@jean2/client 0.6.8 → 0.7.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.
@@ -0,0 +1,630 @@
1
+ function L4(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(t,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function rf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rm={exports:{}},nc={};/**
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 Cb;function I4(){if(Cb)return nc;Cb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,l){var c=null;if(l!==void 0&&(c=""+l),i.key!==void 0&&(c=""+i.key),"key"in i){l={};for(var a in i)a!=="key"&&(l[a]=i[a])}else l=i;return i=l.ref,{$$typeof:t,type:r,key:c,ref:i!==void 0?i:null,props:l}}return nc.Fragment=e,nc.jsx=n,nc.jsxs=n,nc}var kb;function P4(){return kb||(kb=1,rm.exports=I4()),rm.exports}var h=P4(),sm={exports:{}},at={};/**
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 Eb;function z4(){if(Eb)return at;Eb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function _(P){return P===null||typeof P!="object"?null:(P=g&&P[g]||P["@@iterator"],typeof P=="function"?P:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,y={};function S(P,F,B){this.props=P,this.context=F,this.refs=y,this.updater=B||C}S.prototype.isReactComponent={},S.prototype.setState=function(P,F){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,F,"setState")},S.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function b(){}b.prototype=S.prototype;function x(P,F,B){this.props=P,this.context=F,this.refs=y,this.updater=B||C}var k=x.prototype=new b;k.constructor=x,w(k,S.prototype),k.isPureReactComponent=!0;var j=Array.isArray;function N(){}var D={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function O(P,F,B){var Q=B.ref;return{$$typeof:t,type:P,key:F,ref:Q!==void 0?Q:null,props:B}}function L(P,F){return O(P.type,F,P.props)}function z(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function H(P){var F={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(B){return F[B]})}var $=/\/+/g;function q(P,F){return typeof P=="object"&&P!==null&&P.key!=null?H(""+P.key):F.toString(36)}function G(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(N,N):(P.status="pending",P.then(function(F){P.status==="pending"&&(P.status="fulfilled",P.value=F)},function(F){P.status==="pending"&&(P.status="rejected",P.reason=F)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function W(P,F,B,Q,J){var ee=typeof P;(ee==="undefined"||ee==="boolean")&&(P=null);var K=!1;if(P===null)K=!0;else switch(ee){case"bigint":case"string":case"number":K=!0;break;case"object":switch(P.$$typeof){case t:case e:K=!0;break;case m:return K=P._init,W(K(P._payload),F,B,Q,J)}}if(K)return J=J(P),K=Q===""?"."+q(P,0):Q,j(J)?(B="",K!=null&&(B=K.replace($,"$&/")+"/"),W(J,F,B,"",function(re){return re})):J!=null&&(z(J)&&(J=L(J,B+(J.key==null||P&&P.key===J.key?"":(""+J.key).replace($,"$&/")+"/")+K)),F.push(J)),1;K=0;var V=Q===""?".":Q+":";if(j(P))for(var te=0;te<P.length;te++)Q=P[te],ee=V+q(Q,te),K+=W(Q,F,B,ee,J);else if(te=_(P),typeof te=="function")for(P=te.call(P),te=0;!(Q=P.next()).done;)Q=Q.value,ee=V+q(Q,te++),K+=W(Q,F,B,ee,J);else if(ee==="object"){if(typeof P.then=="function")return W(G(P),F,B,Q,J);throw F=String(P),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return K}function X(P,F,B){if(P==null)return P;var Q=[],J=0;return W(P,Q,"","",function(ee){return F.call(B,ee,J++)}),Q}function Y(P){if(P._status===-1){var F=P._result;F=F(),F.then(function(B){(P._status===0||P._status===-1)&&(P._status=1,P._result=B)},function(B){(P._status===0||P._status===-1)&&(P._status=2,P._result=B)}),P._status===-1&&(P._status=0,P._result=F)}if(P._status===1)return P._result.default;throw P._result}var I=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},M={map:X,forEach:function(P,F,B){X(P,function(){F.apply(this,arguments)},B)},count:function(P){var F=0;return X(P,function(){F++}),F},toArray:function(P){return X(P,function(F){return F})||[]},only:function(P){if(!z(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return at.Activity=p,at.Children=M,at.Component=S,at.Fragment=n,at.Profiler=i,at.PureComponent=x,at.StrictMode=r,at.Suspense=u,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,at.__COMPILER_RUNTIME={__proto__:null,c:function(P){return D.H.useMemoCache(P)}},at.cache=function(P){return function(){return P.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(P,F,B){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var Q=w({},P.props),J=P.key;if(F!=null)for(ee in F.key!==void 0&&(J=""+F.key),F)!E.call(F,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&F.ref===void 0||(Q[ee]=F[ee]);var ee=arguments.length-2;if(ee===1)Q.children=B;else if(1<ee){for(var K=Array(ee),V=0;V<ee;V++)K[V]=arguments[V+2];Q.children=K}return O(P.type,J,Q)},at.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:l,_context:P},P},at.createElement=function(P,F,B){var Q,J={},ee=null;if(F!=null)for(Q in F.key!==void 0&&(ee=""+F.key),F)E.call(F,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(J[Q]=F[Q]);var K=arguments.length-2;if(K===1)J.children=B;else if(1<K){for(var V=Array(K),te=0;te<K;te++)V[te]=arguments[te+2];J.children=V}if(P&&P.defaultProps)for(Q in K=P.defaultProps,K)J[Q]===void 0&&(J[Q]=K[Q]);return O(P,ee,J)},at.createRef=function(){return{current:null}},at.forwardRef=function(P){return{$$typeof:a,render:P}},at.isValidElement=z,at.lazy=function(P){return{$$typeof:m,_payload:{_status:-1,_result:P},_init:Y}},at.memo=function(P,F){return{$$typeof:d,type:P,compare:F===void 0?null:F}},at.startTransition=function(P){var F=D.T,B={};D.T=B;try{var Q=P(),J=D.S;J!==null&&J(B,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(N,I)}catch(ee){I(ee)}finally{F!==null&&B.types!==null&&(F.types=B.types),D.T=F}},at.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},at.use=function(P){return D.H.use(P)},at.useActionState=function(P,F,B){return D.H.useActionState(P,F,B)},at.useCallback=function(P,F){return D.H.useCallback(P,F)},at.useContext=function(P){return D.H.useContext(P)},at.useDebugValue=function(){},at.useDeferredValue=function(P,F){return D.H.useDeferredValue(P,F)},at.useEffect=function(P,F){return D.H.useEffect(P,F)},at.useEffectEvent=function(P){return D.H.useEffectEvent(P)},at.useId=function(){return D.H.useId()},at.useImperativeHandle=function(P,F,B){return D.H.useImperativeHandle(P,F,B)},at.useInsertionEffect=function(P,F){return D.H.useInsertionEffect(P,F)},at.useLayoutEffect=function(P,F){return D.H.useLayoutEffect(P,F)},at.useMemo=function(P,F){return D.H.useMemo(P,F)},at.useOptimistic=function(P,F){return D.H.useOptimistic(P,F)},at.useReducer=function(P,F,B){return D.H.useReducer(P,F,B)},at.useRef=function(P){return D.H.useRef(P)},at.useState=function(P){return D.H.useState(P)},at.useSyncExternalStore=function(P,F,B){return D.H.useSyncExternalStore(P,F,B)},at.useTransition=function(){return D.H.useTransition()},at.version="19.2.4",at}var Ab;function sf(){return Ab||(Ab=1,sm.exports=z4()),sm.exports}var R=sf();const In=rf(R),lS=L4({__proto__:null,default:In},[R]);var im={exports:{}},rc={},om={exports:{}},am={};/**
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 Nb;function B4(){return Nb||(Nb=1,(function(t){function e(W,X){var Y=W.length;W.push(X);e:for(;0<Y;){var I=Y-1>>>1,M=W[I];if(0<i(M,X))W[I]=X,W[Y]=M,Y=I;else break e}}function n(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var X=W[0],Y=W.pop();if(Y!==X){W[0]=Y;e:for(var I=0,M=W.length,P=M>>>1;I<P;){var F=2*(I+1)-1,B=W[F],Q=F+1,J=W[Q];if(0>i(B,Y))Q<M&&0>i(J,B)?(W[I]=J,W[Q]=Y,I=Q):(W[I]=B,W[F]=Y,I=F);else if(Q<M&&0>i(J,Y))W[I]=J,W[Q]=Y,I=Q;else break e}}return X}function i(W,X){var Y=W.sortIndex-X.sortIndex;return Y!==0?Y:W.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var c=Date,a=c.now();t.unstable_now=function(){return c.now()-a}}var u=[],d=[],m=1,p=null,g=3,_=!1,C=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function k(W){for(var X=n(d);X!==null;){if(X.callback===null)r(d);else if(X.startTime<=W)r(d),X.sortIndex=X.expirationTime,e(u,X);else break;X=n(d)}}function j(W){if(w=!1,k(W),!C)if(n(u)!==null)C=!0,N||(N=!0,H());else{var X=n(d);X!==null&&G(j,X.startTime-W)}}var N=!1,D=-1,E=5,O=-1;function L(){return y?!0:!(t.unstable_now()-O<E)}function z(){if(y=!1,N){var W=t.unstable_now();O=W;var X=!0;try{e:{C=!1,w&&(w=!1,b(D),D=-1),_=!0;var Y=g;try{t:{for(k(W),p=n(u);p!==null&&!(p.expirationTime>W&&L());){var I=p.callback;if(typeof I=="function"){p.callback=null,g=p.priorityLevel;var M=I(p.expirationTime<=W);if(W=t.unstable_now(),typeof M=="function"){p.callback=M,k(W),X=!0;break t}p===n(u)&&r(u),k(W)}else r(u);p=n(u)}if(p!==null)X=!0;else{var P=n(d);P!==null&&G(j,P.startTime-W),X=!1}}break e}finally{p=null,g=Y,_=!1}X=void 0}}finally{X?H():N=!1}}}var H;if(typeof x=="function")H=function(){x(z)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,q=$.port2;$.port1.onmessage=z,H=function(){q.postMessage(null)}}else H=function(){S(z,0)};function G(W,X){D=S(function(){W(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(W){W.callback=null},t.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<W?Math.floor(1e3/W):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(W){switch(g){case 1:case 2:case 3:var X=3;break;default:X=g}var Y=g;g=X;try{return W()}finally{g=Y}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(W,X){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Y=g;g=W;try{return X()}finally{g=Y}},t.unstable_scheduleCallback=function(W,X,Y){var I=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?I+Y:I):Y=I,W){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=Y+M,W={id:m++,callback:X,priorityLevel:W,startTime:Y,expirationTime:M,sortIndex:-1},Y>I?(W.sortIndex=Y,e(d,W),n(u)===null&&W===n(d)&&(w?(b(D),D=-1):w=!0,G(j,Y-I))):(W.sortIndex=M,e(u,W),C||_||(C=!0,N||(N=!0,H()))),W},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(W){var X=g;return function(){var Y=g;g=X;try{return W.apply(this,arguments)}finally{g=Y}}}})(am)),am}var Rb;function F4(){return Rb||(Rb=1,om.exports=B4()),om.exports}var lm={exports:{}},$n={};/**
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 jb;function H4(){if(jb)return $n;jb=1;var t=sf();function e(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(u,d,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:u,containerInfo:d,implementation:m}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return $n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$n.createPortal=function(u,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return l(u,d,null,m)},$n.flushSync=function(u){var d=c.T,m=r.p;try{if(c.T=null,r.p=2,u)return u()}finally{c.T=d,r.p=m,r.d.f()}},$n.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},$n.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},$n.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var m=d.as,p=a(m,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,_=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:_}):m==="script"&&r.d.X(u,{crossOrigin:p,integrity:g,fetchPriority:_,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},$n.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=a(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},$n.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,p=a(m,d.crossOrigin);r.d.L(u,m,{crossOrigin:p,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})}},$n.preloadModule=function(u,d){if(typeof u=="string")if(d){var m=a(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},$n.requestFormReset=function(u){r.d.r(u)},$n.unstable_batchedUpdates=function(u,d){return u(d)},$n.useFormState=function(u,d,m){return c.H.useFormState(u,d,m)},$n.useFormStatus=function(){return c.H.useHostTransitionStatus()},$n.version="19.2.4",$n}var Tb;function cS(){if(Tb)return lm.exports;Tb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),lm.exports=H4(),lm.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 Db;function $4(){if(Db)return rc;Db=1;var t=F4(),e=sf(),n=cS();function r(s){var o="https://react.dev/errors/"+s;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+s+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function l(s){var o=s,f=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,(o.flags&4098)!==0&&(f=o.return),s=o.return;while(s)}return o.tag===3?f:null}function c(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function a(s){if(s.tag===31){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function u(s){if(l(s)!==s)throw Error(r(188))}function d(s){var o=s.alternate;if(!o){if(o=l(s),o===null)throw Error(r(188));return o!==s?null:s}for(var f=s,v=o;;){var A=f.return;if(A===null)break;var T=A.alternate;if(T===null){if(v=A.return,v!==null){f=v;continue}break}if(A.child===T.child){for(T=A.child;T;){if(T===f)return u(A),s;if(T===v)return u(A),o;T=T.sibling}throw Error(r(188))}if(f.return!==v.return)f=A,v=T;else{for(var U=!1,Z=A.child;Z;){if(Z===f){U=!0,f=A,v=T;break}if(Z===v){U=!0,v=A,f=T;break}Z=Z.sibling}if(!U){for(Z=T.child;Z;){if(Z===f){U=!0,f=T,v=A;break}if(Z===v){U=!0,v=T,f=A;break}Z=Z.sibling}if(!U)throw Error(r(189))}}if(f.alternate!==v)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?s:o}function m(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s;for(s=s.child;s!==null;){if(o=m(s),o!==null)return o;s=s.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),x=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function H(s){return s===null||typeof s!="object"?null:(s=z&&s[z]||s["@@iterator"],typeof s=="function"?s:null)}var $=Symbol.for("react.client.reference");function q(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===$?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case S:return"Profiler";case y:return"StrictMode";case j:return"Suspense";case N:return"SuspenseList";case O:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case C:return"Portal";case x:return s.displayName||"Context";case b:return(s._context.displayName||"Context")+".Consumer";case k:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return o=s.displayName||null,o!==null?o:q(s.type)||"Memo";case E:o=s._payload,s=s._init;try{return q(s(o))}catch{}}return null}var G=Array.isArray,W=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},I=[],M=-1;function P(s){return{current:s}}function F(s){0>M||(s.current=I[M],I[M]=null,M--)}function B(s,o){M++,I[M]=s.current,s.current=o}var Q=P(null),J=P(null),ee=P(null),K=P(null);function V(s,o){switch(B(ee,o),B(J,s),B(Q,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?Gy(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=Gy(o),s=Ky(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}F(Q),B(Q,s)}function te(){F(Q),F(J),F(ee)}function re(s){s.memoizedState!==null&&B(K,s);var o=Q.current,f=Ky(o,s.type);o!==f&&(B(J,s),B(Q,f))}function ae(s){J.current===s&&(F(Q),F(J)),K.current===s&&(F(K),Zl._currentValue=Y)}var se,_e;function Ee(s){if(se===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);se=o&&o[1]||"",_e=-1<f.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+se+s+_e}var De=!1;function Ue(s,o){if(!s||De)return"";De=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(o){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(ve){var pe=ve}Reflect.construct(s,[],Ce)}else{try{Ce.call()}catch(ve){pe=ve}s.call(Ce.prototype)}}else{try{throw Error()}catch(ve){pe=ve}(Ce=s())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(ve){if(ve&&pe&&typeof ve.stack=="string")return[ve.stack,pe.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var A=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");A&&A.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=v.DetermineComponentFrameRoot(),U=T[0],Z=T[1];if(U&&Z){var ne=U.split(`
44
+ `),fe=Z.split(`
45
+ `);for(A=v=0;v<ne.length&&!ne[v].includes("DetermineComponentFrameRoot");)v++;for(;A<fe.length&&!fe[A].includes("DetermineComponentFrameRoot");)A++;if(v===ne.length||A===fe.length)for(v=ne.length-1,A=fe.length-1;1<=v&&0<=A&&ne[v]!==fe[A];)A--;for(;1<=v&&0<=A;v--,A--)if(ne[v]!==fe[A]){if(v!==1||A!==1)do if(v--,A--,0>A||ne[v]!==fe[A]){var xe=`
46
+ `+ne[v].replace(" at new "," at ");return s.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",s.displayName)),xe}while(1<=v&&0<=A);break}}}finally{De=!1,Error.prepareStackTrace=f}return(f=s?s.displayName||s.name:"")?Ee(f):""}function ce(s,o){switch(s.tag){case 26:case 27:case 5:return Ee(s.type);case 16:return Ee("Lazy");case 13:return s.child!==o&&o!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Ue(s.type,!1);case 11:return Ue(s.type.render,!1);case 1:return Ue(s.type,!0);case 31:return Ee("Activity");default:return""}}function je(s){try{var o="",f=null;do o+=ce(s,f),f=s,s=s.return;while(s);return o}catch(v){return`
47
+ Error generating stack: `+v.message+`
48
+ `+v.stack}}var be=Object.prototype.hasOwnProperty,Ve=t.unstable_scheduleCallback,qe=t.unstable_cancelCallback,ye=t.unstable_shouldYield,Me=t.unstable_requestPaint,Re=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,oe=t.unstable_ImmediatePriority,me=t.unstable_UserBlockingPriority,Ne=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Ge=t.unstable_IdlePriority,Ke=t.log,Je=t.unstable_setDisableYieldValue,lt=null,Be=null;function We(s){if(typeof Ke=="function"&&Je(s),Be&&typeof Be.setStrictMode=="function")try{Be.setStrictMode(lt,s)}catch{}}var ze=Math.clz32?Math.clz32:mn,rt=Math.log,kt=Math.LN2;function mn(s){return s>>>=0,s===0?32:31-(rt(s)/kt|0)|0}var gn=256,Zt=262144,rn=4194304;function Jt(s){var o=s&42;if(o!==0)return o;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function ge(s,o,f){var v=s.pendingLanes;if(v===0)return 0;var A=0,T=s.suspendedLanes,U=s.pingedLanes;s=s.warmLanes;var Z=v&134217727;return Z!==0?(v=Z&~T,v!==0?A=Jt(v):(U&=Z,U!==0?A=Jt(U):f||(f=Z&~s,f!==0&&(A=Jt(f))))):(Z=v&~T,Z!==0?A=Jt(Z):U!==0?A=Jt(U):f||(f=v&~s,f!==0&&(A=Jt(f)))),A===0?0:o!==0&&o!==A&&(o&T)===0&&(T=A&-A,f=o&-o,T>=f||T===32&&(f&4194048)!==0)?o:A}function He(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function tt(s,o){switch(s){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Oe(){var s=rn;return rn<<=1,(rn&62914560)===0&&(rn=4194304),s}function Ie(s){for(var o=[],f=0;31>f;f++)o.push(s);return o}function ot(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Tt(s,o,f,v,A,T){var U=s.pendingLanes;s.pendingLanes=f,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=f,s.entangledLanes&=f,s.errorRecoveryDisabledLanes&=f,s.shellSuspendCounter=0;var Z=s.entanglements,ne=s.expirationTimes,fe=s.hiddenUpdates;for(f=U&~f;0<f;){var xe=31-ze(f),Ce=1<<xe;Z[xe]=0,ne[xe]=-1;var pe=fe[xe];if(pe!==null)for(fe[xe]=null,xe=0;xe<pe.length;xe++){var ve=pe[xe];ve!==null&&(ve.lane&=-536870913)}f&=~Ce}v!==0&&Gt(s,v,0),T!==0&&A===0&&s.tag!==0&&(s.suspendedLanes|=T&~(U&~o))}function Gt(s,o,f){s.pendingLanes|=o,s.suspendedLanes&=~o;var v=31-ze(o);s.entangledLanes|=o,s.entanglements[v]=s.entanglements[v]|1073741824|f&261930}function Kt(s,o){var f=s.entangledLanes|=o;for(s=s.entanglements;f;){var v=31-ze(f),A=1<<v;A&o|s[v]&o&&(s[v]|=o),f&=~A}}function lr(s,o){var f=o&-o;return f=(f&42)!==0?1:An(f),(f&(s.suspendedLanes|o))!==0?0:f}function An(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function vn(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Nn(){var s=X.p;return s!==0?s:(s=window.event,s===void 0?32:vb(s.type))}function Rn(s,o){var f=X.p;try{return X.p=s,o()}finally{X.p=f}}var Mt=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Mt,Dt="__reactProps$"+Mt,jn="__reactContainer$"+Mt,bs="__reactEvents$"+Mt,Zs="__reactListeners$"+Mt,Js="__reactHandles$"+Mt,xs="__reactResources$"+Mt,kr="__reactMarker$"+Mt;function Er(s){delete s[Nt],delete s[Dt],delete s[bs],delete s[Zs],delete s[Js]}function Bn(s){var o=s[Nt];if(o)return o;for(var f=s.parentNode;f;){if(o=f[jn]||f[Nt]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(s=tb(s);s!==null;){if(f=s[Nt])return f;s=tb(s)}return o}s=f,f=s.parentNode}return null}function Wn(s){if(s=s[Nt]||s[jn]){var o=s.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return s}return null}function Gn(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s.stateNode;throw Error(r(33))}function wn(s){var o=s[xs];return o||(o=s[xs]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function en(s){s[kr]=!0}var Ur=new Set,_s={};function Zn(s,o){cr(s,o),cr(s+"Capture",o)}function cr(s,o){for(_s[s]=o,s=0;s<o.length;s++)Ur.add(o[s])}var rs=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]*$"),Jn={},ur={};function ul(s){return be.call(ur,s)?!0:be.call(Jn,s)?!1:rs.test(s)?ur[s]=!0:(Jn[s]=!0,!1)}function dr(s,o,f){if(ul(o))if(f===null)s.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":s.removeAttribute(o);return;case"boolean":var v=o.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){s.removeAttribute(o);return}}s.setAttribute(o,""+f)}}function Ar(s,o,f){if(f===null)s.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttribute(o,""+f)}}function yn(s,o,f,v){if(v===null)s.removeAttribute(f);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(f);return}s.setAttributeNS(o,f,""+v)}}function Tn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Vr(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Xc(s,o,f){var v=Object.getOwnPropertyDescriptor(s.constructor.prototype,o);if(!s.hasOwnProperty(o)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var A=v.get,T=v.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return A.call(this)},set:function(U){f=""+U,T.call(this,U)}}),Object.defineProperty(s,o,{enumerable:v.enumerable}),{getValue:function(){return f},setValue:function(U){f=""+U},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function qo(s){if(!s._valueTracker){var o=Vr(s)?"checked":"value";s._valueTracker=Xc(s,o,""+s[o])}}function dl(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var f=o.getValue(),v="";return s&&(v=Vr(s)?s.checked?"true":"false":s.value),s=v,s!==f?(o.setValue(s),!0):!1}function Ss(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Qc=/[\n"\\]/g;function Fn(s){return s.replace(Qc,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Wo(s,o,f,v,A,T,U,Z){s.name="",U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?s.type=U:s.removeAttribute("type"),o!=null?U==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+Tn(o)):s.value!==""+Tn(o)&&(s.value=""+Tn(o)):U!=="submit"&&U!=="reset"||s.removeAttribute("value"),o!=null?Yt(s,U,Tn(o)):f!=null?Yt(s,U,Tn(f)):v!=null&&s.removeAttribute("value"),A==null&&T!=null&&(s.defaultChecked=!!T),A!=null&&(s.checked=A&&typeof A!="function"&&typeof A!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?s.name=""+Tn(Z):s.removeAttribute("name")}function Zc(s,o,f,v,A,T,U,Z){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.type=T),o!=null||f!=null){if(!(T!=="submit"&&T!=="reset"||o!=null)){qo(s);return}f=f!=null?""+Tn(f):"",o=o!=null?""+Tn(o):f,Z||o===s.value||(s.value=o),s.defaultValue=o}v=v!=null?v:A,v=typeof v!="function"&&typeof v!="symbol"&&!!v,s.checked=Z?s.checked:!!v,s.defaultChecked=!!v,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(s.name=U),qo(s)}function Yt(s,o,f){o==="number"&&Ss(s.ownerDocument)===s||s.defaultValue===""+f||(s.defaultValue=""+f)}function It(s,o,f,v){if(s=s.options,o){o={};for(var A=0;A<f.length;A++)o["$"+f[A]]=!0;for(f=0;f<s.length;f++)A=o.hasOwnProperty("$"+s[f].value),s[f].selected!==A&&(s[f].selected=A),A&&v&&(s[f].defaultSelected=!0)}else{for(f=""+Tn(f),o=null,A=0;A<s.length;A++){if(s[A].value===f){s[A].selected=!0,v&&(s[A].defaultSelected=!0);return}o!==null||s[A].disabled||(o=s[A])}o!==null&&(o.selected=!0)}}function Ji(s,o,f){if(o!=null&&(o=""+Tn(o),o!==s.value&&(s.value=o),f==null)){s.defaultValue!==o&&(s.defaultValue=o);return}s.defaultValue=f!=null?""+Tn(f):""}function Go(s,o,f,v){if(o==null){if(v!=null){if(f!=null)throw Error(r(92));if(G(v)){if(1<v.length)throw Error(r(93));v=v[0]}f=v}f==null&&(f=""),o=f}f=Tn(o),s.defaultValue=f,v=s.textContent,v===f&&v!==""&&v!==null&&(s.value=v),qo(s)}function ei(s,o){if(o){var f=s.firstChild;if(f&&f===s.lastChild&&f.nodeType===3){f.nodeValue=o;return}}s.textContent=o}var th=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 ti(s,o,f){var v=o.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?v?s.setProperty(o,""):o==="float"?s.cssFloat="":s[o]="":v?s.setProperty(o,f):typeof f!="number"||f===0||th.has(o)?o==="float"?s.cssFloat=f:s[o]=(""+f).trim():s[o]=f+"px"}function Jc(s,o,f){if(o!=null&&typeof o!="object")throw Error(r(62));if(s=s.style,f!=null){for(var v in f)!f.hasOwnProperty(v)||o!=null&&o.hasOwnProperty(v)||(v.indexOf("--")===0?s.setProperty(v,""):v==="float"?s.cssFloat="":s[v]="");for(var A in o)v=o[A],o.hasOwnProperty(A)&&f[A]!==v&&ti(s,A,v)}else for(var T in o)o.hasOwnProperty(T)&&ti(s,T,o[T])}function ni(s){if(s.indexOf("-")===-1)return!1;switch(s){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 ri=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"]]),nh=/^[\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 eo(s){return nh.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function qr(){}var fl=null;function hl(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var si=null,ii=null;function oi(s){var o=Wn(s);if(o&&(s=o.stateNode)){var f=s[Dt]||null;e:switch(s=o.stateNode,o.type){case"input":if(Wo(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),o=f.name,f.type==="radio"&&o!=null){for(f=s;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Fn(""+o)+'"][type="radio"]'),o=0;o<f.length;o++){var v=f[o];if(v!==s&&v.form===s.form){var A=v[Dt]||null;if(!A)throw Error(r(90));Wo(v,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name)}}for(o=0;o<f.length;o++)v=f[o],v.form===s.form&&dl(v)}break e;case"textarea":Ji(s,f.value,f.defaultValue);break e;case"select":o=f.value,o!=null&&It(s,!!f.multiple,o,!1)}}}var Ko=!1;function to(s,o,f){if(Ko)return s(o,f);Ko=!0;try{var v=s(o);return v}finally{if(Ko=!1,(si!==null||ii!==null)&&(Vu(),si&&(o=si,s=ii,ii=si=null,oi(o),s)))for(o=0;o<s.length;o++)oi(s[o])}}function ai(s,o){var f=s.stateNode;if(f===null)return null;var v=f[Dt]||null;if(v===null)return null;f=v[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(s=s.type,v=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!v;break e;default:s=!1}if(s)return null;if(f&&typeof f!="function")throw Error(r(231,o,typeof f));return f}var Nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yo=!1;if(Nr)try{var no={};Object.defineProperty(no,"passive",{get:function(){Yo=!0}}),window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{Yo=!1}var ss=null,pl=null,ro=null;function eu(){if(ro)return ro;var s,o=pl,f=o.length,v,A="value"in ss?ss.value:ss.textContent,T=A.length;for(s=0;s<f&&o[s]===A[s];s++);var U=f-s;for(v=1;v<=U&&o[f-v]===A[T-v];v++);return ro=A.slice(s,1<v?1-v:void 0)}function Xo(s){var o=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&o===13&&(s=13)):s=o,s===10&&(s=13),32<=s||s===13?s:0}function Qo(){return!0}function tu(){return!1}function Hn(s){function o(f,v,A,T,U){this._reactName=f,this._targetInst=A,this.type=v,this.nativeEvent=T,this.target=U,this.currentTarget=null;for(var Z in s)s.hasOwnProperty(Z)&&(f=s[Z],this[Z]=f?f(T):T[Z]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Qo:tu,this.isPropagationStopped=tu,this}return p(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Qo)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),o}var ws={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},so=Hn(ws),io=p({},ws,{view:0,detail:0}),rh=Hn(io),ml,gl,oo,Zo=p({},io,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ft,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==oo&&(oo&&s.type==="mousemove"?(ml=s.screenX-oo.screenX,gl=s.screenY-oo.screenY):gl=ml=0,oo=s),ml)},movementY:function(s){return"movementY"in s?s.movementY:gl}}),nu=Hn(Zo),sh=p({},Zo,{dataTransfer:0}),ih=Hn(sh),oh=p({},io,{relatedTarget:0}),Jo=Hn(oh),ah=p({},ws,{animationName:0,elapsedTime:0,pseudoElement:0}),ru=Hn(ah),lh=p({},ws,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),li=Hn(lh),su=p({},ws,{data:0}),vl=Hn(su),iu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ou={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"},au={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function de(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=au[s])?!!o[s]:!1}function ft(){return de}var Ht=p({},io,{key:function(s){if(s.key){var o=iu[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=Xo(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?ou[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ft,charCode:function(s){return s.type==="keypress"?Xo(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Xo(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),_t=Hn(Ht),nn=p({},Zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),St=Hn(nn),Rt=p({},io,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ft}),ao=Hn(Rt),yl=p({},ws,{propertyName:0,elapsedTime:0,pseudoElement:0}),lo=Hn(yl),lu=p({},Zo,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),e3=Hn(lu),t3=p({},ws,{newState:0,oldState:0}),n3=Hn(t3),r3=[9,13,27,32],ch=Nr&&"CompositionEvent"in window,bl=null;Nr&&"documentMode"in document&&(bl=document.documentMode);var s3=Nr&&"TextEvent"in window&&!bl,Jv=Nr&&(!ch||bl&&8<bl&&11>=bl),e1=" ",t1=!1;function n1(s,o){switch(s){case"keyup":return r3.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r1(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ea=!1;function i3(s,o){switch(s){case"compositionend":return r1(o);case"keypress":return o.which!==32?null:(t1=!0,e1);case"textInput":return s=o.data,s===e1&&t1?null:s;default:return null}}function o3(s,o){if(ea)return s==="compositionend"||!ch&&n1(s,o)?(s=eu(),ro=pl=ss=null,ea=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Jv&&o.locale!=="ko"?null:o.data;default:return null}}var a3={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 s1(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!a3[s.type]:o==="textarea"}function i1(s,o,f,v){si?ii?ii.push(v):ii=[v]:si=v,o=Qu(o,"onChange"),0<o.length&&(f=new so("onChange","change",null,f,v),s.push({event:f,listeners:o}))}var xl=null,_l=null;function l3(s){Hy(s,0)}function cu(s){var o=Gn(s);if(dl(o))return s}function o1(s,o){if(s==="change")return o}var a1=!1;if(Nr){var uh;if(Nr){var dh="oninput"in document;if(!dh){var l1=document.createElement("div");l1.setAttribute("oninput","return;"),dh=typeof l1.oninput=="function"}uh=dh}else uh=!1;a1=uh&&(!document.documentMode||9<document.documentMode)}function c1(){xl&&(xl.detachEvent("onpropertychange",u1),_l=xl=null)}function u1(s){if(s.propertyName==="value"&&cu(_l)){var o=[];i1(o,_l,s,hl(s)),to(l3,o)}}function c3(s,o,f){s==="focusin"?(c1(),xl=o,_l=f,xl.attachEvent("onpropertychange",u1)):s==="focusout"&&c1()}function u3(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return cu(_l)}function d3(s,o){if(s==="click")return cu(o)}function f3(s,o){if(s==="input"||s==="change")return cu(o)}function h3(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var fr=typeof Object.is=="function"?Object.is:h3;function Sl(s,o){if(fr(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var f=Object.keys(s),v=Object.keys(o);if(f.length!==v.length)return!1;for(v=0;v<f.length;v++){var A=f[v];if(!be.call(o,A)||!fr(s[A],o[A]))return!1}return!0}function d1(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function f1(s,o){var f=d1(s);s=0;for(var v;f;){if(f.nodeType===3){if(v=s+f.textContent.length,s<=o&&v>=o)return{node:f,offset:o-s};s=v}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=d1(f)}}function h1(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?h1(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function p1(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=Ss(s.document);o instanceof s.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)s=o.contentWindow;else break;o=Ss(s.document)}return o}function fh(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var p3=Nr&&"documentMode"in document&&11>=document.documentMode,ta=null,hh=null,wl=null,ph=!1;function m1(s,o,f){var v=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;ph||ta==null||ta!==Ss(v)||(v=ta,"selectionStart"in v&&fh(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),wl&&Sl(wl,v)||(wl=v,v=Qu(hh,"onSelect"),0<v.length&&(o=new so("onSelect","select",null,o,f),s.push({event:o,listeners:v}),o.target=ta)))}function co(s,o){var f={};return f[s.toLowerCase()]=o.toLowerCase(),f["Webkit"+s]="webkit"+o,f["Moz"+s]="moz"+o,f}var na={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionrun:co("Transition","TransitionRun"),transitionstart:co("Transition","TransitionStart"),transitioncancel:co("Transition","TransitionCancel"),transitionend:co("Transition","TransitionEnd")},mh={},g1={};Nr&&(g1=document.createElement("div").style,"AnimationEvent"in window||(delete na.animationend.animation,delete na.animationiteration.animation,delete na.animationstart.animation),"TransitionEvent"in window||delete na.transitionend.transition);function uo(s){if(mh[s])return mh[s];if(!na[s])return s;var o=na[s],f;for(f in o)if(o.hasOwnProperty(f)&&f in g1)return mh[s]=o[f];return s}var v1=uo("animationend"),y1=uo("animationiteration"),b1=uo("animationstart"),m3=uo("transitionrun"),g3=uo("transitionstart"),v3=uo("transitioncancel"),x1=uo("transitionend"),_1=new Map,gh="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(" ");gh.push("scrollEnd");function Wr(s,o){_1.set(s,o),Zn(o,[s])}var uu=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Rr=[],ra=0,vh=0;function du(){for(var s=ra,o=vh=ra=0;o<s;){var f=Rr[o];Rr[o++]=null;var v=Rr[o];Rr[o++]=null;var A=Rr[o];Rr[o++]=null;var T=Rr[o];if(Rr[o++]=null,v!==null&&A!==null){var U=v.pending;U===null?A.next=A:(A.next=U.next,U.next=A),v.pending=A}T!==0&&S1(f,A,T)}}function fu(s,o,f,v){Rr[ra++]=s,Rr[ra++]=o,Rr[ra++]=f,Rr[ra++]=v,vh|=v,s.lanes|=v,s=s.alternate,s!==null&&(s.lanes|=v)}function yh(s,o,f,v){return fu(s,o,f,v),hu(s)}function fo(s,o){return fu(s,null,null,o),hu(s)}function S1(s,o,f){s.lanes|=f;var v=s.alternate;v!==null&&(v.lanes|=f);for(var A=!1,T=s.return;T!==null;)T.childLanes|=f,v=T.alternate,v!==null&&(v.childLanes|=f),T.tag===22&&(s=T.stateNode,s===null||s._visibility&1||(A=!0)),s=T,T=T.return;return s.tag===3?(T=s.stateNode,A&&o!==null&&(A=31-ze(f),s=T.hiddenUpdates,v=s[A],v===null?s[A]=[o]:v.push(o),o.lane=f|536870912),T):null}function hu(s){if(50<ql)throw ql=0,Ap=null,Error(r(185));for(var o=s.return;o!==null;)s=o,o=s.return;return s.tag===3?s.stateNode:null}var sa={};function y3(s,o,f,v){this.tag=s,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hr(s,o,f,v){return new y3(s,o,f,v)}function bh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Cs(s,o){var f=s.alternate;return f===null?(f=hr(s.tag,o,s.key,s.mode),f.elementType=s.elementType,f.type=s.type,f.stateNode=s.stateNode,f.alternate=s,s.alternate=f):(f.pendingProps=o,f.type=s.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=s.flags&65011712,f.childLanes=s.childLanes,f.lanes=s.lanes,f.child=s.child,f.memoizedProps=s.memoizedProps,f.memoizedState=s.memoizedState,f.updateQueue=s.updateQueue,o=s.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=s.sibling,f.index=s.index,f.ref=s.ref,f.refCleanup=s.refCleanup,f}function w1(s,o){s.flags&=65011714;var f=s.alternate;return f===null?(s.childLanes=0,s.lanes=o,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=f.childLanes,s.lanes=f.lanes,s.child=f.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=f.memoizedProps,s.memoizedState=f.memoizedState,s.updateQueue=f.updateQueue,s.type=f.type,o=f.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),s}function pu(s,o,f,v,A,T){var U=0;if(v=s,typeof s=="function")bh(s)&&(U=1);else if(typeof s=="string")U=w4(s,f,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case O:return s=hr(31,f,o,A),s.elementType=O,s.lanes=T,s;case w:return ho(f.children,A,T,o);case y:U=8,A|=24;break;case S:return s=hr(12,f,o,A|2),s.elementType=S,s.lanes=T,s;case j:return s=hr(13,f,o,A),s.elementType=j,s.lanes=T,s;case N:return s=hr(19,f,o,A),s.elementType=N,s.lanes=T,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case x:U=10;break e;case b:U=9;break e;case k:U=11;break e;case D:U=14;break e;case E:U=16,v=null;break e}U=29,f=Error(r(130,s===null?"null":typeof s,"")),v=null}return o=hr(U,f,o,A),o.elementType=s,o.type=v,o.lanes=T,o}function ho(s,o,f,v){return s=hr(7,s,v,o),s.lanes=f,s}function xh(s,o,f){return s=hr(6,s,null,o),s.lanes=f,s}function C1(s){var o=hr(18,null,null,0);return o.stateNode=s,o}function _h(s,o,f){return o=hr(4,s.children!==null?s.children:[],s.key,o),o.lanes=f,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}var k1=new WeakMap;function jr(s,o){if(typeof s=="object"&&s!==null){var f=k1.get(s);return f!==void 0?f:(o={value:s,source:o,stack:je(o)},k1.set(s,o),o)}return{value:s,source:o,stack:je(o)}}var ia=[],oa=0,mu=null,Cl=0,Tr=[],Dr=0,ci=null,is=1,os="";function ks(s,o){ia[oa++]=Cl,ia[oa++]=mu,mu=s,Cl=o}function E1(s,o,f){Tr[Dr++]=is,Tr[Dr++]=os,Tr[Dr++]=ci,ci=s;var v=is;s=os;var A=32-ze(v)-1;v&=~(1<<A),f+=1;var T=32-ze(o)+A;if(30<T){var U=A-A%5;T=(v&(1<<U)-1).toString(32),v>>=U,A-=U,is=1<<32-ze(o)+A|f<<A|v,os=T+s}else is=1<<T|f<<A|v,os=s}function Sh(s){s.return!==null&&(ks(s,1),E1(s,1,0))}function wh(s){for(;s===mu;)mu=ia[--oa],ia[oa]=null,Cl=ia[--oa],ia[oa]=null;for(;s===ci;)ci=Tr[--Dr],Tr[Dr]=null,os=Tr[--Dr],Tr[Dr]=null,is=Tr[--Dr],Tr[Dr]=null}function A1(s,o){Tr[Dr++]=is,Tr[Dr++]=os,Tr[Dr++]=ci,is=o.id,os=o.overflow,ci=s}var Dn=null,Xt=null,wt=!1,ui=null,Mr=!1,Ch=Error(r(519));function di(s){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kl(jr(o,s)),Ch}function N1(s){var o=s.stateNode,f=s.type,v=s.memoizedProps;switch(o[Nt]=s,o[Dt]=v,f){case"dialog":gt("cancel",o),gt("close",o);break;case"iframe":case"object":case"embed":gt("load",o);break;case"video":case"audio":for(f=0;f<Gl.length;f++)gt(Gl[f],o);break;case"source":gt("error",o);break;case"img":case"image":case"link":gt("error",o),gt("load",o);break;case"details":gt("toggle",o);break;case"input":gt("invalid",o),Zc(o,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0);break;case"select":gt("invalid",o);break;case"textarea":gt("invalid",o),Go(o,v.value,v.defaultValue,v.children)}f=v.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||o.textContent===""+f||v.suppressHydrationWarning===!0||qy(o.textContent,f)?(v.popover!=null&&(gt("beforetoggle",o),gt("toggle",o)),v.onScroll!=null&&gt("scroll",o),v.onScrollEnd!=null&&gt("scrollend",o),v.onClick!=null&&(o.onclick=qr),o=!0):o=!1,o||di(s,!0)}function R1(s){for(Dn=s.return;Dn;)switch(Dn.tag){case 5:case 31:case 13:Mr=!1;return;case 27:case 3:Mr=!0;return;default:Dn=Dn.return}}function aa(s){if(s!==Dn)return!1;if(!wt)return R1(s),wt=!0,!1;var o=s.tag,f;if((f=o!==3&&o!==27)&&((f=o===5)&&(f=s.type,f=!(f!=="form"&&f!=="button")||$p(s.type,s.memoizedProps)),f=!f),f&&Xt&&di(s),R1(s),o===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Xt=eb(s)}else if(o===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Xt=eb(s)}else o===27?(o=Xt,ki(s.type)?(s=Gp,Gp=null,Xt=s):Xt=o):Xt=Dn?Lr(s.stateNode.nextSibling):null;return!0}function po(){Xt=Dn=null,wt=!1}function kh(){var s=ui;return s!==null&&(rr===null?rr=s:rr.push.apply(rr,s),ui=null),s}function kl(s){ui===null?ui=[s]:ui.push(s)}var Eh=P(null),mo=null,Es=null;function fi(s,o,f){B(Eh,o._currentValue),o._currentValue=f}function As(s){s._currentValue=Eh.current,F(Eh)}function Ah(s,o,f){for(;s!==null;){var v=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,v!==null&&(v.childLanes|=o)):v!==null&&(v.childLanes&o)!==o&&(v.childLanes|=o),s===f)break;s=s.return}}function Nh(s,o,f,v){var A=s.child;for(A!==null&&(A.return=s);A!==null;){var T=A.dependencies;if(T!==null){var U=A.child;T=T.firstContext;e:for(;T!==null;){var Z=T;T=A;for(var ne=0;ne<o.length;ne++)if(Z.context===o[ne]){T.lanes|=f,Z=T.alternate,Z!==null&&(Z.lanes|=f),Ah(T.return,f,s),v||(U=null);break e}T=Z.next}}else if(A.tag===18){if(U=A.return,U===null)throw Error(r(341));U.lanes|=f,T=U.alternate,T!==null&&(T.lanes|=f),Ah(U,f,s),U=null}else U=A.child;if(U!==null)U.return=A;else for(U=A;U!==null;){if(U===s){U=null;break}if(A=U.sibling,A!==null){A.return=U.return,U=A;break}U=U.return}A=U}}function la(s,o,f,v){s=null;for(var A=o,T=!1;A!==null;){if(!T){if((A.flags&524288)!==0)T=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var U=A.alternate;if(U===null)throw Error(r(387));if(U=U.memoizedProps,U!==null){var Z=A.type;fr(A.pendingProps.value,U.value)||(s!==null?s.push(Z):s=[Z])}}else if(A===K.current){if(U=A.alternate,U===null)throw Error(r(387));U.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(s!==null?s.push(Zl):s=[Zl])}A=A.return}s!==null&&Nh(o,s,f,v),o.flags|=262144}function gu(s){for(s=s.firstContext;s!==null;){if(!fr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function go(s){mo=s,Es=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Mn(s){return j1(mo,s)}function vu(s,o){return mo===null&&go(s),j1(s,o)}function j1(s,o){var f=o._currentValue;if(o={context:o,memoizedValue:f,next:null},Es===null){if(s===null)throw Error(r(308));Es=o,s.dependencies={lanes:0,firstContext:o},s.flags|=524288}else Es=Es.next=o;return f}var b3=typeof AbortController<"u"?AbortController:function(){var s=[],o=this.signal={aborted:!1,addEventListener:function(f,v){s.push(v)}};this.abort=function(){o.aborted=!0,s.forEach(function(f){return f()})}},x3=t.unstable_scheduleCallback,_3=t.unstable_NormalPriority,un={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rh(){return{controller:new b3,data:new Map,refCount:0}}function El(s){s.refCount--,s.refCount===0&&x3(_3,function(){s.controller.abort()})}var Al=null,jh=0,ca=0,ua=null;function S3(s,o){if(Al===null){var f=Al=[];jh=0,ca=Mp(),ua={status:"pending",value:void 0,then:function(v){f.push(v)}}}return jh++,o.then(T1,T1),o}function T1(){if(--jh===0&&Al!==null){ua!==null&&(ua.status="fulfilled");var s=Al;Al=null,ca=0,ua=null;for(var o=0;o<s.length;o++)(0,s[o])()}}function w3(s,o){var f=[],v={status:"pending",value:null,reason:null,then:function(A){f.push(A)}};return s.then(function(){v.status="fulfilled",v.value=o;for(var A=0;A<f.length;A++)(0,f[A])(o)},function(A){for(v.status="rejected",v.reason=A,A=0;A<f.length;A++)(0,f[A])(void 0)}),v}var D1=W.S;W.S=function(s,o){my=Re(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&S3(s,o),D1!==null&&D1(s,o)};var vo=P(null);function Th(){var s=vo.current;return s!==null?s:$t.pooledCache}function yu(s,o){o===null?B(vo,vo.current):B(vo,o.pool)}function M1(){var s=Th();return s===null?null:{parent:un._currentValue,pool:s}}var da=Error(r(460)),Dh=Error(r(474)),bu=Error(r(542)),xu={then:function(){}};function O1(s){return s=s.status,s==="fulfilled"||s==="rejected"}function L1(s,o,f){switch(f=s[f],f===void 0?s.push(o):f!==o&&(o.then(qr,qr),o=f),o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,P1(s),s;default:if(typeof o.status=="string")o.then(qr,qr);else{if(s=$t,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=o,s.status="pending",s.then(function(v){if(o.status==="pending"){var A=o;A.status="fulfilled",A.value=v}},function(v){if(o.status==="pending"){var A=o;A.status="rejected",A.reason=v}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,P1(s),s}throw bo=o,da}}function yo(s){try{var o=s._init;return o(s._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(bo=f,da):f}}var bo=null;function I1(){if(bo===null)throw Error(r(459));var s=bo;return bo=null,s}function P1(s){if(s===da||s===bu)throw Error(r(483))}var fa=null,Nl=0;function _u(s){var o=Nl;return Nl+=1,fa===null&&(fa=[]),L1(fa,s,o)}function Rl(s,o){o=o.props.ref,s.ref=o!==void 0?o:null}function Su(s,o){throw o.$$typeof===g?Error(r(525)):(s=Object.prototype.toString.call(o),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s)))}function z1(s){function o(le,ie){if(s){var ue=le.deletions;ue===null?(le.deletions=[ie],le.flags|=16):ue.push(ie)}}function f(le,ie){if(!s)return null;for(;ie!==null;)o(le,ie),ie=ie.sibling;return null}function v(le){for(var ie=new Map;le!==null;)le.key!==null?ie.set(le.key,le):ie.set(le.index,le),le=le.sibling;return ie}function A(le,ie){return le=Cs(le,ie),le.index=0,le.sibling=null,le}function T(le,ie,ue){return le.index=ue,s?(ue=le.alternate,ue!==null?(ue=ue.index,ue<ie?(le.flags|=67108866,ie):ue):(le.flags|=67108866,ie)):(le.flags|=1048576,ie)}function U(le){return s&&le.alternate===null&&(le.flags|=67108866),le}function Z(le,ie,ue,Se){return ie===null||ie.tag!==6?(ie=xh(ue,le.mode,Se),ie.return=le,ie):(ie=A(ie,ue),ie.return=le,ie)}function ne(le,ie,ue,Se){var nt=ue.type;return nt===w?xe(le,ie,ue.props.children,Se,ue.key):ie!==null&&(ie.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===E&&yo(nt)===ie.type)?(ie=A(ie,ue.props),Rl(ie,ue),ie.return=le,ie):(ie=pu(ue.type,ue.key,ue.props,null,le.mode,Se),Rl(ie,ue),ie.return=le,ie)}function fe(le,ie,ue,Se){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==ue.containerInfo||ie.stateNode.implementation!==ue.implementation?(ie=_h(ue,le.mode,Se),ie.return=le,ie):(ie=A(ie,ue.children||[]),ie.return=le,ie)}function xe(le,ie,ue,Se,nt){return ie===null||ie.tag!==7?(ie=ho(ue,le.mode,Se,nt),ie.return=le,ie):(ie=A(ie,ue),ie.return=le,ie)}function Ce(le,ie,ue){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=xh(""+ie,le.mode,ue),ie.return=le,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case _:return ue=pu(ie.type,ie.key,ie.props,null,le.mode,ue),Rl(ue,ie),ue.return=le,ue;case C:return ie=_h(ie,le.mode,ue),ie.return=le,ie;case E:return ie=yo(ie),Ce(le,ie,ue)}if(G(ie)||H(ie))return ie=ho(ie,le.mode,ue,null),ie.return=le,ie;if(typeof ie.then=="function")return Ce(le,_u(ie),ue);if(ie.$$typeof===x)return Ce(le,vu(le,ie),ue);Su(le,ie)}return null}function pe(le,ie,ue,Se){var nt=ie!==null?ie.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return nt!==null?null:Z(le,ie,""+ue,Se);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case _:return ue.key===nt?ne(le,ie,ue,Se):null;case C:return ue.key===nt?fe(le,ie,ue,Se):null;case E:return ue=yo(ue),pe(le,ie,ue,Se)}if(G(ue)||H(ue))return nt!==null?null:xe(le,ie,ue,Se,null);if(typeof ue.then=="function")return pe(le,ie,_u(ue),Se);if(ue.$$typeof===x)return pe(le,ie,vu(le,ue),Se);Su(le,ue)}return null}function ve(le,ie,ue,Se,nt){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(ue)||null,Z(ie,le,""+Se,nt);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case _:return le=le.get(Se.key===null?ue:Se.key)||null,ne(ie,le,Se,nt);case C:return le=le.get(Se.key===null?ue:Se.key)||null,fe(ie,le,Se,nt);case E:return Se=yo(Se),ve(le,ie,ue,Se,nt)}if(G(Se)||H(Se))return le=le.get(ue)||null,xe(ie,le,Se,nt,null);if(typeof Se.then=="function")return ve(le,ie,ue,_u(Se),nt);if(Se.$$typeof===x)return ve(le,ie,ue,vu(ie,Se),nt);Su(ie,Se)}return null}function Ye(le,ie,ue,Se){for(var nt=null,Et=null,et=ie,ut=ie=0,bt=null;et!==null&&ut<ue.length;ut++){et.index>ut?(bt=et,et=null):bt=et.sibling;var At=pe(le,et,ue[ut],Se);if(At===null){et===null&&(et=bt);break}s&&et&&At.alternate===null&&o(le,et),ie=T(At,ie,ut),Et===null?nt=At:Et.sibling=At,Et=At,et=bt}if(ut===ue.length)return f(le,et),wt&&ks(le,ut),nt;if(et===null){for(;ut<ue.length;ut++)et=Ce(le,ue[ut],Se),et!==null&&(ie=T(et,ie,ut),Et===null?nt=et:Et.sibling=et,Et=et);return wt&&ks(le,ut),nt}for(et=v(et);ut<ue.length;ut++)bt=ve(et,le,ut,ue[ut],Se),bt!==null&&(s&&bt.alternate!==null&&et.delete(bt.key===null?ut:bt.key),ie=T(bt,ie,ut),Et===null?nt=bt:Et.sibling=bt,Et=bt);return s&&et.forEach(function(ji){return o(le,ji)}),wt&&ks(le,ut),nt}function it(le,ie,ue,Se){if(ue==null)throw Error(r(151));for(var nt=null,Et=null,et=ie,ut=ie=0,bt=null,At=ue.next();et!==null&&!At.done;ut++,At=ue.next()){et.index>ut?(bt=et,et=null):bt=et.sibling;var ji=pe(le,et,At.value,Se);if(ji===null){et===null&&(et=bt);break}s&&et&&ji.alternate===null&&o(le,et),ie=T(ji,ie,ut),Et===null?nt=ji:Et.sibling=ji,Et=ji,et=bt}if(At.done)return f(le,et),wt&&ks(le,ut),nt;if(et===null){for(;!At.done;ut++,At=ue.next())At=Ce(le,At.value,Se),At!==null&&(ie=T(At,ie,ut),Et===null?nt=At:Et.sibling=At,Et=At);return wt&&ks(le,ut),nt}for(et=v(et);!At.done;ut++,At=ue.next())At=ve(et,le,ut,At.value,Se),At!==null&&(s&&At.alternate!==null&&et.delete(At.key===null?ut:At.key),ie=T(At,ie,ut),Et===null?nt=At:Et.sibling=At,Et=At);return s&&et.forEach(function(O4){return o(le,O4)}),wt&&ks(le,ut),nt}function Bt(le,ie,ue,Se){if(typeof ue=="object"&&ue!==null&&ue.type===w&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case _:e:{for(var nt=ue.key;ie!==null;){if(ie.key===nt){if(nt=ue.type,nt===w){if(ie.tag===7){f(le,ie.sibling),Se=A(ie,ue.props.children),Se.return=le,le=Se;break e}}else if(ie.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===E&&yo(nt)===ie.type){f(le,ie.sibling),Se=A(ie,ue.props),Rl(Se,ue),Se.return=le,le=Se;break e}f(le,ie);break}else o(le,ie);ie=ie.sibling}ue.type===w?(Se=ho(ue.props.children,le.mode,Se,ue.key),Se.return=le,le=Se):(Se=pu(ue.type,ue.key,ue.props,null,le.mode,Se),Rl(Se,ue),Se.return=le,le=Se)}return U(le);case C:e:{for(nt=ue.key;ie!==null;){if(ie.key===nt)if(ie.tag===4&&ie.stateNode.containerInfo===ue.containerInfo&&ie.stateNode.implementation===ue.implementation){f(le,ie.sibling),Se=A(ie,ue.children||[]),Se.return=le,le=Se;break e}else{f(le,ie);break}else o(le,ie);ie=ie.sibling}Se=_h(ue,le.mode,Se),Se.return=le,le=Se}return U(le);case E:return ue=yo(ue),Bt(le,ie,ue,Se)}if(G(ue))return Ye(le,ie,ue,Se);if(H(ue)){if(nt=H(ue),typeof nt!="function")throw Error(r(150));return ue=nt.call(ue),it(le,ie,ue,Se)}if(typeof ue.then=="function")return Bt(le,ie,_u(ue),Se);if(ue.$$typeof===x)return Bt(le,ie,vu(le,ue),Se);Su(le,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ie!==null&&ie.tag===6?(f(le,ie.sibling),Se=A(ie,ue),Se.return=le,le=Se):(f(le,ie),Se=xh(ue,le.mode,Se),Se.return=le,le=Se),U(le)):f(le,ie)}return function(le,ie,ue,Se){try{Nl=0;var nt=Bt(le,ie,ue,Se);return fa=null,nt}catch(et){if(et===da||et===bu)throw et;var Et=hr(29,et,null,le.mode);return Et.lanes=Se,Et.return=le,Et}finally{}}}var xo=z1(!0),B1=z1(!1),hi=!1;function Mh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oh(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function pi(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function mi(s,o,f){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(jt&2)!==0){var A=v.pending;return A===null?o.next=o:(o.next=A.next,A.next=o),v.pending=o,o=hu(s),S1(s,null,f),o}return fu(s,v,o,f),hu(s)}function jl(s,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194048)!==0)){var v=o.lanes;v&=s.pendingLanes,f|=v,o.lanes=f,Kt(s,f)}}function Lh(s,o){var f=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,f===v)){var A=null,T=null;if(f=f.firstBaseUpdate,f!==null){do{var U={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};T===null?A=T=U:T=T.next=U,f=f.next}while(f!==null);T===null?A=T=o:T=T.next=o}else A=T=o;f={baseState:v.baseState,firstBaseUpdate:A,lastBaseUpdate:T,shared:v.shared,callbacks:v.callbacks},s.updateQueue=f;return}s=f.lastBaseUpdate,s===null?f.firstBaseUpdate=o:s.next=o,f.lastBaseUpdate=o}var Ih=!1;function Tl(){if(Ih){var s=ua;if(s!==null)throw s}}function Dl(s,o,f,v){Ih=!1;var A=s.updateQueue;hi=!1;var T=A.firstBaseUpdate,U=A.lastBaseUpdate,Z=A.shared.pending;if(Z!==null){A.shared.pending=null;var ne=Z,fe=ne.next;ne.next=null,U===null?T=fe:U.next=fe,U=ne;var xe=s.alternate;xe!==null&&(xe=xe.updateQueue,Z=xe.lastBaseUpdate,Z!==U&&(Z===null?xe.firstBaseUpdate=fe:Z.next=fe,xe.lastBaseUpdate=ne))}if(T!==null){var Ce=A.baseState;U=0,xe=fe=ne=null,Z=T;do{var pe=Z.lane&-536870913,ve=pe!==Z.lane;if(ve?(yt&pe)===pe:(v&pe)===pe){pe!==0&&pe===ca&&(Ih=!0),xe!==null&&(xe=xe.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var Ye=s,it=Z;pe=o;var Bt=f;switch(it.tag){case 1:if(Ye=it.payload,typeof Ye=="function"){Ce=Ye.call(Bt,Ce,pe);break e}Ce=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=it.payload,pe=typeof Ye=="function"?Ye.call(Bt,Ce,pe):Ye,pe==null)break e;Ce=p({},Ce,pe);break e;case 2:hi=!0}}pe=Z.callback,pe!==null&&(s.flags|=64,ve&&(s.flags|=8192),ve=A.callbacks,ve===null?A.callbacks=[pe]:ve.push(pe))}else ve={lane:pe,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},xe===null?(fe=xe=ve,ne=Ce):xe=xe.next=ve,U|=pe;if(Z=Z.next,Z===null){if(Z=A.shared.pending,Z===null)break;ve=Z,Z=ve.next,ve.next=null,A.lastBaseUpdate=ve,A.shared.pending=null}}while(!0);xe===null&&(ne=Ce),A.baseState=ne,A.firstBaseUpdate=fe,A.lastBaseUpdate=xe,T===null&&(A.shared.lanes=0),xi|=U,s.lanes=U,s.memoizedState=Ce}}function F1(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function H1(s,o){var f=s.callbacks;if(f!==null)for(s.callbacks=null,s=0;s<f.length;s++)F1(f[s],o)}var ha=P(null),wu=P(0);function $1(s,o){s=Is,B(wu,s),B(ha,o),Is=s|o.baseLanes}function Ph(){B(wu,Is),B(ha,ha.current)}function zh(){Is=wu.current,F(ha),F(wu)}var pr=P(null),Or=null;function gi(s){var o=s.alternate;B(ln,ln.current&1),B(pr,s),Or===null&&(o===null||ha.current!==null||o.memoizedState!==null)&&(Or=s)}function Bh(s){B(ln,ln.current),B(pr,s),Or===null&&(Or=s)}function U1(s){s.tag===22?(B(ln,ln.current),B(pr,s),Or===null&&(Or=s)):vi()}function vi(){B(ln,ln.current),B(pr,pr.current)}function mr(s){F(pr),Or===s&&(Or=null),F(ln)}var ln=P(0);function Cu(s){for(var o=s;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||qp(f)||Wp(f)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Ns=0,ct=null,Pt=null,dn=null,ku=!1,pa=!1,_o=!1,Eu=0,Ml=0,ma=null,C3=0;function sn(){throw Error(r(321))}function Fh(s,o){if(o===null)return!1;for(var f=0;f<o.length&&f<s.length;f++)if(!fr(s[f],o[f]))return!1;return!0}function Hh(s,o,f,v,A,T){return Ns=T,ct=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,W.H=s===null||s.memoizedState===null?E0:np,_o=!1,T=f(v,A),_o=!1,pa&&(T=q1(o,f,v,A)),V1(s),T}function V1(s){W.H=Il;var o=Pt!==null&&Pt.next!==null;if(Ns=0,dn=Pt=ct=null,ku=!1,Ml=0,ma=null,o)throw Error(r(300));s===null||fn||(s=s.dependencies,s!==null&&gu(s)&&(fn=!0))}function q1(s,o,f,v){ct=s;var A=0;do{if(pa&&(ma=null),Ml=0,pa=!1,25<=A)throw Error(r(301));if(A+=1,dn=Pt=null,s.updateQueue!=null){var T=s.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}W.H=A0,T=o(f,v)}while(pa);return T}function k3(){var s=W.H,o=s.useState()[0];return o=typeof o.then=="function"?Ol(o):o,s=s.useState()[0],(Pt!==null?Pt.memoizedState:null)!==s&&(ct.flags|=1024),o}function $h(){var s=Eu!==0;return Eu=0,s}function Uh(s,o,f){o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~f}function Vh(s){if(ku){for(s=s.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}ku=!1}Ns=0,dn=Pt=ct=null,pa=!1,Ml=Eu=0,ma=null}function Kn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?ct.memoizedState=dn=s:dn=dn.next=s,dn}function cn(){if(Pt===null){var s=ct.alternate;s=s!==null?s.memoizedState:null}else s=Pt.next;var o=dn===null?ct.memoizedState:dn.next;if(o!==null)dn=o,Pt=s;else{if(s===null)throw ct.alternate===null?Error(r(467)):Error(r(310));Pt=s,s={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},dn===null?ct.memoizedState=dn=s:dn=dn.next=s}return dn}function Au(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ol(s){var o=Ml;return Ml+=1,ma===null&&(ma=[]),s=L1(ma,s,o),o=ct,(dn===null?o.memoizedState:dn.next)===null&&(o=o.alternate,W.H=o===null||o.memoizedState===null?E0:np),s}function Nu(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Ol(s);if(s.$$typeof===x)return Mn(s)}throw Error(r(438,String(s)))}function qh(s){var o=null,f=ct.updateQueue;if(f!==null&&(o=f.memoCache),o==null){var v=ct.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(o={data:v.data.map(function(A){return A.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),f===null&&(f=Au(),ct.updateQueue=f),f.memoCache=o,f=o.data[o.index],f===void 0)for(f=o.data[o.index]=Array(s),v=0;v<s;v++)f[v]=L;return o.index++,f}function Rs(s,o){return typeof o=="function"?o(s):o}function Ru(s){var o=cn();return Wh(o,Pt,s)}function Wh(s,o,f){var v=s.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=f;var A=s.baseQueue,T=v.pending;if(T!==null){if(A!==null){var U=A.next;A.next=T.next,T.next=U}o.baseQueue=A=T,v.pending=null}if(T=s.baseState,A===null)s.memoizedState=T;else{o=A.next;var Z=U=null,ne=null,fe=o,xe=!1;do{var Ce=fe.lane&-536870913;if(Ce!==fe.lane?(yt&Ce)===Ce:(Ns&Ce)===Ce){var pe=fe.revertLane;if(pe===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ce===ca&&(xe=!0);else if((Ns&pe)===pe){fe=fe.next,pe===ca&&(xe=!0);continue}else Ce={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},ne===null?(Z=ne=Ce,U=T):ne=ne.next=Ce,ct.lanes|=pe,xi|=pe;Ce=fe.action,_o&&f(T,Ce),T=fe.hasEagerState?fe.eagerState:f(T,Ce)}else pe={lane:Ce,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},ne===null?(Z=ne=pe,U=T):ne=ne.next=pe,ct.lanes|=Ce,xi|=Ce;fe=fe.next}while(fe!==null&&fe!==o);if(ne===null?U=T:ne.next=Z,!fr(T,s.memoizedState)&&(fn=!0,xe&&(f=ua,f!==null)))throw f;s.memoizedState=T,s.baseState=U,s.baseQueue=ne,v.lastRenderedState=T}return A===null&&(v.lanes=0),[s.memoizedState,v.dispatch]}function Gh(s){var o=cn(),f=o.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=s;var v=f.dispatch,A=f.pending,T=o.memoizedState;if(A!==null){f.pending=null;var U=A=A.next;do T=s(T,U.action),U=U.next;while(U!==A);fr(T,o.memoizedState)||(fn=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),f.lastRenderedState=T}return[T,v]}function W1(s,o,f){var v=ct,A=cn(),T=wt;if(T){if(f===void 0)throw Error(r(407));f=f()}else f=o();var U=!fr((Pt||A).memoizedState,f);if(U&&(A.memoizedState=f,fn=!0),A=A.queue,Xh(Y1.bind(null,v,A,s),[s]),A.getSnapshot!==o||U||dn!==null&&dn.memoizedState.tag&1){if(v.flags|=2048,ga(9,{destroy:void 0},K1.bind(null,v,A,f,o),null),$t===null)throw Error(r(349));T||(Ns&127)!==0||G1(v,o,f)}return f}function G1(s,o,f){s.flags|=16384,s={getSnapshot:o,value:f},o=ct.updateQueue,o===null?(o=Au(),ct.updateQueue=o,o.stores=[s]):(f=o.stores,f===null?o.stores=[s]:f.push(s))}function K1(s,o,f,v){o.value=f,o.getSnapshot=v,X1(o)&&Q1(s)}function Y1(s,o,f){return f(function(){X1(o)&&Q1(s)})}function X1(s){var o=s.getSnapshot;s=s.value;try{var f=o();return!fr(s,f)}catch{return!0}}function Q1(s){var o=fo(s,2);o!==null&&sr(o,s,2)}function Kh(s){var o=Kn();if(typeof s=="function"){var f=s;if(s=f(),_o){We(!0);try{f()}finally{We(!1)}}}return o.memoizedState=o.baseState=s,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:s},o}function Z1(s,o,f,v){return s.baseState=f,Wh(s,Pt,typeof v=="function"?v:Rs)}function E3(s,o,f,v,A){if(Du(s))throw Error(r(485));if(s=o.action,s!==null){var T={payload:A,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){T.listeners.push(U)}};W.T!==null?f(!0):T.isTransition=!1,v(T),f=o.pending,f===null?(T.next=o.pending=T,J1(o,T)):(T.next=f.next,o.pending=f.next=T)}}function J1(s,o){var f=o.action,v=o.payload,A=s.state;if(o.isTransition){var T=W.T,U={};W.T=U;try{var Z=f(A,v),ne=W.S;ne!==null&&ne(U,Z),e0(s,o,Z)}catch(fe){Yh(s,o,fe)}finally{T!==null&&U.types!==null&&(T.types=U.types),W.T=T}}else try{T=f(A,v),e0(s,o,T)}catch(fe){Yh(s,o,fe)}}function e0(s,o,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(v){t0(s,o,v)},function(v){return Yh(s,o,v)}):t0(s,o,f)}function t0(s,o,f){o.status="fulfilled",o.value=f,n0(o),s.state=f,o=s.pending,o!==null&&(f=o.next,f===o?s.pending=null:(f=f.next,o.next=f,J1(s,f)))}function Yh(s,o,f){var v=s.pending;if(s.pending=null,v!==null){v=v.next;do o.status="rejected",o.reason=f,n0(o),o=o.next;while(o!==v)}s.action=null}function n0(s){s=s.listeners;for(var o=0;o<s.length;o++)(0,s[o])()}function r0(s,o){return o}function s0(s,o){if(wt){var f=$t.formState;if(f!==null){e:{var v=ct;if(wt){if(Xt){t:{for(var A=Xt,T=Mr;A.nodeType!==8;){if(!T){A=null;break t}if(A=Lr(A.nextSibling),A===null){A=null;break t}}T=A.data,A=T==="F!"||T==="F"?A:null}if(A){Xt=Lr(A.nextSibling),v=A.data==="F!";break e}}di(v)}v=!1}v&&(o=f[0])}}return f=Kn(),f.memoizedState=f.baseState=o,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r0,lastRenderedState:o},f.queue=v,f=w0.bind(null,ct,v),v.dispatch=f,v=Kh(!1),T=tp.bind(null,ct,!1,v.queue),v=Kn(),A={state:o,dispatch:null,action:s,pending:null},v.queue=A,f=E3.bind(null,ct,A,T,f),A.dispatch=f,v.memoizedState=s,[o,f,!1]}function i0(s){var o=cn();return o0(o,Pt,s)}function o0(s,o,f){if(o=Wh(s,o,r0)[0],s=Ru(Rs)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var v=Ol(o)}catch(U){throw U===da?bu:U}else v=o;o=cn();var A=o.queue,T=A.dispatch;return f!==o.memoizedState&&(ct.flags|=2048,ga(9,{destroy:void 0},A3.bind(null,A,f),null)),[v,T,s]}function A3(s,o){s.action=o}function a0(s){var o=cn(),f=Pt;if(f!==null)return o0(o,f,s);cn(),o=o.memoizedState,f=cn();var v=f.queue.dispatch;return f.memoizedState=s,[o,v,!1]}function ga(s,o,f,v){return s={tag:s,create:f,deps:v,inst:o,next:null},o=ct.updateQueue,o===null&&(o=Au(),ct.updateQueue=o),f=o.lastEffect,f===null?o.lastEffect=s.next=s:(v=f.next,f.next=s,s.next=v,o.lastEffect=s),s}function l0(){return cn().memoizedState}function ju(s,o,f,v){var A=Kn();ct.flags|=s,A.memoizedState=ga(1|o,{destroy:void 0},f,v===void 0?null:v)}function Tu(s,o,f,v){var A=cn();v=v===void 0?null:v;var T=A.memoizedState.inst;Pt!==null&&v!==null&&Fh(v,Pt.memoizedState.deps)?A.memoizedState=ga(o,T,f,v):(ct.flags|=s,A.memoizedState=ga(1|o,T,f,v))}function c0(s,o){ju(8390656,8,s,o)}function Xh(s,o){Tu(2048,8,s,o)}function N3(s){ct.flags|=4;var o=ct.updateQueue;if(o===null)o=Au(),ct.updateQueue=o,o.events=[s];else{var f=o.events;f===null?o.events=[s]:f.push(s)}}function u0(s){var o=cn().memoizedState;return N3({ref:o,nextImpl:s}),function(){if((jt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function d0(s,o){return Tu(4,2,s,o)}function f0(s,o){return Tu(4,4,s,o)}function h0(s,o){if(typeof o=="function"){s=s();var f=o(s);return function(){typeof f=="function"?f():o(null)}}if(o!=null)return s=s(),o.current=s,function(){o.current=null}}function p0(s,o,f){f=f!=null?f.concat([s]):null,Tu(4,4,h0.bind(null,o,s),f)}function Qh(){}function m0(s,o){var f=cn();o=o===void 0?null:o;var v=f.memoizedState;return o!==null&&Fh(o,v[1])?v[0]:(f.memoizedState=[s,o],s)}function g0(s,o){var f=cn();o=o===void 0?null:o;var v=f.memoizedState;if(o!==null&&Fh(o,v[1]))return v[0];if(v=s(),_o){We(!0);try{s()}finally{We(!1)}}return f.memoizedState=[v,o],v}function Zh(s,o,f){return f===void 0||(Ns&1073741824)!==0&&(yt&261930)===0?s.memoizedState=o:(s.memoizedState=f,s=vy(),ct.lanes|=s,xi|=s,f)}function v0(s,o,f,v){return fr(f,o)?f:ha.current!==null?(s=Zh(s,f,v),fr(s,o)||(fn=!0),s):(Ns&42)===0||(Ns&1073741824)!==0&&(yt&261930)===0?(fn=!0,s.memoizedState=f):(s=vy(),ct.lanes|=s,xi|=s,o)}function y0(s,o,f,v,A){var T=X.p;X.p=T!==0&&8>T?T:8;var U=W.T,Z={};W.T=Z,tp(s,!1,o,f);try{var ne=A(),fe=W.S;if(fe!==null&&fe(Z,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var xe=w3(ne,v);Ll(s,o,xe,yr(s))}else Ll(s,o,v,yr(s))}catch(Ce){Ll(s,o,{then:function(){},status:"rejected",reason:Ce},yr())}finally{X.p=T,U!==null&&Z.types!==null&&(U.types=Z.types),W.T=U}}function R3(){}function Jh(s,o,f,v){if(s.tag!==5)throw Error(r(476));var A=b0(s).queue;y0(s,A,o,Y,f===null?R3:function(){return x0(s),f(v)})}function b0(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:Y},next:null};var f={};return o.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:f},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function x0(s){var o=b0(s);o.next===null&&(o=s.alternate.memoizedState),Ll(s,o.next.queue,{},yr())}function ep(){return Mn(Zl)}function _0(){return cn().memoizedState}function S0(){return cn().memoizedState}function j3(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var f=yr();s=pi(f);var v=mi(o,s,f);v!==null&&(sr(v,o,f),jl(v,o,f)),o={cache:Rh()},s.payload=o;return}o=o.return}}function T3(s,o,f){var v=yr();f={lane:v,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Du(s)?C0(o,f):(f=yh(s,o,f,v),f!==null&&(sr(f,s,v),k0(f,o,v)))}function w0(s,o,f){var v=yr();Ll(s,o,f,v)}function Ll(s,o,f,v){var A={lane:v,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Du(s))C0(o,A);else{var T=s.alternate;if(s.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var U=o.lastRenderedState,Z=T(U,f);if(A.hasEagerState=!0,A.eagerState=Z,fr(Z,U))return fu(s,o,A,0),$t===null&&du(),!1}catch{}finally{}if(f=yh(s,o,A,v),f!==null)return sr(f,s,v),k0(f,o,v),!0}return!1}function tp(s,o,f,v){if(v={lane:2,revertLane:Mp(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Du(s)){if(o)throw Error(r(479))}else o=yh(s,f,v,2),o!==null&&sr(o,s,2)}function Du(s){var o=s.alternate;return s===ct||o!==null&&o===ct}function C0(s,o){pa=ku=!0;var f=s.pending;f===null?o.next=o:(o.next=f.next,f.next=o),s.pending=o}function k0(s,o,f){if((f&4194048)!==0){var v=o.lanes;v&=s.pendingLanes,f|=v,o.lanes=f,Kt(s,f)}}var Il={readContext:Mn,use:Nu,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useLayoutEffect:sn,useInsertionEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useSyncExternalStore:sn,useId:sn,useHostTransitionStatus:sn,useFormState:sn,useActionState:sn,useOptimistic:sn,useMemoCache:sn,useCacheRefresh:sn};Il.useEffectEvent=sn;var E0={readContext:Mn,use:Nu,useCallback:function(s,o){return Kn().memoizedState=[s,o===void 0?null:o],s},useContext:Mn,useEffect:c0,useImperativeHandle:function(s,o,f){f=f!=null?f.concat([s]):null,ju(4194308,4,h0.bind(null,o,s),f)},useLayoutEffect:function(s,o){return ju(4194308,4,s,o)},useInsertionEffect:function(s,o){ju(4,2,s,o)},useMemo:function(s,o){var f=Kn();o=o===void 0?null:o;var v=s();if(_o){We(!0);try{s()}finally{We(!1)}}return f.memoizedState=[v,o],v},useReducer:function(s,o,f){var v=Kn();if(f!==void 0){var A=f(o);if(_o){We(!0);try{f(o)}finally{We(!1)}}}else A=o;return v.memoizedState=v.baseState=A,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:A},v.queue=s,s=s.dispatch=T3.bind(null,ct,s),[v.memoizedState,s]},useRef:function(s){var o=Kn();return s={current:s},o.memoizedState=s},useState:function(s){s=Kh(s);var o=s.queue,f=w0.bind(null,ct,o);return o.dispatch=f,[s.memoizedState,f]},useDebugValue:Qh,useDeferredValue:function(s,o){var f=Kn();return Zh(f,s,o)},useTransition:function(){var s=Kh(!1);return s=y0.bind(null,ct,s.queue,!0,!1),Kn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,f){var v=ct,A=Kn();if(wt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=o(),$t===null)throw Error(r(349));(yt&127)!==0||G1(v,o,f)}A.memoizedState=f;var T={value:f,getSnapshot:o};return A.queue=T,c0(Y1.bind(null,v,T,s),[s]),v.flags|=2048,ga(9,{destroy:void 0},K1.bind(null,v,T,f,o),null),f},useId:function(){var s=Kn(),o=$t.identifierPrefix;if(wt){var f=os,v=is;f=(v&~(1<<32-ze(v)-1)).toString(32)+f,o="_"+o+"R_"+f,f=Eu++,0<f&&(o+="H"+f.toString(32)),o+="_"}else f=C3++,o="_"+o+"r_"+f.toString(32)+"_";return s.memoizedState=o},useHostTransitionStatus:ep,useFormState:s0,useActionState:s0,useOptimistic:function(s){var o=Kn();o.memoizedState=o.baseState=s;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=f,o=tp.bind(null,ct,!0,f),f.dispatch=o,[s,o]},useMemoCache:qh,useCacheRefresh:function(){return Kn().memoizedState=j3.bind(null,ct)},useEffectEvent:function(s){var o=Kn(),f={impl:s};return o.memoizedState=f,function(){if((jt&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},np={readContext:Mn,use:Nu,useCallback:m0,useContext:Mn,useEffect:Xh,useImperativeHandle:p0,useInsertionEffect:d0,useLayoutEffect:f0,useMemo:g0,useReducer:Ru,useRef:l0,useState:function(){return Ru(Rs)},useDebugValue:Qh,useDeferredValue:function(s,o){var f=cn();return v0(f,Pt.memoizedState,s,o)},useTransition:function(){var s=Ru(Rs)[0],o=cn().memoizedState;return[typeof s=="boolean"?s:Ol(s),o]},useSyncExternalStore:W1,useId:_0,useHostTransitionStatus:ep,useFormState:i0,useActionState:i0,useOptimistic:function(s,o){var f=cn();return Z1(f,Pt,s,o)},useMemoCache:qh,useCacheRefresh:S0};np.useEffectEvent=u0;var A0={readContext:Mn,use:Nu,useCallback:m0,useContext:Mn,useEffect:Xh,useImperativeHandle:p0,useInsertionEffect:d0,useLayoutEffect:f0,useMemo:g0,useReducer:Gh,useRef:l0,useState:function(){return Gh(Rs)},useDebugValue:Qh,useDeferredValue:function(s,o){var f=cn();return Pt===null?Zh(f,s,o):v0(f,Pt.memoizedState,s,o)},useTransition:function(){var s=Gh(Rs)[0],o=cn().memoizedState;return[typeof s=="boolean"?s:Ol(s),o]},useSyncExternalStore:W1,useId:_0,useHostTransitionStatus:ep,useFormState:a0,useActionState:a0,useOptimistic:function(s,o){var f=cn();return Pt!==null?Z1(f,Pt,s,o):(f.baseState=s,[s,f.queue.dispatch])},useMemoCache:qh,useCacheRefresh:S0};A0.useEffectEvent=u0;function rp(s,o,f,v){o=s.memoizedState,f=f(v,o),f=f==null?o:p({},o,f),s.memoizedState=f,s.lanes===0&&(s.updateQueue.baseState=f)}var sp={enqueueSetState:function(s,o,f){s=s._reactInternals;var v=yr(),A=pi(v);A.payload=o,f!=null&&(A.callback=f),o=mi(s,A,v),o!==null&&(sr(o,s,v),jl(o,s,v))},enqueueReplaceState:function(s,o,f){s=s._reactInternals;var v=yr(),A=pi(v);A.tag=1,A.payload=o,f!=null&&(A.callback=f),o=mi(s,A,v),o!==null&&(sr(o,s,v),jl(o,s,v))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var f=yr(),v=pi(f);v.tag=2,o!=null&&(v.callback=o),o=mi(s,v,f),o!==null&&(sr(o,s,f),jl(o,s,f))}};function N0(s,o,f,v,A,T,U){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(v,T,U):o.prototype&&o.prototype.isPureReactComponent?!Sl(f,v)||!Sl(A,T):!0}function R0(s,o,f,v){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,v),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,v),o.state!==s&&sp.enqueueReplaceState(o,o.state,null)}function So(s,o){var f=o;if("ref"in o){f={};for(var v in o)v!=="ref"&&(f[v]=o[v])}if(s=s.defaultProps){f===o&&(f=p({},f));for(var A in s)f[A]===void 0&&(f[A]=s[A])}return f}function j0(s){uu(s)}function T0(s){console.error(s)}function D0(s){uu(s)}function Mu(s,o){try{var f=s.onUncaughtError;f(o.value,{componentStack:o.stack})}catch(v){setTimeout(function(){throw v})}}function M0(s,o,f){try{var v=s.onCaughtError;v(f.value,{componentStack:f.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function ip(s,o,f){return f=pi(f),f.tag=3,f.payload={element:null},f.callback=function(){Mu(s,o)},f}function O0(s){return s=pi(s),s.tag=3,s}function L0(s,o,f,v){var A=f.type.getDerivedStateFromError;if(typeof A=="function"){var T=v.value;s.payload=function(){return A(T)},s.callback=function(){M0(o,f,v)}}var U=f.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(s.callback=function(){M0(o,f,v),typeof A!="function"&&(_i===null?_i=new Set([this]):_i.add(this));var Z=v.stack;this.componentDidCatch(v.value,{componentStack:Z!==null?Z:""})})}function D3(s,o,f,v,A){if(f.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(o=f.alternate,o!==null&&la(o,f,A,!0),f=pr.current,f!==null){switch(f.tag){case 31:case 13:return Or===null?qu():f.alternate===null&&on===0&&(on=3),f.flags&=-257,f.flags|=65536,f.lanes=A,v===xu?f.flags|=16384:(o=f.updateQueue,o===null?f.updateQueue=new Set([v]):o.add(v),jp(s,v,A)),!1;case 22:return f.flags|=65536,v===xu?f.flags|=16384:(o=f.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([v])},f.updateQueue=o):(f=o.retryQueue,f===null?o.retryQueue=new Set([v]):f.add(v)),jp(s,v,A)),!1}throw Error(r(435,f.tag))}return jp(s,v,A),qu(),!1}if(wt)return o=pr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=A,v!==Ch&&(s=Error(r(422),{cause:v}),kl(jr(s,f)))):(v!==Ch&&(o=Error(r(423),{cause:v}),kl(jr(o,f))),s=s.current.alternate,s.flags|=65536,A&=-A,s.lanes|=A,v=jr(v,f),A=ip(s.stateNode,v,A),Lh(s,A),on!==4&&(on=2)),!1;var T=Error(r(520),{cause:v});if(T=jr(T,f),Vl===null?Vl=[T]:Vl.push(T),on!==4&&(on=2),o===null)return!0;v=jr(v,f),f=o;do{switch(f.tag){case 3:return f.flags|=65536,s=A&-A,f.lanes|=s,s=ip(f.stateNode,v,s),Lh(f,s),!1;case 1:if(o=f.type,T=f.stateNode,(f.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(_i===null||!_i.has(T))))return f.flags|=65536,A&=-A,f.lanes|=A,A=O0(A),L0(A,s,f,v),Lh(f,A),!1}f=f.return}while(f!==null);return!1}var op=Error(r(461)),fn=!1;function On(s,o,f,v){o.child=s===null?B1(o,null,f,v):xo(o,s.child,f,v)}function I0(s,o,f,v,A){f=f.render;var T=o.ref;if("ref"in v){var U={};for(var Z in v)Z!=="ref"&&(U[Z]=v[Z])}else U=v;return go(o),v=Hh(s,o,f,U,T,A),Z=$h(),s!==null&&!fn?(Uh(s,o,A),js(s,o,A)):(wt&&Z&&Sh(o),o.flags|=1,On(s,o,v,A),o.child)}function P0(s,o,f,v,A){if(s===null){var T=f.type;return typeof T=="function"&&!bh(T)&&T.defaultProps===void 0&&f.compare===null?(o.tag=15,o.type=T,z0(s,o,T,v,A)):(s=pu(f.type,null,v,o,o.mode,A),s.ref=o.ref,s.return=o,o.child=s)}if(T=s.child,!pp(s,A)){var U=T.memoizedProps;if(f=f.compare,f=f!==null?f:Sl,f(U,v)&&s.ref===o.ref)return js(s,o,A)}return o.flags|=1,s=Cs(T,v),s.ref=o.ref,s.return=o,o.child=s}function z0(s,o,f,v,A){if(s!==null){var T=s.memoizedProps;if(Sl(T,v)&&s.ref===o.ref)if(fn=!1,o.pendingProps=v=T,pp(s,A))(s.flags&131072)!==0&&(fn=!0);else return o.lanes=s.lanes,js(s,o,A)}return ap(s,o,f,v,A)}function B0(s,o,f,v){var A=v.children,T=s!==null?s.memoizedState:null;if(s===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((o.flags&128)!==0){if(T=T!==null?T.baseLanes|f:f,s!==null){for(v=o.child=s.child,A=0;v!==null;)A=A|v.lanes|v.childLanes,v=v.sibling;v=A&~T}else v=0,o.child=null;return F0(s,o,T,f,v)}if((f&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},s!==null&&yu(o,T!==null?T.cachePool:null),T!==null?$1(o,T):Ph(),U1(o);else return v=o.lanes=536870912,F0(s,o,T!==null?T.baseLanes|f:f,f,v)}else T!==null?(yu(o,T.cachePool),$1(o,T),vi(),o.memoizedState=null):(s!==null&&yu(o,null),Ph(),vi());return On(s,o,A,f),o.child}function Pl(s,o){return s!==null&&s.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function F0(s,o,f,v,A){var T=Th();return T=T===null?null:{parent:un._currentValue,pool:T},o.memoizedState={baseLanes:f,cachePool:T},s!==null&&yu(o,null),Ph(),U1(o),s!==null&&la(s,o,v,!0),o.childLanes=A,null}function Ou(s,o){return o=Iu({mode:o.mode,children:o.children},s.mode),o.ref=s.ref,s.child=o,o.return=s,o}function H0(s,o,f){return xo(o,s.child,null,f),s=Ou(o,o.pendingProps),s.flags|=2,mr(o),o.memoizedState=null,s}function M3(s,o,f){var v=o.pendingProps,A=(o.flags&128)!==0;if(o.flags&=-129,s===null){if(wt){if(v.mode==="hidden")return s=Ou(o,v),o.lanes=536870912,Pl(null,s);if(Bh(o),(s=Xt)?(s=Jy(s,Mr),s=s!==null&&s.data==="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:ci!==null?{id:is,overflow:os}:null,retryLane:536870912,hydrationErrors:null},f=C1(s),f.return=o,o.child=f,Dn=o,Xt=null)):s=null,s===null)throw di(o);return o.lanes=536870912,null}return Ou(o,v)}var T=s.memoizedState;if(T!==null){var U=T.dehydrated;if(Bh(o),A)if(o.flags&256)o.flags&=-257,o=H0(s,o,f);else if(o.memoizedState!==null)o.child=s.child,o.flags|=128,o=null;else throw Error(r(558));else if(fn||la(s,o,f,!1),A=(f&s.childLanes)!==0,fn||A){if(v=$t,v!==null&&(U=lr(v,f),U!==0&&U!==T.retryLane))throw T.retryLane=U,fo(s,U),sr(v,s,U),op;qu(),o=H0(s,o,f)}else s=T.treeContext,Xt=Lr(U.nextSibling),Dn=o,wt=!0,ui=null,Mr=!1,s!==null&&A1(o,s),o=Ou(o,v),o.flags|=4096;return o}return s=Cs(s.child,{mode:v.mode,children:v.children}),s.ref=o.ref,o.child=s,s.return=o,s}function Lu(s,o){var f=o.ref;if(f===null)s!==null&&s.ref!==null&&(o.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(s===null||s.ref!==f)&&(o.flags|=4194816)}}function ap(s,o,f,v,A){return go(o),f=Hh(s,o,f,v,void 0,A),v=$h(),s!==null&&!fn?(Uh(s,o,A),js(s,o,A)):(wt&&v&&Sh(o),o.flags|=1,On(s,o,f,A),o.child)}function $0(s,o,f,v,A,T){return go(o),o.updateQueue=null,f=q1(o,v,f,A),V1(s),v=$h(),s!==null&&!fn?(Uh(s,o,T),js(s,o,T)):(wt&&v&&Sh(o),o.flags|=1,On(s,o,f,T),o.child)}function U0(s,o,f,v,A){if(go(o),o.stateNode===null){var T=sa,U=f.contextType;typeof U=="object"&&U!==null&&(T=Mn(U)),T=new f(v,T),o.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=sp,o.stateNode=T,T._reactInternals=o,T=o.stateNode,T.props=v,T.state=o.memoizedState,T.refs={},Mh(o),U=f.contextType,T.context=typeof U=="object"&&U!==null?Mn(U):sa,T.state=o.memoizedState,U=f.getDerivedStateFromProps,typeof U=="function"&&(rp(o,f,U,v),T.state=o.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(U=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),U!==T.state&&sp.enqueueReplaceState(T,T.state,null),Dl(o,v,T,A),Tl(),T.state=o.memoizedState),typeof T.componentDidMount=="function"&&(o.flags|=4194308),v=!0}else if(s===null){T=o.stateNode;var Z=o.memoizedProps,ne=So(f,Z);T.props=ne;var fe=T.context,xe=f.contextType;U=sa,typeof xe=="object"&&xe!==null&&(U=Mn(xe));var Ce=f.getDerivedStateFromProps;xe=typeof Ce=="function"||typeof T.getSnapshotBeforeUpdate=="function",Z=o.pendingProps!==Z,xe||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(Z||fe!==U)&&R0(o,T,v,U),hi=!1;var pe=o.memoizedState;T.state=pe,Dl(o,v,T,A),Tl(),fe=o.memoizedState,Z||pe!==fe||hi?(typeof Ce=="function"&&(rp(o,f,Ce,v),fe=o.memoizedState),(ne=hi||N0(o,f,ne,v,pe,fe,U))?(xe||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=v,o.memoizedState=fe),T.props=v,T.state=fe,T.context=U,v=ne):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),v=!1)}else{T=o.stateNode,Oh(s,o),U=o.memoizedProps,xe=So(f,U),T.props=xe,Ce=o.pendingProps,pe=T.context,fe=f.contextType,ne=sa,typeof fe=="object"&&fe!==null&&(ne=Mn(fe)),Z=f.getDerivedStateFromProps,(fe=typeof Z=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(U!==Ce||pe!==ne)&&R0(o,T,v,ne),hi=!1,pe=o.memoizedState,T.state=pe,Dl(o,v,T,A),Tl();var ve=o.memoizedState;U!==Ce||pe!==ve||hi||s!==null&&s.dependencies!==null&&gu(s.dependencies)?(typeof Z=="function"&&(rp(o,f,Z,v),ve=o.memoizedState),(xe=hi||N0(o,f,xe,v,pe,ve,ne)||s!==null&&s.dependencies!==null&&gu(s.dependencies))?(fe||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(v,ve,ne),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(v,ve,ne)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(o.flags|=1024),o.memoizedProps=v,o.memoizedState=ve),T.props=v,T.state=ve,T.context=ne,v=xe):(typeof T.componentDidUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(o.flags|=1024),v=!1)}return T=v,Lu(s,o),v=(o.flags&128)!==0,T||v?(T=o.stateNode,f=v&&typeof f.getDerivedStateFromError!="function"?null:T.render(),o.flags|=1,s!==null&&v?(o.child=xo(o,s.child,null,A),o.child=xo(o,null,f,A)):On(s,o,f,A),o.memoizedState=T.state,s=o.child):s=js(s,o,A),s}function V0(s,o,f,v){return po(),o.flags|=256,On(s,o,f,v),o.child}var lp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cp(s){return{baseLanes:s,cachePool:M1()}}function up(s,o,f){return s=s!==null?s.childLanes&~f:0,o&&(s|=vr),s}function q0(s,o,f){var v=o.pendingProps,A=!1,T=(o.flags&128)!==0,U;if((U=T)||(U=s!==null&&s.memoizedState===null?!1:(ln.current&2)!==0),U&&(A=!0,o.flags&=-129),U=(o.flags&32)!==0,o.flags&=-33,s===null){if(wt){if(A?gi(o):vi(),(s=Xt)?(s=Jy(s,Mr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:ci!==null?{id:is,overflow:os}:null,retryLane:536870912,hydrationErrors:null},f=C1(s),f.return=o,o.child=f,Dn=o,Xt=null)):s=null,s===null)throw di(o);return Wp(s)?o.lanes=32:o.lanes=536870912,null}var Z=v.children;return v=v.fallback,A?(vi(),A=o.mode,Z=Iu({mode:"hidden",children:Z},A),v=ho(v,A,f,null),Z.return=o,v.return=o,Z.sibling=v,o.child=Z,v=o.child,v.memoizedState=cp(f),v.childLanes=up(s,U,f),o.memoizedState=lp,Pl(null,v)):(gi(o),dp(o,Z))}var ne=s.memoizedState;if(ne!==null&&(Z=ne.dehydrated,Z!==null)){if(T)o.flags&256?(gi(o),o.flags&=-257,o=fp(s,o,f)):o.memoizedState!==null?(vi(),o.child=s.child,o.flags|=128,o=null):(vi(),Z=v.fallback,A=o.mode,v=Iu({mode:"visible",children:v.children},A),Z=ho(Z,A,f,null),Z.flags|=2,v.return=o,Z.return=o,v.sibling=Z,o.child=v,xo(o,s.child,null,f),v=o.child,v.memoizedState=cp(f),v.childLanes=up(s,U,f),o.memoizedState=lp,o=Pl(null,v));else if(gi(o),Wp(Z)){if(U=Z.nextSibling&&Z.nextSibling.dataset,U)var fe=U.dgst;U=fe,v=Error(r(419)),v.stack="",v.digest=U,kl({value:v,source:null,stack:null}),o=fp(s,o,f)}else if(fn||la(s,o,f,!1),U=(f&s.childLanes)!==0,fn||U){if(U=$t,U!==null&&(v=lr(U,f),v!==0&&v!==ne.retryLane))throw ne.retryLane=v,fo(s,v),sr(U,s,v),op;qp(Z)||qu(),o=fp(s,o,f)}else qp(Z)?(o.flags|=192,o.child=s.child,o=null):(s=ne.treeContext,Xt=Lr(Z.nextSibling),Dn=o,wt=!0,ui=null,Mr=!1,s!==null&&A1(o,s),o=dp(o,v.children),o.flags|=4096);return o}return A?(vi(),Z=v.fallback,A=o.mode,ne=s.child,fe=ne.sibling,v=Cs(ne,{mode:"hidden",children:v.children}),v.subtreeFlags=ne.subtreeFlags&65011712,fe!==null?Z=Cs(fe,Z):(Z=ho(Z,A,f,null),Z.flags|=2),Z.return=o,v.return=o,v.sibling=Z,o.child=v,Pl(null,v),v=o.child,Z=s.child.memoizedState,Z===null?Z=cp(f):(A=Z.cachePool,A!==null?(ne=un._currentValue,A=A.parent!==ne?{parent:ne,pool:ne}:A):A=M1(),Z={baseLanes:Z.baseLanes|f,cachePool:A}),v.memoizedState=Z,v.childLanes=up(s,U,f),o.memoizedState=lp,Pl(s.child,v)):(gi(o),f=s.child,s=f.sibling,f=Cs(f,{mode:"visible",children:v.children}),f.return=o,f.sibling=null,s!==null&&(U=o.deletions,U===null?(o.deletions=[s],o.flags|=16):U.push(s)),o.child=f,o.memoizedState=null,f)}function dp(s,o){return o=Iu({mode:"visible",children:o},s.mode),o.return=s,s.child=o}function Iu(s,o){return s=hr(22,s,null,o),s.lanes=0,s}function fp(s,o,f){return xo(o,s.child,null,f),s=dp(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function W0(s,o,f){s.lanes|=o;var v=s.alternate;v!==null&&(v.lanes|=o),Ah(s.return,o,f)}function hp(s,o,f,v,A,T){var U=s.memoizedState;U===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:v,tail:f,tailMode:A,treeForkCount:T}:(U.isBackwards=o,U.rendering=null,U.renderingStartTime=0,U.last=v,U.tail=f,U.tailMode=A,U.treeForkCount=T)}function G0(s,o,f){var v=o.pendingProps,A=v.revealOrder,T=v.tail;v=v.children;var U=ln.current,Z=(U&2)!==0;if(Z?(U=U&1|2,o.flags|=128):U&=1,B(ln,U),On(s,o,v,f),v=wt?Cl:0,!Z&&s!==null&&(s.flags&128)!==0)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&W0(s,f,o);else if(s.tag===19)W0(s,f,o);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(A){case"forwards":for(f=o.child,A=null;f!==null;)s=f.alternate,s!==null&&Cu(s)===null&&(A=f),f=f.sibling;f=A,f===null?(A=o.child,o.child=null):(A=f.sibling,f.sibling=null),hp(o,!1,A,f,T,v);break;case"backwards":case"unstable_legacy-backwards":for(f=null,A=o.child,o.child=null;A!==null;){if(s=A.alternate,s!==null&&Cu(s)===null){o.child=A;break}s=A.sibling,A.sibling=f,f=A,A=s}hp(o,!0,f,null,T,v);break;case"together":hp(o,!1,null,null,void 0,v);break;default:o.memoizedState=null}return o.child}function js(s,o,f){if(s!==null&&(o.dependencies=s.dependencies),xi|=o.lanes,(f&o.childLanes)===0)if(s!==null){if(la(s,o,f,!1),(f&o.childLanes)===0)return null}else return null;if(s!==null&&o.child!==s.child)throw Error(r(153));if(o.child!==null){for(s=o.child,f=Cs(s,s.pendingProps),o.child=f,f.return=o;s.sibling!==null;)s=s.sibling,f=f.sibling=Cs(s,s.pendingProps),f.return=o;f.sibling=null}return o.child}function pp(s,o){return(s.lanes&o)!==0?!0:(s=s.dependencies,!!(s!==null&&gu(s)))}function O3(s,o,f){switch(o.tag){case 3:V(o,o.stateNode.containerInfo),fi(o,un,s.memoizedState.cache),po();break;case 27:case 5:re(o);break;case 4:V(o,o.stateNode.containerInfo);break;case 10:fi(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Bh(o),null;break;case 13:var v=o.memoizedState;if(v!==null)return v.dehydrated!==null?(gi(o),o.flags|=128,null):(f&o.child.childLanes)!==0?q0(s,o,f):(gi(o),s=js(s,o,f),s!==null?s.sibling:null);gi(o);break;case 19:var A=(s.flags&128)!==0;if(v=(f&o.childLanes)!==0,v||(la(s,o,f,!1),v=(f&o.childLanes)!==0),A){if(v)return G0(s,o,f);o.flags|=128}if(A=o.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),B(ln,ln.current),v)break;return null;case 22:return o.lanes=0,B0(s,o,f,o.pendingProps);case 24:fi(o,un,s.memoizedState.cache)}return js(s,o,f)}function K0(s,o,f){if(s!==null)if(s.memoizedProps!==o.pendingProps)fn=!0;else{if(!pp(s,f)&&(o.flags&128)===0)return fn=!1,O3(s,o,f);fn=(s.flags&131072)!==0}else fn=!1,wt&&(o.flags&1048576)!==0&&E1(o,Cl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var v=o.pendingProps;if(s=yo(o.elementType),o.type=s,typeof s=="function")bh(s)?(v=So(s,v),o.tag=1,o=U0(null,o,s,v,f)):(o.tag=0,o=ap(null,o,s,v,f));else{if(s!=null){var A=s.$$typeof;if(A===k){o.tag=11,o=I0(null,o,s,v,f);break e}else if(A===D){o.tag=14,o=P0(null,o,s,v,f);break e}}throw o=q(s)||s,Error(r(306,o,""))}}return o;case 0:return ap(s,o,o.type,o.pendingProps,f);case 1:return v=o.type,A=So(v,o.pendingProps),U0(s,o,v,A,f);case 3:e:{if(V(o,o.stateNode.containerInfo),s===null)throw Error(r(387));v=o.pendingProps;var T=o.memoizedState;A=T.element,Oh(s,o),Dl(o,v,null,f);var U=o.memoizedState;if(v=U.cache,fi(o,un,v),v!==T.cache&&Nh(o,[un],f,!0),Tl(),v=U.element,T.isDehydrated)if(T={element:v,isDehydrated:!1,cache:U.cache},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){o=V0(s,o,v,f);break e}else if(v!==A){A=jr(Error(r(424)),o),kl(A),o=V0(s,o,v,f);break e}else{switch(s=o.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Xt=Lr(s.firstChild),Dn=o,wt=!0,ui=null,Mr=!0,f=B1(o,null,v,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(po(),v===A){o=js(s,o,f);break e}On(s,o,v,f)}o=o.child}return o;case 26:return Lu(s,o),s===null?(f=ib(o.type,null,o.pendingProps,null))?o.memoizedState=f:wt||(f=o.type,s=o.pendingProps,v=Zu(ee.current).createElement(f),v[Nt]=o,v[Dt]=s,Ln(v,f,s),en(v),o.stateNode=v):o.memoizedState=ib(o.type,s.memoizedProps,o.pendingProps,s.memoizedState),null;case 27:return re(o),s===null&&wt&&(v=o.stateNode=nb(o.type,o.pendingProps,ee.current),Dn=o,Mr=!0,A=Xt,ki(o.type)?(Gp=A,Xt=Lr(v.firstChild)):Xt=A),On(s,o,o.pendingProps.children,f),Lu(s,o),s===null&&(o.flags|=4194304),o.child;case 5:return s===null&&wt&&((A=v=Xt)&&(v=u4(v,o.type,o.pendingProps,Mr),v!==null?(o.stateNode=v,Dn=o,Xt=Lr(v.firstChild),Mr=!1,A=!0):A=!1),A||di(o)),re(o),A=o.type,T=o.pendingProps,U=s!==null?s.memoizedProps:null,v=T.children,$p(A,T)?v=null:U!==null&&$p(A,U)&&(o.flags|=32),o.memoizedState!==null&&(A=Hh(s,o,k3,null,null,f),Zl._currentValue=A),Lu(s,o),On(s,o,v,f),o.child;case 6:return s===null&&wt&&((s=f=Xt)&&(f=d4(f,o.pendingProps,Mr),f!==null?(o.stateNode=f,Dn=o,Xt=null,s=!0):s=!1),s||di(o)),null;case 13:return q0(s,o,f);case 4:return V(o,o.stateNode.containerInfo),v=o.pendingProps,s===null?o.child=xo(o,null,v,f):On(s,o,v,f),o.child;case 11:return I0(s,o,o.type,o.pendingProps,f);case 7:return On(s,o,o.pendingProps,f),o.child;case 8:return On(s,o,o.pendingProps.children,f),o.child;case 12:return On(s,o,o.pendingProps.children,f),o.child;case 10:return v=o.pendingProps,fi(o,o.type,v.value),On(s,o,v.children,f),o.child;case 9:return A=o.type._context,v=o.pendingProps.children,go(o),A=Mn(A),v=v(A),o.flags|=1,On(s,o,v,f),o.child;case 14:return P0(s,o,o.type,o.pendingProps,f);case 15:return z0(s,o,o.type,o.pendingProps,f);case 19:return G0(s,o,f);case 31:return M3(s,o,f);case 22:return B0(s,o,f,o.pendingProps);case 24:return go(o),v=Mn(un),s===null?(A=Th(),A===null&&(A=$t,T=Rh(),A.pooledCache=T,T.refCount++,T!==null&&(A.pooledCacheLanes|=f),A=T),o.memoizedState={parent:v,cache:A},Mh(o),fi(o,un,A)):((s.lanes&f)!==0&&(Oh(s,o),Dl(o,null,null,f),Tl()),A=s.memoizedState,T=o.memoizedState,A.parent!==v?(A={parent:v,cache:v},o.memoizedState=A,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=A),fi(o,un,v)):(v=T.cache,fi(o,un,v),v!==A.cache&&Nh(o,[un],f,!0))),On(s,o,o.pendingProps.children,f),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Ts(s){s.flags|=4}function mp(s,o,f,v,A){if((o=(s.mode&32)!==0)&&(o=!1),o){if(s.flags|=16777216,(A&335544128)===A)if(s.stateNode.complete)s.flags|=8192;else if(_y())s.flags|=8192;else throw bo=xu,Dh}else s.flags&=-16777217}function Y0(s,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!ub(o))if(_y())s.flags|=8192;else throw bo=xu,Dh}function Pu(s,o){o!==null&&(s.flags|=4),s.flags&16384&&(o=s.tag!==22?Oe():536870912,s.lanes|=o,xa|=o)}function zl(s,o){if(!wt)switch(s.tailMode){case"hidden":o=s.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?s.tail=null:f.sibling=null;break;case"collapsed":f=s.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:v.sibling=null}}function Qt(s){var o=s.alternate!==null&&s.alternate.child===s.child,f=0,v=0;if(o)for(var A=s.child;A!==null;)f|=A.lanes|A.childLanes,v|=A.subtreeFlags&65011712,v|=A.flags&65011712,A.return=s,A=A.sibling;else for(A=s.child;A!==null;)f|=A.lanes|A.childLanes,v|=A.subtreeFlags,v|=A.flags,A.return=s,A=A.sibling;return s.subtreeFlags|=v,s.childLanes=f,o}function L3(s,o,f){var v=o.pendingProps;switch(wh(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(o),null;case 1:return Qt(o),null;case 3:return f=o.stateNode,v=null,s!==null&&(v=s.memoizedState.cache),o.memoizedState.cache!==v&&(o.flags|=2048),As(un),te(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(s===null||s.child===null)&&(aa(o)?Ts(o):s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,kh())),Qt(o),null;case 26:var A=o.type,T=o.memoizedState;return s===null?(Ts(o),T!==null?(Qt(o),Y0(o,T)):(Qt(o),mp(o,A,null,v,f))):T?T!==s.memoizedState?(Ts(o),Qt(o),Y0(o,T)):(Qt(o),o.flags&=-16777217):(s=s.memoizedProps,s!==v&&Ts(o),Qt(o),mp(o,A,s,v,f)),null;case 27:if(ae(o),f=ee.current,A=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==v&&Ts(o);else{if(!v){if(o.stateNode===null)throw Error(r(166));return Qt(o),null}s=Q.current,aa(o)?N1(o):(s=nb(A,v,f),o.stateNode=s,Ts(o))}return Qt(o),null;case 5:if(ae(o),A=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==v&&Ts(o);else{if(!v){if(o.stateNode===null)throw Error(r(166));return Qt(o),null}if(T=Q.current,aa(o))N1(o);else{var U=Zu(ee.current);switch(T){case 1:T=U.createElementNS("http://www.w3.org/2000/svg",A);break;case 2:T=U.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;default:switch(A){case"svg":T=U.createElementNS("http://www.w3.org/2000/svg",A);break;case"math":T=U.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;case"script":T=U.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof v.is=="string"?U.createElement("select",{is:v.is}):U.createElement("select"),v.multiple?T.multiple=!0:v.size&&(T.size=v.size);break;default:T=typeof v.is=="string"?U.createElement(A,{is:v.is}):U.createElement(A)}}T[Nt]=o,T[Dt]=v;e:for(U=o.child;U!==null;){if(U.tag===5||U.tag===6)T.appendChild(U.stateNode);else if(U.tag!==4&&U.tag!==27&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===o)break e;for(;U.sibling===null;){if(U.return===null||U.return===o)break e;U=U.return}U.sibling.return=U.return,U=U.sibling}o.stateNode=T;e:switch(Ln(T,A,v),A){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Ts(o)}}return Qt(o),mp(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,f),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==v&&Ts(o);else{if(typeof v!="string"&&o.stateNode===null)throw Error(r(166));if(s=ee.current,aa(o)){if(s=o.stateNode,f=o.memoizedProps,v=null,A=Dn,A!==null)switch(A.tag){case 27:case 5:v=A.memoizedProps}s[Nt]=o,s=!!(s.nodeValue===f||v!==null&&v.suppressHydrationWarning===!0||qy(s.nodeValue,f)),s||di(o,!0)}else s=Zu(s).createTextNode(v),s[Nt]=o,o.stateNode=s}return Qt(o),null;case 31:if(f=o.memoizedState,s===null||s.memoizedState!==null){if(v=aa(o),f!==null){if(s===null){if(!v)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Nt]=o}else po(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Qt(o),s=!1}else f=kh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=f),s=!0;if(!s)return o.flags&256?(mr(o),o):(mr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Qt(o),null;case 13:if(v=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(A=aa(o),v!==null&&v.dehydrated!==null){if(s===null){if(!A)throw Error(r(318));if(A=o.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[Nt]=o}else po(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Qt(o),A=!1}else A=kh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=A),A=!0;if(!A)return o.flags&256?(mr(o),o):(mr(o),null)}return mr(o),(o.flags&128)!==0?(o.lanes=f,o):(f=v!==null,s=s!==null&&s.memoizedState!==null,f&&(v=o.child,A=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(A=v.alternate.memoizedState.cachePool.pool),T=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(T=v.memoizedState.cachePool.pool),T!==A&&(v.flags|=2048)),f!==s&&f&&(o.child.flags|=8192),Pu(o,o.updateQueue),Qt(o),null);case 4:return te(),s===null&&Pp(o.stateNode.containerInfo),Qt(o),null;case 10:return As(o.type),Qt(o),null;case 19:if(F(ln),v=o.memoizedState,v===null)return Qt(o),null;if(A=(o.flags&128)!==0,T=v.rendering,T===null)if(A)zl(v,!1);else{if(on!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(T=Cu(s),T!==null){for(o.flags|=128,zl(v,!1),s=T.updateQueue,o.updateQueue=s,Pu(o,s),o.subtreeFlags=0,s=f,f=o.child;f!==null;)w1(f,s),f=f.sibling;return B(ln,ln.current&1|2),wt&&ks(o,v.treeForkCount),o.child}s=s.sibling}v.tail!==null&&Re()>$u&&(o.flags|=128,A=!0,zl(v,!1),o.lanes=4194304)}else{if(!A)if(s=Cu(T),s!==null){if(o.flags|=128,A=!0,s=s.updateQueue,o.updateQueue=s,Pu(o,s),zl(v,!0),v.tail===null&&v.tailMode==="hidden"&&!T.alternate&&!wt)return Qt(o),null}else 2*Re()-v.renderingStartTime>$u&&f!==536870912&&(o.flags|=128,A=!0,zl(v,!1),o.lanes=4194304);v.isBackwards?(T.sibling=o.child,o.child=T):(s=v.last,s!==null?s.sibling=T:o.child=T,v.last=T)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=Re(),s.sibling=null,f=ln.current,B(ln,A?f&1|2:f&1),wt&&ks(o,v.treeForkCount),s):(Qt(o),null);case 22:case 23:return mr(o),zh(),v=o.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(o.flags|=8192):v&&(o.flags|=8192),v?(f&536870912)!==0&&(o.flags&128)===0&&(Qt(o),o.subtreeFlags&6&&(o.flags|=8192)):Qt(o),f=o.updateQueue,f!==null&&Pu(o,f.retryQueue),f=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),v=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(v=o.memoizedState.cachePool.pool),v!==f&&(o.flags|=2048),s!==null&&F(vo),null;case 24:return f=null,s!==null&&(f=s.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),As(un),Qt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function I3(s,o){switch(wh(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return As(un),te(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return ae(o),null;case 31:if(o.memoizedState!==null){if(mr(o),o.alternate===null)throw Error(r(340));po()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(mr(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));po()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return F(ln),null;case 4:return te(),null;case 10:return As(o.type),null;case 22:case 23:return mr(o),zh(),s!==null&&F(vo),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return As(un),null;case 25:return null;default:return null}}function X0(s,o){switch(wh(o),o.tag){case 3:As(un),te();break;case 26:case 27:case 5:ae(o);break;case 4:te();break;case 31:o.memoizedState!==null&&mr(o);break;case 13:mr(o);break;case 19:F(ln);break;case 10:As(o.type);break;case 22:case 23:mr(o),zh(),s!==null&&F(vo);break;case 24:As(un)}}function Bl(s,o){try{var f=o.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var A=v.next;f=A;do{if((f.tag&s)===s){v=void 0;var T=f.create,U=f.inst;v=T(),U.destroy=v}f=f.next}while(f!==A)}}catch(Z){Lt(o,o.return,Z)}}function yi(s,o,f){try{var v=o.updateQueue,A=v!==null?v.lastEffect:null;if(A!==null){var T=A.next;v=T;do{if((v.tag&s)===s){var U=v.inst,Z=U.destroy;if(Z!==void 0){U.destroy=void 0,A=o;var ne=f,fe=Z;try{fe()}catch(xe){Lt(A,ne,xe)}}}v=v.next}while(v!==T)}}catch(xe){Lt(o,o.return,xe)}}function Q0(s){var o=s.updateQueue;if(o!==null){var f=s.stateNode;try{H1(o,f)}catch(v){Lt(s,s.return,v)}}}function Z0(s,o,f){f.props=So(s.type,s.memoizedProps),f.state=s.memoizedState;try{f.componentWillUnmount()}catch(v){Lt(s,o,v)}}function Fl(s,o){try{var f=s.ref;if(f!==null){switch(s.tag){case 26:case 27:case 5:var v=s.stateNode;break;case 30:v=s.stateNode;break;default:v=s.stateNode}typeof f=="function"?s.refCleanup=f(v):f.current=v}}catch(A){Lt(s,o,A)}}function as(s,o){var f=s.ref,v=s.refCleanup;if(f!==null)if(typeof v=="function")try{v()}catch(A){Lt(s,o,A)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(A){Lt(s,o,A)}else f.current=null}function J0(s){var o=s.type,f=s.memoizedProps,v=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":f.autoFocus&&v.focus();break e;case"img":f.src?v.src=f.src:f.srcSet&&(v.srcset=f.srcSet)}}catch(A){Lt(s,s.return,A)}}function gp(s,o,f){try{var v=s.stateNode;s4(v,s.type,f,o),v[Dt]=o}catch(A){Lt(s,s.return,A)}}function ey(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ki(s.type)||s.tag===4}function vp(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||ey(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ki(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function yp(s,o,f){var v=s.tag;if(v===5||v===6)s=s.stateNode,o?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(s,o):(o=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,o.appendChild(s),f=f._reactRootContainer,f!=null||o.onclick!==null||(o.onclick=qr));else if(v!==4&&(v===27&&ki(s.type)&&(f=s.stateNode,o=null),s=s.child,s!==null))for(yp(s,o,f),s=s.sibling;s!==null;)yp(s,o,f),s=s.sibling}function zu(s,o,f){var v=s.tag;if(v===5||v===6)s=s.stateNode,o?f.insertBefore(s,o):f.appendChild(s);else if(v!==4&&(v===27&&ki(s.type)&&(f=s.stateNode),s=s.child,s!==null))for(zu(s,o,f),s=s.sibling;s!==null;)zu(s,o,f),s=s.sibling}function ty(s){var o=s.stateNode,f=s.memoizedProps;try{for(var v=s.type,A=o.attributes;A.length;)o.removeAttributeNode(A[0]);Ln(o,v,f),o[Nt]=s,o[Dt]=f}catch(T){Lt(s,s.return,T)}}var Ds=!1,hn=!1,bp=!1,ny=typeof WeakSet=="function"?WeakSet:Set,Cn=null;function P3(s,o){if(s=s.containerInfo,Fp=id,s=p1(s),fh(s)){if("selectionStart"in s)var f={start:s.selectionStart,end:s.selectionEnd};else e:{f=(f=s.ownerDocument)&&f.defaultView||window;var v=f.getSelection&&f.getSelection();if(v&&v.rangeCount!==0){f=v.anchorNode;var A=v.anchorOffset,T=v.focusNode;v=v.focusOffset;try{f.nodeType,T.nodeType}catch{f=null;break e}var U=0,Z=-1,ne=-1,fe=0,xe=0,Ce=s,pe=null;t:for(;;){for(var ve;Ce!==f||A!==0&&Ce.nodeType!==3||(Z=U+A),Ce!==T||v!==0&&Ce.nodeType!==3||(ne=U+v),Ce.nodeType===3&&(U+=Ce.nodeValue.length),(ve=Ce.firstChild)!==null;)pe=Ce,Ce=ve;for(;;){if(Ce===s)break t;if(pe===f&&++fe===A&&(Z=U),pe===T&&++xe===v&&(ne=U),(ve=Ce.nextSibling)!==null)break;Ce=pe,pe=Ce.parentNode}Ce=ve}f=Z===-1||ne===-1?null:{start:Z,end:ne}}else f=null}f=f||{start:0,end:0}}else f=null;for(Hp={focusedElem:s,selectionRange:f},id=!1,Cn=o;Cn!==null;)if(o=Cn,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,Cn=s;else for(;Cn!==null;){switch(o=Cn,T=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(f=0;f<s.length;f++)A=s[f],A.ref.impl=A.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&T!==null){s=void 0,f=o,A=T.memoizedProps,T=T.memoizedState,v=f.stateNode;try{var Ye=So(f.type,A);s=v.getSnapshotBeforeUpdate(Ye,T),v.__reactInternalSnapshotBeforeUpdate=s}catch(it){Lt(f,f.return,it)}}break;case 3:if((s&1024)!==0){if(s=o.stateNode.containerInfo,f=s.nodeType,f===9)Vp(s);else if(f===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Vp(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=o.sibling,s!==null){s.return=o.return,Cn=s;break}Cn=o.return}}function ry(s,o,f){var v=f.flags;switch(f.tag){case 0:case 11:case 15:Os(s,f),v&4&&Bl(5,f);break;case 1:if(Os(s,f),v&4)if(s=f.stateNode,o===null)try{s.componentDidMount()}catch(U){Lt(f,f.return,U)}else{var A=So(f.type,o.memoizedProps);o=o.memoizedState;try{s.componentDidUpdate(A,o,s.__reactInternalSnapshotBeforeUpdate)}catch(U){Lt(f,f.return,U)}}v&64&&Q0(f),v&512&&Fl(f,f.return);break;case 3:if(Os(s,f),v&64&&(s=f.updateQueue,s!==null)){if(o=null,f.child!==null)switch(f.child.tag){case 27:case 5:o=f.child.stateNode;break;case 1:o=f.child.stateNode}try{H1(s,o)}catch(U){Lt(f,f.return,U)}}break;case 27:o===null&&v&4&&ty(f);case 26:case 5:Os(s,f),o===null&&v&4&&J0(f),v&512&&Fl(f,f.return);break;case 12:Os(s,f);break;case 31:Os(s,f),v&4&&oy(s,f);break;case 13:Os(s,f),v&4&&ay(s,f),v&64&&(s=f.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(f=W3.bind(null,f),f4(s,f))));break;case 22:if(v=f.memoizedState!==null||Ds,!v){o=o!==null&&o.memoizedState!==null||hn,A=Ds;var T=hn;Ds=v,(hn=o)&&!T?Ls(s,f,(f.subtreeFlags&8772)!==0):Os(s,f),Ds=A,hn=T}break;case 30:break;default:Os(s,f)}}function sy(s){var o=s.alternate;o!==null&&(s.alternate=null,sy(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&Er(o)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var tn=null,er=!1;function Ms(s,o,f){for(f=f.child;f!==null;)iy(s,o,f),f=f.sibling}function iy(s,o,f){if(Be&&typeof Be.onCommitFiberUnmount=="function")try{Be.onCommitFiberUnmount(lt,f)}catch{}switch(f.tag){case 26:hn||as(f,o),Ms(s,o,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:hn||as(f,o);var v=tn,A=er;ki(f.type)&&(tn=f.stateNode,er=!1),Ms(s,o,f),Yl(f.stateNode),tn=v,er=A;break;case 5:hn||as(f,o);case 6:if(v=tn,A=er,tn=null,Ms(s,o,f),tn=v,er=A,tn!==null)if(er)try{(tn.nodeType===9?tn.body:tn.nodeName==="HTML"?tn.ownerDocument.body:tn).removeChild(f.stateNode)}catch(T){Lt(f,o,T)}else try{tn.removeChild(f.stateNode)}catch(T){Lt(f,o,T)}break;case 18:tn!==null&&(er?(s=tn,Qy(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,f.stateNode),Na(s)):Qy(tn,f.stateNode));break;case 4:v=tn,A=er,tn=f.stateNode.containerInfo,er=!0,Ms(s,o,f),tn=v,er=A;break;case 0:case 11:case 14:case 15:yi(2,f,o),hn||yi(4,f,o),Ms(s,o,f);break;case 1:hn||(as(f,o),v=f.stateNode,typeof v.componentWillUnmount=="function"&&Z0(f,o,v)),Ms(s,o,f);break;case 21:Ms(s,o,f);break;case 22:hn=(v=hn)||f.memoizedState!==null,Ms(s,o,f),hn=v;break;default:Ms(s,o,f)}}function oy(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Na(s)}catch(f){Lt(o,o.return,f)}}}function ay(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Na(s)}catch(f){Lt(o,o.return,f)}}function z3(s){switch(s.tag){case 31:case 13:case 19:var o=s.stateNode;return o===null&&(o=s.stateNode=new ny),o;case 22:return s=s.stateNode,o=s._retryCache,o===null&&(o=s._retryCache=new ny),o;default:throw Error(r(435,s.tag))}}function Bu(s,o){var f=z3(s);o.forEach(function(v){if(!f.has(v)){f.add(v);var A=G3.bind(null,s,v);v.then(A,A)}})}function tr(s,o){var f=o.deletions;if(f!==null)for(var v=0;v<f.length;v++){var A=f[v],T=s,U=o,Z=U;e:for(;Z!==null;){switch(Z.tag){case 27:if(ki(Z.type)){tn=Z.stateNode,er=!1;break e}break;case 5:tn=Z.stateNode,er=!1;break e;case 3:case 4:tn=Z.stateNode.containerInfo,er=!0;break e}Z=Z.return}if(tn===null)throw Error(r(160));iy(T,U,A),tn=null,er=!1,T=A.alternate,T!==null&&(T.return=null),A.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)ly(o,s),o=o.sibling}var Gr=null;function ly(s,o){var f=s.alternate,v=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:tr(o,s),nr(s),v&4&&(yi(3,s,s.return),Bl(3,s),yi(5,s,s.return));break;case 1:tr(o,s),nr(s),v&512&&(hn||f===null||as(f,f.return)),v&64&&Ds&&(s=s.updateQueue,s!==null&&(v=s.callbacks,v!==null&&(f=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=f===null?v:f.concat(v))));break;case 26:var A=Gr;if(tr(o,s),nr(s),v&512&&(hn||f===null||as(f,f.return)),v&4){var T=f!==null?f.memoizedState:null;if(v=s.memoizedState,f===null)if(v===null)if(s.stateNode===null){e:{v=s.type,f=s.memoizedProps,A=A.ownerDocument||A;t:switch(v){case"title":T=A.getElementsByTagName("title")[0],(!T||T[kr]||T[Nt]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=A.createElement(v),A.head.insertBefore(T,A.querySelector("head > title"))),Ln(T,v,f),T[Nt]=s,en(T),v=T;break e;case"link":var U=lb("link","href",A).get(v+(f.href||""));if(U){for(var Z=0;Z<U.length;Z++)if(T=U[Z],T.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&T.getAttribute("rel")===(f.rel==null?null:f.rel)&&T.getAttribute("title")===(f.title==null?null:f.title)&&T.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){U.splice(Z,1);break t}}T=A.createElement(v),Ln(T,v,f),A.head.appendChild(T);break;case"meta":if(U=lb("meta","content",A).get(v+(f.content||""))){for(Z=0;Z<U.length;Z++)if(T=U[Z],T.getAttribute("content")===(f.content==null?null:""+f.content)&&T.getAttribute("name")===(f.name==null?null:f.name)&&T.getAttribute("property")===(f.property==null?null:f.property)&&T.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&T.getAttribute("charset")===(f.charSet==null?null:f.charSet)){U.splice(Z,1);break t}}T=A.createElement(v),Ln(T,v,f),A.head.appendChild(T);break;default:throw Error(r(468,v))}T[Nt]=s,en(T),v=T}s.stateNode=v}else cb(A,s.type,s.stateNode);else s.stateNode=ab(A,v,s.memoizedProps);else T!==v?(T===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):T.count--,v===null?cb(A,s.type,s.stateNode):ab(A,v,s.memoizedProps)):v===null&&s.stateNode!==null&&gp(s,s.memoizedProps,f.memoizedProps)}break;case 27:tr(o,s),nr(s),v&512&&(hn||f===null||as(f,f.return)),f!==null&&v&4&&gp(s,s.memoizedProps,f.memoizedProps);break;case 5:if(tr(o,s),nr(s),v&512&&(hn||f===null||as(f,f.return)),s.flags&32){A=s.stateNode;try{ei(A,"")}catch(Ye){Lt(s,s.return,Ye)}}v&4&&s.stateNode!=null&&(A=s.memoizedProps,gp(s,A,f!==null?f.memoizedProps:A)),v&1024&&(bp=!0);break;case 6:if(tr(o,s),nr(s),v&4){if(s.stateNode===null)throw Error(r(162));v=s.memoizedProps,f=s.stateNode;try{f.nodeValue=v}catch(Ye){Lt(s,s.return,Ye)}}break;case 3:if(td=null,A=Gr,Gr=Ju(o.containerInfo),tr(o,s),Gr=A,nr(s),v&4&&f!==null&&f.memoizedState.isDehydrated)try{Na(o.containerInfo)}catch(Ye){Lt(s,s.return,Ye)}bp&&(bp=!1,cy(s));break;case 4:v=Gr,Gr=Ju(s.stateNode.containerInfo),tr(o,s),nr(s),Gr=v;break;case 12:tr(o,s),nr(s);break;case 31:tr(o,s),nr(s),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Bu(s,v)));break;case 13:tr(o,s),nr(s),s.child.flags&8192&&s.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Hu=Re()),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Bu(s,v)));break;case 22:A=s.memoizedState!==null;var ne=f!==null&&f.memoizedState!==null,fe=Ds,xe=hn;if(Ds=fe||A,hn=xe||ne,tr(o,s),hn=xe,Ds=fe,nr(s),v&8192)e:for(o=s.stateNode,o._visibility=A?o._visibility&-2:o._visibility|1,A&&(f===null||ne||Ds||hn||wo(s)),f=null,o=s;;){if(o.tag===5||o.tag===26){if(f===null){ne=f=o;try{if(T=ne.stateNode,A)U=T.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none";else{Z=ne.stateNode;var Ce=ne.memoizedProps.style,pe=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;Z.style.display=pe==null||typeof pe=="boolean"?"":(""+pe).trim()}}catch(Ye){Lt(ne,ne.return,Ye)}}}else if(o.tag===6){if(f===null){ne=o;try{ne.stateNode.nodeValue=A?"":ne.memoizedProps}catch(Ye){Lt(ne,ne.return,Ye)}}}else if(o.tag===18){if(f===null){ne=o;try{var ve=ne.stateNode;A?Zy(ve,!0):Zy(ne.stateNode,!1)}catch(Ye){Lt(ne,ne.return,Ye)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===s)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;o.sibling===null;){if(o.return===null||o.return===s)break e;f===o&&(f=null),o=o.return}f===o&&(f=null),o.sibling.return=o.return,o=o.sibling}v&4&&(v=s.updateQueue,v!==null&&(f=v.retryQueue,f!==null&&(v.retryQueue=null,Bu(s,f))));break;case 19:tr(o,s),nr(s),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Bu(s,v)));break;case 30:break;case 21:break;default:tr(o,s),nr(s)}}function nr(s){var o=s.flags;if(o&2){try{for(var f,v=s.return;v!==null;){if(ey(v)){f=v;break}v=v.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var A=f.stateNode,T=vp(s);zu(s,T,A);break;case 5:var U=f.stateNode;f.flags&32&&(ei(U,""),f.flags&=-33);var Z=vp(s);zu(s,Z,U);break;case 3:case 4:var ne=f.stateNode.containerInfo,fe=vp(s);yp(s,fe,ne);break;default:throw Error(r(161))}}catch(xe){Lt(s,s.return,xe)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function cy(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var o=s;cy(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),s=s.sibling}}function Os(s,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)ry(s,o.alternate,o),o=o.sibling}function wo(s){for(s=s.child;s!==null;){var o=s;switch(o.tag){case 0:case 11:case 14:case 15:yi(4,o,o.return),wo(o);break;case 1:as(o,o.return);var f=o.stateNode;typeof f.componentWillUnmount=="function"&&Z0(o,o.return,f),wo(o);break;case 27:Yl(o.stateNode);case 26:case 5:as(o,o.return),wo(o);break;case 22:o.memoizedState===null&&wo(o);break;case 30:wo(o);break;default:wo(o)}s=s.sibling}}function Ls(s,o,f){for(f=f&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var v=o.alternate,A=s,T=o,U=T.flags;switch(T.tag){case 0:case 11:case 15:Ls(A,T,f),Bl(4,T);break;case 1:if(Ls(A,T,f),v=T,A=v.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(fe){Lt(v,v.return,fe)}if(v=T,A=v.updateQueue,A!==null){var Z=v.stateNode;try{var ne=A.shared.hiddenCallbacks;if(ne!==null)for(A.shared.hiddenCallbacks=null,A=0;A<ne.length;A++)F1(ne[A],Z)}catch(fe){Lt(v,v.return,fe)}}f&&U&64&&Q0(T),Fl(T,T.return);break;case 27:ty(T);case 26:case 5:Ls(A,T,f),f&&v===null&&U&4&&J0(T),Fl(T,T.return);break;case 12:Ls(A,T,f);break;case 31:Ls(A,T,f),f&&U&4&&oy(A,T);break;case 13:Ls(A,T,f),f&&U&4&&ay(A,T);break;case 22:T.memoizedState===null&&Ls(A,T,f),Fl(T,T.return);break;case 30:break;default:Ls(A,T,f)}o=o.sibling}}function xp(s,o){var f=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),s=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(s=o.memoizedState.cachePool.pool),s!==f&&(s!=null&&s.refCount++,f!=null&&El(f))}function _p(s,o){s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&El(s))}function Kr(s,o,f,v){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)uy(s,o,f,v),o=o.sibling}function uy(s,o,f,v){var A=o.flags;switch(o.tag){case 0:case 11:case 15:Kr(s,o,f,v),A&2048&&Bl(9,o);break;case 1:Kr(s,o,f,v);break;case 3:Kr(s,o,f,v),A&2048&&(s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&El(s)));break;case 12:if(A&2048){Kr(s,o,f,v),s=o.stateNode;try{var T=o.memoizedProps,U=T.id,Z=T.onPostCommit;typeof Z=="function"&&Z(U,o.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(ne){Lt(o,o.return,ne)}}else Kr(s,o,f,v);break;case 31:Kr(s,o,f,v);break;case 13:Kr(s,o,f,v);break;case 23:break;case 22:T=o.stateNode,U=o.alternate,o.memoizedState!==null?T._visibility&2?Kr(s,o,f,v):Hl(s,o):T._visibility&2?Kr(s,o,f,v):(T._visibility|=2,va(s,o,f,v,(o.subtreeFlags&10256)!==0||!1)),A&2048&&xp(U,o);break;case 24:Kr(s,o,f,v),A&2048&&_p(o.alternate,o);break;default:Kr(s,o,f,v)}}function va(s,o,f,v,A){for(A=A&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var T=s,U=o,Z=f,ne=v,fe=U.flags;switch(U.tag){case 0:case 11:case 15:va(T,U,Z,ne,A),Bl(8,U);break;case 23:break;case 22:var xe=U.stateNode;U.memoizedState!==null?xe._visibility&2?va(T,U,Z,ne,A):Hl(T,U):(xe._visibility|=2,va(T,U,Z,ne,A)),A&&fe&2048&&xp(U.alternate,U);break;case 24:va(T,U,Z,ne,A),A&&fe&2048&&_p(U.alternate,U);break;default:va(T,U,Z,ne,A)}o=o.sibling}}function Hl(s,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var f=s,v=o,A=v.flags;switch(v.tag){case 22:Hl(f,v),A&2048&&xp(v.alternate,v);break;case 24:Hl(f,v),A&2048&&_p(v.alternate,v);break;default:Hl(f,v)}o=o.sibling}}var $l=8192;function ya(s,o,f){if(s.subtreeFlags&$l)for(s=s.child;s!==null;)dy(s,o,f),s=s.sibling}function dy(s,o,f){switch(s.tag){case 26:ya(s,o,f),s.flags&$l&&s.memoizedState!==null&&C4(f,Gr,s.memoizedState,s.memoizedProps);break;case 5:ya(s,o,f);break;case 3:case 4:var v=Gr;Gr=Ju(s.stateNode.containerInfo),ya(s,o,f),Gr=v;break;case 22:s.memoizedState===null&&(v=s.alternate,v!==null&&v.memoizedState!==null?(v=$l,$l=16777216,ya(s,o,f),$l=v):ya(s,o,f));break;default:ya(s,o,f)}}function fy(s){var o=s.alternate;if(o!==null&&(s=o.child,s!==null)){o.child=null;do o=s.sibling,s.sibling=null,s=o;while(s!==null)}}function Ul(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var v=o[f];Cn=v,py(v,s)}fy(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)hy(s),s=s.sibling}function hy(s){switch(s.tag){case 0:case 11:case 15:Ul(s),s.flags&2048&&yi(9,s,s.return);break;case 3:Ul(s);break;case 12:Ul(s);break;case 22:var o=s.stateNode;s.memoizedState!==null&&o._visibility&2&&(s.return===null||s.return.tag!==13)?(o._visibility&=-3,Fu(s)):Ul(s);break;default:Ul(s)}}function Fu(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var v=o[f];Cn=v,py(v,s)}fy(s)}for(s=s.child;s!==null;){switch(o=s,o.tag){case 0:case 11:case 15:yi(8,o,o.return),Fu(o);break;case 22:f=o.stateNode,f._visibility&2&&(f._visibility&=-3,Fu(o));break;default:Fu(o)}s=s.sibling}}function py(s,o){for(;Cn!==null;){var f=Cn;switch(f.tag){case 0:case 11:case 15:yi(8,f,o);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var v=f.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:El(f.memoizedState.cache)}if(v=f.child,v!==null)v.return=f,Cn=v;else e:for(f=s;Cn!==null;){v=Cn;var A=v.sibling,T=v.return;if(sy(v),v===f){Cn=null;break e}if(A!==null){A.return=T,Cn=A;break e}Cn=T}}}var B3={getCacheForType:function(s){var o=Mn(un),f=o.data.get(s);return f===void 0&&(f=s(),o.data.set(s,f)),f},cacheSignal:function(){return Mn(un).controller.signal}},F3=typeof WeakMap=="function"?WeakMap:Map,jt=0,$t=null,mt=null,yt=0,Ot=0,gr=null,bi=!1,ba=!1,Sp=!1,Is=0,on=0,xi=0,Co=0,wp=0,vr=0,xa=0,Vl=null,rr=null,Cp=!1,Hu=0,my=0,$u=1/0,Uu=null,_i=null,bn=0,Si=null,_a=null,Ps=0,kp=0,Ep=null,gy=null,ql=0,Ap=null;function yr(){return(jt&2)!==0&&yt!==0?yt&-yt:W.T!==null?Mp():Nn()}function vy(){if(vr===0)if((yt&536870912)===0||wt){var s=Zt;Zt<<=1,(Zt&3932160)===0&&(Zt=262144),vr=s}else vr=536870912;return s=pr.current,s!==null&&(s.flags|=32),vr}function sr(s,o,f){(s===$t&&(Ot===2||Ot===9)||s.cancelPendingCommit!==null)&&(Sa(s,0),wi(s,yt,vr,!1)),ot(s,f),((jt&2)===0||s!==$t)&&(s===$t&&((jt&2)===0&&(Co|=f),on===4&&wi(s,yt,vr,!1)),ls(s))}function yy(s,o,f){if((jt&6)!==0)throw Error(r(327));var v=!f&&(o&127)===0&&(o&s.expiredLanes)===0||He(s,o),A=v?U3(s,o):Rp(s,o,!0),T=v;do{if(A===0){ba&&!v&&wi(s,o,0,!1);break}else{if(f=s.current.alternate,T&&!H3(f)){A=Rp(s,o,!1),T=!1;continue}if(A===2){if(T=o,s.errorRecoveryDisabledLanes&T)var U=0;else U=s.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){o=U;e:{var Z=s;A=Vl;var ne=Z.current.memoizedState.isDehydrated;if(ne&&(Sa(Z,U).flags|=256),U=Rp(Z,U,!1),U!==2){if(Sp&&!ne){Z.errorRecoveryDisabledLanes|=T,Co|=T,A=4;break e}T=rr,rr=A,T!==null&&(rr===null?rr=T:rr.push.apply(rr,T))}A=U}if(T=!1,A!==2)continue}}if(A===1){Sa(s,0),wi(s,o,0,!0);break}e:{switch(v=s,T=A,T){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:wi(v,o,vr,!bi);break e;case 2:rr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(A=Hu+300-Re(),10<A)){if(wi(v,o,vr,!bi),ge(v,0,!0)!==0)break e;Ps=o,v.timeoutHandle=Yy(by.bind(null,v,f,rr,Uu,Cp,o,vr,Co,xa,bi,T,"Throttled",-0,0),A);break e}by(v,f,rr,Uu,Cp,o,vr,Co,xa,bi,T,null,-0,0)}}break}while(!0);ls(s)}function by(s,o,f,v,A,T,U,Z,ne,fe,xe,Ce,pe,ve){if(s.timeoutHandle=-1,Ce=o.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qr},dy(o,T,Ce);var Ye=(T&62914560)===T?Hu-Re():(T&4194048)===T?my-Re():0;if(Ye=k4(Ce,Ye),Ye!==null){Ps=T,s.cancelPendingCommit=Ye(Ay.bind(null,s,o,T,f,v,A,U,Z,ne,xe,Ce,null,pe,ve)),wi(s,T,U,!fe);return}}Ay(s,o,T,f,v,A,U,Z,ne)}function H3(s){for(var o=s;;){var f=o.tag;if((f===0||f===11||f===15)&&o.flags&16384&&(f=o.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var v=0;v<f.length;v++){var A=f[v],T=A.getSnapshot;A=A.value;try{if(!fr(T(),A))return!1}catch{return!1}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function wi(s,o,f,v){o&=~wp,o&=~Co,s.suspendedLanes|=o,s.pingedLanes&=~o,v&&(s.warmLanes|=o),v=s.expirationTimes;for(var A=o;0<A;){var T=31-ze(A),U=1<<T;v[T]=-1,A&=~U}f!==0&&Gt(s,f,o)}function Vu(){return(jt&6)===0?(Wl(0),!1):!0}function Np(){if(mt!==null){if(Ot===0)var s=mt.return;else s=mt,Es=mo=null,Vh(s),fa=null,Nl=0,s=mt;for(;s!==null;)X0(s.alternate,s),s=s.return;mt=null}}function Sa(s,o){var f=s.timeoutHandle;f!==-1&&(s.timeoutHandle=-1,a4(f)),f=s.cancelPendingCommit,f!==null&&(s.cancelPendingCommit=null,f()),Ps=0,Np(),$t=s,mt=f=Cs(s.current,null),yt=o,Ot=0,gr=null,bi=!1,ba=He(s,o),Sp=!1,xa=vr=wp=Co=xi=on=0,rr=Vl=null,Cp=!1,(o&8)!==0&&(o|=o&32);var v=s.entangledLanes;if(v!==0)for(s=s.entanglements,v&=o;0<v;){var A=31-ze(v),T=1<<A;o|=s[A],v&=~T}return Is=o,du(),f}function xy(s,o){ct=null,W.H=Il,o===da||o===bu?(o=I1(),Ot=3):o===Dh?(o=I1(),Ot=4):Ot=o===op?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,gr=o,mt===null&&(on=1,Mu(s,jr(o,s.current)))}function _y(){var s=pr.current;return s===null?!0:(yt&4194048)===yt?Or===null:(yt&62914560)===yt||(yt&536870912)!==0?s===Or:!1}function Sy(){var s=W.H;return W.H=Il,s===null?Il:s}function wy(){var s=W.A;return W.A=B3,s}function qu(){on=4,bi||(yt&4194048)!==yt&&pr.current!==null||(ba=!0),(xi&134217727)===0&&(Co&134217727)===0||$t===null||wi($t,yt,vr,!1)}function Rp(s,o,f){var v=jt;jt|=2;var A=Sy(),T=wy();($t!==s||yt!==o)&&(Uu=null,Sa(s,o)),o=!1;var U=on;e:do try{if(Ot!==0&&mt!==null){var Z=mt,ne=gr;switch(Ot){case 8:Np(),U=6;break e;case 3:case 2:case 9:case 6:pr.current===null&&(o=!0);var fe=Ot;if(Ot=0,gr=null,wa(s,Z,ne,fe),f&&ba){U=0;break e}break;default:fe=Ot,Ot=0,gr=null,wa(s,Z,ne,fe)}}$3(),U=on;break}catch(xe){xy(s,xe)}while(!0);return o&&s.shellSuspendCounter++,Es=mo=null,jt=v,W.H=A,W.A=T,mt===null&&($t=null,yt=0,du()),U}function $3(){for(;mt!==null;)Cy(mt)}function U3(s,o){var f=jt;jt|=2;var v=Sy(),A=wy();$t!==s||yt!==o?(Uu=null,$u=Re()+500,Sa(s,o)):ba=He(s,o);e:do try{if(Ot!==0&&mt!==null){o=mt;var T=gr;t:switch(Ot){case 1:Ot=0,gr=null,wa(s,o,T,1);break;case 2:case 9:if(O1(T)){Ot=0,gr=null,ky(o);break}o=function(){Ot!==2&&Ot!==9||$t!==s||(Ot=7),ls(s)},T.then(o,o);break e;case 3:Ot=7;break e;case 4:Ot=5;break e;case 7:O1(T)?(Ot=0,gr=null,ky(o)):(Ot=0,gr=null,wa(s,o,T,7));break;case 5:var U=null;switch(mt.tag){case 26:U=mt.memoizedState;case 5:case 27:var Z=mt;if(U?ub(U):Z.stateNode.complete){Ot=0,gr=null;var ne=Z.sibling;if(ne!==null)mt=ne;else{var fe=Z.return;fe!==null?(mt=fe,Wu(fe)):mt=null}break t}}Ot=0,gr=null,wa(s,o,T,5);break;case 6:Ot=0,gr=null,wa(s,o,T,6);break;case 8:Np(),on=6;break e;default:throw Error(r(462))}}V3();break}catch(xe){xy(s,xe)}while(!0);return Es=mo=null,W.H=v,W.A=A,jt=f,mt!==null?0:($t=null,yt=0,du(),on)}function V3(){for(;mt!==null&&!ye();)Cy(mt)}function Cy(s){var o=K0(s.alternate,s,Is);s.memoizedProps=s.pendingProps,o===null?Wu(s):mt=o}function ky(s){var o=s,f=o.alternate;switch(o.tag){case 15:case 0:o=$0(f,o,o.pendingProps,o.type,void 0,yt);break;case 11:o=$0(f,o,o.pendingProps,o.type.render,o.ref,yt);break;case 5:Vh(o);default:X0(f,o),o=mt=w1(o,Is),o=K0(f,o,Is)}s.memoizedProps=s.pendingProps,o===null?Wu(s):mt=o}function wa(s,o,f,v){Es=mo=null,Vh(o),fa=null,Nl=0;var A=o.return;try{if(D3(s,A,o,f,yt)){on=1,Mu(s,jr(f,s.current)),mt=null;return}}catch(T){if(A!==null)throw mt=A,T;on=1,Mu(s,jr(f,s.current)),mt=null;return}o.flags&32768?(wt||v===1?s=!0:ba||(yt&536870912)!==0?s=!1:(bi=s=!0,(v===2||v===9||v===3||v===6)&&(v=pr.current,v!==null&&v.tag===13&&(v.flags|=16384))),Ey(o,s)):Wu(o)}function Wu(s){var o=s;do{if((o.flags&32768)!==0){Ey(o,bi);return}s=o.return;var f=L3(o.alternate,o,Is);if(f!==null){mt=f;return}if(o=o.sibling,o!==null){mt=o;return}mt=o=s}while(o!==null);on===0&&(on=5)}function Ey(s,o){do{var f=I3(s.alternate,s);if(f!==null){f.flags&=32767,mt=f;return}if(f=s.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!o&&(s=s.sibling,s!==null)){mt=s;return}mt=s=f}while(s!==null);on=6,mt=null}function Ay(s,o,f,v,A,T,U,Z,ne){s.cancelPendingCommit=null;do Gu();while(bn!==0);if((jt&6)!==0)throw Error(r(327));if(o!==null){if(o===s.current)throw Error(r(177));if(T=o.lanes|o.childLanes,T|=vh,Tt(s,f,T,U,Z,ne),s===$t&&(mt=$t=null,yt=0),_a=o,Si=s,Ps=f,kp=T,Ep=A,gy=v,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,K3(Ne,function(){return Dy(),null})):(s.callbackNode=null,s.callbackPriority=0),v=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||v){v=W.T,W.T=null,A=X.p,X.p=2,U=jt,jt|=4;try{P3(s,o,f)}finally{jt=U,X.p=A,W.T=v}}bn=1,Ny(),Ry(),jy()}}function Ny(){if(bn===1){bn=0;var s=Si,o=_a,f=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||f){f=W.T,W.T=null;var v=X.p;X.p=2;var A=jt;jt|=4;try{ly(o,s);var T=Hp,U=p1(s.containerInfo),Z=T.focusedElem,ne=T.selectionRange;if(U!==Z&&Z&&Z.ownerDocument&&h1(Z.ownerDocument.documentElement,Z)){if(ne!==null&&fh(Z)){var fe=ne.start,xe=ne.end;if(xe===void 0&&(xe=fe),"selectionStart"in Z)Z.selectionStart=fe,Z.selectionEnd=Math.min(xe,Z.value.length);else{var Ce=Z.ownerDocument||document,pe=Ce&&Ce.defaultView||window;if(pe.getSelection){var ve=pe.getSelection(),Ye=Z.textContent.length,it=Math.min(ne.start,Ye),Bt=ne.end===void 0?it:Math.min(ne.end,Ye);!ve.extend&&it>Bt&&(U=Bt,Bt=it,it=U);var le=f1(Z,it),ie=f1(Z,Bt);if(le&&ie&&(ve.rangeCount!==1||ve.anchorNode!==le.node||ve.anchorOffset!==le.offset||ve.focusNode!==ie.node||ve.focusOffset!==ie.offset)){var ue=Ce.createRange();ue.setStart(le.node,le.offset),ve.removeAllRanges(),it>Bt?(ve.addRange(ue),ve.extend(ie.node,ie.offset)):(ue.setEnd(ie.node,ie.offset),ve.addRange(ue))}}}}for(Ce=[],ve=Z;ve=ve.parentNode;)ve.nodeType===1&&Ce.push({element:ve,left:ve.scrollLeft,top:ve.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<Ce.length;Z++){var Se=Ce[Z];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}id=!!Fp,Hp=Fp=null}finally{jt=A,X.p=v,W.T=f}}s.current=o,bn=2}}function Ry(){if(bn===2){bn=0;var s=Si,o=_a,f=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||f){f=W.T,W.T=null;var v=X.p;X.p=2;var A=jt;jt|=4;try{ry(s,o.alternate,o)}finally{jt=A,X.p=v,W.T=f}}bn=3}}function jy(){if(bn===4||bn===3){bn=0,Me();var s=Si,o=_a,f=Ps,v=gy;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?bn=5:(bn=0,_a=Si=null,Ty(s,s.pendingLanes));var A=s.pendingLanes;if(A===0&&(_i=null),vn(f),o=o.stateNode,Be&&typeof Be.onCommitFiberRoot=="function")try{Be.onCommitFiberRoot(lt,o,void 0,(o.current.flags&128)===128)}catch{}if(v!==null){o=W.T,A=X.p,X.p=2,W.T=null;try{for(var T=s.onRecoverableError,U=0;U<v.length;U++){var Z=v[U];T(Z.value,{componentStack:Z.stack})}}finally{W.T=o,X.p=A}}(Ps&3)!==0&&Gu(),ls(s),A=s.pendingLanes,(f&261930)!==0&&(A&42)!==0?s===Ap?ql++:(ql=0,Ap=s):ql=0,Wl(0)}}function Ty(s,o){(s.pooledCacheLanes&=o)===0&&(o=s.pooledCache,o!=null&&(s.pooledCache=null,El(o)))}function Gu(){return Ny(),Ry(),jy(),Dy()}function Dy(){if(bn!==5)return!1;var s=Si,o=kp;kp=0;var f=vn(Ps),v=W.T,A=X.p;try{X.p=32>f?32:f,W.T=null,f=Ep,Ep=null;var T=Si,U=Ps;if(bn=0,_a=Si=null,Ps=0,(jt&6)!==0)throw Error(r(331));var Z=jt;if(jt|=4,hy(T.current),uy(T,T.current,U,f),jt=Z,Wl(0,!1),Be&&typeof Be.onPostCommitFiberRoot=="function")try{Be.onPostCommitFiberRoot(lt,T)}catch{}return!0}finally{X.p=A,W.T=v,Ty(s,o)}}function My(s,o,f){o=jr(f,o),o=ip(s.stateNode,o,2),s=mi(s,o,2),s!==null&&(ot(s,2),ls(s))}function Lt(s,o,f){if(s.tag===3)My(s,s,f);else for(;o!==null;){if(o.tag===3){My(o,s,f);break}else if(o.tag===1){var v=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(_i===null||!_i.has(v))){s=jr(f,s),f=O0(2),v=mi(o,f,2),v!==null&&(L0(f,v,o,s),ot(v,2),ls(v));break}}o=o.return}}function jp(s,o,f){var v=s.pingCache;if(v===null){v=s.pingCache=new F3;var A=new Set;v.set(o,A)}else A=v.get(o),A===void 0&&(A=new Set,v.set(o,A));A.has(f)||(Sp=!0,A.add(f),s=q3.bind(null,s,o,f),o.then(s,s))}function q3(s,o,f){var v=s.pingCache;v!==null&&v.delete(o),s.pingedLanes|=s.suspendedLanes&f,s.warmLanes&=~f,$t===s&&(yt&f)===f&&(on===4||on===3&&(yt&62914560)===yt&&300>Re()-Hu?(jt&2)===0&&Sa(s,0):wp|=f,xa===yt&&(xa=0)),ls(s)}function Oy(s,o){o===0&&(o=Oe()),s=fo(s,o),s!==null&&(ot(s,o),ls(s))}function W3(s){var o=s.memoizedState,f=0;o!==null&&(f=o.retryLane),Oy(s,f)}function G3(s,o){var f=0;switch(s.tag){case 31:case 13:var v=s.stateNode,A=s.memoizedState;A!==null&&(f=A.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(o),Oy(s,f)}function K3(s,o){return Ve(s,o)}var Ku=null,Ca=null,Tp=!1,Yu=!1,Dp=!1,Ci=0;function ls(s){s!==Ca&&s.next===null&&(Ca===null?Ku=Ca=s:Ca=Ca.next=s),Yu=!0,Tp||(Tp=!0,X3())}function Wl(s,o){if(!Dp&&Yu){Dp=!0;do for(var f=!1,v=Ku;v!==null;){if(s!==0){var A=v.pendingLanes;if(A===0)var T=0;else{var U=v.suspendedLanes,Z=v.pingedLanes;T=(1<<31-ze(42|s)+1)-1,T&=A&~(U&~Z),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(f=!0,zy(v,T))}else T=yt,T=ge(v,v===$t?T:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(T&3)===0||He(v,T)||(f=!0,zy(v,T));v=v.next}while(f);Dp=!1}}function Y3(){Ly()}function Ly(){Yu=Tp=!1;var s=0;Ci!==0&&o4()&&(s=Ci);for(var o=Re(),f=null,v=Ku;v!==null;){var A=v.next,T=Iy(v,o);T===0?(v.next=null,f===null?Ku=A:f.next=A,A===null&&(Ca=f)):(f=v,(s!==0||(T&3)!==0)&&(Yu=!0)),v=A}bn!==0&&bn!==5||Wl(s),Ci!==0&&(Ci=0)}function Iy(s,o){for(var f=s.suspendedLanes,v=s.pingedLanes,A=s.expirationTimes,T=s.pendingLanes&-62914561;0<T;){var U=31-ze(T),Z=1<<U,ne=A[U];ne===-1?((Z&f)===0||(Z&v)!==0)&&(A[U]=tt(Z,o)):ne<=o&&(s.expiredLanes|=Z),T&=~Z}if(o=$t,f=yt,f=ge(s,s===o?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),v=s.callbackNode,f===0||s===o&&(Ot===2||Ot===9)||s.cancelPendingCommit!==null)return v!==null&&v!==null&&qe(v),s.callbackNode=null,s.callbackPriority=0;if((f&3)===0||He(s,f)){if(o=f&-f,o===s.callbackPriority)return o;switch(v!==null&&qe(v),vn(f)){case 2:case 8:f=me;break;case 32:f=Ne;break;case 268435456:f=Ge;break;default:f=Ne}return v=Py.bind(null,s),f=Ve(f,v),s.callbackPriority=o,s.callbackNode=f,o}return v!==null&&v!==null&&qe(v),s.callbackPriority=2,s.callbackNode=null,2}function Py(s,o){if(bn!==0&&bn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var f=s.callbackNode;if(Gu()&&s.callbackNode!==f)return null;var v=yt;return v=ge(s,s===$t?v:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),v===0?null:(yy(s,v,o),Iy(s,Re()),s.callbackNode!=null&&s.callbackNode===f?Py.bind(null,s):null)}function zy(s,o){if(Gu())return null;yy(s,o,!0)}function X3(){l4(function(){(jt&6)!==0?Ve(oe,Y3):Ly()})}function Mp(){if(Ci===0){var s=ca;s===0&&(s=gn,gn<<=1,(gn&261888)===0&&(gn=256)),Ci=s}return Ci}function By(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:eo(""+s)}function Fy(s,o){var f=o.ownerDocument.createElement("input");return f.name=o.name,f.value=o.value,s.id&&f.setAttribute("form",s.id),o.parentNode.insertBefore(f,o),s=new FormData(s),f.parentNode.removeChild(f),s}function Q3(s,o,f,v,A){if(o==="submit"&&f&&f.stateNode===A){var T=By((A[Dt]||null).action),U=v.submitter;U&&(o=(o=U[Dt]||null)?By(o.formAction):U.getAttribute("formAction"),o!==null&&(T=o,U=null));var Z=new so("action","action",null,v,A);s.push({event:Z,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(Ci!==0){var ne=U?Fy(A,U):new FormData(A);Jh(f,{pending:!0,data:ne,method:A.method,action:T},null,ne)}}else typeof T=="function"&&(Z.preventDefault(),ne=U?Fy(A,U):new FormData(A),Jh(f,{pending:!0,data:ne,method:A.method,action:T},T,ne))},currentTarget:A}]})}}for(var Op=0;Op<gh.length;Op++){var Lp=gh[Op],Z3=Lp.toLowerCase(),J3=Lp[0].toUpperCase()+Lp.slice(1);Wr(Z3,"on"+J3)}Wr(v1,"onAnimationEnd"),Wr(y1,"onAnimationIteration"),Wr(b1,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(m3,"onTransitionRun"),Wr(g3,"onTransitionStart"),Wr(v3,"onTransitionCancel"),Wr(x1,"onTransitionEnd"),cr("onMouseEnter",["mouseout","mouseover"]),cr("onMouseLeave",["mouseout","mouseover"]),cr("onPointerEnter",["pointerout","pointerover"]),cr("onPointerLeave",["pointerout","pointerover"]),Zn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gl="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(" "),e4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gl));function Hy(s,o){o=(o&4)!==0;for(var f=0;f<s.length;f++){var v=s[f],A=v.event;v=v.listeners;e:{var T=void 0;if(o)for(var U=v.length-1;0<=U;U--){var Z=v[U],ne=Z.instance,fe=Z.currentTarget;if(Z=Z.listener,ne!==T&&A.isPropagationStopped())break e;T=Z,A.currentTarget=fe;try{T(A)}catch(xe){uu(xe)}A.currentTarget=null,T=ne}else for(U=0;U<v.length;U++){if(Z=v[U],ne=Z.instance,fe=Z.currentTarget,Z=Z.listener,ne!==T&&A.isPropagationStopped())break e;T=Z,A.currentTarget=fe;try{T(A)}catch(xe){uu(xe)}A.currentTarget=null,T=ne}}}}function gt(s,o){var f=o[bs];f===void 0&&(f=o[bs]=new Set);var v=s+"__bubble";f.has(v)||($y(o,s,2,!1),f.add(v))}function Ip(s,o,f){var v=0;o&&(v|=4),$y(f,s,v,o)}var Xu="_reactListening"+Math.random().toString(36).slice(2);function Pp(s){if(!s[Xu]){s[Xu]=!0,Ur.forEach(function(f){f!=="selectionchange"&&(e4.has(f)||Ip(f,!1,s),Ip(f,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[Xu]||(o[Xu]=!0,Ip("selectionchange",!1,o))}}function $y(s,o,f,v){switch(vb(o)){case 2:var A=N4;break;case 8:A=R4;break;default:A=Zp}f=A.bind(null,o,f,s),A=void 0,!Yo||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(A=!0),v?A!==void 0?s.addEventListener(o,f,{capture:!0,passive:A}):s.addEventListener(o,f,!0):A!==void 0?s.addEventListener(o,f,{passive:A}):s.addEventListener(o,f,!1)}function zp(s,o,f,v,A){var T=v;if((o&1)===0&&(o&2)===0&&v!==null)e:for(;;){if(v===null)return;var U=v.tag;if(U===3||U===4){var Z=v.stateNode.containerInfo;if(Z===A)break;if(U===4)for(U=v.return;U!==null;){var ne=U.tag;if((ne===3||ne===4)&&U.stateNode.containerInfo===A)return;U=U.return}for(;Z!==null;){if(U=Bn(Z),U===null)return;if(ne=U.tag,ne===5||ne===6||ne===26||ne===27){v=T=U;continue e}Z=Z.parentNode}}v=v.return}to(function(){var fe=T,xe=hl(f),Ce=[];e:{var pe=_1.get(s);if(pe!==void 0){var ve=so,Ye=s;switch(s){case"keypress":if(Xo(f)===0)break e;case"keydown":case"keyup":ve=_t;break;case"focusin":Ye="focus",ve=Jo;break;case"focusout":Ye="blur",ve=Jo;break;case"beforeblur":case"afterblur":ve=Jo;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ve=nu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=ih;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=ao;break;case v1:case y1:case b1:ve=ru;break;case x1:ve=lo;break;case"scroll":case"scrollend":ve=rh;break;case"wheel":ve=e3;break;case"copy":case"cut":case"paste":ve=li;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=St;break;case"toggle":case"beforetoggle":ve=n3}var it=(o&4)!==0,Bt=!it&&(s==="scroll"||s==="scrollend"),le=it?pe!==null?pe+"Capture":null:pe;it=[];for(var ie=fe,ue;ie!==null;){var Se=ie;if(ue=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||ue===null||le===null||(Se=ai(ie,le),Se!=null&&it.push(Kl(ie,Se,ue))),Bt)break;ie=ie.return}0<it.length&&(pe=new ve(pe,Ye,null,f,xe),Ce.push({event:pe,listeners:it}))}}if((o&7)===0){e:{if(pe=s==="mouseover"||s==="pointerover",ve=s==="mouseout"||s==="pointerout",pe&&f!==fl&&(Ye=f.relatedTarget||f.fromElement)&&(Bn(Ye)||Ye[jn]))break e;if((ve||pe)&&(pe=xe.window===xe?xe:(pe=xe.ownerDocument)?pe.defaultView||pe.parentWindow:window,ve?(Ye=f.relatedTarget||f.toElement,ve=fe,Ye=Ye?Bn(Ye):null,Ye!==null&&(Bt=l(Ye),it=Ye.tag,Ye!==Bt||it!==5&&it!==27&&it!==6)&&(Ye=null)):(ve=null,Ye=fe),ve!==Ye)){if(it=nu,Se="onMouseLeave",le="onMouseEnter",ie="mouse",(s==="pointerout"||s==="pointerover")&&(it=St,Se="onPointerLeave",le="onPointerEnter",ie="pointer"),Bt=ve==null?pe:Gn(ve),ue=Ye==null?pe:Gn(Ye),pe=new it(Se,ie+"leave",ve,f,xe),pe.target=Bt,pe.relatedTarget=ue,Se=null,Bn(xe)===fe&&(it=new it(le,ie+"enter",Ye,f,xe),it.target=ue,it.relatedTarget=Bt,Se=it),Bt=Se,ve&&Ye)t:{for(it=t4,le=ve,ie=Ye,ue=0,Se=le;Se;Se=it(Se))ue++;Se=0;for(var nt=ie;nt;nt=it(nt))Se++;for(;0<ue-Se;)le=it(le),ue--;for(;0<Se-ue;)ie=it(ie),Se--;for(;ue--;){if(le===ie||ie!==null&&le===ie.alternate){it=le;break t}le=it(le),ie=it(ie)}it=null}else it=null;ve!==null&&Uy(Ce,pe,ve,it,!1),Ye!==null&&Bt!==null&&Uy(Ce,Bt,Ye,it,!0)}}e:{if(pe=fe?Gn(fe):window,ve=pe.nodeName&&pe.nodeName.toLowerCase(),ve==="select"||ve==="input"&&pe.type==="file")var Et=o1;else if(s1(pe))if(a1)Et=f3;else{Et=u3;var et=c3}else ve=pe.nodeName,!ve||ve.toLowerCase()!=="input"||pe.type!=="checkbox"&&pe.type!=="radio"?fe&&ni(fe.elementType)&&(Et=o1):Et=d3;if(Et&&(Et=Et(s,fe))){i1(Ce,Et,f,xe);break e}et&&et(s,pe,fe),s==="focusout"&&fe&&pe.type==="number"&&fe.memoizedProps.value!=null&&Yt(pe,"number",pe.value)}switch(et=fe?Gn(fe):window,s){case"focusin":(s1(et)||et.contentEditable==="true")&&(ta=et,hh=fe,wl=null);break;case"focusout":wl=hh=ta=null;break;case"mousedown":ph=!0;break;case"contextmenu":case"mouseup":case"dragend":ph=!1,m1(Ce,f,xe);break;case"selectionchange":if(p3)break;case"keydown":case"keyup":m1(Ce,f,xe)}var ut;if(ch)e:{switch(s){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else ea?n1(s,f)&&(bt="onCompositionEnd"):s==="keydown"&&f.keyCode===229&&(bt="onCompositionStart");bt&&(Jv&&f.locale!=="ko"&&(ea||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&ea&&(ut=eu()):(ss=xe,pl="value"in ss?ss.value:ss.textContent,ea=!0)),et=Qu(fe,bt),0<et.length&&(bt=new vl(bt,s,null,f,xe),Ce.push({event:bt,listeners:et}),ut?bt.data=ut:(ut=r1(f),ut!==null&&(bt.data=ut)))),(ut=s3?i3(s,f):o3(s,f))&&(bt=Qu(fe,"onBeforeInput"),0<bt.length&&(et=new vl("onBeforeInput","beforeinput",null,f,xe),Ce.push({event:et,listeners:bt}),et.data=ut)),Q3(Ce,s,fe,f,xe)}Hy(Ce,o)})}function Kl(s,o,f){return{instance:s,listener:o,currentTarget:f}}function Qu(s,o){for(var f=o+"Capture",v=[];s!==null;){var A=s,T=A.stateNode;if(A=A.tag,A!==5&&A!==26&&A!==27||T===null||(A=ai(s,f),A!=null&&v.unshift(Kl(s,A,T)),A=ai(s,o),A!=null&&v.push(Kl(s,A,T))),s.tag===3)return v;s=s.return}return[]}function t4(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function Uy(s,o,f,v,A){for(var T=o._reactName,U=[];f!==null&&f!==v;){var Z=f,ne=Z.alternate,fe=Z.stateNode;if(Z=Z.tag,ne!==null&&ne===v)break;Z!==5&&Z!==26&&Z!==27||fe===null||(ne=fe,A?(fe=ai(f,T),fe!=null&&U.unshift(Kl(f,fe,ne))):A||(fe=ai(f,T),fe!=null&&U.push(Kl(f,fe,ne)))),f=f.return}U.length!==0&&s.push({event:o,listeners:U})}var n4=/\r\n?/g,r4=/\u0000|\uFFFD/g;function Vy(s){return(typeof s=="string"?s:""+s).replace(n4,`
49
+ `).replace(r4,"")}function qy(s,o){return o=Vy(o),Vy(s)===o}function zt(s,o,f,v,A,T){switch(f){case"children":typeof v=="string"?o==="body"||o==="textarea"&&v===""||ei(s,v):(typeof v=="number"||typeof v=="bigint")&&o!=="body"&&ei(s,""+v);break;case"className":Ar(s,"class",v);break;case"tabIndex":Ar(s,"tabindex",v);break;case"dir":case"role":case"viewBox":case"width":case"height":Ar(s,f,v);break;case"style":Jc(s,v,T);break;case"data":if(o!=="object"){Ar(s,"data",v);break}case"src":case"href":if(v===""&&(o!=="a"||f!=="href")){s.removeAttribute(f);break}if(v==null||typeof v=="function"||typeof v=="symbol"||typeof v=="boolean"){s.removeAttribute(f);break}v=eo(""+v),s.setAttribute(f,v);break;case"action":case"formAction":if(typeof v=="function"){s.setAttribute(f,"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 T=="function"&&(f==="formAction"?(o!=="input"&&zt(s,o,"name",A.name,A,null),zt(s,o,"formEncType",A.formEncType,A,null),zt(s,o,"formMethod",A.formMethod,A,null),zt(s,o,"formTarget",A.formTarget,A,null)):(zt(s,o,"encType",A.encType,A,null),zt(s,o,"method",A.method,A,null),zt(s,o,"target",A.target,A,null)));if(v==null||typeof v=="symbol"||typeof v=="boolean"){s.removeAttribute(f);break}v=eo(""+v),s.setAttribute(f,v);break;case"onClick":v!=null&&(s.onclick=qr);break;case"onScroll":v!=null&&gt("scroll",s);break;case"onScrollEnd":v!=null&&gt("scrollend",s);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(f=v.__html,f!=null){if(A.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"multiple":s.multiple=v&&typeof v!="function"&&typeof v!="symbol";break;case"muted":s.muted=v&&typeof v!="function"&&typeof v!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(v==null||typeof v=="function"||typeof v=="boolean"||typeof v=="symbol"){s.removeAttribute("xlink:href");break}f=eo(""+v),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":v!=null&&typeof v!="function"&&typeof v!="symbol"?s.setAttribute(f,""+v):s.removeAttribute(f);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":v&&typeof v!="function"&&typeof v!="symbol"?s.setAttribute(f,""):s.removeAttribute(f);break;case"capture":case"download":v===!0?s.setAttribute(f,""):v!==!1&&v!=null&&typeof v!="function"&&typeof v!="symbol"?s.setAttribute(f,v):s.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":v!=null&&typeof v!="function"&&typeof v!="symbol"&&!isNaN(v)&&1<=v?s.setAttribute(f,v):s.removeAttribute(f);break;case"rowSpan":case"start":v==null||typeof v=="function"||typeof v=="symbol"||isNaN(v)?s.removeAttribute(f):s.setAttribute(f,v);break;case"popover":gt("beforetoggle",s),gt("toggle",s),dr(s,"popover",v);break;case"xlinkActuate":yn(s,"http://www.w3.org/1999/xlink","xlink:actuate",v);break;case"xlinkArcrole":yn(s,"http://www.w3.org/1999/xlink","xlink:arcrole",v);break;case"xlinkRole":yn(s,"http://www.w3.org/1999/xlink","xlink:role",v);break;case"xlinkShow":yn(s,"http://www.w3.org/1999/xlink","xlink:show",v);break;case"xlinkTitle":yn(s,"http://www.w3.org/1999/xlink","xlink:title",v);break;case"xlinkType":yn(s,"http://www.w3.org/1999/xlink","xlink:type",v);break;case"xmlBase":yn(s,"http://www.w3.org/XML/1998/namespace","xml:base",v);break;case"xmlLang":yn(s,"http://www.w3.org/XML/1998/namespace","xml:lang",v);break;case"xmlSpace":yn(s,"http://www.w3.org/XML/1998/namespace","xml:space",v);break;case"is":dr(s,"is",v);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=ri.get(f)||f,dr(s,f,v))}}function Bp(s,o,f,v,A,T){switch(f){case"style":Jc(s,v,T);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(f=v.__html,f!=null){if(A.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"children":typeof v=="string"?ei(s,v):(typeof v=="number"||typeof v=="bigint")&&ei(s,""+v);break;case"onScroll":v!=null&&gt("scroll",s);break;case"onScrollEnd":v!=null&&gt("scrollend",s);break;case"onClick":v!=null&&(s.onclick=qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_s.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(A=f.endsWith("Capture"),o=f.slice(2,A?f.length-7:void 0),T=s[Dt]||null,T=T!=null?T[f]:null,typeof T=="function"&&s.removeEventListener(o,T,A),typeof v=="function")){typeof T!="function"&&T!==null&&(f in s?s[f]=null:s.hasAttribute(f)&&s.removeAttribute(f)),s.addEventListener(o,v,A);break e}f in s?s[f]=v:v===!0?s.setAttribute(f,""):dr(s,f,v)}}}function Ln(s,o,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gt("error",s),gt("load",s);var v=!1,A=!1,T;for(T in f)if(f.hasOwnProperty(T)){var U=f[T];if(U!=null)switch(T){case"src":v=!0;break;case"srcSet":A=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:zt(s,o,T,U,f,null)}}A&&zt(s,o,"srcSet",f.srcSet,f,null),v&&zt(s,o,"src",f.src,f,null);return;case"input":gt("invalid",s);var Z=T=U=A=null,ne=null,fe=null;for(v in f)if(f.hasOwnProperty(v)){var xe=f[v];if(xe!=null)switch(v){case"name":A=xe;break;case"type":U=xe;break;case"checked":ne=xe;break;case"defaultChecked":fe=xe;break;case"value":T=xe;break;case"defaultValue":Z=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,o));break;default:zt(s,o,v,xe,f,null)}}Zc(s,T,Z,ne,fe,U,A,!1);return;case"select":gt("invalid",s),v=U=T=null;for(A in f)if(f.hasOwnProperty(A)&&(Z=f[A],Z!=null))switch(A){case"value":T=Z;break;case"defaultValue":U=Z;break;case"multiple":v=Z;default:zt(s,o,A,Z,f,null)}o=T,f=U,s.multiple=!!v,o!=null?It(s,!!v,o,!1):f!=null&&It(s,!!v,f,!0);return;case"textarea":gt("invalid",s),T=A=v=null;for(U in f)if(f.hasOwnProperty(U)&&(Z=f[U],Z!=null))switch(U){case"value":v=Z;break;case"defaultValue":A=Z;break;case"children":T=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(91));break;default:zt(s,o,U,Z,f,null)}Go(s,v,A,T);return;case"option":for(ne in f)if(f.hasOwnProperty(ne)&&(v=f[ne],v!=null))switch(ne){case"selected":s.selected=v&&typeof v!="function"&&typeof v!="symbol";break;default:zt(s,o,ne,v,f,null)}return;case"dialog":gt("beforetoggle",s),gt("toggle",s),gt("cancel",s),gt("close",s);break;case"iframe":case"object":gt("load",s);break;case"video":case"audio":for(v=0;v<Gl.length;v++)gt(Gl[v],s);break;case"image":gt("error",s),gt("load",s);break;case"details":gt("toggle",s);break;case"embed":case"source":case"link":gt("error",s),gt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in f)if(f.hasOwnProperty(fe)&&(v=f[fe],v!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:zt(s,o,fe,v,f,null)}return;default:if(ni(o)){for(xe in f)f.hasOwnProperty(xe)&&(v=f[xe],v!==void 0&&Bp(s,o,xe,v,f,void 0));return}}for(Z in f)f.hasOwnProperty(Z)&&(v=f[Z],v!=null&&zt(s,o,Z,v,f,null))}function s4(s,o,f,v){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var A=null,T=null,U=null,Z=null,ne=null,fe=null,xe=null;for(ve in f){var Ce=f[ve];if(f.hasOwnProperty(ve)&&Ce!=null)switch(ve){case"checked":break;case"value":break;case"defaultValue":ne=Ce;default:v.hasOwnProperty(ve)||zt(s,o,ve,null,v,Ce)}}for(var pe in v){var ve=v[pe];if(Ce=f[pe],v.hasOwnProperty(pe)&&(ve!=null||Ce!=null))switch(pe){case"type":T=ve;break;case"name":A=ve;break;case"checked":fe=ve;break;case"defaultChecked":xe=ve;break;case"value":U=ve;break;case"defaultValue":Z=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,o));break;default:ve!==Ce&&zt(s,o,pe,ve,v,Ce)}}Wo(s,U,Z,ne,fe,xe,T,A);return;case"select":ve=U=Z=pe=null;for(T in f)if(ne=f[T],f.hasOwnProperty(T)&&ne!=null)switch(T){case"value":break;case"multiple":ve=ne;default:v.hasOwnProperty(T)||zt(s,o,T,null,v,ne)}for(A in v)if(T=v[A],ne=f[A],v.hasOwnProperty(A)&&(T!=null||ne!=null))switch(A){case"value":pe=T;break;case"defaultValue":Z=T;break;case"multiple":U=T;default:T!==ne&&zt(s,o,A,T,v,ne)}o=Z,f=U,v=ve,pe!=null?It(s,!!f,pe,!1):!!v!=!!f&&(o!=null?It(s,!!f,o,!0):It(s,!!f,f?[]:"",!1));return;case"textarea":ve=pe=null;for(Z in f)if(A=f[Z],f.hasOwnProperty(Z)&&A!=null&&!v.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:zt(s,o,Z,null,v,A)}for(U in v)if(A=v[U],T=f[U],v.hasOwnProperty(U)&&(A!=null||T!=null))switch(U){case"value":pe=A;break;case"defaultValue":ve=A;break;case"children":break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:A!==T&&zt(s,o,U,A,v,T)}Ji(s,pe,ve);return;case"option":for(var Ye in f)if(pe=f[Ye],f.hasOwnProperty(Ye)&&pe!=null&&!v.hasOwnProperty(Ye))switch(Ye){case"selected":s.selected=!1;break;default:zt(s,o,Ye,null,v,pe)}for(ne in v)if(pe=v[ne],ve=f[ne],v.hasOwnProperty(ne)&&pe!==ve&&(pe!=null||ve!=null))switch(ne){case"selected":s.selected=pe&&typeof pe!="function"&&typeof pe!="symbol";break;default:zt(s,o,ne,pe,v,ve)}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 it in f)pe=f[it],f.hasOwnProperty(it)&&pe!=null&&!v.hasOwnProperty(it)&&zt(s,o,it,null,v,pe);for(fe in v)if(pe=v[fe],ve=f[fe],v.hasOwnProperty(fe)&&pe!==ve&&(pe!=null||ve!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,o));break;default:zt(s,o,fe,pe,v,ve)}return;default:if(ni(o)){for(var Bt in f)pe=f[Bt],f.hasOwnProperty(Bt)&&pe!==void 0&&!v.hasOwnProperty(Bt)&&Bp(s,o,Bt,void 0,v,pe);for(xe in v)pe=v[xe],ve=f[xe],!v.hasOwnProperty(xe)||pe===ve||pe===void 0&&ve===void 0||Bp(s,o,xe,pe,v,ve);return}}for(var le in f)pe=f[le],f.hasOwnProperty(le)&&pe!=null&&!v.hasOwnProperty(le)&&zt(s,o,le,null,v,pe);for(Ce in v)pe=v[Ce],ve=f[Ce],!v.hasOwnProperty(Ce)||pe===ve||pe==null&&ve==null||zt(s,o,Ce,pe,v,ve)}function Wy(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i4(){if(typeof performance.getEntriesByType=="function"){for(var s=0,o=0,f=performance.getEntriesByType("resource"),v=0;v<f.length;v++){var A=f[v],T=A.transferSize,U=A.initiatorType,Z=A.duration;if(T&&Z&&Wy(U)){for(U=0,Z=A.responseEnd,v+=1;v<f.length;v++){var ne=f[v],fe=ne.startTime;if(fe>Z)break;var xe=ne.transferSize,Ce=ne.initiatorType;xe&&Wy(Ce)&&(ne=ne.responseEnd,U+=xe*(ne<Z?1:(Z-fe)/(ne-fe)))}if(--v,o+=8*(T+U)/(A.duration/1e3),s++,10<s)break}}if(0<s)return o/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Fp=null,Hp=null;function Zu(s){return s.nodeType===9?s:s.ownerDocument}function Gy(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ky(s,o){if(s===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&o==="foreignObject"?0:s}function $p(s,o){return s==="textarea"||s==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Up=null;function o4(){var s=window.event;return s&&s.type==="popstate"?s===Up?!1:(Up=s,!0):(Up=null,!1)}var Yy=typeof setTimeout=="function"?setTimeout:void 0,a4=typeof clearTimeout=="function"?clearTimeout:void 0,Xy=typeof Promise=="function"?Promise:void 0,l4=typeof queueMicrotask=="function"?queueMicrotask:typeof Xy<"u"?function(s){return Xy.resolve(null).then(s).catch(c4)}:Yy;function c4(s){setTimeout(function(){throw s})}function ki(s){return s==="head"}function Qy(s,o){var f=o,v=0;do{var A=f.nextSibling;if(s.removeChild(f),A&&A.nodeType===8)if(f=A.data,f==="/$"||f==="/&"){if(v===0){s.removeChild(A),Na(o);return}v--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")v++;else if(f==="html")Yl(s.ownerDocument.documentElement);else if(f==="head"){f=s.ownerDocument.head,Yl(f);for(var T=f.firstChild;T;){var U=T.nextSibling,Z=T.nodeName;T[kr]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&T.rel.toLowerCase()==="stylesheet"||f.removeChild(T),T=U}}else f==="body"&&Yl(s.ownerDocument.body);f=A}while(f);Na(o)}function Zy(s,o){var f=s;s=0;do{var v=f.nextSibling;if(f.nodeType===1?o?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(o?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),v&&v.nodeType===8)if(f=v.data,f==="/$"){if(s===0)break;s--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||s++;f=v}while(f)}function Vp(s){var o=s.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var f=o;switch(o=o.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":Vp(f),Er(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}s.removeChild(f)}}function u4(s,o,f,v){for(;s.nodeType===1;){var A=f;if(s.nodeName.toLowerCase()!==o.toLowerCase()){if(!v&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(v){if(!s[kr])switch(o){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(T=s.getAttribute("rel"),T==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(T!==A.rel||s.getAttribute("href")!==(A.href==null||A.href===""?null:A.href)||s.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin)||s.getAttribute("title")!==(A.title==null?null:A.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(T=s.getAttribute("src"),(T!==(A.src==null?null:A.src)||s.getAttribute("type")!==(A.type==null?null:A.type)||s.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin))&&T&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(o==="input"&&s.type==="hidden"){var T=A.name==null?null:""+A.name;if(A.type==="hidden"&&s.getAttribute("name")===T)return s}else return s;if(s=Lr(s.nextSibling),s===null)break}return null}function d4(s,o,f){if(o==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!f||(s=Lr(s.nextSibling),s===null))return null;return s}function Jy(s,o){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=Lr(s.nextSibling),s===null))return null;return s}function qp(s){return s.data==="$?"||s.data==="$~"}function Wp(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function f4(s,o){var f=s.ownerDocument;if(s.data==="$~")s._reactRetry=o;else if(s.data!=="$?"||f.readyState!=="loading")o();else{var v=function(){o(),f.removeEventListener("DOMContentLoaded",v)};f.addEventListener("DOMContentLoaded",v),s._reactRetry=v}}function Lr(s){for(;s!=null;s=s.nextSibling){var o=s.nodeType;if(o===1||o===3)break;if(o===8){if(o=s.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return s}var Gp=null;function eb(s){s=s.nextSibling;for(var o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="/$"||f==="/&"){if(o===0)return Lr(s.nextSibling);o--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||o++}s=s.nextSibling}return null}function tb(s){s=s.previousSibling;for(var o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(o===0)return s;o--}else f!=="/$"&&f!=="/&"||o++}s=s.previousSibling}return null}function nb(s,o,f){switch(o=Zu(f),s){case"html":if(s=o.documentElement,!s)throw Error(r(452));return s;case"head":if(s=o.head,!s)throw Error(r(453));return s;case"body":if(s=o.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Yl(s){for(var o=s.attributes;o.length;)s.removeAttributeNode(o[0]);Er(s)}var Ir=new Map,rb=new Set;function Ju(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var zs=X.d;X.d={f:h4,r:p4,D:m4,C:g4,L:v4,m:y4,X:x4,S:b4,M:_4};function h4(){var s=zs.f(),o=Vu();return s||o}function p4(s){var o=Wn(s);o!==null&&o.tag===5&&o.type==="form"?x0(o):zs.r(s)}var ka=typeof document>"u"?null:document;function sb(s,o,f){var v=ka;if(v&&typeof o=="string"&&o){var A=Fn(o);A='link[rel="'+s+'"][href="'+A+'"]',typeof f=="string"&&(A+='[crossorigin="'+f+'"]'),rb.has(A)||(rb.add(A),s={rel:s,crossOrigin:f,href:o},v.querySelector(A)===null&&(o=v.createElement("link"),Ln(o,"link",s),en(o),v.head.appendChild(o)))}}function m4(s){zs.D(s),sb("dns-prefetch",s,null)}function g4(s,o){zs.C(s,o),sb("preconnect",s,o)}function v4(s,o,f){zs.L(s,o,f);var v=ka;if(v&&s&&o){var A='link[rel="preload"][as="'+Fn(o)+'"]';o==="image"&&f&&f.imageSrcSet?(A+='[imagesrcset="'+Fn(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(A+='[imagesizes="'+Fn(f.imageSizes)+'"]')):A+='[href="'+Fn(s)+'"]';var T=A;switch(o){case"style":T=Ea(s);break;case"script":T=Aa(s)}Ir.has(T)||(s=p({rel:"preload",href:o==="image"&&f&&f.imageSrcSet?void 0:s,as:o},f),Ir.set(T,s),v.querySelector(A)!==null||o==="style"&&v.querySelector(Xl(T))||o==="script"&&v.querySelector(Ql(T))||(o=v.createElement("link"),Ln(o,"link",s),en(o),v.head.appendChild(o)))}}function y4(s,o){zs.m(s,o);var f=ka;if(f&&s){var v=o&&typeof o.as=="string"?o.as:"script",A='link[rel="modulepreload"][as="'+Fn(v)+'"][href="'+Fn(s)+'"]',T=A;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=Aa(s)}if(!Ir.has(T)&&(s=p({rel:"modulepreload",href:s},o),Ir.set(T,s),f.querySelector(A)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Ql(T)))return}v=f.createElement("link"),Ln(v,"link",s),en(v),f.head.appendChild(v)}}}function b4(s,o,f){zs.S(s,o,f);var v=ka;if(v&&s){var A=wn(v).hoistableStyles,T=Ea(s);o=o||"default";var U=A.get(T);if(!U){var Z={loading:0,preload:null};if(U=v.querySelector(Xl(T)))Z.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":o},f),(f=Ir.get(T))&&Kp(s,f);var ne=U=v.createElement("link");en(ne),Ln(ne,"link",s),ne._p=new Promise(function(fe,xe){ne.onload=fe,ne.onerror=xe}),ne.addEventListener("load",function(){Z.loading|=1}),ne.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,ed(U,o,v)}U={type:"stylesheet",instance:U,count:1,state:Z},A.set(T,U)}}}function x4(s,o){zs.X(s,o);var f=ka;if(f&&s){var v=wn(f).hoistableScripts,A=Aa(s),T=v.get(A);T||(T=f.querySelector(Ql(A)),T||(s=p({src:s,async:!0},o),(o=Ir.get(A))&&Yp(s,o),T=f.createElement("script"),en(T),Ln(T,"link",s),f.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},v.set(A,T))}}function _4(s,o){zs.M(s,o);var f=ka;if(f&&s){var v=wn(f).hoistableScripts,A=Aa(s),T=v.get(A);T||(T=f.querySelector(Ql(A)),T||(s=p({src:s,async:!0,type:"module"},o),(o=Ir.get(A))&&Yp(s,o),T=f.createElement("script"),en(T),Ln(T,"link",s),f.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},v.set(A,T))}}function ib(s,o,f,v){var A=(A=ee.current)?Ju(A):null;if(!A)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(o=Ea(f.href),f=wn(A).hoistableStyles,v=f.get(o),v||(v={type:"style",instance:null,count:0,state:null},f.set(o,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){s=Ea(f.href);var T=wn(A).hoistableStyles,U=T.get(s);if(U||(A=A.ownerDocument||A,U={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(s,U),(T=A.querySelector(Xl(s)))&&!T._p&&(U.instance=T,U.state.loading=5),Ir.has(s)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Ir.set(s,f),T||S4(A,s,f,U.state))),o&&v===null)throw Error(r(528,""));return U}if(o&&v!==null)throw Error(r(529,""));return null;case"script":return o=f.async,f=f.src,typeof f=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Aa(f),f=wn(A).hoistableScripts,v=f.get(o),v||(v={type:"script",instance:null,count:0,state:null},f.set(o,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Ea(s){return'href="'+Fn(s)+'"'}function Xl(s){return'link[rel="stylesheet"]['+s+"]"}function ob(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function S4(s,o,f,v){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?v.loading=1:(o=s.createElement("link"),v.preload=o,o.addEventListener("load",function(){return v.loading|=1}),o.addEventListener("error",function(){return v.loading|=2}),Ln(o,"link",f),en(o),s.head.appendChild(o))}function Aa(s){return'[src="'+Fn(s)+'"]'}function Ql(s){return"script[async]"+s}function ab(s,o,f){if(o.count++,o.instance===null)switch(o.type){case"style":var v=s.querySelector('style[data-href~="'+Fn(f.href)+'"]');if(v)return o.instance=v,en(v),v;var A=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return v=(s.ownerDocument||s).createElement("style"),en(v),Ln(v,"style",A),ed(v,f.precedence,s),o.instance=v;case"stylesheet":A=Ea(f.href);var T=s.querySelector(Xl(A));if(T)return o.state.loading|=4,o.instance=T,en(T),T;v=ob(f),(A=Ir.get(A))&&Kp(v,A),T=(s.ownerDocument||s).createElement("link"),en(T);var U=T;return U._p=new Promise(function(Z,ne){U.onload=Z,U.onerror=ne}),Ln(T,"link",v),o.state.loading|=4,ed(T,f.precedence,s),o.instance=T;case"script":return T=Aa(f.src),(A=s.querySelector(Ql(T)))?(o.instance=A,en(A),A):(v=f,(A=Ir.get(T))&&(v=p({},f),Yp(v,A)),s=s.ownerDocument||s,A=s.createElement("script"),en(A),Ln(A,"link",v),s.head.appendChild(A),o.instance=A);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(v=o.instance,o.state.loading|=4,ed(v,f.precedence,s));return o.instance}function ed(s,o,f){for(var v=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=v.length?v[v.length-1]:null,T=A,U=0;U<v.length;U++){var Z=v[U];if(Z.dataset.precedence===o)T=Z;else if(T!==A)break}T?T.parentNode.insertBefore(s,T.nextSibling):(o=f.nodeType===9?f.head:f,o.insertBefore(s,o.firstChild))}function Kp(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.title==null&&(s.title=o.title)}function Yp(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.integrity==null&&(s.integrity=o.integrity)}var td=null;function lb(s,o,f){if(td===null){var v=new Map,A=td=new Map;A.set(f,v)}else A=td,v=A.get(f),v||(v=new Map,A.set(f,v));if(v.has(s))return v;for(v.set(s,null),f=f.getElementsByTagName(s),A=0;A<f.length;A++){var T=f[A];if(!(T[kr]||T[Nt]||s==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var U=T.getAttribute(o)||"";U=s+U;var Z=v.get(U);Z?Z.push(T):v.set(U,[T])}}return v}function cb(s,o,f){s=s.ownerDocument||s,s.head.insertBefore(f,o==="title"?s.querySelector("head > title"):null)}function w4(s,o,f){if(f===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return s=o.disabled,typeof o.precedence=="string"&&s==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function ub(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function C4(s,o,f,v){if(f.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var A=Ea(v.href),T=o.querySelector(Xl(A));if(T){o=T._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=nd.bind(s),o.then(s,s)),f.state.loading|=4,f.instance=T,en(T);return}T=o.ownerDocument||o,v=ob(v),(A=Ir.get(A))&&Kp(v,A),T=T.createElement("link"),en(T);var U=T;U._p=new Promise(function(Z,ne){U.onload=Z,U.onerror=ne}),Ln(T,"link",v),f.instance=T}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(f,o),(o=f.state.preload)&&(f.state.loading&3)===0&&(s.count++,f=nd.bind(s),o.addEventListener("load",f),o.addEventListener("error",f))}}var Xp=0;function k4(s,o){return s.stylesheets&&s.count===0&&sd(s,s.stylesheets),0<s.count||0<s.imgCount?function(f){var v=setTimeout(function(){if(s.stylesheets&&sd(s,s.stylesheets),s.unsuspend){var T=s.unsuspend;s.unsuspend=null,T()}},6e4+o);0<s.imgBytes&&Xp===0&&(Xp=62500*i4());var A=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&sd(s,s.stylesheets),s.unsuspend)){var T=s.unsuspend;s.unsuspend=null,T()}},(s.imgBytes>Xp?50:800)+o);return s.unsuspend=f,function(){s.unsuspend=null,clearTimeout(v),clearTimeout(A)}}:null}function nd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sd(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var rd=null;function sd(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,rd=new Map,o.forEach(E4,s),rd=null,nd.call(s))}function E4(s,o){if(!(o.state.loading&4)){var f=rd.get(s);if(f)var v=f.get(null);else{f=new Map,rd.set(s,f);for(var A=s.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<A.length;T++){var U=A[T];(U.nodeName==="LINK"||U.getAttribute("media")!=="not all")&&(f.set(U.dataset.precedence,U),v=U)}v&&f.set(null,v)}A=o.instance,U=A.getAttribute("data-precedence"),T=f.get(U)||v,T===v&&f.set(null,A),f.set(U,A),this.count++,v=nd.bind(this),A.addEventListener("load",v),A.addEventListener("error",v),T?T.parentNode.insertBefore(A,T.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(A,s.firstChild)),o.state.loading|=4}}var Zl={$$typeof:x,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function A4(s,o,f,v,A,T,U,Z,ne){this.tag=1,this.containerInfo=s,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=Ie(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ie(0),this.hiddenUpdates=Ie(null),this.identifierPrefix=v,this.onUncaughtError=A,this.onCaughtError=T,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function db(s,o,f,v,A,T,U,Z,ne,fe,xe,Ce){return s=new A4(s,o,f,U,ne,fe,xe,Ce,Z),o=1,T===!0&&(o|=24),T=hr(3,null,null,o),s.current=T,T.stateNode=s,o=Rh(),o.refCount++,s.pooledCache=o,o.refCount++,T.memoizedState={element:v,isDehydrated:f,cache:o},Mh(T),s}function fb(s){return s?(s=sa,s):sa}function hb(s,o,f,v,A,T){A=fb(A),v.context===null?v.context=A:v.pendingContext=A,v=pi(o),v.payload={element:f},T=T===void 0?null:T,T!==null&&(v.callback=T),f=mi(s,v,o),f!==null&&(sr(f,s,o),jl(f,s,o))}function pb(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<o?f:o}}function Qp(s,o){pb(s,o),(s=s.alternate)&&pb(s,o)}function mb(s){if(s.tag===13||s.tag===31){var o=fo(s,67108864);o!==null&&sr(o,s,67108864),Qp(s,67108864)}}function gb(s){if(s.tag===13||s.tag===31){var o=yr();o=An(o);var f=fo(s,o);f!==null&&sr(f,s,o),Qp(s,o)}}var id=!0;function N4(s,o,f,v){var A=W.T;W.T=null;var T=X.p;try{X.p=2,Zp(s,o,f,v)}finally{X.p=T,W.T=A}}function R4(s,o,f,v){var A=W.T;W.T=null;var T=X.p;try{X.p=8,Zp(s,o,f,v)}finally{X.p=T,W.T=A}}function Zp(s,o,f,v){if(id){var A=Jp(v);if(A===null)zp(s,o,v,od,f),yb(s,v);else if(T4(A,s,o,f,v))v.stopPropagation();else if(yb(s,v),o&4&&-1<j4.indexOf(s)){for(;A!==null;){var T=Wn(A);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var U=Jt(T.pendingLanes);if(U!==0){var Z=T;for(Z.pendingLanes|=2,Z.entangledLanes|=2;U;){var ne=1<<31-ze(U);Z.entanglements[1]|=ne,U&=~ne}ls(T),(jt&6)===0&&($u=Re()+500,Wl(0))}}break;case 31:case 13:Z=fo(T,2),Z!==null&&sr(Z,T,2),Vu(),Qp(T,2)}if(T=Jp(v),T===null&&zp(s,o,v,od,f),T===A)break;A=T}A!==null&&v.stopPropagation()}else zp(s,o,v,null,f)}}function Jp(s){return s=hl(s),em(s)}var od=null;function em(s){if(od=null,s=Bn(s),s!==null){var o=l(s);if(o===null)s=null;else{var f=o.tag;if(f===13){if(s=c(o),s!==null)return s;s=null}else if(f===31){if(s=a(o),s!==null)return s;s=null}else if(f===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;s=null}else o!==s&&(s=null)}}return od=s,null}function vb(s){switch(s){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(we()){case oe:return 2;case me:return 8;case Ne:case Le:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var tm=!1,Ei=null,Ai=null,Ni=null,Jl=new Map,ec=new Map,Ri=[],j4="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 yb(s,o){switch(s){case"focusin":case"focusout":Ei=null;break;case"dragenter":case"dragleave":Ai=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":Jl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ec.delete(o.pointerId)}}function tc(s,o,f,v,A,T){return s===null||s.nativeEvent!==T?(s={blockedOn:o,domEventName:f,eventSystemFlags:v,nativeEvent:T,targetContainers:[A]},o!==null&&(o=Wn(o),o!==null&&mb(o)),s):(s.eventSystemFlags|=v,o=s.targetContainers,A!==null&&o.indexOf(A)===-1&&o.push(A),s)}function T4(s,o,f,v,A){switch(o){case"focusin":return Ei=tc(Ei,s,o,f,v,A),!0;case"dragenter":return Ai=tc(Ai,s,o,f,v,A),!0;case"mouseover":return Ni=tc(Ni,s,o,f,v,A),!0;case"pointerover":var T=A.pointerId;return Jl.set(T,tc(Jl.get(T)||null,s,o,f,v,A)),!0;case"gotpointercapture":return T=A.pointerId,ec.set(T,tc(ec.get(T)||null,s,o,f,v,A)),!0}return!1}function bb(s){var o=Bn(s.target);if(o!==null){var f=l(o);if(f!==null){if(o=f.tag,o===13){if(o=c(f),o!==null){s.blockedOn=o,Rn(s.priority,function(){gb(f)});return}}else if(o===31){if(o=a(f),o!==null){s.blockedOn=o,Rn(s.priority,function(){gb(f)});return}}else if(o===3&&f.stateNode.current.memoizedState.isDehydrated){s.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}s.blockedOn=null}function ad(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var f=Jp(s.nativeEvent);if(f===null){f=s.nativeEvent;var v=new f.constructor(f.type,f);fl=v,f.target.dispatchEvent(v),fl=null}else return o=Wn(f),o!==null&&mb(o),s.blockedOn=f,!1;o.shift()}return!0}function xb(s,o,f){ad(s)&&f.delete(o)}function D4(){tm=!1,Ei!==null&&ad(Ei)&&(Ei=null),Ai!==null&&ad(Ai)&&(Ai=null),Ni!==null&&ad(Ni)&&(Ni=null),Jl.forEach(xb),ec.forEach(xb)}function ld(s,o){s.blockedOn===o&&(s.blockedOn=null,tm||(tm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,D4)))}var cd=null;function _b(s){cd!==s&&(cd=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){cd===s&&(cd=null);for(var o=0;o<s.length;o+=3){var f=s[o],v=s[o+1],A=s[o+2];if(typeof v!="function"){if(em(v||f)===null)continue;break}var T=Wn(f);T!==null&&(s.splice(o,3),o-=3,Jh(T,{pending:!0,data:A,method:f.method,action:v},v,A))}}))}function Na(s){function o(ne){return ld(ne,s)}Ei!==null&&ld(Ei,s),Ai!==null&&ld(Ai,s),Ni!==null&&ld(Ni,s),Jl.forEach(o),ec.forEach(o);for(var f=0;f<Ri.length;f++){var v=Ri[f];v.blockedOn===s&&(v.blockedOn=null)}for(;0<Ri.length&&(f=Ri[0],f.blockedOn===null);)bb(f),f.blockedOn===null&&Ri.shift();if(f=(s.ownerDocument||s).$$reactFormReplay,f!=null)for(v=0;v<f.length;v+=3){var A=f[v],T=f[v+1],U=A[Dt]||null;if(typeof T=="function")U||_b(f);else if(U){var Z=null;if(T&&T.hasAttribute("formAction")){if(A=T,U=T[Dt]||null)Z=U.formAction;else if(em(A)!==null)continue}else Z=U.action;typeof Z=="function"?f[v+1]=Z:(f.splice(v,3),v-=3),_b(f)}}}function Sb(){function s(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(U){return A=U})},focusReset:"manual",scroll:"manual"})}function o(){A!==null&&(A(),A=null),v||setTimeout(f,20)}function f(){if(!v&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var v=!1,A=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(f,100),function(){v=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),A!==null&&(A(),A=null)}}}function nm(s){this._internalRoot=s}ud.prototype.render=nm.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(r(409));var f=o.current,v=yr();hb(f,v,s,o,null,null)},ud.prototype.unmount=nm.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;hb(s.current,2,null,s,null,null),Vu(),o[jn]=null}};function ud(s){this._internalRoot=s}ud.prototype.unstable_scheduleHydration=function(s){if(s){var o=Nn();s={blockedOn:null,target:s,priority:o};for(var f=0;f<Ri.length&&o!==0&&o<Ri[f].priority;f++);Ri.splice(f,0,s),f===0&&bb(s)}};var wb=e.version;if(wb!=="19.2.4")throw Error(r(527,wb,"19.2.4"));X.findDOMNode=function(s){var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=d(o),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var M4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dd.isDisabled&&dd.supportsFiber)try{lt=dd.inject(M4),Be=dd}catch{}}return rc.createRoot=function(s,o){if(!i(s))throw Error(r(299));var f=!1,v="",A=j0,T=T0,U=D0;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(v=o.identifierPrefix),o.onUncaughtError!==void 0&&(A=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(U=o.onRecoverableError)),o=db(s,1,!1,null,null,f,v,null,A,T,U,Sb),s[jn]=o.current,Pp(s),new nm(o)},rc.hydrateRoot=function(s,o,f){if(!i(s))throw Error(r(299));var v=!1,A="",T=j0,U=T0,Z=D0,ne=null;return f!=null&&(f.unstable_strictMode===!0&&(v=!0),f.identifierPrefix!==void 0&&(A=f.identifierPrefix),f.onUncaughtError!==void 0&&(T=f.onUncaughtError),f.onCaughtError!==void 0&&(U=f.onCaughtError),f.onRecoverableError!==void 0&&(Z=f.onRecoverableError),f.formState!==void 0&&(ne=f.formState)),o=db(s,1,!0,o,f!=null?f:null,v,A,ne,T,U,Z,Sb),o.context=fb(null),f=o.current,v=yr(),v=An(v),A=pi(v),A.callback=null,mi(f,A,v),f=v,o.current.lanes=f,ot(o,f),ls(o),s[jn]=o.current,Pp(s),new ud(o)},rc.version="19.2.4",rc}var Mb;function U4(){if(Mb)return im.exports;Mb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),im.exports=$4(),im.exports}var V4=U4();const Ob="jean2-theme",Ig="neutral",uS="system",q4={mode:uS,scheme:Ig,setMode:()=>null,setScheme:()=>null,resolvedMode:"dark"},dS=R.createContext(q4);function W4(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Lb(t){return t==="system"?W4():t}function G4(t){const e=localStorage.getItem(Ob);if(!e||!["light","dark","system"].includes(e))return null;const r={mode:e,scheme:Ig};return localStorage.setItem(t,JSON.stringify(r)),localStorage.removeItem(Ob),r}function K4({children:t,defaultMode:e=uS,defaultScheme:n=Ig,storageKey:r="jean2-theme-settings",...i}){const[l,c]=R.useState(()=>{const _=G4(r);if(_)return _;const C=localStorage.getItem(r);if(C)try{const w=JSON.parse(C);if(typeof w=="object"&&w!==null&&"mode"in w&&"scheme"in w)return w}catch{}return{mode:e,scheme:n}}),[a,u]=R.useState(()=>Lb(l.mode)),d=R.useCallback((_,C)=>{const w=window.document.documentElement,y=Lb(_);w.classList.remove("light","dark"),w.classList.remove("neutral","ocean","forest","sunset","amethyst"),w.classList.add(y),w.classList.add(C),u(y)},[]);R.useEffect(()=>{d(l.mode,l.scheme)},[l,d]),R.useEffect(()=>{if(l.mode!=="system")return;const _=window.matchMedia("(prefers-color-scheme: dark)"),C=()=>{d(l.mode,l.scheme)};return _.addEventListener("change",C),()=>_.removeEventListener("change",C)},[l.mode,l.scheme,d]);const m=R.useCallback(_=>{const C={...l,mode:_};c(C),localStorage.setItem(r,JSON.stringify(C))},[l,r]),p=R.useCallback(_=>{const C={...l,scheme:_};c(C),localStorage.setItem(r,JSON.stringify(C))},[l,r]),g={mode:l.mode,scheme:l.scheme,setMode:m,setScheme:p,resolvedMode:a};return h.jsx(dS.Provider,{...i,value:g,children:t})}const Y4=()=>{const t=R.useContext(dS);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var cm={exports:{}},um={};/**
50
+ * @license React
51
+ * react-compiler-runtime.production.js
52
+ *
53
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ */var Ib;function X4(){if(Ib)return um;Ib=1;var t=sf().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return um.c=function(e){return t.H.useMemoCache(e)},um}var Pb;function Q4(){return Pb||(Pb=1,cm.exports=X4()),cm.exports}var he=Q4();const zb=t=>Symbol.iterator in t,Bb=t=>"entries"in t,Fb=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),r=e instanceof Map?e:new Map(e.entries());if(n.size!==r.size)return!1;for(const[i,l]of n)if(!r.has(i)||!Object.is(l,r.get(i)))return!1;return!0},Z4=(t,e)=>{const n=t[Symbol.iterator](),r=e[Symbol.iterator]();let i=n.next(),l=r.next();for(;!i.done&&!l.done;){if(!Object.is(i.value,l.value))return!1;i=n.next(),l=r.next()}return!!i.done&&!!l.done};function J4(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:zb(t)&&zb(e)?Bb(t)&&Bb(e)?Fb(t,e):Z4(t,e):Fb({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function ko(t){const e=In.useRef(void 0);return n=>{const r=t(n);return J4(e.current,r)?e.current:e.current=r}}const Hb=t=>{let e;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(e):d;if(!Object.is(p,e)){const g=e;e=(m!=null?m:typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(_=>_(e,g))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=e=t(r,i,a);return a},e5=(t=>t?Hb(t):Hb),t5=t=>t;function n5(t,e=t5){const n=In.useSyncExternalStore(t.subscribe,In.useCallback(()=>e(t.getState()),[t,e]),In.useCallback(()=>e(t.getInitialState()),[t,e]));return In.useDebugValue(n),n}const $b=t=>{const e=e5(t),n=r=>n5(e,r);return Object.assign(n,e),n},Xa=(t=>t?$b(t):$b);function Pg(t){return t.role==="assistant"}const r5=220,fS=256,s5=512;function Dd(t){return Math.max(r5,Math.min(s5,t))}const of={SESSIONS:"jean2_sessions_panel_width",FILES:"jean2_files_panel_width"};function af(t){return Dd(t)}function i5(t){if(typeof window>"u")return t;try{const e=localStorage.getItem(of.SESSIONS);if(e===null)return t;const n=JSON.parse(e);return typeof n.width!="number"||isNaN(n.width)?t:af(n.width)}catch{return t}}function o5(t){if(!(typeof window>"u"))try{const e=af(t);localStorage.setItem(of.SESSIONS,JSON.stringify({width:e}))}catch(e){console.warn("Error saving sessions panel width:",e)}}function a5(t){if(typeof window>"u")return t;try{const e=localStorage.getItem(of.FILES);if(e===null)return t;const n=JSON.parse(e);return typeof n.width!="number"||isNaN(n.width)?t:af(n.width)}catch{return t}}function l5(t){if(!(typeof window>"u"))try{const e=af(t);localStorage.setItem(of.FILES,JSON.stringify({width:e}))}catch(e){console.warn("Error saving files panel width:",e)}}const c5=5e3,hS="jean2_sidebar_view",u5=()=>{if(typeof window>"u")return"default";const t=localStorage.getItem(hS);return t==="default"||t==="overview"?t:"default"},d5=()=>i5(fS),f5=()=>a5(fS),qt=Xa(t=>({showSettings:!1,showConfiguration:!1,showMCPDialog:!1,showFilesPanel:!1,showTerminalPanel:!1,showAddServer:!1,editServerData:null,sidebarViewMode:u5(),completionState:new Map,sessionsPanelWidth:d5(),filesPanelWidth:f5(),filePreviewTarget:null,setShowSettings:e=>t({showSettings:e}),setShowConfiguration:e=>t({showConfiguration:e}),setShowMCPDialog:e=>t({showMCPDialog:e}),setShowFilesPanel:e=>t({showFilesPanel:e}),setShowTerminalPanel:e=>t({showTerminalPanel:e}),setShowAddServer:e=>t({showAddServer:e}),setEditServerData:e=>t({editServerData:e}),setSidebarViewMode:e=>{typeof window<"u"&&localStorage.setItem(hS,e),t({sidebarViewMode:e})},setCompletion:(e,n)=>t(r=>{const i=new Map(r.completionState);return i.set(e,n),{completionState:i}}),clearCompletion:e=>t(n=>{const r=new Map(n.completionState);return r.delete(e),{completionState:r}}),clearAllCompletions:()=>t({completionState:new Map}),setSessionsPanelWidth:e=>{const n=Dd(e);o5(n),t({sessionsPanelWidth:n})},setFilesPanelWidth:e=>{const n=Dd(e);l5(n),t({filesPanelWidth:n})},openFilePreview:e=>t({filePreviewTarget:e}),closeFilePreview:()=>t({filePreviewTarget:null})})),h5=t=>e=>e.completionState.get(t),Ub=c5,p5=Xa(t=>({pendingPermissions:[],queuedMessages:{},clearPendingPermissions:()=>t({pendingPermissions:[]}),setPendingPermissions:e=>t({pendingPermissions:e}),mergePendingPermissions:e=>t(n=>{const r=new Set(n.pendingPermissions.map(l=>l.toolCallId)),i=e.filter(l=>!r.has(l.toolCallId));return{pendingPermissions:[...n.pendingPermissions,...i]}}),addPendingPermission:e=>t(n=>({pendingPermissions:[...n.pendingPermissions,e]})),removePendingPermissionByToolCallId:e=>t(n=>({pendingPermissions:n.pendingPermissions.filter(r=>r.toolCallId!==e)})),removePendingPermissionsBySessionId:e=>t(n=>({pendingPermissions:n.pendingPermissions.filter(r=>r.sessionId!==e)})),clearQueuedMessages:()=>t({queuedMessages:{}}),setQueuedMessagesForSession:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:n}})),addQueuedMessage:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:[...r.queuedMessages[e]||[],n]}})),removeQueuedMessageById:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:(r.queuedMessages[e]||[]).filter(i=>i.id!==n)}})),removeQueuedMessagesByIds:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:(r.queuedMessages[e]||[]).filter(i=>!n.includes(i.id))}}))})),tg=Xa(t=>({streamingSessionIds:new Set,interruptedSessions:new Set,clearStreamingSessions:()=>t({streamingSessionIds:new Set}),addStreamingSession:e=>t(n=>{if(n.streamingSessionIds.has(e))return n;const r=new Set(n.streamingSessionIds);return r.add(e),{streamingSessionIds:r}}),removeStreamingSession:e=>t(n=>{if(!n.streamingSessionIds.has(e))return n;const r=new Set(n.streamingSessionIds);return r.delete(e),{streamingSessionIds:r}}),replaceStreamingSessions:e=>t({streamingSessionIds:e instanceof Set?e:new Set(e)}),addInterruptedSession:e=>t(n=>{if(n.interruptedSessions.has(e))return n;const r=new Set(n.interruptedSessions);return r.add(e),{interruptedSessions:r}}),removeInterruptedSession:e=>t(n=>{if(!n.interruptedSessions.has(e))return n;const r=new Set(n.interruptedSessions);return r.delete(e),{interruptedSessions:r}}),clearInterruptedSessions:()=>t({interruptedSessions:new Set})})),m5=Xa(t=>({sessions:[],currentSession:null,setSessions:e=>t(n=>({sessions:typeof e=="function"?e(n.sessions):e})),addSessionToFront:e=>t(n=>({sessions:[e,...n.sessions]})),updateSession:e=>t(n=>({sessions:n.sessions.map(r=>r.id===e.id?e:r)})),removeSessionById:e=>t(n=>({sessions:n.sessions.filter(r=>r.id!==e)})),setCurrentSession:e=>t({currentSession:e}),clearSessionState:()=>t({sessions:[],currentSession:null})})),sc=Xa((t,e)=>({messagesBySession:{},partsBySession:{},setMessagesBySession:n=>t(r=>({messagesBySession:typeof n=="function"?n(r.messagesBySession):n})),setPartsBySession:n=>t(r=>({partsBySession:typeof n=="function"?n(r.partsBySession):n})),getMessagesBySessionKeysCount:()=>Object.keys(e().messagesBySession).length})),zg=Xa(t=>({activeWorkspace:null,setActiveWorkspace:e=>t({activeWorkspace:e})})),Sr={SERVERS:"jean2_servers",ACTIVE_SERVER_ID:"jean2_active_server_id",QUICK_CONNECTIONS:"jean2_quick_connections"};function Fs(){try{const t=localStorage.getItem(Sr.SERVERS);return t?JSON.parse(t):[]}catch(t){return console.error("Error reading saved servers from localStorage:",t),[]}}function g5(t){return Fs().find(n=>n.id===t)||null}function v5(t){try{const e=Fs();e.push(t),localStorage.setItem(Sr.SERVERS,JSON.stringify(e))}catch(e){console.error("Error saving server to localStorage:",e)}}function y5(t,e){try{const n=Fs(),r=n.findIndex(i=>i.id===t);if(r===-1){console.error("Server not found:",t);return}n[r]={...n[r],...e},localStorage.setItem(Sr.SERVERS,JSON.stringify(n))}catch(n){console.error("Error updating server in localStorage:",n)}}function b5(t){try{const n=Fs().filter(c=>c.id!==t);localStorage.setItem(Sr.SERVERS,JSON.stringify(n));const i=Xr().filter(c=>c.serverId!==t);localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(i)),pS()===t&&localStorage.removeItem(Sr.ACTIVE_SERVER_ID)}catch(e){console.error("Error deleting server from localStorage:",e)}}function pS(){try{return localStorage.getItem(Sr.ACTIVE_SERVER_ID)}catch(t){return console.error("Error reading active server ID from localStorage:",t),null}}function dm(t){try{localStorage.setItem(Sr.ACTIVE_SERVER_ID,t)}catch(e){console.error("Error setting active server ID in localStorage:",e)}}function Vb(){const t=pS();return t?g5(t):null}function Xr(){try{const t=localStorage.getItem(Sr.QUICK_CONNECTIONS);return t?JSON.parse(t):[]}catch(t){return console.error("Error reading quick connections from localStorage:",t),[]}}function x5(t){const e=Xr(),n=e.reduce((i,l)=>Math.max(i,l.order),-1),r={...t,id:crypto.randomUUID(),order:n+1};e.push(r);try{localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(e))}catch(i){console.error("Error saving quick connection to localStorage:",i)}return r}function _5(t){try{const n=Xr().filter(r=>r.id!==t);localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(e){console.error("Error removing quick connection from localStorage:",e)}}function S5(t){try{const n=Xr().filter(r=>r.workspaceId!==t);localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(e){console.error("Error removing quick connections for workspace from localStorage:",e)}}function w5(t){try{const e=Xr(),n=new Map(e.map(r=>[r.id,r]));t.forEach((r,i)=>{const l=n.get(r);l&&(l.order=i)}),localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(e))}catch(e){console.error("Error reordering quick connections in localStorage:",e)}}function mS(t){return/^[a-f0-9]{64}$/.test(t)}function C5(t){return t.length<12?t:`${t.slice(0,4)}...${t.slice(-4)}`}function Md(t){const e=t.trim(),n=/^https:\/\//i.test(e);let r=e.replace(/^(https?:\/\/|wss?:\/\/)/i,"");return r=r.replace(/\/+$/,""),n&&(r=`https://${r}`),r}const gS=R.createContext(null),k5=t=>{const e=he.c(30),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=[],e[0]=r):r=e[0];const[i,l]=R.useState(r),[c,a]=R.useState(null);let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=[],e[1]=u):u=e[1];const[d,m]=R.useState(u),[p,g]=R.useState(!1),_=R.useRef(null),C=R.useRef(!1);let w,y;e[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{const Q=Fs(),J=Vb(),ee=Xr();l(Q),a(J),m(ee)},y=[],e[2]=w,e[3]=y):(w=e[2],y=e[3]),R.useEffect(w,y);let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{C.current=!0},e[4]=S):S=e[4];const b=S;let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=(Q,J,ee)=>{const K=Md(J),V={id:crypto.randomUUID(),name:Q,url:K,token:ee,createdAt:new Date().toISOString()};return v5(V),l(Fs()),dm(V.id),a(V),V},e[5]=x):x=e[5];const k=x;let j;e[6]!==(c==null?void 0:c.id)?(j=(Q,J)=>{const ee={...J,...J.url&&{url:Md(J.url)}};y5(Q,ee),l(Fs()),(c==null?void 0:c.id)===Q&&a(Vb())},e[6]=c==null?void 0:c.id,e[7]=j):j=e[7];const N=j;let D;e[8]!==(c==null?void 0:c.id)?(D=Q=>{const J=(c==null?void 0:c.id)===Q;if(b5(Q),l(Fs()),J){const ee=Fs(),K=ee.length>0?ee[0]:null;K?(dm(K.id),a(K)):a(null)}m(Xr())},e[8]=c==null?void 0:c.id,e[9]=D):D=e[9];const E=D;let O;e[10]!==(c==null?void 0:c.id)||e[11]!==p||e[12]!==i?(O=Q=>(_.current&&(clearTimeout(_.current),_.current=null),p&&(c==null?void 0:c.id)===Q?!1:(p&&g(!1),g(!0),_.current=setTimeout(()=>{dm(Q);const J=i.find(ee=>ee.id===Q)||null;a(J),g(!1)},100),!0)),e[10]=c==null?void 0:c.id,e[11]=p,e[12]=i,e[13]=O):O=e[13];const L=O;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{g(!1)},e[14]=z):z=e[14];const H=z;let $;e[15]===Symbol.for("react.memo_cache_sentinel")?($=(Q,J,ee,K)=>{x5({serverId:Q,serverName:J,workspaceId:ee,workspaceName:K}),m(Xr())},e[15]=$):$=e[15];const q=$;let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=Q=>{_5(Q),m(Xr())},e[16]=G):G=e[16];const W=G;let X;e[17]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>{S5(Q),m(Xr())},e[17]=X):X=e[17];const Y=X;let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=Q=>{w5(Q),m(Xr())},e[18]=I):I=e[18];const M=I;let P;e[19]!==c||e[20]!==N||e[21]!==p||e[22]!==d||e[23]!==E||e[24]!==i||e[25]!==L?(P={servers:i,activeServer:c,quickConnections:d,isSwitching:p,isAddingServerRef:C,prepareForServerAdd:b,addServer:k,editServer:N,removeServer:E,switchServer:L,clearSwitchingState:H,addToQuickConnections:q,removeFromQuickConnections:W,removeFromQuickConnectionsByWorkspace:Y,reorderQuick:M},e[19]=c,e[20]=N,e[21]=p,e[22]=d,e[23]=E,e[24]=i,e[25]=L,e[26]=P):P=e[26];const F=P;let B;return e[27]!==n||e[28]!==F?(B=h.jsx(gS.Provider,{value:F,children:n}),e[27]=n,e[28]=F,e[29]=B):B=e[29],B},Qa=()=>{const t=R.useContext(gS);if(t===null)throw new Error("useServerContext must be used within a ServerProvider");return t};/**
58
+ * @license lucide-react v0.577.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const vS=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
63
+ * @license lucide-react v0.577.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const E5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
68
+ * @license lucide-react v0.577.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const A5=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
73
+ * @license lucide-react v0.577.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const qb=t=>{const e=A5(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
78
+ * @license lucide-react v0.577.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */var N5={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"};/**
83
+ * @license lucide-react v0.577.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const R5=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
88
+ * @license lucide-react v0.577.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const j5=R.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:l,iconNode:c,...a},u)=>R.createElement("svg",{ref:u,...N5,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:vS("lucide",i),...!l&&!R5(a)&&{"aria-hidden":"true"},...a},[...c.map(([d,m])=>R.createElement(d,m)),...Array.isArray(l)?l:[l]]));/**
93
+ * @license lucide-react v0.577.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const Fe=(t,e)=>{const n=R.forwardRef(({className:r,...i},l)=>R.createElement(j5,{ref:l,iconNode:e,className:vS(`lucide-${E5(qb(t))}`,`lucide-${t}`,r),...i}));return n.displayName=qb(t),n};/**
98
+ * @license lucide-react v0.577.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const T5=[["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"}]],D5=Fe("archive",T5);/**
103
+ * @license lucide-react v0.577.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const M5=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],O5=Fe("arrow-down",M5);/**
108
+ * @license lucide-react v0.577.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const L5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Bg=Fe("arrow-left",L5);/**
113
+ * @license lucide-react v0.577.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const I5=[["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"}]],P5=Fe("bot",I5);/**
118
+ * @license lucide-react v0.577.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const z5=[["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"}]],ng=Fe("box",z5);/**
123
+ * @license lucide-react v0.577.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const B5=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],yS=Fe("boxes",B5);/**
128
+ * @license lucide-react v0.577.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const F5=[["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"}]],Wb=Fe("brain",F5);/**
133
+ * @license lucide-react v0.577.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const H5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Vn=Fe("check",H5);/**
138
+ * @license lucide-react v0.577.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const $5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Za=Fe("chevron-down",$5);/**
143
+ * @license lucide-react v0.577.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const U5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],V5=Fe("chevron-left",U5);/**
148
+ * @license lucide-react v0.577.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const q5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hr=Fe("chevron-right",q5);/**
153
+ * @license lucide-react v0.577.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const W5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],G5=Fe("chevron-up",W5);/**
158
+ * @license lucide-react v0.577.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const K5=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],bS=Fe("chevrons-up-down",K5);/**
163
+ * @license lucide-react v0.577.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const Y5=[["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"}]],To=Fe("circle-alert",Y5);/**
168
+ * @license lucide-react v0.577.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const X5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Dc=Fe("circle-check-big",X5);/**
173
+ * @license lucide-react v0.577.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const Q5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Z5=Fe("circle-check",Q5);/**
178
+ * @license lucide-react v0.577.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const J5=[["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"}]],lf=Fe("circle-x",J5);/**
183
+ * @license lucide-react v0.577.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const eA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],tA=Fe("circle",eA);/**
188
+ * @license lucide-react v0.577.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const nA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],xS=Fe("clock",nA);/**
193
+ * @license lucide-react v0.577.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const rA=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],sA=Fe("cog",rA);/**
198
+ * @license lucide-react v0.577.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const iA=[["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"}]],yc=Fe("copy",iA);/**
203
+ * @license lucide-react v0.577.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const oA=[["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"}]],Gb=Fe("cpu",oA);/**
208
+ * @license lucide-react v0.577.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const aA=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],lA=Fe("download",aA);/**
213
+ * @license lucide-react v0.577.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const cA=[["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"}]],_S=Fe("ellipsis",cA);/**
218
+ * @license lucide-react v0.577.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const uA=[["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"}]],bc=Fe("external-link",uA);/**
223
+ * @license lucide-react v0.577.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const dA=[["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"}]],SS=Fe("eye-off",dA);/**
228
+ * @license lucide-react v0.577.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const fA=[["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"}]],Fg=Fe("eye",fA);/**
233
+ * @license lucide-react v0.577.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const hA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],pA=Fe("file-exclamation-point",hA);/**
238
+ * @license lucide-react v0.577.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const mA=[["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=Fe("file-pen",mA);/**
243
+ * @license lucide-react v0.577.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const vA=[["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:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],yA=Fe("file-question-mark",vA);/**
248
+ * @license lucide-react v0.577.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const bA=[["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"}]],Mc=Fe("file-text",bA);/**
253
+ * @license lucide-react v0.577.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const xA=[["path",{d:"M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5",key:"1jo35a"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m15 17 5 5",key:"36xl1x"}],["path",{d:"m20 17-5 5",key:"vdz27y"}]],_A=Fe("file-x-corner",xA);/**
258
+ * @license lucide-react v0.577.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const SA=[["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"}]],Pr=Fe("file",SA);/**
263
+ * @license lucide-react v0.577.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const wA=[["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"}]],rg=Fe("folder-open",wA);/**
268
+ * @license lucide-react v0.577.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const CA=[["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"}]],Vs=Fe("folder",CA);/**
273
+ * @license lucide-react v0.577.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const kA=[["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"}]],EA=Fe("git-branch",kA);/**
278
+ * @license lucide-react v0.577.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const AA=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],NA=Fe("hard-drive",AA);/**
283
+ * @license lucide-react v0.577.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const RA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],jA=Fe("image",RA);/**
288
+ * @license lucide-react v0.577.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const TA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],DA=Fe("info",TA);/**
293
+ * @license lucide-react v0.577.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const MA=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],wS=Fe("key",MA);/**
298
+ * @license lucide-react v0.577.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const OA=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],LA=Fe("keyboard",OA);/**
303
+ * @license lucide-react v0.577.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const IA=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],CS=Fe("layers",IA);/**
308
+ * @license lucide-react v0.577.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const PA=[["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"}]],zA=Fe("layout-grid",PA);/**
313
+ * @license lucide-react v0.577.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const BA=[["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"}]],FA=Fe("layout-list",BA);/**
318
+ * @license lucide-react v0.577.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const HA=[["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"}]],$A=Fe("link-2",HA);/**
323
+ * @license lucide-react v0.577.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const UA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wt=Fe("loader-circle",UA);/**
328
+ * @license lucide-react v0.577.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const VA=[["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"}]],qA=Fe("lock",VA);/**
333
+ * @license lucide-react v0.577.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const WA=[["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"}]],GA=Fe("message-square",WA);/**
338
+ * @license lucide-react v0.577.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const KA=[["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"}]],kS=Fe("minimize-2",KA);/**
343
+ * @license lucide-react v0.577.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const YA=[["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"}]],XA=Fe("monitor",YA);/**
348
+ * @license lucide-react v0.577.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const QA=[["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"}]],ZA=Fe("moon",QA);/**
353
+ * @license lucide-react v0.577.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const JA=[["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"}]],eN=Fe("palette",JA);/**
358
+ * @license lucide-react v0.577.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const tN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],nN=Fe("panel-left",tN);/**
363
+ * @license lucide-react v0.577.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const rN=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],sN=Fe("paperclip",rN);/**
368
+ * @license lucide-react v0.577.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const iN=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ES=Fe("pause",iN);/**
373
+ * @license lucide-react v0.577.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const oN=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],za=Fe("pencil",oN);/**
378
+ * @license lucide-react v0.577.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const aN=[["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"}]],lN=Fe("plug-zap",aN);/**
383
+ * @license lucide-react v0.577.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const cN=[["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"}]],uN=Fe("plug",cN);/**
388
+ * @license lucide-react v0.577.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const dN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qr=Fe("plus",dN);/**
393
+ * @license lucide-react v0.577.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const fN=[["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"}]],Pi=Fe("refresh-cw",fN);/**
398
+ * @license lucide-react v0.577.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const hN=[["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"}]],AS=Fe("rotate-ccw",hN);/**
403
+ * @license lucide-react v0.577.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const pN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Hg=Fe("search",pN);/**
408
+ * @license lucide-react v0.577.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const mN=[["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"}]],gN=Fe("send",mN);/**
413
+ * @license lucide-react v0.577.0 - ISC
414
+ *
415
+ * This source code is licensed under the ISC license.
416
+ * See the LICENSE file in the root directory of this source tree.
417
+ */const vN=[["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"}]],Do=Fe("server",vN);/**
418
+ * @license lucide-react v0.577.0 - ISC
419
+ *
420
+ * This source code is licensed under the ISC license.
421
+ * See the LICENSE file in the root directory of this source tree.
422
+ */const yN=[["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"}]],NS=Fe("settings",yN);/**
423
+ * @license lucide-react v0.577.0 - ISC
424
+ *
425
+ * This source code is licensed under the ISC license.
426
+ * See the LICENSE file in the root directory of this source tree.
427
+ */const bN=[["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"}]],RS=Fe("shield",bN);/**
428
+ * @license lucide-react v0.577.0 - ISC
429
+ *
430
+ * This source code is licensed under the ISC license.
431
+ * See the LICENSE file in the root directory of this source tree.
432
+ */const xN=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],_N=Fe("sliders-horizontal",xN);/**
433
+ * @license lucide-react v0.577.0 - ISC
434
+ *
435
+ * This source code is licensed under the ISC license.
436
+ * See the LICENSE file in the root directory of this source tree.
437
+ */const SN=[["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"}]],Kb=Fe("square-terminal",SN);/**
438
+ * @license lucide-react v0.577.0 - ISC
439
+ *
440
+ * This source code is licensed under the ISC license.
441
+ * See the LICENSE file in the root directory of this source tree.
442
+ */const wN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],jS=Fe("square",wN);/**
443
+ * @license lucide-react v0.577.0 - ISC
444
+ *
445
+ * This source code is licensed under the ISC license.
446
+ * See the LICENSE file in the root directory of this source tree.
447
+ */const CN=[["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"}]],xc=Fe("star",CN);/**
448
+ * @license lucide-react v0.577.0 - ISC
449
+ *
450
+ * This source code is licensed under the ISC license.
451
+ * See the LICENSE file in the root directory of this source tree.
452
+ */const kN=[["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"}]],EN=Fe("sun",kN);/**
453
+ * @license lucide-react v0.577.0 - ISC
454
+ *
455
+ * This source code is licensed under the ISC license.
456
+ * See the LICENSE file in the root directory of this source tree.
457
+ */const AN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Yb=Fe("terminal",AN);/**
458
+ * @license lucide-react v0.577.0 - ISC
459
+ *
460
+ * This source code is licensed under the ISC license.
461
+ * See the LICENSE file in the root directory of this source tree.
462
+ */const NN=[["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"}]],Br=Fe("trash-2",NN);/**
463
+ * @license lucide-react v0.577.0 - ISC
464
+ *
465
+ * This source code is licensed under the ISC license.
466
+ * See the LICENSE file in the root directory of this source tree.
467
+ */const RN=[["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"}]],Ua=Fe("triangle-alert",RN);/**
468
+ * @license lucide-react v0.577.0 - ISC
469
+ *
470
+ * This source code is licensed under the ISC license.
471
+ * See the LICENSE file in the root directory of this source tree.
472
+ */const jN=[["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"}]],TN=Fe("undo-2",jN);/**
473
+ * @license lucide-react v0.577.0 - ISC
474
+ *
475
+ * This source code is licensed under the ISC license.
476
+ * See the LICENSE file in the root directory of this source tree.
477
+ */const DN=[["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"}]],MN=Fe("unplug",DN);/**
478
+ * @license lucide-react v0.577.0 - ISC
479
+ *
480
+ * This source code is licensed under the ISC license.
481
+ * See the LICENSE file in the root directory of this source tree.
482
+ */const ON=[["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"}]],TS=Fe("user",ON);/**
483
+ * @license lucide-react v0.577.0 - ISC
484
+ *
485
+ * This source code is licensed under the ISC license.
486
+ * See the LICENSE file in the root directory of this source tree.
487
+ */const LN=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],IN=Fe("volume-2",LN);/**
488
+ * @license lucide-react v0.577.0 - ISC
489
+ *
490
+ * This source code is licensed under the ISC license.
491
+ * See the LICENSE file in the root directory of this source tree.
492
+ */const PN=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],zN=Fe("volume-x",PN);/**
493
+ * @license lucide-react v0.577.0 - ISC
494
+ *
495
+ * This source code is licensed under the ISC license.
496
+ * See the LICENSE file in the root directory of this source tree.
497
+ */const BN=[["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"}]],DS=Fe("wifi-off",BN);/**
498
+ * @license lucide-react v0.577.0 - ISC
499
+ *
500
+ * This source code is licensed under the ISC license.
501
+ * See the LICENSE file in the root directory of this source tree.
502
+ */const FN=[["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"}]],HN=Fe("wifi",FN);/**
503
+ * @license lucide-react v0.577.0 - ISC
504
+ *
505
+ * This source code is licensed under the ISC license.
506
+ * See the LICENSE file in the root directory of this source tree.
507
+ */const $N=[["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"}]],UN=Fe("wrench",$N);/**
508
+ * @license lucide-react v0.577.0 - ISC
509
+ *
510
+ * This source code is licensed under the ISC license.
511
+ * See the LICENSE file in the root directory of this source tree.
512
+ */const VN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zn=Fe("x",VN);/**
513
+ * @license lucide-react v0.577.0 - ISC
514
+ *
515
+ * This source code is licensed under the ISC license.
516
+ * See the LICENSE file in the root directory of this source tree.
517
+ */const qN=[["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"}]],fm=Fe("zap",qN);function MS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=MS(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function cf(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=MS(t))&&(r&&(r+=" "),r+=e);return r}const Xb=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Qb=cf,Ja=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Qb(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:l}=e,c=Object.keys(i).map(d=>{const m=n==null?void 0:n[d],p=l==null?void 0:l[d];if(m===null)return null;const g=Xb(m)||Xb(p);return i[d][g]}),a=n&&Object.entries(n).reduce((d,m)=>{let[p,g]=m;return g===void 0||(d[p]=g),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:p,className:g,..._}=m;return Object.entries(_).every(C=>{let[w,y]=C;return Array.isArray(y)?y.includes({...l,...a}[w]):{...l,...a}[w]===y})?[...d,p,g]:d},[]);return Qb(t,c,u,n==null?void 0:n.class,n==null?void 0:n.className)};var el=cS();const WN=rf(el);function Zb(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function qs(...t){return e=>{let n=!1;const r=t.map(i=>{const l=Zb(i,e);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let i=0;i<r.length;i++){const l=r[i];typeof l=="function"?l():Zb(t[i],null)}}}}function ht(...t){return R.useCallback(qs(...t),t)}function zi(t){const e=GN(t),n=R.forwardRef((r,i)=>{const{children:l,...c}=r,a=R.Children.toArray(l),u=a.find(YN);if(u){const d=u.props.children,m=a.map(p=>p===u?R.Children.count(d)>1?R.Children.only(null):R.isValidElement(d)?d.props.children:null:p);return h.jsx(e,{...c,ref:i,children:R.isValidElement(d)?R.cloneElement(d,void 0,m):null})}return h.jsx(e,{...c,ref:i,children:l})});return n.displayName=`${t}.Slot`,n}var Oc=zi("Slot");function GN(t){const e=R.forwardRef((n,r)=>{const{children:i,...l}=n;if(R.isValidElement(i)){const c=QN(i),a=XN(l,i.props);return i.type!==R.Fragment&&(a.ref=r?qs(r,c):c),R.cloneElement(i,a)}return R.Children.count(i)>1?R.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var OS=Symbol("radix.slottable");function KN(t){const e=({children:n})=>h.jsx(h.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=OS,e}function YN(t){return R.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===OS}function XN(t,e){const n={...e};for(const r in e){const i=t[r],l=e[r];/^on[A-Z]/.test(r)?i&&l?n[r]=(...a)=>{const u=l(...a);return i(...a),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...l}:r==="className"&&(n[r]=[i,l].filter(Boolean).join(" "))}return{...t,...n}}function QN(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var ZN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=ZN.reduce((t,e)=>{const n=zi(`Primitive.${e}`),r=R.forwardRef((i,l)=>{const{asChild:c,...a}=i,u=c?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(u,{...a,ref:l})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function LS(t,e){t&&el.flushSync(()=>t.dispatchEvent(e))}var IS=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"}),JN="VisuallyHidden",PS=R.forwardRef((t,e)=>h.jsx(Ze.span,{...t,ref:e,style:{...IS,...t.style}}));PS.displayName=JN;var eR=PS;function tR(t,e){const n=R.createContext(e),r=l=>{const{children:c,...a}=l,u=R.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:u,children:c})};r.displayName=t+"Provider";function i(l){const c=R.useContext(n);if(c)return c;if(e!==void 0)return e;throw new Error(`\`${l}\` must be used within \`${t}\``)}return[r,i]}function or(t,e=[]){let n=[];function r(l,c){const a=R.createContext(c),u=n.length;n=[...n,c];const d=p=>{var S;const{scope:g,children:_,...C}=p,w=((S=g==null?void 0:g[t])==null?void 0:S[u])||a,y=R.useMemo(()=>C,Object.values(C));return h.jsx(w.Provider,{value:y,children:_})};d.displayName=l+"Provider";function m(p,g){var w;const _=((w=g==null?void 0:g[t])==null?void 0:w[u])||a,C=R.useContext(_);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[d,m]}const i=()=>{const l=n.map(c=>R.createContext(c));return function(a){const u=(a==null?void 0:a[t])||l;return R.useMemo(()=>({[`__scope${t}`]:{...a,[t]:u}}),[a,u])}};return i.scopeName=t,[r,nR(i,...e)]}function nR(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const c=r.reduce((a,{useScope:u,scopeName:d})=>{const p=u(l)[`__scope${d}`];return{...a,...p}},{});return R.useMemo(()=>({[`__scope${e.scopeName}`]:c}),[c])}};return n.scopeName=e.scopeName,n}function $g(t){const e=t+"CollectionProvider",[n,r]=or(e),[i,l]=n(e,{collectionRef:{current:null},itemMap:new Map}),c=w=>{const{scope:y,children:S}=w,b=In.useRef(null),x=In.useRef(new Map).current;return h.jsx(i,{scope:y,itemMap:x,collectionRef:b,children:S})};c.displayName=e;const a=t+"CollectionSlot",u=zi(a),d=In.forwardRef((w,y)=>{const{scope:S,children:b}=w,x=l(a,S),k=ht(y,x.collectionRef);return h.jsx(u,{ref:k,children:b})});d.displayName=a;const m=t+"CollectionItemSlot",p="data-radix-collection-item",g=zi(m),_=In.forwardRef((w,y)=>{const{scope:S,children:b,...x}=w,k=In.useRef(null),j=ht(y,k),N=l(m,S);return In.useEffect(()=>(N.itemMap.set(k,{ref:k,...x}),()=>void N.itemMap.delete(k))),h.jsx(g,{[p]:"",ref:j,children:b})});_.displayName=m;function C(w){const y=l(t+"CollectionConsumer",w);return In.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((N,D)=>x.indexOf(N.ref.current)-x.indexOf(D.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:c,Slot:d,ItemSlot:_},C,r]}function $e(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}var kn=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},rR=lS[" useInsertionEffect ".trim().toString()]||kn;function ms({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,l,c]=sR({defaultProp:e,onChange:n}),a=t!==void 0,u=a?t:i;{const m=R.useRef(t!==void 0);R.useEffect(()=>{const p=m.current;p!==a&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=a},[a,r])}const d=R.useCallback(m=>{var p;if(a){const g=iR(m)?m(t):m;g!==t&&((p=c.current)==null||p.call(c,g))}else l(m)},[a,t,l,c]);return[u,d]}function sR({defaultProp:t,onChange:e}){const[n,r]=R.useState(t),i=R.useRef(n),l=R.useRef(e);return rR(()=>{l.current=e},[e]),R.useEffect(()=>{var c;i.current!==n&&((c=l.current)==null||c.call(l,n),i.current=n)},[n,i]),[n,r,l]}function iR(t){return typeof t=="function"}function oR(t,e){return R.useReducer((n,r)=>{const i=e[n][r];return i!=null?i:n},t)}var En=t=>{const{present:e,children:n}=t,r=aR(e),i=typeof n=="function"?n({present:r.isPresent}):R.Children.only(n),l=ht(r.ref,lR(i));return typeof n=="function"||r.isPresent?R.cloneElement(i,{ref:l}):null};En.displayName="Presence";function aR(t){const[e,n]=R.useState(),r=R.useRef(null),i=R.useRef(t),l=R.useRef("none"),c=t?"mounted":"unmounted",[a,u]=oR(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const d=fd(r.current);l.current=a==="mounted"?d:"none"},[a]),kn(()=>{const d=r.current,m=i.current;if(m!==t){const g=l.current,_=fd(d);t?u("MOUNT"):_==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(m&&g!==_?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),kn(()=>{var d;if(e){let m;const p=(d=e.ownerDocument.defaultView)!=null?d:window,g=C=>{const y=fd(r.current).includes(CSS.escape(C.animationName));if(C.target===e&&y&&(u("ANIMATION_END"),!i.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",m=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},_=C=>{C.target===e&&(l.current=fd(r.current))};return e.addEventListener("animationstart",_),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(m),e.removeEventListener("animationstart",_),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:R.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function fd(t){return(t==null?void 0:t.animationName)||"none"}function lR(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var cR=lS[" useId ".trim().toString()]||(()=>{}),uR=0;function Sn(t){const[e,n]=R.useState(cR());return kn(()=>{n(r=>r!=null?r:String(uR++))},[t]),e?`radix-${e}`:""}var uf="Collapsible",[dR]=or(uf),[fR,Ug]=dR(uf),zS=R.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:l,onOpenChange:c,...a}=t,[u,d]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:c,caller:uf});return h.jsx(fR,{scope:n,disabled:l,contentId:Sn(),open:u,onOpenToggle:R.useCallback(()=>d(m=>!m),[d]),children:h.jsx(Ze.div,{"data-state":qg(u),"data-disabled":l?"":void 0,...a,ref:e})})});zS.displayName=uf;var BS="CollapsibleTrigger",FS=R.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=Ug(BS,n);return h.jsx(Ze.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":qg(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:$e(t.onClick,i.onOpenToggle)})});FS.displayName=BS;var Vg="CollapsibleContent",HS=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ug(Vg,t.__scopeCollapsible);return h.jsx(En,{present:n||i.open,children:({present:l})=>h.jsx(hR,{...r,ref:e,present:l})})});HS.displayName=Vg;var hR=R.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...l}=t,c=Ug(Vg,n),[a,u]=R.useState(r),d=R.useRef(null),m=ht(e,d),p=R.useRef(0),g=p.current,_=R.useRef(0),C=_.current,w=c.open||a,y=R.useRef(w),S=R.useRef(void 0);return R.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),kn(()=>{const b=d.current;if(b){S.current=S.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();p.current=x.height,_.current=x.width,y.current||(b.style.transitionDuration=S.current.transitionDuration,b.style.animationName=S.current.animationName),u(r)}},[c.open,r]),h.jsx(Ze.div,{"data-state":qg(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!w,...l,ref:m,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...t.style},children:w&&i})});function qg(t){return t?"open":"closed"}var pR=zS,mR=R.createContext(void 0);function Lc(t){const e=R.useContext(mR);return t||e||"ltr"}function Pn(t){const e=R.useRef(t);return R.useEffect(()=>{e.current=t}),R.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function gR(t,e=globalThis==null?void 0:globalThis.document){const n=Pn(t);R.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var vR="DismissableLayer",sg="dismissableLayer.update",yR="dismissableLayer.pointerDownOutside",bR="dismissableLayer.focusOutside",Jb,$S=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tl=R.forwardRef((t,e)=>{var D;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:c,onDismiss:a,...u}=t,d=R.useContext($S),[m,p]=R.useState(null),g=(D=m==null?void 0:m.ownerDocument)!=null?D:globalThis==null?void 0:globalThis.document,[,_]=R.useState({}),C=ht(e,E=>p(E)),w=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(y),b=m?w.indexOf(m):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,k=b>=S,j=SR(E=>{const O=E.target,L=[...d.branches].some(z=>z.contains(O));!k||L||(i==null||i(E),c==null||c(E),E.defaultPrevented||a==null||a())},g),N=wR(E=>{const O=E.target;[...d.branches].some(z=>z.contains(O))||(l==null||l(E),c==null||c(E),E.defaultPrevented||a==null||a())},g);return gR(E=>{b===d.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},g),R.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Jb=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),ex(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Jb)}},[m,g,n,d]),R.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),ex())},[m,d]),R.useEffect(()=>{const E=()=>_({});return document.addEventListener(sg,E),()=>document.removeEventListener(sg,E)},[]),h.jsx(Ze.div,{...u,ref:C,style:{pointerEvents:x?k?"auto":"none":void 0,...t.style},onFocusCapture:$e(t.onFocusCapture,N.onFocusCapture),onBlurCapture:$e(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:$e(t.onPointerDownCapture,j.onPointerDownCapture)})});tl.displayName=vR;var xR="DismissableLayerBranch",_R=R.forwardRef((t,e)=>{const n=R.useContext($S),r=R.useRef(null),i=ht(e,r);return R.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),h.jsx(Ze.div,{...t,ref:i})});_R.displayName=xR;function SR(t,e=globalThis==null?void 0:globalThis.document){const n=Pn(t),r=R.useRef(!1),i=R.useRef(()=>{});return R.useEffect(()=>{const l=a=>{if(a.target&&!r.current){let u=function(){US(yR,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=u,e.addEventListener("click",i.current,{once:!0})):u()}else e.removeEventListener("click",i.current);r.current=!1},c=window.setTimeout(()=>{e.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),e.removeEventListener("pointerdown",l),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function wR(t,e=globalThis==null?void 0:globalThis.document){const n=Pn(t),r=R.useRef(!1);return R.useEffect(()=>{const i=l=>{l.target&&!r.current&&US(bR,n,{originalEvent:l},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ex(){const t=new CustomEvent(sg);document.dispatchEvent(t)}function US(t,e,n,{discrete:r}){const i=n.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?LS(i,l):i.dispatchEvent(l)}var hm="focusScope.autoFocusOnMount",pm="focusScope.autoFocusOnUnmount",tx={bubbles:!1,cancelable:!0},CR="FocusScope",Ic=R.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...c}=t,[a,u]=R.useState(null),d=Pn(i),m=Pn(l),p=R.useRef(null),g=ht(e,w=>u(w)),_=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(r){let w=function(x){if(_.paused||!a)return;const k=x.target;a.contains(k)?p.current=k:Li(p.current,{select:!0})},y=function(x){if(_.paused||!a)return;const k=x.relatedTarget;k!==null&&(a.contains(k)||Li(p.current,{select:!0}))},S=function(x){if(document.activeElement===document.body)for(const j of x)j.removedNodes.length>0&&Li(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",y);const b=new MutationObserver(S);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,_.paused]),R.useEffect(()=>{if(a){rx.add(_);const w=document.activeElement;if(!a.contains(w)){const S=new CustomEvent(hm,tx);a.addEventListener(hm,d),a.dispatchEvent(S),S.defaultPrevented||(kR(jR(VS(a)),{select:!0}),document.activeElement===w&&Li(a))}return()=>{a.removeEventListener(hm,d),setTimeout(()=>{const S=new CustomEvent(pm,tx);a.addEventListener(pm,m),a.dispatchEvent(S),S.defaultPrevented||Li(w!=null?w:document.body,{select:!0}),a.removeEventListener(pm,m),rx.remove(_)},0)}}},[a,d,m,_]);const C=R.useCallback(w=>{if(!n&&!r||_.paused)return;const y=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(y&&S){const b=w.currentTarget,[x,k]=ER(b);x&&k?!w.shiftKey&&S===k?(w.preventDefault(),n&&Li(x,{select:!0})):w.shiftKey&&S===x&&(w.preventDefault(),n&&Li(k,{select:!0})):S===b&&w.preventDefault()}},[n,r,_.paused]);return h.jsx(Ze.div,{tabIndex:-1,...c,ref:g,onKeyDown:C})});Ic.displayName=CR;function kR(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Li(r,{select:e}),document.activeElement!==n)return}function ER(t){const e=VS(t),n=nx(e,t),r=nx(e.reverse(),t);return[n,r]}function VS(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function nx(t,e){for(const n of t)if(!AR(n,{upTo:e}))return n}function AR(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function NR(t){return t instanceof HTMLInputElement&&"select"in t}function Li(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&NR(t)&&e&&t.select()}}var rx=RR();function RR(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=sx(t,e),t.unshift(e)},remove(e){var n;t=sx(t,e),(n=t[0])==null||n.resume()}}}function sx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function jR(t){return t.filter(e=>e.tagName!=="A")}var TR="Portal",nl=R.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,l]=R.useState(!1);kn(()=>l(!0),[]);const c=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return c?WN.createPortal(h.jsx(Ze.div,{...r,ref:e}),c):null});nl.displayName=TR;var mm=0;function df(){R.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!=null?e:ix()),document.body.insertAdjacentElement("beforeend",(n=t[1])!=null?n:ix()),mm++,()=>{mm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),mm--}},[])}function ix(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var us=function(){return us=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},us.apply(this,arguments)};function qS(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function DR(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,l;r<i;r++)(l||!(r in e))&&(l||(l=Array.prototype.slice.call(e,0,r)),l[r]=e[r]);return t.concat(l||Array.prototype.slice.call(e))}var kd="right-scroll-bar-position",Ed="width-before-scroll-bar",MR="with-scroll-bars-hidden",OR="--removed-body-scroll-bar-size";function gm(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function LR(t,e){var n=R.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var IR=typeof window<"u"?R.useLayoutEffect:R.useEffect,ox=new WeakMap;function PR(t,e){var n=LR(null,function(r){return t.forEach(function(i){return gm(i,r)})});return IR(function(){var r=ox.get(n);if(r){var i=new Set(r),l=new Set(t),c=n.current;i.forEach(function(a){l.has(a)||gm(a,null)}),l.forEach(function(a){i.has(a)||gm(a,c)})}ox.set(n,t)},[t]),n}function zR(t){return t}function BR(t,e){e===void 0&&(e=zR);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(l){var c=e(l,r);return n.push(c),function(){n=n.filter(function(a){return a!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(a){return l(a)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var a=n;n=[],a.forEach(l),c=n}var u=function(){var m=c;c=[],m.forEach(l)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(m){c.push(m),d()},filter:function(m){return c=c.filter(m),n}}}};return i}function FR(t){t===void 0&&(t={});var e=BR(null);return e.options=us({async:!0,ssr:!1},t),e}var WS=function(t){var e=t.sideCar,n=qS(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return R.createElement(r,us({},n))};WS.isSideCarExport=!0;function HR(t,e){return t.useMedium(e),WS}var GS=FR(),vm=function(){},ff=R.forwardRef(function(t,e){var n=R.useRef(null),r=R.useState({onScrollCapture:vm,onWheelCapture:vm,onTouchMoveCapture:vm}),i=r[0],l=r[1],c=t.forwardProps,a=t.children,u=t.className,d=t.removeScrollBar,m=t.enabled,p=t.shards,g=t.sideCar,_=t.noRelative,C=t.noIsolation,w=t.inert,y=t.allowPinchZoom,S=t.as,b=S===void 0?"div":S,x=t.gapMode,k=qS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=g,N=PR([n,e]),D=us(us({},k),i);return R.createElement(R.Fragment,null,m&&R.createElement(j,{sideCar:GS,removeScrollBar:d,shards:p,noRelative:_,noIsolation:C,inert:w,setCallbacks:l,allowPinchZoom:!!y,lockRef:n,gapMode:x}),c?R.cloneElement(R.Children.only(a),us(us({},D),{ref:N})):R.createElement(b,us({},D,{className:u,ref:N}),a))});ff.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ff.classNames={fullWidth:Ed,zeroRight:kd};var $R=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function UR(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=$R();return e&&t.setAttribute("nonce",e),t}function VR(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function qR(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var WR=function(){var t=0,e=null;return{add:function(n){t==0&&(e=UR())&&(VR(e,n),qR(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},GR=function(){var t=WR();return function(e,n){R.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},KS=function(){var t=GR(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},KR={left:0,top:0,right:0,gap:0},ym=function(t){return parseInt(t||"",10)||0},YR=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[ym(n),ym(r),ym(i)]},XR=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return KR;var e=YR(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},QR=KS(),Ba="data-scroll-locked",ZR=function(t,e,n,r){var i=t.left,l=t.top,c=t.right,a=t.gap;return n===void 0&&(n="margin"),`
518
+ .`.concat(MR,` {
519
+ overflow: hidden `).concat(r,`;
520
+ padding-right: `).concat(a,"px ").concat(r,`;
521
+ }
522
+ body[`).concat(Ba,`] {
523
+ overflow: hidden `).concat(r,`;
524
+ overscroll-behavior: contain;
525
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
526
+ padding-left: `.concat(i,`px;
527
+ padding-top: `).concat(l,`px;
528
+ padding-right: `).concat(c,`px;
529
+ margin-left:0;
530
+ margin-top:0;
531
+ margin-right: `).concat(a,"px ").concat(r,`;
532
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
533
+ }
534
+
535
+ .`).concat(kd,` {
536
+ right: `).concat(a,"px ").concat(r,`;
537
+ }
538
+
539
+ .`).concat(Ed,` {
540
+ margin-right: `).concat(a,"px ").concat(r,`;
541
+ }
542
+
543
+ .`).concat(kd," .").concat(kd,` {
544
+ right: 0 `).concat(r,`;
545
+ }
546
+
547
+ .`).concat(Ed," .").concat(Ed,` {
548
+ margin-right: 0 `).concat(r,`;
549
+ }
550
+
551
+ body[`).concat(Ba,`] {
552
+ `).concat(OR,": ").concat(a,`px;
553
+ }
554
+ `)},ax=function(){var t=parseInt(document.body.getAttribute(Ba)||"0",10);return isFinite(t)?t:0},JR=function(){R.useEffect(function(){return document.body.setAttribute(Ba,(ax()+1).toString()),function(){var t=ax()-1;t<=0?document.body.removeAttribute(Ba):document.body.setAttribute(Ba,t.toString())}},[])},ej=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;JR();var l=R.useMemo(function(){return XR(i)},[i]);return R.createElement(QR,{styles:ZR(l,!e,i,n?"":"!important")})},ig=!1;if(typeof window<"u")try{var hd=Object.defineProperty({},"passive",{get:function(){return ig=!0,!0}});window.addEventListener("test",hd,hd),window.removeEventListener("test",hd,hd)}catch{ig=!1}var Ra=ig?{passive:!1}:!1,tj=function(t){return t.tagName==="TEXTAREA"},YS=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!tj(t)&&n[e]==="visible")},nj=function(t){return YS(t,"overflowY")},rj=function(t){return YS(t,"overflowX")},lx=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=XS(t,r);if(i){var l=QS(t,r),c=l[1],a=l[2];if(c>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sj=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},ij=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},XS=function(t,e){return t==="v"?nj(e):rj(e)},QS=function(t,e){return t==="v"?sj(e):ij(e)},oj=function(t,e){return t==="h"&&e==="rtl"?-1:1},aj=function(t,e,n,r,i){var l=oj(t,window.getComputedStyle(e).direction),c=l*r,a=n.target,u=e.contains(a),d=!1,m=c>0,p=0,g=0;do{if(!a)break;var _=QS(t,a),C=_[0],w=_[1],y=_[2],S=w-y-l*C;(C||S)&&XS(t,a)&&(p+=S,g+=C);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!u&&a!==document.body||u&&(e.contains(a)||e===a));return(m&&Math.abs(p)<1||!m&&Math.abs(g)<1)&&(d=!0),d},pd=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},cx=function(t){return[t.deltaX,t.deltaY]},ux=function(t){return t&&"current"in t?t.current:t},lj=function(t,e){return t[0]===e[0]&&t[1]===e[1]},cj=function(t){return`
555
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
556
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
557
+ `)},uj=0,ja=[];function dj(t){var e=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(uj++)[0],l=R.useState(KS)[0],c=R.useRef(t);R.useEffect(function(){c.current=t},[t]),R.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var w=DR([t.lockRef.current],(t.shards||[]).map(ux),!0).filter(Boolean);return w.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=R.useCallback(function(w,y){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!c.current.allowPinchZoom;var S=pd(w),b=n.current,x="deltaX"in w?w.deltaX:b[0]-S[0],k="deltaY"in w?w.deltaY:b[1]-S[1],j,N=w.target,D=Math.abs(x)>Math.abs(k)?"h":"v";if("touches"in w&&D==="h"&&N.type==="range")return!1;var E=window.getSelection(),O=E&&E.anchorNode,L=O?O===N||O.contains(N):!1;if(L)return!1;var z=lx(D,N);if(!z)return!0;if(z?j=D:(j=D==="v"?"h":"v",z=lx(D,N)),!z)return!1;if(!r.current&&"changedTouches"in w&&(x||k)&&(r.current=j),!j)return!0;var H=r.current||j;return aj(H,y,w,H==="h"?x:k)},[]),u=R.useCallback(function(w){var y=w;if(!(!ja.length||ja[ja.length-1]!==l)){var S="deltaY"in y?cx(y):pd(y),b=e.current.filter(function(j){return j.name===y.type&&(j.target===y.target||y.target===j.shadowParent)&&lj(j.delta,S)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var x=(c.current.shards||[]).map(ux).filter(Boolean).filter(function(j){return j.contains(y.target)}),k=x.length>0?a(y,x[0]):!c.current.noIsolation;k&&y.cancelable&&y.preventDefault()}}},[]),d=R.useCallback(function(w,y,S,b){var x={name:w,delta:y,target:S,should:b,shadowParent:fj(S)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(k){return k!==x})},1)},[]),m=R.useCallback(function(w){n.current=pd(w),r.current=void 0},[]),p=R.useCallback(function(w){d(w.type,cx(w),w.target,a(w,t.lockRef.current))},[]),g=R.useCallback(function(w){d(w.type,pd(w),w.target,a(w,t.lockRef.current))},[]);R.useEffect(function(){return ja.push(l),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Ra),document.addEventListener("touchmove",u,Ra),document.addEventListener("touchstart",m,Ra),function(){ja=ja.filter(function(w){return w!==l}),document.removeEventListener("wheel",u,Ra),document.removeEventListener("touchmove",u,Ra),document.removeEventListener("touchstart",m,Ra)}},[]);var _=t.removeScrollBar,C=t.inert;return R.createElement(R.Fragment,null,C?R.createElement(l,{styles:cj(i)}):null,_?R.createElement(ej,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function fj(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const hj=HR(GS,dj);var Pc=R.forwardRef(function(t,e){return R.createElement(ff,us({},t,{ref:e,sideCar:hj}))});Pc.classNames=ff.classNames;var pj=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ta=new WeakMap,md=new WeakMap,gd={},bm=0,ZS=function(t){return t&&(t.host||ZS(t.parentNode))},mj=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=ZS(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},gj=function(t,e,n,r){var i=mj(e,Array.isArray(t)?t:[t]);gd[n]||(gd[n]=new WeakMap);var l=gd[n],c=[],a=new Set,u=new Set(i),d=function(p){!p||a.has(p)||(a.add(p),d(p.parentNode))};i.forEach(d);var m=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(a.has(g))m(g);else try{var _=g.getAttribute(r),C=_!==null&&_!=="false",w=(Ta.get(g)||0)+1,y=(l.get(g)||0)+1;Ta.set(g,w),l.set(g,y),c.push(g),w===1&&C&&md.set(g,!0),y===1&&g.setAttribute(n,"true"),C||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return m(e),a.clear(),bm++,function(){c.forEach(function(p){var g=Ta.get(p)-1,_=l.get(p)-1;Ta.set(p,g),l.set(p,_),g||(md.has(p)||p.removeAttribute(r),md.delete(p)),_||p.removeAttribute(n)}),bm--,bm||(Ta=new WeakMap,Ta=new WeakMap,md=new WeakMap,gd={})}},hf=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=pj(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),gj(r,i,n,"aria-hidden")):function(){return null}},pf="Dialog",[JS]=or(pf),[vj,ts]=JS(pf),e2=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:l,modal:c=!0}=t,a=R.useRef(null),u=R.useRef(null),[d,m]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:l,caller:pf});return h.jsx(vj,{scope:e,triggerRef:a,contentRef:u,contentId:Sn(),titleId:Sn(),descriptionId:Sn(),open:d,onOpenChange:m,onOpenToggle:R.useCallback(()=>m(p=>!p),[m]),modal:c,children:n})};e2.displayName=pf;var t2="DialogTrigger",n2=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(t2,n),l=ht(e,i.triggerRef);return h.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Kg(i.open),...r,ref:l,onClick:$e(t.onClick,i.onOpenToggle)})});n2.displayName=t2;var Wg="DialogPortal",[yj,r2]=JS(Wg,{forceMount:void 0}),s2=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,l=ts(Wg,e);return h.jsx(yj,{scope:e,forceMount:n,children:R.Children.map(r,c=>h.jsx(En,{present:n||l.open,children:h.jsx(nl,{asChild:!0,container:i,children:c})}))})};s2.displayName=Wg;var Od="DialogOverlay",i2=R.forwardRef((t,e)=>{const n=r2(Od,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,l=ts(Od,t.__scopeDialog);return l.modal?h.jsx(En,{present:r||l.open,children:h.jsx(xj,{...i,ref:e})}):null});i2.displayName=Od;var bj=zi("DialogOverlay.RemoveScroll"),xj=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(Od,n);return h.jsx(Pc,{as:bj,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(Ze.div,{"data-state":Kg(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Mo="DialogContent",o2=R.forwardRef((t,e)=>{const n=r2(Mo,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,l=ts(Mo,t.__scopeDialog);return h.jsx(En,{present:r||l.open,children:l.modal?h.jsx(_j,{...i,ref:e}):h.jsx(Sj,{...i,ref:e})})});o2.displayName=Mo;var _j=R.forwardRef((t,e)=>{const n=ts(Mo,t.__scopeDialog),r=R.useRef(null),i=ht(e,n.contentRef,r);return R.useEffect(()=>{const l=r.current;if(l)return hf(l)},[]),h.jsx(a2,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$e(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:$e(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,a=c.button===0&&c.ctrlKey===!0;(c.button===2||a)&&l.preventDefault()}),onFocusOutside:$e(t.onFocusOutside,l=>l.preventDefault())})}),Sj=R.forwardRef((t,e)=>{const n=ts(Mo,t.__scopeDialog),r=R.useRef(!1),i=R.useRef(!1);return h.jsx(a2,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,a;(c=t.onCloseAutoFocus)==null||c.call(t,l),l.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),l.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:l=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),a2=R.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:l,...c}=t,a=ts(Mo,n),u=R.useRef(null),d=ht(e,u);return df(),h.jsxs(h.Fragment,{children:[h.jsx(Ic,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:l,children:h.jsx(tl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Kg(a.open),...c,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(wj,{titleId:a.titleId}),h.jsx(kj,{contentRef:u,descriptionId:a.descriptionId})]})]})}),Gg="DialogTitle",l2=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(Gg,n);return h.jsx(Ze.h2,{id:i.titleId,...r,ref:e})});l2.displayName=Gg;var c2="DialogDescription",u2=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(c2,n);return h.jsx(Ze.p,{id:i.descriptionId,...r,ref:e})});u2.displayName=c2;var d2="DialogClose",f2=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(d2,n);return h.jsx(Ze.button,{type:"button",...r,ref:e,onClick:$e(t.onClick,()=>i.onOpenChange(!1))})});f2.displayName=d2;function Kg(t){return t?"open":"closed"}var h2="DialogTitleWarning",[mq,p2]=tR(h2,{contentName:Mo,titleName:Gg,docsSlug:"dialog"}),wj=({titleId:t})=>{const e=p2(h2),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
558
+
559
+ If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
560
+
561
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return R.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Cj="DialogDescriptionWarning",kj=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${p2(Cj).contentName}}.`;return R.useEffect(()=>{var l;const i=(l=t.current)==null?void 0:l.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Yg=e2,Ej=n2,Xg=s2,Qg=i2,Zg=o2,m2=l2,g2=u2,mf=f2;function v2(t){const e=R.useRef({value:t,previous:t});return R.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function y2(t){const[e,n]=R.useState(void 0);return kn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let c,a;if("borderBoxSize"in l){const u=l.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,a=d.blockSize}else c=t.offsetWidth,a=t.offsetHeight;n({width:c,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const Aj=["top","right","bottom","left"],Bi=Math.min,_r=Math.max,Ld=Math.round,vd=Math.floor,hs=t=>({x:t,y:t}),Nj={left:"right",right:"left",bottom:"top",top:"bottom"};function og(t,e,n){return _r(t,Bi(e,n))}function Ws(t,e){return typeof t=="function"?t(e):t}function Gs(t){return t.split("-")[0]}function rl(t){return t.split("-")[1]}function Jg(t){return t==="x"?"y":"x"}function ev(t){return t==="y"?"height":"width"}function fs(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function tv(t){return Jg(fs(t))}function Rj(t,e,n){n===void 0&&(n=!1);const r=rl(t),i=tv(t),l=ev(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(c=Id(c)),[c,Id(c)]}function jj(t){const e=Id(t);return[ag(t),e,ag(e)]}function ag(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const dx=["left","right"],fx=["right","left"],Tj=["top","bottom"],Dj=["bottom","top"];function Mj(t,e,n){switch(t){case"top":case"bottom":return n?e?fx:dx:e?dx:fx;case"left":case"right":return e?Tj:Dj;default:return[]}}function Oj(t,e,n,r){const i=rl(t);let l=Mj(Gs(t),n==="start",r);return i&&(l=l.map(c=>c+"-"+i),e&&(l=l.concat(l.map(ag)))),l}function Id(t){const e=Gs(t);return Nj[e]+t.slice(e.length)}function Lj(t){return{top:0,right:0,bottom:0,left:0,...t}}function b2(t){return typeof t!="number"?Lj(t):{top:t,right:t,bottom:t,left:t}}function Pd(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function hx(t,e,n){let{reference:r,floating:i}=t;const l=fs(e),c=tv(e),a=ev(c),u=Gs(e),d=l==="y",m=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let _;switch(u){case"top":_={x:m,y:r.y-i.height};break;case"bottom":_={x:m,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:p};break;case"left":_={x:r.x-i.width,y:p};break;default:_={x:r.x,y:r.y}}switch(rl(e)){case"start":_[c]-=g*(n&&d?-1:1);break;case"end":_[c]+=g*(n&&d?-1:1);break}return _}async function Ij(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:l,rects:c,elements:a,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:g=!1,padding:_=0}=Ws(e,t),C=b2(_),y=a[g?p==="floating"?"reference":"floating":p],S=Pd(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(y)))==null||n?y:y.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(a.floating)),boundary:d,rootBoundary:m,strategy:u})),b=p==="floating"?{x:r,y:i,width:c.floating.width,height:c.floating.height}:c.reference,x=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a.floating)),k=await(l.isElement==null?void 0:l.isElement(x))?await(l.getScale==null?void 0:l.getScale(x))||{x:1,y:1}:{x:1,y:1},j=Pd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:u}):b);return{top:(S.top-j.top+C.top)/k.y,bottom:(j.bottom-S.bottom+C.bottom)/k.y,left:(S.left-j.left+C.left)/k.x,right:(j.right-S.right+C.right)/k.x}}const Pj=50,zj=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:l=[],platform:c}=n,a=c.detectOverflow?c:{...c,detectOverflow:Ij},u=await(c.isRTL==null?void 0:c.isRTL(e));let d=await c.getElementRects({reference:t,floating:e,strategy:i}),{x:m,y:p}=hx(d,r,u),g=r,_=0;const C={};for(let w=0;w<l.length;w++){const y=l[w];if(!y)continue;const{name:S,fn:b}=y,{x,y:k,data:j,reset:N}=await b({x:m,y:p,initialPlacement:r,placement:g,strategy:i,middlewareData:C,rects:d,platform:a,elements:{reference:t,floating:e}});m=x!=null?x:m,p=k!=null?k:p,C[S]={...C[S],...j},N&&_<Pj&&(_++,typeof N=="object"&&(N.placement&&(g=N.placement),N.rects&&(d=N.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:i}):N.rects),{x:m,y:p}=hx(d,g,u)),w=-1)}return{x:m,y:p,placement:g,strategy:i,middlewareData:C}},Bj=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:l,platform:c,elements:a,middlewareData:u}=e,{element:d,padding:m=0}=Ws(t,e)||{};if(d==null)return{};const p=b2(m),g={x:n,y:r},_=tv(i),C=ev(_),w=await c.getDimensions(d),y=_==="y",S=y?"top":"left",b=y?"bottom":"right",x=y?"clientHeight":"clientWidth",k=l.reference[C]+l.reference[_]-g[_]-l.floating[C],j=g[_]-l.reference[_],N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let D=N?N[x]:0;(!D||!await(c.isElement==null?void 0:c.isElement(N)))&&(D=a.floating[x]||l.floating[C]);const E=k/2-j/2,O=D/2-w[C]/2-1,L=Bi(p[S],O),z=Bi(p[b],O),H=L,$=D-w[C]-z,q=D/2-w[C]/2+E,G=og(H,q,$),W=!u.arrow&&rl(i)!=null&&q!==G&&l.reference[C]/2-(q<H?L:z)-w[C]/2<0,X=W?q<H?q-H:q-$:0;return{[_]:g[_]+X,data:{[_]:G,centerOffset:q-G-X,...W&&{alignmentOffset:X}},reset:W}}}),Fj=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:l,rects:c,initialPlacement:a,platform:u,elements:d}=e,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:w=!0,...y}=Ws(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const S=Gs(i),b=fs(a),x=Gs(a)===a,k=await(u.isRTL==null?void 0:u.isRTL(d.floating)),j=g||(x||!w?[Id(a)]:jj(a)),N=C!=="none";!g&&N&&j.push(...Oj(a,w,C,k));const D=[a,...j],E=await u.detectOverflow(e,y),O=[];let L=((r=l.flip)==null?void 0:r.overflows)||[];if(m&&O.push(E[S]),p){const q=Rj(i,c,k);O.push(E[q[0]],E[q[1]])}if(L=[...L,{placement:i,overflows:O}],!O.every(q=>q<=0)){var z,H;const q=(((z=l.flip)==null?void 0:z.index)||0)+1,G=D[q];if(G&&(!(p==="alignment"?b!==fs(G):!1)||L.every(Y=>fs(Y.placement)===b?Y.overflows[0]>0:!0)))return{data:{index:q,overflows:L},reset:{placement:G}};let W=(H=L.filter(X=>X.overflows[0]<=0).sort((X,Y)=>X.overflows[1]-Y.overflows[1])[0])==null?void 0:H.placement;if(!W)switch(_){case"bestFit":{var $;const X=($=L.filter(Y=>{if(N){const I=fs(Y.placement);return I===b||I==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(I=>I>0).reduce((I,M)=>I+M,0)]).sort((Y,I)=>Y[1]-I[1])[0])==null?void 0:$[0];X&&(W=X);break}case"initialPlacement":W=a;break}if(i!==W)return{reset:{placement:W}}}return{}}}};function px(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function mx(t){return Aj.some(e=>t[e]>=0)}const Hj=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...l}=Ws(t,e);switch(i){case"referenceHidden":{const c=await r.detectOverflow(e,{...l,elementContext:"reference"}),a=px(c,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:mx(a)}}}case"escaped":{const c=await r.detectOverflow(e,{...l,altBoundary:!0}),a=px(c,n.floating);return{data:{escapedOffsets:a,escaped:mx(a)}}}default:return{}}}}},x2=new Set(["left","top"]);async function $j(t,e){const{placement:n,platform:r,elements:i}=t,l=await(r.isRTL==null?void 0:r.isRTL(i.floating)),c=Gs(n),a=rl(n),u=fs(n)==="y",d=x2.has(c)?-1:1,m=l&&u?-1:1,p=Ws(e,t);let{mainAxis:g,crossAxis:_,alignmentAxis:C}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof C=="number"&&(_=a==="end"?C*-1:C),u?{x:_*m,y:g*d}:{x:g*d,y:_*m}}const Uj=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:l,placement:c,middlewareData:a}=e,u=await $j(e,t);return c===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:l+u.y,data:{...u,placement:c}}}}},Vj=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:l}=e,{mainAxis:c=!0,crossAxis:a=!1,limiter:u={fn:S=>{let{x:b,y:x}=S;return{x:b,y:x}}},...d}=Ws(t,e),m={x:n,y:r},p=await l.detectOverflow(e,d),g=fs(Gs(i)),_=Jg(g);let C=m[_],w=m[g];if(c){const S=_==="y"?"top":"left",b=_==="y"?"bottom":"right",x=C+p[S],k=C-p[b];C=og(x,C,k)}if(a){const S=g==="y"?"top":"left",b=g==="y"?"bottom":"right",x=w+p[S],k=w-p[b];w=og(x,w,k)}const y=u.fn({...e,[_]:C,[g]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[_]:c,[g]:a}}}}}},qj=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:l,middlewareData:c}=e,{offset:a=0,mainAxis:u=!0,crossAxis:d=!0}=Ws(t,e),m={x:n,y:r},p=fs(i),g=Jg(p);let _=m[g],C=m[p];const w=Ws(a,e),y=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const x=g==="y"?"height":"width",k=l.reference[g]-l.floating[x]+y.mainAxis,j=l.reference[g]+l.reference[x]-y.mainAxis;_<k?_=k:_>j&&(_=j)}if(d){var S,b;const x=g==="y"?"width":"height",k=x2.has(Gs(i)),j=l.reference[p]-l.floating[x]+(k&&((S=c.offset)==null?void 0:S[p])||0)+(k?0:y.crossAxis),N=l.reference[p]+l.reference[x]+(k?0:((b=c.offset)==null?void 0:b[p])||0)-(k?y.crossAxis:0);C<j?C=j:C>N&&(C=N)}return{[g]:_,[p]:C}}}},Wj=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:l,platform:c,elements:a}=e,{apply:u=()=>{},...d}=Ws(t,e),m=await c.detectOverflow(e,d),p=Gs(i),g=rl(i),_=fs(i)==="y",{width:C,height:w}=l.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=g===(await(c.isRTL==null?void 0:c.isRTL(a.floating))?"start":"end")?"left":"right"):(S=p,y=g==="end"?"top":"bottom");const b=w-m.top-m.bottom,x=C-m.left-m.right,k=Bi(w-m[y],b),j=Bi(C-m[S],x),N=!e.middlewareData.shift;let D=k,E=j;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(E=x),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(D=b),N&&!g){const L=_r(m.left,0),z=_r(m.right,0),H=_r(m.top,0),$=_r(m.bottom,0);_?E=C-2*(L!==0||z!==0?L+z:_r(m.left,m.right)):D=w-2*(H!==0||$!==0?H+$:_r(m.top,m.bottom))}await u({...e,availableWidth:E,availableHeight:D});const O=await c.getDimensions(a.floating);return C!==O.width||w!==O.height?{reset:{rects:!0}}:{}}}};function gf(){return typeof window<"u"}function sl(t){return _2(t)?(t.nodeName||"").toLowerCase():"#document"}function wr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function gs(t){var e;return(e=(_2(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function _2(t){return gf()?t instanceof Node||t instanceof wr(t).Node:!1}function Jr(t){return gf()?t instanceof Element||t instanceof wr(t).Element:!1}function Xs(t){return gf()?t instanceof HTMLElement||t instanceof wr(t).HTMLElement:!1}function gx(t){return!gf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof wr(t).ShadowRoot}function zc(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=es(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function Gj(t){return/^(table|td|th)$/.test(sl(t))}function vf(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Kj=/transform|translate|scale|rotate|perspective|filter/,Yj=/paint|layout|strict|content/,Eo=t=>!!t&&t!=="none";let xm;function nv(t){const e=Jr(t)?es(t):t;return Eo(e.transform)||Eo(e.translate)||Eo(e.scale)||Eo(e.rotate)||Eo(e.perspective)||!rv()&&(Eo(e.backdropFilter)||Eo(e.filter))||Kj.test(e.willChange||"")||Yj.test(e.contain||"")}function Xj(t){let e=Fi(t);for(;Xs(e)&&!Va(e);){if(nv(e))return e;if(vf(e))return null;e=Fi(e)}return null}function rv(){return xm==null&&(xm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xm}function Va(t){return/^(html|body|#document)$/.test(sl(t))}function es(t){return wr(t).getComputedStyle(t)}function yf(t){return Jr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fi(t){if(sl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||gx(t)&&t.host||gs(t);return gx(e)?e.host:e}function S2(t){const e=Fi(t);return Va(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xs(e)&&zc(e)?e:S2(e)}function _c(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=S2(t),l=i===((r=t.ownerDocument)==null?void 0:r.body),c=wr(i);if(l){const a=lg(c);return e.concat(c,c.visualViewport||[],zc(i)?i:[],a&&n?_c(a):[])}else return e.concat(i,_c(i,[],n))}function lg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function w2(t){const e=es(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Xs(t),l=i?t.offsetWidth:n,c=i?t.offsetHeight:r,a=Ld(n)!==l||Ld(r)!==c;return a&&(n=l,r=c),{width:n,height:r,$:a}}function sv(t){return Jr(t)?t:t.contextElement}function Fa(t){const e=sv(t);if(!Xs(e))return hs(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:l}=w2(e);let c=(l?Ld(n.width):n.width)/r,a=(l?Ld(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!a||!Number.isFinite(a))&&(a=1),{x:c,y:a}}const Qj=hs(0);function C2(t){const e=wr(t);return!rv()||!e.visualViewport?Qj:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Zj(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==wr(t)?!1:e}function Oo(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),l=sv(t);let c=hs(1);e&&(r?Jr(r)&&(c=Fa(r)):c=Fa(t));const a=Zj(l,n,r)?C2(l):hs(0);let u=(i.left+a.x)/c.x,d=(i.top+a.y)/c.y,m=i.width/c.x,p=i.height/c.y;if(l){const g=wr(l),_=r&&Jr(r)?wr(r):r;let C=g,w=lg(C);for(;w&&r&&_!==C;){const y=Fa(w),S=w.getBoundingClientRect(),b=es(w),x=S.left+(w.clientLeft+parseFloat(b.paddingLeft))*y.x,k=S.top+(w.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,d*=y.y,m*=y.x,p*=y.y,u+=x,d+=k,C=wr(w),w=lg(C)}}return Pd({width:m,height:p,x:u,y:d})}function bf(t,e){const n=yf(t).scrollLeft;return e?e.left+n:Oo(gs(t)).left+n}function k2(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-bf(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function Jj(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const l=i==="fixed",c=gs(r),a=e?vf(e.floating):!1;if(r===c||a&&l)return n;let u={scrollLeft:0,scrollTop:0},d=hs(1);const m=hs(0),p=Xs(r);if((p||!p&&!l)&&((sl(r)!=="body"||zc(c))&&(u=yf(r)),p)){const _=Oo(r);d=Fa(r),m.x=_.x+r.clientLeft,m.y=_.y+r.clientTop}const g=c&&!p&&!l?k2(c,u):hs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+m.x+g.x,y:n.y*d.y-u.scrollTop*d.y+m.y+g.y}}function eT(t){return Array.from(t.getClientRects())}function tT(t){const e=gs(t),n=yf(t),r=t.ownerDocument.body,i=_r(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=_r(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+bf(t);const a=-n.scrollTop;return es(r).direction==="rtl"&&(c+=_r(e.clientWidth,r.clientWidth)-i),{width:i,height:l,x:c,y:a}}const vx=25;function nT(t,e){const n=wr(t),r=gs(t),i=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,a=0,u=0;if(i){l=i.width,c=i.height;const m=rv();(!m||m&&e==="fixed")&&(a=i.offsetLeft,u=i.offsetTop)}const d=bf(r);if(d<=0){const m=r.ownerDocument,p=m.body,g=getComputedStyle(p),_=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,C=Math.abs(r.clientWidth-p.clientWidth-_);C<=vx&&(l-=C)}else d<=vx&&(l+=d);return{width:l,height:c,x:a,y:u}}function rT(t,e){const n=Oo(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,l=Xs(t)?Fa(t):hs(1),c=t.clientWidth*l.x,a=t.clientHeight*l.y,u=i*l.x,d=r*l.y;return{width:c,height:a,x:u,y:d}}function yx(t,e,n){let r;if(e==="viewport")r=nT(t,n);else if(e==="document")r=tT(gs(t));else if(Jr(e))r=rT(e,n);else{const i=C2(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Pd(r)}function E2(t,e){const n=Fi(t);return n===e||!Jr(n)||Va(n)?!1:es(n).position==="fixed"||E2(n,e)}function sT(t,e){const n=e.get(t);if(n)return n;let r=_c(t,[],!1).filter(a=>Jr(a)&&sl(a)!=="body"),i=null;const l=es(t).position==="fixed";let c=l?Fi(t):t;for(;Jr(c)&&!Va(c);){const a=es(c),u=nv(c);!u&&a.position==="fixed"&&(i=null),(l?!u&&!i:!u&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||zc(c)&&!u&&E2(t,c))?r=r.filter(m=>m!==c):i=a,c=Fi(c)}return e.set(t,r),r}function iT(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const c=[...n==="clippingAncestors"?vf(e)?[]:sT(e,this._c):[].concat(n),r],a=yx(e,c[0],i);let u=a.top,d=a.right,m=a.bottom,p=a.left;for(let g=1;g<c.length;g++){const _=yx(e,c[g],i);u=_r(_.top,u),d=Bi(_.right,d),m=Bi(_.bottom,m),p=_r(_.left,p)}return{width:d-p,height:m-u,x:p,y:u}}function oT(t){const{width:e,height:n}=w2(t);return{width:e,height:n}}function aT(t,e,n){const r=Xs(e),i=gs(e),l=n==="fixed",c=Oo(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const u=hs(0);function d(){u.x=bf(i)}if(r||!r&&!l)if((sl(e)!=="body"||zc(i))&&(a=yf(e)),r){const _=Oo(e,!0,l,e);u.x=_.x+e.clientLeft,u.y=_.y+e.clientTop}else i&&d();l&&!r&&i&&d();const m=i&&!r&&!l?k2(i,a):hs(0),p=c.left+a.scrollLeft-u.x-m.x,g=c.top+a.scrollTop-u.y-m.y;return{x:p,y:g,width:c.width,height:c.height}}function _m(t){return es(t).position==="static"}function bx(t,e){if(!Xs(t)||es(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return gs(t)===n&&(n=n.ownerDocument.body),n}function A2(t,e){const n=wr(t);if(vf(t))return n;if(!Xs(t)){let i=Fi(t);for(;i&&!Va(i);){if(Jr(i)&&!_m(i))return i;i=Fi(i)}return n}let r=bx(t,e);for(;r&&Gj(r)&&_m(r);)r=bx(r,e);return r&&Va(r)&&_m(r)&&!nv(r)?n:r||Xj(t)||n}const lT=async function(t){const e=this.getOffsetParent||A2,n=this.getDimensions,r=await n(t.floating);return{reference:aT(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cT(t){return es(t).direction==="rtl"}const uT={convertOffsetParentRelativeRectToViewportRelativeRect:Jj,getDocumentElement:gs,getClippingRect:iT,getOffsetParent:A2,getElementRects:lT,getClientRects:eT,getDimensions:oT,getScale:Fa,isElement:Jr,isRTL:cT};function N2(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function dT(t,e){let n=null,r;const i=gs(t);function l(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function c(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),l();const d=t.getBoundingClientRect(),{left:m,top:p,width:g,height:_}=d;if(a||e(),!g||!_)return;const C=vd(p),w=vd(i.clientWidth-(m+g)),y=vd(i.clientHeight-(p+_)),S=vd(m),x={rootMargin:-C+"px "+-w+"px "+-y+"px "+-S+"px",threshold:_r(0,Bi(1,u))||1};let k=!0;function j(N){const D=N[0].intersectionRatio;if(D!==u){if(!k)return c();D?c(!1,D):r=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!N2(d,t.getBoundingClientRect())&&c(),k=!1}try{n=new IntersectionObserver(j,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,x)}n.observe(t)}return c(!0),l}function fT(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=sv(t),m=i||l?[...d?_c(d):[],...e?_c(e):[]]:[];m.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),l&&S.addEventListener("resize",n)});const p=d&&a?dT(d,n):null;let g=-1,_=null;c&&(_=new ResizeObserver(S=>{let[b]=S;b&&b.target===d&&_&&e&&(_.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=_)==null||x.observe(e)})),n()}),d&&!u&&_.observe(d),e&&_.observe(e));let C,w=u?Oo(t):null;u&&y();function y(){const S=Oo(t);w&&!N2(w,S)&&n(),w=S,C=requestAnimationFrame(y)}return n(),()=>{var S;m.forEach(b=>{i&&b.removeEventListener("scroll",n),l&&b.removeEventListener("resize",n)}),p==null||p(),(S=_)==null||S.disconnect(),_=null,u&&cancelAnimationFrame(C)}}const hT=Uj,pT=Vj,mT=Fj,gT=Wj,vT=Hj,xx=Bj,yT=qj,bT=(t,e,n)=>{const r=new Map,i={platform:uT,...n},l={...i.platform,_c:r};return zj(t,e,{...i,platform:l})};var xT=typeof document<"u",_T=function(){},Ad=xT?R.useLayoutEffect:_T;function zd(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!zd(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const l=i[r];if(!(l==="_owner"&&t.$$typeof)&&!zd(t[l],e[l]))return!1}return!0}return t!==t&&e!==e}function R2(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function _x(t,e){const n=R2(t);return Math.round(e*n)/n}function Sm(t){const e=R.useRef(t);return Ad(()=>{e.current=t}),e}function ST(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:l,floating:c}={},transform:a=!0,whileElementsMounted:u,open:d}=t,[m,p]=R.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,_]=R.useState(r);zd(g,r)||_(r);const[C,w]=R.useState(null),[y,S]=R.useState(null),b=R.useCallback(Y=>{Y!==N.current&&(N.current=Y,w(Y))},[]),x=R.useCallback(Y=>{Y!==D.current&&(D.current=Y,S(Y))},[]),k=l||C,j=c||y,N=R.useRef(null),D=R.useRef(null),E=R.useRef(m),O=u!=null,L=Sm(u),z=Sm(i),H=Sm(d),$=R.useCallback(()=>{if(!N.current||!D.current)return;const Y={placement:e,strategy:n,middleware:g};z.current&&(Y.platform=z.current),bT(N.current,D.current,Y).then(I=>{const M={...I,isPositioned:H.current!==!1};q.current&&!zd(E.current,M)&&(E.current=M,el.flushSync(()=>{p(M)}))})},[g,e,n,z,H]);Ad(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[d]);const q=R.useRef(!1);Ad(()=>(q.current=!0,()=>{q.current=!1}),[]),Ad(()=>{if(k&&(N.current=k),j&&(D.current=j),k&&j){if(L.current)return L.current(k,j,$);$()}},[k,j,$,L,O]);const G=R.useMemo(()=>({reference:N,floating:D,setReference:b,setFloating:x}),[b,x]),W=R.useMemo(()=>({reference:k,floating:j}),[k,j]),X=R.useMemo(()=>{const Y={position:n,left:0,top:0};if(!W.floating)return Y;const I=_x(W.floating,m.x),M=_x(W.floating,m.y);return a?{...Y,transform:"translate("+I+"px, "+M+"px)",...R2(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:M}},[n,a,W.floating,m.x,m.y]);return R.useMemo(()=>({...m,update:$,refs:G,elements:W,floatingStyles:X}),[m,$,G,W,X])}const wT=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?xx({element:r.current,padding:i}).fn(n):{}:r?xx({element:r,padding:i}).fn(n):{}}}},CT=(t,e)=>{const n=hT(t);return{name:n.name,fn:n.fn,options:[t,e]}},kT=(t,e)=>{const n=pT(t);return{name:n.name,fn:n.fn,options:[t,e]}},ET=(t,e)=>({fn:yT(t).fn,options:[t,e]}),AT=(t,e)=>{const n=mT(t);return{name:n.name,fn:n.fn,options:[t,e]}},NT=(t,e)=>{const n=gT(t);return{name:n.name,fn:n.fn,options:[t,e]}},RT=(t,e)=>{const n=vT(t);return{name:n.name,fn:n.fn,options:[t,e]}},jT=(t,e)=>{const n=wT(t);return{name:n.name,fn:n.fn,options:[t,e]}};var TT="Arrow",j2=R.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...l}=t;return h.jsx(Ze.svg,{...l,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});j2.displayName=TT;var DT=j2,iv="Popper",[T2,Ui]=or(iv),[MT,D2]=T2(iv),M2=t=>{const{__scopePopper:e,children:n}=t,[r,i]=R.useState(null);return h.jsx(MT,{scope:e,anchor:r,onAnchorChange:i,children:n})};M2.displayName=iv;var O2="PopperAnchor",L2=R.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,l=D2(O2,n),c=R.useRef(null),a=ht(e,c),u=R.useRef(null);return R.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||c.current,d!==u.current&&l.onAnchorChange(u.current)}),r?null:h.jsx(Ze.div,{...i,ref:a})});L2.displayName=O2;var ov="PopperContent",[OT,LT]=T2(ov),I2=R.forwardRef((t,e)=>{var K,V,te,re,ae,se,_e,Ee;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:l="center",alignOffset:c=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:_="optimized",onPlaced:C,...w}=t,y=D2(ov,n),[S,b]=R.useState(null),x=ht(e,De=>b(De)),[k,j]=R.useState(null),N=y2(k),D=(K=N==null?void 0:N.width)!=null?K:0,E=(V=N==null?void 0:N.height)!=null?V:0,O=r+(l!=="center"?"-"+l:""),L=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},z=Array.isArray(d)?d:[d],H=z.length>0,$={padding:L,boundary:z.filter(PT),altBoundary:H},{refs:q,floatingStyles:G,placement:W,isPositioned:X,middlewareData:Y}=ST({strategy:"fixed",placement:O,whileElementsMounted:(...De)=>fT(...De,{animationFrame:_==="always"}),elements:{reference:y.anchor},middleware:[CT({mainAxis:i+E,alignmentAxis:c}),u&&kT({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?ET():void 0,...$}),u&&AT({...$}),NT({...$,apply:({elements:De,rects:Ue,availableWidth:ce,availableHeight:je})=>{const{width:be,height:Ve}=Ue.reference,qe=De.floating.style;qe.setProperty("--radix-popper-available-width",`${ce}px`),qe.setProperty("--radix-popper-available-height",`${je}px`),qe.setProperty("--radix-popper-anchor-width",`${be}px`),qe.setProperty("--radix-popper-anchor-height",`${Ve}px`)}}),k&&jT({element:k,padding:a}),zT({arrowWidth:D,arrowHeight:E}),g&&RT({strategy:"referenceHidden",...$})]}),[I,M]=B2(W),P=Pn(C);kn(()=>{X&&(P==null||P())},[X,P]);const F=(te=Y.arrow)==null?void 0:te.x,B=(re=Y.arrow)==null?void 0:re.y,Q=((ae=Y.arrow)==null?void 0:ae.centerOffset)!==0,[J,ee]=R.useState();return kn(()=>{S&&ee(window.getComputedStyle(S).zIndex)},[S]),h.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:X?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(se=Y.transformOrigin)==null?void 0:se.x,(_e=Y.transformOrigin)==null?void 0:_e.y].join(" "),...((Ee=Y.hide)==null?void 0:Ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(OT,{scope:n,placedSide:I,onArrowChange:j,arrowX:F,arrowY:B,shouldHideArrow:Q,children:h.jsx(Ze.div,{"data-side":I,"data-align":M,...w,ref:x,style:{...w.style,animation:X?void 0:"none"}})})})});I2.displayName=ov;var P2="PopperArrow",IT={top:"bottom",right:"left",bottom:"top",left:"right"},z2=R.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,l=LT(P2,r),c=IT[l.placedSide];return h.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:h.jsx(DT,{...i,ref:n,style:{...i.style,display:"block"}})})});z2.displayName=P2;function PT(t){return t!==null}var zT=t=>({name:"transformOrigin",options:t,fn(e){var y,S,b,x,k;const{placement:n,rects:r,middlewareData:i}=e,c=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=c?0:t.arrowWidth,u=c?0:t.arrowHeight,[d,m]=B2(n),p={start:"0%",center:"50%",end:"100%"}[m],g=((b=(S=i.arrow)==null?void 0:S.x)!=null?b:0)+a/2,_=((k=(x=i.arrow)==null?void 0:x.y)!=null?k:0)+u/2;let C="",w="";return d==="bottom"?(C=c?p:`${g}px`,w=`${-u}px`):d==="top"?(C=c?p:`${g}px`,w=`${r.floating.height+u}px`):d==="right"?(C=`${-u}px`,w=c?p:`${_}px`):d==="left"&&(C=`${r.floating.width+u}px`,w=c?p:`${_}px`),{data:{x:C,y:w}}}});function B2(t){const[e,n="center"]=t.split("-");return[e,n]}var xf=M2,Bc=L2,_f=I2,Sf=z2,wm="rovingFocusGroup.onEntryFocus",BT={bubbles:!1,cancelable:!0},Fc="RovingFocusGroup",[cg,F2,FT]=$g(Fc),[HT,wf]=or(Fc,[FT]),[$T,UT]=HT(Fc),H2=R.forwardRef((t,e)=>h.jsx(cg.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(cg.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(VT,{...t,ref:e})})}));H2.displayName=Fc;var VT=R.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...p}=t,g=R.useRef(null),_=ht(e,g),C=Lc(l),[w,y]=ms({prop:c,defaultProp:a!=null?a:null,onChange:u,caller:Fc}),[S,b]=R.useState(!1),x=Pn(d),k=F2(n),j=R.useRef(!1),[N,D]=R.useState(0);return R.useEffect(()=>{const E=g.current;if(E)return E.addEventListener(wm,x),()=>E.removeEventListener(wm,x)},[x]),h.jsx($T,{scope:n,orientation:r,dir:C,loop:i,currentTabStopId:w,onItemFocus:R.useCallback(E=>y(E),[y]),onItemShiftTab:R.useCallback(()=>b(!0),[]),onFocusableItemAdd:R.useCallback(()=>D(E=>E+1),[]),onFocusableItemRemove:R.useCallback(()=>D(E=>E-1),[]),children:h.jsx(Ze.div,{tabIndex:S||N===0?-1:0,"data-orientation":r,...p,ref:_,style:{outline:"none",...t.style},onMouseDown:$e(t.onMouseDown,()=>{j.current=!0}),onFocus:$e(t.onFocus,E=>{const O=!j.current;if(E.target===E.currentTarget&&O&&!S){const L=new CustomEvent(wm,BT);if(E.currentTarget.dispatchEvent(L),!L.defaultPrevented){const z=k().filter(W=>W.focusable),H=z.find(W=>W.active),$=z.find(W=>W.id===w),G=[H,$,...z].filter(Boolean).map(W=>W.ref.current);V2(G,m)}}j.current=!1}),onBlur:$e(t.onBlur,()=>b(!1))})})}),$2="RovingFocusGroupItem",U2=R.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:l,children:c,...a}=t,u=Sn(),d=l||u,m=UT($2,n),p=m.currentTabStopId===d,g=F2(n),{onFocusableItemAdd:_,onFocusableItemRemove:C,currentTabStopId:w}=m;return R.useEffect(()=>{if(r)return _(),()=>C()},[r,_,C]),h.jsx(cg.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:h.jsx(Ze.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...a,ref:e,onMouseDown:$e(t.onMouseDown,y=>{r?m.onItemFocus(d):y.preventDefault()}),onFocus:$e(t.onFocus,()=>m.onItemFocus(d)),onKeyDown:$e(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){m.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=GT(y,m.orientation,m.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=g().filter(k=>k.focusable).map(k=>k.ref.current);if(S==="last")x.reverse();else if(S==="prev"||S==="next"){S==="prev"&&x.reverse();const k=x.indexOf(y.currentTarget);x=m.loop?KT(x,k+1):x.slice(k+1)}setTimeout(()=>V2(x))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:w!=null}):c})})});U2.displayName=$2;var qT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WT(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function GT(t,e,n){const r=WT(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return qT[r]}function V2(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function KT(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var q2=H2,W2=U2,ug=["Enter"," "],YT=["ArrowDown","PageUp","Home"],G2=["ArrowUp","PageDown","End"],XT=[...YT,...G2],QT={ltr:[...ug,"ArrowRight"],rtl:[...ug,"ArrowLeft"]},ZT={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Hc="Menu",[Sc,JT,e6]=$g(Hc),[Bo,K2]=or(Hc,[e6,Ui,wf]),Cf=Ui(),Y2=wf(),[t6,Fo]=Bo(Hc),[n6,$c]=Bo(Hc),X2=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:l,modal:c=!0}=t,a=Cf(e),[u,d]=R.useState(null),m=R.useRef(!1),p=Pn(l),g=Lc(i);return R.useEffect(()=>{const _=()=>{m.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>m.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),h.jsx(xf,{...a,children:h.jsx(t6,{scope:e,open:n,onOpenChange:p,content:u,onContentChange:d,children:h.jsx(n6,{scope:e,onClose:R.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:c,children:r})})})};X2.displayName=Hc;var r6="MenuAnchor",av=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Cf(n);return h.jsx(Bc,{...i,...r,ref:e})});av.displayName=r6;var lv="MenuPortal",[s6,Q2]=Bo(lv,{forceMount:void 0}),Z2=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,l=Fo(lv,e);return h.jsx(s6,{scope:e,forceMount:n,children:h.jsx(En,{present:n||l.open,children:h.jsx(nl,{asChild:!0,container:i,children:r})})})};Z2.displayName=lv;var Fr="MenuContent",[i6,cv]=Bo(Fr),J2=R.forwardRef((t,e)=>{const n=Q2(Fr,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,l=Fo(Fr,t.__scopeMenu),c=$c(Fr,t.__scopeMenu);return h.jsx(Sc.Provider,{scope:t.__scopeMenu,children:h.jsx(En,{present:r||l.open,children:h.jsx(Sc.Slot,{scope:t.__scopeMenu,children:c.modal?h.jsx(o6,{...i,ref:e}):h.jsx(a6,{...i,ref:e})})})})}),o6=R.forwardRef((t,e)=>{const n=Fo(Fr,t.__scopeMenu),r=R.useRef(null),i=ht(e,r);return R.useEffect(()=>{const l=r.current;if(l)return hf(l)},[]),h.jsx(uv,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:$e(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),a6=R.forwardRef((t,e)=>{const n=Fo(Fr,t.__scopeMenu);return h.jsx(uv,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),l6=zi("MenuContent.ScrollLock"),uv=R.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:_,disableOutsideScroll:C,...w}=t,y=Fo(Fr,n),S=$c(Fr,n),b=Cf(n),x=Y2(n),k=JT(n),[j,N]=R.useState(null),D=R.useRef(null),E=ht(e,D,y.onContentChange),O=R.useRef(0),L=R.useRef(""),z=R.useRef(0),H=R.useRef(null),$=R.useRef("right"),q=R.useRef(0),G=C?Pc:R.Fragment,W=C?{as:l6,allowPinchZoom:!0}:void 0,X=I=>{var K,V;const M=L.current+I,P=k().filter(te=>!te.disabled),F=document.activeElement,B=(K=P.find(te=>te.ref.current===F))==null?void 0:K.textValue,Q=P.map(te=>te.textValue),J=x6(Q,M,B),ee=(V=P.find(te=>te.textValue===J))==null?void 0:V.ref.current;(function te(re){L.current=re,window.clearTimeout(O.current),re!==""&&(O.current=window.setTimeout(()=>te(""),1e3))})(M),ee&&setTimeout(()=>ee.focus())};R.useEffect(()=>()=>window.clearTimeout(O.current),[]),df();const Y=R.useCallback(I=>{var P,F;return $.current===((P=H.current)==null?void 0:P.side)&&S6(I,(F=H.current)==null?void 0:F.area)},[]);return h.jsx(i6,{scope:n,searchRef:L,onItemEnter:R.useCallback(I=>{Y(I)&&I.preventDefault()},[Y]),onItemLeave:R.useCallback(I=>{var M;Y(I)||((M=D.current)==null||M.focus(),N(null))},[Y]),onTriggerLeave:R.useCallback(I=>{Y(I)&&I.preventDefault()},[Y]),pointerGraceTimerRef:z,onPointerGraceIntentChange:R.useCallback(I=>{H.current=I},[]),children:h.jsx(G,{...W,children:h.jsx(Ic,{asChild:!0,trapped:i,onMountAutoFocus:$e(l,I=>{var M;I.preventDefault(),(M=D.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:_,children:h.jsx(q2,{asChild:!0,...x,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:$e(u,I=>{S.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(_f,{role:"menu","aria-orientation":"vertical","data-state":mw(y.open),"data-radix-menu-content":"",dir:S.dir,...b,...w,ref:E,style:{outline:"none",...w.style},onKeyDown:$e(w.onKeyDown,I=>{const P=I.target.closest("[data-radix-menu-content]")===I.currentTarget,F=I.ctrlKey||I.altKey||I.metaKey,B=I.key.length===1;P&&(I.key==="Tab"&&I.preventDefault(),!F&&B&&X(I.key));const Q=D.current;if(I.target!==Q||!XT.includes(I.key))return;I.preventDefault();const ee=k().filter(K=>!K.disabled).map(K=>K.ref.current);G2.includes(I.key)&&ee.reverse(),y6(ee)}),onBlur:$e(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(O.current),L.current="")}),onPointerMove:$e(t.onPointerMove,wc(I=>{const M=I.target,P=q.current!==I.clientX;if(I.currentTarget.contains(M)&&P){const F=I.clientX>q.current?"right":"left";$.current=F,q.current=I.clientX}}))})})})})})})});J2.displayName=Fr;var c6="MenuGroup",dv=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(Ze.div,{role:"group",...r,ref:e})});dv.displayName=c6;var u6="MenuLabel",ew=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(Ze.div,{...r,ref:e})});ew.displayName=u6;var Bd="MenuItem",Sx="menu.itemSelect",kf=R.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,l=R.useRef(null),c=$c(Bd,t.__scopeMenu),a=cv(Bd,t.__scopeMenu),u=ht(e,l),d=R.useRef(!1),m=()=>{const p=l.current;if(!n&&p){const g=new CustomEvent(Sx,{bubbles:!0,cancelable:!0});p.addEventListener(Sx,_=>r==null?void 0:r(_),{once:!0}),LS(p,g),g.defaultPrevented?d.current=!1:c.onClose()}};return h.jsx(tw,{...i,ref:u,disabled:n,onClick:$e(t.onClick,m),onPointerDown:p=>{var g;(g=t.onPointerDown)==null||g.call(t,p),d.current=!0},onPointerUp:$e(t.onPointerUp,p=>{var g;d.current||(g=p.currentTarget)==null||g.click()}),onKeyDown:$e(t.onKeyDown,p=>{const g=a.searchRef.current!=="";n||g&&p.key===" "||ug.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});kf.displayName=Bd;var tw=R.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...l}=t,c=cv(Bd,n),a=Y2(n),u=R.useRef(null),d=ht(e,u),[m,p]=R.useState(!1),[g,_]=R.useState("");return R.useEffect(()=>{var w;const C=u.current;C&&_(((w=C.textContent)!=null?w:"").trim())},[l.children]),h.jsx(Sc.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:g,children:h.jsx(W2,{asChild:!0,...a,focusable:!r,children:h.jsx(Ze.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:d,onPointerMove:$e(t.onPointerMove,wc(C=>{r?c.onItemLeave(C):(c.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$e(t.onPointerLeave,wc(C=>c.onItemLeave(C))),onFocus:$e(t.onFocus,()=>p(!0)),onBlur:$e(t.onBlur,()=>p(!1))})})})}),d6="MenuCheckboxItem",nw=R.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return h.jsx(aw,{scope:t.__scopeMenu,checked:n,children:h.jsx(kf,{role:"menuitemcheckbox","aria-checked":Fd(n)?"mixed":n,...i,ref:e,"data-state":hv(n),onSelect:$e(i.onSelect,()=>r==null?void 0:r(Fd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});nw.displayName=d6;var rw="MenuRadioGroup",[f6,h6]=Bo(rw,{value:void 0,onValueChange:()=>{}}),sw=R.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,l=Pn(r);return h.jsx(f6,{scope:t.__scopeMenu,value:n,onValueChange:l,children:h.jsx(dv,{...i,ref:e})})});sw.displayName=rw;var iw="MenuRadioItem",ow=R.forwardRef((t,e)=>{const{value:n,...r}=t,i=h6(iw,t.__scopeMenu),l=n===i.value;return h.jsx(aw,{scope:t.__scopeMenu,checked:l,children:h.jsx(kf,{role:"menuitemradio","aria-checked":l,...r,ref:e,"data-state":hv(l),onSelect:$e(r.onSelect,()=>{var c;return(c=i.onValueChange)==null?void 0:c.call(i,n)},{checkForDefaultPrevented:!1})})})});ow.displayName=iw;var fv="MenuItemIndicator",[aw,p6]=Bo(fv,{checked:!1}),lw=R.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,l=p6(fv,n);return h.jsx(En,{present:r||Fd(l.checked)||l.checked===!0,children:h.jsx(Ze.span,{...i,ref:e,"data-state":hv(l.checked)})})});lw.displayName=fv;var m6="MenuSeparator",cw=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});cw.displayName=m6;var g6="MenuArrow",uw=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Cf(n);return h.jsx(Sf,{...i,...r,ref:e})});uw.displayName=g6;var v6="MenuSub",[gq,dw]=Bo(v6),fc="MenuSubTrigger",fw=R.forwardRef((t,e)=>{const n=Fo(fc,t.__scopeMenu),r=$c(fc,t.__scopeMenu),i=dw(fc,t.__scopeMenu),l=cv(fc,t.__scopeMenu),c=R.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=l,d={__scopeMenu:t.__scopeMenu},m=R.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return R.useEffect(()=>m,[m]),R.useEffect(()=>{const p=a.current;return()=>{window.clearTimeout(p),u(null)}},[a,u]),h.jsx(av,{asChild:!0,...d,children:h.jsx(tw,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":mw(n.open),...t,ref:qs(e,i.onTriggerChange),onClick:p=>{var g;(g=t.onClick)==null||g.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:$e(t.onPointerMove,wc(p=>{l.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:$e(t.onPointerLeave,wc(p=>{var _,C;m();const g=(_=n.content)==null?void 0:_.getBoundingClientRect();if(g){const w=(C=n.content)==null?void 0:C.dataset.side,y=w==="right",S=y?-5:5,b=g[y?"left":"right"],x=g[y?"right":"left"];l.onPointerGraceIntentChange({area:[{x:p.clientX+S,y:p.clientY},{x:b,y:g.top},{x,y:g.top},{x,y:g.bottom},{x:b,y:g.bottom}],side:w}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(p),p.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:$e(t.onKeyDown,p=>{var _;const g=l.searchRef.current!=="";t.disabled||g&&p.key===" "||QT[r.dir].includes(p.key)&&(n.onOpenChange(!0),(_=n.content)==null||_.focus(),p.preventDefault())})})})});fw.displayName=fc;var hw="MenuSubContent",pw=R.forwardRef((t,e)=>{const n=Q2(Fr,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,l=Fo(Fr,t.__scopeMenu),c=$c(Fr,t.__scopeMenu),a=dw(hw,t.__scopeMenu),u=R.useRef(null),d=ht(e,u);return h.jsx(Sc.Provider,{scope:t.__scopeMenu,children:h.jsx(En,{present:r||l.open,children:h.jsx(Sc.Slot,{scope:t.__scopeMenu,children:h.jsx(uv,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:d,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;c.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:$e(t.onFocusOutside,m=>{m.target!==a.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:$e(t.onEscapeKeyDown,m=>{c.onClose(),m.preventDefault()}),onKeyDown:$e(t.onKeyDown,m=>{var _;const p=m.currentTarget.contains(m.target),g=ZT[c.dir].includes(m.key);p&&g&&(l.onOpenChange(!1),(_=a.trigger)==null||_.focus(),m.preventDefault())})})})})})});pw.displayName=hw;function mw(t){return t?"open":"closed"}function Fd(t){return t==="indeterminate"}function hv(t){return Fd(t)?"indeterminate":t?"checked":"unchecked"}function y6(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function b6(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function x6(t,e,n){const i=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let c=b6(t,Math.max(l,0));i.length===1&&(c=c.filter(d=>d!==n));const u=c.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function _6(t,e){const{x:n,y:r}=t;let i=!1;for(let l=0,c=e.length-1;l<e.length;c=l++){const a=e[l],u=e[c],d=a.x,m=a.y,p=u.x,g=u.y;m>r!=g>r&&n<(p-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function S6(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return _6(n,e)}function wc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var w6=X2,C6=av,k6=Z2,E6=J2,A6=dv,N6=ew,R6=kf,j6=nw,T6=sw,D6=ow,M6=lw,O6=cw,L6=uw,I6=fw,P6=pw,Ef="DropdownMenu",[z6]=or(Ef,[K2]),Qn=K2(),[B6,gw]=z6(Ef),vw=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:l,onOpenChange:c,modal:a=!0}=t,u=Qn(e),d=R.useRef(null),[m,p]=ms({prop:i,defaultProp:l!=null?l:!1,onChange:c,caller:Ef});return h.jsx(B6,{scope:e,triggerId:Sn(),triggerRef:d,contentId:Sn(),open:m,onOpenChange:p,onOpenToggle:R.useCallback(()=>p(g=>!g),[p]),modal:a,children:h.jsx(w6,{...u,open:m,onOpenChange:p,dir:r,modal:a,children:n})})};vw.displayName=Ef;var yw="DropdownMenuTrigger",bw=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,l=gw(yw,n),c=Qn(n);return h.jsx(C6,{asChild:!0,...c,children:h.jsx(Ze.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:qs(e,l.triggerRef),onPointerDown:$e(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(l.onOpenToggle(),l.open||a.preventDefault())}),onKeyDown:$e(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&l.onOpenToggle(),a.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});bw.displayName=yw;var F6="DropdownMenuPortal",xw=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Qn(e);return h.jsx(k6,{...r,...n})};xw.displayName=F6;var _w="DropdownMenuContent",Sw=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=gw(_w,n),l=Qn(n),c=R.useRef(!1);return h.jsx(E6,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...r,ref:e,onCloseAutoFocus:$e(t.onCloseAutoFocus,a=>{var u;c.current||(u=i.triggerRef.current)==null||u.focus(),c.current=!1,a.preventDefault()}),onInteractOutside:$e(t.onInteractOutside,a=>{const u=a.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,m=u.button===2||d;(!i.modal||m)&&(c.current=!0)}),style:{...t.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)"}})});Sw.displayName=_w;var H6="DropdownMenuGroup",$6=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(A6,{...i,...r,ref:e})});$6.displayName=H6;var U6="DropdownMenuLabel",V6=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(N6,{...i,...r,ref:e})});V6.displayName=U6;var q6="DropdownMenuItem",ww=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(R6,{...i,...r,ref:e})});ww.displayName=q6;var W6="DropdownMenuCheckboxItem",G6=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(j6,{...i,...r,ref:e})});G6.displayName=W6;var K6="DropdownMenuRadioGroup",Y6=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(T6,{...i,...r,ref:e})});Y6.displayName=K6;var X6="DropdownMenuRadioItem",Q6=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(D6,{...i,...r,ref:e})});Q6.displayName=X6;var Z6="DropdownMenuItemIndicator",J6=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(M6,{...i,...r,ref:e})});J6.displayName=Z6;var eD="DropdownMenuSeparator",tD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(O6,{...i,...r,ref:e})});tD.displayName=eD;var nD="DropdownMenuArrow",rD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(L6,{...i,...r,ref:e})});rD.displayName=nD;var sD="DropdownMenuSubTrigger",iD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(I6,{...i,...r,ref:e})});iD.displayName=sD;var oD="DropdownMenuSubContent",aD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(P6,{...i,...r,ref:e,style:{...t.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)"}})});aD.displayName=oD;var lD=vw,cD=bw,uD=xw,dD=Sw,fD=ww,hD="Label",Cw=R.forwardRef((t,e)=>h.jsx(Ze.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Cw.displayName=hD;var pD=Cw;function dg(t,[e,n]){return Math.min(n,Math.max(e,t))}var Af="Popover",[kw]=or(Af,[Ui]),Uc=Ui(),[mD,Vi]=kw(Af),Ew=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:l,modal:c=!1}=t,a=Uc(e),u=R.useRef(null),[d,m]=R.useState(!1),[p,g]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:l,caller:Af});return h.jsx(xf,{...a,children:h.jsx(mD,{scope:e,contentId:Sn(),triggerRef:u,open:p,onOpenChange:g,onOpenToggle:R.useCallback(()=>g(_=>!_),[g]),hasCustomAnchor:d,onCustomAnchorAdd:R.useCallback(()=>m(!0),[]),onCustomAnchorRemove:R.useCallback(()=>m(!1),[]),modal:c,children:n})})};Ew.displayName=Af;var Aw="PopoverAnchor",Nw=R.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Vi(Aw,n),l=Uc(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:a}=i;return R.useEffect(()=>(c(),()=>a()),[c,a]),h.jsx(Bc,{...l,...r,ref:e})});Nw.displayName=Aw;var Rw="PopoverTrigger",jw=R.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Vi(Rw,n),l=Uc(n),c=ht(e,i.triggerRef),a=h.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Lw(i.open),...r,ref:c,onClick:$e(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:h.jsx(Bc,{asChild:!0,...l,children:a})});jw.displayName=Rw;var pv="PopoverPortal",[gD,vD]=kw(pv,{forceMount:void 0}),Tw=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,l=Vi(pv,e);return h.jsx(gD,{scope:e,forceMount:n,children:h.jsx(En,{present:n||l.open,children:h.jsx(nl,{asChild:!0,container:i,children:r})})})};Tw.displayName=pv;var qa="PopoverContent",Dw=R.forwardRef((t,e)=>{const n=vD(qa,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,l=Vi(qa,t.__scopePopover);return h.jsx(En,{present:r||l.open,children:l.modal?h.jsx(bD,{...i,ref:e}):h.jsx(xD,{...i,ref:e})})});Dw.displayName=qa;var yD=zi("PopoverContent.RemoveScroll"),bD=R.forwardRef((t,e)=>{const n=Vi(qa,t.__scopePopover),r=R.useRef(null),i=ht(e,r),l=R.useRef(!1);return R.useEffect(()=>{const c=r.current;if(c)return hf(c)},[]),h.jsx(Pc,{as:yD,allowPinchZoom:!0,children:h.jsx(Mw,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$e(t.onCloseAutoFocus,c=>{var a;c.preventDefault(),l.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:$e(t.onPointerDownOutside,c=>{const a=c.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,d=a.button===2||u;l.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:$e(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),xD=R.forwardRef((t,e)=>{const n=Vi(qa,t.__scopePopover),r=R.useRef(!1),i=R.useRef(!1);return h.jsx(Mw,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,a;(c=t.onCloseAutoFocus)==null||c.call(t,l),l.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),l.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:l=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),Mw=R.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,...p}=t,g=Vi(qa,n),_=Uc(n);return df(),h.jsx(Ic,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:l,children:h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:h.jsx(_f,{"data-state":Lw(g.open),role:"dialog",id:g.contentId,..._,...p,ref:e,style:{...p.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)"}})})})}),Ow="PopoverClose",_D=R.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Vi(Ow,n);return h.jsx(Ze.button,{type:"button",...r,ref:e,onClick:$e(t.onClick,()=>i.onOpenChange(!1))})});_D.displayName=Ow;var SD="PopoverArrow",wD=R.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Uc(n);return h.jsx(Sf,{...i,...r,ref:e})});wD.displayName=SD;function Lw(t){return t?"open":"closed"}var CD=Ew,kD=Nw,ED=jw,AD=Tw,ND=Dw,mv="Progress",gv=100,[RD]=or(mv),[jD,TD]=RD(mv),Iw=R.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:l=DD,...c}=t;(i||i===0)&&!wx(i)&&console.error(MD(`${i}`,"Progress"));const a=wx(i)?i:gv;r!==null&&!Cx(r,a)&&console.error(OD(`${r}`,"Progress"));const u=Cx(r,a)?r:null,d=Hd(u)?l(u,a):void 0;return h.jsx(jD,{scope:n,value:u,max:a,children:h.jsx(Ze.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Hd(u)?u:void 0,"aria-valuetext":d,role:"progressbar","data-state":Bw(u,a),"data-value":u!=null?u:void 0,"data-max":a,...c,ref:e})})});Iw.displayName=mv;var Pw="ProgressIndicator",zw=R.forwardRef((t,e)=>{var l;const{__scopeProgress:n,...r}=t,i=TD(Pw,n);return h.jsx(Ze.div,{"data-state":Bw(i.value,i.max),"data-value":(l=i.value)!=null?l:void 0,"data-max":i.max,...r,ref:e})});zw.displayName=Pw;function DD(t,e){return`${Math.round(t/e*100)}%`}function Bw(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Hd(t){return typeof t=="number"}function wx(t){return Hd(t)&&!isNaN(t)&&t>0}function Cx(t,e){return Hd(t)&&!isNaN(t)&&t<=e&&t>=0}function MD(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${gv}\`.`}function OD(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
562
+ - a positive number
563
+ - less than the value passed to \`max\` (or ${gv} if no \`max\` prop is set)
564
+ - \`null\` or \`undefined\` if the progress is indeterminate.
565
+
566
+ Defaulting to \`null\`.`}var LD=Iw,ID=zw;function PD(t,e){return R.useReducer((n,r)=>{const i=e[n][r];return i!=null?i:n},t)}var vv="ScrollArea",[Fw]=or(vv),[zD,$r]=Fw(vv),Hw=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:l=600,...c}=t,[a,u]=R.useState(null),[d,m]=R.useState(null),[p,g]=R.useState(null),[_,C]=R.useState(null),[w,y]=R.useState(null),[S,b]=R.useState(0),[x,k]=R.useState(0),[j,N]=R.useState(!1),[D,E]=R.useState(!1),O=ht(e,z=>u(z)),L=Lc(i);return h.jsx(zD,{scope:n,type:r,dir:L,scrollHideDelay:l,scrollArea:a,viewport:d,onViewportChange:m,content:p,onContentChange:g,scrollbarX:_,onScrollbarXChange:C,scrollbarXEnabled:j,onScrollbarXEnabledChange:N,scrollbarY:w,onScrollbarYChange:y,scrollbarYEnabled:D,onScrollbarYEnabledChange:E,onCornerWidthChange:b,onCornerHeightChange:k,children:h.jsx(Ze.div,{dir:L,...c,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});Hw.displayName=vv;var $w="ScrollAreaViewport",Uw=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:i,...l}=t,c=$r($w,n),a=R.useRef(null),u=ht(e,a,c.onViewportChange);return h.jsxs(h.Fragment,{children:[h.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:i}),h.jsx(Ze.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:h.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Uw.displayName=$w;var vs="ScrollAreaScrollbar",Vw=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=$r(vs,t.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=i,a=t.orientation==="horizontal";return R.useEffect(()=>(a?l(!0):c(!0),()=>{a?l(!1):c(!1)}),[a,l,c]),i.type==="hover"?h.jsx(BD,{...r,ref:e,forceMount:n}):i.type==="scroll"?h.jsx(FD,{...r,ref:e,forceMount:n}):i.type==="auto"?h.jsx(qw,{...r,ref:e,forceMount:n}):i.type==="always"?h.jsx(yv,{...r,ref:e}):null});Vw.displayName=vs;var BD=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=$r(vs,t.__scopeScrollArea),[l,c]=R.useState(!1);return R.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const d=()=>{window.clearTimeout(u),c(!0)},m=()=>{u=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),h.jsx(En,{present:n||l,children:h.jsx(qw,{"data-state":l?"visible":"hidden",...r,ref:e})})}),FD=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=$r(vs,t.__scopeScrollArea),l=t.orientation==="horizontal",c=Rf(()=>u("SCROLL_END"),100),[a,u]=PD("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 R.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,i.scrollHideDelay,u]),R.useEffect(()=>{const d=i.viewport,m=l?"scrollLeft":"scrollTop";if(d){let p=d[m];const g=()=>{const _=d[m];p!==_&&(u("SCROLL"),c()),p=_};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[i.viewport,l,u,c]),h.jsx(En,{present:n||a!=="hidden",children:h.jsx(yv,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:$e(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:$e(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),qw=R.forwardRef((t,e)=>{const n=$r(vs,t.__scopeScrollArea),{forceMount:r,...i}=t,[l,c]=R.useState(!1),a=t.orientation==="horizontal",u=Rf(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(a?d:m)}},10);return Wa(n.viewport,u),Wa(n.content,u),h.jsx(En,{present:r||l,children:h.jsx(yv,{"data-state":l?"visible":"hidden",...i,ref:e})})}),yv=R.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,i=$r(vs,t.__scopeScrollArea),l=R.useRef(null),c=R.useRef(0),[a,u]=R.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Xw(a.viewport,a.content),m={...r,sizes:a,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:g=>l.current=g,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:g=>c.current=g};function p(g,_){return WD(g,c.current,a,_)}return n==="horizontal"?h.jsx(HD,{...m,ref:e,onThumbPositionChange:()=>{if(i.viewport&&l.current){const g=i.viewport.scrollLeft,_=kx(g,a,i.dir);l.current.style.transform=`translate3d(${_}px, 0, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollLeft=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollLeft=p(g,i.dir))}}):n==="vertical"?h.jsx($D,{...m,ref:e,onThumbPositionChange:()=>{if(i.viewport&&l.current){const g=i.viewport.scrollTop,_=kx(g,a);l.current.style.transform=`translate3d(0, ${_}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=p(g))}}):null}),HD=R.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,l=$r(vs,t.__scopeScrollArea),[c,a]=R.useState(),u=R.useRef(null),d=ht(e,u,l.onScrollbarXChange);return R.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),h.jsx(Gw,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Nf(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.x),onDragScroll:m=>t.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(l.viewport){const g=l.viewport.scrollLeft+m.deltaX;t.onWheelScroll(g),Zw(g,p)&&m.preventDefault()}},onResize:()=>{u.current&&l.viewport&&c&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Ud(c.paddingLeft),paddingEnd:Ud(c.paddingRight)}})}})}),$D=R.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,l=$r(vs,t.__scopeScrollArea),[c,a]=R.useState(),u=R.useRef(null),d=ht(e,u,l.onScrollbarYChange);return R.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),h.jsx(Gw,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Nf(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.y),onDragScroll:m=>t.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(l.viewport){const g=l.viewport.scrollTop+m.deltaY;t.onWheelScroll(g),Zw(g,p)&&m.preventDefault()}},onResize:()=>{u.current&&l.viewport&&c&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Ud(c.paddingTop),paddingEnd:Ud(c.paddingBottom)}})}})}),[UD,Ww]=Fw(vs),Gw=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:m,onResize:p,...g}=t,_=$r(vs,n),[C,w]=R.useState(null),y=ht(e,O=>w(O)),S=R.useRef(null),b=R.useRef(""),x=_.viewport,k=r.content-r.viewport,j=Pn(m),N=Pn(u),D=Rf(p,10);function E(O){if(S.current){const L=O.clientX-S.current.left,z=O.clientY-S.current.top;d({x:L,y:z})}}return R.useEffect(()=>{const O=L=>{const z=L.target;(C==null?void 0:C.contains(z))&&j(L,k)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[x,C,k,j]),R.useEffect(N,[r,N]),Wa(C,D),Wa(_.content,D),h.jsx(UD,{scope:n,scrollbar:C,hasThumb:i,onThumbChange:Pn(l),onThumbPointerUp:Pn(c),onThumbPositionChange:N,onThumbPointerDown:Pn(a),children:h.jsx(Ze.div,{...g,ref:y,style:{position:"absolute",...g.style},onPointerDown:$e(t.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),S.current=C.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",_.viewport&&(_.viewport.style.scrollBehavior="auto"),E(O))}),onPointerMove:$e(t.onPointerMove,E),onPointerUp:$e(t.onPointerUp,O=>{const L=O.target;L.hasPointerCapture(O.pointerId)&&L.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=b.current,_.viewport&&(_.viewport.style.scrollBehavior=""),S.current=null})})})}),$d="ScrollAreaThumb",Kw=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ww($d,t.__scopeScrollArea);return h.jsx(En,{present:n||i.hasThumb,children:h.jsx(VD,{ref:e,...r})})}),VD=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...i}=t,l=$r($d,n),c=Ww($d,n),{onThumbPositionChange:a}=c,u=ht(e,p=>c.onThumbChange(p)),d=R.useRef(void 0),m=Rf(()=>{d.current&&(d.current(),d.current=void 0)},100);return R.useEffect(()=>{const p=l.viewport;if(p){const g=()=>{if(m(),!d.current){const _=GD(p,a);d.current=_,a()}};return a(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[l.viewport,m,a]),h.jsx(Ze.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:$e(t.onPointerDownCapture,p=>{const _=p.target.getBoundingClientRect(),C=p.clientX-_.left,w=p.clientY-_.top;c.onThumbPointerDown({x:C,y:w})}),onPointerUp:$e(t.onPointerUp,c.onThumbPointerUp)})});Kw.displayName=$d;var bv="ScrollAreaCorner",Yw=R.forwardRef((t,e)=>{const n=$r(bv,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.jsx(qD,{...t,ref:e}):null});Yw.displayName=bv;var qD=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,i=$r(bv,n),[l,c]=R.useState(0),[a,u]=R.useState(0),d=!!(l&&a);return Wa(i.scrollbarX,()=>{var p;const m=((p=i.scrollbarX)==null?void 0:p.offsetHeight)||0;i.onCornerHeightChange(m),u(m)}),Wa(i.scrollbarY,()=>{var p;const m=((p=i.scrollbarY)==null?void 0:p.offsetWidth)||0;i.onCornerWidthChange(m),c(m)}),d?h.jsx(Ze.div,{...r,ref:e,style:{width:l,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Ud(t){return t?parseInt(t,10):0}function Xw(t,e){const n=t/e;return isNaN(n)?0:n}function Nf(t){const e=Xw(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function WD(t,e,n,r="ltr"){const i=Nf(n),l=i/2,c=e||l,a=i-c,u=n.scrollbar.paddingStart+c,d=n.scrollbar.size-n.scrollbar.paddingEnd-a,m=n.content-n.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return Qw([u,d],p)(t)}function kx(t,e,n="ltr"){const r=Nf(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=e.scrollbar.size-i,c=e.content-e.viewport,a=l-r,u=n==="ltr"?[0,c]:[c*-1,0],d=dg(t,u);return Qw([0,c],[0,a])(d)}function Qw(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function Zw(t,e){return t>0&&t<e}var GD=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function i(){const l={left:t.scrollLeft,top:t.scrollTop},c=n.left!==l.left,a=n.top!==l.top;(c||a)&&e(),n=l,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Rf(t,e){const n=Pn(t),r=R.useRef(0);return R.useEffect(()=>()=>window.clearTimeout(r.current),[]),R.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Wa(t,e){const n=Pn(e);kn(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}var KD=Hw,YD=Uw,XD=Yw,QD=[" ","Enter","ArrowUp","ArrowDown"],ZD=[" ","Enter"],Lo="Select",[jf,Tf,JD]=$g(Lo),[il]=or(Lo,[JD,Ui]),Df=Ui(),[eM,qi]=il(Lo),[tM,nM]=il(Lo),Jw=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:l,value:c,defaultValue:a,onValueChange:u,dir:d,name:m,autoComplete:p,disabled:g,required:_,form:C}=t,w=Df(e),[y,S]=R.useState(null),[b,x]=R.useState(null),[k,j]=R.useState(!1),N=Lc(d),[D,E]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:l,caller:Lo}),[O,L]=ms({prop:c,defaultProp:a,onChange:u,caller:Lo}),z=R.useRef(null),H=y?C||!!y.closest("form"):!0,[$,q]=R.useState(new Set),G=Array.from($).map(W=>W.props.value).join(";");return h.jsx(xf,{...w,children:h.jsxs(eM,{required:_,scope:e,trigger:y,onTriggerChange:S,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:k,onValueNodeHasChildrenChange:j,contentId:Sn(),value:O,onValueChange:L,open:D,onOpenChange:E,dir:N,triggerPointerDownPosRef:z,disabled:g,children:[h.jsx(jf.Provider,{scope:e,children:h.jsx(tM,{scope:t.__scopeSelect,onNativeOptionAdd:R.useCallback(W=>{q(X=>new Set(X).add(W))},[]),onNativeOptionRemove:R.useCallback(W=>{q(X=>{const Y=new Set(X);return Y.delete(W),Y})},[]),children:n})}),H?h.jsxs(wC,{"aria-hidden":!0,required:_,tabIndex:-1,name:m,autoComplete:p,value:O,onChange:W=>L(W.target.value),disabled:g,form:C,children:[O===void 0?h.jsx("option",{value:""}):null,Array.from($)]},G):null]})})};Jw.displayName=Lo;var eC="SelectTrigger",tC=R.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,l=Df(n),c=qi(eC,n),a=c.disabled||r,u=ht(e,c.onTriggerChange),d=Tf(n),m=R.useRef("touch"),[p,g,_]=kC(w=>{const y=d().filter(x=>!x.disabled),S=y.find(x=>x.value===c.value),b=EC(y,w,S);b!==void 0&&c.onValueChange(b.value)}),C=w=>{a||(c.onOpenChange(!0),_()),w&&(c.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return h.jsx(Bc,{asChild:!0,...l,children:h.jsx(Ze.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":CC(c.value)?"":void 0,...i,ref:u,onClick:$e(i.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&C(w)}),onPointerDown:$e(i.onPointerDown,w=>{m.current=w.pointerType;const y=w.target;y.hasPointerCapture(w.pointerId)&&y.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(C(w),w.preventDefault())}),onKeyDown:$e(i.onKeyDown,w=>{const y=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(y&&w.key===" ")&&QD.includes(w.key)&&(C(),w.preventDefault())})})})});tC.displayName=eC;var nC="SelectValue",rC=R.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:l,placeholder:c="",...a}=t,u=qi(nC,n),{onValueNodeHasChildrenChange:d}=u,m=l!==void 0,p=ht(e,u.onValueNodeChange);return kn(()=>{d(m)},[d,m]),h.jsx(Ze.span,{...a,ref:p,style:{pointerEvents:"none"},children:CC(u.value)?h.jsx(h.Fragment,{children:c}):l})});rC.displayName=nC;var rM="SelectIcon",sC=R.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return h.jsx(Ze.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});sC.displayName=rM;var sM="SelectPortal",iC=t=>h.jsx(nl,{asChild:!0,...t});iC.displayName=sM;var Io="SelectContent",oC=R.forwardRef((t,e)=>{const n=qi(Io,t.__scopeSelect),[r,i]=R.useState();if(kn(()=>{i(new DocumentFragment)},[]),!n.open){const l=r;return l?el.createPortal(h.jsx(aC,{scope:t.__scopeSelect,children:h.jsx(jf.Slot,{scope:t.__scopeSelect,children:h.jsx("div",{children:t.children})})}),l):null}return h.jsx(lC,{...t,ref:e})});oC.displayName=Io;var Yr=10,[aC,Wi]=il(Io),iM="SelectContentImpl",oM=zi("SelectContent.RemoveScroll"),lC=R.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:c,side:a,sideOffset:u,align:d,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:_,sticky:C,hideWhenDetached:w,avoidCollisions:y,...S}=t,b=qi(Io,n),[x,k]=R.useState(null),[j,N]=R.useState(null),D=ht(e,K=>k(K)),[E,O]=R.useState(null),[L,z]=R.useState(null),H=Tf(n),[$,q]=R.useState(!1),G=R.useRef(!1);R.useEffect(()=>{if(x)return hf(x)},[x]),df();const W=R.useCallback(K=>{const[V,...te]=H().map(se=>se.ref.current),[re]=te.slice(-1),ae=document.activeElement;for(const se of K)if(se===ae||(se==null||se.scrollIntoView({block:"nearest"}),se===V&&j&&(j.scrollTop=0),se===re&&j&&(j.scrollTop=j.scrollHeight),se==null||se.focus(),document.activeElement!==ae))return},[H,j]),X=R.useCallback(()=>W([E,x]),[W,E,x]);R.useEffect(()=>{$&&X()},[$,X]);const{onOpenChange:Y,triggerPointerDownPosRef:I}=b;R.useEffect(()=>{if(x){let K={x:0,y:0};const V=re=>{var ae,se,_e,Ee;K={x:Math.abs(Math.round(re.pageX)-((se=(ae=I.current)==null?void 0:ae.x)!=null?se:0)),y:Math.abs(Math.round(re.pageY)-((Ee=(_e=I.current)==null?void 0:_e.y)!=null?Ee:0))}},te=re=>{K.x<=10&&K.y<=10?re.preventDefault():x.contains(re.target)||Y(!1),document.removeEventListener("pointermove",V),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",te,{capture:!0})}}},[x,Y,I]),R.useEffect(()=>{const K=()=>Y(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[Y]);const[M,P]=kC(K=>{const V=H().filter(ae=>!ae.disabled),te=V.find(ae=>ae.ref.current===document.activeElement),re=EC(V,K,te);re&&setTimeout(()=>re.ref.current.focus())}),F=R.useCallback((K,V,te)=>{const re=!G.current&&!te;(b.value!==void 0&&b.value===V||re)&&(O(K),re&&(G.current=!0))},[b.value]),B=R.useCallback(()=>x==null?void 0:x.focus(),[x]),Q=R.useCallback((K,V,te)=>{const re=!G.current&&!te;(b.value!==void 0&&b.value===V||re)&&z(K)},[b.value]),J=r==="popper"?fg:cC,ee=J===fg?{side:a,sideOffset:u,align:d,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:_,sticky:C,hideWhenDetached:w,avoidCollisions:y}:{};return h.jsx(aC,{scope:n,content:x,viewport:j,onViewportChange:N,itemRefCallback:F,selectedItem:E,onItemLeave:B,itemTextRefCallback:Q,focusSelectedItem:X,selectedItemText:L,position:r,isPositioned:$,searchRef:M,children:h.jsx(Pc,{as:oM,allowPinchZoom:!0,children:h.jsx(Ic,{asChild:!0,trapped:b.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:$e(i,K=>{var V;(V=b.trigger)==null||V.focus({preventScroll:!0}),K.preventDefault()}),children:h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:h.jsx(J,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:K=>K.preventDefault(),...S,...ee,onPlaced:()=>q(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:$e(S.onKeyDown,K=>{const V=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!V&&K.key.length===1&&P(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let re=H().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(K.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ae=K.target,se=re.indexOf(ae);re=re.slice(se+1)}setTimeout(()=>W(re)),K.preventDefault()}})})})})})})});lC.displayName=iM;var aM="SelectItemAlignedPosition",cC=R.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,l=qi(Io,n),c=Wi(Io,n),[a,u]=R.useState(null),[d,m]=R.useState(null),p=ht(e,D=>m(D)),g=Tf(n),_=R.useRef(!1),C=R.useRef(!0),{viewport:w,selectedItem:y,selectedItemText:S,focusSelectedItem:b}=c,x=R.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&d&&w&&y&&S){const D=l.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),O=l.valueNode.getBoundingClientRect(),L=S.getBoundingClientRect();if(l.dir!=="rtl"){const ae=L.left-E.left,se=O.left-ae,_e=D.left-se,Ee=D.width+_e,De=Math.max(Ee,E.width),Ue=window.innerWidth-Yr,ce=dg(se,[Yr,Math.max(Yr,Ue-De)]);a.style.minWidth=Ee+"px",a.style.left=ce+"px"}else{const ae=E.right-L.right,se=window.innerWidth-O.right-ae,_e=window.innerWidth-D.right-se,Ee=D.width+_e,De=Math.max(Ee,E.width),Ue=window.innerWidth-Yr,ce=dg(se,[Yr,Math.max(Yr,Ue-De)]);a.style.minWidth=Ee+"px",a.style.right=ce+"px"}const z=g(),H=window.innerHeight-Yr*2,$=w.scrollHeight,q=window.getComputedStyle(d),G=parseInt(q.borderTopWidth,10),W=parseInt(q.paddingTop,10),X=parseInt(q.borderBottomWidth,10),Y=parseInt(q.paddingBottom,10),I=G+W+$+Y+X,M=Math.min(y.offsetHeight*5,I),P=window.getComputedStyle(w),F=parseInt(P.paddingTop,10),B=parseInt(P.paddingBottom,10),Q=D.top+D.height/2-Yr,J=H-Q,ee=y.offsetHeight/2,K=y.offsetTop+ee,V=G+W+K,te=I-V;if(V<=Q){const ae=z.length>0&&y===z[z.length-1].ref.current;a.style.bottom="0px";const se=d.clientHeight-w.offsetTop-w.offsetHeight,_e=Math.max(J,ee+(ae?B:0)+se+X),Ee=V+_e;a.style.height=Ee+"px"}else{const ae=z.length>0&&y===z[0].ref.current;a.style.top="0px";const _e=Math.max(Q,G+w.offsetTop+(ae?F:0)+ee)+te;a.style.height=_e+"px",w.scrollTop=V-Q+w.offsetTop}a.style.margin=`${Yr}px 0`,a.style.minHeight=M+"px",a.style.maxHeight=H+"px",r==null||r(),requestAnimationFrame(()=>_.current=!0)}},[g,l.trigger,l.valueNode,a,d,w,y,S,l.dir,r]);kn(()=>x(),[x]);const[k,j]=R.useState();kn(()=>{d&&j(window.getComputedStyle(d).zIndex)},[d]);const N=R.useCallback(D=>{D&&C.current===!0&&(x(),b==null||b(),C.current=!1)},[x,b]);return h.jsx(cM,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:_,onScrollButtonChange:N,children:h.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:h.jsx(Ze.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});cC.displayName=aM;var lM="SelectPopperPosition",fg=R.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Yr,...l}=t,c=Df(n);return h.jsx(_f,{...c,...l,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...l.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)"}})});fg.displayName=lM;var[cM,xv]=il(Io,{}),hg="SelectViewport",uC=R.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,l=Wi(hg,n),c=xv(hg,n),a=ht(e,l.onViewportChange),u=R.useRef(0);return h.jsxs(h.Fragment,{children:[h.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:r}),h.jsx(jf.Slot,{scope:n,children:h.jsx(Ze.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:$e(i.onScroll,d=>{const m=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=c;if(g!=null&&g.current&&p){const _=Math.abs(u.current-m.scrollTop);if(_>0){const C=window.innerHeight-Yr*2,w=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(w,y);if(S<C){const b=S+_,x=Math.min(C,b),k=b-x;p.style.height=x+"px",p.style.bottom==="0px"&&(m.scrollTop=k>0?k:0,p.style.justifyContent="flex-end")}}}u.current=m.scrollTop})})})]})});uC.displayName=hg;var dC="SelectGroup",[uM,dM]=il(dC),fC=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Sn();return h.jsx(uM,{scope:n,id:i,children:h.jsx(Ze.div,{role:"group","aria-labelledby":i,...r,ref:e})})});fC.displayName=dC;var hC="SelectLabel",pC=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=dM(hC,n);return h.jsx(Ze.div,{id:i.id,...r,ref:e})});pC.displayName=hC;var Vd="SelectItem",[fM,mC]=il(Vd),gC=R.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:l,...c}=t,a=qi(Vd,n),u=Wi(Vd,n),d=a.value===r,[m,p]=R.useState(l!=null?l:""),[g,_]=R.useState(!1),C=ht(e,b=>{var x;return(x=u.itemRefCallback)==null?void 0:x.call(u,b,r,i)}),w=Sn(),y=R.useRef("touch"),S=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 h.jsx(fM,{scope:n,value:r,disabled:i,textId:w,isSelected:d,onItemTextChange:R.useCallback(b=>{p(x=>{var k;return x||((k=b==null?void 0:b.textContent)!=null?k:"").trim()})},[]),children:h.jsx(jf.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:h.jsx(Ze.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:C,onFocus:$e(c.onFocus,()=>_(!0)),onBlur:$e(c.onBlur,()=>_(!1)),onClick:$e(c.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:$e(c.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:$e(c.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:$e(c.onPointerMove,b=>{var x;y.current=b.pointerType,i?(x=u.onItemLeave)==null||x.call(u):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$e(c.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=u.onItemLeave)==null||x.call(u))}),onKeyDown:$e(c.onKeyDown,b=>{var k;((k=u.searchRef)==null?void 0:k.current)!==""&&b.key===" "||(ZD.includes(b.key)&&S(),b.key===" "&&b.preventDefault())})})})})});gC.displayName=Vd;var hc="SelectItemText",vC=R.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...l}=t,c=qi(hc,n),a=Wi(hc,n),u=mC(hc,n),d=nM(hc,n),[m,p]=R.useState(null),g=ht(e,S=>p(S),u.onItemTextChange,S=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,S,u.value,u.disabled)}),_=m==null?void 0:m.textContent,C=R.useMemo(()=>h.jsx("option",{value:u.value,disabled:u.disabled,children:_},u.value),[u.disabled,u.value,_]),{onNativeOptionAdd:w,onNativeOptionRemove:y}=d;return kn(()=>(w(C),()=>y(C)),[w,y,C]),h.jsxs(h.Fragment,{children:[h.jsx(Ze.span,{id:u.textId,...l,ref:g}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren?el.createPortal(l.children,c.valueNode):null]})});vC.displayName=hc;var yC="SelectItemIndicator",bC=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return mC(yC,n).isSelected?h.jsx(Ze.span,{"aria-hidden":!0,...r,ref:e}):null});bC.displayName=yC;var pg="SelectScrollUpButton",xC=R.forwardRef((t,e)=>{const n=Wi(pg,t.__scopeSelect),r=xv(pg,t.__scopeSelect),[i,l]=R.useState(!1),c=ht(e,r.onScrollButtonChange);return kn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=u.scrollTop>0;l(d)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?h.jsx(SC,{...t,ref:c,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});xC.displayName=pg;var mg="SelectScrollDownButton",_C=R.forwardRef((t,e)=>{const n=Wi(mg,t.__scopeSelect),r=xv(mg,t.__scopeSelect),[i,l]=R.useState(!1),c=ht(e,r.onScrollButtonChange);return kn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=u.scrollHeight-u.clientHeight,m=Math.ceil(u.scrollTop)<d;l(m)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?h.jsx(SC,{...t,ref:c,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});_C.displayName=mg;var SC=R.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,l=Wi("SelectScrollButton",n),c=R.useRef(null),a=Tf(n),u=R.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return R.useEffect(()=>()=>u(),[u]),kn(()=>{var m;const d=a().find(p=>p.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[a]),h.jsx(Ze.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:$e(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:$e(i.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:$e(i.onPointerLeave,()=>{u()})})}),hM="SelectSeparator",pM=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return h.jsx(Ze.div,{"aria-hidden":!0,...r,ref:e})});pM.displayName=hM;var gg="SelectArrow",mM=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Df(n),l=qi(gg,n),c=Wi(gg,n);return l.open&&c.position==="popper"?h.jsx(Sf,{...i,...r,ref:e}):null});mM.displayName=gg;var gM="SelectBubbleInput",wC=R.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=R.useRef(null),l=ht(r,i),c=v2(e);return R.useEffect(()=>{const a=i.current;if(!a)return;const u=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(u,"value").set;if(c!==e&&m){const p=new Event("change",{bubbles:!0});m.call(a,e),a.dispatchEvent(p)}},[c,e]),h.jsx(Ze.select,{...n,style:{...IS,...n.style},ref:l,defaultValue:e})});wC.displayName=gM;function CC(t){return t===""||t===void 0}function kC(t){const e=Pn(t),n=R.useRef(""),r=R.useRef(0),i=R.useCallback(c=>{const a=n.current+c;e(a),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(a)},[e]),l=R.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,l]}function EC(t,e,n){const i=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let c=vM(t,Math.max(l,0));i.length===1&&(c=c.filter(d=>d!==n));const u=c.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function vM(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var yM=Jw,bM=tC,xM=rC,_M=sC,SM=iC,wM=oC,CM=uC,kM=fC,EM=pC,AM=gC,NM=vC,RM=bC,jM=xC,TM=_C,DM="Separator",Ex="horizontal",MM=["horizontal","vertical"],AC=R.forwardRef((t,e)=>{const{decorative:n,orientation:r=Ex,...i}=t,l=OM(r)?r:Ex,a=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return h.jsx(Ze.div,{"data-orientation":l,...a,...i,ref:e})});AC.displayName=DM;function OM(t){return MM.includes(t)}var LM=AC,Mf="Switch",[IM]=or(Mf),[PM,zM]=IM(Mf),NC=R.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:l,required:c,disabled:a,value:u="on",onCheckedChange:d,form:m,...p}=t,[g,_]=R.useState(null),C=ht(e,x=>_(x)),w=R.useRef(!1),y=g?m||!!g.closest("form"):!0,[S,b]=ms({prop:i,defaultProp:l!=null?l:!1,onChange:d,caller:Mf});return h.jsxs(PM,{scope:n,checked:S,disabled:a,children:[h.jsx(Ze.button,{type:"button",role:"switch","aria-checked":S,"aria-required":c,"data-state":DC(S),"data-disabled":a?"":void 0,disabled:a,value:u,...p,ref:C,onClick:$e(t.onClick,x=>{b(k=>!k),y&&(w.current=x.isPropagationStopped(),w.current||x.stopPropagation())})}),y&&h.jsx(TC,{control:g,bubbles:!w.current,name:r,value:u,checked:S,required:c,disabled:a,form:m,style:{transform:"translateX(-100%)"}})]})});NC.displayName=Mf;var RC="SwitchThumb",jC=R.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=zM(RC,n);return h.jsx(Ze.span,{"data-state":DC(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});jC.displayName=RC;var BM="SwitchBubbleInput",TC=R.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...i},l)=>{const c=R.useRef(null),a=ht(c,l),u=v2(n),d=y2(e);return R.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(p,"checked").set;if(u!==n&&_){const C=new Event("click",{bubbles:r});_.call(m,n),m.dispatchEvent(C)}},[u,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:a,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});TC.displayName=BM;function DC(t){return t?"checked":"unchecked"}var FM=NC,HM=jC,Of="Tabs",[$M]=or(Of,[wf]),MC=wf(),[UM,_v]=$M(Of),OC=R.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:l,orientation:c="horizontal",dir:a,activationMode:u="automatic",...d}=t,m=Lc(a),[p,g]=ms({prop:r,onChange:i,defaultProp:l!=null?l:"",caller:Of});return h.jsx(UM,{scope:n,baseId:Sn(),value:p,onValueChange:g,orientation:c,dir:m,activationMode:u,children:h.jsx(Ze.div,{dir:m,"data-orientation":c,...d,ref:e})})});OC.displayName=Of;var LC="TabsList",IC=R.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,l=_v(LC,n),c=MC(n);return h.jsx(q2,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:r,children:h.jsx(Ze.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:e})})});IC.displayName=LC;var PC="TabsTrigger",zC=R.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...l}=t,c=_v(PC,n),a=MC(n),u=HC(c.baseId,r),d=$C(c.baseId,r),m=r===c.value;return h.jsx(W2,{asChild:!0,...a,focusable:!i,active:m,children:h.jsx(Ze.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...l,ref:e,onMouseDown:$e(t.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?c.onValueChange(r):p.preventDefault()}),onKeyDown:$e(t.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&c.onValueChange(r)}),onFocus:$e(t.onFocus,()=>{const p=c.activationMode!=="manual";!m&&!i&&p&&c.onValueChange(r)})})})});zC.displayName=PC;var BC="TabsContent",FC=R.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:l,...c}=t,a=_v(BC,n),u=HC(a.baseId,r),d=$C(a.baseId,r),m=r===a.value,p=R.useRef(m);return R.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),h.jsx(En,{present:i||m,children:({present:g})=>h.jsx(Ze.div,{"data-state":m?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:d,tabIndex:0,...c,ref:e,style:{...t.style,animationDuration:p.current?"0s":void 0},children:g&&l})})});FC.displayName=BC;function HC(t,e){return`${t}-trigger-${e}`}function $C(t,e){return`${t}-content-${e}`}var VM=OC,qM=IC,WM=zC,GM=FC,[Lf]=or("Tooltip",[Ui]),If=Ui(),UC="TooltipProvider",KM=700,vg="tooltip.open",[YM,Sv]=Lf(UC),VC=t=>{const{__scopeTooltip:e,delayDuration:n=KM,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:l}=t,c=R.useRef(!0),a=R.useRef(!1),u=R.useRef(0);return R.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),h.jsx(YM,{scope:e,isOpenDelayedRef:c,delayDuration:n,onOpen:R.useCallback(()=>{window.clearTimeout(u.current),c.current=!1},[]),onClose:R.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:R.useCallback(d=>{a.current=d},[]),disableHoverableContent:i,children:l})};VC.displayName=UC;var Cc="Tooltip",[XM,Vc]=Lf(Cc),qC=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:l,disableHoverableContent:c,delayDuration:a}=t,u=Sv(Cc,t.__scopeTooltip),d=If(e),[m,p]=R.useState(null),g=Sn(),_=R.useRef(0),C=c!=null?c:u.disableHoverableContent,w=a!=null?a:u.delayDuration,y=R.useRef(!1),[S,b]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:D=>{D?(u.onOpen(),document.dispatchEvent(new CustomEvent(vg))):u.onClose(),l==null||l(D)},caller:Cc}),x=R.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),k=R.useCallback(()=>{window.clearTimeout(_.current),_.current=0,y.current=!1,b(!0)},[b]),j=R.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b(!1)},[b]),N=R.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{y.current=!0,b(!0),_.current=0},w)},[w,b]);return R.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]),h.jsx(xf,{...d,children:h.jsx(XM,{scope:e,contentId:g,open:S,stateAttribute:x,trigger:m,onTriggerChange:p,onTriggerEnter:R.useCallback(()=>{u.isOpenDelayedRef.current?N():k()},[u.isOpenDelayedRef,N,k]),onTriggerLeave:R.useCallback(()=>{C?j():(window.clearTimeout(_.current),_.current=0)},[j,C]),onOpen:k,onClose:j,disableHoverableContent:C,children:n})})};qC.displayName=Cc;var yg="TooltipTrigger",WC=R.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Vc(yg,n),l=Sv(yg,n),c=If(n),a=R.useRef(null),u=ht(e,a,i.onTriggerChange),d=R.useRef(!1),m=R.useRef(!1),p=R.useCallback(()=>d.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),h.jsx(Bc,{asChild:!0,...c,children:h.jsx(Ze.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:u,onPointerMove:$e(t.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:$e(t.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:$e(t.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:$e(t.onFocus,()=>{d.current||i.onOpen()}),onBlur:$e(t.onBlur,i.onClose),onClick:$e(t.onClick,i.onClose)})})});WC.displayName=yg;var wv="TooltipPortal",[QM,ZM]=Lf(wv,{forceMount:void 0}),GC=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,l=Vc(wv,e);return h.jsx(QM,{scope:e,forceMount:n,children:h.jsx(En,{present:n||l.open,children:h.jsx(nl,{asChild:!0,container:i,children:r})})})};GC.displayName=wv;var Ga="TooltipContent",KC=R.forwardRef((t,e)=>{const n=ZM(Ga,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...l}=t,c=Vc(Ga,t.__scopeTooltip);return h.jsx(En,{present:r||c.open,children:c.disableHoverableContent?h.jsx(YC,{side:i,...l,ref:e}):h.jsx(JM,{side:i,...l,ref:e})})}),JM=R.forwardRef((t,e)=>{const n=Vc(Ga,t.__scopeTooltip),r=Sv(Ga,t.__scopeTooltip),i=R.useRef(null),l=ht(e,i),[c,a]=R.useState(null),{trigger:u,onClose:d}=n,m=i.current,{onPointerInTransitChange:p}=r,g=R.useCallback(()=>{a(null),p(!1)},[p]),_=R.useCallback((C,w)=>{const y=C.currentTarget,S={x:C.clientX,y:C.clientY},b=rO(S,y.getBoundingClientRect()),x=sO(S,b),k=iO(w.getBoundingClientRect()),j=aO([...x,...k]);a(j),p(!0)},[p]);return R.useEffect(()=>()=>g(),[g]),R.useEffect(()=>{if(u&&m){const C=y=>_(y,m),w=y=>_(y,u);return u.addEventListener("pointerleave",C),m.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",C),m.removeEventListener("pointerleave",w)}}},[u,m,_,g]),R.useEffect(()=>{if(c){const C=w=>{const y=w.target,S={x:w.clientX,y:w.clientY},b=(u==null?void 0:u.contains(y))||(m==null?void 0:m.contains(y)),x=!oO(S,c);b?g():x&&(g(),d())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[u,m,c,d,g]),h.jsx(YC,{...t,ref:l})}),[eO,tO]=Lf(Cc,{isInside:!1}),nO=KN("TooltipContent"),YC=R.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:l,onPointerDownOutside:c,...a}=t,u=Vc(Ga,n),d=If(n),{onClose:m}=u;return R.useEffect(()=>(document.addEventListener(vg,m),()=>document.removeEventListener(vg,m)),[m]),R.useEffect(()=>{if(u.trigger){const p=g=>{const _=g.target;_!=null&&_.contains(u.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,m]),h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:h.jsxs(_f,{"data-state":u.stateAttribute,...d,...a,ref:e,style:{...a.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:[h.jsx(nO,{children:r}),h.jsx(eO,{scope:n,isInside:!0,children:h.jsx(eR,{id:u.contentId,role:"tooltip",children:i||r})})]})})});KC.displayName=Ga;var XC="TooltipArrow",QC=R.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=If(n);return tO(XC,n).isInside?null:h.jsx(Sf,{...i,...r,ref:e})});QC.displayName=XC;function rO(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),l=Math.abs(e.left-t.x);switch(Math.min(n,r,i,l)){case l:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function sO(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function iO(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function oO(t,e){const{x:n,y:r}=t;let i=!1;for(let l=0,c=e.length-1;l<e.length;c=l++){const a=e[l],u=e[c],d=a.x,m=a.y,p=u.x,g=u.y;m>r!=g>r&&n<(p-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function aO(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),lO(e)}function lO(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const l=e[e.length-1],c=e[e.length-2];if((l.x-c.x)*(i.y-c.y)>=(l.y-c.y)*(i.x-c.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(i.y-c.y)>=(l.y-c.y)*(i.x-c.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var cO=VC,uO=qC,dO=WC,fO=GC,hO=KC,pO=QC;const mO=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},gO=(t,e)=>({classGroupId:t,validator:e}),ZC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),qd="-",Ax=[],vO="arbitrary..",yO=t=>{const e=xO(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return bO(c);const a=c.split(qd),u=a[0]===""&&a.length>1?1:0;return JC(a,u,e)},getConflictingClassGroupIds:(c,a)=>{if(a){const u=r[c],d=n[c];return u?d?mO(d,u):u:d||Ax}return n[c]||Ax}}},JC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],l=n.nextPart.get(i);if(l){const d=JC(t,e+1,l);if(d)return d}const c=n.validators;if(c===null)return;const a=e===0?t.join(qd):t.slice(e).join(qd),u=c.length;for(let d=0;d<u;d++){const m=c[d];if(m.validator(a))return m.classGroupId}},bO=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?vO+r:void 0})(),xO=t=>{const{theme:e,classGroups:n}=t;return _O(n,e)},_O=(t,e)=>{const n=ZC();for(const r in t){const i=t[r];Cv(i,n,r,e)}return n},Cv=(t,e,n,r)=>{const i=t.length;for(let l=0;l<i;l++){const c=t[l];SO(c,e,n,r)}},SO=(t,e,n,r)=>{if(typeof t=="string"){wO(t,e,n);return}if(typeof t=="function"){CO(t,e,n,r);return}kO(t,e,n,r)},wO=(t,e,n)=>{const r=t===""?e:ek(e,t);r.classGroupId=n},CO=(t,e,n,r)=>{if(EO(t)){Cv(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(gO(n,t))},kO=(t,e,n,r)=>{const i=Object.entries(t),l=i.length;for(let c=0;c<l;c++){const[a,u]=i[c];Cv(u,ek(e,a),n,r)}},ek=(t,e)=>{let n=t;const r=e.split(qd),i=r.length;for(let l=0;l<i;l++){const c=r[l];let a=n.nextPart.get(c);a||(a=ZC(),n.nextPart.set(c,a)),n=a}return n},EO=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,AO=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(l,c)=>{n[l]=c,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(l){let c=n[l];if(c!==void 0)return c;if((c=r[l])!==void 0)return i(l,c),c},set(l,c){l in n?n[l]=c:i(l,c)}}},bg="!",Nx=":",NO=[],Rx=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),RO=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const l=[];let c=0,a=0,u=0,d;const m=i.length;for(let w=0;w<m;w++){const y=i[w];if(c===0&&a===0){if(y===Nx){l.push(i.slice(u,w)),u=w+1;continue}if(y==="/"){d=w;continue}}y==="["?c++:y==="]"?c--:y==="("?a++:y===")"&&a--}const p=l.length===0?i:i.slice(u);let g=p,_=!1;p.endsWith(bg)?(g=p.slice(0,-1),_=!0):p.startsWith(bg)&&(g=p.slice(1),_=!0);const C=d&&d>u?d-u:void 0;return Rx(l,_,g,C)};if(e){const i=e+Nx,l=r;r=c=>c.startsWith(i)?l(c.slice(i.length)):Rx(NO,!1,c,void 0,!0)}if(n){const i=r;r=l=>n({className:l,parseClassName:i})}return r},jO=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let l=0;l<n.length;l++){const c=n[l],a=c[0]==="[",u=e.has(c);a||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(c)):i.push(c)}return i.length>0&&(i.sort(),r.push(...i)),r}},TO=t=>({cache:AO(t.cacheSize),parseClassName:RO(t),sortModifiers:jO(t),...yO(t)}),DO=/\s+/,MO=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:l}=e,c=[],a=t.trim().split(DO);let u="";for(let d=a.length-1;d>=0;d-=1){const m=a[d],{isExternal:p,modifiers:g,hasImportantModifier:_,baseClassName:C,maybePostfixModifierPosition:w}=n(m);if(p){u=m+(u.length>0?" "+u:u);continue}let y=!!w,S=r(y?C.substring(0,w):C);if(!S){if(!y){u=m+(u.length>0?" "+u:u);continue}if(S=r(C),!S){u=m+(u.length>0?" "+u:u);continue}y=!1}const b=g.length===0?"":g.length===1?g[0]:l(g).join(":"),x=_?b+bg:b,k=x+S;if(c.indexOf(k)>-1)continue;c.push(k);const j=i(S,y);for(let N=0;N<j.length;++N){const D=j[N];c.push(x+D)}u=m+(u.length>0?" "+u:u)}return u},OO=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=tk(n))&&(i&&(i+=" "),i+=r);return i},tk=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=tk(t[r]))&&(n&&(n+=" "),n+=e);return n},LO=(t,...e)=>{let n,r,i,l;const c=u=>{const d=e.reduce((m,p)=>p(m),t());return n=TO(d),r=n.cache.get,i=n.cache.set,l=a,a(u)},a=u=>{const d=r(u);if(d)return d;const m=MO(u,n);return i(u,m),m};return l=c,(...u)=>l(OO(...u))},IO=[],xn=t=>{const e=n=>n[t]||IO;return e.isThemeGetter=!0,e},nk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,zO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,BO=/\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$/,FO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,HO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$O=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ti=t=>PO.test(t),pt=t=>!!t&&!Number.isNaN(Number(t)),Di=t=>!!t&&Number.isInteger(Number(t)),Cm=t=>t.endsWith("%")&&pt(t.slice(0,-1)),Bs=t=>zO.test(t),sk=()=>!0,UO=t=>BO.test(t)&&!FO.test(t),kv=()=>!1,VO=t=>HO.test(t),qO=t=>$O.test(t),WO=t=>!Xe(t)&&!Qe(t),GO=t=>Gi(t,ak,kv),Xe=t=>nk.test(t),Ao=t=>Gi(t,lk,UO),jx=t=>Gi(t,t8,pt),KO=t=>Gi(t,uk,sk),YO=t=>Gi(t,ck,kv),Tx=t=>Gi(t,ik,kv),XO=t=>Gi(t,ok,qO),yd=t=>Gi(t,dk,VO),Qe=t=>rk.test(t),ic=t=>Ho(t,lk),QO=t=>Ho(t,ck),Dx=t=>Ho(t,ik),ZO=t=>Ho(t,ak),JO=t=>Ho(t,ok),bd=t=>Ho(t,dk,!0),e8=t=>Ho(t,uk,!0),Gi=(t,e,n)=>{const r=nk.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Ho=(t,e,n=!1)=>{const r=rk.exec(t);return r?r[1]?e(r[1]):n:!1},ik=t=>t==="position"||t==="percentage",ok=t=>t==="image"||t==="url",ak=t=>t==="length"||t==="size"||t==="bg-size",lk=t=>t==="length",t8=t=>t==="number",ck=t=>t==="family-name",uk=t=>t==="number"||t==="weight",dk=t=>t==="shadow",n8=()=>{const t=xn("color"),e=xn("font"),n=xn("text"),r=xn("font-weight"),i=xn("tracking"),l=xn("leading"),c=xn("breakpoint"),a=xn("container"),u=xn("spacing"),d=xn("radius"),m=xn("shadow"),p=xn("inset-shadow"),g=xn("text-shadow"),_=xn("drop-shadow"),C=xn("blur"),w=xn("perspective"),y=xn("aspect"),S=xn("ease"),b=xn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...k(),Qe,Xe],N=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],E=()=>[Qe,Xe,u],O=()=>[Ti,"full","auto",...E()],L=()=>[Di,"none","subgrid",Qe,Xe],z=()=>["auto",{span:["full",Di,Qe,Xe]},Di,Qe,Xe],H=()=>[Di,"auto",Qe,Xe],$=()=>["auto","min","max","fr",Qe,Xe],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...E()],X=()=>[Ti,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],Y=()=>[Ti,"screen","full","dvw","lvw","svw","min","max","fit",...E()],I=()=>[Ti,"screen","full","lh","dvh","lvh","svh","min","max","fit",...E()],M=()=>[t,Qe,Xe],P=()=>[...k(),Dx,Tx,{position:[Qe,Xe]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",ZO,GO,{size:[Qe,Xe]}],Q=()=>[Cm,ic,Ao],J=()=>["","none","full",d,Qe,Xe],ee=()=>["",pt,ic,Ao],K=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[pt,Cm,Dx,Tx],re=()=>["","none",C,Qe,Xe],ae=()=>["none",pt,Qe,Xe],se=()=>["none",pt,Qe,Xe],_e=()=>[pt,Qe,Xe],Ee=()=>[Ti,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bs],breakpoint:[Bs],color:[sk],container:[Bs],"drop-shadow":[Bs],ease:["in","out","in-out"],font:[WO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bs],shadow:[Bs],spacing:["px",pt],text:[Bs],"text-shadow":[Bs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ti,Xe,Qe,y]}],container:["container"],columns:[{columns:[pt,Xe,Qe,a]}],"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:j()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],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:[Di,"auto",Qe,Xe]}],basis:[{basis:[Ti,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pt,Ti,"auto","initial","none",Xe]}],grow:[{grow:["",pt,Qe,Xe]}],shrink:[{shrink:["",pt,Qe,Xe]}],order:[{order:[Di,"first","last","none",Qe,Xe]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pbs:[{pbs:E()}],pbe:[{pbe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mbs:[{mbs:W()}],mbe:[{mbe:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[a,"screen",...X()]}],"min-w":[{"min-w":[a,"screen","none",...X()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[c]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,ic,Ao]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,e8,KO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cm,Xe]}],"font-family":[{font:[QO,YO,e]}],"font-features":[{"font-features":[Xe]}],"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:[i,Qe,Xe]}],"line-clamp":[{"line-clamp":[pt,"none",Qe,jx]}],leading:[{leading:[l,...E()]}],"list-image":[{"list-image":["none",Qe,Xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Qe,Xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[pt,"from-font","auto",Qe,Ao]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[pt,"auto",Qe,Xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qe,Xe]}],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",Qe,Xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Di,Qe,Xe],radial:["",Qe,Xe],conic:[Di,Qe,Xe]},JO,XO]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border: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:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pt,Qe,Xe]}],"outline-w":[{outline:["",pt,ic,Ao]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",m,bd,yd]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",p,bd,yd]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[pt,Ao]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",g,bd,yd]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[pt,Qe,Xe]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"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":[pt]}],"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":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"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":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"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":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"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":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"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":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"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":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"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":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Qe,Xe]}],"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":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[pt]}],"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":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Qe,Xe]}],filter:[{filter:["","none",Qe,Xe]}],blur:[{blur:re()}],brightness:[{brightness:[pt,Qe,Xe]}],contrast:[{contrast:[pt,Qe,Xe]}],"drop-shadow":[{"drop-shadow":["","none",_,bd,yd]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",pt,Qe,Xe]}],"hue-rotate":[{"hue-rotate":[pt,Qe,Xe]}],invert:[{invert:["",pt,Qe,Xe]}],saturate:[{saturate:[pt,Qe,Xe]}],sepia:[{sepia:["",pt,Qe,Xe]}],"backdrop-filter":[{"backdrop-filter":["","none",Qe,Xe]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[pt,Qe,Xe]}],"backdrop-contrast":[{"backdrop-contrast":[pt,Qe,Xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pt,Qe,Xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pt,Qe,Xe]}],"backdrop-invert":[{"backdrop-invert":["",pt,Qe,Xe]}],"backdrop-opacity":[{"backdrop-opacity":[pt,Qe,Xe]}],"backdrop-saturate":[{"backdrop-saturate":[pt,Qe,Xe]}],"backdrop-sepia":[{"backdrop-sepia":["",pt,Qe,Xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Qe,Xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pt,"initial",Qe,Xe]}],ease:[{ease:["linear","initial",S,Qe,Xe]}],delay:[{delay:[pt,Qe,Xe]}],animate:[{animate:["none",b,Qe,Xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Qe,Xe]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[Qe,Xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"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",Qe,Xe]}],"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":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mbs":[{"scroll-mbs":E()}],"scroll-mbe":[{"scroll-mbe":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pbs":[{"scroll-pbs":E()}],"scroll-pbe":[{"scroll-pbe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",Qe,Xe]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[pt,ic,Ao,jx]}],stroke:[{stroke:["none",...M()]}],"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"]}},r8=LO(n8);function Ae(...t){return r8(cf(t))}const s8=Ja("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Te(t){const e=he.c(16);let n,r,i,l,c;e[0]!==t?({className:n,variant:i,size:l,asChild:c,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5]);const a=i===void 0?"default":i,u=l===void 0?"default":l,m=(c===void 0?!1:c)?Oc:"button";let p;e[6]!==n||e[7]!==u||e[8]!==a?(p=Ae(s8({variant:a,size:u,className:n})),e[6]=n,e[7]=u,e[8]=a,e[9]=p):p=e[9];let g;return e[10]!==m||e[11]!==r||e[12]!==u||e[13]!==p||e[14]!==a?(g=h.jsx(m,{"data-slot":"button","data-variant":a,"data-size":u,className:p,...r}),e[10]=m,e[11]=r,e[12]=u,e[13]=p,e[14]=a,e[15]=g):g=e[15],g}function fk(t){return t.startsWith("https://")?"https":"http"}function i8(t){return fk(t)==="https"?"wss":"ws"}function Xn(t,e){const n=fk(t),r=t.replace(/^https?:\/\//,"");return`${n}://${r}${e}`}function Wd(t,e){const n=i8(t),r=t.replace(/^https?:\/\//,"");return`${n}://${r}${e}`}function ns(){const t=he.c(1),e=o8;let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n={fetchWithAuth:e},t[0]=n):n=t[0],n}async function o8(t,e,n){const r=e===void 0?{}:e,{serverUrl:i,token:l}=n||{};let c=t;t.startsWith("/")&&i&&(c=Xn(i,t));const a=new Headers(r.headers||{});return l&&a.set("Authorization",`Bearer ${l}`),fetch(c,{...r,headers:a})}function a8(...t){return t.map((e,n)=>n===0?e.replace(/\/+$/,""):e.replace(/^\/+|\/+$/g,"")).filter(Boolean).join("/")}function Ki(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Yg,{"data-slot":"dialog",...n}),e[2]=n,e[3]=r):r=e[3],r}function l8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Xg,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function c8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(mf,{"data-slot":"dialog-close",...n}),e[2]=n,e[3]=r):r=e[3],r}function u8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("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",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Qg,{"data-slot":"dialog-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Yi(t){const e=he.c(15);let n,r,i,l;e[0]!==t?({className:r,children:n,showCloseButton:l,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?!0:l;let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(u8,{}),e[5]=a):a=e[5];let u;e[6]!==r?(u=Ae("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",r),e[6]=r,e[7]=u):u=e[7];let d;e[8]!==c?(d=c&&h.jsx(mf,{"data-slot":"dialog-close",asChild:!0,children:h.jsxs(Te,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[h.jsx(zn,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})}),e[8]=c,e[9]=d):d=e[9];let m;return e[10]!==n||e[11]!==i||e[12]!==u||e[13]!==d?(m=h.jsxs(l8,{children:[a,h.jsxs(Zg,{"data-slot":"dialog-content",className:u,...i,children:[n,d]})]}),e[10]=n,e[11]=i,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function Xi(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("flex flex-col gap-2",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"dialog-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Pf(t){const e=he.c(14);let n,r,i,l;e[0]!==t?({className:r,showCloseButton:l,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?!1:l;let a;e[5]!==r?(a=Ae("-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",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]!==c?(u=c&&h.jsx(mf,{asChild:!0,children:h.jsx(Te,{variant:"outline",children:"Close"})}),e[7]=c,e[8]=u):u=e[8];let d;return e[9]!==n||e[10]!==i||e[11]!==a||e[12]!==u?(d=h.jsxs("div",{"data-slot":"dialog-footer",className:a,...i,children:[n,u]}),e[9]=n,e[10]=i,e[11]=a,e[12]=u,e[13]=d):d=e[13],d}function Qi(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("text-base leading-none font-medium",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(m2,{"data-slot":"dialog-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function $o(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(g2,{"data-slot":"dialog-description",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function an(t){const e=he.c(10);let n,r,i;e[0]!==t?({className:n,type:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let l;e[4]!==n?(l=Ae("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",n),e[4]=n,e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==i?(c=h.jsx("input",{type:i,"data-slot":"input",className:l,...r}),e[6]=r,e[7]=l,e[8]=i,e[9]=c):c=e[9],c}const ds=R.forwardRef((t,e)=>{const n=he.c(16);let r,i,l;n[0]!==t?({className:i,children:r,...l}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=l):(r=n[1],i=n[2],l=n[3]);let c;n[4]!==i?(c=Ae("relative overflow-hidden",i),n[4]=i,n[5]=c):c=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a={WebkitOverflowScrolling:"touch"},n[6]=a):a=n[6];let u;n[7]!==r||n[8]!==e?(u=h.jsx(YD,{ref:e,"data-slot":"scroll-area-viewport",className:"size-full min-w-0 rounded-[inherit] outline-none",style:a,children:r}),n[7]=r,n[8]=e,n[9]=u):u=n[9];let d,m;n[10]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(d8,{}),m=h.jsx(XD,{}),n[10]=d,n[11]=m):(d=n[10],m=n[11]);let p;return n[12]!==l||n[13]!==c||n[14]!==u?(p=h.jsxs(KD,{"data-slot":"scroll-area",className:c,...l,children:[u,d,m]}),n[12]=l,n[13]=c,n[14]=u,n[15]=p):p=n[15],p});ds.displayName="ScrollArea";function d8(t){const e=he.c(11);let n,r,i;e[0]!==t?({className:n,orientation:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"vertical":i;let c;e[4]!==n?(c=Ae("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",n),e[4]=n,e[5]=c):c=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(Kw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[6]=a):a=e[6];let u;return e[7]!==l||e[8]!==r||e[9]!==c?(u=h.jsx(Vw,{"data-slot":"scroll-area-scrollbar","data-orientation":l,orientation:l,className:c,...r,children:a}),e[7]=l,e[8]=r,e[9]=c,e[10]=u):u=e[10],u}function f8({open:t,onOpenChange:e,onSelect:n,initialPath:r,title:i="Select Folder"}){var B;const[l,c]=R.useState(r||""),[a,u]=R.useState([]),[d,m]=R.useState(!1),[p,g]=R.useState(0),[_,C]=R.useState(null),[w,y]=R.useState(""),[S,b]=R.useState(!1),[x,k]=R.useState([]),[j,N]=R.useState(!1),D=R.useRef(null),E=R.useRef(null),{fetchWithAuth:O}=ns(),{activeServer:L}=Qa(),z=R.useCallback(async Q=>{var J;m(!0),C(null),g(0),y(""),N(!1);try{const ee=await O(`/api/fs/browse?path=${encodeURIComponent(Q)}`,{},{serverUrl:L==null?void 0:L.url,token:L==null?void 0:L.token}),K=await ee.json();if(!ee.ok)throw new Error(K.message||"Failed to browse directory");const V=K.files.filter(te=>te.type==="directory");u(V),c(K.currentPath),b((J=K.isRoot)!=null?J:!1)}catch(ee){C(ee instanceof Error?ee.message:"Failed to load directory"),u([])}finally{m(!1)}},[O,L]),H=R.useCallback(async()=>{try{const J=await(await O("/api/fs/drives",{},{serverUrl:L==null?void 0:L.url,token:L==null?void 0:L.token})).json();k(J.drives||[])}catch{}},[O,L]);R.useEffect(()=>{t&&(z(r||""),H())},[t,r,z,H]),R.useEffect(()=>{g(0)},[w]);const $=a.filter(Q=>Q.name.toLowerCase().includes(w.toLowerCase())),q=(B=$[p])!=null?B:null,G=R.useCallback(Q=>a8(l,Q.name),[l]),W=q?G(q):l,X=!q,Y=async()=>{var Q;m(!0),C(null);try{const J=await O(`/api/fs/parent?path=${encodeURIComponent(l)}`,{},{serverUrl:L==null?void 0:L.url,token:L==null?void 0:L.token}),ee=await J.json();if(!J.ok)throw new Error(ee.message||"Failed to navigate up");const K=ee.files.filter(V=>V.type==="directory");u(K),c(ee.currentPath),b((Q=ee.isRoot)!=null?Q:!1),g(0),y("")}catch(J){C(J instanceof Error?J.message:"Failed to navigate up")}finally{m(!1)}},I=()=>{W&&(n(W),e(!1))},M=Q=>{const J=G(Q);z(J)},P=Q=>{if($.length!==0)switch(Q.key){case"ArrowDown":Q.preventDefault(),g(J=>Math.min(J+1,$.length-1));break;case"ArrowRight":$[p]&&(Q.preventDefault(),M($[p]));break;case"ArrowUp":Q.preventDefault(),g(J=>Math.max(J-1,0));break;case"Enter":Q.preventDefault(),I();break;case"Escape":w&&(Q.preventDefault(),y(""));break}};R.useEffect(()=>{if(E.current&&$.length>0){const Q=E.current.children[p];Q&&Q.scrollIntoView({block:"nearest"})}},[p,$.length]),R.useEffect(()=>{t&&setTimeout(()=>{var Q;return(Q=D.current)==null?void 0:Q.focus()},100)},[t]),R.useEffect(()=>{N(!1)},[l]);const F=(Q,J=50)=>{if(Q.length<=J)return Q;const ee=Q.split(/[/\\]/);return ee.length<=2?Q:".../"+ee.slice(-2).join("/")};return h.jsx(Ki,{open:t,onOpenChange:e,children:h.jsxs(Yi,{className:"sm:max-w-lg",onKeyDown:P,children:[h.jsx(Xi,{children:h.jsx(Qi,{children:i})}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted rounded-md",children:[h.jsx(Te,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:Y,disabled:d||!l||S,children:h.jsx(V5,{className:"w-4 h-4"})}),x.length>1&&h.jsxs("div",{className:"relative",children:[h.jsx(Te,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:()=>N(Q=>!Q),disabled:d,children:h.jsx(NA,{className:"w-4 h-4"})}),j&&h.jsx("div",{className:"absolute top-full left-0 mt-1 bg-popover border rounded-md shadow-md z-50 min-w-[120px]",children:x.map(Q=>h.jsxs("button",{onClick:()=>{z(Q),N(!1)},className:Ae("flex items-center gap-2 w-full px-3 py-1.5 text-sm text-left hover:bg-muted",l===Q&&"bg-primary/20 text-primary font-medium"),children:[h.jsx(Vs,{className:"w-3.5 h-3.5 text-amber-500"}),Q]},Q))})]}),h.jsx("span",{className:"flex-1 text-sm font-mono truncate",title:W,children:q?h.jsx("span",{className:"text-primary",children:F(G(q),45)}):F(l)||"Home"})]}),h.jsxs("div",{className:"relative",children:[h.jsx(Hg,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),h.jsx(an,{ref:D,placeholder:"Filter folders...",value:w,onChange:Q=>y(Q.target.value),className:"pl-8"})]}),h.jsx(ds,{className:"h-64 border rounded-md",children:d?h.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[h.jsx(Wt,{className:"w-4 h-4 animate-spin mr-2"}),"Loading..."]}):_?h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[h.jsx("span",{className:"text-destructive",children:_}),h.jsx(Te,{variant:"ghost",size:"sm",onClick:()=>z(l),className:"mt-2",children:"Retry"})]}):$.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-sm",children:[h.jsx(Vs,{className:"w-8 h-8 mb-2 opacity-50"}),w?"No matching folders":"No folders in this directory"]}):h.jsx("div",{className:"p-1",ref:E,children:$.map((Q,J)=>h.jsxs("button",{onClick:()=>g(J),onDoubleClick:()=>M(Q),className:Ae("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",J===p&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[h.jsx(Vs,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),h.jsx("span",{className:"truncate flex-1",children:Q.name}),J===p&&h.jsx(Vn,{className:"w-4 h-4 text-primary"})]},Q.path))})}),_&&h.jsx("p",{className:"text-xs text-destructive",children:_})]}),h.jsxs(Pf,{children:[h.jsx(Te,{variant:"outline",onClick:()=>e(!1),children:"Cancel"}),h.jsx(Te,{onClick:I,disabled:!W||d,children:X?"Use This Folder":"Add Selected Folder"})]})]})})}function xg(t){const e=he.c(26),{open:n,onOpenChange:r,title:i,description:l,confirmLabel:c,cancelLabel:a,onConfirm:u,variant:d}=t,m=c===void 0?"Confirm":c,p=a===void 0?"Cancel":a,g=d===void 0?"default":d;let _;e[0]!==u||e[1]!==r?(_=()=>{u(),r(!1)},e[0]=u,e[1]=r,e[2]=_):_=e[2];const C=_;let w;e[3]!==i?(w=h.jsx(Qi,{children:i}),e[3]=i,e[4]=w):w=e[4];let y;e[5]!==l?(y=h.jsx($o,{children:l}),e[5]=l,e[6]=y):y=e[6];let S;e[7]!==w||e[8]!==y?(S=h.jsxs(Xi,{children:[w,y]}),e[7]=w,e[8]=y,e[9]=S):S=e[9];let b;e[10]!==p?(b=h.jsx(c8,{asChild:!0,children:h.jsx(Te,{variant:"outline",children:p})}),e[10]=p,e[11]=b):b=e[11];const x=g==="destructive"?"destructive":"default";let k;e[12]!==m||e[13]!==C||e[14]!==x?(k=h.jsx(Te,{onClick:C,variant:x,children:m}),e[12]=m,e[13]=C,e[14]=x,e[15]=k):k=e[15];let j;e[16]!==k||e[17]!==b?(j=h.jsxs(Pf,{children:[b,k]}),e[16]=k,e[17]=b,e[18]=j):j=e[18];let N;e[19]!==j||e[20]!==S?(N=h.jsxs(Yi,{showCloseButton:!1,children:[S,j]}),e[19]=j,e[20]=S,e[21]=N):N=e[21];let D;return e[22]!==r||e[23]!==n||e[24]!==N?(D=h.jsx(Ki,{open:n,onOpenChange:r,children:N}),e[22]=r,e[23]=n,e[24]=N,e[25]=D):D=e[25],D}function hk(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(lD,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function pk(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(cD,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function mk(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,align:i,sideOffset:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?"start":i,a=l===void 0?4:l;let u;e[5]!==n?(u=Ae("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",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==r||e[9]!==a||e[10]!==u?(d=h.jsx(uD,{children:h.jsx(dD,{"data-slot":"dropdown-menu-content",sideOffset:a,align:c,className:u,...r})}),e[7]=c,e[8]=r,e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function pc(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,inset:r,variant:l,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?"default":l;let a;e[5]!==n?(a=Ae("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",n),e[5]=n,e[6]=a):a=e[6];let u;return e[7]!==r||e[8]!==i||e[9]!==a||e[10]!==c?(u=h.jsx(fD,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":c,className:a,...i}),e[7]=r,e[8]=i,e[9]=a,e[10]=c,e[11]=u):u=e[11],u}var Mx=1,h8=.9,p8=.8,m8=.17,km=.1,Em=.999,g8=.9999,v8=.99,y8=/[\\\/_+.#"@\[\(\{&]/,b8=/[\\\/_+.#"@\[\(\{&]/g,x8=/[\s-]/,gk=/[\s-]/g;function _g(t,e,n,r,i,l,c){if(l===e.length)return i===t.length?Mx:v8;var a=`${i},${l}`;if(c[a]!==void 0)return c[a];for(var u=r.charAt(l),d=n.indexOf(u,i),m=0,p,g,_,C;d>=0;)p=_g(t,e,n,r,d+1,l+1,c),p>m&&(d===i?p*=Mx:y8.test(t.charAt(d-1))?(p*=p8,_=t.slice(i,d-1).match(b8),_&&i>0&&(p*=Math.pow(Em,_.length))):x8.test(t.charAt(d-1))?(p*=h8,C=t.slice(i,d-1).match(gk),C&&i>0&&(p*=Math.pow(Em,C.length))):(p*=m8,i>0&&(p*=Math.pow(Em,d-i))),t.charAt(d)!==e.charAt(l)&&(p*=g8)),(p<km&&n.charAt(d-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(d-1)!==r.charAt(l))&&(g=_g(t,e,n,r,d+1,l+2,c),g*km>p&&(p=g*km)),p>m&&(m=p),d=n.indexOf(u,d+1);return c[a]=m,m}function Ox(t){return t.toLowerCase().replace(gk," ")}function _8(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,_g(t,e,Ox(t),Ox(e),0,0,{})}var oc='[cmdk-group=""]',Am='[cmdk-group-items=""]',S8='[cmdk-group-heading=""]',vk='[cmdk-item=""]',Lx=`${vk}:not([aria-disabled="true"])`,Sg="cmdk-item-select",La="data-value",w8=(t,e,n)=>_8(t,e,n),yk=R.createContext(void 0),qc=()=>R.useContext(yk),bk=R.createContext(void 0),Ev=()=>R.useContext(bk),xk=R.createContext(void 0),_k=R.forwardRef((t,e)=>{let n=Ia(()=>{var F,B;return{search:"",value:(B=(F=t.value)!=null?F:t.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ia(()=>new Set),i=Ia(()=>new Map),l=Ia(()=>new Map),c=Ia(()=>new Set),a=Sk(t),{label:u,children:d,value:m,onValueChange:p,filter:g,shouldFilter:_,loop:C,disablePointerSelection:w=!1,vimBindings:y=!0,...S}=t,b=Sn(),x=Sn(),k=Sn(),j=R.useRef(null),N=O8();Po(()=>{if(m!==void 0){let F=m.trim();n.current.value=F,D.emit()}},[m]),Po(()=>{N(6,$)},[]);let D=R.useMemo(()=>({subscribe:F=>(c.current.add(F),()=>c.current.delete(F)),snapshot:()=>n.current,setState:(F,B,Q)=>{var J,ee,K,V;if(!Object.is(n.current[F],B)){if(n.current[F]=B,F==="search")H(),L(),N(1,z);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let te=document.getElementById(k);te?te.focus():(J=document.getElementById(b))==null||J.focus()}if(N(7,()=>{var te;n.current.selectedItemId=(te=q())==null?void 0:te.id,D.emit()}),Q||N(5,$),((ee=a.current)==null?void 0:ee.value)!==void 0){let te=B!=null?B:"";(V=(K=a.current).onValueChange)==null||V.call(K,te);return}}D.emit()}},emit:()=>{c.current.forEach(F=>F())}}),[]),E=R.useMemo(()=>({value:(F,B,Q)=>{var J;B!==((J=l.current.get(F))==null?void 0:J.value)&&(l.current.set(F,{value:B,keywords:Q}),n.current.filtered.items.set(F,O(B,Q)),N(2,()=>{L(),D.emit()}))},item:(F,B)=>(r.current.add(F),B&&(i.current.has(B)?i.current.get(B).add(F):i.current.set(B,new Set([F]))),N(3,()=>{H(),L(),n.current.value||z(),D.emit()}),()=>{l.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let Q=q();N(4,()=>{H(),(Q==null?void 0:Q.getAttribute("id"))===F&&z(),D.emit()})}),group:F=>(i.current.has(F)||i.current.set(F,new Set),()=>{l.current.delete(F),i.current.delete(F)}),filter:()=>a.current.shouldFilter,label:u||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:k,labelId:x,listInnerRef:j}),[]);function O(F,B){var Q,J;let ee=(J=(Q=a.current)==null?void 0:Q.filter)!=null?J:w8;return F?ee(F,n.current.search,B):0}function L(){if(!n.current.search||a.current.shouldFilter===!1)return;let F=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(J=>{let ee=i.current.get(J),K=0;ee.forEach(V=>{let te=F.get(V);K=Math.max(te,K)}),B.push([J,K])});let Q=j.current;G().sort((J,ee)=>{var K,V;let te=J.getAttribute("id"),re=ee.getAttribute("id");return((K=F.get(re))!=null?K:0)-((V=F.get(te))!=null?V:0)}).forEach(J=>{let ee=J.closest(Am);ee?ee.appendChild(J.parentElement===ee?J:J.closest(`${Am} > *`)):Q.appendChild(J.parentElement===Q?J:J.closest(`${Am} > *`))}),B.sort((J,ee)=>ee[1]-J[1]).forEach(J=>{var ee;let K=(ee=j.current)==null?void 0:ee.querySelector(`${oc}[${La}="${encodeURIComponent(J[0])}"]`);K==null||K.parentElement.appendChild(K)})}function z(){let F=G().find(Q=>Q.getAttribute("aria-disabled")!=="true"),B=F==null?void 0:F.getAttribute(La);D.setState("value",B||void 0)}function H(){var F,B,Q,J;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ee=0;for(let K of r.current){let V=(B=(F=l.current.get(K))==null?void 0:F.value)!=null?B:"",te=(J=(Q=l.current.get(K))==null?void 0:Q.keywords)!=null?J:[],re=O(V,te);n.current.filtered.items.set(K,re),re>0&&ee++}for(let[K,V]of i.current)for(let te of V)if(n.current.filtered.items.get(te)>0){n.current.filtered.groups.add(K);break}n.current.filtered.count=ee}function $(){var F,B,Q;let J=q();J&&(((F=J.parentElement)==null?void 0:F.firstChild)===J&&((Q=(B=J.closest(oc))==null?void 0:B.querySelector(S8))==null||Q.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function q(){var F;return(F=j.current)==null?void 0:F.querySelector(`${vk}[aria-selected="true"]`)}function G(){var F;return Array.from(((F=j.current)==null?void 0:F.querySelectorAll(Lx))||[])}function W(F){let B=G()[F];B&&D.setState("value",B.getAttribute(La))}function X(F){var B;let Q=q(),J=G(),ee=J.findIndex(V=>V===Q),K=J[ee+F];(B=a.current)!=null&&B.loop&&(K=ee+F<0?J[J.length-1]:ee+F===J.length?J[0]:J[ee+F]),K&&D.setState("value",K.getAttribute(La))}function Y(F){let B=q(),Q=B==null?void 0:B.closest(oc),J;for(;Q&&!J;)Q=F>0?D8(Q,oc):M8(Q,oc),J=Q==null?void 0:Q.querySelector(Lx);J?D.setState("value",J.getAttribute(La)):X(F)}let I=()=>W(G().length-1),M=F=>{F.preventDefault(),F.metaKey?I():F.altKey?Y(1):X(1)},P=F=>{F.preventDefault(),F.metaKey?W(0):F.altKey?Y(-1):X(-1)};return R.createElement(Ze.div,{ref:e,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:F=>{var B;(B=S.onKeyDown)==null||B.call(S,F);let Q=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||Q))switch(F.key){case"n":case"j":{y&&F.ctrlKey&&M(F);break}case"ArrowDown":{M(F);break}case"p":case"k":{y&&F.ctrlKey&&P(F);break}case"ArrowUp":{P(F);break}case"Home":{F.preventDefault(),W(0);break}case"End":{F.preventDefault(),I();break}case"Enter":{F.preventDefault();let J=q();if(J){let ee=new Event(Sg);J.dispatchEvent(ee)}}}}},R.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:I8},u),zf(t,F=>R.createElement(bk.Provider,{value:D},R.createElement(yk.Provider,{value:E},F))))}),C8=R.forwardRef((t,e)=>{var n,r;let i=Sn(),l=R.useRef(null),c=R.useContext(xk),a=qc(),u=Sk(t),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;Po(()=>{if(!d)return a.item(i,c==null?void 0:c.id)},[d]);let m=wk(i,l,[t.value,t.children,l],t.keywords),p=Ev(),g=Hi(N=>N.value&&N.value===m.current),_=Hi(N=>d||a.filter()===!1?!0:N.search?N.filtered.items.get(i)>0:!0);R.useEffect(()=>{let N=l.current;if(!(!N||t.disabled))return N.addEventListener(Sg,C),()=>N.removeEventListener(Sg,C)},[_,t.onSelect,t.disabled]);function C(){var N,D;w(),(D=(N=u.current).onSelect)==null||D.call(N,m.current)}function w(){p.setState("value",m.current,!0)}if(!_)return null;let{disabled:y,value:S,onSelect:b,forceMount:x,keywords:k,...j}=t;return R.createElement(Ze.div,{ref:qs(l,e),...j,id:i,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!g,"data-disabled":!!y,"data-selected":!!g,onPointerMove:y||a.getDisablePointerSelection()?void 0:w,onClick:y?void 0:C},t.children)}),k8=R.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...l}=t,c=Sn(),a=R.useRef(null),u=R.useRef(null),d=Sn(),m=qc(),p=Hi(_=>i||m.filter()===!1?!0:_.search?_.filtered.groups.has(c):!0);Po(()=>m.group(c),[]),wk(c,a,[t.value,t.heading,u]);let g=R.useMemo(()=>({id:c,forceMount:i}),[i]);return R.createElement(Ze.div,{ref:qs(a,e),...l,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&R.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),zf(t,_=>R.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},R.createElement(xk.Provider,{value:g},_))))}),E8=R.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=R.useRef(null),l=Hi(c=>!c.search);return!n&&!l?null:R.createElement(Ze.div,{ref:qs(i,e),...r,"cmdk-separator":"",role:"separator"})}),A8=R.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,l=Ev(),c=Hi(d=>d.search),a=Hi(d=>d.selectedItemId),u=qc();return R.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),R.createElement(Ze.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":a,id:u.inputId,type:"text",value:i?t.value:c,onChange:d=>{i||l.setState("search",d.target.value),n==null||n(d.target.value)}})}),N8=R.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,l=R.useRef(null),c=R.useRef(null),a=Hi(d=>d.selectedItemId),u=qc();return R.useEffect(()=>{if(c.current&&l.current){let d=c.current,m=l.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let _=d.offsetHeight;m.style.setProperty("--cmdk-list-height",_.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(p),g.unobserve(d)}}},[]),R.createElement(Ze.div,{ref:qs(l,e),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:u.listId},zf(t,d=>R.createElement("div",{ref:qs(c,u.listInnerRef),"cmdk-list-sizer":""},d)))}),R8=R.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:l,container:c,...a}=t;return R.createElement(Yg,{open:n,onOpenChange:r},R.createElement(Xg,{container:c},R.createElement(Qg,{"cmdk-overlay":"",className:i}),R.createElement(Zg,{"aria-label":t.label,"cmdk-dialog":"",className:l},R.createElement(_k,{ref:e,...a}))))}),j8=R.forwardRef((t,e)=>Hi(n=>n.filtered.count===0)?R.createElement(Ze.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),T8=R.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...l}=t;return R.createElement(Ze.div,{ref:e,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},zf(t,c=>R.createElement("div",{"aria-hidden":!0},c)))}),Uo=Object.assign(_k,{List:N8,Item:C8,Input:A8,Group:k8,Separator:E8,Dialog:R8,Empty:j8,Loading:T8});function D8(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function M8(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function Sk(t){let e=R.useRef(t);return Po(()=>{e.current=t}),e}var Po=typeof window>"u"?R.useEffect:R.useLayoutEffect;function Ia(t){let e=R.useRef();return e.current===void 0&&(e.current=t()),e}function Hi(t){let e=Ev(),n=()=>t(e.snapshot());return R.useSyncExternalStore(e.subscribe,n,n)}function wk(t,e,n,r=[]){let i=R.useRef(),l=qc();return Po(()=>{var c;let a=(()=>{var d;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(d=m.current.textContent)==null?void 0:d.trim():i.current}})(),u=r.map(d=>d.trim());l.value(t,a,u),(c=e.current)==null||c.setAttribute(La,a),i.current=a}),i}var O8=()=>{let[t,e]=R.useState(),n=Ia(()=>new Map);return Po(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function L8(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function zf({asChild:t,children:e},n){return t&&R.isValidElement(e)?R.cloneElement(L8(e),{ref:e.ref},n(e.props.children)):n(e)}var I8={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Ck(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("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",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("textarea",{"data-slot":"textarea",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function P8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("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",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"input-group",role:"group",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}const z8=Ja("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 B8(t){const e=he.c(11);let n,r,i;e[0]!==t?({className:n,align:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"inline-start":i;let c;e[4]!==l||e[5]!==n?(c=Ae(z8({align:l}),n),e[4]=l,e[5]=n,e[6]=c):c=e[6];let a;return e[7]!==l||e[8]!==r||e[9]!==c?(a=h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":l,className:c,onClick:F8,...r}),e[7]=l,e[8]=r,e[9]=c,e[10]=a):a=e[10],a}function F8(t){var e,n;t.target.closest("button")||(n=(e=t.currentTarget.parentElement)==null?void 0:e.querySelector("input"))==null||n.focus()}function Av(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo,{"data-slot":"command",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function kk(t){const e=he.c(11);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=i):i=e[4];let l;e[5]!==r||e[6]!==i?(l=h.jsx(Uo.Input,{"data-slot":"command-input",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(B8,{children:h.jsx(Hg,{className:"size-4 shrink-0 opacity-50"})}),e[8]=c):c=e[8];let a;return e[9]!==l?(a=h.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:h.jsxs(P8,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[l,c]})}),e[9]=l,e[10]=a):a=e[10],a}function Nv(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo.List,{"data-slot":"command-list",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Rv(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("py-6 text-center text-sm",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo.Empty,{"data-slot":"command-empty",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function kc(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("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",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo.Group,{"data-slot":"command-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Ek(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("-mx-1 h-px bg-border",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo.Separator,{"data-slot":"command-separator",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Ha(t){const e=he.c(14);let n,r,i,l;e[0]!==t?({className:r,children:n,showCheck:l,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?!0:l;let a;e[5]!==r?(a=Ae("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",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]!==c?(u=c&&h.jsx(Vn,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"}),e[7]=c,e[8]=u):u=e[8];let d;return e[9]!==n||e[10]!==i||e[11]!==a||e[12]!==u?(d=h.jsxs(Uo.Item,{"data-slot":"command-item",className:a,...i,children:[n,u]}),e[9]=n,e[10]=i,e[11]=a,e[12]=u,e[13]=d):d=e[13],d}function Bf(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(CD,{"data-slot":"popover",...n}),e[2]=n,e[3]=r):r=e[3],r}function jv(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(ED,{"data-slot":"popover-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ff(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,align:i,sideOffset:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?"center":i,a=l===void 0?4:l;let u;e[5]!==n?(u=Ae("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",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==r||e[9]!==a||e[10]!==u?(d=h.jsx(AD,{children:h.jsx(ND,{"data-slot":"popover-content",align:c,sideOffset:a,className:u,...r})}),e[7]=c,e[8]=r,e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function H8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(kD,{"data-slot":"popover-anchor",...n}),e[2]=n,e[3]=r):r=e[3],r}function $8(t){const e=he.c(59),{workspaces:n,activeWorkspace:r,onSelectWorkspace:i,onCreateVirtualWorkspace:l,onCreatePhysicalWorkspace:c,isWorkspaceFavorited:a,onToggleFavorite:u,onDeleteWorkspace:d}=t,[m,p]=R.useState(!1),[g,_]=R.useState(!1),[C,w]=R.useState(null);let y;e[0]!==(r==null?void 0:r.isVirtual)?(y=r!=null&&r.isVirtual?h.jsx(ng,{className:"size-4 flex-shrink-0 text-muted-foreground"}):h.jsx(Vs,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=r==null?void 0:r.isVirtual,e[1]=y):y=e[1];const S=(r==null?void 0:r.name)||"Select workspace";let b;e[2]!==S?(b=h.jsx("span",{className:"truncate",children:S}),e[2]=S,e[3]=b):b=e[3];let x;e[4]!==y||e[5]!==b?(x=h.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[y,b]}),e[4]=y,e[5]=b,e[6]=x):x=e[6];let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(bS,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[7]=k):k=e[7];let j;e[8]!==m||e[9]!==x?(j=h.jsx(jv,{asChild:!0,children:h.jsxs(Te,{variant:"outline",role:"combobox","aria-expanded":m,"aria-label":"Select workspace",className:"w-full justify-between h-9",children:[x,k]})}),e[8]=m,e[9]=x,e[10]=j):j=e[10];let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(kk,{placeholder:"Search workspace..."}),e[11]=N):N=e[11];let D;e[12]===Symbol.for("react.memo_cache_sentinel")?(D=h.jsx(Rv,{children:"No workspace found."}),e[12]=D):D=e[12];let E;if(e[13]!==(r==null?void 0:r.id)||e[14]!==a||e[15]!==i||e[16]!==u||e[17]!==n){let ee;e[19]!==(r==null?void 0:r.id)||e[20]!==a||e[21]!==i||e[22]!==u?(ee=K=>h.jsxs(Ha,{showCheck:!1,onSelect:()=>{i(K),p(!1)},children:[h.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[K.isVirtual?h.jsx(ng,{className:"size-4 flex-shrink-0 text-muted-foreground"}):h.jsx(Vs,{className:"size-4 flex-shrink-0 text-muted-foreground"}),h.jsx("span",{className:"truncate",children:K.name})]}),h.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[h.jsx("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:V=>{V.stopPropagation(),u(K.id,K.name)},title:a(K.id)?"Remove from favorites":"Add to favorites",children:a(K.id)?h.jsx(xc,{className:"size-4 fill-primary text-primary"}):h.jsx(xc,{className:"size-4 text-muted-foreground"})}),h.jsx(Vn,{className:Ae("size-4",(r==null?void 0:r.id)===K.id?"opacity-100":"opacity-0")}),h.jsxs(hk,{children:[h.jsx(pk,{asChild:!0,children:h.jsxs("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:U8,children:[h.jsx(_S,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Workspace actions"})]})}),h.jsx(mk,{align:"end",children:h.jsxs(pc,{onClick:V=>{V.stopPropagation(),w(K)},className:"text-destructive focus:text-destructive",children:[h.jsx(Br,{className:"size-4"}),"Delete workspace"]})})]})]})]},K.id),e[19]=r==null?void 0:r.id,e[20]=a,e[21]=i,e[22]=u,e[23]=ee):ee=e[23],E=n.map(ee),e[13]=r==null?void 0:r.id,e[14]=a,e[15]=i,e[16]=u,e[17]=n,e[18]=E}else E=e[18];let O;e[24]!==E?(O=h.jsx(kc,{heading:"Workspaces",children:E}),e[24]=E,e[25]=O):O=e[25];let L;e[26]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(Ek,{}),e[26]=L):L=e[26];let z;e[27]!==l?(z=()=>{l(),p(!1)},e[27]=l,e[28]=z):z=e[28];let H;e[29]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(Qr,{className:"size-4","data-icon":"inline-start"}),e[29]=H):H=e[29];let $;e[30]!==z?($=h.jsxs(Ha,{onSelect:z,children:[H,"Create virtual workspace"]}),e[30]=z,e[31]=$):$=e[31];let q;e[32]===Symbol.for("react.memo_cache_sentinel")?(q=h.jsxs(Ha,{onSelect:()=>{p(!1),_(!0)},children:[h.jsx(Vs,{className:"size-4","data-icon":"inline-start"}),"Add existing folder"]}),e[32]=q):q=e[32];let G;e[33]!==$?(G=h.jsxs(kc,{children:[$,q]}),e[33]=$,e[34]=G):G=e[34];let W;e[35]!==O||e[36]!==G?(W=h.jsx(Ff,{className:"w-[240px] p-0 max-h-[80vh]",children:h.jsxs(Av,{children:[N,h.jsxs(Nv,{className:"max-h-[50vh] overflow-y-auto",children:[D,O,L,G]})]})}),e[35]=O,e[36]=G,e[37]=W):W=e[37];let X;e[38]!==m||e[39]!==W||e[40]!==j?(X=h.jsxs(Bf,{open:m,onOpenChange:p,children:[j,W]}),e[38]=m,e[39]=W,e[40]=j,e[41]=X):X=e[41];let Y;e[42]!==c?(Y=ee=>{c(ee),_(!1)},e[42]=c,e[43]=Y):Y=e[43];let I;e[44]!==g||e[45]!==Y?(I=h.jsx(f8,{open:g,onOpenChange:_,onSelect:Y,title:"Select Workspace Folder"}),e[44]=g,e[45]=Y,e[46]=I):I=e[46];const M=C!==null;let P;e[47]===Symbol.for("react.memo_cache_sentinel")?(P=ee=>!ee&&w(null),e[47]=P):P=e[47];const F=C?`Are you sure you want to delete "${C.name}"? This will permanently remove the workspace and all associated Jean data, including sessions, messages, and temporary files. The actual files in "${C.name}" on disk will not be deleted.`:"";let B;e[48]!==d||e[49]!==C?(B=()=>{C&&(d(C.id),w(null))},e[48]=d,e[49]=C,e[50]=B):B=e[50];let Q;e[51]!==M||e[52]!==F||e[53]!==B?(Q=h.jsx(xg,{open:M,onOpenChange:P,title:"Delete Workspace",description:F,confirmLabel:"Delete",variant:"destructive",onConfirm:B}),e[51]=M,e[52]=F,e[53]=B,e[54]=Q):Q=e[54];let J;return e[55]!==X||e[56]!==I||e[57]!==Q?(J=h.jsxs(h.Fragment,{children:[X,I,Q]}),e[55]=X,e[56]=I,e[57]=Q,e[58]=J):J=e[58],J}function U8(t){return t.stopPropagation()}function V8(t){const e=he.c(33),{onOpenAddServer:n,onServerSwitch:r}=t,[i,l]=R.useState(!1),{servers:c,activeServer:a,switchServer:u}=Qa();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(Do,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=d):d=e[0];const m=(a==null?void 0:a.name)||"Select server";let p;e[1]!==m?(p=h.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[d,h.jsx("span",{className:"truncate",children:m})]}),e[1]=m,e[2]=p):p=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(bS,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[3]=g):g=e[3];let _;e[4]!==i||e[5]!==p?(_=h.jsx(jv,{asChild:!0,children:h.jsxs(Te,{variant:"outline",role:"combobox","aria-expanded":i,"aria-label":"Select server",className:"w-full justify-between h-9",children:[p,g]})}),e[4]=i,e[5]=p,e[6]=_):_=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(kk,{placeholder:"Search server..."}),e[7]=C):C=e[7];let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx(Rv,{children:"No server found."}),e[8]=w):w=e[8];let y;if(e[9]!==(a==null?void 0:a.id)||e[10]!==r||e[11]!==c||e[12]!==u){let E;e[14]!==(a==null?void 0:a.id)||e[15]!==r||e[16]!==u?(E=O=>h.jsxs(Ha,{onSelect:()=>{u(O.id),r==null||r(),l(!1)},className:"justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Do,{className:"size-4 text-muted-foreground"}),h.jsx("span",{children:O.name})]}),h.jsx(Vn,{className:Ae("size-4",(a==null?void 0:a.id)===O.id?"opacity-100":"opacity-0")})]},O.id),e[14]=a==null?void 0:a.id,e[15]=r,e[16]=u,e[17]=E):E=e[17],y=c.map(E),e[9]=a==null?void 0:a.id,e[10]=r,e[11]=c,e[12]=u,e[13]=y}else y=e[13];let S;e[18]!==y?(S=h.jsx(kc,{heading:"Servers",children:y}),e[18]=y,e[19]=S):S=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(Ek,{}),e[20]=b):b=e[20];let x;e[21]!==n?(x=()=>{n(),l(!1)},e[21]=n,e[22]=x):x=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(Qr,{className:"size-4","data-icon":"inline-start"}),e[23]=k):k=e[23];let j;e[24]!==x?(j=h.jsx(kc,{children:h.jsxs(Ha,{onSelect:x,children:[k,"Add Server..."]})}),e[24]=x,e[25]=j):j=e[25];let N;e[26]!==j||e[27]!==S?(N=h.jsx(Ff,{className:"w-[240px] p-0 max-h-[80vh]",children:h.jsxs(Av,{children:[C,h.jsxs(Nv,{className:"max-h-[50vh] overflow-y-auto",children:[w,S,b,j]})]})}),e[26]=j,e[27]=S,e[28]=N):N=e[28];let D;return e[29]!==i||e[30]!==N||e[31]!==_?(D=h.jsxs(Bf,{open:i,onOpenChange:l,children:[_,N]}),e[29]=i,e[30]=N,e[31]=_,e[32]=D):D=e[32],D}const Nm=640,Rm=1700;function ol(){const t=he.c(2),[e,n]=R.useState(void 0);let r,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=window.matchMedia(`(max-width: ${Nm-1}px)`),c=()=>{n(window.innerWidth<Nm)};return l.addEventListener("change",c),n(window.innerWidth<Nm),()=>l.removeEventListener("change",c)},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),R.useEffect(r,i),!!e}function q8(){const t=he.c(2),[e,n]=R.useState(void 0);let r,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=window.matchMedia(`(max-width: ${Rm-1}px)`),c=()=>{n(window.innerWidth<Rm)};return l.addEventListener("change",c),n(window.innerWidth<Rm),()=>l.removeEventListener("change",c)},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),R.useEffect(r,i),!!e}function _n(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,orientation:i,decorative:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?"horizontal":i,a=l===void 0?!0:l;let u;e[5]!==n?(u=Ae("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==a||e[8]!==c||e[9]!==r||e[10]!==u?(d=h.jsx(LM,{"data-slot":"separator",decorative:a,orientation:c,className:u,...r}),e[7]=a,e[8]=c,e[9]=r,e[10]=u,e[11]=d):d=e[11],d}function Hf(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Yg,{"data-slot":"sheet",...n}),e[2]=n,e[3]=r):r=e[3],r}function W8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Ej,{"data-slot":"sheet-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function G8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Xg,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function K8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("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",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Qg,{"data-slot":"sheet-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function $f(t){const e=he.c(24);let n,r,i,l,c,a;e[0]!==t?({className:r,children:n,side:c,showCloseButton:a,style:l,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c,e[6]=a):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5],a=e[6]);const u=c===void 0?"right":c,d=a===void 0?!0:a;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(K8,{}),e[7]=m):m=e[7];let p;e[8]!==r?(p=Ae("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",r),e[8]=r,e[9]=p):p=e[9];let g;e[10]!==u?(g=u==="left"||u==="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))"}:u==="top"?{top:"env(safe-area-inset-top, 0px)"}:u==="bottom"?{bottom:"env(safe-area-inset-bottom, 0px)"}:void 0,e[10]=u,e[11]=g):g=e[11];const _=g;let C;e[12]!==_||e[13]!==l?(C=_?{..._,...l}:l,e[12]=_,e[13]=l,e[14]=C):C=e[14];const w=C;let y;e[15]!==d?(y=d&&h.jsx(mf,{"data-slot":"sheet-close",asChild:!0,children:h.jsxs(Te,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[h.jsx(zn,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})}),e[15]=d,e[16]=y):y=e[16];let S;return e[17]!==n||e[18]!==i||e[19]!==u||e[20]!==p||e[21]!==w||e[22]!==y?(S=h.jsxs(G8,{children:[m,h.jsxs(Zg,{"data-slot":"sheet-content","data-side":u,className:p,style:w,...i,children:[n,y]})]}),e[17]=n,e[18]=i,e[19]=u,e[20]=p,e[21]=w,e[22]=y,e[23]=S):S=e[23],S}function Uf(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("flex flex-col gap-0.5 p-4",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sheet-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Vf(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("text-base font-medium text-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(m2,{"data-slot":"sheet-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Y8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("text-sm text-muted-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(g2,{"data-slot":"sheet-description",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function jm(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("animate-pulse rounded-md bg-muted",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"skeleton",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Gd(t){const e=he.c(6);let n,r;e[0]!==t?({delayDuration:r,...n}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const i=r===void 0?0:r;let l;return e[3]!==i||e[4]!==n?(l=h.jsx(cO,{"data-slot":"tooltip-provider",delayDuration:i,...n}),e[3]=i,e[4]=n,e[5]=l):l=e[5],l}function Ec(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(uO,{"data-slot":"tooltip",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ac(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(dO,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Nc(t){const e=he.c(13);let n,r,i,l;e[0]!==t?({className:r,sideOffset:l,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?0:l;let a;e[5]!==r?(a=Ae("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",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(pO,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"}),e[7]=u):u=e[7];let d;return e[8]!==n||e[9]!==i||e[10]!==c||e[11]!==a?(d=h.jsx(fO,{children:h.jsxs(hO,{"data-slot":"tooltip-content",sideOffset:c,className:a,...i,children:[n,u]})}),e[8]=n,e[9]=i,e[10]=c,e[11]=a,e[12]=d):d=e[12],d}const X8="sidebar_state",Q8=3600*24*7,Z8="16rem",J8="18rem",eL="3rem",Ak=R.createContext(null);function Wc(){const t=R.useContext(Ak);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Nk(t){const e=he.c(35);let n,r,i,l,c,a,u,d;e[0]!==t?({defaultOpen:d,open:i,onOpenChange:a,className:r,style:u,children:n,panelId:l,...c}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c,e[6]=a,e[7]=u,e[8]=d):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5],a=e[6],u=e[7],d=e[8]);const m=d===void 0?!0:d,p=ol(),[g,_]=R.useState(!1),[C,w]=R.useState(m),y=i!=null?i:C;let S;e[9]!==y||e[10]!==a?(S=$=>{const q=typeof $=="function"?$(y):$;a?a(q):w(q),document.cookie=`${X8}=${q}; path=/; max-age=${Q8}`},e[9]=y,e[10]=a,e[11]=S):S=e[11];const b=S;let x;e[12]!==p||e[13]!==b?(x=()=>p?_(nL):b(tL),e[12]=p,e[13]=b,e[14]=x):x=e[14];const k=x,j=y?"expanded":"collapsed";let N;e[15]!==p||e[16]!==y||e[17]!==g||e[18]!==b||e[19]!==j||e[20]!==k?(N={state:j,open:y,setOpen:b,isMobile:p,openMobile:g,setOpenMobile:_,toggleSidebar:k},e[15]=p,e[16]=y,e[17]=g,e[18]=b,e[19]=j,e[20]=k,e[21]=N):N=e[21];const D=N;let E;e[22]!==u?(E={"--sidebar-width":Z8,"--sidebar-width-icon":eL,...u},e[22]=u,e[23]=E):E=e[23];const O=E;let L;e[24]!==r?(L=Ae("overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar",r),e[24]=r,e[25]=L):L=e[25];let z;e[26]!==n||e[27]!==l||e[28]!==c||e[29]!==O||e[30]!==L?(z=h.jsx("div",{"data-slot":"sidebar-wrapper","data-panel-id":l,style:O,className:L,...c,children:n}),e[26]=n,e[27]=l,e[28]=c,e[29]=O,e[30]=L,e[31]=z):z=e[31];let H;return e[32]!==D||e[33]!==z?(H=h.jsx(Ak.Provider,{value:D,children:z}),e[32]=D,e[33]=z,e[34]=H):H=e[34],H}function tL(t){return!t}function nL(t){return!t}function Rk(t){const e=he.c(53);let n,r,i,l,c,a,u,d;if(e[0]!==t){const{side:X,variant:Y,collapsible:I,className:M,children:P,dir:F,isOpen:B,onOpenChange:Q,...J}=t;a=X,u=Y,d=I,r=M,n=P,i=F,l=B,c=J,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c,e[6]=a,e[7]=u,e[8]=d}else n=e[1],r=e[2],i=e[3],l=e[4],c=e[5],a=e[6],u=e[7],d=e[8];const m=a===void 0?"left":a,p=u===void 0?"sidebar":u,g=d===void 0?"offcanvas":d,{isMobile:_,state:C,openMobile:w,setOpenMobile:y}=Wc(),b=l!==void 0?l:void 0,x=b!==void 0?b?"expanded":"collapsed":C;if(g==="none"){let X;e[9]!==r?(X=Ae("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),e[9]=r,e[10]=X):X=e[10];let Y;return e[11]!==n||e[12]!==c||e[13]!==X?(Y=h.jsx("div",{"data-slot":"sidebar",className:X,...c,children:n}),e[11]=n,e[12]=c,e[13]=X,e[14]=Y):Y=e[14],Y}if(_){let X;e[15]===Symbol.for("react.memo_cache_sentinel")?(X={"--sidebar-width":J8},e[15]=X):X=e[15];let Y;e[16]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsxs(Uf,{className:"sr-only",children:[h.jsx(Vf,{children:"Sidebar"}),h.jsx(Y8,{children:"Displays the mobile sidebar."})]}),e[16]=Y):Y=e[16];let I;e[17]!==n?(I=h.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[17]=n,e[18]=I):I=e[18];let M;e[19]!==i||e[20]!==m||e[21]!==I?(M=h.jsxs($f,{dir:i,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:X,side:m,children:[Y,I]}),e[19]=i,e[20]=m,e[21]=I,e[22]=M):M=e[22];let P;return e[23]!==w||e[24]!==c||e[25]!==y||e[26]!==M?(P=h.jsx(Hf,{open:w,onOpenChange:y,...c,children:M}),e[23]=w,e[24]=c,e[25]=y,e[26]=M,e[27]=P):P=e[27],P}const k=x==="collapsed"?g:"",j=b!==void 0&&!b&&"w-0",N=p==="floating"||p==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let D;e[28]!==j||e[29]!==N?(D=Ae("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0",j,"group-data-[side=right]:rotate-180",N),e[28]=j,e[29]=N,e[30]=D):D=e[30];let E;e[31]!==D?(E=h.jsx("div",{"data-slot":"sidebar-gap",className:D}),e[31]=D,e[32]=E):E=e[32];const O=m==="left"&&b!==void 0&&!b&&"left-[calc(var(--sidebar-width)*-1)]",L=m==="right"&&b!==void 0&&!b&&"right-[calc(var(--sidebar-width)*-1)]",z=p==="floating"||p==="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";let H;e[33]!==r||e[34]!==L||e[35]!==z||e[36]!==O?(H=Ae("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",O,L,z,r),e[33]=r,e[34]=L,e[35]=z,e[36]=O,e[37]=H):H=e[37];let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($={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))"},e[38]=$):$=e[38];let q;e[39]!==n?(q=h.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:n}),e[39]=n,e[40]=q):q=e[40];let G;e[41]!==c||e[42]!==m||e[43]!==H||e[44]!==q?(G=h.jsx("div",{"data-slot":"sidebar-container","data-side":m,className:H,style:$,...c,children:q}),e[41]=c,e[42]=m,e[43]=H,e[44]=q,e[45]=G):G=e[45];let W;return e[46]!==x||e[47]!==m||e[48]!==G||e[49]!==k||e[50]!==E||e[51]!==p?(W=h.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":x,"data-collapsible":k,"data-variant":p,"data-side":m,"data-slot":"sidebar",children:[E,G]}),e[46]=x,e[47]=m,e[48]=G,e[49]=k,e[50]=E,e[51]=p,e[52]=W):W=e[52],W}function Ix(t){const e=he.c(15);let n,r,i;e[0]!==t?({className:n,onClick:r,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const{toggleSidebar:l}=Wc();let c;e[4]!==n?(c=Ae(n),e[4]=n,e[5]=c):c=e[5];let a;e[6]!==r||e[7]!==l?(a=p=>{r==null||r(p),l()},e[6]=r,e[7]=l,e[8]=a):a=e[8];let u,d;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(nN,{}),d=h.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=u,e[10]=d):(u=e[9],d=e[10]);let m;return e[11]!==i||e[12]!==c||e[13]!==a?(m=h.jsxs(Te,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:c,onClick:a,...i,children:[u,d]}),e[11]=i,e[12]=c,e[13]=a,e[14]=m):m=e[14],m}function jk(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function rL(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function sL(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("mx-2 w-auto bg-sidebar-border",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(_n,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}const Tk=R.forwardRef((t,e)=>{const n=he.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let l;n[3]!==r?(l=Ae("no-scrollbar flex min-h-0 min-w-0 w-full flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r),n[3]=r,n[4]=l):l=n[4];let c;return n[5]!==i||n[6]!==e||n[7]!==l?(c=h.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l,ref:e,...i}),n[5]=i,n[6]=e,n[7]=l,n[8]=c):c=n[8],c});function Kd(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("relative flex w-full min-w-0 flex-col p-2",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Yd(t){const e=he.c(10);let n,r,i;e[0]!==t?({className:n,asChild:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const c=(i===void 0?!1:i)?Oc:"div";let a;e[4]!==n?(a=Ae("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:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",n),e[4]=n,e[5]=a):a=e[5];let u;return e[6]!==c||e[7]!==r||e[8]!==a?(u=h.jsx(c,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:a,...r}),e[6]=c,e[7]=r,e[8]=a,e[9]=u):u=e[9],u}function Xd(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("w-full text-sm",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function jo(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("flex w-full min-w-0 flex-col gap-0",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Hs(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("group/menu-item relative",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}const iL=Ja("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:ring-1 focus:ring-inset 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 Ii(t){const e=he.c(28);let n,r,i,l,c,a,u;e[0]!==t?({asChild:i,isActive:l,variant:c,size:a,tooltip:u,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c,e[6]=a,e[7]=u):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5],a=e[6],u=e[7]);const d=i===void 0?!1:i,m=l===void 0?!1:l,p=c===void 0?"default":c,g=a===void 0?"default":a,_=d?Oc:"button",{isMobile:C,state:w}=Wc();let y;e[8]!==n||e[9]!==g||e[10]!==p?(y=Ae(iL({variant:p,size:g}),n),e[8]=n,e[9]=g,e[10]=p,e[11]=y):y=e[11];let S;e[12]!==_||e[13]!==m||e[14]!==r||e[15]!==g||e[16]!==y?(S=h.jsx(_,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":g,"data-active":m,className:y,...r}),e[12]=_,e[13]=m,e[14]=r,e[15]=g,e[16]=y,e[17]=S):S=e[17];const b=S;if(!u)return b;if(typeof u=="string"){let D;e[18]!==u?(D={children:u},e[18]=u,e[19]=D):D=e[19],u=D}let x;e[20]!==b?(x=h.jsx(Ac,{asChild:!0,children:b}),e[20]=b,e[21]=x):x=e[21];const k=w!=="collapsed"||C;let j;e[22]!==k||e[23]!==u?(j=h.jsx(Nc,{side:"right",align:"center",hidden:k,...u}),e[22]=k,e[23]=u,e[24]=j):j=e[24];let N;return e[25]!==x||e[26]!==j?(N=h.jsxs(Ec,{children:[x,j]}),e[25]=x,e[26]=j,e[27]=N):N=e[27],N}function oL(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,asChild:i,showOnHover:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?!1:i,a=l===void 0?!1:l,u=c?Oc:"button",d=a&&"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";let m;e[5]!==n||e[6]!==d?(m=Ae("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:ring-1 focus:ring-inset md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",d,n),e[5]=n,e[6]=d,e[7]=m):m=e[7];let p;return e[8]!==u||e[9]!==r||e[10]!==m?(p=h.jsx(u,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:m,...r}),e[8]=u,e[9]=r,e[10]=m,e[11]=p):p=e[11],p}function aL(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("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",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Dk(t){const e=he.c(29);let n,r,i,l;e[0]!==t?({side:l,panelId:r,className:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=ol(),a=qt(dL),u=qt(uL),d=qt(cL),m=qt(lL),p=r==="sessions"?a:d,g=r==="sessions"?u:m,[_,C]=R.useState(!1),w=R.useRef(!1),y=R.useRef(0),S=R.useRef(0),b=R.useRef(0),x=R.useRef(null),k=R.useRef(null);let j;e[5]!==c||e[6]!==r?(j=X=>{if(c)return;X.preventDefault(),X.stopPropagation(),w.current=!0,C(!0),y.current=X.clientX,S.current=b.current,document.body.style.cursor="ew-resize",document.body.style.userSelect="none";const Y=document.querySelector(`[data-panel-id="${r}"]`);x.current=Y,Y&&(k.current=Y.style.getPropertyValue("--sidebar-width")||null,Y.classList.add("no-transition"))},e[5]=c,e[6]=r,e[7]=j):j=e[7];const N=j;let D,E;e[8]!==p?(D=()=>{b.current=p},E=[p],e[8]=p,e[9]=D,e[10]=E):(D=e[9],E=e[10]),R.useEffect(D,E);let O,L;if(e[11]!==r||e[12]!==g||e[13]!==l?(O=()=>{const X=I=>{if(!w.current)return;const M=l==="left"?I.clientX-y.current:y.current-I.clientX,P=Dd(S.current+M);b.current=P;const F=x.current||document.querySelector(`[data-panel-id="${r}"]`);F&&(F.style.setProperty("--sidebar-width",`${Math.round(P)}px`),x.current=F);const B=document.querySelector(`[data-panel-gap="${r}"]`);B&&(B.style.width=`${Math.round(P)}px`)},Y=()=>{if(!w.current)return;w.current=!1,C(!1),document.body.style.cursor="",document.body.style.userSelect="";const I=x.current||document.querySelector(`[data-panel-id="${r}"]`);I&&(I.classList.remove("no-transition"),k.current!==null?I.style.setProperty("--sidebar-width",k.current):I.style.removeProperty("--sidebar-width"));const M=document.querySelector(`[data-panel-gap="${r}"]`);M&&(M.classList.add("no-transition"),M.style.width=`${Math.round(b.current)}px`,requestAnimationFrame(()=>{M==null||M.classList.remove("no-transition")})),g(Math.round(b.current))};return document.addEventListener("mousemove",X),document.addEventListener("mouseup",Y),()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",Y)}},L=[g,l,r],e[11]=r,e[12]=g,e[13]=l,e[14]=O,e[15]=L):(O=e[14],L=e[15]),R.useEffect(O,L),c)return null;const z=l==="left"?"absolute top-0 right-0":"absolute top-0 left-0";let H;e[16]!==n||e[17]!==z?(H=Ae("z-30 flex h-full w-2 cursor-ew-resize items-center justify-center group/sidebar-resize",z,n),e[16]=n,e[17]=z,e[18]=H):H=e[18];const $=_?"bg-primary":"group-active/sidebar-resize:bg-primary";let q;e[19]!==$?(q=Ae("h-8 w-0.5 rounded-full transition-colors duration-100","bg-transparent group-hover/sidebar-resize:bg-border",$),e[19]=$,e[20]=q):q=e[20];let G;e[21]!==q?(G=h.jsx("div",{className:q}),e[21]=q,e[22]=G):G=e[22];let W;return e[23]!==N||e[24]!==r||e[25]!==i||e[26]!==H||e[27]!==G?(W=h.jsx("div",{"data-slot":"panel-resize-handle","data-panel-id":r,className:H,onMouseDown:N,...i,children:G}),e[23]=N,e[24]=r,e[25]=i,e[26]=H,e[27]=G,e[28]=W):W=e[28],W}function lL(t){return t.setFilesPanelWidth}function cL(t){return t.filesPanelWidth}function uL(t){return t.setSessionsPanelWidth}function dL(t){return t.sessionsPanelWidth}function fL(t){const e=he.c(6);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;return e[3]!==n||e[4]!==r?(i=h.jsx(Dk,{side:"left",panelId:"sessions",className:n,...r}),e[3]=n,e[4]=r,e[5]=i):i=e[5],i}function Ks(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(pR,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function $i(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(FS,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ys(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(HS,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}const Px=In.memo(function(e){const n=he.c(13),{isClosed:r,isEditing:i,onRename:l,onReopen:c,onClose:a,onDelete:u}=e;if(i){let C;return n[0]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx("div",{className:"shrink-0 size-7"}),n[0]=C):C=n[0],C}let d;n[1]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(pk,{asChild:!0,children:h.jsxs(oL,{showOnHover:!0,children:[h.jsx(_S,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Session actions"})]})}),n[1]=d):d=n[1];let m;n[2]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(za,{className:"size-4"}),n[2]=m):m=n[2];let p;n[3]!==l?(p=h.jsxs(pc,{onClick:l,children:[m,"Rename"]}),n[3]=l,n[4]=p):p=n[4];let g;n[5]!==r||n[6]!==a||n[7]!==u||n[8]!==c?(g=r?h.jsxs(h.Fragment,{children:[h.jsxs(pc,{onClick:c,children:[h.jsx(AS,{className:"size-4"}),"Restore"]}),h.jsxs(pc,{onClick:u,className:"text-destructive focus:text-destructive",children:[h.jsx(Br,{className:"size-4"}),"Delete permanently"]})]}):h.jsxs(pc,{onClick:a,children:[h.jsx(zn,{className:"size-4"}),"Archive"]}),n[5]=r,n[6]=a,n[7]=u,n[8]=c,n[9]=g):g=n[9];let _;return n[10]!==p||n[11]!==g?(_=h.jsxs(hk,{children:[d,h.jsxs(mk,{align:"end",children:[p,g]})]}),n[10]=p,n[11]=g,n[12]=_):_=n[12],_}),zx=In.memo(function(e){const n=he.c(4),{status:r,isStreaming:i,runningAt:l}=e;if(i||r==="running"||!!l){let u;return n[0]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(Wt,{className:"size-3.5 animate-spin shrink-0"}),n[0]=u):u=n[0],u}if(r==="error"){let u;return n[1]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(lf,{className:"size-3.5 shrink-0"}),n[1]=u):u=n[1],u}if(r==="interrupted"){let u;return n[2]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(ES,{className:"size-3.5 shrink-0"}),n[2]=u):u=n[2],u}let a;return n[3]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(Dc,{className:"size-3.5 shrink-0"}),n[3]=a):a=n[3],a}),wg=In.memo(function t({session:e,childrenMap:n,sessionDerivedValues:r,isActive:i,currentSessionId:l,onResumeSession:c,onCloseSession:a,onReopenSession:u,onDeleteSession:d,onRename:m}){var X,Y;const[p,g]=R.useState(!1),[_,C]=R.useState(e.title||""),w=R.useRef(null),y=(X=r.get(e.id))!=null?X:{isStreaming:!1,hasPendingPermission:!1},S=(Y=n.get(e.id))!=null?Y:[],b=S.length>0,x=e.status==="closed",k=S.some(I=>I.id===l),j=qt(h5(e.id)),N=qt(I=>I.clearCompletion),[D,E]=R.useState(()=>Date.now());R.useEffect(()=>{const I=setInterval(()=>E(Date.now()),500);return()=>clearInterval(I)},[]);const O=!!j&&D-j.flashStartedAt<Ub,L=(j==null?void 0:j.type)==="flash-then-sticky";R.useEffect(()=>{if(!j||j.type!=="flash-only")return;const I=Ub-(D-j.flashStartedAt);if(I<=0){N(e.id);return}const M=setTimeout(()=>{N(e.id)},I);return()=>clearTimeout(M)},[j,e.id,N,D]);const z=O?"animate-completion-flash rounded-md":L?"bg-[oklch(0.85_0.15_145_/_0.15)] rounded-md":"",H=R.useRef(!1);R.useEffect(()=>{p&&w.current?H.current||(w.current.focus(),w.current.select(),H.current=!0):H.current=!1},[p]),R.useEffect(()=>{p||C(e.title||"")},[p,e.title]);const $=()=>{C(e.title||""),g(!0)},q=()=>{const I=_.trim();I&&I!==e.title&&m(e.id,I),g(!1)},G=()=>{g(!1),C(e.title||"")},W=I=>{I.key==="Enter"?(I.preventDefault(),q()):I.key==="Escape"&&(I.preventDefault(),G())};return b?h.jsx(Gd,{delayDuration:300,children:h.jsx(Ks,{defaultOpen:i||k,className:"group/collapsible",children:h.jsxs(Hs,{children:[h.jsxs("div",{className:"flex items-center w-full",children:[h.jsx($i,{asChild:!0,children:h.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:h.jsx(Hr,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-90"})})}),p?h.jsx("input",{ref:w,type:"text",value:_,onChange:I=>C(I.target.value),onKeyDown:W,onBlur:q,"aria-label":`Rename session: ${e.title||"Untitled"}`,className:"flex-1 min-w-0 h-8 px-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"}):h.jsx(Ii,{"data-session-id":e.id,isActive:i,onClick:()=>c(e.id),className:Ae("flex-1 min-w-0",z),children:h.jsxs(Ec,{children:[h.jsx(Ac,{asChild:!0,children:h.jsxs("span",{className:"truncate flex items-center gap-2",children:[h.jsx(zx,{status:e.subagentStatus,isStreaming:i?y.isStreaming:!1,runningAt:e.runningAt}),y.hasPendingPermission&&h.jsx(Ua,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),h.jsx(Nc,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),h.jsx(Px,{isClosed:x,isEditing:p,onRename:$,onReopen:()=>u(e.id),onClose:()=>a(e.id),onDelete:()=>d(e.id)})]}),h.jsx(Ys,{children:h.jsx(aL,{children:S.map(I=>h.jsx(t,{session:I,childrenMap:n,sessionDerivedValues:r,isActive:l===I.id,currentSessionId:l,onResumeSession:c,onCloseSession:a,onReopenSession:u,onDeleteSession:d,onRename:m},I.id))})})]})})}):h.jsx(Gd,{delayDuration:300,children:h.jsx(Hs,{children:h.jsxs("div",{className:"flex items-center w-full",children:[h.jsx("div",{className:"shrink-0 size-7 p-1"}),p?h.jsx("input",{ref:w,type:"text",value:_,onChange:I=>C(I.target.value),onKeyDown:W,onBlur:q,"aria-label":`Rename session: ${e.title||"Untitled"}`,className:"flex-1 min-w-0 h-8 px-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"}):h.jsx(Ii,{"data-session-id":e.id,isActive:i,onClick:()=>c(e.id),className:Ae("flex-1 min-w-0",z),children:h.jsxs(Ec,{children:[h.jsx(Ac,{asChild:!0,children:h.jsxs("span",{className:"truncate flex items-center gap-2",children:[h.jsx(zx,{status:e.subagentStatus,isStreaming:i?y.isStreaming:!1,runningAt:e.runningAt}),y.hasPendingPermission&&h.jsx(Ua,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),h.jsx(Nc,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),h.jsx(Px,{isClosed:x,isEditing:p,onRename:$,onReopen:()=>u(e.id),onClose:()=>a(e.id),onDelete:()=>d(e.id)})]})})})}),hL=Ja("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 Ft(t){const e=he.c(13);let n,r,i,l;e[0]!==t?({className:n,variant:i,asChild:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?"default":i,u=(l===void 0?!1:l)?Oc:"span";let d;e[5]!==n||e[6]!==c?(d=Ae(hL({variant:c}),n),e[5]=n,e[6]=c,e[7]=d):d=e[7];let m;return e[8]!==u||e[9]!==r||e[10]!==d||e[11]!==c?(m=h.jsx(u,{"data-slot":"badge","data-variant":c,className:d,...r}),e[8]=u,e[9]=r,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}const pL=In.memo(function(e){const n=he.c(43),{allSessions:r,childrenMap:i,sessionDerivedValues:l,currentSession:c,currentSessionId:a,favoritedWorkspaceIds:u,workspaces:d,activeWorkspace:m,onSelectWorkspace:p,onResumeSession:g,onCloseSession:_,onReopenSession:C,onDeleteSession:w,onRenameSession:y,onCreateSessionInWorkspace:S,connected:b}=e;let x;if(n[0]!==u||n[1]!==d){const O=new Map(d.map(mL));x=u.map(L=>O.get(L)).filter(gL),n[0]=u,n[1]=d,n[2]=x}else x=n[2];const k=x;let j;if(n[3]!==r||n[4]!==k){j=new Map;for(const O of k){const L=r.filter(z=>z.workspaceId===O.id&&z.status==="active"&&z.parentId===null).sort(vL);j.set(O.id,L)}n[3]=r,n[4]=k,n[5]=j}else j=n[5];const N=j;if(k.length===0){let O;n[6]===Symbol.for("react.memo_cache_sentinel")?(O=h.jsx(Yd,{children:"Overview"}),n[6]=O):O=n[6];let L;return n[7]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsxs(Kd,{children:[O,h.jsx(Xd,{children:h.jsx("div",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"Star a workspace to see it here"})})]}),n[7]=L):L=n[7],L}let D;if(n[8]!==(m==null?void 0:m.id)||n[9]!==i||n[10]!==b||n[11]!==(c==null?void 0:c.id)||n[12]!==(c==null?void 0:c.workspaceId)||n[13]!==a||n[14]!==k||n[15]!==_||n[16]!==S||n[17]!==w||n[18]!==y||n[19]!==C||n[20]!==g||n[21]!==p||n[22]!==l||n[23]!==N){let O;n[25]!==(m==null?void 0:m.id)||n[26]!==i||n[27]!==b||n[28]!==(c==null?void 0:c.id)||n[29]!==(c==null?void 0:c.workspaceId)||n[30]!==a||n[31]!==_||n[32]!==S||n[33]!==w||n[34]!==y||n[35]!==C||n[36]!==g||n[37]!==p||n[38]!==l||n[39]!==N?(O=L=>{const z=L.id===(m==null?void 0:m.id),H=(c==null?void 0:c.workspaceId)===L.id,$=N.get(L.id)||[];return h.jsx(Ks,{defaultOpen:z,className:"group/collapsible",children:h.jsxs(Kd,{children:[h.jsx(Yd,{asChild:!0,children:h.jsxs($i,{className:"flex items-center justify-between w-full",onClick:()=>p(L),children:[h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(Hr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),L.isVirtual?h.jsx(ng,{className:"size-3.5"}):h.jsx(Vs,{className:"size-3.5"}),h.jsx("span",{className:H?"truncate text-sidebar-foreground font-medium":"truncate",children:L.name})]}),h.jsx(Ft,{variant:"secondary",children:$.length})]})}),h.jsx(Ys,{children:h.jsxs(Xd,{children:[h.jsx(jo,{children:h.jsx(Hs,{children:h.jsxs(Ii,{onClick:()=>S(L.id),disabled:!b,className:"w-full",children:[h.jsx(Qr,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{children:"New Chat"})]})})}),h.jsx(sL,{}),h.jsx(jo,{children:$.length===0?h.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"(no active sessions)"}):$.map(q=>h.jsx(wg,{session:q,childrenMap:i,sessionDerivedValues:l,isActive:(c==null?void 0:c.id)===q.id,currentSessionId:a,onResumeSession:g,onCloseSession:_,onReopenSession:C,onDeleteSession:w,onRename:y},q.id))})]})})]})},L.id)},n[25]=m==null?void 0:m.id,n[26]=i,n[27]=b,n[28]=c==null?void 0:c.id,n[29]=c==null?void 0:c.workspaceId,n[30]=a,n[31]=_,n[32]=S,n[33]=w,n[34]=y,n[35]=C,n[36]=g,n[37]=p,n[38]=l,n[39]=N,n[40]=O):O=n[40],D=k.map(O),n[8]=m==null?void 0:m.id,n[9]=i,n[10]=b,n[11]=c==null?void 0:c.id,n[12]=c==null?void 0:c.workspaceId,n[13]=a,n[14]=k,n[15]=_,n[16]=S,n[17]=w,n[18]=y,n[19]=C,n[20]=g,n[21]=p,n[22]=l,n[23]=N,n[24]=D}else D=n[24];let E;return n[41]!==D?(E=h.jsx(h.Fragment,{children:D}),n[41]=D,n[42]=E):E=n[42],E});function mL(t){return[t.id,t]}function gL(t){return t!==void 0}function vL(t,e){return new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()}const yL=R.forwardRef((t,e)=>{var Oe;const n=he.c(106),{sessions:r,currentSession:i,currentSessionId:l,streamingSessionIds:c,pendingPermissions:a,connected:u,workspaces:d,activeWorkspace:m,allSessions:p,favoritedWorkspaceIds:g,onCreateSession:_,onResumeSession:C,onCloseSession:w,onReopenSession:y,onDeleteSession:S,onRenameSession:b,onSelectWorkspace:x,onCreateVirtualWorkspace:k,onCreatePhysicalWorkspace:j,onDeleteWorkspace:N,onCreateSessionInWorkspace:D,onOpenSettings:E,onOpenMCP:O,onOpenAddServer:L,onOpenConfiguration:z,onServerSwitch:H,onEscape:$}=t,q=qt(bL),{quickConnections:G,addToQuickConnections:W,removeFromQuickConnections:X,activeServer:Y}=Qa();Wc();const I=R.useRef(null),M=R.useRef(null);let P,F;n[0]!==l?(P=()=>{M.current=l},F=[l],n[0]=l,n[1]=P,n[2]=F):(P=n[1],F=n[2]),R.useEffect(P,F);let B;n[3]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{var Gt;const Ie=I.current;if(!Ie)return;const ot=Array.from(Ie.querySelectorAll('[data-sidebar="menu-button"]'));if(ot.length===0){Ie.focus();return}const Tt=ot.find(Kt=>Kt.getAttribute("data-session-id")===M.current);Tt?Tt.focus():(Gt=ot[0])==null||Gt.focus()},n[3]=B):B=n[3];const Q=B;let J,ee;n[4]===Symbol.for("react.memo_cache_sentinel")?(J=()=>({focusSessionPanel:Q}),ee=[Q],n[4]=J,n[5]=ee):(J=n[4],ee=n[5]),R.useImperativeHandle(e,J,ee);let K;n[6]!==$?(K=Ie=>{var lr,An,vn,Nn,Rn;const ot=I.current;if(!ot)return;const Tt=document.activeElement;if(Tt instanceof HTMLInputElement||Tt instanceof HTMLTextAreaElement||Tt instanceof HTMLElement&&Tt.contentEditable==="true")return;const Gt=Array.from(ot.querySelectorAll('[data-sidebar="menu-button"]')),Kt=Gt.indexOf(document.activeElement);e:switch(Ie.key){case"ArrowDown":{Ie.preventDefault();const Mt=Kt<Gt.length-1?Kt+1:0;(lr=Gt[Mt])==null||lr.focus();break e}case"ArrowUp":{Ie.preventDefault();const Mt=Kt>0?Kt-1:Gt.length-1;(An=Gt[Mt])==null||An.focus();break e}case"ArrowRight":{const Mt=(vn=document.activeElement)==null?void 0:vn.parentElement;if(!Mt)break e;const Nt=Mt.querySelector('button[aria-label="Toggle child sessions"]');if(!Nt)break e;const Dt=Mt.closest("[data-state]");(Dt==null?void 0:Dt.dataset.state)==="closed"&&(Ie.preventDefault(),Nt.click());break e}case"ArrowLeft":{const Mt=(Nn=document.activeElement)==null?void 0:Nn.parentElement;if(!Mt)break e;const Nt=Mt.querySelector('button[aria-label="Toggle child sessions"]');if(!Nt)break e;const Dt=Mt.closest("[data-state]");(Dt==null?void 0:Dt.dataset.state)==="open"&&(Ie.preventDefault(),Nt.click());break e}case"Enter":{document.activeElement instanceof HTMLButtonElement&&document.activeElement.click();break e}case"Escape":Ie.preventDefault(),(Rn=document.activeElement)==null||Rn.blur(),$==null||$()}},n[6]=$,n[7]=K):K=n[7];const V=K;let te;if(n[8]!==p){te=new Map;for(const Ie of p)if(Ie.parentId){const ot=(Oe=te.get(Ie.parentId))!=null?Oe:[];ot.push(Ie),te.set(Ie.parentId,ot)}n[8]=p,n[9]=te}else te=n[9];const re=te;let ae;n[10]!==a?(ae=new Set(a.map(xL)),n[10]=a,n[11]=ae):ae=n[11];const se=ae;let _e;if(n[12]!==p||n[13]!==l||n[14]!==se||n[15]!==c){_e=new Map;for(const Ie of p){const ot=c.has(Ie.id),Tt=se.has(Ie.id),Kt=Ie.id===l&&ot||Ie.subagentStatus==="running"||!!Ie.runningAt;_e.set(Ie.id,{isStreaming:ot,hasPendingPermission:Tt,isRunning:Kt})}n[12]=p,n[13]=l,n[14]=se,n[15]=c,n[16]=_e}else _e=n[16];const Ee=_e;let De,Ue;if(n[17]!==r){const Ie=r.filter(_L);De=Ie.filter(SL),Ue=Ie.filter(wL),n[17]=r,n[18]=De,n[19]=Ue}else De=n[18],Ue=n[19];let ce;n[20]!==De||n[21]!==Ue?(ce={activeSessions:De,archivedSessions:Ue},n[20]=De,n[21]=Ue,n[22]=ce):ce=n[22];const{activeSessions:je,archivedSessions:be}=ce;let Ve;n[23]!==(Y==null?void 0:Y.id)||n[24]!==G?(Ve=Ie=>G.some(ot=>ot.workspaceId===Ie&&ot.serverId===(Y==null?void 0:Y.id)),n[23]=Y==null?void 0:Y.id,n[24]=G,n[25]=Ve):Ve=n[25];const qe=Ve;let ye;n[26]!==Y||n[27]!==W||n[28]!==G||n[29]!==X?(ye=(Ie,ot)=>{if(!Y)return;const Tt=G.find(Gt=>Gt.workspaceId===Ie&&Gt.serverId===Y.id);Tt?X(Tt.id):W(Y.id,Y.name,Ie,ot)},n[26]=Y,n[27]=W,n[28]=G,n[29]=X,n[30]=ye):ye=n[30];const Me=ye;let Re;n[31]===Symbol.for("react.memo_cache_sentinel")?(Re=h.jsx(fL,{}),n[31]=Re):Re=n[31];let we;n[32]!==L||n[33]!==H?(we=h.jsx(V8,{onOpenAddServer:L,onServerSwitch:H}),n[32]=L,n[33]=H,n[34]=we):we=n[34];let oe;n[35]!==m||n[36]!==Me||n[37]!==qe||n[38]!==j||n[39]!==k||n[40]!==N||n[41]!==x||n[42]!==q||n[43]!==d?(oe=q!=="overview"&&h.jsx($8,{workspaces:d,activeWorkspace:m,onSelectWorkspace:x,onCreateVirtualWorkspace:k,onCreatePhysicalWorkspace:j,isWorkspaceFavorited:qe,onToggleFavorite:Me,onDeleteWorkspace:N}),n[35]=m,n[36]=Me,n[37]=qe,n[38]=j,n[39]=k,n[40]=N,n[41]=x,n[42]=q,n[43]=d,n[44]=oe):oe=n[44];let me;n[45]!==we||n[46]!==oe?(me=h.jsxs("div",{className:"p-2 space-y-2",children:[we,oe]}),n[45]=we,n[46]=oe,n[47]=me):me=n[47];let Ne;n[48]!==u||n[49]!==_||n[50]!==q?(Ne=q!=="overview"&&h.jsx(jo,{children:h.jsx(Hs,{children:h.jsxs(Ii,{onClick:_,disabled:!u,className:"w-full",children:[h.jsx(Qr,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{children:"New Chat"})]})})}),n[48]=u,n[49]=_,n[50]=q,n[51]=Ne):Ne=n[51];let Le;n[52]!==me||n[53]!==Ne?(Le=h.jsxs(jk,{children:[me,Ne]}),n[52]=me,n[53]=Ne,n[54]=Le):Le=n[54];let Ge;n[55]!==je||n[56]!==m||n[57]!==p||n[58]!==be||n[59]!==re||n[60]!==u||n[61]!==i||n[62]!==l||n[63]!==g||n[64]!==w||n[65]!==D||n[66]!==S||n[67]!==b||n[68]!==y||n[69]!==C||n[70]!==x||n[71]!==Ee||n[72]!==q||n[73]!==d?(Ge=q==="overview"?h.jsx(pL,{allSessions:p,childrenMap:re,sessionDerivedValues:Ee,currentSession:i,currentSessionId:l,favoritedWorkspaceIds:g,workspaces:d,activeWorkspace:m,onSelectWorkspace:x,onResumeSession:C,onCloseSession:w,onReopenSession:y,onDeleteSession:S,onRenameSession:b,onCreateSessionInWorkspace:D,connected:u}):h.jsxs(h.Fragment,{children:[je.length>0&&h.jsx(Ks,{defaultOpen:!0,className:"group/collapsible",children:h.jsxs(Kd,{children:[h.jsx(Yd,{asChild:!0,children:h.jsxs($i,{className:"flex items-center justify-between w-full",children:[h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(Hr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Active"]}),h.jsx(Ft,{variant:"secondary",children:je.length})]})}),h.jsx(Ys,{children:h.jsx(Xd,{children:h.jsx(jo,{children:je.map(Ie=>h.jsx(wg,{session:Ie,childrenMap:re,sessionDerivedValues:Ee,isActive:(i==null?void 0:i.id)===Ie.id,currentSessionId:l,onResumeSession:C,onCloseSession:w,onReopenSession:y,onDeleteSession:S,onRename:b},Ie.id))})})})]})}),be.length>0&&h.jsx(Ks,{defaultOpen:!0,className:"group/collapsible",children:h.jsxs(Kd,{children:[h.jsx(Yd,{asChild:!0,children:h.jsxs($i,{className:"flex items-center justify-between w-full",children:[h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(Hr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Archived"]}),h.jsx(Ft,{variant:"secondary",children:be.length})]})}),h.jsx(Ys,{children:h.jsx(Xd,{children:h.jsx(jo,{children:be.map(Ie=>h.jsx(wg,{session:Ie,childrenMap:re,sessionDerivedValues:Ee,isActive:(i==null?void 0:i.id)===Ie.id,currentSessionId:l,onResumeSession:C,onCloseSession:w,onReopenSession:y,onDeleteSession:S,onRename:b},Ie.id))})})})]})}),je.length===0&&be.length===0&&h.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["No sessions yet.",h.jsx("br",{}),"Start a new chat to begin."]})]}),n[55]=je,n[56]=m,n[57]=p,n[58]=be,n[59]=re,n[60]=u,n[61]=i,n[62]=l,n[63]=g,n[64]=w,n[65]=D,n[66]=S,n[67]=b,n[68]=y,n[69]=C,n[70]=x,n[71]=Ee,n[72]=q,n[73]=d,n[74]=Ge):Ge=n[74];let Ke;n[75]!==V||n[76]!==Ge?(Ke=h.jsx(Tk,{ref:I,tabIndex:-1,onKeyDown:V,className:"outline-none",children:Ge}),n[75]=V,n[76]=Ge,n[77]=Ke):Ke=n[77];let Je;n[78]!==u?(Je=u?h.jsx(HN,{className:"size-3.5 text-success"}):h.jsx(DS,{className:"size-3.5 text-destructive"}),n[78]=u,n[79]=Je):Je=n[79];const lt=u?"Connected":"Disconnected";let Be;n[80]!==lt?(Be=h.jsx("span",{className:"text-xs text-muted-foreground",children:lt}),n[80]=lt,n[81]=Be):Be=n[81];let We;n[82]!==Je||n[83]!==Be?(We=h.jsx(Hs,{children:h.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[Je,Be]})}),n[82]=Je,n[83]=Be,n[84]=We):We=n[84];let ze,rt;n[85]===Symbol.for("react.memo_cache_sentinel")?(ze=h.jsx(Do,{className:"size-4","data-icon":"inline-start"}),rt=h.jsx("span",{children:"MCP Servers"}),n[85]=ze,n[86]=rt):(ze=n[85],rt=n[86]);let kt;n[87]!==O?(kt=h.jsx(Hs,{children:h.jsxs(Ii,{onClick:O,children:[ze,rt]})}),n[87]=O,n[88]=kt):kt=n[88];let mn,gn;n[89]===Symbol.for("react.memo_cache_sentinel")?(mn=h.jsx(_N,{className:"size-4","data-icon":"inline-start"}),gn=h.jsx("span",{children:"Configuration"}),n[89]=mn,n[90]=gn):(mn=n[89],gn=n[90]);let Zt;n[91]!==z?(Zt=h.jsx(Hs,{children:h.jsxs(Ii,{onClick:z,children:[mn,gn]})}),n[91]=z,n[92]=Zt):Zt=n[92];let rn,Jt;n[93]===Symbol.for("react.memo_cache_sentinel")?(rn=h.jsx(NS,{className:"size-4","data-icon":"inline-start"}),Jt=h.jsx("span",{children:"Settings"}),n[93]=rn,n[94]=Jt):(rn=n[93],Jt=n[94]);let ge;n[95]!==E?(ge=h.jsx(Hs,{children:h.jsx("div",{className:"flex items-center gap-1",children:h.jsxs(Ii,{onClick:E,children:[rn,Jt]})})}),n[95]=E,n[96]=ge):ge=n[96];let He;n[97]!==We||n[98]!==kt||n[99]!==Zt||n[100]!==ge?(He=h.jsx(rL,{className:"pb-4",children:h.jsxs(jo,{children:[We,kt,Zt,ge]})}),n[97]=We,n[98]=kt,n[99]=Zt,n[100]=ge,n[101]=He):He=n[101];let tt;return n[102]!==Le||n[103]!==Ke||n[104]!==He?(tt=h.jsxs(Rk,{collapsible:"offcanvas",children:[Re,Le,Ke,He]}),n[102]=Le,n[103]=Ke,n[104]=He,n[105]=tt):tt=n[105],tt});function bL(t){return t.sidebarViewMode}function xL(t){return t.sessionId}function _L(t){return!t.parentId}function SL(t){return t.status==="active"}function wL(t){return t.status==="closed"}function Mk(t){const e=he.c(10);let n,r,i;e[0]!==t?({className:n,orientation:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"horizontal":i;let c;e[4]!==n?(c=Ae("group/tabs flex gap-2 data-horizontal:flex-col",n),e[4]=n,e[5]=c):c=e[5];let a;return e[6]!==l||e[7]!==r||e[8]!==c?(a=h.jsx(VM,{"data-slot":"tabs","data-orientation":l,className:c,...r}),e[6]=l,e[7]=r,e[8]=c,e[9]=a):a=e[9],a}const CL=Ja("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 Ok(t){const e=he.c(11);let n,r,i;e[0]!==t?({className:n,variant:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"default":i;let c;e[4]!==n||e[5]!==l?(c=Ae(CL({variant:l}),n),e[4]=n,e[5]=l,e[6]=c):c=e[6];let a;return e[7]!==r||e[8]!==c||e[9]!==l?(a=h.jsx(qM,{"data-slot":"tabs-list","data-variant":l,className:c,...r}),e[7]=r,e[8]=c,e[9]=l,e[10]=a):a=e[10],a}function $s(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("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",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(WM,{"data-slot":"tabs-trigger",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Us(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("flex-1 text-sm outline-none",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(GM,{"data-slot":"tabs-content",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function xt(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("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",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(pD,{"data-slot":"label",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Bx(t){return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Fx(t){const e=he.c(29),{permission:n,onRevoke:r}=t,i=!!n.revokedAt,l=i?"outline":"secondary";let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(RS,{className:"size-3","data-icon":"inline-start"}),e[0]=c):c=e[0];let a;e[1]!==n.permissionType||e[2]!==l?(a=h.jsxs(Ft,{variant:l,children:[c,n.permissionType]}),e[1]=n.permissionType,e[2]=l,e[3]=a):a=e[3];let u;e[4]!==i?(u=i&&h.jsx(Ft,{variant:"outline",className:"text-muted-foreground",children:"Revoked"}),e[4]=i,e[5]=u):u=e[5];let d;e[6]!==a||e[7]!==u?(d=h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a,u]}),e[6]=a,e[7]=u,e[8]=d):d=e[8];let m;e[9]!==n.permissionKey?(m=h.jsx("p",{className:"text-sm font-mono truncate text-muted-foreground",children:n.permissionKey}),e[9]=n.permissionKey,e[10]=m):m=e[10];let p;e[11]!==n.grantedAt?(p=Bx(n.grantedAt),e[11]=n.grantedAt,e[12]=p):p=e[12];let g;e[13]!==n.revokedAt?(g=n.revokedAt&&` • Revoked ${Bx(n.revokedAt)}`,e[13]=n.revokedAt,e[14]=g):g=e[14];let _;e[15]!==p||e[16]!==g?(_=h.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Granted ",p,g]}),e[15]=p,e[16]=g,e[17]=_):_=e[17];let C;e[18]!==d||e[19]!==m||e[20]!==_?(C=h.jsxs("div",{className:"flex-1 min-w-0",children:[d,m,_]}),e[18]=d,e[19]=m,e[20]=_,e[21]=C):C=e[21];let w;e[22]!==i||e[23]!==r||e[24]!==n.id?(w=!i&&h.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>r(n.id),className:"size-8 text-destructive hover:text-destructive",children:h.jsx(Br,{className:"size-4"})}),e[22]=i,e[23]=r,e[24]=n.id,e[25]=w):w=e[25];let y;return e[26]!==C||e[27]!==w?(y=h.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border last:border-0",children:[C,w]}),e[26]=C,e[27]=w,e[28]=y):y=e[28],y}function Rc(t){const e=he.c(30),{open:n,onOpenChange:r,title:i,description:l,confirmLabel:c,cancelLabel:a,variant:u,onConfirm:d,onCancel:m}=t,p=c===void 0?"Confirm":c,g=a===void 0?"Cancel":a,_=u===void 0?"default":u;let C;e[0]!==m||e[1]!==r?(C=()=>{m==null||m(),r(!1)},e[0]=m,e[1]=r,e[2]=C):C=e[2];const w=C;let y;e[3]!==d||e[4]!==r?(y=()=>{d(),r(!1)},e[3]=d,e[4]=r,e[5]=y):y=e[5];const S=y;let b;e[6]!==i?(b=h.jsx(Qi,{children:i}),e[6]=i,e[7]=b):b=e[7];let x;e[8]!==l?(x=h.jsx($o,{children:l}),e[8]=l,e[9]=x):x=e[9];let k;e[10]!==b||e[11]!==x?(k=h.jsxs(Xi,{children:[b,x]}),e[10]=b,e[11]=x,e[12]=k):k=e[12];let j;e[13]!==g||e[14]!==w?(j=h.jsx(Te,{variant:"outline",onClick:w,children:g}),e[13]=g,e[14]=w,e[15]=j):j=e[15];const N=_==="destructive"?"destructive":"default";let D;e[16]!==p||e[17]!==S||e[18]!==N?(D=h.jsx(Te,{variant:N,onClick:S,children:p}),e[16]=p,e[17]=S,e[18]=N,e[19]=D):D=e[19];let E;e[20]!==D||e[21]!==j?(E=h.jsxs(Pf,{children:[j,D]}),e[20]=D,e[21]=j,e[22]=E):E=e[22];let O;e[23]!==E||e[24]!==k?(O=h.jsxs(Yi,{className:"sm:max-w-[425px]",children:[k,E]}),e[23]=E,e[24]=k,e[25]=O):O=e[25];let L;return e[26]!==r||e[27]!==n||e[28]!==O?(L=h.jsx(Ki,{open:n,onOpenChange:r,children:O}),e[26]=r,e[27]=n,e[28]=O,e[29]=L):L=e[29],L}function kL(t){const e=he.c(10),{token:n,onLogout:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("span",{className:"text-muted-foreground",children:"Token:"}),e[0]=i):i=e[0];let l;e[1]!==n?(l=C5(n),e[1]=n,e[2]=l):l=e[2];let c;e[3]!==l?(c=h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i,h.jsx("code",{className:"font-mono text-foreground bg-background px-1.5 py-0.5 rounded text-[10px]",children:l})]}),e[3]=l,e[4]=c):c=e[4];let a;e[5]!==r?(a=h.jsx(Te,{variant:"destructive",size:"sm",onClick:r,title:"Disconnect and clear token",children:"Logout"}),e[5]=r,e[6]=a):a=e[6];let u;return e[7]!==c||e[8]!==a?(u=h.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md bg-muted",children:[c,a]}),e[7]=c,e[8]=a,e[9]=u):u=e[9],u}const Hx="0.7.1";function $x(t){const e=t.trim().match(/^v?(\d+)\.(\d+)\.(\d+)$/);return e?[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]:null}function EL(t,e){const n=$x(t),r=$x(e);if(!n&&!r)return 0;if(!n)return-1;if(!r)return 1;for(let i=0;i<3;i++)if(n[i]!==r[i])return n[i]-r[i];return 0}function Ux(t,e){return e?EL(t,e)>=0?"up-to-date":"update-available":"unknown"}const Lk="rabbyte-tech/jean2",AL=300*1e3,Ik=1e4,Qd=new Map;function Pk(t){const e=Qd.get(t);return e?Date.now()-e.timestamp>AL?(Qd.delete(t),null):e.value:null}function zk(t,e){Qd.set(t,{value:e,timestamp:Date.now()})}function NL(){Qd.clear()}async function Bk(t,e){const n=new AbortController,r=setTimeout(()=>n.abort(),e);try{return await fetch(t,{signal:n.signal})}finally{clearTimeout(r)}}async function RL(){const t=Pk("latest-server");if(t)return t;try{const e=`https://raw.githubusercontent.com/${Lk}/refs/heads/main/packages/server/VERSION`,n=await Bk(e,Ik);if(!n.ok)return null;const r=(await n.text()).trim();return/^\d+\.\d+\.\d+$/.test(r)?(zk("latest-server",r),r):null}catch{return null}}async function jL(){const t=Pk("latest-client");if(t)return t;try{const e=`https://api.github.com/repos/${Lk}/releases?per_page=20`,n=await Bk(e,Ik);if(!n.ok)return null;const i=(await n.json()).find(c=>c.tag_name.startsWith("client/")&&!c.prerelease);if(!i)return null;const l=i.tag_name.replace(/^client\/v?/,"");return/^\d+\.\d+\.\d+$/.test(l)?(zk("latest-client",l),l):null}catch{return null}}function TL(t){if(!t)return"";const e=Math.floor((Date.now()-t)/1e3);if(e<10)return"just now";if(e<60)return`${e}s ago`;const n=Math.floor(e/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function Vx(t){const e=he.c(3),{status:n}=t;if(n==="up-to-date"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsxs("span",{className:"text-xs text-green-500 flex items-center gap-1",children:[h.jsx("span",{className:"inline-block size-1.5 rounded-full bg-green-500"}),"Up to date"]}),e[0]=i):i=e[0],i}if(n==="update-available"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400",children:"Update available"}),e[1]=i):i=e[1],i}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx("span",{className:"text-xs text-muted-foreground",children:"Unknown"}),e[2]=r):r=e[2],r}function DL({serverUrl:t,enabled:e}){const n=R.useRef(0),[r,i]=R.useState({serverVersion:null,latestServer:null,latestClient:null,loading:!0,lastChecked:null,fetchError:null}),l=R.useCallback(async(u=!1)=>{u&&NL();const d=++n.current;i(m=>({...m,loading:!0,fetchError:null}));try{const m=await Promise.allSettled([t?fetch(Xn(t,"/api/info")).then(C=>C.ok?C.json():null).then(C=>{var w;return(w=C==null?void 0:C.version)!=null?w:null}):Promise.resolve(null),RL(),jL()]);if(n.current!==d)return;const p=m[0].status==="fulfilled"?m[0].value:null,g=m[1].status==="fulfilled"?m[1].value:null,_=m[2].status==="fulfilled"?m[2].value:null;i({serverVersion:p,latestServer:g,latestClient:_,loading:!1,lastChecked:Date.now(),fetchError:null})}catch{if(n.current!==d)return;i(m=>({...m,loading:!1,fetchError:"Unable to check for updates"}))}},[t]);R.useEffect(()=>{e&&l()},[l,e]);const c=Ux(Hx,r.latestClient),a=t&&r.serverVersion?Ux(r.serverVersion,r.latestServer):"unknown";return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm font-medium",children:"Versions"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Check for updates to client and server"})]}),h.jsx(_n,{}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-sm font-medium",children:"Client"}),r.loading?h.jsx(jm,{className:"h-5 w-32"}):h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",Hx]}),h.jsx(Vx,{status:c})]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-sm font-medium",children:"Server"}),r.loading?h.jsx(jm,{className:"h-5 w-32"}):r.serverVersion?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",r.serverVersion]}),h.jsx(Vx,{status:a})]}):h.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-sm font-medium",children:"Latest"}),r.loading?h.jsx(jm,{className:"h-5 w-48"}):h.jsxs("span",{className:"text-sm text-muted-foreground",children:[r.latestServer?`v${r.latestServer} (server)`:"",r.latestServer&&r.latestClient&&" · ",r.latestClient?`v${r.latestClient} (client)`:"",!r.latestServer&&!r.latestClient&&"Unknown"]})]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[r.lastChecked&&!r.loading&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last checked: ",TL(r.lastChecked)]}),h.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>l(!0),disabled:r.loading,className:"ml-auto",children:[h.jsx(Pi,{className:`size-3.5 ${r.loading?"animate-spin":""}`}),"Check for Updates"]})]})]})}const ML={neutral:{label:"Neutral",colors:["bg-zinc-400","bg-zinc-600","bg-zinc-800"]},ocean:{label:"Ocean",colors:["bg-sky-300","bg-sky-500","bg-slate-700"]},forest:{label:"Forest",colors:["bg-emerald-300","bg-emerald-500","bg-green-800"]},sunset:{label:"Sunset",colors:["bg-orange-300","bg-amber-500","bg-orange-800"]},amethyst:{label:"Amethyst",colors:["bg-violet-300","bg-violet-500","bg-purple-800"]}};function ac(t){const e=he.c(15),{scheme:n,currentScheme:r,onClick:i}=t,l=n===r,c=ML[n];let a;e[0]!==i||e[1]!==n?(a=()=>i(n),e[0]=i,e[1]=n,e[2]=a):a=e[2];const u=`
567
+ flex flex-col items-center gap-1.5 p-2 rounded-lg border transition-all
568
+ ${l?"border-primary bg-primary/5":"border-border bg-transparent hover:bg-muted/50"}
569
+ `,d=c.label;let m;e[3]!==c.colors?(m=c.colors.map(OL),e[3]=c.colors,e[4]=m):m=e[4];let p;e[5]!==m?(p=h.jsx("div",{className:"flex gap-0.5",children:m}),e[5]=m,e[6]=p):p=e[6];let g;e[7]!==n?(g=h.jsx("span",{className:"text-[10px] text-muted-foreground capitalize",children:n}),e[7]=n,e[8]=g):g=e[8];let _;return e[9]!==c.label||e[10]!==a||e[11]!==u||e[12]!==p||e[13]!==g?(_=h.jsxs("button",{type:"button",onClick:a,className:u,title:d,children:[p,g]}),e[9]=c.label,e[10]=a,e[11]=u,e[12]=p,e[13]=g,e[14]=_):_=e[14],_}function OL(t,e){return h.jsx("div",{className:`w-4 h-4 rounded-full ${t}`},e)}function LL(t){var se;const e=he.c(172),{open:n,onOpenChange:r,permissions:i,onRefreshPermissions:l,onRevokePermission:c,onRevokeAllPermissions:a,apiToken:u,onLogout:d,chatFinishSoundEnabled:m,onChatFinishSoundEnabledChange:p,permissionSoundEnabled:g,onPermissionSoundEnabledChange:_,serverUrl:C}=t,{mode:w,scheme:y,setMode:S,setScheme:b}=Y4(),[x,k]=R.useState(!1),N=((se=navigator.userAgentData)==null?void 0:se.platform)==="macOS"||/mac|iphone|ipad|ipod/i.test(navigator.userAgent)?"⌘":"Ctrl";let D,E,O,L,z,H,$,q,G,W,X,Y,I,M,P,F,B,Q;if(e[0]!==u||e[1]!==m||e[2]!==w||e[3]!==p||e[4]!==d||e[5]!==r||e[6]!==_||e[7]!==l||e[8]!==c||e[9]!==n||e[10]!==g||e[11]!==i||e[12]!==y||e[13]!==C||e[14]!==S||e[15]!==b){const _e=[{keys:[N,"1"],description:"Open session list"},{keys:[N,"2"],description:"Open files panel"},{keys:[N,"T"],description:"Open terminal"},{keys:[N,"O"],description:"Toggle overview mode"},{keys:[N,"N"],description:"New session"},{keys:[N,"Shift","N"],description:"New window"},{keys:[N,"Shift","F"],description:"Toggle follow/free mode"},{keys:["Shift","Esc"],description:"Close focused panel"},{keys:["Shift","Enter"],description:"New line in input"},{keys:["Enter"],description:"Send message"},{keys:["↑","↓","←","→"],description:"Navigate sessions"},{keys:["Esc"],description:"Focus chat input"},{keys:["Esc","Esc"],description:"Stop streaming (chat input focused)"}],Ee=i.filter(zL),De=i.filter(PL);L=Ki,G=n,W=r,O=Yi,$="sm:max-w-[700px] max-h-[80vh]",e[34]===Symbol.for("react.memo_cache_sentinel")?(q=h.jsxs(Xi,{children:[h.jsx(Qi,{children:"Settings"}),h.jsx($o,{children:"Manage your preferences and permissions"})]}),e[34]=q):q=e[34],E=Mk,M="account",P="mt-4";let Ue,ce;e[35]===Symbol.for("react.memo_cache_sentinel")?(Ue=h.jsxs($s,{value:"account",children:[h.jsx(TS,{className:"size-4 sm:size-3","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Account"})]}),ce=h.jsxs($s,{value:"appearance",children:[h.jsx(eN,{className:"size-4 sm:size-3","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Appearance"})]}),e[35]=Ue,e[36]=ce):(Ue=e[35],ce=e[36]);let je,be;e[37]===Symbol.for("react.memo_cache_sentinel")?(je=h.jsx(RS,{className:"size-4 sm:size-3","data-icon":"inline-start"}),be=h.jsx("span",{className:"hidden sm:inline",children:"Permissions"}),e[37]=je,e[38]=be):(je=e[37],be=e[38]);const Ve=Ee.length>0&&h.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:Ee.length});let qe;e[39]!==Ve?(qe=h.jsxs($s,{value:"permissions",children:[je,be,Ve]}),e[39]=Ve,e[40]=qe):qe=e[40];let ye;e[41]===Symbol.for("react.memo_cache_sentinel")?(ye=h.jsxs($s,{value:"keybinds",children:[h.jsx(LA,{className:"size-4 sm:size-3","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Keybinds"})]}),e[41]=ye):ye=e[41],e[42]!==qe?(F=h.jsxs(Ok,{className:"grid w-full grid-cols-4",children:[Ue,ce,qe,ye]}),e[42]=qe,e[43]=F):F=e[43];let Me,Re;e[44]===Symbol.for("react.memo_cache_sentinel")?(Me=h.jsx(xt,{className:"text-sm font-medium",children:"Session"}),Re=h.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Manage your current session"}),e[44]=Me,e[45]=Re):(Me=e[44],Re=e[45]);let we;e[46]!==u||e[47]!==d?(we=h.jsxs("div",{children:[Me,Re,u?h.jsx(kL,{token:u,onLogout:d}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No active session"})]}),e[46]=u,e[47]=d,e[48]=we):we=e[48];let oe;e[49]===Symbol.for("react.memo_cache_sentinel")?(oe=h.jsx(_n,{}),e[49]=oe):oe=e[49];let me;e[50]!==n||e[51]!==C?(me=h.jsx(DL,{serverUrl:C,enabled:n}),e[50]=n,e[51]=C,e[52]=me):me=e[52],e[53]!==we||e[54]!==me?(B=h.jsx(Us,{value:"account",className:"mt-4",children:h.jsxs("div",{className:"flex flex-col gap-4",children:[we,oe,me]})}),e[53]=we,e[54]=me,e[55]=B):B=e[55];let Ne,Le;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ne=h.jsx(xt,{className:"text-sm font-medium",children:"Mode"}),Le=h.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose light, dark, or system theme"}),e[56]=Ne,e[57]=Le):(Ne=e[56],Le=e[57]);const Ge=w==="light"?"default":"outline";let Ke;e[58]!==S?(Ke=()=>S("light"),e[58]=S,e[59]=Ke):Ke=e[59];let Je;e[60]===Symbol.for("react.memo_cache_sentinel")?(Je=h.jsx(EN,{className:"size-4","data-icon":"inline-start"}),e[60]=Je):Je=e[60];let lt;e[61]!==Ge||e[62]!==Ke?(lt=h.jsxs(Te,{variant:Ge,className:"justify-start",onClick:Ke,children:[Je,"Light"]}),e[61]=Ge,e[62]=Ke,e[63]=lt):lt=e[63];const Be=w==="dark"?"default":"outline";let We;e[64]!==S?(We=()=>S("dark"),e[64]=S,e[65]=We):We=e[65];let ze;e[66]===Symbol.for("react.memo_cache_sentinel")?(ze=h.jsx(ZA,{className:"size-4","data-icon":"inline-start"}),e[66]=ze):ze=e[66];let rt;e[67]!==Be||e[68]!==We?(rt=h.jsxs(Te,{variant:Be,className:"justify-start",onClick:We,children:[ze,"Dark"]}),e[67]=Be,e[68]=We,e[69]=rt):rt=e[69];const kt=w==="system"?"default":"outline";let mn;e[70]!==S?(mn=()=>S("system"),e[70]=S,e[71]=mn):mn=e[71];let gn;e[72]===Symbol.for("react.memo_cache_sentinel")?(gn=h.jsx(XA,{className:"size-4","data-icon":"inline-start"}),e[72]=gn):gn=e[72];let Zt;e[73]!==kt||e[74]!==mn?(Zt=h.jsxs(Te,{variant:kt,className:"justify-start",onClick:mn,children:[gn,"System"]}),e[73]=kt,e[74]=mn,e[75]=Zt):Zt=e[75];let rn;e[76]!==lt||e[77]!==rt||e[78]!==Zt?(rn=h.jsxs("div",{children:[Ne,Le,h.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[lt,rt,Zt]})]}),e[76]=lt,e[77]=rt,e[78]=Zt,e[79]=rn):rn=e[79];let Jt,ge;e[80]===Symbol.for("react.memo_cache_sentinel")?(Jt=h.jsx(_n,{}),ge=h.jsx(xt,{className:"text-sm font-medium mb-3 block",children:"Notification Sounds"}),e[80]=Jt,e[81]=ge):(Jt=e[80],ge=e[81]);let He;e[82]===Symbol.for("react.memo_cache_sentinel")?(He=h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(IN,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm",children:"Chat completion"})]}),e[82]=He):He=e[82];let tt;e[83]!==m||e[84]!==p?(tt=()=>p(!m),e[83]=m,e[84]=p,e[85]=tt):tt=e[85];const Oe=`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${m?"bg-primary":"bg-muted"}`,Ie=`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${m?"translate-x-6":"translate-x-1"}`;let ot;e[86]!==Ie?(ot=h.jsx("span",{className:Ie}),e[86]=Ie,e[87]=ot):ot=e[87];let Tt;e[88]!==tt||e[89]!==Oe||e[90]!==ot?(Tt=h.jsxs("div",{className:"flex items-center justify-between",children:[He,h.jsx("button",{type:"button",onClick:tt,className:Oe,children:ot})]}),e[88]=tt,e[89]=Oe,e[90]=ot,e[91]=Tt):Tt=e[91];let Gt;e[92]===Symbol.for("react.memo_cache_sentinel")?(Gt=h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(zN,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm",children:"Permission requests"})]}),e[92]=Gt):Gt=e[92];let Kt;e[93]!==_||e[94]!==g?(Kt=()=>_(!g),e[93]=_,e[94]=g,e[95]=Kt):Kt=e[95];const lr=`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${g?"bg-primary":"bg-muted"}`,An=`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${g?"translate-x-6":"translate-x-1"}`;let vn;e[96]!==An?(vn=h.jsx("span",{className:An}),e[96]=An,e[97]=vn):vn=e[97];let Nn;e[98]!==Kt||e[99]!==lr||e[100]!==vn?(Nn=h.jsxs("div",{className:"flex items-center justify-between",children:[Gt,h.jsx("button",{type:"button",onClick:Kt,className:lr,children:vn})]}),e[98]=Kt,e[99]=lr,e[100]=vn,e[101]=Nn):Nn=e[101];let Rn;e[102]!==Tt||e[103]!==Nn?(Rn=h.jsxs("div",{children:[ge,h.jsxs("div",{className:"flex flex-col gap-3",children:[Tt,Nn]})]}),e[102]=Tt,e[103]=Nn,e[104]=Rn):Rn=e[104];let Mt,Nt,Dt;e[105]===Symbol.for("react.memo_cache_sentinel")?(Mt=h.jsx(_n,{}),Nt=h.jsx(xt,{className:"text-sm font-medium",children:"Color Scheme"}),Dt=h.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose your preferred color palette"}),e[105]=Mt,e[106]=Nt,e[107]=Dt):(Mt=e[105],Nt=e[106],Dt=e[107]);let jn;e[108]!==y||e[109]!==b?(jn=h.jsxs("div",{children:[Nt,Dt,h.jsxs("div",{className:"grid grid-cols-5 gap-2",children:[h.jsx(ac,{scheme:"neutral",currentScheme:y,onClick:b}),h.jsx(ac,{scheme:"ocean",currentScheme:y,onClick:b}),h.jsx(ac,{scheme:"forest",currentScheme:y,onClick:b}),h.jsx(ac,{scheme:"sunset",currentScheme:y,onClick:b}),h.jsx(ac,{scheme:"amethyst",currentScheme:y,onClick:b})]})]}),e[108]=y,e[109]=b,e[110]=jn):jn=e[110],e[111]!==rn||e[112]!==Rn||e[113]!==jn?(Q=h.jsx(Us,{value:"appearance",className:"mt-4",children:h.jsxs("div",{className:"flex flex-col gap-4",children:[rn,Jt,Rn,Mt,jn]})}),e[111]=rn,e[112]=Rn,e[113]=jn,e[114]=Q):Q=e[114];const bs=Us,Zs="permissions",Js="mt-4",xs="flex flex-col gap-4";let kr;e[115]===Symbol.for("react.memo_cache_sentinel")?(kr=h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm font-medium",children:"Always-allowed Operations"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Tools you've approved to run without asking"})]}),e[115]=kr):kr=e[115];let Er;e[116]===Symbol.for("react.memo_cache_sentinel")?(Er=h.jsx(Pi,{className:"size-4"}),e[116]=Er):Er=e[116];let Bn;e[117]!==l?(Bn=h.jsx(Te,{variant:"outline",size:"icon",onClick:l,className:"size-8",children:Er}),e[117]=l,e[118]=Bn):Bn=e[118];const Wn=Ee.length>0&&h.jsxs(Te,{variant:"destructive",size:"sm",onClick:()=>k(!0),children:[h.jsx(Br,{className:"size-4","data-icon":"inline-start"}),"Revoke All"]});let Gn;e[119]!==Bn||e[120]!==Wn?(Gn=h.jsxs("div",{className:"flex items-center justify-between",children:[kr,h.jsxs("div",{className:"flex gap-2",children:[Bn,Wn]})]}),e[119]=Bn,e[120]=Wn,e[121]=Gn):Gn=e[121];let wn;e[122]===Symbol.for("react.memo_cache_sentinel")?(wn=h.jsx(_n,{}),e[122]=wn):wn=e[122];const en=ds,Ur="h-[300px]",_s=Ee.length===0&&De.length===0&&h.jsxs("div",{className:"text-center py-8 text-muted-foreground text-sm",children:["No permissions granted yet.",h.jsx("br",{}),'Approve tool requests with "Always allow" to add them here.']}),Zn=Ee.length>0&&h.jsxs("div",{className:"mb-4",children:[h.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Active (",Ee.length,")"]}),Ee.map(ur=>h.jsx(Fx,{permission:ur,onRevoke:c},ur.id))]}),cr=De.length>0&&h.jsxs("div",{children:[h.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Revoked (",De.length,")"]}),De.map(ur=>h.jsx(Fx,{permission:ur,onRevoke:c},ur.id))]});let rs;e[123]!==en||e[124]!==Ur||e[125]!==_s||e[126]!==Zn||e[127]!==cr?(rs=h.jsxs(en,{className:Ur,children:[_s,Zn,cr]}),e[123]=en,e[124]=Ur,e[125]=_s,e[126]=Zn,e[127]=cr,e[128]=rs):rs=e[128];let Jn;e[129]!==xs||e[130]!==Gn||e[131]!==wn||e[132]!==rs?(Jn=h.jsxs("div",{className:xs,children:[Gn,wn,rs]}),e[129]=xs,e[130]=Gn,e[131]=wn,e[132]=rs,e[133]=Jn):Jn=e[133],e[134]!==bs||e[135]!==Zs||e[136]!==Js||e[137]!==Jn?(H=h.jsx(bs,{value:Zs,className:Js,children:Jn}),e[134]=bs,e[135]=Zs,e[136]=Js,e[137]=Jn,e[138]=H):H=e[138],D=Us,Y="keybinds",I="mt-4",z="flex flex-col gap-2",X=_e.map(IL),e[0]=u,e[1]=m,e[2]=w,e[3]=p,e[4]=d,e[5]=r,e[6]=_,e[7]=l,e[8]=c,e[9]=n,e[10]=g,e[11]=i,e[12]=y,e[13]=C,e[14]=S,e[15]=b,e[16]=D,e[17]=E,e[18]=O,e[19]=L,e[20]=z,e[21]=H,e[22]=$,e[23]=q,e[24]=G,e[25]=W,e[26]=X,e[27]=Y,e[28]=I,e[29]=M,e[30]=P,e[31]=F,e[32]=B,e[33]=Q}else D=e[16],E=e[17],O=e[18],L=e[19],z=e[20],H=e[21],$=e[22],q=e[23],G=e[24],W=e[25],X=e[26],Y=e[27],I=e[28],M=e[29],P=e[30],F=e[31],B=e[32],Q=e[33];let J;e[139]!==z||e[140]!==X?(J=h.jsx("div",{className:z,children:X}),e[139]=z,e[140]=X,e[141]=J):J=e[141];let ee;e[142]!==D||e[143]!==J||e[144]!==Y||e[145]!==I?(ee=h.jsx(D,{value:Y,className:I,children:J}),e[142]=D,e[143]=J,e[144]=Y,e[145]=I,e[146]=ee):ee=e[146];let K;e[147]!==E||e[148]!==H||e[149]!==ee||e[150]!==M||e[151]!==P||e[152]!==F||e[153]!==B||e[154]!==Q?(K=h.jsxs(E,{defaultValue:M,className:P,children:[F,B,Q,H,ee]}),e[147]=E,e[148]=H,e[149]=ee,e[150]=M,e[151]=P,e[152]=F,e[153]=B,e[154]=Q,e[155]=K):K=e[155];let V;e[156]!==O||e[157]!==$||e[158]!==q||e[159]!==K?(V=h.jsxs(O,{className:$,children:[q,K]}),e[156]=O,e[157]=$,e[158]=q,e[159]=K,e[160]=V):V=e[160];let te;e[161]!==a?(te=()=>{a(),k(!1)},e[161]=a,e[162]=te):te=e[162];let re;e[163]!==x||e[164]!==te?(re=h.jsx(Rc,{open:x,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:te}),e[163]=x,e[164]=te,e[165]=re):re=e[165];let ae;return e[166]!==L||e[167]!==G||e[168]!==W||e[169]!==V||e[170]!==re?(ae=h.jsxs(L,{open:G,onOpenChange:W,children:[V,re]}),e[166]=L,e[167]=G,e[168]=W,e[169]=V,e[170]=re,e[171]=ae):ae=e[171],ae}function IL(t,e){return h.jsxs("div",{className:"flex items-center justify-between py-1",children:[h.jsx("div",{className:"flex items-center gap-1",children:t.keys.map((n,r)=>h.jsxs("span",{children:[h.jsx("kbd",{className:"font-mono bg-muted rounded px-2 py-1 text-xs",children:n}),r<t.keys.length-1&&h.jsx("span",{className:"mx-1 text-muted-foreground",children:"+"})]},r))}),h.jsx("span",{className:"text-sm text-muted-foreground",children:t.description})]},e)}function PL(t){return t.revokedAt}function zL(t){return!t.revokedAt}const BL=Ja("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 Nd(t){const e=he.c(10);let n,r,i;e[0]!==t?({className:n,variant:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let l;e[4]!==n||e[5]!==i?(l=Ae(BL({variant:i}),n),e[4]=n,e[5]=i,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==l?(c=h.jsx("div",{"data-slot":"alert",role:"alert",className:l,...r}),e[7]=r,e[8]=l,e[9]=c):c=e[9],c}function Rd(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("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",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"alert-description",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function FL(t){const e=he.c(6),{status:n}=t;switch(n.status){case"connected":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"default",className:"bg-green-600",children:[h.jsx(Dc,{className:"size-3 mr-1"}),"Connected"]}),e[0]=r):r=e[0],r}case"disabled":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"secondary",children:[h.jsx(lf,{className:"size-3 mr-1"}),"Disabled"]}),e[1]=r):r=e[1],r}case"failed":{let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"destructive",children:[h.jsx(To,{className:"size-3 mr-1"}),"Failed"]}),e[2]=r):r=e[2],r}case"needs_auth":{let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"outline",className:"border-yellow-500 text-yellow-600",children:[h.jsx(To,{className:"size-3 mr-1"}),"Needs Auth"]}),e[3]=r):r=e[3],r}case"needs_client_registration":{let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"outline",className:"border-orange-500 text-orange-600",children:[h.jsx(To,{className:"size-3 mr-1"}),"Needs Registration"]}),e[4]=r):r=e[4],r}default:{let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(Ft,{variant:"secondary",children:"Unknown"}),e[5]=r):r=e[5],r}}}function HL({open:t,onOpenChange:e,workspaceId:n,workspacePath:r,serverUrl:i,apiToken:l}){const{fetchWithAuth:c}=ns(),[a,u]=R.useState({}),[d,m]=R.useState(!1),[p,g]=R.useState(null),[_,C]=R.useState(null),w=R.useCallback(async()=>{if(n){m(!0),C(null);try{const k=await c(`/api/workspaces/${n}/mcp/status`,{},{serverUrl:i,token:l});if(!k.ok)throw new Error("Failed to load MCP status");const j=await k.json();u(j.status||{})}catch(k){const j=k instanceof Error?k.message:"Unknown error";C(j)}finally{m(!1)}}},[n,c,i,l]);R.useEffect(()=>{t&&n&&w()},[t,n,w]);const y=async k=>{if(n){g(k);try{if(!(await c(`/api/workspaces/${n}/mcp/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:i,token:l})).ok)throw new Error("Failed to connect");await w()}catch(j){const N=j instanceof Error?j.message:"Unknown error";C(N)}finally{g(null)}}},S=async k=>{if(n){g(k);try{if(!(await c(`/api/workspaces/${n}/mcp/disconnect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:i,token:l})).ok)throw new Error("Failed to disconnect");await w()}catch(j){const N=j instanceof Error?j.message:"Unknown error";C(N)}finally{g(null)}}},b=async k=>{if(n){g(k);try{const j=await c(`/api/workspaces/${n}/mcp/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:i,token:l});if(!j.ok)throw new Error("Failed to start auth");const N=await j.json();N.authorizationUrl&&window.open(N.authorizationUrl,"_blank"),await w()}catch(j){const N=j instanceof Error?j.message:"Unknown error";C(N)}finally{g(null)}}},x=Object.entries(a);return h.jsx(Ki,{open:t,onOpenChange:e,children:h.jsxs(Yi,{className:"sm:max-w-[600px] max-h-[80vh]",children:[h.jsxs(Xi,{children:[h.jsxs(Qi,{className:"flex items-center gap-2",children:[h.jsx(Do,{className:"size-5"}),"MCP Servers"]}),h.jsx($o,{children:"Manage Model Context Protocol servers for this workspace"})]}),h.jsxs("div",{className:"mt-4 space-y-4",children:[_&&h.jsxs(Nd,{variant:"destructive",children:[h.jsx(To,{className:"size-4"}),h.jsx(Rd,{children:_})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure servers in ",h.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})]}),h.jsx(Te,{variant:"outline",size:"sm",onClick:w,disabled:d,children:h.jsx(Pi,{className:`size-4 ${d?"animate-spin":""}`})})]}),h.jsx(ds,{className:"h-[400px]",children:d&&x.length===0?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):x.length===0?h.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[h.jsx(Do,{className:"size-12 mx-auto mb-3 opacity-50"}),h.jsx("p",{className:"font-medium",children:"No MCP servers configured"}),h.jsxs("p",{className:"text-sm mt-1",children:["Create ",h.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})," in your workspace to add servers."]})]}):h.jsx("div",{className:"space-y-3",children:x.map(([k,{config:j,status:N}])=>{var D;return h.jsxs("div",{className:"border rounded-lg p-4",children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(Do,{className:"size-5 text-muted-foreground mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium",children:k}),h.jsx("div",{className:"text-sm text-muted-foreground",children:(j==null?void 0:j.type)==="local"?h.jsxs("span",{children:["Local - ",((D=j.command)==null?void 0:D[0])||"command"]}):(j==null?void 0:j.type)==="remote"?h.jsxs("span",{className:"flex items-center gap-1",children:["Remote - ",j.url]}):"Unknown type"}),N.status==="failed"&&"error"in N&&h.jsx(Nd,{variant:"destructive",className:"mt-2 py-2",children:h.jsx(Rd,{className:"text-xs",children:N.error})}),N.status==="needs_client_registration"&&"error"in N&&h.jsx(Nd,{className:"mt-2 py-2 border-orange-500",children:h.jsx(Rd,{className:"text-xs",children:N.error})})]})]}),h.jsx("div",{className:"flex items-center gap-2",children:h.jsx(FL,{status:N})})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t",children:[N.status==="connected"&&h.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>S(k),disabled:p===k,children:[p===k?h.jsx(Wt,{className:"size-4 animate-spin"}):h.jsx(lN,{className:"size-4"}),h.jsx("span",{className:"ml-1",children:"Disconnect"})]}),(N.status==="disabled"||N.status==="failed")&&h.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>y(k),disabled:p===k,children:[p===k?h.jsx(Wt,{className:"size-4 animate-spin"}):h.jsx(uN,{className:"size-4"}),h.jsx("span",{className:"ml-1",children:"Connect"})]}),N.status==="needs_auth"&&h.jsxs(Te,{variant:"default",size:"sm",onClick:()=>b(k),disabled:p===k,children:[p===k?h.jsx(Wt,{className:"size-4 animate-spin"}):h.jsx(bc,{className:"size-4"}),h.jsx("span",{className:"ml-1",children:"Authenticate"})]})]})]},k)})})})]})]})})}function $L({serverUrl:t,apiToken:e}){const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState([]),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,_]=R.useState(""),[C,w]=R.useState(!1),[y,S]=R.useState(null),b=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const D=await n(`${r}/api/config/providers`,{headers:{Authorization:`Bearer ${e}`}});if(!D.ok)throw new Error("Failed to load providers");const E=await D.json();l(E.providers)}catch(D){d(D instanceof Error?D.message:"Failed to load providers")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{b()},[b]);const x=async D=>{if(g.trim()){S(D);try{const E=await n(`${r}/api/config/providers/${D}`,{method:"PUT",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({apiKey:g.trim()})});if(!E.ok){const O=await E.json().catch(()=>({}));throw new Error(O.message||"Failed to set key")}p(null),_(""),w(!1),await b()}catch(E){d(E instanceof Error?E.message:"Failed to set key")}finally{S(null)}}},k=async D=>{S(D);try{const E=await n(`${r}/api/config/providers/${D}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!E.ok){const O=await E.json().catch(()=>({}));throw new Error(O.message||"Failed to clear key")}await b()}catch(E){d(E instanceof Error?E.message:"Failed to clear key")}finally{S(null)}},j={anthropic:"Anthropic",google:"Google",minimax:"MiniMax",openai:"OpenAI",openrouter:"OpenRouter",zhipu:"Z.AI","zhipu-coding":"Z.AI Coding"},N=D=>j[D]||D.split("-").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join(" ");return c?h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):u&&i.length===0?h.jsx("div",{className:"p-4 text-sm text-destructive",children:u}):h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for LLM providers. Keys are stored in ~/.jean2/.env and never exposed to the client."}),h.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"OAuth-based providers are managed in the OAuth tab."}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsx("div",{className:"space-y-2",children:i.map(D=>h.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(wS,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm font-medium",children:N(D.provider)}),h.jsx(Ft,{variant:D.configured?"default":"secondary",children:D.configured?"Configured":"Not set"})]}),h.jsx("div",{className:"flex items-center gap-2",children:m===D.provider?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx(an,{type:C?"text":"password",value:g,onChange:E=>_(E.target.value),placeholder:"Enter API key...",className:"w-full sm:w-48 h-8 text-sm pr-8",onKeyDown:E=>{E.key==="Enter"&&x(D.provider),E.key==="Escape"&&(p(null),_(""))},autoFocus:!0}),h.jsx(Te,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-8 w-8",onClick:()=>w(!C),children:C?h.jsx(SS,{className:"size-3"}):h.jsx(Fg,{className:"size-3"})})]}),h.jsx(Te,{size:"sm",onClick:()=>x(D.provider),disabled:!g.trim()||y===D.provider,children:y===D.provider?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Vn,{className:"size-3"})}),h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>{p(null),_("")},children:h.jsx(zn,{className:"size-3"})})]}):h.jsxs(h.Fragment,{children:[h.jsx(Te,{size:"sm",variant:"outline",onClick:()=>{p(D.provider),_(""),w(!1)},disabled:y===D.provider,children:D.configured?"Update":"Set Key"}),D.configured&&h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>k(D.provider),disabled:y===D.provider,children:y===D.provider?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Br,{className:"size-3"})})]})})]},D.provider))})]})}function UL({serverUrl:t,apiToken:e}){const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState([]),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,_]=R.useState({}),[C,w]=R.useState(null),y=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const k=await n(`${r}/api/providers`,{headers:{Authorization:`Bearer ${e}`}});if(!k.ok)throw new Error("Failed to load providers");const j=await k.json();l(j.providers||[])}catch(k){d(k instanceof Error?k.message:"Failed to load providers")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{y()},[y]);const S=async k=>{p(k),_(j=>({...j,[k]:""})),d(null);try{const j=await n(`${r}/api/providers/${k}/connect`,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!j.ok)throw new Error("Failed to connect provider");const N=await j.json();N.authorizationUrl&&_(D=>({...D,[k]:N.authorizationUrl}))}catch(j){d(j instanceof Error?j.message:"Failed to connect provider"),_(N=>({...N,[k]:""}))}finally{p(null)}},b=async k=>{d(null);try{if(!(await n(`${r}/api/providers/${k}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}})).ok)throw new Error("Failed to disconnect provider");await y()}catch(j){d(j instanceof Error?j.message:"Failed to disconnect provider")}},x=async(k,j)=>{try{await navigator.clipboard.writeText(k),w(j),setTimeout(()=>w(null),2e3)}catch{}};return c?h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect subscription-based providers using OAuth. No API keys needed."}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),i.length===0?h.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No OAuth providers available."}):h.jsx("div",{className:"flex flex-col gap-3",children:i.map(k=>h.jsxs("div",{className:"rounded-lg border p-3 sm:p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`size-2 rounded-full ${k.connected?"bg-green-500":"bg-muted-foreground"}`}),h.jsx("span",{className:"text-sm font-medium",children:k.displayName||k.provider})]}),k.connected&&h.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),k.error&&h.jsx("p",{className:"text-xs text-destructive",children:k.error}),k.connected&&k.connectedAt&&h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Connected ",new Date(k.connectedAt).toLocaleDateString()]}),h.jsxs("div",{className:"flex gap-2",children:[!k.connected&&!g[k.provider]&&h.jsxs(Te,{size:"sm",onClick:()=>S(k.provider),disabled:m===k.provider,children:[m===k.provider?h.jsx(Wt,{className:"size-3 animate-spin"}):null,"Connect"]}),k.connected&&h.jsxs(Te,{variant:"destructive",size:"sm",onClick:()=>b(k.provider),children:[h.jsx(MN,{className:"size-3"}),h.jsx("span",{className:"hidden sm:inline",children:"Disconnect"})]})]}),!k.connected&&g[k.provider]&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-xs text-muted-foreground",children:"Open this URL in your browser to complete the connection:"}),h.jsx("div",{className:"rounded-md bg-muted p-2",children:h.jsx("a",{href:g[k.provider],target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs text-blue-500 underline break-all",children:g[k.provider]})}),h.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>x(g[k.provider],k.provider),children:[C===k.provider?h.jsx(Vn,{className:"size-3"}):h.jsx(yc,{className:"size-3"}),C===k.provider?"Copied":"Copy URL"]})]})]},k.provider))})]})}function jd(t){const e=he.c(11);let n,r,i;e[0]!==t?({className:n,size:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"default":i;let c;e[4]!==n?(c=Ae("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",n),e[4]=n,e[5]=c):c=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(HM,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"}),e[6]=a):a=e[6];let u;return e[7]!==r||e[8]!==l||e[9]!==c?(u=h.jsx(FM,{"data-slot":"switch","data-size":l,className:c,...r,children:a}),e[7]=r,e[8]=l,e[9]=c,e[10]=u):u=e[10],u}function VL(t){const e=he.c(9),{tier:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={variant:"secondary",icon:h.jsx("span",{className:"text-[10px] font-bold",children:"B"})},e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={variant:"default",icon:h.jsx("span",{className:"text-[10px] font-bold",children:"S"})},e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l={budget:r,standard:i,premium:{variant:"outline",icon:h.jsx(xc,{className:"size-2.5"})}},e[2]=l):l=e[2];const c=l,{variant:a,icon:u}=c[n];let d;e[3]!==n?(d=h.jsx("span",{className:"hidden sm:inline",children:n}),e[3]=n,e[4]=d):d=e[4];let m;return e[5]!==u||e[6]!==d||e[7]!==a?(m=h.jsxs(Ft,{variant:a,className:"text-[10px] gap-0.5",children:[u,d]}),e[5]=u,e[6]=d,e[7]=a,e[8]=m):m=e[8],m}function qL(t){const e=he.c(3),{status:n}=t;if(n.usable){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsxs(Ft,{variant:"default",className:"bg-emerald-500/20 text-emerald-600 dark:text-emerald-400 border-emerald-500/30 text-[10px]",children:[h.jsx(Vn,{className:"size-2.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Usable"})]}),e[0]=i):i=e[0],i}if(n.providerSupported&&!n.providerConfigured){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsxs(Ft,{variant:"secondary",className:"text-[10px]",children:[h.jsx(To,{className:"size-2.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Needs config"})]}),e[1]=i):i=e[1],i}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"outline",className:"text-[10px] text-muted-foreground",children:[h.jsx(zn,{className:"size-2.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Unsupported"})]}),e[2]=r):r=e[2],r}const qx={id:"",name:""},Wx={id:"",name:"",contextWindow:128e3,maxOutputTokens:void 0,tier:"standard"};function WL({serverUrl:t,apiToken:e}){var oe,me,Ne,Le,Ge,Ke,Je,lt,Be,We,ze,rt,kt,mn,gn,Zt,rn,Jt;const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState(null),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,_]=R.useState(!1),[C,w]=R.useState(qx),[y,S]=R.useState(!1),[b,x]=R.useState(null),[k,j]=R.useState(!1),[N,D]=R.useState(null),[E,O]=R.useState(null),[L,z]=R.useState(Wx),[H,$]=R.useState(!1),[q,G]=R.useState(null),[W,X]=R.useState(!1),[Y,I]=R.useState({}),[M,P]=R.useState(!1),[F,B]=R.useState({defaultProvider:"",defaultModel:""}),[Q,J]=R.useState(!1);function ee(ge,He,tt){var ot;const Oe={...(ot=ge.capabilities)==null?void 0:ot.input};Oe[He]=tt;const Ie=Oe.text||Oe.image||Oe.video||Array.isArray(Oe.file)&&Oe.file.length>0;return{...ge,capabilities:Ie?{input:Oe}:void 0}}function K(ge,He){var ot;const tt=He.trim()?He.split(",").map(Tt=>Tt.trim()).filter(Boolean):void 0,Oe={...(ot=ge.capabilities)==null?void 0:ot.input,file:tt},Ie=Oe.text||Oe.image||Oe.video||Array.isArray(Oe.file)&&Oe.file.length>0;return{...ge,capabilities:Ie?{input:Oe}:void 0}}const V=()=>{const ge={...L.variants||{}};let He="new",tt=1;for(;ge[He];)He=`new-${tt++}`;ge[He]={providerOptions:{}},z(Oe=>({...Oe,variants:ge}))},te=ge=>{const He={...L.variants||{}};delete He[ge];const tt=Object.keys(He);z(Oe=>({...Oe,variants:tt.length>0?He:void 0}))},re=(ge,He)=>{if(ge===He)return;const tt={...L.variants||{}};if(tt[He]&&He!==ge)return;const Oe=tt[ge];delete tt[ge],tt[He]=Oe,z(Ie=>({...Ie,variants:Object.keys(tt).length>0?tt:void 0}))},ae=(ge,He)=>{try{const tt=JSON.parse(He);if(typeof tt!="object"||Array.isArray(tt)){I(Ie=>({...Ie,[ge]:!0}));return}const Oe={...L.variants||{}};Oe[ge]={providerOptions:tt},z(Ie=>({...Ie,variants:Oe})),I(Ie=>({...Ie,[ge]:!1}))}catch{I(tt=>({...tt,[ge]:!0}))}},[se,_e]=R.useState(new Set),Ee=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const ge=await n(`${r}/api/config/models`,{headers:{Authorization:`Bearer ${e}`}});if(!ge.ok)throw new Error("Failed to load models config");const He=await ge.json();l(He),B({defaultProvider:He.defaultProvider,defaultModel:He.defaultModel})}catch(ge){d(ge instanceof Error?ge.message:"Failed to load models config")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{Ee()},[Ee]);const De=()=>{_(!0),p(null),w(qx)},Ue=ge=>{p(ge.id),_(!1),w({id:ge.id,name:ge.name})},ce=async()=>{if(!(!C.id.trim()||!C.name.trim())){S(!0),d(null);try{const ge=g?`${r}/api/config/models/providers`:`${r}/api/config/models/providers/${m}`,He=g?"POST":"PUT",tt=g?{id:C.id.trim(),name:C.name.trim()}:{name:C.name.trim()},Oe=await n(ge,{method:He,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(tt)});if(!Oe.ok){const Ie=await Oe.json().catch(()=>({}));throw new Error(Ie.message||"Failed to save provider")}_(!1),p(null),await Ee()}catch(ge){d(ge instanceof Error?ge.message:"Failed to save provider")}finally{S(!1)}}},je=async()=>{if(b){j(!0),d(null);try{const ge=await n(`${r}/api/config/models/providers/${b}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!ge.ok){const He=await ge.json().catch(()=>({}));throw new Error(He.message||"Failed to delete provider")}x(null),await Ee()}catch(ge){d(ge instanceof Error?ge.message:"Failed to delete provider")}finally{j(!1)}}},be=ge=>{O(ge),D(null),z(Wx),I({})},Ve=ge=>{D({providerId:ge.providerId,modelId:ge.id}),O(null),z({id:ge.id,name:ge.name,contextWindow:ge.contextWindow,maxOutputTokens:ge.maxOutputTokens,tier:ge.tier,variants:ge.variants,capabilities:ge.capabilities}),I({})},qe=async ge=>{if(!(!L.id.trim()||!L.name.trim())){$(!0),d(null);try{const He=E?`${r}/api/config/models/providers/${ge}/models`:`${r}/api/config/models/providers/${ge}/models/${N==null?void 0:N.modelId}`,tt=E?"POST":"PUT",Oe={...E?{id:L.id.trim()}:{},name:L.name.trim(),contextWindow:L.contextWindow,maxOutputTokens:L.maxOutputTokens,tier:L.tier,variants:L.variants,capabilities:L.capabilities},Ie=await n(He,{method:tt,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(Oe)});if(!Ie.ok){const ot=await Ie.json().catch(()=>({}));throw new Error(ot.message||"Failed to save model")}O(null),D(null),await Ee()}catch(He){d(He instanceof Error?He.message:"Failed to save model")}finally{$(!1)}}},ye=async()=>{if(q){X(!0),d(null);try{const ge=await n(`${r}/api/config/models/providers/${q.providerId}/models/${q.modelId}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!ge.ok){const He=await ge.json().catch(()=>({}));throw new Error(He.message||"Failed to delete model")}G(null),await Ee()}catch(ge){d(ge instanceof Error?ge.message:"Failed to delete model")}finally{X(!1)}}},Me=async()=>{J(!0),d(null);try{const ge=await n(`${r}/api/config/models/defaults`,{method:"PUT",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({defaultProvider:F.defaultProvider,defaultModel:F.defaultModel})});if(!ge.ok){const He=await ge.json().catch(()=>({}));throw new Error(He.message||"Failed to save defaults")}P(!1),await Ee()}catch(ge){d(ge instanceof Error?ge.message:"Failed to save defaults")}finally{J(!1)}},Re=ge=>{_e(He=>{const tt=new Set(He);return tt.has(ge)?tt.delete(ge):tt.add(ge),tt})},we=[];if(i==null||i.providers.forEach(ge=>{ge.models.forEach(He=>{we.push({providerId:ge.id,providerName:ge.name,modelId:He.id,modelName:He.name})})}),c)return h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})});if(g||m){const ge=i==null?void 0:i.providers.find(He=>He.id===m);return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-medium",children:g?"New Provider":`Edit: ${(ge==null?void 0:ge.name)||m}`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Te,{size:"sm",onClick:ce,disabled:y||!C.id.trim()||!C.name.trim(),children:[y?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Vn,{className:"size-3"}),"Save"]}),h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>{_(!1),p(null)},children:h.jsx(zn,{className:"size-3"})})]})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Provider ID"}),h.jsx(an,{value:C.id,onChange:He=>w(tt=>({...tt,id:He.target.value})),disabled:!g,placeholder:"e.g., openai",className:"mt-1 font-mono"}),!g&&h.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"ID cannot be changed"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Name"}),h.jsx(an,{value:C.name,onChange:He=>w(tt=>({...tt,name:He.target.value})),placeholder:"e.g., OpenAI",className:"mt-1"})]})]})]})}if(E||N){const ge=E||(N==null?void 0:N.providerId)||"",He=i==null?void 0:i.providers.find(Oe=>Oe.id===ge),tt=!E&&N?He==null?void 0:He.models.find(Oe=>Oe.id===N.modelId):null;return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-medium",children:E?`New Model (${(He==null?void 0:He.name)||ge})`:`Edit: ${(tt==null?void 0:tt.name)||(N==null?void 0:N.modelId)}`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Te,{size:"sm",onClick:()=>qe(ge),disabled:H||!L.id.trim()||!L.name.trim()||Object.values(Y).some(Boolean),children:[H?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Vn,{className:"size-3"}),"Save"]}),h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>{O(null),D(null)},children:h.jsx(zn,{className:"size-3"})})]})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Model ID"}),h.jsx(an,{value:L.id,onChange:Oe=>z(Ie=>({...Ie,id:Oe.target.value})),disabled:!E,placeholder:"e.g., gpt-4o",className:"mt-1 font-mono"}),!E&&h.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"ID cannot be changed"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Display Name"}),h.jsx(an,{value:L.name,onChange:Oe=>z(Ie=>({...Ie,name:Oe.target.value})),placeholder:"e.g., GPT-4o",className:"mt-1"})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Context Window"}),h.jsx(an,{type:"number",value:L.contextWindow,onChange:Oe=>z(Ie=>({...Ie,contextWindow:parseInt(Oe.target.value)||0})),min:1,className:"mt-1"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Max Output Tokens"}),h.jsx(an,{type:"number",value:(oe=L.maxOutputTokens)!=null?oe:"",onChange:Oe=>z(Ie=>({...Ie,maxOutputTokens:Oe.target.value?parseInt(Oe.target.value):void 0})),min:1,placeholder:"Optional",className:"mt-1"})]})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Tier"}),h.jsxs("select",{value:L.tier,onChange:Oe=>z(Ie=>({...Ie,tier:Oe.target.value})),className:"mt-1 h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm",children:[h.jsx("option",{value:"budget",children:"Budget"}),h.jsx("option",{value:"standard",children:"Standard"}),h.jsx("option",{value:"premium",children:"Premium"})]})]}),h.jsx(_n,{className:"my-2"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(xt,{className:"text-xs font-medium",children:"Capabilities"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[h.jsx(jd,{checked:(Le=(Ne=(me=L.capabilities)==null?void 0:me.input)==null?void 0:Ne.text)!=null?Le:!1,onCheckedChange:Oe=>z(Ie=>ee(Ie,"text",Oe))}),h.jsx("span",{className:"text-xs",children:"Text"})]}),h.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[h.jsx(jd,{checked:(Je=(Ke=(Ge=L.capabilities)==null?void 0:Ge.input)==null?void 0:Ke.image)!=null?Je:!1,onCheckedChange:Oe=>z(Ie=>ee(Ie,"image",Oe))}),h.jsx("span",{className:"text-xs",children:"Image"})]}),h.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[h.jsx(jd,{checked:(We=(Be=(lt=L.capabilities)==null?void 0:lt.input)==null?void 0:Be.video)!=null?We:!1,onCheckedChange:Oe=>z(Ie=>ee(Ie,"video",Oe))}),h.jsx("span",{className:"text-xs",children:"Video"})]})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"File Types (MIME, comma-separated)"}),h.jsx(an,{value:(mn=(kt=(rt=(ze=L.capabilities)==null?void 0:ze.input)==null?void 0:rt.file)==null?void 0:kt.join(", "))!=null?mn:"",onChange:Oe=>z(Ie=>K(Ie,Oe.target.value)),placeholder:"e.g., application/pdf, text/csv",className:"mt-1 font-mono text-xs"})]})]}),h.jsx(_n,{className:"my-2"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(xt,{className:"text-xs font-medium",children:"Variants"}),h.jsxs(Te,{type:"button",size:"sm",variant:"ghost",onClick:V,children:[h.jsx(Qr,{className:"size-3"}),"Add Variant"]})]}),L.variants&&Object.keys(L.variants).length>0?h.jsx("div",{className:"space-y-2",children:Object.entries(L.variants).map(([Oe,Ie])=>h.jsxs("div",{className:"border rounded p-2 space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(an,{value:Oe,onChange:ot=>re(Oe,ot.target.value),placeholder:"variant name",className:"h-7 text-xs font-mono w-24"}),h.jsx("div",{className:"flex-1"}),h.jsx(Te,{type:"button",size:"icon-xs",variant:"ghost",onClick:()=>te(Oe),children:h.jsx(Br,{className:"size-3"})})]}),h.jsx(Ck,{value:JSON.stringify(Ie.providerOptions,null,2),onChange:ot=>ae(Oe,ot.target.value),placeholder:"{}",className:"font-mono text-xs min-h-[60px]",rows:3}),Y[Oe]&&h.jsx("p",{className:"text-[10px] text-destructive",children:"Invalid JSON"})]},Oe))}):h.jsx("p",{className:"text-xs text-muted-foreground",children:"No variants configured"})]})]})]})}return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"border rounded-lg p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[h.jsx(yS,{className:"size-4"}),"Default Model"]}),h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>P(!M),children:M?h.jsx(zn,{className:"size-3"}):h.jsx(za,{className:"size-3"})})]}),M?h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Default Provider"}),h.jsxs("select",{value:F.defaultProvider,onChange:ge=>B(He=>({...He,defaultProvider:ge.target.value,defaultModel:""})),className:"mt-1 h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm",children:[h.jsx("option",{value:"",children:"Select provider..."}),i==null?void 0:i.providers.map(ge=>h.jsx("option",{value:ge.id,children:ge.name},ge.id))]})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Default Model"}),h.jsxs("select",{value:F.defaultModel,onChange:ge=>B(He=>({...He,defaultModel:ge.target.value})),className:"mt-1 h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm",children:[h.jsx("option",{value:"",children:"Select model..."}),(gn=i==null?void 0:i.providers.find(ge=>ge.id===F.defaultProvider))==null?void 0:gn.models.map(ge=>h.jsx("option",{value:ge.id,children:ge.name},ge.id))]})]}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>P(!1),children:"Cancel"}),h.jsxs(Te,{size:"sm",onClick:Me,disabled:Q||!F.defaultProvider||!F.defaultModel,children:[Q?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Vn,{className:"size-3"}),"Save"]})]})]}):h.jsx("div",{className:"text-sm text-muted-foreground",children:i!=null&&i.defaultProvider&&(i!=null&&i.defaultModel)?h.jsxs("span",{children:[((Zt=i.providers.find(ge=>ge.id===i.defaultProvider))==null?void 0:Zt.name)||i.defaultProvider," /"," ",((Jt=(rn=i.providers.find(ge=>ge.id===i.defaultProvider))==null?void 0:rn.models.find(ge=>ge.id===i.defaultModel))==null?void 0:Jt.name)||i.defaultModel]}):h.jsx("span",{className:"italic",children:"Not configured"})})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-sm text-muted-foreground",children:[(i==null?void 0:i.providers.length)||0," provider",((i==null?void 0:i.providers.length)||0)!==1?"s":""]}),h.jsxs(Te,{size:"sm",onClick:De,children:[h.jsx(Qr,{className:"size-3"}),h.jsx("span",{className:"hidden sm:inline",children:"Add Provider"})]})]}),(i==null?void 0:i.providers.length)===0?h.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No providers configured. Add one to get started."}):h.jsx("div",{className:"space-y-2",children:i==null?void 0:i.providers.map(ge=>{const He=se.has(ge.id),tt=ge.id===i.defaultProvider;return h.jsxs(Ks,{open:!He,onOpenChange:()=>Re(ge.id),className:"border rounded-lg",children:[h.jsxs("div",{className:"flex items-center justify-between w-full px-3 py-2 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>Re(ge.id),children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx(Hr,{className:`size-4 transition-transform ${He?"":"rotate-90"}`}),h.jsx("span",{className:"text-sm font-medium truncate",children:ge.name}),h.jsxs(Ft,{variant:"secondary",className:"text-[10px] shrink-0",children:[ge.models.length," model",ge.models.length!==1?"s":""]}),tt&&h.jsx(Ft,{variant:"outline",className:"text-[10px] shrink-0",children:"Default"})]}),h.jsxs("div",{className:"flex items-center gap-1 shrink-0",onClick:Oe=>Oe.stopPropagation(),children:[h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>be(ge.id),title:"Add model",children:h.jsx(Qr,{className:"size-3"})}),h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>Ue(ge),title:"Edit provider",children:h.jsx(za,{className:"size-3"})}),h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>x(ge.id),title:"Delete provider",children:h.jsx(Br,{className:"size-3"})})]})]}),h.jsx(Ys,{children:h.jsx("div",{className:"border-t px-3 py-2 space-y-1 bg-muted/30",children:ge.models.length===0?h.jsx("div",{className:"text-sm text-muted-foreground py-2 pl-6",children:"No models. Add one to get started."}):ge.models.map(Oe=>{var ot,Tt,Gt,Kt,lr,An,vn,Nn;const Ie=Oe.id===i.defaultModel&&Oe.providerId===i.defaultProvider;return h.jsxs("div",{className:"flex items-center justify-between py-1.5 pl-6 pr-2 rounded hover:bg-background",children:[h.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("span",{className:"text-sm truncate",children:Oe.name}),h.jsx(VL,{tier:Oe.tier}),h.jsx(qL,{status:Oe.runtimeStatus}),Ie&&h.jsxs(Ft,{variant:"outline",className:"text-[10px]",children:[h.jsx(xc,{className:"size-2.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Default"})]})]}),h.jsxs("div",{className:"hidden sm:flex items-center gap-2",children:[h.jsx("code",{className:"text-[10px] text-muted-foreground bg-muted px-1 rounded",children:Oe.id}),((Tt=(ot=Oe.capabilities)==null?void 0:ot.input)==null?void 0:Tt.text)&&h.jsx(Ft,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:"Text"}),((Kt=(Gt=Oe.capabilities)==null?void 0:Gt.input)==null?void 0:Kt.image)&&h.jsx(Ft,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:"Image"}),((An=(lr=Oe.capabilities)==null?void 0:lr.input)==null?void 0:An.video)&&h.jsx(Ft,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:"Video"}),((Nn=(vn=Oe.capabilities)==null?void 0:vn.input)==null?void 0:Nn.file)&&Oe.capabilities.input.file.length>0&&h.jsxs(Ft,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:["Files (",Oe.capabilities.input.file.length,")"]}),Oe.variants&&Object.keys(Oe.variants).length>0&&h.jsxs(Ft,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:[Object.keys(Oe.variants).length," variant",Object.keys(Oe.variants).length!==1?"s":""]})]})]}),h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>Ve(Oe),title:"Edit model",children:h.jsx(za,{className:"size-2.5"})}),h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>G({providerId:Oe.providerId,modelId:Oe.id}),title:"Delete model",children:h.jsx(Br,{className:"size-2.5"})})]})]},Oe.id)})})})]},ge.id)})}),h.jsx(Rc,{open:b!==null,onOpenChange:ge=>{ge||x(null)},title:"Delete Provider",description:`Are you sure you want to delete "${b}"? All models under this provider will be removed.${(i==null?void 0:i.defaultProvider)===b?" Warning: This is the current default provider.":""}`,confirmLabel:"Delete",variant:"destructive",onConfirm:je}),h.jsx(Rc,{open:q!==null,onOpenChange:ge=>{ge||G(null)},title:"Delete Model",description:`Are you sure you want to delete "${q==null?void 0:q.modelId}"?${(i==null?void 0:i.defaultModel)===(q==null?void 0:q.modelId)&&(i==null?void 0:i.defaultProvider)===(q==null?void 0:q.providerId)?" Warning: This is the current default model.":""}`,confirmLabel:"Delete",variant:"destructive",onConfirm:ye})]})}function GL({serverUrl:t,apiToken:e}){const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState([]),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,_]=R.useState(!1),[C,w]=R.useState(""),[y,S]=R.useState(""),[b,x]=R.useState(!1),[k,j]=R.useState(null),N=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const H=await n(`${r}/api/config/prompts`,{headers:{Authorization:`Bearer ${e}`}});if(!H.ok)throw new Error("Failed to load prompts");const $=await H.json();l($.prompts)}catch(H){d(H instanceof Error?H.message:"Failed to load prompts")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{N()},[N]);const D=()=>{_(!0),p(null),w(""),S(`# New Prompt
570
+
571
+ `)},E=H=>{p(H),_(!1),w(H.name),S(H.content)},O=async()=>{if(C.trim()){x(!0),d(null);try{if(g){const H=await n(`${r}/api/config/prompts`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({name:C.trim(),content:y})});if(!H.ok){const $=await H.json().catch(()=>({}));throw new Error($.message||"Failed to create prompt")}}else if(m){const H=await n(`${r}/api/config/prompts/${m.name}`,{method:"PUT",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({content:y})});if(!H.ok){const $=await H.json().catch(()=>({}));throw new Error($.message||"Failed to update prompt")}}_(!1),p(null),await N()}catch(H){d(H instanceof Error?H.message:"Failed to save prompt")}finally{x(!1)}}},L=async()=>{if(k)try{const H=await n(`${r}/api/config/prompts/${k}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!H.ok){const $=await H.json().catch(()=>({}));throw new Error($.message||"Failed to delete prompt")}j(null),await N()}catch(H){d(H instanceof Error?H.message:"Failed to delete prompt")}},z=()=>{_(!1),p(null),w(""),S("")};return g||m?h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Te,{variant:"ghost",size:"icon",onClick:z,children:h.jsx(Bg,{className:"size-4"})}),h.jsx("h3",{className:"text-sm font-medium",children:g?"New Prompt":`Edit: ${m==null?void 0:m.name}`})]}),h.jsx(Te,{size:"sm",onClick:O,disabled:b||!C.trim(),children:b?h.jsx(Wt,{className:"size-3 animate-spin"}):"Save"})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Name"}),h.jsx(an,{value:C,onChange:H=>w(H.target.value),disabled:!g,placeholder:"prompt-name",className:"font-mono"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Content (Markdown)"}),h.jsx("textarea",{value:y,onChange:H=>S(H.target.value),className:"w-full h-64 p-3 rounded-lg border bg-background font-mono text-sm resize-y",placeholder:"# Prompt Title\\n\\nPrompt content here..."})]})]}):c?h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.length," prompt",i.length!==1?"s":""]}),h.jsxs(Te,{size:"sm",onClick:D,children:[h.jsx(Qr,{className:"size-3","data-icon":"inline-start"}),"New Prompt"]})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),i.length===0?h.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No prompts yet. Create one to get started."}):h.jsx("div",{className:"space-y-2",children:i.map(H=>h.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover:bg-muted/50 cursor-pointer",onClick:()=>E(H),children:[h.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[h.jsx(Mc,{className:"size-4 text-muted-foreground shrink-0"}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm font-medium truncate",children:H.name}),H.description&&h.jsx("div",{className:"text-xs text-muted-foreground truncate",children:H.description})]})]}),h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsx(Te,{size:"icon",variant:"ghost",className:"size-8",onClick:$=>{$.stopPropagation(),E(H)},children:h.jsx(za,{className:"size-3"})}),h.jsx(Te,{size:"icon",variant:"ghost",className:"size-8",onClick:$=>{$.stopPropagation(),j(H.name)},children:h.jsx(Br,{className:"size-3"})})]})]},H.name))}),h.jsx(Rc,{open:k!==null,onOpenChange:H=>{H||j(null)},title:"Delete Prompt",description:`Are you sure you want to delete the prompt "${k}"? This cannot be undone.`,confirmLabel:"Delete",variant:"destructive",onConfirm:L})]})}const KL=[{value:"primary",label:"Primary"},{value:"subagent",label:"Subagent"},{value:"both",label:"Both"}],Tm={name:"",description:"",systemPrompt:"",mode:"primary",model:"",provider:"",variant:"",tools:[],settings:"",canSpawnSubagentsMode:"none",canSpawnSubagentsList:[],skills:[],isDefault:!1};function YL({serverUrl:t,apiToken:e}){const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState([]),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,_]=R.useState(!1),[C,w]=R.useState(Tm),[y,S]=R.useState(!1),[b,x]=R.useState(null),[k,j]=R.useState(!1),[N,D]=R.useState([]),[E,O]=R.useState(""),[L,z]=R.useState(""),[H,$]=R.useState(""),q=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const M=await n(`${r}/api/preconfigs`,{headers:{Authorization:`Bearer ${e}`}});if(!M.ok)throw new Error("Failed to load preconfigs");const P=await M.json();l(P.preconfigs)}catch(M){d(M instanceof Error?M.message:"Failed to load preconfigs")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{q()},[q]),R.useEffect(()=>{!e||!r||n(`${r}/api/tools`,{headers:{Authorization:`Bearer ${e}`}}).then(M=>M.json()).then(M=>D(M.tools||[])).catch(()=>{})},[n,r,e]);const G=()=>{_(!0),p(null),w(Tm),O(""),z(""),$("")},W=M=>{var P,F;p(M),_(!1),w({name:M.name,description:M.description||"",systemPrompt:M.systemPrompt||"",mode:M.mode||"primary",model:M.model||"",provider:M.provider||"",variant:M.variant||"",tools:(P=M.tools)!=null?P:[],settings:M.settings?JSON.stringify(M.settings,null,2):"",canSpawnSubagentsMode:M.canSpawnSubagents===!0?"all":M.canSpawnSubagents===!1||M.canSpawnSubagents===null||M.canSpawnSubagents===void 0?"none":"specific",canSpawnSubagentsList:Array.isArray(M.canSpawnSubagents)?M.canSpawnSubagents:[],skills:(F=M.skills)!=null?F:[],isDefault:M.isDefault}),O(""),z(""),$("")},X=async()=>{if(C.name.trim()){S(!0),d(null);try{let M=null;if(C.settings.trim())try{const B=JSON.parse(C.settings);if(typeof B=="object"&&!Array.isArray(B))M=B;else throw new Error("Settings must be a JSON object")}catch(B){d(B instanceof Error?B.message:"Invalid settings JSON"),S(!1);return}let P=null;C.canSpawnSubagentsMode==="all"?P=!0:C.canSpawnSubagentsMode==="specific"?P=C.canSpawnSubagentsList.length>0?C.canSpawnSubagentsList:[]:P=!1;const F={name:C.name.trim(),description:C.description.trim(),systemPrompt:C.systemPrompt,mode:C.mode,model:C.model.trim()||null,provider:C.provider.trim()||null,variant:C.variant.trim()||null,tools:C.tools.length>0?C.tools:null,settings:M,canSpawnSubagents:P,skills:C.skills.length>0?C.skills:null,isDefault:C.isDefault,format:"md"};if(g){const B=await n(`${r}/api/preconfigs`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(F)});if(!B.ok){const Q=await B.json().catch(()=>({}));throw new Error(Q.message||"Failed to create preconfig")}}else if(m){const B=await n(`${r}/api/preconfigs/${m.id}`,{method:"PUT",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(F)});if(!B.ok){const Q=await B.json().catch(()=>({}));throw new Error(Q.message||"Failed to update preconfig")}}_(!1),p(null),await q()}catch(M){d(M instanceof Error?M.message:"Failed to save preconfig")}finally{S(!1)}}},Y=async()=>{if(b){j(!0);try{const M=await n(`${r}/api/preconfigs/${b}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!M.ok){const P=await M.json().catch(()=>({}));throw new Error(P.message||"Failed to delete preconfig")}x(null),await q()}catch(M){d(M instanceof Error?M.message:"Failed to delete preconfig")}finally{j(!1)}}},I=()=>{_(!1),p(null),w(Tm),O(""),z(""),$("")};return g||m?h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Te,{variant:"ghost",size:"icon",onClick:I,children:h.jsx(Bg,{className:"size-4"})}),h.jsx("h3",{className:"text-sm font-medium",children:g?"New Preconfig":`Edit: ${m==null?void 0:m.name}`})]}),h.jsx(Te,{size:"sm",onClick:X,disabled:y||!C.name.trim(),children:y?h.jsx(Wt,{className:"size-3 animate-spin"}):"Save"})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Name"}),h.jsx(an,{value:C.name,onChange:M=>w({...C,name:M.target.value}),placeholder:"My Agent"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Description"}),h.jsx(an,{value:C.description,onChange:M=>w({...C,description:M.target.value}),placeholder:"Description..."})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Mode"}),h.jsx("select",{value:C.mode,onChange:M=>w({...C,mode:M.target.value}),className:"w-full h-9 rounded-md border bg-background px-3 text-sm",children:KL.map(M=>h.jsx("option",{value:M.value,children:M.label},M.value))})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Model (optional)"}),h.jsx(an,{value:C.model,onChange:M=>w({...C,model:M.target.value}),placeholder:"gpt-4o",className:"font-mono"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Provider (optional)"}),h.jsx(an,{value:C.provider,onChange:M=>w({...C,provider:M.target.value}),placeholder:"openai",className:"font-mono"})]})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Variant (optional)"}),h.jsx(an,{value:C.variant,onChange:M=>w({...C,variant:M.target.value}),placeholder:"e.g., low, medium, high",className:"font-mono"}),h.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Model variant key from models.json"})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Default Preconfig"}),h.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Only one preconfig can be the default"})]}),h.jsx(jd,{checked:C.isDefault,onCheckedChange:M=>w({...C,isDefault:M})})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(xt,{className:"text-sm",children:"Tools"}),h.jsx("p",{className:"text-[10px] text-muted-foreground",children:C.tools.length===0?"No tools selected — all available tools will be enabled":`${C.tools.length} tool${C.tools.length!==1?"s":""} selected`}),N.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:N.map(M=>{const P=C.tools.includes(M.name);return h.jsxs("button",{type:"button",onClick:()=>{w(F=>({...F,tools:P?F.tools.filter(B=>B!==M.name):[...F.tools,M.name]}))},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs border transition-colors ${P?"bg-primary text-primary-foreground border-primary":"bg-background border-border hover:bg-muted"}`,title:M.description,children:[P&&h.jsx(Vn,{className:"size-2.5"}),M.name]},M.name)})}),h.jsx("div",{className:"flex gap-1.5",children:h.jsx(an,{value:E,onChange:M=>O(M.target.value),placeholder:"Add custom tool ID...",className:"h-7 text-xs font-mono",onKeyDown:M=>{if(M.key==="Enter"&&E.trim()){M.preventDefault();const P=E.trim();C.tools.includes(P)||w(F=>({...F,tools:[...F.tools,P]})),O("")}}})}),C.tools.filter(M=>!N.some(P=>P.name===M)).length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:C.tools.filter(M=>!N.some(P=>P.name===M)).map(M=>h.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs bg-primary/10 border border-primary/30",children:[M,h.jsx("button",{type:"button",onClick:()=>w(P=>({...P,tools:P.tools.filter(F=>F!==M)})),className:"hover:text-destructive",children:h.jsx(zn,{className:"size-2.5"})})]},M))})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(xt,{className:"text-sm",children:"Settings"}),h.jsx("p",{className:"text-[10px] text-muted-foreground",children:"JSON object for model parameters (e.g., temperature)"}),h.jsx("textarea",{value:C.settings,onChange:M=>w({...C,settings:M.target.value}),className:"w-full h-20 p-2 rounded-lg border bg-background text-sm font-mono resize-y",placeholder:'{"temperature": 0.2}'})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(xt,{className:"text-sm",children:"Can Spawn Subagents"}),h.jsxs("select",{value:C.canSpawnSubagentsMode,onChange:M=>w({...C,canSpawnSubagentsMode:M.target.value}),className:"w-full h-9 rounded-md border bg-background px-3 text-sm",children:[h.jsx("option",{value:"none",children:"No — cannot spawn subagents"}),h.jsx("option",{value:"all",children:"Yes — all available subagents"}),h.jsx("option",{value:"specific",children:"Specific — choose which subagents"})]}),C.canSpawnSubagentsMode==="specific"&&h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Enter preconfig IDs that this agent can spawn"}),h.jsx("div",{className:"flex gap-1.5",children:h.jsx(an,{value:L,onChange:M=>z(M.target.value),placeholder:"Preconfig ID...",className:"h-7 text-xs font-mono",onKeyDown:M=>{if(M.key==="Enter"&&L.trim()){M.preventDefault();const P=L.trim();C.canSpawnSubagentsList.includes(P)||w(F=>({...F,canSpawnSubagentsList:[...F.canSpawnSubagentsList,P]})),z("")}}})}),C.canSpawnSubagentsList.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:C.canSpawnSubagentsList.map(M=>h.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs bg-primary/10 border border-primary/30 font-mono",children:[M,h.jsx("button",{type:"button",onClick:()=>w(P=>({...P,canSpawnSubagentsList:P.canSpawnSubagentsList.filter(F=>F!==M)})),className:"hover:text-destructive",children:h.jsx(zn,{className:"size-2.5"})})]},M))})]})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(xt,{className:"text-sm",children:"Skills"}),h.jsx("p",{className:"text-[10px] text-muted-foreground",children:C.skills.length===0?"No skills selected — all available skills will be enabled":`${C.skills.length} skill${C.skills.length!==1?"s":""} selected`}),h.jsx("div",{className:"flex gap-1.5",children:h.jsx(an,{value:H,onChange:M=>$(M.target.value),placeholder:"Skill name...",className:"h-7 text-xs font-mono",onKeyDown:M=>{if(M.key==="Enter"&&H.trim()){M.preventDefault();const P=H.trim();C.skills.includes(P)||w(F=>({...F,skills:[...F.skills,P]})),$("")}}})}),C.skills.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:C.skills.map(M=>h.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs bg-primary/10 border border-primary/30",children:[M,h.jsx("button",{type:"button",onClick:()=>w(P=>({...P,skills:P.skills.filter(F=>F!==M)})),className:"hover:text-destructive",children:h.jsx(zn,{className:"size-2.5"})})]},M))})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"System Prompt"}),h.jsx("textarea",{value:C.systemPrompt,onChange:M=>w({...C,systemPrompt:M.target.value}),className:"w-full h-48 p-3 rounded-lg border bg-background text-sm resize-y",placeholder:"System prompt content..."})]})]})]}):c?h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.length," preconfig",i.length!==1?"s":""]}),h.jsxs(Te,{size:"sm",onClick:G,children:[h.jsx(Qr,{className:"size-3"}),h.jsx("span",{className:"hidden sm:inline",children:"New Preconfig"})]})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),i.length===0?h.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No preconfigs yet. Create one to get started."}):h.jsx("div",{className:"space-y-2",children:i.map(M=>h.jsxs("div",{className:"flex items-center justify-between p-2.5 sm:p-3 rounded-lg border hover:bg-muted/50 cursor-pointer",onClick:()=>W(M),children:[h.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-1 min-w-0",children:[h.jsx(CS,{className:"size-4 text-muted-foreground shrink-0 hidden sm:block"}),h.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5 sm:gap-1 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 min-w-0",children:[h.jsx("span",{className:"text-sm font-medium truncate",children:M.name}),M.isDefault&&h.jsxs(Ft,{variant:"default",className:"text-[10px] px-1 sm:px-1.5 py-0",children:[h.jsx(xc,{className:"size-2.5 sm:mr-0.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Default"})]}),M.mode&&M.mode!=="primary"&&h.jsxs(Ft,{variant:"secondary",className:"text-[10px] px-1 sm:px-1.5 py-0",children:[h.jsx("span",{className:"hidden sm:inline",children:M.mode}),h.jsx("span",{className:"sm:hidden",children:M.mode==="subagent"?"SA":"B"})]})]}),M.description&&h.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:M.description})]})]}),h.jsxs("div",{className:"flex items-center gap-0.5 sm:gap-1 shrink-0",onClick:P=>P.stopPropagation(),children:[h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>W(M),title:"Edit preconfig",children:h.jsx(za,{className:"size-3"})}),!M.isDefault&&h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>x(M.id),title:"Delete preconfig",children:h.jsx(Br,{className:"size-3"})})]})]},M.id))}),h.jsx(Rc,{open:b!==null,onOpenChange:M=>{M||x(null)},title:"Delete Preconfig",description:"Are you sure you want to delete this preconfig? This cannot be undone.",confirmLabel:"Delete",variant:"destructive",onConfirm:Y})]})}function XL(t){const e=he.c(31),{open:n,onOpenChange:r,serverUrl:i,apiToken:l}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsxs(Xi,{children:[h.jsx(Qi,{children:"Configuration"}),h.jsx($o,{children:"Manage credentials, OAuth providers, models, prompts, and preconfigs"})]}),e[0]=c):c=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsxs($s,{value:"providers",children:[h.jsx(wS,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Credentials"})]}),e[1]=a):a=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsxs($s,{value:"oauth",children:[h.jsx($A,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"OAuth"})]}),e[2]=u):u=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs($s,{value:"models",children:[h.jsx(yS,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Models"})]}),e[3]=d):d=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsxs($s,{value:"prompts",children:[h.jsx(Mc,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Prompts"})]}),e[4]=m):m=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsxs(Ok,{className:"grid w-full grid-cols-5",children:[a,u,d,m,h.jsxs($s,{value:"preconfigs",children:[h.jsx(CS,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Preconfigs"})]})]}),e[5]=p):p=e[5];let g;e[6]!==l||e[7]!==i?(g=h.jsx(Us,{value:"providers",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx($L,{serverUrl:i,apiToken:l})})}),e[6]=l,e[7]=i,e[8]=g):g=e[8];let _;e[9]!==l||e[10]!==i?(_=h.jsx(Us,{value:"oauth",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx(UL,{serverUrl:i,apiToken:l})})}),e[9]=l,e[10]=i,e[11]=_):_=e[11];let C;e[12]!==l||e[13]!==i?(C=h.jsx(Us,{value:"models",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx(WL,{serverUrl:i,apiToken:l})})}),e[12]=l,e[13]=i,e[14]=C):C=e[14];let w;e[15]!==l||e[16]!==i?(w=h.jsx(Us,{value:"prompts",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx(GL,{serverUrl:i,apiToken:l})})}),e[15]=l,e[16]=i,e[17]=w):w=e[17];let y;e[18]!==l||e[19]!==i?(y=h.jsx(Us,{value:"preconfigs",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx(YL,{serverUrl:i,apiToken:l})})}),e[18]=l,e[19]=i,e[20]=y):y=e[20];let S;e[21]!==w||e[22]!==y||e[23]!==g||e[24]!==_||e[25]!==C?(S=h.jsxs(Yi,{className:"max-w-[calc(100vw-1rem)] sm:max-w-[800px] max-h-[calc(100dvh-2rem)] sm:max-h-[85vh]",children:[c,h.jsxs(Mk,{defaultValue:"providers",className:"mt-4",children:[p,g,_,C,w,y]})]}),e[21]=w,e[22]=y,e[23]=g,e[24]=_,e[25]=C,e[26]=S):S=e[26];let b;return e[27]!==r||e[28]!==n||e[29]!==S?(b=h.jsx(Ki,{open:n,onOpenChange:r,children:S}),e[27]=r,e[28]=n,e[29]=S,e[30]=b):b=e[30],b}function QL(t){const e=he.c(70),{open:n,onOpenChange:r,editServer:i}=t,{prepareForServerAdd:l,addServer:c,editServer:a}=Qa(),[u,d]=R.useState(""),[m,p]=R.useState(""),[g,_]=R.useState(""),[C,w]=R.useState(!1),[y,S]=R.useState(null),b=i!=null;let x;e[0]!==i?(x=()=>{i?(d(i.name),p(i.url),_(i.token)):(d(""),p("localhost:8742"),_("")),S(null),w(!1)},e[0]=i,e[1]=x):x=e[1];let k;e[2]!==i||e[3]!==n?(k=[i,n],e[2]=i,e[3]=n,e[4]=k):k=e[4],R.useEffect(x,k);let j;e[5]!==c||e[6]!==i||e[7]!==b||e[8]!==u||e[9]!==r||e[10]!==l||e[11]!==g||e[12]!==a||e[13]!==m?(j=De=>{De.preventDefault(),S(null);const Ue=u.trim(),ce=m.trim(),je=g.trim();if(!Ue){S("Name is required");return}if(!ce){S("Server URL is required");return}if(!je){S("API token is required");return}if(!mS(je)){S("Token must be 64 hexadecimal characters");return}const be=Md(ce);b?a(i.id,{name:Ue,url:be,token:je}):(l(),c(Ue,be,je)),r(!1)},e[5]=c,e[6]=i,e[7]=b,e[8]=u,e[9]=r,e[10]=l,e[11]=g,e[12]=a,e[13]=m,e[14]=j):j=e[14];const N=j,D=b?"Edit Server":"Add Server";let E;e[15]!==D?(E=h.jsx(Qi,{children:D}),e[15]=D,e[16]=E):E=e[16];const O=b?"Update server details":"Enter your server details";let L;e[17]!==O?(L=h.jsx($o,{children:O}),e[17]=O,e[18]=L):L=e[18];let z;e[19]!==E||e[20]!==L?(z=h.jsxs(Xi,{children:[E,L]}),e[19]=E,e[20]=L,e[21]=z):z=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(xt,{htmlFor:"server-name",children:"Name"}),e[22]=H):H=e[22];let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=De=>d(De.target.value),e[23]=$):$=e[23];let q;e[24]!==u?(q=h.jsxs("div",{className:"grid gap-2",children:[H,h.jsx(an,{id:"server-name",value:u,onChange:$,placeholder:"My Server"})]}),e[24]=u,e[25]=q):q=e[25];let G;e[26]===Symbol.for("react.memo_cache_sentinel")?(G=h.jsx(xt,{htmlFor:"server-url",children:"Server URL"}),e[26]=G):G=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=De=>p(De.target.value),e[27]=W):W=e[27];let X;e[28]!==m?(X=h.jsxs("div",{className:"grid gap-2",children:[G,h.jsx(an,{id:"server-url",value:m,onChange:W,placeholder:"localhost:8742"})]}),e[28]=m,e[29]=X):X=e[29];let Y;e[30]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsx(xt,{htmlFor:"server-token",children:"API Token"}),e[30]=Y):Y=e[30];const I=C?"text":"password";let M;e[31]===Symbol.for("react.memo_cache_sentinel")?(M=De=>_(De.target.value),e[31]=M):M=e[31];let P;e[32]!==I||e[33]!==g?(P=h.jsx(an,{id:"server-token",type:I,value:g,onChange:M,placeholder:"64-character hex string",className:"pr-10"}),e[32]=I,e[33]=g,e[34]=P):P=e[34];let F;e[35]!==C?(F=()=>w(!C),e[35]=C,e[36]=F):F=e[36];let B;e[37]!==C?(B=C?h.jsx(SS,{className:"size-4 text-muted-foreground"}):h.jsx(Fg,{className:"size-4 text-muted-foreground"}),e[37]=C,e[38]=B):B=e[38];let Q;e[39]!==F||e[40]!==B?(Q=h.jsx("button",{type:"button",onClick:F,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-transparent",children:B}),e[39]=F,e[40]=B,e[41]=Q):Q=e[41];let J;e[42]!==P||e[43]!==Q?(J=h.jsxs("div",{className:"grid gap-2",children:[Y,h.jsxs("div",{className:"relative",children:[P,Q]})]}),e[42]=P,e[43]=Q,e[44]=J):J=e[44];let ee;e[45]!==y?(ee=y&&h.jsx("p",{className:"text-sm text-destructive",children:y}),e[45]=y,e[46]=ee):ee=e[46];let K;e[47]!==q||e[48]!==X||e[49]!==J||e[50]!==ee?(K=h.jsxs("div",{className:"grid gap-4 py-4",children:[q,X,J,ee]}),e[47]=q,e[48]=X,e[49]=J,e[50]=ee,e[51]=K):K=e[51];let V;e[52]!==r?(V=h.jsx(Te,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e[52]=r,e[53]=V):V=e[53];const te=b?"Save":"Add";let re;e[54]!==te?(re=h.jsx(Te,{type:"submit",children:te}),e[54]=te,e[55]=re):re=e[55];let ae;e[56]!==V||e[57]!==re?(ae=h.jsxs(Pf,{children:[V,re]}),e[56]=V,e[57]=re,e[58]=ae):ae=e[58];let se;e[59]!==N||e[60]!==K||e[61]!==ae?(se=h.jsxs("form",{onSubmit:N,children:[K,ae]}),e[59]=N,e[60]=K,e[61]=ae,e[62]=se):se=e[62];let _e;e[63]!==se||e[64]!==z?(_e=h.jsxs(Yi,{className:"sm:max-w-[425px]",children:[z,se]}),e[63]=se,e[64]=z,e[65]=_e):_e=e[65];let Ee;return e[66]!==r||e[67]!==n||e[68]!==_e?(Ee=h.jsx(Ki,{open:n,onOpenChange:r,children:_e}),e[66]=r,e[67]=n,e[68]=_e,e[69]=Ee):Ee=e[69],Ee}function ZL(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const JL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,e7=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t7={};function Gx(t,e){return(t7.jsx?e7:JL).test(t)}const n7=/[ \t\n\f\r]/g;function r7(t){return typeof t=="object"?t.type==="text"?Kx(t.value):!1:Kx(t)}function Kx(t){return t.replace(n7,"")===""}class Gc{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Gc.prototype.normal={};Gc.prototype.property={};Gc.prototype.space=void 0;function Fk(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Gc(n,r,e)}function Cg(t){return t.toLowerCase()}class ar{constructor(e,n){this.attribute=n,this.property=e}}ar.prototype.attribute="";ar.prototype.booleanish=!1;ar.prototype.boolean=!1;ar.prototype.commaOrSpaceSeparated=!1;ar.prototype.commaSeparated=!1;ar.prototype.defined=!1;ar.prototype.mustUseProperty=!1;ar.prototype.number=!1;ar.prototype.overloadedBoolean=!1;ar.prototype.property="";ar.prototype.spaceSeparated=!1;ar.prototype.space=void 0;let s7=0;const dt=Vo(),pn=Vo(),kg=Vo(),Pe=Vo(),Vt=Vo(),$a=Vo(),xr=Vo();function Vo(){return 2**++s7}const Eg=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:pn,commaOrSpaceSeparated:xr,commaSeparated:$a,number:Pe,overloadedBoolean:kg,spaceSeparated:Vt},Symbol.toStringTag,{value:"Module"})),Dm=Object.keys(Eg);class Tv extends ar{constructor(e,n,r,i){let l=-1;if(super(e,n),Yx(this,"space",i),typeof r=="number")for(;++l<Dm.length;){const c=Dm[l];Yx(this,Dm[l],(r&Eg[c])===Eg[c])}}}Tv.prototype.defined=!0;function Yx(t,e,n){n&&(t[e]=n)}function al(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const l=new Tv(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),e[r]=l,n[Cg(r)]=r,n[Cg(l.attribute)]=r}return new Gc(e,n,t.space)}const Hk=al({properties:{ariaActiveDescendant:null,ariaAtomic:pn,ariaAutoComplete:null,ariaBusy:pn,ariaChecked:pn,ariaColCount:Pe,ariaColIndex:Pe,ariaColSpan:Pe,ariaControls:Vt,ariaCurrent:null,ariaDescribedBy:Vt,ariaDetails:null,ariaDisabled:pn,ariaDropEffect:Vt,ariaErrorMessage:null,ariaExpanded:pn,ariaFlowTo:Vt,ariaGrabbed:pn,ariaHasPopup:null,ariaHidden:pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vt,ariaLevel:Pe,ariaLive:null,ariaModal:pn,ariaMultiLine:pn,ariaMultiSelectable:pn,ariaOrientation:null,ariaOwns:Vt,ariaPlaceholder:null,ariaPosInSet:Pe,ariaPressed:pn,ariaReadOnly:pn,ariaRelevant:null,ariaRequired:pn,ariaRoleDescription:Vt,ariaRowCount:Pe,ariaRowIndex:Pe,ariaRowSpan:Pe,ariaSelected:pn,ariaSetSize:Pe,ariaSort:null,ariaValueMax:Pe,ariaValueMin:Pe,ariaValueNow:Pe,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function $k(t,e){return e in t?t[e]:e}function Uk(t,e){return $k(t,e.toLowerCase())}const i7=al({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$a,acceptCharset:Vt,accessKey:Vt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Vt,autoFocus:dt,autoPlay:dt,blocking:Vt,capture:null,charSet:null,checked:dt,cite:null,className:Vt,cols:Pe,colSpan:null,content:null,contentEditable:pn,controls:dt,controlsList:Vt,coords:Pe|$a,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:kg,draggable:pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Vt,height:Pe,hidden:kg,high:Pe,href:null,hrefLang:null,htmlFor:Vt,httpEquiv:Vt,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Vt,itemRef:Vt,itemScope:dt,itemType:Vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:Pe,manifest:null,max:null,maxLength:Pe,media:null,method:null,min:null,minLength:Pe,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,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:dt,optimum:Pe,pattern:null,ping:Vt,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Vt,required:dt,reversed:dt,rows:Pe,rowSpan:Pe,sandbox:Vt,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:Pe,sizes:null,slot:null,span:Pe,spellCheck:pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pe,step:null,style:null,tabIndex:Pe,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:pn,width:Pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Vt,axis:null,background:null,bgColor:null,border:Pe,borderColor:null,bottomMargin:Pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:Pe,leftMargin:Pe,link:null,longDesc:null,lowSrc:null,marginHeight:Pe,marginWidth:Pe,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:Pe,rules:null,scheme:null,scrolling:pn,standby:null,summary:null,text:null,topMargin:Pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:Pe,security:null,unselectable:null},space:"html",transform:Uk}),o7=al({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:xr,accentHeight:Pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pe,amplitude:Pe,arabicForm:null,ascent:Pe,attributeName:null,attributeType:null,azimuth:Pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pe,by:null,calcMode:null,capHeight:Pe,className:Vt,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:Pe,diffuseConstant:Pe,direction:null,display:null,dur:null,divisor:Pe,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pe,enableBackground:null,end:null,event:null,exponent:Pe,externalResourcesRequired:null,fill:null,fillOpacity:Pe,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:$a,g2:$a,glyphName:$a,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pe,horizOriginX:Pe,horizOriginY:Pe,id:null,ideographic:Pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pe,k:Pe,k1:Pe,k2:Pe,k3:Pe,k4:Pe,kernelMatrix:xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pe,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:Pe,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:Pe,overlineThickness:Pe,paintOrder:null,panose1:null,path:null,pathLength:Pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pe,pointsAtY:Pe,pointsAtZ:Pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xr,rev:xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xr,requiredFeatures:xr,requiredFonts:xr,requiredFormats:xr,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:Pe,specularExponent:Pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pe,strikethroughThickness:Pe,string:null,stroke:null,strokeDashArray:xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pe,strokeOpacity:Pe,strokeWidth:null,style:null,surfaceScale:Pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xr,tabIndex:Pe,tableValues:null,target:null,targetX:Pe,targetY:Pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pe,underlineThickness:Pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pe,values:null,vAlphabetic:Pe,vMathematical:Pe,vectorEffect:null,vHanging:Pe,vIdeographic:Pe,version:null,vertAdvY:Pe,vertOriginX:Pe,vertOriginY:Pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$k}),Vk=al({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),qk=al({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Uk}),Wk=al({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),a7={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"},l7=/[A-Z]/g,Xx=/-[a-z]/g,c7=/^data[-\w.:]+$/i;function u7(t,e){const n=Cg(e);let r=e,i=ar;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&c7.test(e)){if(e.charAt(4)==="-"){const l=e.slice(5).replace(Xx,f7);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=e.slice(4);if(!Xx.test(l)){let c=l.replace(l7,d7);c.charAt(0)!=="-"&&(c="-"+c),e="data"+c}}i=Tv}return new i(r,e)}function d7(t){return"-"+t.toLowerCase()}function f7(t){return t.charAt(1).toUpperCase()}const h7=Fk([Hk,i7,Vk,qk,Wk],"html"),Dv=Fk([Hk,o7,Vk,qk,Wk],"svg");function p7(t){return t.join(" ").trim()}var Da={},Mm,Qx;function m7(){if(Qx)return Mm;Qx=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
572
+ `,d="/",m="*",p="",g="comment",_="declaration";function C(y,S){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];S=S||{};var b=1,x=1;function k(q){var G=q.match(e);G&&(b+=G.length);var W=q.lastIndexOf(u);x=~W?q.length-W:x+q.length}function j(){var q={line:b,column:x};return function(G){return G.position=new N(q),O(),G}}function N(q){this.start=q,this.end={line:b,column:x},this.source=S.source}N.prototype.content=y;function D(q){var G=new Error(S.source+":"+b+":"+x+": "+q);if(G.reason=q,G.filename=S.source,G.line=b,G.column=x,G.source=y,!S.silent)throw G}function E(q){var G=q.exec(y);if(G){var W=G[0];return k(W),y=y.slice(W.length),G}}function O(){E(n)}function L(q){var G;for(q=q||[];G=z();)G!==!1&&q.push(G);return q}function z(){var q=j();if(!(d!=y.charAt(0)||m!=y.charAt(1))){for(var G=2;p!=y.charAt(G)&&(m!=y.charAt(G)||d!=y.charAt(G+1));)++G;if(G+=2,p===y.charAt(G-1))return D("End of comment missing");var W=y.slice(2,G-2);return x+=2,k(W),y=y.slice(G),x+=2,q({type:g,comment:W})}}function H(){var q=j(),G=E(r);if(G){if(z(),!E(i))return D("property missing ':'");var W=E(l),X=q({type:_,property:w(G[0].replace(t,p)),value:W?w(W[0].replace(t,p)):p});return E(c),X}}function $(){var q=[];L(q);for(var G;G=H();)G!==!1&&(q.push(G),L(q));return q}return O(),$()}function w(y){return y?y.replace(a,p):p}return Mm=C,Mm}var Zx;function g7(){if(Zx)return Da;Zx=1;var t=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0}),Da.default=n;const e=t(m7());function n(r,i){let l=null;if(!r||typeof r!="string")return l;const c=(0,e.default)(r),a=typeof i=="function";return c.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:m}=u;a?i(d,m,u):m&&(l=l||{},l[d]=m)}),l}return Da}var lc={},Jx;function v7(){if(Jx)return lc;Jx=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(d){return!d||n.test(d)||t.test(d)},c=function(d,m){return m.toUpperCase()},a=function(d,m){return"".concat(m,"-")},u=function(d,m){return m===void 0&&(m={}),l(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(i,a):d=d.replace(r,a),d.replace(e,c))};return lc.camelCase=u,lc}var cc,e_;function y7(){if(e_)return cc;e_=1;var t=cc&&cc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(g7()),n=v7();function r(i,l){var c={};return!i||typeof i!="string"||(0,e.default)(i,function(a,u){a&&u&&(c[(0,n.camelCase)(a,l)]=u)}),c}return r.default=r,cc=r,cc}var b7=y7();const x7=rf(b7),Gk=Kk("end"),Mv=Kk("start");function Kk(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function _7(t){const e=Mv(t),n=Gk(t);if(e&&n)return{start:e,end:n}}function mc(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?t_(t.position):"start"in t||"end"in t?t_(t):"line"in t||"column"in t?Ag(t):""}function Ag(t){return n_(t&&t.line)+":"+n_(t&&t.column)}function t_(t){return Ag(t&&t.start)+"-"+Ag(t&&t.end)}function n_(t){return t&&typeof t=="number"?t:1}class qn extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},c=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof e=="string"?i=e:!l.cause&&e&&(c=!0,i=e.message,l.cause=e),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=mc(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=c&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qn.prototype.file="";qn.prototype.name="";qn.prototype.reason="";qn.prototype.message="";qn.prototype.stack="";qn.prototype.column=void 0;qn.prototype.line=void 0;qn.prototype.ancestors=void 0;qn.prototype.cause=void 0;qn.prototype.fatal=void 0;qn.prototype.place=void 0;qn.prototype.ruleId=void 0;qn.prototype.source=void 0;const Ov={}.hasOwnProperty,S7=new Map,w7=/[A-Z]/g,C7=new Set(["table","tbody","thead","tfoot","tr"]),k7=new Set(["td","th"]),Yk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function E7(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=O7(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=M7(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Dv:h7,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},l=Xk(i,t,void 0);return l&&typeof l!="string"?l:i.create(t,i.Fragment,{children:l||void 0},void 0)}function Xk(t,e,n){if(e.type==="element")return A7(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return N7(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return j7(t,e,n);if(e.type==="mdxjsEsm")return R7(t,e);if(e.type==="root")return T7(t,e,n);if(e.type==="text")return D7(t,e)}function A7(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Dv,t.schema=i),t.ancestors.push(e);const l=Zk(t,e.tagName,!1),c=L7(t,e);let a=Iv(t,e);return C7.has(e.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!r7(u):!0})),Qk(t,c,l,e),Lv(c,a),t.ancestors.pop(),t.schema=r,t.create(e,l,c,n)}function N7(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}jc(t,e.position)}function R7(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);jc(t,e.position)}function j7(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Dv,t.schema=i),t.ancestors.push(e);const l=e.name===null?t.Fragment:Zk(t,e.name,!0),c=I7(t,e),a=Iv(t,e);return Qk(t,c,l,e),Lv(c,a),t.ancestors.pop(),t.schema=r,t.create(e,l,c,n)}function T7(t,e,n){const r={};return Lv(r,Iv(t,e)),t.create(e,t.Fragment,r,n)}function D7(t,e){return e.value}function Qk(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Lv(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function M7(t,e,n){return r;function r(i,l,c,a){const d=Array.isArray(c.children)?n:e;return a?d(l,c,a):d(l,c)}}function O7(t,e){return n;function n(r,i,l,c){const a=Array.isArray(l.children),u=Mv(r);return e(i,l,c,a,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function L7(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Ov.call(e.properties,i)){const l=P7(t,i,e.properties[i]);if(l){const[c,a]=l;t.tableCellAlignToStyle&&c==="align"&&typeof a=="string"&&k7.has(e.tagName)?r=a:n[c]=a}}if(r){const l=n.style||(n.style={});l[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function I7(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];l.type;const c=l.expression;c.type;const a=c.properties[0];a.type,Object.assign(n,t.evaluater.evaluateExpression(a.argument))}else jc(t,e.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const a=r.value.data.estree.body[0];a.type,l=t.evaluater.evaluateExpression(a.expression)}else jc(t,e.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Iv(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:S7;for(;++r<e.children.length;){const l=e.children[r];let c;if(t.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const d=i.get(u)||0;c=u+"-"+d,i.set(u,d+1)}}const a=Xk(t,l,c);a!==void 0&&n.push(a)}return n}function P7(t,e,n){const r=u7(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ZL(n):p7(n)),r.property==="style"){let i=typeof n=="object"?n:z7(t,String(n));return t.stylePropertyNameCase==="css"&&(i=B7(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?a7[r.property]||r.property:r.attribute,n]}}function z7(t,e){try{return x7(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new qn("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Yk+"#cannot-parse-style-attribute",i}}function Zk(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let l=-1,c;for(;++l<i.length;){const a=Gx(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};c=c?{type:"MemberExpression",object:c,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=c}else r=Gx(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return Ov.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);jc(t)}function jc(t,e){const n=new qn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=Yk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function B7(t){const e={};let n;for(n in t)Ov.call(t,n)&&(e[F7(n)]=t[n]);return e}function F7(t){let e=t.replace(w7,H7);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function H7(t){return"-"+t.toLowerCase()}const Om={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"]},$7={};function Pv(t,e){const n=$7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Jk(t,r,i)}function Jk(t,e,n){if(U7(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return r_(t.children,e,n)}return Array.isArray(t)?r_(t,e,n):""}function r_(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Jk(t[i],e,n);return r.join("")}function U7(t){return!!(t&&typeof t=="object")}const s_=document.createElement("i");function zv(t){const e="&"+t+";";s_.innerHTML=e;const n=s_.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Cr(t,e,n,r){const i=t.length;let l=0,c;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)c=Array.from(r),c.unshift(e,n),t.splice(...c);else for(n&&t.splice(e,n);l<r.length;)c=r.slice(l,l+1e4),c.unshift(e,0),t.splice(...c),l+=1e4,e+=1e4}function zr(t,e){return t.length>0?(Cr(t,t.length,0,e),t):e}const i_={}.hasOwnProperty;function eE(t){const e={};let n=-1;for(;++n<t.length;)V7(e,t[n]);return e}function V7(t,e){let n;for(n in e){const i=(i_.call(t,n)?t[n]:void 0)||(t[n]={}),l=e[n];let c;if(l)for(c in l){i_.call(i,c)||(i[c]=[]);const a=l[c];q7(i[c],Array.isArray(a)?a:a?[a]:[])}}}function q7(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Cr(t,0,0,r)}function tE(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Zr(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yn=Zi(/[A-Za-z]/),Un=Zi(/[\dA-Za-z]/),W7=Zi(/[#-'*+\--9=?A-Z^-~]/);function Zd(t){return t!==null&&(t<32||t===127)}const Ng=Zi(/\d/),G7=Zi(/[\dA-Fa-f]/),K7=Zi(/[!-/:-@[-`{-~]/);function st(t){return t!==null&&t<-2}function Ut(t){return t!==null&&(t<0||t===32)}function vt(t){return t===-2||t===-1||t===32}const qf=Zi(new RegExp("\\p{P}|\\p{S}","u")),zo=Zi(/\s/);function Zi(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function ll(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const l=t.charCodeAt(n);let c="";if(l===37&&Un(t.charCodeAt(n+1))&&Un(t.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const a=t.charCodeAt(n+1);l<56320&&a>56319&&a<57344?(c=String.fromCharCode(l,a),i=1):c="�"}else c=String.fromCharCode(l);c&&(e.push(t.slice(r,n),encodeURIComponent(c)),r=n+i+1,c=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Ct(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(u){return vt(u)?(t.enter(n),a(u)):e(u)}function a(u){return vt(u)&&l++<i?(t.consume(u),a):(t.exit(n),e(u))}}const Y7={tokenize:X7};function X7(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Ct(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),l(a)}function l(a){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,c(a)}function c(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return st(a)?(t.consume(a),t.exit("chunkText"),l):(t.consume(a),c)}}const Q7={tokenize:Z7},o_={tokenize:J7};function Z7(t){const e=this,n=[];let r=0,i,l,c;return a;function a(x){if(r<n.length){const k=n[r];return e.containerState=k[1],t.attempt(k[0].continuation,u,d)(x)}return d(x)}function u(x){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&b();const k=e.events.length;let j=k,N;for(;j--;)if(e.events[j][0]==="exit"&&e.events[j][1].type==="chunkFlow"){N=e.events[j][1].end;break}S(r);let D=k;for(;D<e.events.length;)e.events[D][1].end={...N},D++;return Cr(e.events,j+1,0,e.events.slice(k)),e.events.length=D,d(x)}return a(x)}function d(x){if(r===n.length){if(!i)return g(x);if(i.currentConstruct&&i.currentConstruct.concrete)return C(x);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(o_,m,p)(x)}function m(x){return i&&b(),S(r),g(x)}function p(x){return e.parser.lazy[e.now().line]=r!==n.length,c=e.now().offset,C(x)}function g(x){return e.containerState={},t.attempt(o_,_,C)(x)}function _(x){return r++,n.push([e.currentConstruct,e.containerState]),g(x)}function C(x){if(x===null){i&&b(),S(0),t.consume(x);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),w(x)}function w(x){if(x===null){y(t.exit("chunkFlow"),!0),S(0),t.consume(x);return}return st(x)?(t.consume(x),y(t.exit("chunkFlow")),r=0,e.interrupt=void 0,a):(t.consume(x),w)}function y(x,k){const j=e.sliceStream(x);if(k&&j.push(null),x.previous=l,l&&(l.next=x),l=x,i.defineSkip(x.start),i.write(j),e.parser.lazy[x.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<c&&(!i.events[N][1].end||i.events[N][1].end.offset>c))return;const D=e.events.length;let E=D,O,L;for(;E--;)if(e.events[E][0]==="exit"&&e.events[E][1].type==="chunkFlow"){if(O){L=e.events[E][1].end;break}O=!0}for(S(r),N=D;N<e.events.length;)e.events[N][1].end={...L},N++;Cr(e.events,E+1,0,e.events.slice(D)),e.events.length=N}}function S(x){let k=n.length;for(;k-- >x;){const j=n[k];e.containerState=j[1],j[0].exit.call(e,t)}n.length=x}function b(){i.write([null]),l=void 0,i=void 0,e.containerState._closeFlow=void 0}}function J7(t,e,n){return Ct(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ka(t){if(t===null||Ut(t)||zo(t))return 1;if(qf(t))return 2}function Wf(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const l=t[i].resolveAll;l&&!r.includes(l)&&(e=l(e,n),r.push(l))}return e}const Rg={name:"attention",resolveAll:eI,tokenize:tI};function eI(t,e){let n=-1,r,i,l,c,a,u,d,m;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const p={...t[r][1].end},g={...t[n][1].start};a_(p,-u),a_(g,u),c={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...t[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},l={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...c.start},end:{...a.end}},t[r][1].end={...c.start},t[n][1].start={...a.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=zr(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=zr(d,[["enter",i,e],["enter",c,e],["exit",c,e],["enter",l,e]]),d=zr(d,Wf(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=zr(d,[["exit",l,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(m=2,d=zr(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):m=0,Cr(t,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function tI(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ka(r);let l;return c;function c(u){return l=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===l)return t.consume(u),a;const d=t.exit("attentionSequence"),m=Ka(u),p=!m||m===2&&i||n.includes(u),g=!i||i===2&&m||n.includes(r);return d._open=!!(l===42?p:p&&(i||!g)),d._close=!!(l===42?g:g&&(m||!p)),e(u)}}function a_(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const nI={name:"autolink",tokenize:rI};function rI(t,e,n){let r=0;return i;function i(_){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(_),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),l}function l(_){return Yn(_)?(t.consume(_),c):_===64?n(_):d(_)}function c(_){return _===43||_===45||_===46||Un(_)?(r=1,a(_)):d(_)}function a(_){return _===58?(t.consume(_),r=0,u):(_===43||_===45||_===46||Un(_))&&r++<32?(t.consume(_),a):(r=0,d(_))}function u(_){return _===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(_),t.exit("autolinkMarker"),t.exit("autolink"),e):_===null||_===32||_===60||Zd(_)?n(_):(t.consume(_),u)}function d(_){return _===64?(t.consume(_),m):W7(_)?(t.consume(_),d):n(_)}function m(_){return Un(_)?p(_):n(_)}function p(_){return _===46?(t.consume(_),r=0,m):_===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(_),t.exit("autolinkMarker"),t.exit("autolink"),e):g(_)}function g(_){if((_===45||Un(_))&&r++<63){const C=_===45?g:p;return t.consume(_),C}return n(_)}}const Kc={partial:!0,tokenize:sI};function sI(t,e,n){return r;function r(l){return vt(l)?Ct(t,i,"linePrefix")(l):i(l)}function i(l){return l===null||st(l)?e(l):n(l)}}const nE={continuation:{tokenize:oI},exit:aI,name:"blockQuote",tokenize:iI};function iI(t,e,n){const r=this;return i;function i(c){if(c===62){const a=r.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(c),t.exit("blockQuoteMarker"),l}return n(c)}function l(c){return vt(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(c))}}function oI(t,e,n){const r=this;return i;function i(c){return vt(c)?Ct(t,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return t.attempt(nE,e,n)(c)}}function aI(t){t.exit("blockQuote")}const rE={name:"characterEscape",tokenize:lI};function lI(t,e,n){return r;function r(l){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(l),t.exit("escapeMarker"),i}function i(l){return K7(l)?(t.enter("characterEscapeValue"),t.consume(l),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(l)}}const sE={name:"characterReference",tokenize:cI};function cI(t,e,n){const r=this;let i=0,l,c;return a;function a(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),u}function u(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),d):(t.enter("characterReferenceValue"),l=31,c=Un,m(p))}function d(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),l=6,c=G7,m):(t.enter("characterReferenceValue"),l=7,c=Ng,m(p))}function m(p){if(p===59&&i){const g=t.exit("characterReferenceValue");return c===Un&&!zv(r.sliceSerialize(g))?n(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return c(p)&&i++<l?(t.consume(p),m):n(p)}}const l_={partial:!0,tokenize:dI},c_={concrete:!0,name:"codeFenced",tokenize:uI};function uI(t,e,n){const r=this,i={partial:!0,tokenize:j};let l=0,c=0,a;return u;function u(N){return d(N)}function d(N){const D=r.events[r.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,a=N,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),m(N)}function m(N){return N===a?(c++,t.consume(N),m):c<3?n(N):(t.exit("codeFencedFenceSequence"),vt(N)?Ct(t,p,"whitespace")(N):p(N))}function p(N){return N===null||st(N)?(t.exit("codeFencedFence"),r.interrupt?e(N):t.check(l_,w,k)(N)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||st(N)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(N)):vt(N)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ct(t,_,"whitespace")(N)):N===96&&N===a?n(N):(t.consume(N),g)}function _(N){return N===null||st(N)?p(N):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),C(N))}function C(N){return N===null||st(N)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(N)):N===96&&N===a?n(N):(t.consume(N),C)}function w(N){return t.attempt(i,k,y)(N)}function y(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),S}function S(N){return l>0&&vt(N)?Ct(t,b,"linePrefix",l+1)(N):b(N)}function b(N){return N===null||st(N)?t.check(l_,w,k)(N):(t.enter("codeFlowValue"),x(N))}function x(N){return N===null||st(N)?(t.exit("codeFlowValue"),b(N)):(t.consume(N),x)}function k(N){return t.exit("codeFenced"),e(N)}function j(N,D,E){let O=0;return L;function L(G){return N.enter("lineEnding"),N.consume(G),N.exit("lineEnding"),z}function z(G){return N.enter("codeFencedFence"),vt(G)?Ct(N,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):H(G)}function H(G){return G===a?(N.enter("codeFencedFenceSequence"),$(G)):E(G)}function $(G){return G===a?(O++,N.consume(G),$):O>=c?(N.exit("codeFencedFenceSequence"),vt(G)?Ct(N,q,"whitespace")(G):q(G)):E(G)}function q(G){return G===null||st(G)?(N.exit("codeFencedFence"),D(G)):E(G)}}}function dI(t,e,n){const r=this;return i;function i(c){return c===null?n(c):(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l)}function l(c){return r.parser.lazy[r.now().line]?n(c):e(c)}}const Lm={name:"codeIndented",tokenize:hI},fI={partial:!0,tokenize:pI};function hI(t,e,n){const r=this;return i;function i(d){return t.enter("codeIndented"),Ct(t,l,"linePrefix",5)(d)}function l(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?c(d):n(d)}function c(d){return d===null?u(d):st(d)?t.attempt(fI,c,u)(d):(t.enter("codeFlowValue"),a(d))}function a(d){return d===null||st(d)?(t.exit("codeFlowValue"),c(d)):(t.consume(d),a)}function u(d){return t.exit("codeIndented"),e(d)}}function pI(t,e,n){const r=this;return i;function i(c){return r.parser.lazy[r.now().line]?n(c):st(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),i):Ct(t,l,"linePrefix",5)(c)}function l(c){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(c):st(c)?i(c):n(c)}}const mI={name:"codeText",previous:vI,resolve:gI,tokenize:yI};function gI(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function vI(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yI(t,e,n){let r=0,i,l;return c;function c(p){return t.enter("codeText"),t.enter("codeTextSequence"),a(p)}function a(p){return p===96?(t.consume(p),r++,a):(t.exit("codeTextSequence"),u(p))}function u(p){return p===null?n(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),u):p===96?(l=t.enter("codeTextSequence"),i=0,m(p)):st(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),u):(t.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||st(p)?(t.exit("codeTextData"),u(p)):(t.consume(p),d)}function m(p){return p===96?(t.consume(p),i++,m):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(l.type="codeTextData",d(p))}}class bI{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n==null?Number.POSITIVE_INFINITY:n;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&uc(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),uc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),uc(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);uc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);uc(this.left,n.reverse())}}}function uc(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function iE(t){const e={};let n=-1,r,i,l,c,a,u,d;const m=new bI(t);for(;++n<m.length;){for(;n in e;)n=e[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,xI(m,n)),n=e[n],d=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(c=m.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),c[1].type="lineEnding",i=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},a=m.slice(i,n),a.unshift(r),m.splice(i,n-i+1,a))}}return Cr(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function xI(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const l=[];let c=n._tokenizer;c||(c=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const a=c.events,u=[],d={};let m,p,g=-1,_=n,C=0,w=0;const y=[w];for(;_;){for(;t.get(++i)[1]!==_;);l.push(i),_._tokenizer||(m=r.sliceStream(_),_.next||m.push(null),p&&c.defineSkip(_.start),_._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(m),_._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),p=_,_=_.next}for(_=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(w=g+1,y.push(w),_._tokenizer=void 0,_.previous=void 0,_=_.next);for(c.events=[],_?(_._tokenizer=void 0,_.previous=void 0):y.pop(),g=y.length;g--;){const S=a.slice(y[g],y[g+1]),b=l.pop();u.push([b,b+S.length-1]),t.splice(b,2,S)}for(u.reverse(),g=-1;++g<u.length;)d[C+u[g][0]]=C+u[g][1],C+=u[g][1]-u[g][0]-1;return d}const _I={resolve:wI,tokenize:CI},SI={partial:!0,tokenize:kI};function wI(t){return iE(t),t}function CI(t,e){let n;return r;function r(a){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):st(a)?t.check(SI,c,l)(a):(t.consume(a),i)}function l(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function c(a){return t.consume(a),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function kI(t,e,n){const r=this;return i;function i(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),Ct(t,l,"linePrefix")}function l(c){if(c===null||st(c))return n(c);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(c):t.interrupt(r.parser.constructs.flow,n,e)(c)}}function oE(t,e,n,r,i,l,c,a,u){const d=u||Number.POSITIVE_INFINITY;let m=0;return p;function p(S){return S===60?(t.enter(r),t.enter(i),t.enter(l),t.consume(S),t.exit(l),g):S===null||S===32||S===41||Zd(S)?n(S):(t.enter(r),t.enter(c),t.enter(a),t.enter("chunkString",{contentType:"string"}),w(S))}function g(S){return S===62?(t.enter(l),t.consume(S),t.exit(l),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),_(S))}function _(S){return S===62?(t.exit("chunkString"),t.exit(a),g(S)):S===null||S===60||st(S)?n(S):(t.consume(S),S===92?C:_)}function C(S){return S===60||S===62||S===92?(t.consume(S),_):_(S)}function w(S){return!m&&(S===null||S===41||Ut(S))?(t.exit("chunkString"),t.exit(a),t.exit(c),t.exit(r),e(S)):m<d&&S===40?(t.consume(S),m++,w):S===41?(t.consume(S),m--,w):S===null||S===32||S===40||Zd(S)?n(S):(t.consume(S),S===92?y:w)}function y(S){return S===40||S===41||S===92?(t.consume(S),w):w(S)}}function aE(t,e,n,r,i,l){const c=this;let a=0,u;return d;function d(_){return t.enter(r),t.enter(i),t.consume(_),t.exit(i),t.enter(l),m}function m(_){return a>999||_===null||_===91||_===93&&!u||_===94&&!a&&"_hiddenFootnoteSupport"in c.parser.constructs?n(_):_===93?(t.exit(l),t.enter(i),t.consume(_),t.exit(i),t.exit(r),e):st(_)?(t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||_===91||_===93||st(_)||a++>999?(t.exit("chunkString"),m(_)):(t.consume(_),u||(u=!vt(_)),_===92?g:p)}function g(_){return _===91||_===92||_===93?(t.consume(_),a++,p):p(_)}}function lE(t,e,n,r,i,l){let c;return a;function a(g){return g===34||g===39||g===40?(t.enter(r),t.enter(i),t.consume(g),t.exit(i),c=g===40?41:g,u):n(g)}function u(g){return g===c?(t.enter(i),t.consume(g),t.exit(i),t.exit(r),e):(t.enter(l),d(g))}function d(g){return g===c?(t.exit(l),u(c)):g===null?n(g):st(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),Ct(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===c||g===null||st(g)?(t.exit("chunkString"),d(g)):(t.consume(g),g===92?p:m)}function p(g){return g===c||g===92?(t.consume(g),m):m(g)}}function gc(t,e){let n;return r;function r(i){return st(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):vt(i)?Ct(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const EI={name:"definition",tokenize:NI},AI={partial:!0,tokenize:RI};function NI(t,e,n){const r=this;let i;return l;function l(_){return t.enter("definition"),c(_)}function c(_){return aE.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(_)}function a(_){return i=Zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),_===58?(t.enter("definitionMarker"),t.consume(_),t.exit("definitionMarker"),u):n(_)}function u(_){return Ut(_)?gc(t,d)(_):d(_)}function d(_){return oE(t,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(_)}function m(_){return t.attempt(AI,p,p)(_)}function p(_){return vt(_)?Ct(t,g,"whitespace")(_):g(_)}function g(_){return _===null||st(_)?(t.exit("definition"),r.parser.defined.push(i),e(_)):n(_)}}function RI(t,e,n){return r;function r(a){return Ut(a)?gc(t,i)(a):n(a)}function i(a){return lE(t,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return vt(a)?Ct(t,c,"whitespace")(a):c(a)}function c(a){return a===null||st(a)?e(a):n(a)}}const jI={name:"hardBreakEscape",tokenize:TI};function TI(t,e,n){return r;function r(l){return t.enter("hardBreakEscape"),t.consume(l),i}function i(l){return st(l)?(t.exit("hardBreakEscape"),e(l)):n(l)}}const DI={name:"headingAtx",resolve:MI,tokenize:OI};function MI(t,e){let n=t.length-2,r=3,i,l;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},l={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Cr(t,r,n-r+1,[["enter",i,e],["enter",l,e],["exit",l,e],["exit",i,e]])),t}function OI(t,e,n){let r=0;return i;function i(m){return t.enter("atxHeading"),l(m)}function l(m){return t.enter("atxHeadingSequence"),c(m)}function c(m){return m===35&&r++<6?(t.consume(m),c):m===null||Ut(m)?(t.exit("atxHeadingSequence"),a(m)):n(m)}function a(m){return m===35?(t.enter("atxHeadingSequence"),u(m)):m===null||st(m)?(t.exit("atxHeading"),e(m)):vt(m)?Ct(t,a,"whitespace")(m):(t.enter("atxHeadingText"),d(m))}function u(m){return m===35?(t.consume(m),u):(t.exit("atxHeadingSequence"),a(m))}function d(m){return m===null||m===35||Ut(m)?(t.exit("atxHeadingText"),a(m)):(t.consume(m),d)}}const LI=["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"],u_=["pre","script","style","textarea"],II={concrete:!0,name:"htmlFlow",resolveTo:BI,tokenize:FI},PI={partial:!0,tokenize:$I},zI={partial:!0,tokenize:HI};function BI(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function FI(t,e,n){const r=this;let i,l,c,a,u;return d;function d(B){return m(B)}function m(B){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(B),p}function p(B){return B===33?(t.consume(B),g):B===47?(t.consume(B),l=!0,w):B===63?(t.consume(B),i=3,r.interrupt?e:M):Yn(B)?(t.consume(B),c=String.fromCharCode(B),y):n(B)}function g(B){return B===45?(t.consume(B),i=2,_):B===91?(t.consume(B),i=5,a=0,C):Yn(B)?(t.consume(B),i=4,r.interrupt?e:M):n(B)}function _(B){return B===45?(t.consume(B),r.interrupt?e:M):n(B)}function C(B){const Q="CDATA[";return B===Q.charCodeAt(a++)?(t.consume(B),a===Q.length?r.interrupt?e:H:C):n(B)}function w(B){return Yn(B)?(t.consume(B),c=String.fromCharCode(B),y):n(B)}function y(B){if(B===null||B===47||B===62||Ut(B)){const Q=B===47,J=c.toLowerCase();return!Q&&!l&&u_.includes(J)?(i=1,r.interrupt?e(B):H(B)):LI.includes(c.toLowerCase())?(i=6,Q?(t.consume(B),S):r.interrupt?e(B):H(B)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):l?b(B):x(B))}return B===45||Un(B)?(t.consume(B),c+=String.fromCharCode(B),y):n(B)}function S(B){return B===62?(t.consume(B),r.interrupt?e:H):n(B)}function b(B){return vt(B)?(t.consume(B),b):L(B)}function x(B){return B===47?(t.consume(B),L):B===58||B===95||Yn(B)?(t.consume(B),k):vt(B)?(t.consume(B),x):L(B)}function k(B){return B===45||B===46||B===58||B===95||Un(B)?(t.consume(B),k):j(B)}function j(B){return B===61?(t.consume(B),N):vt(B)?(t.consume(B),j):x(B)}function N(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(t.consume(B),u=B,D):vt(B)?(t.consume(B),N):E(B)}function D(B){return B===u?(t.consume(B),u=null,O):B===null||st(B)?n(B):(t.consume(B),D)}function E(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||Ut(B)?j(B):(t.consume(B),E)}function O(B){return B===47||B===62||vt(B)?x(B):n(B)}function L(B){return B===62?(t.consume(B),z):n(B)}function z(B){return B===null||st(B)?H(B):vt(B)?(t.consume(B),z):n(B)}function H(B){return B===45&&i===2?(t.consume(B),W):B===60&&i===1?(t.consume(B),X):B===62&&i===4?(t.consume(B),P):B===63&&i===3?(t.consume(B),M):B===93&&i===5?(t.consume(B),I):st(B)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(PI,F,$)(B)):B===null||st(B)?(t.exit("htmlFlowData"),$(B)):(t.consume(B),H)}function $(B){return t.check(zI,q,F)(B)}function q(B){return t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),G}function G(B){return B===null||st(B)?$(B):(t.enter("htmlFlowData"),H(B))}function W(B){return B===45?(t.consume(B),M):H(B)}function X(B){return B===47?(t.consume(B),c="",Y):H(B)}function Y(B){if(B===62){const Q=c.toLowerCase();return u_.includes(Q)?(t.consume(B),P):H(B)}return Yn(B)&&c.length<8?(t.consume(B),c+=String.fromCharCode(B),Y):H(B)}function I(B){return B===93?(t.consume(B),M):H(B)}function M(B){return B===62?(t.consume(B),P):B===45&&i===2?(t.consume(B),M):H(B)}function P(B){return B===null||st(B)?(t.exit("htmlFlowData"),F(B)):(t.consume(B),P)}function F(B){return t.exit("htmlFlow"),e(B)}}function HI(t,e,n){const r=this;return i;function i(c){return st(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l):n(c)}function l(c){return r.parser.lazy[r.now().line]?n(c):e(c)}}function $I(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Kc,e,n)}}const UI={name:"htmlText",tokenize:VI};function VI(t,e,n){const r=this;let i,l,c;return a;function a(M){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(M),u}function u(M){return M===33?(t.consume(M),d):M===47?(t.consume(M),j):M===63?(t.consume(M),x):Yn(M)?(t.consume(M),E):n(M)}function d(M){return M===45?(t.consume(M),m):M===91?(t.consume(M),l=0,C):Yn(M)?(t.consume(M),b):n(M)}function m(M){return M===45?(t.consume(M),_):n(M)}function p(M){return M===null?n(M):M===45?(t.consume(M),g):st(M)?(c=p,X(M)):(t.consume(M),p)}function g(M){return M===45?(t.consume(M),_):p(M)}function _(M){return M===62?W(M):M===45?g(M):p(M)}function C(M){const P="CDATA[";return M===P.charCodeAt(l++)?(t.consume(M),l===P.length?w:C):n(M)}function w(M){return M===null?n(M):M===93?(t.consume(M),y):st(M)?(c=w,X(M)):(t.consume(M),w)}function y(M){return M===93?(t.consume(M),S):w(M)}function S(M){return M===62?W(M):M===93?(t.consume(M),S):w(M)}function b(M){return M===null||M===62?W(M):st(M)?(c=b,X(M)):(t.consume(M),b)}function x(M){return M===null?n(M):M===63?(t.consume(M),k):st(M)?(c=x,X(M)):(t.consume(M),x)}function k(M){return M===62?W(M):x(M)}function j(M){return Yn(M)?(t.consume(M),N):n(M)}function N(M){return M===45||Un(M)?(t.consume(M),N):D(M)}function D(M){return st(M)?(c=D,X(M)):vt(M)?(t.consume(M),D):W(M)}function E(M){return M===45||Un(M)?(t.consume(M),E):M===47||M===62||Ut(M)?O(M):n(M)}function O(M){return M===47?(t.consume(M),W):M===58||M===95||Yn(M)?(t.consume(M),L):st(M)?(c=O,X(M)):vt(M)?(t.consume(M),O):W(M)}function L(M){return M===45||M===46||M===58||M===95||Un(M)?(t.consume(M),L):z(M)}function z(M){return M===61?(t.consume(M),H):st(M)?(c=z,X(M)):vt(M)?(t.consume(M),z):O(M)}function H(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(t.consume(M),i=M,$):st(M)?(c=H,X(M)):vt(M)?(t.consume(M),H):(t.consume(M),q)}function $(M){return M===i?(t.consume(M),i=void 0,G):M===null?n(M):st(M)?(c=$,X(M)):(t.consume(M),$)}function q(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Ut(M)?O(M):(t.consume(M),q)}function G(M){return M===47||M===62||Ut(M)?O(M):n(M)}function W(M){return M===62?(t.consume(M),t.exit("htmlTextData"),t.exit("htmlText"),e):n(M)}function X(M){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),Y}function Y(M){return vt(M)?Ct(t,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):I(M)}function I(M){return t.enter("htmlTextData"),c(M)}}const Bv={name:"labelEnd",resolveAll:KI,resolveTo:YI,tokenize:XI},qI={tokenize:QI},WI={tokenize:ZI},GI={tokenize:JI};function KI(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&Cr(t,0,t.length,n),t}function YI(t,e){let n=t.length,r=0,i,l,c,a;for(;n--;)if(i=t[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(c){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(c=n);const u={type:t[l][1].type==="labelLink"?"link":"image",start:{...t[l][1].start},end:{...t[t.length-1][1].end}},d={type:"label",start:{...t[l][1].start},end:{...t[c][1].end}},m={type:"labelText",start:{...t[l+r+2][1].end},end:{...t[c-2][1].start}};return a=[["enter",u,e],["enter",d,e]],a=zr(a,t.slice(l+1,l+r+3)),a=zr(a,[["enter",m,e]]),a=zr(a,Wf(e.parser.constructs.insideSpan.null,t.slice(l+r+4,c-3),e)),a=zr(a,[["exit",m,e],t[c-2],t[c-1],["exit",d,e]]),a=zr(a,t.slice(c+1)),a=zr(a,[["exit",u,e]]),Cr(t,l,t.length,a),t}function XI(t,e,n){const r=this;let i=r.events.length,l,c;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(g){return l?l._inactive?p(g):(c=r.parser.defined.includes(Zr(r.sliceSerialize({start:l.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),u):n(g)}function u(g){return g===40?t.attempt(qI,m,c?m:p)(g):g===91?t.attempt(WI,m,c?d:p)(g):c?m(g):p(g)}function d(g){return t.attempt(GI,m,p)(g)}function m(g){return e(g)}function p(g){return l._balanced=!0,n(g)}}function QI(t,e,n){return r;function r(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),i}function i(p){return Ut(p)?gc(t,l)(p):l(p)}function l(p){return p===41?m(p):oE(t,c,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function c(p){return Ut(p)?gc(t,u)(p):m(p)}function a(p){return n(p)}function u(p){return p===34||p===39||p===40?lE(t,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function d(p){return Ut(p)?gc(t,m)(p):m(p)}function m(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):n(p)}}function ZI(t,e,n){const r=this;return i;function i(a){return aE.call(r,t,l,c,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(a):n(a)}function c(a){return n(a)}}function JI(t,e,n){return r;function r(l){return t.enter("reference"),t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),i}function i(l){return l===93?(t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),t.exit("reference"),e):n(l)}}const e9={name:"labelStartImage",resolveAll:Bv.resolveAll,tokenize:t9};function t9(t,e,n){const r=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),l}function l(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),c):n(a)}function c(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const n9={name:"labelStartLink",resolveAll:Bv.resolveAll,tokenize:r9};function r9(t,e,n){const r=this;return i;function i(c){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):e(c)}}const Im={name:"lineEnding",tokenize:s9};function s9(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Ct(t,e,"linePrefix")}}const Td={name:"thematicBreak",tokenize:i9};function i9(t,e,n){let r=0,i;return l;function l(d){return t.enter("thematicBreak"),c(d)}function c(d){return i=d,a(d)}function a(d){return d===i?(t.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||st(d))?(t.exit("thematicBreak"),e(d)):n(d)}function u(d){return d===i?(t.consume(d),r++,u):(t.exit("thematicBreakSequence"),vt(d)?Ct(t,a,"whitespace")(d):a(d))}}const ir={continuation:{tokenize:c9},exit:d9,name:"list",tokenize:l9},o9={partial:!0,tokenize:f9},a9={partial:!0,tokenize:u9};function l9(t,e,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,c=0;return a;function a(_){const C=r.containerState.type||(_===42||_===43||_===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||_===r.containerState.marker:Ng(_)){if(r.containerState.type||(r.containerState.type=C,t.enter(C,{_container:!0})),C==="listUnordered")return t.enter("listItemPrefix"),_===42||_===45?t.check(Td,n,d)(_):d(_);if(!r.interrupt||_===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(_)}return n(_)}function u(_){return Ng(_)&&++c<10?(t.consume(_),u):(!r.interrupt||c<2)&&(r.containerState.marker?_===r.containerState.marker:_===41||_===46)?(t.exit("listItemValue"),d(_)):n(_)}function d(_){return t.enter("listItemMarker"),t.consume(_),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||_,t.check(Kc,r.interrupt?n:m,t.attempt(o9,g,p))}function m(_){return r.containerState.initialBlankLine=!0,l++,g(_)}function p(_){return vt(_)?(t.enter("listItemPrefixWhitespace"),t.consume(_),t.exit("listItemPrefixWhitespace"),g):n(_)}function g(_){return r.containerState.size=l+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(_)}}function c9(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Kc,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ct(t,e,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!vt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(a9,e,c)(a))}function c(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ct(t,t.attempt(ir,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function u9(t,e,n){const r=this;return Ct(t,i,"listItemIndent",r.containerState.size+1);function i(l){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?e(l):n(l)}}function d9(t){t.exit(this.containerState.type)}function f9(t,e,n){const r=this;return Ct(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const c=r.events[r.events.length-1];return!vt(l)&&c&&c[1].type==="listItemPrefixWhitespace"?e(l):n(l)}}const d_={name:"setextUnderline",resolveTo:h9,tokenize:p9};function h9(t,e){let n=t.length,r,i,l;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!l&&t[n][1].type==="definition"&&(l=n);const c={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",l?(t.splice(i,0,["enter",c,e]),t.splice(l+1,0,["exit",t[r][1],e]),t[r][1].end={...t[l][1].end}):t[r][1]=c,t.push(["exit",c,e]),t}function p9(t,e,n){const r=this;let i;return l;function l(d){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(t.enter("setextHeadingLine"),i=d,c(d)):n(d)}function c(d){return t.enter("setextHeadingLineSequence"),a(d)}function a(d){return d===i?(t.consume(d),a):(t.exit("setextHeadingLineSequence"),vt(d)?Ct(t,u,"lineSuffix")(d):u(d))}function u(d){return d===null||st(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const m9={tokenize:g9};function g9(t){const e=this,n=t.attempt(Kc,r,t.attempt(this.parser.constructs.flowInitial,i,Ct(t,t.attempt(this.parser.constructs.flow,i,t.attempt(_I,i)),"linePrefix")));return n;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEndingBlank"),t.consume(l),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const v9={resolveAll:uE()},y9=cE("string"),b9=cE("text");function cE(t){return{resolveAll:uE(t==="text"?x9:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],l=n.attempt(i,c,a);return c;function c(m){return d(m)?l(m):a(m)}function a(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),u}function u(m){return d(m)?(n.exit("data"),l(m)):(n.consume(m),u)}function d(m){if(m===null)return!0;const p=i[m];let g=-1;if(p)for(;++g<p.length;){const _=p[g];if(!_.previous||_.previous.call(r,r.previous))return!0}return!1}}}function uE(t){return e;function e(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return t?t(n,r):n}}function x9(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let l=i.length,c=-1,a=0,u;for(;l--;){const d=i[l];if(typeof d=="string"){for(c=d.length;d.charCodeAt(c-1)===32;)a++,c--;if(c)break;c=-1}else if(d===-2)u=!0,a++;else if(d!==-1){l++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(a=0),a){const d={type:n===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:r.start._bufferIndex+c,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(t.splice(n,0,["enter",d,e],["exit",d,e]),n+=2)}n++}return t}const _9={42:ir,43:ir,45:ir,48:ir,49:ir,50:ir,51:ir,52:ir,53:ir,54:ir,55:ir,56:ir,57:ir,62:nE},S9={91:EI},w9={[-2]:Lm,[-1]:Lm,32:Lm},C9={35:DI,42:Td,45:[d_,Td],60:II,61:d_,95:Td,96:c_,126:c_},k9={38:sE,92:rE},E9={[-5]:Im,[-4]:Im,[-3]:Im,33:e9,38:sE,42:Rg,60:[nI,UI],91:n9,92:[jI,rE],93:Bv,95:Rg,96:mI},A9={null:[Rg,v9]},N9={null:[42,95]},R9={null:[]},j9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:N9,contentInitial:S9,disable:R9,document:_9,flow:C9,flowInitial:w9,insideSpan:A9,string:k9,text:E9},Symbol.toStringTag,{value:"Module"}));function T9(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let c=[],a=[];const u={attempt:D(j),check:D(N),consume:b,enter:x,exit:k,interrupt:D(N,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:C,parser:t,previous:null,sliceSerialize:g,sliceStream:_,write:p};let m=e.tokenize.call(d,u);return e.resolveAll&&l.push(e),d;function p(z){return c=zr(c,z),y(),c[c.length-1]!==null?[]:(E(e,0),d.events=Wf(l,d.events,d),d.events)}function g(z,H){return M9(_(z),H)}function _(z){return D9(c,z)}function C(){const{_bufferIndex:z,_index:H,line:$,column:q,offset:G}=r;return{_bufferIndex:z,_index:H,line:$,column:q,offset:G}}function w(z){i[z.line]=z.column,L()}function y(){let z;for(;r._index<c.length;){const H=c[r._index];if(typeof H=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<H.length;)S(H.charCodeAt(r._bufferIndex));else S(H)}}function S(z){m=m(z)}function b(z){st(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,L()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=z}function x(z,H){const $=H||{};return $.type=z,$.start=C(),d.events.push(["enter",$,d]),a.push($),$}function k(z){const H=a.pop();return H.end=C(),d.events.push(["exit",H,d]),H}function j(z,H){E(z,H.from)}function N(z,H){H.restore()}function D(z,H){return $;function $(q,G,W){let X,Y,I,M;return Array.isArray(q)?F(q):"tokenize"in q?F([q]):P(q);function P(ee){return K;function K(V){const te=V!==null&&ee[V],re=V!==null&&ee.null,ae=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(re)?re:re?[re]:[]];return F(ae)(V)}}function F(ee){return X=ee,Y=0,ee.length===0?W:B(ee[Y])}function B(ee){return K;function K(V){return M=O(),I=ee,ee.partial||(d.currentConstruct=ee),ee.name&&d.parser.constructs.disable.null.includes(ee.name)?J():ee.tokenize.call(H?Object.assign(Object.create(d),H):d,u,Q,J)(V)}}function Q(ee){return z(I,M),G}function J(ee){return M.restore(),++Y<X.length?B(X[Y]):W}}}function E(z,H){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&Cr(d.events,H,d.events.length-H,z.resolve(d.events.slice(H),d)),z.resolveTo&&(d.events=z.resolveTo(d.events,d))}function O(){const z=C(),H=d.previous,$=d.currentConstruct,q=d.events.length,G=Array.from(a);return{from:q,restore:W};function W(){r=z,d.previous=H,d.currentConstruct=$,d.events.length=q,a=G,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function D9(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,l=e.end._bufferIndex;let c;if(n===i)c=[t[n].slice(r,l)];else{if(c=t.slice(n,i),r>-1){const a=c[0];typeof a=="string"?c[0]=a.slice(r):c.shift()}l>0&&c.push(t[i].slice(0,l))}return c}function M9(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const l=t[n];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
573
+ `;break}case-3:{c=`\r
574
+ `;break}case-2:{c=e?" ":" ";break}case-1:{if(!e&&i)continue;c=" ";break}default:c=String.fromCharCode(l)}i=l===-2,r.push(c)}return r.join("")}function O9(t){const r={constructs:eE([j9,...(t||{}).extensions||[]]),content:i(Y7),defined:[],document:i(Q7),flow:i(m9),lazy:{},string:i(y9),text:i(b9)};return r;function i(l){return c;function c(a){return T9(r,l,a)}}}function L9(t){for(;!iE(t););return t}const f_=/[\0\t\n\r]/g;function I9(){let t=1,e="",n=!0,r;return i;function i(l,c,a){const u=[];let d,m,p,g,_;for(l=e+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),p=0,e="",n&&(l.charCodeAt(0)===65279&&p++,n=void 0);p<l.length;){if(f_.lastIndex=p,d=f_.exec(l),g=d&&d.index!==void 0?d.index:l.length,_=l.charCodeAt(g),!d){e=l.slice(p);break}if(_===10&&p===g&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<g&&(u.push(l.slice(p,g)),t+=g-p),_){case 0:{u.push(65533),t++;break}case 9:{for(m=Math.ceil(t/4)*4,u.push(-2);t++<m;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}p=g+1}return a&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const P9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function z9(t){return t.replace(P9,B9)}function B9(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return tE(n.slice(l?2:1),l?16:10)}return zv(n)||t}const dE={}.hasOwnProperty;function F9(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),H9(n)(L9(O9(n).document().write(I9()(t,e,!0))))}function H9(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(be),autolinkProtocol:O,autolinkEmail:O,atxHeading:l(De),blockQuote:l(re),characterEscape:O,characterReference:O,codeFenced:l(ae),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(ae,c),codeText:l(se,c),codeTextData:O,data:O,codeFlowValue:O,definition:l(_e),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(Ee),hardBreakEscape:l(Ue),hardBreakTrailing:l(Ue),htmlFlow:l(ce,c),htmlFlowData:O,htmlText:l(ce,c),htmlTextData:O,image:l(je),label:c,link:l(be),listItem:l(qe),listItemValue:g,listOrdered:l(Ve,p),listUnordered:l(Ve),paragraph:l(ye),reference:B,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(De),strong:l(Me),thematicBreak:l(we)},exit:{atxHeading:u(),atxHeadingSequence:j,autolink:u(),autolinkEmail:te,autolinkProtocol:V,blockQuote:u(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ee,characterReference:K,codeFenced:u(y),codeFencedFence:w,codeFencedFenceInfo:_,codeFencedFenceMeta:C,codeFlowValue:L,codeIndented:u(S),codeText:u(G),codeTextData:L,data:L,definition:u(),definitionDestinationString:k,definitionLabelString:b,definitionTitleString:x,emphasis:u(),hardBreakEscape:u(H),hardBreakTrailing:u(H),htmlFlow:u($),htmlFlowData:L,htmlText:u(q),htmlTextData:L,image:u(X),label:I,labelText:Y,lineEnding:z,link:u(W),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Q,resourceDestinationString:M,resourceTitleString:P,resource:F,setextHeading:u(E),setextHeadingLineSequence:D,setextHeadingText:N,strong:u(),thematicBreak:u()}};fE(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(oe){let me={type:"root",children:[]};const Ne={stack:[me],tokenStack:[],config:e,enter:a,exit:d,buffer:c,resume:m,data:n},Le=[];let Ge=-1;for(;++Ge<oe.length;)if(oe[Ge][1].type==="listOrdered"||oe[Ge][1].type==="listUnordered")if(oe[Ge][0]==="enter")Le.push(Ge);else{const Ke=Le.pop();Ge=i(oe,Ke,Ge)}for(Ge=-1;++Ge<oe.length;){const Ke=e[oe[Ge][0]];dE.call(Ke,oe[Ge][1].type)&&Ke[oe[Ge][1].type].call(Object.assign({sliceSerialize:oe[Ge][2].sliceSerialize},Ne),oe[Ge][1])}if(Ne.tokenStack.length>0){const Ke=Ne.tokenStack[Ne.tokenStack.length-1];(Ke[1]||h_).call(Ne,void 0,Ke[0])}for(me.position={start:Mi(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Mi(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<e.transforms.length;)me=e.transforms[Ge](me)||me;return me}function i(oe,me,Ne){let Le=me-1,Ge=-1,Ke=!1,Je,lt,Be,We;for(;++Le<=Ne;){const ze=oe[Le];switch(ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ze[0]==="enter"?Ge++:Ge--,We=void 0;break}case"lineEndingBlank":{ze[0]==="enter"&&(Je&&!We&&!Ge&&!Be&&(Be=Le),We=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:We=void 0}if(!Ge&&ze[0]==="enter"&&ze[1].type==="listItemPrefix"||Ge===-1&&ze[0]==="exit"&&(ze[1].type==="listUnordered"||ze[1].type==="listOrdered")){if(Je){let rt=Le;for(lt=void 0;rt--;){const kt=oe[rt];if(kt[1].type==="lineEnding"||kt[1].type==="lineEndingBlank"){if(kt[0]==="exit")continue;lt&&(oe[lt][1].type="lineEndingBlank",Ke=!0),kt[1].type="lineEnding",lt=rt}else if(!(kt[1].type==="linePrefix"||kt[1].type==="blockQuotePrefix"||kt[1].type==="blockQuotePrefixWhitespace"||kt[1].type==="blockQuoteMarker"||kt[1].type==="listItemIndent"))break}Be&&(!lt||Be<lt)&&(Je._spread=!0),Je.end=Object.assign({},lt?oe[lt][1].start:ze[1].end),oe.splice(lt||Le,0,["exit",Je,ze[2]]),Le++,Ne++}if(ze[1].type==="listItemPrefix"){const rt={type:"listItem",_spread:!1,start:Object.assign({},ze[1].start),end:void 0};Je=rt,oe.splice(Le,0,["enter",rt,ze[2]]),Le++,Ne++,Be=void 0,We=!0}}}return oe[me][1]._spread=Ke,Ne}function l(oe,me){return Ne;function Ne(Le){a.call(this,oe(Le),Le),me&&me.call(this,Le)}}function c(){this.stack.push({type:"fragment",children:[]})}function a(oe,me,Ne){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([me,Ne||void 0]),oe.position={start:Mi(me.start),end:void 0}}function u(oe){return me;function me(Ne){oe&&oe.call(this,Ne),d.call(this,Ne)}}function d(oe,me){const Ne=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==oe.type&&(me?me.call(this,oe,Le[0]):(Le[1]||h_).call(this,oe,Le[0]));else throw new Error("Cannot close `"+oe.type+"` ("+mc({start:oe.start,end:oe.end})+"): it’s not open");Ne.position.end=Mi(oe.end)}function m(){return Pv(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(oe){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function _(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.lang=oe}function C(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.meta=oe}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe.replace(/(\r?\n|\r)$/g,"")}function b(oe){const me=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=me,Ne.identifier=Zr(this.sliceSerialize(oe)).toLowerCase()}function x(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.title=oe}function k(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.url=oe}function j(oe){const me=this.stack[this.stack.length-1];if(!me.depth){const Ne=this.sliceSerialize(oe).length;me.depth=Ne}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function D(oe){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function O(oe){const Ne=this.stack[this.stack.length-1].children;let Le=Ne[Ne.length-1];(!Le||Le.type!=="text")&&(Le=Re(),Le.position={start:Mi(oe.start),end:void 0},Ne.push(Le)),this.stack.push(Le)}function L(oe){const me=this.stack.pop();me.value+=this.sliceSerialize(oe),me.position.end=Mi(oe.end)}function z(oe){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=me.children[me.children.length-1];Ne.position.end=Mi(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(me.type)&&(O.call(this,oe),L.call(this,oe))}function H(){this.data.atHardBreak=!0}function $(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function q(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function G(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function W(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=me,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function X(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=me,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Y(oe){const me=this.sliceSerialize(oe),Ne=this.stack[this.stack.length-2];Ne.label=z9(me),Ne.identifier=Zr(me).toLowerCase()}function I(){const oe=this.stack[this.stack.length-1],me=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const Le=oe.children;Ne.children=Le}else Ne.alt=me}function M(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.url=oe}function P(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.title=oe}function F(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function Q(oe){const me=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=me,Ne.identifier=Zr(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function J(oe){this.data.characterReferenceType=oe.type}function ee(oe){const me=this.sliceSerialize(oe),Ne=this.data.characterReferenceType;let Le;Ne?(Le=tE(me,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=zv(me);const Ge=this.stack[this.stack.length-1];Ge.value+=Le}function K(oe){const me=this.stack.pop();me.position.end=Mi(oe.end)}function V(oe){L.call(this,oe);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(oe)}function te(oe){L.call(this,oe);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(oe)}function re(){return{type:"blockquote",children:[]}}function ae(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function De(){return{type:"heading",depth:0,children:[]}}function Ue(){return{type:"break"}}function ce(){return{type:"html",value:""}}function je(){return{type:"image",title:null,url:"",alt:null}}function be(){return{type:"link",title:null,url:"",children:[]}}function Ve(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function qe(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function ye(){return{type:"paragraph",children:[]}}function Me(){return{type:"strong",children:[]}}function Re(){return{type:"text",value:""}}function we(){return{type:"thematicBreak"}}}function Mi(t){return{line:t.line,column:t.column,offset:t.offset}}function fE(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?fE(t,r):$9(t,r)}}function $9(t,e){let n;for(n in e)if(dE.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function h_(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+mc({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+mc({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+mc({start:e.start,end:e.end})+") is still open")}function U9(t){const e=this;e.parser=n;function n(r){return F9(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function V9(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function q9(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
575
+ `}]}function W9(t,e){const n=e.value?e.value+`
576
+ `:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(l.data={meta:e.meta}),t.patch(e,l),l=t.applyData(e,l),l={type:"element",tagName:"pre",properties:{},children:[l]},t.patch(e,l),l}function G9(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function K9(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Y9(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=ll(r.toLowerCase()),l=t.footnoteOrder.indexOf(r);let c,a=t.footnoteCounts.get(r);a===void 0?(a=0,t.footnoteOrder.push(r),c=t.footnoteOrder.length):c=l+1,a+=1,t.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};t.patch(e,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,d),t.applyData(e,d)}function X9(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Q9(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function hE(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const c=i[i.length-1];return c&&c.type==="text"?c.value+=r:i.push({type:"text",value:r}),i}function Z9(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return hE(t,e);const i={src:ll(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,l),t.applyData(e,l)}function J9(t,e){const n={src:ll(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function eP(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function tP(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return hE(t,e);const i={href:ll(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,l),t.applyData(e,l)}function nP(t,e){const n={href:ll(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function rP(t,e,n){const r=t.all(e),i=n?sP(n):pE(e),l={},c=[];if(typeof e.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const m=r[a];(i||a!==0||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
577
+ `}),m.type==="element"&&m.tagName==="p"&&!i?c.push(...m.children):c.push(m)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&c.push({type:"text",value:`
578
+ `});const d={type:"element",tagName:"li",properties:l,children:c};return t.patch(e,d),t.applyData(e,d)}function sP(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=pE(n[r])}return e}function pE(t){const e=t.spread;return e==null?t.children.length>1:e}function iP(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const c=r[i];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,l),t.applyData(e,l)}function oP(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function aP(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function lP(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function cP(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const c={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],c),i.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=Mv(e.children[1]),u=Gk(e.children[e.children.length-1]);a&&u&&(c.position={start:a,end:u}),i.push(c)}const l={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,l),t.applyData(e,l)}function uP(t,e,n){const r=n?n.children:void 0,l=(r?r.indexOf(e):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,a=c?c.length:e.children.length;let u=-1;const d=[];for(;++u<a;){const p=e.children[u],g={},_=c?c[u]:void 0;_&&(g.align=_);let C={type:"element",tagName:l,properties:g,children:[]};p&&(C.children=t.all(p),t.patch(p,C),C=t.applyData(p,C)),d.push(C)}const m={type:"element",tagName:"tr",properties:{},children:t.wrap(d,!0)};return t.patch(e,m),t.applyData(e,m)}function dP(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const p_=9,m_=32;function fP(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const l=[];for(;r;)l.push(g_(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return l.push(g_(e.slice(i),i>0,!1)),l.join("")}function g_(t,e,n){let r=0,i=t.length;if(e){let l=t.codePointAt(r);for(;l===p_||l===m_;)r++,l=t.codePointAt(r)}if(n){let l=t.codePointAt(i-1);for(;l===p_||l===m_;)i--,l=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function hP(t,e){const n={type:"text",value:fP(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function pP(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const mP={blockquote:V9,break:q9,code:W9,delete:G9,emphasis:K9,footnoteReference:Y9,heading:X9,html:Q9,imageReference:Z9,image:J9,inlineCode:eP,linkReference:tP,link:nP,listItem:rP,list:iP,paragraph:oP,root:aP,strong:lP,table:cP,tableCell:dP,tableRow:uP,text:hP,thematicBreak:pP,toml:xd,yaml:xd,definition:xd,footnoteDefinition:xd};function xd(){}const mE=-1,Gf=0,vc=1,Jd=2,Fv=3,Hv=4,$v=5,Uv=6,gE=7,vE=8,v_=typeof self=="object"?self:globalThis,gP=(t,e)=>{const n=(i,l)=>(t.set(l,i),i),r=i=>{if(t.has(i))return t.get(i);const[l,c]=e[i];switch(l){case Gf:case mE:return n(c,i);case vc:{const a=n([],i);for(const u of c)a.push(r(u));return a}case Jd:{const a=n({},i);for(const[u,d]of c)a[r(u)]=r(d);return a}case Fv:return n(new Date(c),i);case Hv:{const{source:a,flags:u}=c;return n(new RegExp(a,u),i)}case $v:{const a=n(new Map,i);for(const[u,d]of c)a.set(r(u),r(d));return a}case Uv:{const a=n(new Set,i);for(const u of c)a.add(r(u));return a}case gE:{const{name:a,message:u}=c;return n(new v_[a](u),i)}case vE:return n(BigInt(c),i);case"BigInt":return n(Object(BigInt(c)),i);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:a}=new Uint8Array(c);return n(new DataView(a),c)}}return n(new v_[l](c),i)};return r},y_=t=>gP(new Map,t)(0),Ma="",{toString:vP}={},{keys:yP}=Object,dc=t=>{const e=typeof t;if(e!=="object"||!t)return[Gf,e];const n=vP.call(t).slice(8,-1);switch(n){case"Array":return[vc,Ma];case"Object":return[Jd,Ma];case"Date":return[Fv,Ma];case"RegExp":return[Hv,Ma];case"Map":return[$v,Ma];case"Set":return[Uv,Ma];case"DataView":return[vc,n]}return n.includes("Array")?[vc,n]:n.includes("Error")?[gE,n]:[Jd,n]},_d=([t,e])=>t===Gf&&(e==="function"||e==="symbol"),bP=(t,e,n,r)=>{const i=(c,a)=>{const u=r.push(c)-1;return n.set(a,u),u},l=c=>{if(n.has(c))return n.get(c);let[a,u]=dc(c);switch(a){case Gf:{let m=c;switch(u){case"bigint":a=vE,m=c.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return i([mE],c)}return i([a,m],c)}case vc:{if(u){let g=c;return u==="DataView"?g=new Uint8Array(c.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(c)),i([u,[...g]],c)}const m=[],p=i([a,m],c);for(const g of c)m.push(l(g));return p}case Jd:{if(u)switch(u){case"BigInt":return i([u,c.toString()],c);case"Boolean":case"Number":case"String":return i([u,c.valueOf()],c)}if(e&&"toJSON"in c)return l(c.toJSON());const m=[],p=i([a,m],c);for(const g of yP(c))(t||!_d(dc(c[g])))&&m.push([l(g),l(c[g])]);return p}case Fv:return i([a,c.toISOString()],c);case Hv:{const{source:m,flags:p}=c;return i([a,{source:m,flags:p}],c)}case $v:{const m=[],p=i([a,m],c);for(const[g,_]of c)(t||!(_d(dc(g))||_d(dc(_))))&&m.push([l(g),l(_)]);return p}case Uv:{const m=[],p=i([a,m],c);for(const g of c)(t||!_d(dc(g)))&&m.push(l(g));return p}}const{message:d}=c;return i([a,{name:u,message:d}],c)};return l},b_=(t,{json:e,lossy:n}={})=>{const r=[];return bP(!(e||n),!!e,new Map,r)(t),r},ef=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?y_(b_(t,e)):structuredClone(t):(t,e)=>y_(b_(t,e));function xP(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function _P(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function SP(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||xP,r=t.options.footnoteBackLabel||_P,i=t.options.footnoteLabel||"Footnotes",l=t.options.footnoteLabelTagName||"h2",c=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<t.footnoteOrder.length;){const d=t.footnoteById.get(t.footnoteOrder[u]);if(!d)continue;const m=t.all(d),p=String(d.identifier).toUpperCase(),g=ll(p.toLowerCase());let _=0;const C=[],w=t.footnoteCounts.get(p);for(;w!==void 0&&++_<=w;){C.length>0&&C.push({type:"text",value:" "});let b=typeof n=="string"?n:n(u,_);typeof b=="string"&&(b={type:"text",value:b}),C.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(_>1?"-"+_:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,_),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=m[m.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...C)}else m.push(...C);const S={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(m,!0)};t.patch(d,S),a.push(S)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...ef(c),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
579
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:`
580
+ `}]}}const Kf=(function(t){if(t==null)return EP;if(typeof t=="function")return Yf(t);if(typeof t=="object")return Array.isArray(t)?wP(t):CP(t);if(typeof t=="string")return kP(t);throw new Error("Expected function, string, or object as test")});function wP(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Kf(t[n]);return Yf(r);function r(...i){let l=-1;for(;++l<e.length;)if(e[l].apply(this,i))return!0;return!1}}function CP(t){const e=t;return Yf(n);function n(r){const i=r;let l;for(l in t)if(i[l]!==e[l])return!1;return!0}}function kP(t){return Yf(e);function e(n){return n&&n.type===t}}function Yf(t){return e;function e(n,r,i){return!!(AP(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function EP(){return!0}function AP(t){return t!==null&&typeof t=="object"&&"type"in t}const yE=[],NP=!0,jg=!1,RP="skip";function bE(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const l=Kf(i),c=r?-1:1;a(t,void 0,[])();function a(u,d,m){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const _=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(u.type+(_?"<"+_+">":""))+")"})}return g;function g(){let _=yE,C,w,y;if((!e||l(u,d,m[m.length-1]||void 0))&&(_=jP(n(u,m)),_[0]===jg))return _;if("children"in u&&u.children){const S=u;if(S.children&&_[0]!==RP)for(w=(r?S.children.length:-1)+c,y=m.concat(S);w>-1&&w<S.children.length;){const b=S.children[w];if(C=a(b,w,y)(),C[0]===jg)return C;w=typeof C[1]=="number"?C[1]:w+c}}return _}}}function jP(t){return Array.isArray(t)?t:typeof t=="number"?[NP,t]:t==null?yE:[t]}function Vv(t,e,n,r){let i,l,c;typeof e=="function"&&typeof n!="function"?(l=void 0,c=e,i=n):(l=e,c=n,i=r),bE(t,l,a,i);function a(u,d){const m=d[d.length-1],p=m?m.children.indexOf(u):void 0;return c(u,p,m)}}const Tg={}.hasOwnProperty,TP={};function DP(t,e){const n=e||TP,r=new Map,i=new Map,l=new Map,c={...mP,...n.handlers},a={all:d,applyData:OP,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:c,one:u,options:n,patch:MP,wrap:IP};return Vv(t,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();p.has(g)||p.set(g,m)}}),a;function u(m,p){const g=m.type,_=a.handlers[g];if(Tg.call(a.handlers,g)&&_)return _(a,m,p);if(a.options.passThrough&&a.options.passThrough.includes(g)){if("children"in m){const{children:w,...y}=m,S=ef(y);return S.children=a.all(m),S}return ef(m)}return(a.options.unknownHandler||LP)(a,m,p)}function d(m){const p=[];if("children"in m){const g=m.children;let _=-1;for(;++_<g.length;){const C=a.one(g[_],m);if(C){if(_&&g[_-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=x_(C.value)),!Array.isArray(C)&&C.type==="element")){const w=C.children[0];w&&w.type==="text"&&(w.value=x_(w.value))}Array.isArray(C)?p.push(...C):p.push(C)}}}return p}}function MP(t,e){t.position&&(e.position=_7(t))}function OP(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,l=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const c="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:c}}n.type==="element"&&l&&Object.assign(n.properties,ef(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function LP(t,e){const n=e.data||{},r="value"in e&&!(Tg.call(n,"hProperties")||Tg.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function IP(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
581
+ `});++r<t.length;)r&&n.push({type:"text",value:`
582
+ `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
583
+ `}),n}function x_(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function __(t,e){const n=DP(t,e),r=n.one(t,void 0),i=SP(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
584
+ `},i),l}function PP(t,e){return t&&"run"in t?async function(n,r){const i=__(n,{file:r,...e});await t.run(i,r)}:function(n,r){return __(n,{file:r,...t||e})}}function S_(t){if(t)throw t}var Pm,w_;function zP(){if(w_)return Pm;w_=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},l=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var m=t.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!p)return!1;var g;for(g in d);return typeof g>"u"||t.call(d,g)},c=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},a=function(d,m){if(m==="__proto__")if(t.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return Pm=function u(){var d,m,p,g,_,C,w=arguments[0],y=1,S=arguments.length,b=!1;for(typeof w=="boolean"&&(b=w,w=arguments[1]||{},y=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});y<S;++y)if(d=arguments[y],d!=null)for(m in d)p=a(w,m),g=a(d,m),w!==g&&(b&&g&&(l(g)||(_=i(g)))?(_?(_=!1,C=p&&i(p)?p:[]):C=p&&l(p)?p:{},c(w,{name:m,newValue:u(b,C,g)})):typeof g<"u"&&c(w,{name:m,newValue:g}));return w},Pm}var BP=zP();const zm=rf(BP);function Dg(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function FP(){const t=[],e={run:n,use:r};return e;function n(...i){let l=-1;const c=i.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);a(null,...i);function a(u,...d){const m=t[++l];let p=-1;if(u){c(u);return}for(;++p<i.length;)(d[p]===null||d[p]===void 0)&&(d[p]=i[p]);i=d,m?HP(m,a)(...d):c(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function HP(t,e){let n;return r;function r(...c){const a=t.length>c.length;let u;a&&c.push(i);try{u=t.apply(this,c)}catch(d){const m=d;if(a&&n)throw m;return i(m)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(c,...a){n||(n=!0,e(c,...a))}function l(c){i(null,c)}}const cs={basename:$P,dirname:UP,extname:VP,join:qP,sep:"/"};function $P(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Yc(t);let n=0,r=-1,i=t.length,l;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let c=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(l){n=i+1;break}}else c<0&&(l=!0,c=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=c));return n===r?r=c:r<0&&(r=t.length),t.slice(n,r)}function UP(t){if(Yc(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function VP(t){Yc(t);let e=t.length,n=-1,r=0,i=-1,l=0,c;for(;e--;){const a=t.codePointAt(e);if(a===47){if(c){r=e+1;break}continue}n<0&&(c=!0,n=e+1),a===46?i<0?i=e:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function qP(...t){let e=-1,n;for(;++e<t.length;)Yc(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":WP(n)}function WP(t){Yc(t);const e=t.codePointAt(0)===47;let n=GP(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function GP(t,e){let n="",r=0,i=-1,l=0,c=-1,a,u;for(;++c<=t.length;){if(c<t.length)a=t.codePointAt(c);else{if(a===47)break;a=47}if(a===47){if(!(i===c-1||l===1))if(i!==c-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=c,l=0;continue}}else if(n.length>0){n="",r=0,i=c,l=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,c):n=t.slice(i+1,c),r=c-i-1;i=c,l=0}else a===46&&l>-1?l++:l=-1}return n}function Yc(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const KP={cwd:YP};function YP(){return"/"}function Mg(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function XP(t){if(typeof t=="string")t=new URL(t);else if(!Mg(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return QP(t)}function QP(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Bm=["history","path","basename","stem","extname","dirname"];class xE{constructor(e){let n;e?Mg(e)?n={path:e}:typeof e=="string"||ZP(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":KP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Bm.length;){const l=Bm[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)Bm.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?cs.basename(this.path):void 0}set basename(e){Hm(e,"basename"),Fm(e,"basename"),this.path=cs.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?cs.dirname(this.path):void 0}set dirname(e){C_(this.basename,"dirname"),this.path=cs.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?cs.extname(this.path):void 0}set extname(e){if(Fm(e,"extname"),C_(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=cs.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Mg(e)&&(e=XP(e)),Hm(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?cs.basename(this.path,this.extname):void 0}set stem(e){Hm(e,"stem"),Fm(e,"stem"),this.path=cs.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new qn(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Fm(t,e){if(t&&t.includes(cs.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+cs.sep+"`")}function Hm(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function C_(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function ZP(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const JP=(function(t){const r=this.constructor.prototype,i=r[t],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),ez={}.hasOwnProperty;class qv extends JP{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=FP()}copy(){const e=new qv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(zm(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Vm("data",this.frozen),this.namespace[e]=n,this):ez.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Vm("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Sd(e),r=this.parser||this.Parser;return $m("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),$m("process",this.parser||this.Parser),Um("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,c){const a=Sd(e),u=r.parse(a);r.run(u,a,function(m,p,g){if(m||!p||!g)return d(m);const _=p,C=r.stringify(_,g);rz(C)?g.value=C:g.result=C,d(m,g)});function d(m,p){m||!p?c(m):l?l(p):n(void 0,p)}}}processSync(e){let n=!1,r;return this.freeze(),$m("processSync",this.parser||this.Parser),Um("processSync",this.compiler||this.Compiler),this.process(e,i),E_("processSync","process",n),r;function i(l,c){n=!0,S_(l),r=c}}run(e,n,r){k_(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(c,a){const u=Sd(n);i.run(e,u,d);function d(m,p,g){const _=p||e;m?a(m):c?c(_):r(void 0,_,g)}}}runSync(e,n){let r=!1,i;return this.run(e,n,l),E_("runSync","run",r),i;function l(c,a){S_(c),i=a,r=!0}}stringify(e,n){this.freeze();const r=Sd(n),i=this.compiler||this.Compiler;return Um("stringify",i),k_(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(Vm("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?a(e):c(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function l(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...p]=d;u(m,p)}else c(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function c(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");a(d.plugins),d.settings&&(i.settings=zm(!0,i.settings,d.settings))}function a(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const p=d[m];l(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,m){let p=-1,g=-1;for(;++p<r.length;)if(r[p][0]===d){g=p;break}if(g===-1)r.push([d,...m]);else if(m.length>0){let[_,...C]=m;const w=r[g][1];Dg(w)&&Dg(_)&&(_=zm(!0,w,_)),r[g]=[d,_,...C]}}}}const tz=new qv().freeze();function $m(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Um(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Vm(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function k_(t){if(!Dg(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function E_(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Sd(t){return nz(t)?t:new xE(t)}function nz(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function rz(t){return typeof t=="string"||sz(t)}function sz(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const iz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",A_=[],N_={allowDangerousHtml:!0},oz=/^(https?|ircs?|mailto|xmpp)$/i,az=[{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 lz(t){const e=cz(t),n=uz(t);return dz(e.runSync(e.parse(n),n),t)}function cz(t){const e=t.rehypePlugins||A_,n=t.remarkPlugins||A_,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...N_}:N_;return tz().use(U9).use(n).use(PP,r).use(e)}function uz(t){const e=t.children||"",n=new xE;return typeof e=="string"&&(n.value=e),n}function dz(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,l=e.disallowedElements,c=e.skipHtml,a=e.unwrapDisallowed,u=e.urlTransform||fz;for(const m of az)Object.hasOwn(e,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+iz+m.id,void 0);return Vv(t,d),E7(t,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function d(m,p,g){if(m.type==="raw"&&g&&typeof p=="number")return c?g.children.splice(p,1):g.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let _;for(_ in Om)if(Object.hasOwn(Om,_)&&Object.hasOwn(m.properties,_)){const C=m.properties[_],w=Om[_];(w===null||w.includes(m.tagName))&&(m.properties[_]=u(String(C||""),_,m))}}if(m.type==="element"){let _=n?!n.includes(m.tagName):l?l.includes(m.tagName):!1;if(!_&&r&&typeof p=="number"&&(_=!r(m,p,g)),_&&g&&typeof p=="number")return a&&m.children?g.children.splice(p,1,...m.children):g.children.splice(p,1),p}}}function fz(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||oz.test(t.slice(0,e))?t:""}function R_(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function hz(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function pz(t,e,n){const i=Kf((n||{}).ignore||[]),l=mz(e);let c=-1;for(;++c<l.length;)bE(t,"text",a);function a(d,m){let p=-1,g;for(;++p<m.length;){const _=m[p],C=g?g.children:void 0;if(i(_,C?C.indexOf(_):void 0,g))return;g=_}if(g)return u(d,m)}function u(d,m){const p=m[m.length-1],g=l[c][0],_=l[c][1];let C=0;const y=p.children.indexOf(d);let S=!1,b=[];g.lastIndex=0;let x=g.exec(d.value);for(;x;){const k=x.index,j={index:x.index,input:x.input,stack:[...m,d]};let N=_(...x,j);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?g.lastIndex=k+1:(C!==k&&b.push({type:"text",value:d.value.slice(C,k)}),Array.isArray(N)?b.push(...N):N&&b.push(N),C=k+x[0].length,S=!0),!g.global)break;x=g.exec(d.value)}return S?(C<d.value.length&&b.push({type:"text",value:d.value.slice(C)}),p.children.splice(y,1,...b)):b=[d],y+b.length}}function mz(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([gz(i[0]),vz(i[1])])}return e}function gz(t){return typeof t=="string"?new RegExp(hz(t),"g"):t}function vz(t){return typeof t=="function"?t:function(){return t}}const qm="phrasing",Wm=["autolink","link","image","label"];function yz(){return{transforms:[kz],enter:{literalAutolink:xz,literalAutolinkEmail:Gm,literalAutolinkHttp:Gm,literalAutolinkWww:Gm},exit:{literalAutolink:Cz,literalAutolinkEmail:wz,literalAutolinkHttp:_z,literalAutolinkWww:Sz}}}function bz(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:qm,notInConstruct:Wm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:qm,notInConstruct:Wm},{character:":",before:"[ps]",after:"\\/",inConstruct:qm,notInConstruct:Wm}]}}function xz(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Gm(t){this.config.enter.autolinkProtocol.call(this,t)}function _z(t){this.config.exit.autolinkProtocol.call(this,t)}function Sz(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function wz(t){this.config.exit.autolinkEmail.call(this,t)}function Cz(t){this.exit(t)}function kz(t){pz(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ez],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Az]],{ignore:["link","linkReference"]})}function Ez(t,e,n,r,i){let l="";if(!_E(i)||(/^w/i.test(e)&&(n=e+n,e="",l="http://"),!Nz(n)))return!1;const c=Rz(n+r);if(!c[0])return!1;const a={type:"link",title:null,url:l+e+c[0],children:[{type:"text",value:e+c[0]}]};return c[1]?[a,{type:"text",value:c[1]}]:a}function Az(t,e,n,r){return!_E(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function Nz(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function Rz(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=R_(t,"(");let l=R_(t,")");for(;r!==-1&&i>l;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[t,n]}function _E(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||zo(n)||qf(n))&&(!e||n!==47)}SE.peek=zz;function jz(){this.buffer()}function Tz(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Dz(){this.buffer()}function Mz(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Oz(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Lz(t){this.exit(t)}function Iz(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Pz(t){this.exit(t)}function zz(){return"["}function SE(t,e,n,r){const i=n.createTracker(r);let l=i.move("[^");const c=n.enter("footnoteReference"),a=n.enter("reference");return l+=i.move(n.safe(n.associationId(t),{after:"]",before:l})),a(),c(),l+=i.move("]"),l}function Bz(){return{enter:{gfmFootnoteCallString:jz,gfmFootnoteCall:Tz,gfmFootnoteDefinitionLabelString:Dz,gfmFootnoteDefinition:Mz},exit:{gfmFootnoteCallString:Oz,gfmFootnoteCall:Lz,gfmFootnoteDefinitionLabelString:Iz,gfmFootnoteDefinition:Pz}}}function Fz(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:SE},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,c){const a=l.createTracker(c);let u=a.move("[^");const d=l.enter("footnoteDefinition"),m=l.enter("label");return u+=a.move(l.safe(l.associationId(r),{before:u,after:"]"})),m(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((e?`
585
+ `:" ")+l.indentLines(l.containerFlow(r,a.current()),e?wE:Hz))),d(),u}}function Hz(t,e,n){return e===0?t:wE(t,e,n)}function wE(t,e,n){return(n?"":" ")+t}const $z=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];CE.peek=Gz;function Uz(){return{canContainEols:["delete"],enter:{strikethrough:qz},exit:{strikethrough:Wz}}}function Vz(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$z}],handlers:{delete:CE}}}function qz(t){this.enter({type:"delete",children:[]},t)}function Wz(t){this.exit(t)}function CE(t,e,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let c=i.move("~~");return c+=n.containerPhrasing(t,{...i.current(),before:c,after:"~"}),c+=i.move("~~"),l(),c}function Gz(){return"~"}function Kz(t){return t.length}function Yz(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||Kz,l=[],c=[],a=[],u=[];let d=0,m=-1;for(;++m<t.length;){const w=[],y=[];let S=-1;for(t[m].length>d&&(d=t[m].length);++S<t[m].length;){const b=Xz(t[m][S]);if(n.alignDelimiters!==!1){const x=i(b);y[S]=x,(u[S]===void 0||x>u[S])&&(u[S]=x)}w.push(b)}c[m]=w,a[m]=y}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)l[p]=j_(r[p]);else{const w=j_(r);for(;++p<d;)l[p]=w}p=-1;const g=[],_=[];for(;++p<d;){const w=l[p];let y="",S="";w===99?(y=":",S=":"):w===108?y=":":w===114&&(S=":");let b=n.alignDelimiters===!1?1:Math.max(1,u[p]-y.length-S.length);const x=y+"-".repeat(b)+S;n.alignDelimiters!==!1&&(b=y.length+b+S.length,b>u[p]&&(u[p]=b),_[p]=b),g[p]=x}c.splice(1,0,g),a.splice(1,0,_),m=-1;const C=[];for(;++m<c.length;){const w=c[m],y=a[m];p=-1;const S=[];for(;++p<d;){const b=w[p]||"";let x="",k="";if(n.alignDelimiters!==!1){const j=u[p]-(y[p]||0),N=l[p];N===114?x=" ".repeat(j):N===99?j%2?(x=" ".repeat(j/2+.5),k=" ".repeat(j/2-.5)):(x=" ".repeat(j/2),k=x):k=" ".repeat(j)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(x),S.push(b),n.alignDelimiters!==!1&&S.push(k),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&S.push("|")}C.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return C.join(`
586
+ `)}function Xz(t){return t==null?"":String(t)}function j_(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function Qz(t,e,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const c=n.indentLines(n.containerFlow(t,l.current()),Zz);return i(),c}function Zz(t,e,n){return">"+(n?"":" ")+t}function Jz(t,e){return T_(t,e.inConstruct,!0)&&!T_(t,e.notInConstruct,!1)}function T_(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function D_(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
587
+ `&&Jz(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
588
+ `}function eB(t,e){const n=String(t);let r=n.indexOf(e),i=r,l=0,c=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>c&&(c=l):l=1,i=r+e.length,r=n.indexOf(e,i);return c}function tB(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function nB(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function rB(t,e,n,r){const i=nB(n),l=t.value||"",c=i==="`"?"GraveAccent":"Tilde";if(tB(t,n)){const p=n.enter("codeIndented"),g=n.indentLines(l,sB);return p(),g}const a=n.createTracker(r),u=i.repeat(Math.max(eB(l,i)+1,3)),d=n.enter("codeFenced");let m=a.move(u);if(t.lang){const p=n.enter(`codeFencedLang${c}`);m+=a.move(n.safe(t.lang,{before:m,after:" ",encode:["`"],...a.current()})),p()}if(t.lang&&t.meta){const p=n.enter(`codeFencedMeta${c}`);m+=a.move(" "),m+=a.move(n.safe(t.meta,{before:m,after:`
589
+ `,encode:["`"],...a.current()})),p()}return m+=a.move(`
590
+ `),l&&(m+=a.move(l+`
591
+ `)),m+=a.move(u),d(),m}function sB(t,e,n){return(n?"":" ")+t}function Wv(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function iB(t,e,n,r){const i=Wv(n),l=i==='"'?"Quote":"Apostrophe",c=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(t),{before:d,after:"]",...u.current()})),d+=u.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":`
592
+ `,...u.current()}))),a(),t.title&&(a=n.enter(`title${l}`),d+=u.move(" "+i),d+=u.move(n.safe(t.title,{before:d,after:i,...u.current()})),d+=u.move(i),a()),c(),d}function oB(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Tc(t){return"&#x"+t.toString(16).toUpperCase()+";"}function tf(t,e,n){const r=Ka(t),i=Ka(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kE.peek=aB;function kE(t,e,n,r){const i=oB(n),l=n.enter("emphasis"),c=n.createTracker(r),a=c.move(i);let u=c.move(n.containerPhrasing(t,{after:i,before:a,...c.current()}));const d=u.charCodeAt(0),m=tf(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Tc(d)+u.slice(1));const p=u.charCodeAt(u.length-1),g=tf(r.after.charCodeAt(0),p,i);g.inside&&(u=u.slice(0,-1)+Tc(p));const _=c.move(i);return l(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},a+u+_}function aB(t,e,n){return n.options.emphasis||"*"}function lB(t,e){let n=!1;return Vv(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,jg}),!!((!t.depth||t.depth<3)&&Pv(t)&&(e.options.setext||n))}function cB(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),l=n.createTracker(r);if(lB(t,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),g=n.containerPhrasing(t,{...l.current(),before:`
593
+ `,after:`
594
+ `});return p(),m(),g+`
595
+ `+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
596
+ `))+1))}const c="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");l.move(c+" ");let d=n.containerPhrasing(t,{before:"# ",after:`
597
+ `,...l.current()});return/^[\t ]/.test(d)&&(d=Tc(d.charCodeAt(0))+d.slice(1)),d=d?c+" "+d:c,n.options.closeAtx&&(d+=" "+c),u(),a(),d}EE.peek=uB;function EE(t){return t.value||""}function uB(){return"<"}AE.peek=dB;function AE(t,e,n,r){const i=Wv(n),l=i==='"'?"Quote":"Apostrophe",c=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(t.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":")",...u.current()}))),a(),t.title&&(a=n.enter(`title${l}`),d+=u.move(" "+i),d+=u.move(n.safe(t.title,{before:d,after:i,...u.current()})),d+=u.move(i),a()),d+=u.move(")"),c(),d}function dB(){return"!"}NE.peek=fB;function NE(t,e,n,r){const i=t.referenceType,l=n.enter("imageReference");let c=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const d=n.safe(t.alt,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),c();const m=n.stack;n.stack=[],c=n.enter("reference");const p=n.safe(n.associationId(t),{before:u,after:"]",...a.current()});return c(),n.stack=m,l(),i==="full"||!d||d!==p?u+=a.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function fB(){return"!"}RE.peek=hB;function RE(t,e,n){let r=t.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const c=n.unsafe[l],a=n.compilePattern(c);let u;if(c.atBreak)for(;u=a.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function hB(){return"`"}function jE(t,e){const n=Pv(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}TE.peek=pB;function TE(t,e,n,r){const i=Wv(n),l=i==='"'?"Quote":"Apostrophe",c=n.createTracker(r);let a,u;if(jE(t,n)){const m=n.stack;n.stack=[],a=n.enter("autolink");let p=c.move("<");return p+=c.move(n.containerPhrasing(t,{before:p,after:">",...c.current()})),p+=c.move(">"),a(),n.stack=m,p}a=n.enter("link"),u=n.enter("label");let d=c.move("[");return d+=c.move(n.containerPhrasing(t,{before:d,after:"](",...c.current()})),d+=c.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(u=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":")",...c.current()}))),u(),t.title&&(u=n.enter(`title${l}`),d+=c.move(" "+i),d+=c.move(n.safe(t.title,{before:d,after:i,...c.current()})),d+=c.move(i),u()),d+=c.move(")"),a(),d}function pB(t,e,n){return jE(t,n)?"<":"["}DE.peek=mB;function DE(t,e,n,r){const i=t.referenceType,l=n.enter("linkReference");let c=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const d=n.containerPhrasing(t,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),c();const m=n.stack;n.stack=[],c=n.enter("reference");const p=n.safe(n.associationId(t),{before:u,after:"]",...a.current()});return c(),n.stack=m,l(),i==="full"||!d||d!==p?u+=a.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function mB(){return"["}function Gv(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function gB(t){const e=Gv(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function vB(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function ME(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function yB(t,e,n,r){const i=n.enter("list"),l=n.bulletCurrent;let c=t.ordered?vB(n):Gv(n);const a=t.ordered?c==="."?")":".":gB(n);let u=e&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!t.ordered){const m=t.children?t.children[0]:void 0;if((c==="*"||c==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),ME(n)===c&&m){let p=-1;for(;++p<t.children.length;){const g=t.children[p];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(c=a),n.bulletCurrent=c;const d=n.containerFlow(t,r);return n.bulletLastUsed=c,n.bulletCurrent=l,i(),d}function bB(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function xB(t,e,n,r){const i=bB(n);let l=n.bulletCurrent||Gv(n);e&&e.type==="list"&&e.ordered&&(l=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+l);let c=l.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(c=Math.ceil(c/4)*4);const a=n.createTracker(r);a.move(l+" ".repeat(c-l.length)),a.shift(c);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,a.current()),m);return u(),d;function m(p,g,_){return g?(_?"":" ".repeat(c))+p:(_?l:l+" ".repeat(c-l.length))+p}}function _B(t,e,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),c=n.containerPhrasing(t,r);return l(),i(),c}const SB=Kf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function wB(t,e,n,r){return(t.children.some(function(c){return SB(c)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function CB(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}OE.peek=kB;function OE(t,e,n,r){const i=CB(n),l=n.enter("strong"),c=n.createTracker(r),a=c.move(i+i);let u=c.move(n.containerPhrasing(t,{after:i,before:a,...c.current()}));const d=u.charCodeAt(0),m=tf(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Tc(d)+u.slice(1));const p=u.charCodeAt(u.length-1),g=tf(r.after.charCodeAt(0),p,i);g.inside&&(u=u.slice(0,-1)+Tc(p));const _=c.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},a+u+_}function kB(t,e,n){return n.options.strong||"*"}function EB(t,e,n,r){return n.safe(t.value,r)}function AB(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function NB(t,e,n){const r=(ME(n)+(n.options.ruleSpaces?" ":"")).repeat(AB(n));return n.options.ruleSpaces?r.slice(0,-1):r}const LE={blockquote:Qz,break:D_,code:rB,definition:iB,emphasis:kE,hardBreak:D_,heading:cB,html:EE,image:AE,imageReference:NE,inlineCode:RE,link:TE,linkReference:DE,list:yB,listItem:xB,paragraph:_B,root:wB,strong:OE,text:EB,thematicBreak:NB};function RB(){return{enter:{table:jB,tableData:M_,tableHeader:M_,tableRow:DB},exit:{codeText:MB,table:TB,tableData:Km,tableHeader:Km,tableRow:Km}}}function jB(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function TB(t){this.exit(t),this.data.inTable=void 0}function DB(t){this.enter({type:"tableRow",children:[]},t)}function Km(t){this.exit(t)}function M_(t){this.enter({type:"tableCell",children:[]},t)}function MB(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,OB));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function OB(t,e){return e==="|"?e:t}function LB(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
598
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:c,tableCell:u,tableRow:a}};function c(_,C,w,y){return d(m(_,w,y),_.align)}function a(_,C,w,y){const S=p(_,w,y),b=d([S]);return b.slice(0,b.indexOf(`
599
+ `))}function u(_,C,w,y){const S=w.enter("tableCell"),b=w.enter("phrasing"),x=w.containerPhrasing(_,{...y,before:l,after:l});return b(),S(),x}function d(_,C){return Yz(_,{align:C,alignDelimiters:r,padding:n,stringLength:i})}function m(_,C,w){const y=_.children;let S=-1;const b=[],x=C.enter("table");for(;++S<y.length;)b[S]=p(y[S],C,w);return x(),b}function p(_,C,w){const y=_.children;let S=-1;const b=[],x=C.enter("tableRow");for(;++S<y.length;)b[S]=u(y[S],_,C,w);return x(),b}function g(_,C,w){let y=LE.inlineCode(_,C,w);return w.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function IB(){return{exit:{taskListCheckValueChecked:O_,taskListCheckValueUnchecked:O_,paragraph:zB}}}function PB(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:BB}}}function O_(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function zB(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let l=-1,c;for(;++l<i.length;){const a=i[l];if(a.type==="paragraph"){c=a;break}}c===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function BB(t,e,n,r){const i=t.children[0],l=typeof t.checked=="boolean"&&i&&i.type==="paragraph",c="["+(t.checked?"x":" ")+"] ",a=n.createTracker(r);l&&a.move(c);let u=LE.listItem(t,e,n,{...r,...a.current()});return l&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(m){return m+c}}function FB(){return[yz(),Bz(),Uz(),RB(),IB()]}function HB(t){return{extensions:[bz(),Fz(t),Vz(),LB(t),PB()]}}const $B={tokenize:KB,partial:!0},IE={tokenize:YB,partial:!0},PE={tokenize:XB,partial:!0},zE={tokenize:QB,partial:!0},UB={tokenize:ZB,partial:!0},BE={name:"wwwAutolink",tokenize:WB,previous:HE},FE={name:"protocolAutolink",tokenize:GB,previous:$E},Qs={name:"emailAutolink",tokenize:qB,previous:UE},ys={};function VB(){return{text:ys}}let No=48;for(;No<123;)ys[No]=Qs,No++,No===58?No=65:No===91&&(No=97);ys[43]=Qs;ys[45]=Qs;ys[46]=Qs;ys[95]=Qs;ys[72]=[Qs,FE];ys[104]=[Qs,FE];ys[87]=[Qs,BE];ys[119]=[Qs,BE];function qB(t,e,n){const r=this;let i,l;return c;function c(p){return!Og(p)||!UE.call(r,r.previous)||Kv(r.events)?n(p):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(p))}function a(p){return Og(p)?(t.consume(p),a):p===64?(t.consume(p),u):n(p)}function u(p){return p===46?t.check(UB,m,d)(p):p===45||p===95||Un(p)?(l=!0,t.consume(p),u):m(p)}function d(p){return t.consume(p),i=!0,u}function m(p){return l&&i&&Yn(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(p)):n(p)}}function WB(t,e,n){const r=this;return i;function i(c){return c!==87&&c!==119||!HE.call(r,r.previous)||Kv(r.events)?n(c):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check($B,t.attempt(IE,t.attempt(PE,l),n),n)(c))}function l(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(c)}}function GB(t,e,n){const r=this;let i="",l=!1;return c;function c(p){return(p===72||p===104)&&$E.call(r,r.previous)&&!Kv(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),t.consume(p),a):n(p)}function a(p){if(Yn(p)&&i.length<5)return i+=String.fromCodePoint(p),t.consume(p),a;if(p===58){const g=i.toLowerCase();if(g==="http"||g==="https")return t.consume(p),u}return n(p)}function u(p){return p===47?(t.consume(p),l?d:(l=!0,u)):n(p)}function d(p){return p===null||Zd(p)||Ut(p)||zo(p)||qf(p)?n(p):t.attempt(IE,t.attempt(PE,m),n)(p)}function m(p){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(p)}}function KB(t,e,n){let r=0;return i;function i(c){return(c===87||c===119)&&r<3?(r++,t.consume(c),i):c===46&&r===3?(t.consume(c),l):n(c)}function l(c){return c===null?n(c):e(c)}}function YB(t,e,n){let r,i,l;return c;function c(d){return d===46||d===95?t.check(zE,u,a)(d):d===null||Ut(d)||zo(d)||d!==45&&qf(d)?u(d):(l=!0,t.consume(d),c)}function a(d){return d===95?r=!0:(i=r,r=void 0),t.consume(d),c}function u(d){return i||r||!l?n(d):e(d)}}function XB(t,e){let n=0,r=0;return i;function i(c){return c===40?(n++,t.consume(c),i):c===41&&r<n?l(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?t.check(zE,e,l)(c):c===null||Ut(c)||zo(c)?e(c):(t.consume(c),i)}function l(c){return c===41&&r++,t.consume(c),i}}function QB(t,e,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),r):a===38?(t.consume(a),l):a===93?(t.consume(a),i):a===60||a===null||Ut(a)||zo(a)?e(a):n(a)}function i(a){return a===null||a===40||a===91||Ut(a)||zo(a)?e(a):r(a)}function l(a){return Yn(a)?c(a):n(a)}function c(a){return a===59?(t.consume(a),r):Yn(a)?(t.consume(a),c):n(a)}}function ZB(t,e,n){return r;function r(l){return t.consume(l),i}function i(l){return Un(l)?n(l):e(l)}}function HE(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ut(t)}function $E(t){return!Yn(t)}function UE(t){return!(t===47||Og(t))}function Og(t){return t===43||t===45||t===46||t===95||Un(t)}function Kv(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const JB={tokenize:aF,partial:!0};function eF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sF,continuation:{tokenize:iF},exit:oF}},text:{91:{name:"gfmFootnoteCall",tokenize:rF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tF,resolveTo:nF}}}}function tF(t,e,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){c=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!c||!c._balanced)return n(u);const d=Zr(r.sliceSerialize({start:c.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function nF(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},a=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",l,e],["enter",c,e],["exit",c,e],["exit",l,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...a),t}function rF(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,c;return a;function a(p){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(t.enter("gfmFootnoteCallMarker"),t.consume(p),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(p){if(l>999||p===93&&!c||p===null||p===91||Ut(p))return n(p);if(p===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return i.includes(Zr(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(p)}return Ut(p)||(c=!0),l++,t.consume(p),p===92?m:d}function m(p){return p===91||p===92||p===93?(t.consume(p),l++,d):d(p)}}function sF(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,c=0,a;return u;function u(C){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(C){return C===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",m):n(C)}function m(C){if(c>999||C===93&&!a||C===null||C===91||Ut(C))return n(C);if(C===93){t.exit("chunkString");const w=t.exit("gfmFootnoteDefinitionLabelString");return l=Zr(r.sliceSerialize(w)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return Ut(C)||(a=!0),c++,t.consume(C),C===92?p:m}function p(C){return C===91||C===92||C===93?(t.consume(C),c++,m):m(C)}function g(C){return C===58?(t.enter("definitionMarker"),t.consume(C),t.exit("definitionMarker"),i.includes(l)||i.push(l),Ct(t,_,"gfmFootnoteDefinitionWhitespace")):n(C)}function _(C){return e(C)}}function iF(t,e,n){return t.check(Kc,e,t.attempt(JB,e,n))}function oF(t){t.exit("gfmFootnoteDefinition")}function aF(t,e,n){const r=this;return Ct(t,i,"gfmFootnoteDefinitionIndent",5);function i(l){const c=r.events[r.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?e(l):n(l)}}function lF(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(c,a){let u=-1;for(;++u<c.length;)if(c[u][0]==="enter"&&c[u][1].type==="strikethroughSequenceTemporary"&&c[u][1]._close){let d=u;for(;d--;)if(c[d][0]==="exit"&&c[d][1].type==="strikethroughSequenceTemporary"&&c[d][1]._open&&c[u][1].end.offset-c[u][1].start.offset===c[d][1].end.offset-c[d][1].start.offset){c[u][1].type="strikethroughSequence",c[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},c[d][1].start),end:Object.assign({},c[u][1].end)},p={type:"strikethroughText",start:Object.assign({},c[d][1].end),end:Object.assign({},c[u][1].start)},g=[["enter",m,a],["enter",c[d][1],a],["exit",c[d][1],a],["enter",p,a]],_=a.parser.constructs.insideSpan.null;_&&Cr(g,g.length,0,Wf(_,c.slice(d+1,u),a)),Cr(g,g.length,0,[["exit",p,a],["enter",c[u][1],a],["exit",c[u][1],a],["exit",m,a]]),Cr(c,d-1,u-d+3,g),u=d+g.length-2;break}}for(u=-1;++u<c.length;)c[u][1].type==="strikethroughSequenceTemporary"&&(c[u][1].type="data");return c}function l(c,a,u){const d=this.previous,m=this.events;let p=0;return g;function g(C){return d===126&&m[m.length-1][1].type!=="characterEscape"?u(C):(c.enter("strikethroughSequenceTemporary"),_(C))}function _(C){const w=Ka(d);if(C===126)return p>1?u(C):(c.consume(C),p++,_);if(p<2&&!n)return u(C);const y=c.exit("strikethroughSequenceTemporary"),S=Ka(C);return y._open=!S||S===2&&!!w,y._close=!w||w===2&&!!S,a(C)}}}class cF{constructor(){this.map=[]}add(e,n,r){uF(this,e,n,r)}consume(e){if(this.map.sort(function(l,c){return l[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const l of i)e.push(l);i=r.pop()}this.map.length=0}}function uF(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function dF(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function fF(){return{flow:{null:{name:"table",tokenize:hF,resolveAll:pF}}}}function hF(t,e,n){const r=this;let i=0,l=0,c;return a;function a(L){let z=r.events.length-1;for(;z>-1;){const q=r.events[z][1].type;if(q==="lineEnding"||q==="linePrefix")z--;else break}const H=z>-1?r.events[z][1].type:null,$=H==="tableHead"||H==="tableRow"?N:u;return $===N&&r.parser.lazy[r.now().line]?n(L):$(L)}function u(L){return t.enter("tableHead"),t.enter("tableRow"),d(L)}function d(L){return L===124||(c=!0,l+=1),m(L)}function m(L){return L===null?n(L):st(L)?l>1?(l=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),_):n(L):vt(L)?Ct(t,m,"whitespace")(L):(l+=1,c&&(c=!1,i+=1),L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),c=!0,m):(t.enter("data"),p(L)))}function p(L){return L===null||L===124||Ut(L)?(t.exit("data"),m(L)):(t.consume(L),L===92?g:p)}function g(L){return L===92||L===124?(t.consume(L),p):p(L)}function _(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(t.enter("tableDelimiterRow"),c=!1,vt(L)?Ct(t,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):C(L))}function C(L){return L===45||L===58?y(L):L===124?(c=!0,t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),w):j(L)}function w(L){return vt(L)?Ct(t,y,"whitespace")(L):y(L)}function y(L){return L===58?(l+=1,c=!0,t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),S):L===45?(l+=1,S(L)):L===null||st(L)?k(L):j(L)}function S(L){return L===45?(t.enter("tableDelimiterFiller"),b(L)):j(L)}function b(L){return L===45?(t.consume(L),b):L===58?(c=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),x):(t.exit("tableDelimiterFiller"),x(L))}function x(L){return vt(L)?Ct(t,k,"whitespace")(L):k(L)}function k(L){return L===124?C(L):L===null||st(L)?!c||i!==l?j(L):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(L)):j(L)}function j(L){return n(L)}function N(L){return t.enter("tableRow"),D(L)}function D(L){return L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),D):L===null||st(L)?(t.exit("tableRow"),e(L)):vt(L)?Ct(t,D,"whitespace")(L):(t.enter("data"),E(L))}function E(L){return L===null||L===124||Ut(L)?(t.exit("data"),D(L)):(t.consume(L),L===92?O:E)}function O(L){return L===92||L===124?(t.consume(L),E):E(L)}}function pF(t,e){let n=-1,r=!0,i=0,l=[0,0,0,0],c=[0,0,0,0],a=!1,u=0,d,m,p;const g=new cF;for(;++n<t.length;){const _=t[n],C=_[1];_[0]==="enter"?C.type==="tableHead"?(a=!1,u!==0&&(L_(g,e,u,d,m),m=void 0,u=0),d={type:"table",start:Object.assign({},C.start),end:Object.assign({},C.end)},g.add(n,0,[["enter",d,e]])):C.type==="tableRow"||C.type==="tableDelimiterRow"?(r=!0,p=void 0,l=[0,0,0,0],c=[0,n+1,0,0],a&&(a=!1,m={type:"tableBody",start:Object.assign({},C.start),end:Object.assign({},C.end)},g.add(n,0,[["enter",m,e]])),i=C.type==="tableDelimiterRow"?2:m?3:1):i&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")?(r=!1,c[2]===0&&(l[1]!==0&&(c[0]=c[1],p=wd(g,e,l,i,void 0,p),l=[0,0,0,0]),c[2]=n)):C.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(c[0]=c[1],p=wd(g,e,l,i,void 0,p)),l=c,c=[l[1],n,0,0])):C.type==="tableHead"?(a=!0,u=n):C.type==="tableRow"||C.type==="tableDelimiterRow"?(u=n,l[1]!==0?(c[0]=c[1],p=wd(g,e,l,i,n,p)):c[1]!==0&&(p=wd(g,e,c,i,n,p)),i=0):i&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")&&(c[3]=n)}for(u!==0&&L_(g,e,u,d,m),g.consume(e.events),n=-1;++n<e.events.length;){const _=e.events[n];_[0]==="enter"&&_[1].type==="table"&&(_[1]._align=dF(e.events,n))}return t}function wd(t,e,n,r,i,l){const c=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(l.end=Object.assign({},Pa(e.events,n[0])),t.add(n[0],0,[["exit",l,e]]));const u=Pa(e.events,n[1]);if(l={type:c,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",l,e]]),n[2]!==0){const d=Pa(e.events,n[2]),m=Pa(e.events,n[3]),p={type:a,start:Object.assign({},d),end:Object.assign({},m)};if(t.add(n[2],0,[["enter",p,e]]),r!==2){const g=e.events[n[2]],_=e.events[n[3]];if(g[1].end=Object.assign({},_[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const C=n[2]+1,w=n[3]-n[2]-1;t.add(C,w,[])}}t.add(n[3]+1,0,[["exit",p,e]])}return i!==void 0&&(l.end=Object.assign({},Pa(e.events,i)),t.add(i,0,[["exit",l,e]]),l=void 0),l}function L_(t,e,n,r,i){const l=[],c=Pa(e.events,n);i&&(i.end=Object.assign({},c),l.push(["exit",i,e])),r.end=Object.assign({},c),l.push(["exit",r,e]),t.add(n+1,0,l)}function Pa(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const mF={name:"tasklistCheck",tokenize:vF};function gF(){return{text:{91:mF}}}function vF(t,e,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),l)}function l(u){return Ut(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),c):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),c):n(u)}function c(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):n(u)}function a(u){return st(u)?e(u):vt(u)?t.check({tokenize:yF},e,n)(u):n(u)}}function yF(t,e,n){return Ct(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function bF(t){return eE([VB(),eF(),lF(t),fF(),gF()])}const xF={};function _F(t){const e=this,n=t||xF,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),c=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(bF(n)),l.push(FB()),c.push(HB(n))}var SF=Object.create,Xf=Object.defineProperty,wF=Object.defineProperties,CF=Object.getOwnPropertyDescriptor,kF=Object.getOwnPropertyDescriptors,VE=Object.getOwnPropertyNames,nf=Object.getOwnPropertySymbols,EF=Object.getPrototypeOf,Yv=Object.prototype.hasOwnProperty,qE=Object.prototype.propertyIsEnumerable,I_=(t,e,n)=>e in t?Xf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ps=(t,e)=>{for(var n in e||(e={}))Yv.call(e,n)&&I_(t,n,e[n]);if(nf)for(var n of nf(e))qE.call(e,n)&&I_(t,n,e[n]);return t},Qf=(t,e)=>wF(t,kF(e)),WE=(t,e)=>{var n={};for(var r in t)Yv.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&nf)for(var r of nf(t))e.indexOf(r)<0&&qE.call(t,r)&&(n[r]=t[r]);return n},AF=(t,e)=>function(){return e||(0,t[VE(t)[0]])((e={exports:{}}).exports,e),e.exports},NF=(t,e)=>{for(var n in e)Xf(t,n,{get:e[n],enumerable:!0})},RF=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of VE(e))!Yv.call(t,i)&&i!==n&&Xf(t,i,{get:()=>e[i],enumerable:!(r=CF(e,i))||r.enumerable});return t},jF=(t,e,n)=>(n=t!=null?SF(EF(t)):{},RF(!t||!t.__esModule?Xf(n,"default",{value:t,enumerable:!0}):n,t)),TF=AF({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(t,e){var n=(function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,l={},c={util:{encode:function C(w){return w instanceof a?new a(w.type,C(w.content),w.alias):Array.isArray(w)?w.map(C):w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){return C.__id||Object.defineProperty(C,"__id",{value:++i}),C.__id},clone:function C(w,y){y=y||{};var S,b;switch(c.util.type(w)){case"Object":if(b=c.util.objId(w),y[b])return y[b];S={},y[b]=S;for(var x in w)w.hasOwnProperty(x)&&(S[x]=C(w[x],y));return S;case"Array":return b=c.util.objId(w),y[b]?y[b]:(S=[],y[b]=S,w.forEach(function(k,j){S[j]=C(k,y)}),S);default:return w}},getLanguage:function(C){for(;C;){var w=r.exec(C.className);if(w)return w[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,w){C.className=C.className.replace(RegExp(r,"gi"),""),C.classList.add("language-"+w)},isActive:function(C,w,y){for(var S="no-"+w;C;){var b=C.classList;if(b.contains(w))return!0;if(b.contains(S))return!1;C=C.parentElement}return!!y}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(C,w){var y=c.util.clone(c.languages[C]);for(var S in w)y[S]=w[S];return y},insertBefore:function(C,w,y,S){S=S||c.languages;var b=S[C],x={};for(var k in b)if(b.hasOwnProperty(k)){if(k==w)for(var j in y)y.hasOwnProperty(j)&&(x[j]=y[j]);y.hasOwnProperty(k)||(x[k]=b[k])}var N=S[C];return S[C]=x,c.languages.DFS(c.languages,function(D,E){E===N&&D!=C&&(this[D]=x)}),x},DFS:function C(w,y,S,b){b=b||{};var x=c.util.objId;for(var k in w)if(w.hasOwnProperty(k)){y.call(w,k,w[k],S||k);var j=w[k],N=c.util.type(j);N==="Object"&&!b[x(j)]?(b[x(j)]=!0,C(j,y,null,b)):N==="Array"&&!b[x(j)]&&(b[x(j)]=!0,C(j,y,k,b))}}},plugins:{},highlight:function(C,w,y){var S={code:C,grammar:w,language:y};if(c.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=c.tokenize(S.code,S.grammar),c.hooks.run("after-tokenize",S),a.stringify(c.util.encode(S.tokens),S.language)},tokenize:function(C,w){var y=w.rest;if(y){for(var S in y)w[S]=y[S];delete w.rest}var b=new m;return p(b,b.head,C),d(C,b,w,b.head,0),_(b)},hooks:{all:{},add:function(C,w){var y=c.hooks.all;y[C]=y[C]||[],y[C].push(w)},run:function(C,w){var y=c.hooks.all[C];if(!(!y||!y.length))for(var S=0,b;b=y[S++];)b(w)}},Token:a};function a(C,w,y,S){this.type=C,this.content=w,this.alias=y,this.length=(S||"").length|0}a.stringify=function C(w,y){if(typeof w=="string")return w;if(Array.isArray(w)){var S="";return w.forEach(function(N){S+=C(N,y)}),S}var b={type:w.type,content:C(w.content,y),tag:"span",classes:["token",w.type],attributes:{},language:y},x=w.alias;x&&(Array.isArray(x)?Array.prototype.push.apply(b.classes,x):b.classes.push(x)),c.hooks.run("wrap",b);var k="";for(var j in b.attributes)k+=" "+j+'="'+(b.attributes[j]||"").replace(/"/g,"&quot;")+'"';return"<"+b.tag+' class="'+b.classes.join(" ")+'"'+k+">"+b.content+"</"+b.tag+">"};function u(C,w,y,S){C.lastIndex=w;var b=C.exec(y);if(b&&S&&b[1]){var x=b[1].length;b.index+=x,b[0]=b[0].slice(x)}return b}function d(C,w,y,S,b,x){for(var k in y)if(!(!y.hasOwnProperty(k)||!y[k])){var j=y[k];j=Array.isArray(j)?j:[j];for(var N=0;N<j.length;++N){if(x&&x.cause==k+","+N)return;var D=j[N],E=D.inside,O=!!D.lookbehind,L=!!D.greedy,z=D.alias;if(L&&!D.pattern.global){var H=D.pattern.toString().match(/[imsuy]*$/)[0];D.pattern=RegExp(D.pattern.source,H+"g")}for(var $=D.pattern||D,q=S.next,G=b;q!==w.tail&&!(x&&G>=x.reach);G+=q.value.length,q=q.next){var W=q.value;if(w.length>C.length)return;if(!(W instanceof a)){var X=1,Y;if(L){if(Y=u($,G,C,O),!Y||Y.index>=C.length)break;var F=Y.index,I=Y.index+Y[0].length,M=G;for(M+=q.value.length;F>=M;)q=q.next,M+=q.value.length;if(M-=q.value.length,G=M,q.value instanceof a)continue;for(var P=q;P!==w.tail&&(M<I||typeof P.value=="string");P=P.next)X++,M+=P.value.length;X--,W=C.slice(G,M),Y.index-=G}else if(Y=u($,0,W,O),!Y)continue;var F=Y.index,B=Y[0],Q=W.slice(0,F),J=W.slice(F+B.length),ee=G+W.length;x&&ee>x.reach&&(x.reach=ee);var K=q.prev;Q&&(K=p(w,K,Q),G+=Q.length),g(w,K,X);var V=new a(k,E?c.tokenize(B,E):B,z,B);if(q=p(w,K,V),J&&p(w,q,J),X>1){var te={cause:k+","+N,reach:ee};d(C,w,y,q.prev,G,te),x&&te.reach>x.reach&&(x.reach=te.reach)}}}}}}function m(){var C={value:null,prev:null,next:null},w={value:null,prev:C,next:null};C.next=w,this.head=C,this.tail=w,this.length=0}function p(C,w,y){var S=w.next,b={value:y,prev:w,next:S};return w.next=b,S.prev=b,C.length++,b}function g(C,w,y){for(var S=w.next,b=0;b<y&&S!==C.tail;b++)S=S.next;w.next=S,S.prev=w,C.length-=b}function _(C){for(var w=[],y=C.head.next;y!==C.tail;)w.push(y.value),y=y.next;return w}return c})();e.exports=n,n.default=n}}),ke=jF(TF());ke.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]},ke.languages.markup.tag.inside["attr-value"].inside.entity=ke.languages.markup.entity,ke.languages.markup.doctype.inside["internal-subset"].inside=ke.languages.markup,ke.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&amp;/,"&"))}),Object.defineProperty(ke.languages.markup.tag,"addInlined",{value:function(t,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ke.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:ke.languages[r]},{});r[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:n},ke.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(ke.languages.markup.tag,"addAttribute",{value:function(t,e){ke.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\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:[e,"language-"+e],inside:ke.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ke.languages.html=ke.languages.markup,ke.languages.mathml=ke.languages.markup,ke.languages.svg=ke.languages.markup,ke.languages.xml=ke.languages.extend("markup",{}),ke.languages.ssml=ke.languages.xml,ke.languages.atom=ke.languages.xml,ke.languages.rss=ke.languages.xml,(function(t){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?: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]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.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:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,"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":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(ke),ke.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:/[{}[\];(),.:]/},ke.languages.javascript=ke.languages.extend("clike",{"class-name":[ke.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}|\?\?=?|\?\.?|[~:]/}),ke.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ke.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:ke.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:ke.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ke.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ke.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:ke.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ke.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:ke.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"}}),ke.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ke.languages.markup&&(ke.languages.markup.tag.addInlined("script","javascript"),ke.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")),ke.languages.js=ke.languages.javascript,ke.languages.actionscript=ke.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:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ke.languages.actionscript["class-name"].alias="function",delete ke.languages.actionscript.parameter,delete ke.languages.actionscript["literal-property"],ke.languages.markup&&ke.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ke.languages.markup}}),(function(t){var e=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};t.languages.coffeescript=t.languages.extend("javascript",{comment:e,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],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"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:e,interpolation:n}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript})(ke),(function(t){var e=t.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(e,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var l=function(p){p.inside||(p.inside={}),p.inside.rest=r},c="doc-comment";if(a=t.languages[i]){var a,u=a[c];if((u=u||(a=t.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[c])instanceof RegExp&&(u=a[c]={pattern:u}),Array.isArray(u))for(var d=0,m=u.length;d<m;d++)u[d]instanceof RegExp&&(u[d]={pattern:u[d]}),l(u[d]);else l(u)}})}}),e.addSupport(["java","javascript","php"],e)})(ke),(function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,e=(t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.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\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,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:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css,t.languages.markup);e&&(e.tag.addInlined("style","css"),e.tag.addAttribute("style","css"))})(ke),(function(t){var e=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,e=(t.languages.css.selector={pattern:t.languages.css.selector.pattern,lookbehind:!0,inside:e={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+e.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":[e,{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:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=e,t.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}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};t.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:e,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:e,number:n})})(ke),(function(t){var e=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\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}),l=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function c(a,u){u=(u||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(d,u)}t.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 r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+l+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\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:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(l),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(ke),(function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(d){return d=d.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),l=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,c=(t.languages.markdown=t.languages.extend("markup",{}),t.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:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+l+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+l+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+l+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.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:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<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:n(/!?\[(?:(?!\])<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(m){d!==m&&(t.languages.markdown[d].inside.content.inside[m]=t.languages.markdown[m])})}),t.hooks.add("after-tokenize",function(d){d.language!=="markdown"&&d.language!=="md"||(function m(p){if(p&&typeof p!="string")for(var g=0,_=p.length;g<_;g++){var C,w=p[g];w.type!=="code"?m(w.content):(C=w.content[1],w=w.content[3],C&&w&&C.type==="code-language"&&w.type==="code-block"&&typeof C.content=="string"&&(C=C.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),C="language-"+(C=(/[a-z][\w-]*/i.exec(C)||[""])[0].toLowerCase()),w.alias?typeof w.alias=="string"?w.alias=[w.alias,C]:w.alias.push(C):w.alias=[C]))}})(d.tokens)}),t.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var m="",p=0,g=d.classes.length;p<g;p++){var _=d.classes[p],_=/language-(.+)/.exec(_);if(_){m=_[1];break}}var C,w=t.languages[m];w?d.content=t.highlight((function(y){return y=y.replace(c,""),y=y.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(S,b){var x;return(b=b.toLowerCase())[0]==="#"?(x=b[1]==="x"?parseInt(b.slice(2),16):Number(b.slice(1)),u(x)):a[b]||S})})(d.content),w,m):m&&m!=="none"&&t.plugins.autoloader&&(C="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),d.attributes.id=C,t.plugins.autoloader.loadLanguages(m,function(){var y=document.getElementById(C);y&&(y.innerHTML=t.highlight(y.textContent,t.languages[m],m))}))}}),RegExp(t.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown})(ke),ke.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:ke.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+/},ke.hooks.add("after-tokenize",function(t){if(t.language==="graphql")for(var e=t.tokens.filter(function(C){return typeof C!="string"&&C.type!=="comment"&&C.type!=="scalar"}),n=0;n<e.length;){var r=e[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(p(["definition-mutation","punctuation"])&&m(1).content==="("){n+=2;var l=g(/^\($/,/^\)$/);if(l===-1)continue;for(;n<l;n++){var c=m(0);c.type==="variable"&&(_(c,"variable-input"),i.push(c.content))}n=l+1}if(p(["punctuation","property-query"])&&m(0).content==="{"&&(n++,_(m(0),"property-mutation"),0<i.length)){var a=g(/^\{$/,/^\}$/);if(a!==-1)for(var u=n;u<a;u++){var d=e[u];d.type==="variable"&&0<=i.indexOf(d.content)&&_(d,"variable-input")}}}}function m(C){return e[n+C]}function p(C,w){w=w||0;for(var y=0;y<C.length;y++){var S=m(y+w);if(!S||S.type!==C[y])return}return 1}function g(C,w){for(var y=1,S=n;S<e.length;S++){var b=e[S],x=b.content;if(b.type==="punctuation"&&typeof x=="string"){if(C.test(x))y++;else if(w.test(x)&&--y===0)return S}}return-1}function _(C,w){var y=C.alias;y?Array.isArray(y)||(C.alias=y=[y]):C.alias=y=[],y.push(w)}}),ke.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(t){var e=t.languages.javascript["template-string"],n=e.pattern.source,r=e.inside.interpolation,i=r.inside["interpolation-punctuation"],l=r.pattern.source;function c(p,g){if(t.languages[p])return{pattern:RegExp("((?:"+g+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:p}}}}function a(p,g,_){return p={code:p,grammar:g,language:_},t.hooks.run("before-tokenize",p),p.tokens=t.tokenize(p.code,p.grammar),t.hooks.run("after-tokenize",p),p.tokens}function u(p,g,_){var y=t.tokenize(p,{interpolation:{pattern:RegExp(l),lookbehind:!0}}),C=0,w={},y=a(y.map(function(b){if(typeof b=="string")return b;for(var x,k,b=b.content;p.indexOf((k=C++,x="___"+_.toUpperCase()+"_"+k+"___"))!==-1;);return w[x]=b,x}).join(""),g,_),S=Object.keys(w);return C=0,(function b(x){for(var k=0;k<x.length;k++){if(C>=S.length)return;var j,N,D,E,O,L,z,H=x[k];typeof H=="string"||typeof H.content=="string"?(j=S[C],(z=(L=typeof H=="string"?H:H.content).indexOf(j))!==-1&&(++C,N=L.substring(0,z),O=w[j],D=void 0,(E={})["interpolation-punctuation"]=i,(E=t.tokenize(O,E)).length===3&&((D=[1,1]).push.apply(D,a(E[1],t.languages.javascript,"javascript")),E.splice.apply(E,D)),D=new t.Token("interpolation",E,r.alias,O),E=L.substring(z+j.length),O=[],N&&O.push(N),O.push(D),E&&(b(L=[E]),O.push.apply(O,L)),typeof H=="string"?(x.splice.apply(x,[k,1].concat(O)),k+=O.length-1):H.content=O)):(z=H.content,Array.isArray(z)?b(z):b([z]))}})(y),new t.Token(_,y,"language-"+_,p)}t.languages.javascript["template-string"]=[c("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),c("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),c("svg",/\bsvg/.source),c("markdown",/\b(?:markdown|md)/.source),c("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),c("sql",/\bsql/.source),e].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function m(p){return typeof p=="string"?p:Array.isArray(p)?p.map(m).join(""):m(p.content)}t.hooks.add("after-tokenize",function(p){p.language in d&&(function g(_){for(var C=0,w=_.length;C<w;C++){var y,S,b,x=_[C];typeof x!="string"&&(y=x.content,Array.isArray(y)?x.type==="template-string"?(x=y[1],y.length===3&&typeof x!="string"&&x.type==="embedded-code"&&(S=m(x),x=x.alias,x=Array.isArray(x)?x[0]:x,b=t.languages[x])&&(y[1]=u(S,b,x))):g(y):typeof y!="string"&&g([y]))}})(p.tokens)})})(ke),(function(t){t.languages.typescript=t.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/}),t.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 t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.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:e}}}}),t.languages.ts=t.languages.typescript})(ke),(function(t){var e=t.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";t.languages.jsdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),t.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\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:e,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 n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:e.string,number:e.number,boolean:e.boolean,keyword:t.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:e,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)})(ke),(function(t){t.languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),t.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 t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.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})})(ke),ke.languages.n4js=ke.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/}),ke.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ke.languages.n4jsd=ke.languages.n4js,(function(t){function e(c,a){return RegExp(c.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}t.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+t.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),t.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+t.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),t.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"}]}),t.languages.insertBefore("javascript","keyword",{imports:{pattern:e(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:t.languages.javascript},exports:{pattern:e(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:t.languages.javascript}}),t.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"}),t.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),t.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:e(/(\.\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 n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var l=n[r],i=t.languages.javascript[l],l=(i=t.util.type(i)==="RegExp"?t.languages.javascript[l]={pattern:i}:i).inside||{};(i.inside=l)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(ke),(function(t){var e=t.util.clone(t.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function l(u,d){return u=u.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(u,d)}i=l(i).source,t.languages.jsx=t.languages.extend("markup",e),t.languages.jsx.tag.pattern=l(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=e.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:l(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:l(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);function c(u){for(var d=[],m=0;m<u.length;m++){var p=u[m],g=!1;typeof p!="string"&&(p.type==="tag"&&p.content[0]&&p.content[0].type==="tag"?p.content[0].content[0].content==="</"?0<d.length&&d[d.length-1].tagName===a(p.content[0].content[1])&&d.pop():p.content[p.content.length-1].content!=="/>"&&d.push({tagName:a(p.content[0].content[1]),openedBraces:0}):0<d.length&&p.type==="punctuation"&&p.content==="{"?d[d.length-1].openedBraces++:0<d.length&&0<d[d.length-1].openedBraces&&p.type==="punctuation"&&p.content==="}"?d[d.length-1].openedBraces--:g=!0),(g||typeof p=="string")&&0<d.length&&d[d.length-1].openedBraces===0&&(g=a(p),m<u.length-1&&(typeof u[m+1]=="string"||u[m+1].type==="plain-text")&&(g+=a(u[m+1]),u.splice(m+1,1)),0<m&&(typeof u[m-1]=="string"||u[m-1].type==="plain-text")&&(g=a(u[m-1])+g,u.splice(m-1,1),m--),u[m]=new t.Token("plain-text",g,null,g)),p.content&&typeof p.content!="string"&&c(p.content)}}var a=function(u){return u?typeof u=="string"?u:typeof u.content=="string"?u.content:u.content.map(a).join(""):""};t.hooks.add("after-tokenize",function(u){u.language!=="jsx"&&u.language!=="tsx"||c(u.tokens)})})(ke),(function(t){var e=t.util.clone(t.languages.typescript),e=(t.languages.tsx=t.languages.extend("jsx",e),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"],t.languages.tsx.tag);e.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+e.pattern.source+")",e.pattern.flags),e.lookbehind=!0})(ke),ke.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:/[{}[\]();,.:\\]/},ke.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=ke.languages.swift}),(function(t){t.languages.kotlin=t.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 t.languages.kotlin["class-name"];var e={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:e},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:e},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(ke),ke.languages.c=ke.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|[?:~]|[-+*/%&|^!=<>]=?/}),ke.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ke.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},ke.languages.c.string],char:ke.languages.c.char,comment:ke.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:ke.languages.c}}}}),ke.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 ke.languages.c.boolean,ke.languages.objectivec=ke.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 ke.languages.objectivec["class-name"],ke.languages.objc=ke.languages.objectivec,ke.languages.reason=ke.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/}),ke.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 ke.languages.reason.function,(function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(ke),ke.languages.go=ke.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/}),ke.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ke.languages.go["class-name"],(function(t){var e=/\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/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.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:e,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/}),t.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 n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.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:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(ke),ke.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:/[{}[\];(),.:]/},ke.languages.python["string-interpolation"].inside.interpolation.inside.rest=ke.languages.python,ke.languages.py=ke.languages.python,ke.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"}},ke.languages.webmanifest=ke.languages.json;var cl={};NF(cl,{dracula:()=>MF,duotoneDark:()=>LF,duotoneLight:()=>PF,github:()=>BF,gruvboxMaterialDark:()=>pH,gruvboxMaterialLight:()=>gH,jettwaveDark:()=>oH,jettwaveLight:()=>lH,nightOwl:()=>HF,nightOwlLight:()=>UF,oceanicNext:()=>qF,okaidia:()=>GF,oneDark:()=>uH,oneLight:()=>fH,palenight:()=>YF,shadesOfPurple:()=>QF,synthwave84:()=>JF,ultramin:()=>tH,vsDark:()=>GE,vsLight:()=>sH});var DF={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)"}}]},MF=DF,OF={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"}}]},LF=OF,IF={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"}}]},PF=IF,zF={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"}}]},BF=zF,FF={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)"}}]},HF=FF,$F={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)"}}]},UF=$F,br={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},VF={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:br.keyword}},{types:["attr-value"],style:{color:br.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:br.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:br.primitive}},{types:["boolean"],style:{color:br.boolean}},{types:["tag"],style:{color:br.tag}},{types:["string"],style:{color:br.string}},{types:["punctuation"],style:{color:br.string}},{types:["selector","char","builtin","inserted"],style:{color:br.char}},{types:["function"],style:{color:br.function}},{types:["operator","entity","url","variable"],style:{color:br.variable}},{types:["keyword"],style:{color:br.keyword}},{types:["atrule","class-name"],style:{color:br.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},qF=VF,WF={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"}}]},GF=WF,KF={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)"}}]},YF=KF,XF={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)"}}]},QF=XF,ZF={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"}}]},JF=ZF,eH={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)"}}]},tH=eH,nH={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)"}}]},GE=nH,rH={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)"}}]},sH=rH,iH={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"}}]},oH=iH,aH={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"}}]},lH=aH,cH={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%)"}}]},uH=cH,dH={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%)"}}]},fH=dH,hH={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"}}]},pH=hH,mH={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"}}]},gH=mH,vH=t=>R.useCallback(e=>{var n=e,{className:r,style:i,line:l}=n,c=WE(n,["className","style","line"]);const a=Qf(ps({},c),{className:cf("token-line",r)});return typeof t=="object"&&"plain"in t&&(a.style=t.plain),typeof i=="object"&&(a.style=ps(ps({},a.style||{}),i)),a},[t]),yH=t=>{const e=R.useCallback(({types:n,empty:r})=>{if(t!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return t[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>t[i]))}},[t]);return R.useCallback(n=>{var r=n,{token:i,className:l,style:c}=r,a=WE(r,["token","className","style"]);const u=Qf(ps({},a),{className:cf("token",...i.types,l),children:i.content,style:e(i)});return c!=null&&(u.style=ps(ps({},u.style||{}),c)),u},[e])},bH=/\r\n|\r|\n/,P_=t=>{t.length===0?t.push({types:["plain"],content:`
600
+ `,empty:!0}):t.length===1&&t[0].content===""&&(t[0].content=`
601
+ `,t[0].empty=!0)},z_=(t,e)=>{const n=t.length;return n>0&&t[n-1]===e?t:t.concat(e)},xH=t=>{const e=[[]],n=[t],r=[0],i=[t.length];let l=0,c=0,a=[];const u=[a];for(;c>-1;){for(;(l=r[c]++)<i[c];){let d,m=e[c];const g=n[c][l];if(typeof g=="string"?(m=c>0?m:["plain"],d=g):(m=z_(m,g.type),g.alias&&(m=z_(m,g.alias)),d=g.content),typeof d!="string"){c++,e.push(m),n.push(d),r.push(0),i.push(d.length);continue}const _=d.split(bH),C=_.length;a.push({types:m,content:_[0]});for(let w=1;w<C;w++)P_(a),u.push(a=[]),a.push({types:m,content:_[w]})}c--,e.pop(),n.pop(),r.pop(),i.pop()}return P_(a),u},B_=xH,_H=({prism:t,code:e,grammar:n,language:r})=>R.useMemo(()=>{if(n==null)return B_([e]);const i={code:e,grammar:n,language:r,tokens:[]};return t.hooks.run("before-tokenize",i),i.tokens=t.tokenize(e,n),t.hooks.run("after-tokenize",i),B_(i.tokens)},[e,n,r,t]),SH=(t,e)=>{const{plain:n}=t,r=t.styles.reduce((i,l)=>{const{languages:c,style:a}=l;return c&&!c.includes(e)||l.types.forEach(u=>{const d=ps(ps({},i[u]),a);i[u]=d}),i},{});return r.root=n,r.plain=Qf(ps({},n),{backgroundColor:void 0}),r},wH=SH,CH=({children:t,language:e,code:n,theme:r,prism:i})=>{const l=e.toLowerCase(),c=wH(r,l),a=vH(c),u=yH(c),d=i.languages[l],m=_H({prism:i,language:l,code:n,grammar:d});return t({tokens:m,className:`prism-code language-${l}`,style:c!=null?c.root:{},getLineProps:a,getTokenProps:u})},Zf=t=>R.createElement(CH,Qf(ps({},t),{prism:t.prism||ke,theme:t.theme||GE,code:t.code,language:t.language}));/*! Bundled license information:
602
+
603
+ prismjs/prism.js:
604
+ (**
605
+ * Prism: Lightweight, robust, elegant syntax highlighting
606
+ *
607
+ * @license MIT <https://opensource.org/licenses/MIT>
608
+ * @author Lea Verou <https://lea.verou.me>
609
+ * @namespace
610
+ * @public
611
+ *)
612
+ */const kH=cl.oneDark,EH=cl.nightOwl,KE=R.memo(function(e){const n=he.c(11),{children:r,className:i,inverted:l}=e,c=l===void 0?!1:l;let a;n[0]!==c?(a={code(_){const{className:C,children:w,...y}=_,S=/language-(\w+)/.exec(C||""),b=S?S[1]:"",x=!b,k=Array.isArray(w)?w.join(""):String(w);return!x&&b?h.jsx("div",{className:"w-full max-w-full overflow-x-auto my-2 min-w-0",children:h.jsx(Zf,{theme:c?EH:kH,code:k.trim(),language:b,children:AH})}):h.jsx("code",{className:Ae("px-1.5 py-0.5 rounded text-sm font-mono",c?"bg-primary-foreground/20 text-primary-foreground":"bg-muted",C),...y,children:w})},a(_){const{href:C,children:w,...y}=_;return h.jsx("a",{href:C,target:"_blank",rel:"noopener noreferrer",className:Ae("underline underline-offset-2 transition-colors",c?"text-primary-foreground/80 hover:text-primary-foreground":"text-primary hover:text-primary/80"),...y,children:w})},p(_){const{children:C}=_;return h.jsx("p",{className:"last:mb-0 leading-relaxed wrap-break-words",children:C})},ul(_){const{children:C}=_;return h.jsx("ul",{className:"list-outside list-disc pl-8",children:C})},ol(_){const{children:C}=_;return h.jsx("ol",{className:"list-outside list-decimal pl-8",children:C})},li(_){const{children:C,className:w}=_,y=w==null?void 0:w.includes("nested");return h.jsx("li",{className:Ae("leading-snug",y&&"ml-8"),children:C})},h1(_){const{children:C}=_;return h.jsx("h1",{className:"text-lg font-semibold mb-1.5 mt-3 first:mt-0",children:C})},h2(_){const{children:C}=_;return h.jsx("h2",{className:"text-base font-semibold mb-1.5 mt-2.5 first:mt-0",children:C})},h3(_){const{children:C}=_;return h.jsx("h3",{className:"text-sm font-semibold mb-1 mt-2 first:mt-0",children:C})},blockquote(_){const{children:C}=_;return h.jsx("blockquote",{className:Ae("border-l-2 pl-3 my-1.5 italic",c?"border-primary-foreground/40 text-primary-foreground/70":"border-muted-foreground/40 text-muted-foreground"),children:C})},strong(_){const{children:C}=_;return h.jsx("strong",{className:Ae("font-semibold",c&&"text-primary-foreground"),children:C})},em(_){const{children:C}=_;return h.jsx("em",{className:"italic",children:C})},hr(){return h.jsx("hr",{className:Ae("my-3",c?"border-primary-foreground/30":"border-border")})},table(_){const{children:C}=_;return h.jsx("div",{className:"my-2 overflow-x-auto max-w-full",children:h.jsx("table",{className:"w-full border-collapse text-sm",children:C})})},th(_){const{children:C}=_;return h.jsx("th",{className:Ae("border border-border px-2 py-1.5 text-left font-semibold",c?"bg-primary-foreground/10 text-primary-foreground":"bg-muted"),children:C})},td(_){const{children:C}=_;return h.jsx("td",{className:Ae("border px-2 py-1.5",c?"border-primary-foreground/20":"border-border"),children:C})}},n[0]=c,n[1]=a):a=n[1];const u=a;let d;n[2]!==i?(d=Ae("w-full markdown-render overflow-x-auto wrap-break-words break",i),n[2]=i,n[3]=d):d=n[3];let m;n[4]===Symbol.for("react.memo_cache_sentinel")?(m=[_F],n[4]=m):m=n[4];let p;n[5]!==r||n[6]!==u?(p=h.jsx(lz,{remarkPlugins:m,components:u,children:r}),n[5]=r,n[6]=u,n[7]=p):p=n[7];let g;return n[8]!==d||n[9]!==p?(g=h.jsx("div",{className:d,children:p}),n[8]=d,n[9]=p,n[10]=g):g=n[10],g});function AH(t){const{className:e,style:n,tokens:r,getLineProps:i,getTokenProps:l}=t;return h.jsx("pre",{className:Ae("rounded-lg text-sm p-3",e),style:n,children:r.map((c,a)=>h.jsx("div",{...i({line:c}),children:c.map((u,d)=>h.jsx("span",{...l({token:u})},d))},a))})}const NH=cl.oneDark;function F_(t){const e=he.c(8),{content:n,language:r,showLineNumbers:i}=t,l=i===void 0?!0:i;let c,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Ae("h-full overflow-auto bg-[#282c34] chat-transcript-scrollbar"),a={WebkitOverflowScrolling:"touch"},e[0]=c,e[1]=a):(c=e[0],a=e[1]);const u=r||"plaintext";let d;e[2]!==l?(d=p=>{const{style:g,tokens:_,getLineProps:C,getTokenProps:w}=p;return h.jsx("pre",{className:"text-sm p-4 min-h-full font-mono",style:g,children:_.map((y,S)=>h.jsxs("div",{...C({line:y}),className:"table-row",children:[l&&h.jsx("span",{className:"table-cell pr-4 text-right select-none opacity-50 text-xs w-12",children:S+1}),h.jsx("span",{className:"table-cell",children:y.map((b,x)=>h.jsx("span",{...w({token:b})},x))})]},S))})},e[2]=l,e[3]=d):d=e[3];let m;return e[4]!==n||e[5]!==u||e[6]!==d?(m=h.jsx("div",{className:c,style:a,children:h.jsx(Zf,{theme:NH,code:n,language:u,children:d})}),e[4]=n,e[5]=u,e[6]=d,e[7]=m):m=e[7],m}function Ym(t){const e=he.c(13),{icon:n,title:r,reason:i,name:l}=t;let c;e[0]!==n?(c=h.jsx(n,{className:"size-10 text-muted-foreground mb-4"}),e[0]=n,e[1]=c):c=e[1];let a;e[2]!==r?(a=h.jsx("p",{className:"text-sm font-medium mb-1",children:r}),e[2]=r,e[3]=a):a=e[3];let u;e[4]!==i?(u=h.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:i}),e[4]=i,e[5]=u):u=e[5];let d;e[6]!==l?(d=h.jsx("p",{className:"text-xs text-muted-foreground",children:l}),e[6]=l,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==a||e[10]!==u||e[11]!==d?(m=h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[c,a,u,d]}),e[8]=c,e[9]=a,e[10]=u,e[11]=d,e[12]=m):m=e[12],m}function RH(t){const e=he.c(20),{preview:n}=t;if(n.kind==="markdown"){let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={WebkitOverflowScrolling:"touch"},e[0]=r):r=e[0];let i;return e[1]!==n.content?(i=h.jsx("div",{className:"h-full overflow-auto p-6 chat-transcript-scrollbar",style:r,children:h.jsx(KE,{children:n.content})}),e[1]=n.content,e[2]=i):i=e[2],i}if(n.kind==="code"){let r;return e[3]!==n.content||e[4]!==n.language||e[5]!==n.path?(r=h.jsx(F_,{content:n.content,path:n.path,language:n.language,showLineNumbers:!0}),e[3]=n.content,e[4]=n.language,e[5]=n.path,e[6]=r):r=e[6],r}if(n.kind==="text"){let r;return e[7]!==n.content||e[8]!==n.language||e[9]!==n.path?(r=h.jsx(F_,{content:n.content,path:n.path,language:n.language,showLineNumbers:!1}),e[7]=n.content,e[8]=n.language,e[9]=n.path,e[10]=r):r=e[10],r}if(n.kind==="binary"){let r;return e[11]!==n.name||e[12]!==n.reason?(r=h.jsx(Ym,{icon:_A,title:"Binary file",reason:n.reason,name:n.name}),e[11]=n.name,e[12]=n.reason,e[13]=r):r=e[13],r}if(n.kind==="unsupported"){let r;return e[14]!==n.name||e[15]!==n.reason?(r=h.jsx(Ym,{icon:yA,title:"Unsupported file",reason:n.reason,name:n.name}),e[14]=n.name,e[15]=n.reason,e[16]=r):r=e[16],r}if(n.kind==="too_large"){let r;return e[17]!==n.name||e[18]!==n.reason?(r=h.jsx(Ym,{icon:pA,title:"File too large",reason:n.reason,name:n.name}),e[17]=n.name,e[18]=n.reason,e[19]=r):r=e[19],r}return null}function jH({workspaceId:t,path:e,serverUrl:n,apiToken:r,enabled:i}){const{fetchWithAuth:l}=ns(),[c,a]=R.useState(null),[u,d]=R.useState(!1),[m,p]=R.useState(null),g=R.useRef(null),_=R.useCallback(async()=>{if(!i||!t||!e||!n||!r)return;g.current&&g.current.abort();const w=new AbortController;g.current=w,d(!0),p(null);try{const y=`/api/workspaces/${t}/file-preview?path=${encodeURIComponent(e)}`,S=await l(y,{signal:w.signal},{serverUrl:n,token:r});if(!S.ok){let x="Failed to fetch file preview";try{x=(await S.json()).message||x}catch{x=S.statusText||x}p(x),a(null),d(!1);return}const b=await S.json();a(b),d(!1)}catch(y){if(y instanceof Error&&y.name==="AbortError")return;const S=y instanceof Error?y.message:"Unknown error occurred";p(S),a(null),d(!1)}},[i,t,e,n,r,l]),C=R.useCallback(()=>{_()},[_]);return R.useEffect(()=>(_(),()=>{g.current&&g.current.abort()}),[_]),{data:c,loading:u,error:m,reload:C}}function TH(t){const e=he.c(37),{workspaceId:n,target:r,serverUrl:i,apiToken:l,open:c,onOpenChange:a}=t,u=r==null?void 0:r.path,d=c&&!!r&&!!n;let m;e[0]!==l||e[1]!==i||e[2]!==u||e[3]!==d||e[4]!==n?(m={workspaceId:n,path:u,serverUrl:i,apiToken:l,enabled:d},e[0]=l,e[1]=i,e[2]=u,e[3]=d,e[4]=n,e[5]=m):m=e[5];const{data:p,loading:g,error:_,reload:C}=jH(m);if(!r)return null;const w=DH;let y;e[6]!==r.name?(y=h.jsx(Qi,{className:"text-base font-semibold truncate",children:r.name}),e[6]=r.name,e[7]=y):y=e[7];let S;e[8]!==r.path?(S=h.jsx($o,{className:"text-xs text-muted-foreground truncate",children:r.path}),e[8]=r.path,e[9]=S):S=e[9];let b;e[10]!==p?(b=p&&h.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[h.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground capitalize",children:p.kind}),h.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:"read-only"}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:[w(p.size),p.language&&` · ${p.language}`]})]}),e[10]=p,e[11]=b):b=e[11];let x;e[12]!==y||e[13]!==S||e[14]!==b?(x=h.jsxs(Xi,{className:"px-6 pt-5 pb-3 border-b border-border shrink-0",children:[y,S,b]}),e[12]=y,e[13]=S,e[14]=b,e[15]=x):x=e[15];let k;e[16]!==g?(k=g&&h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(Wt,{className:"size-5 animate-spin text-muted-foreground"})}),e[16]=g,e[17]=k):k=e[17];let j;e[18]!==_||e[19]!==g||e[20]!==C?(j=_&&!g&&h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[h.jsx(To,{className:"size-8 text-muted-foreground mb-3"}),h.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:_}),h.jsxs(Te,{variant:"outline",size:"sm",onClick:C,children:[h.jsx(Pi,{className:"size-3.5 mr-1.5"}),"Retry"]})]}),e[18]=_,e[19]=g,e[20]=C,e[21]=j):j=e[21];let N;e[22]!==p||e[23]!==_||e[24]!==g?(N=p&&!g&&!_&&h.jsx(RH,{preview:p}),e[22]=p,e[23]=_,e[24]=g,e[25]=N):N=e[25];let D;e[26]!==N||e[27]!==k||e[28]!==j?(D=h.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden",children:[k,j,N]}),e[26]=N,e[27]=k,e[28]=j,e[29]=D):D=e[29];let E;e[30]!==D||e[31]!==x?(E=h.jsxs(Yi,{showCloseButton:!0,className:"sm:max-w-5xl w-[min(92vw,1100px)] h-[85vh] flex flex-col p-0 gap-0",children:[x,D]}),e[30]=D,e[31]=x,e[32]=E):E=e[32];let O;return e[33]!==a||e[34]!==c||e[35]!==E?(O=h.jsx(Ki,{open:c,onOpenChange:a,children:E}),e[33]=a,e[34]=c,e[35]=E,e[36]=O):O=e[36],O}function DH(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}function MH(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function Jf(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}function OH(){return!!(globalThis||window).isTauri}const LH="/assets/chat-finish-Kb8mnIhV.mp3",IH="/assets/chat-permission-BltPnMpz.mp3",PH={chatFinish:LH,chatPermission:IH};function zH(){const t=R.useRef(null),e=R.useRef({}),n=R.useRef(!1),r=R.useRef(null),i=R.useRef(0),l=R.useCallback(async()=>{let C=t.current;return(!C||C.state==="closed")&&(C=new AudioContext,t.current=C,e.current={}),C.state==="suspended"&&await C.resume(),C},[]),c=R.useCallback(async(C,w)=>{var y;if(e.current[C])return(y=e.current[C])!=null?y:null;try{const S=await fetch(PH[C]);if(!S.ok)throw new Error(`HTTP ${S.status}`);const b=await S.arrayBuffer(),x=await w.decodeAudioData(b);return e.current[C]=x,x}catch(S){return console.warn("[useNotificationSound] Failed to load",C,S),null}},[]),a=R.useCallback((C,w)=>{try{const y=w.createBufferSource();y.buffer=C,y.connect(w.destination),y.start(0)}catch(y){console.warn("[useNotificationSound] Playback error",y)}},[]),u=R.useCallback(async()=>{if(n.current)return;const C=await l();if(C.state!=="running")return;const w=r.current;if(r.current=null,w){const y=await c(w,C);y&&a(y,C)}n.current=!0},[l,c,a]),d=R.useCallback(()=>{const C=()=>{document.removeEventListener("click",C),document.removeEventListener("keydown",C),document.removeEventListener("touchstart",C),u()};document.addEventListener("click",C),document.addEventListener("keydown",C),document.addEventListener("touchstart",C)},[u]),m=R.useCallback(async C=>{if(n.current){const w=await l();if(w.state!=="running")return;const y=await c(C,w);y&&a(y,w);return}r.current=C,d()},[l,c,a,d]),p=R.useCallback(async C=>{if(OH()){const w=Date.now();if(w>i.current)try{await Jf("play_sound",{soundKey:C});return}catch(y){const S=y instanceof Error?y.message:String(y);console.warn(`[useNotificationSound] Native playback failed for ${C}, error: ${S}`),i.current=w+1e3}}else await m(C)},[m]),g=R.useCallback(()=>{p("chatFinish")},[p]),_=R.useCallback(()=>{p("chatPermission")},[p]);return R.useEffect(()=>()=>{const C=t.current;C&&C.state!=="closed"&&C.close(),t.current=null},[]),{playChatFinishSound:g,playPermissionSound:_,playSound:p}}const BH=(t,e)=>t&&e?Wd(e,`/ws?token=${t}`):null,FH=1e4,HH=3e4,$H=1e3,UH=3e4;function VH({apiToken:t,serverUrl:e,wsRef:n,serverEpochRef:r,currentSessionIdRef:i,clearPendingPermissions:l,handleLogout:c,setWs:a,setConnected:u,setAuthError:d,setConnectionTimedOut:m,setRetryCount:p,setNextRetryIn:g,setReconnectTrigger:_,reconnectTrigger:C,connected:w,connectionTimedOut:y,retryCount:S,onMessage:b}){const x=R.useRef(Date.now());R.useEffect(()=>{if(!t||!e)return;const k=BH(t,e);if(!k)return;const j=new WebSocket(k),N=r.current;return j.onopen=()=>{r.current===N&&(x.current=Date.now(),u(!0),d(null),p(0),m(!1),l(),i.current&&j.send(JSON.stringify({type:"session.resume",sessionId:i.current})),j.send(JSON.stringify({type:"permissions.sync"})))},j.onclose=D=>{r.current===N&&(u(!1),(D.code===1008||D.code===401)&&c())},j.onerror=D=>{r.current===N&&console.error("WebSocket error:",D)},j.onmessage=D=>{if(r.current!==N)return;x.current=Date.now();const E=JSON.parse(D.data);b(E)},a(j),()=>j.close()},[t,e,c,C]),R.useEffect(()=>{if(t&&e&&!w&&!y){const k=setTimeout(()=>{w||m(!0)},FH);return()=>clearTimeout(k)}},[t,e,w,y,m]),R.useEffect(()=>{const k=r.current;if(y&&!w&&t&&e){const j=Math.min($H*Math.pow(2,S),HH);let N=Math.floor(j/1e3);g(N);const D=setInterval(()=>{N-=1,g(Math.max(0,N))},1e3),E=setTimeout(()=>{r.current===k&&(p(O=>O+1),_(O=>O+1))},j);return()=>{clearInterval(D),clearTimeout(E)}}},[y,w,t,e,S,r,_,g]),R.useEffect(()=>{const k=r.current,j=()=>{if(r.current!==k||document.visibilityState!=="visible")return;const N=n.current;if(!(!N||!t||!e))if(N.readyState===WebSocket.OPEN){if(Date.now()-x.current<UH)return;N.onclose=null,N.close(),u(!1),p(0),m(!1),_(E=>E+1)}else(N.readyState===WebSocket.CLOSED||N.readyState===WebSocket.CLOSING)&&(u(!1),p(0),m(!1),_(D=>D+1))};return document.addEventListener("visibilitychange",j),()=>document.removeEventListener("visibilitychange",j)},[t,e,r,_,u,p,m,x]),R.useEffect(()=>{const k=r.current,j=()=>{if(r.current!==k||!t||!e)return;const N=n.current;N&&N.readyState===WebSocket.OPEN||(u(!1),p(0),m(!1),_(D=>D+1))};return window.addEventListener("online",j),()=>window.removeEventListener("online",j)},[t,e,r,_,u,p,m])}const qH=t=>t?Xn(t,"/api"):null;function WH(t){const e=he.c(38),{apiToken:n,serverUrl:r,reconnectTrigger:i,serverEpochRef:l,fetchWithAuth:c,clearSwitchingState:a,setSessions:u,setPreconfigs:d,setPrompts:m,setModels:p,setDefaultModel:g,setProviderStatuses:_,setWorkspaces:C,setActiveWorkspace:w,activeWorkspace:y,setIsLoadingServerData:S,setAuthError:b,pendingWorkspaceIdRef:x}=t,k=R.useRef(null);let j,N;e[0]!==y?(j=()=>{y&&localStorage.setItem("activeWorkspaceId",y.id)},N=[y],e[0]=y,e[1]=j,e[2]=N):(j=e[1],N=e[2]),R.useEffect(j,N);let D;e[3]!==n||e[4]!==a||e[5]!==c||e[6]!==x||e[7]!==l||e[8]!==r||e[9]!==w||e[10]!==b||e[11]!==g||e[12]!==S||e[13]!==p||e[14]!==d||e[15]!==m||e[16]!==_||e[17]!==u||e[18]!==C?(D=()=>{var H;if(!n||!r)return;(H=k.current)==null||H.abort(),k.current=new AbortController;const O=k.current.signal,L=qH(r);if(!L)return;const z=l.current;return S(!0),Promise.all([c(`${L}/sessions`,{signal:O}).then(JH),c(`${L}/preconfigs`,{signal:O}).then(ZH),c(`${L}/prompts`,{signal:O}).then(QH),c(`${L}/models`,{signal:O}).then(XH),c(`${L}/workspaces`,{signal:O}).then(YH),c(`${L}/providers`,{signal:O}).then(KH)]).then($=>{const[q,G,W,X,Y,I]=$;if(l.current!==z)return;u(q.sessions||[]),d(G.preconfigs||[]),m(W.prompts||[]),p((X.models||[]).filter(GH)),g(X.defaultModel||"gpt-4o"),_(I.providers||[]);const M=Y.workspaces||[];if(C(M),x.current){const P=M.find(F=>F.id===x.current);P&&w(P),x.current=null}else{const P=localStorage.getItem("activeWorkspaceId"),F=M.find(B=>B.id===P);w(F||M[0])}a(),S(!1)}).catch($=>{var q;if($.name==="AbortError"){console.log("Fetch aborted due to server switch");return}console.error("Failed to load server data:",$),S(!1),(q=$.message)!=null&&q.includes("Unauthorized")||b("Failed to connect to server")}),()=>{var $;($=k.current)==null||$.abort()}},e[3]=n,e[4]=a,e[5]=c,e[6]=x,e[7]=l,e[8]=r,e[9]=w,e[10]=b,e[11]=g,e[12]=S,e[13]=p,e[14]=d,e[15]=m,e[16]=_,e[17]=u,e[18]=C,e[19]=D):D=e[19];let E;e[20]!==n||e[21]!==a||e[22]!==c||e[23]!==x||e[24]!==i||e[25]!==l||e[26]!==r||e[27]!==w||e[28]!==b||e[29]!==g||e[30]!==S||e[31]!==p||e[32]!==d||e[33]!==m||e[34]!==_||e[35]!==u||e[36]!==C?(E=[n,r,i,l,c,a,u,d,m,p,g,_,C,w,S,b,x],e[20]=n,e[21]=a,e[22]=c,e[23]=x,e[24]=i,e[25]=l,e[26]=r,e[27]=w,e[28]=b,e[29]=g,e[30]=S,e[31]=p,e[32]=d,e[33]=m,e[34]=_,e[35]=u,e[36]=C,e[37]=E):E=e[37],R.useEffect(D,E)}function GH(t){var e;return(e=t.runtimeStatus)==null?void 0:e.usable}function KH(t){return t.json()}function YH(t){return t.json()}function XH(t){return t.json()}function QH(t){return t.json()}function ZH(t){return t.json()}function JH(t){return t.json()}function e$(t){const e=he.c(108),{ws:n,currentSession:r,sessions:i,workspaces:l,activeWorkspace:c,currentModel:a,streamingSessionIds:u,isCompacting:d,primaryPreconfigs:m,setCurrentSession:p,setActiveWorkspace:g,setCompactionSuccess:_,setCurrentModel:C,setSelectedVariant:w,removePendingPermissionByToolCallId:y,removePendingPermissionsBySessionId:S,clearStreamingSessions:b,pendingSessionCreateRef:x,partAppendRafRef:k,pendingPartAppendsRef:j,skipFinishSoundSessionIdsRef:N}=t;let D;e[0]!==n?(D=(Be,We)=>{n&&n.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:Be,...We}))},e[0]=n,e[1]=D):D=e[1];const E=D;let O;e[2]!==(c==null?void 0:c.id)||e[3]!==k||e[4]!==j||e[5]!==x||e[6]!==E||e[7]!==_?(O=(Be,We)=>{x.current=!0,k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),j.current.clear(),E("session.create",{preconfigId:Be,title:We,workspaceId:c==null?void 0:c.id}),_(!1)},e[2]=c==null?void 0:c.id,e[3]=k,e[4]=j,e[5]=x,e[6]=E,e[7]=_,e[8]=O):O=e[8];const L=O;let z;e[9]!==(c==null?void 0:c.id)||e[10]!==b||e[11]!==k||e[12]!==j||e[13]!==S||e[14]!==E||e[15]!==i||e[16]!==g||e[17]!==_||e[18]!==p||e[19]!==N||e[20]!==l?(z=Be=>{S(Be),N.current=new Set(tg.getState().streamingSessionIds),b(),_(!1);const We=i.find(ze=>ze.id===Be);if(We!=null&&We.workspaceId&&We.workspaceId!==(c==null?void 0:c.id)){const ze=l.find(rt=>rt.id===We.workspaceId);ze&&g(ze)}k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),j.current.clear(),We&&p(We),E("session.resume",{sessionId:Be})},e[9]=c==null?void 0:c.id,e[10]=b,e[11]=k,e[12]=j,e[13]=S,e[14]=E,e[15]=i,e[16]=g,e[17]=_,e[18]=p,e[19]=N,e[20]=l,e[21]=z):z=e[21];const H=z;let $;e[22]!==E?($=Be=>{E("session.close",{sessionId:Be})},e[22]=E,e[23]=$):$=e[23];const q=$;let G;e[24]!==E?(G=(Be,We)=>{E("session.revert",{sessionId:Be,messageId:We})},e[24]=E,e[25]=G):G=e[25];const W=G;let X;e[26]!==E?(X=(Be,We)=>{E("session.fork",{sessionId:Be,messageId:We})},e[26]=E,e[27]=X):X=e[27];const Y=X;let I;e[28]!==E?(I=Be=>{E("session.compact",{sessionId:Be})},e[28]=E,e[29]=I):I=e[29];const M=I;let P;e[30]!==E?(P=Be=>{E("session.reopen",{sessionId:Be})},e[30]=E,e[31]=P):P=e[31];const F=P;let B;e[32]!==E?(B=Be=>{E("session.delete",{sessionId:Be})},e[32]=E,e[33]=B):B=e[33];const Q=B;let J;e[34]!==r||e[35]!==E?(J=Be=>{r&&E("session.update",{sessionId:r.id,preconfigId:Be})},e[34]=r,e[35]=E,e[36]=J):J=e[36];const ee=J;let K;e[37]!==r||e[38]!==E||e[39]!==C||e[40]!==w?(K=(Be,We)=>{C(Be),w(null),r&&E("session.update_model",{sessionId:r.id,modelId:Be,providerId:We})},e[37]=r,e[38]=E,e[39]=C,e[40]=w,e[41]=K):K=e[41];const V=K;let te;e[42]!==a||e[43]!==r||e[44]!==E||e[45]!==w?(te=Be=>{r&&(E("session.update_model",{sessionId:r.id,modelId:r.selectedModel||a,providerId:r.selectedProvider||"openai",variant:Be}),w(Be))},e[42]=a,e[43]=r,e[44]=E,e[45]=w,e[46]=te):te=e[46];const re=te;let ae;e[47]!==E?(ae=(Be,We)=>{E("session.rename",{sessionId:Be,title:We})},e[47]=E,e[48]=ae):ae=e[48];const se=ae;let _e;e[49]!==r||e[50]!==H?(_e=()=>{r!=null&&r.parentId&&H(r.parentId)},e[49]=r,e[50]=H,e[51]=_e):_e=e[51];const Ee=_e;let De;e[52]!==E?(De=(Be,We,ze)=>{E("queue.add",{sessionId:Be,content:We,...ze&&ze.length>0?{attachments:ze}:{}})},e[52]=E,e[53]=De):De=e[53];const Ue=De;let ce;e[54]!==E?(ce=Be=>{E("queue.remove",{queueId:Be})},e[54]=E,e[55]=ce):ce=e[55];const je=ce;let be;e[56]!==Ue||e[57]!==r||e[58]!==d||e[59]!==E||e[60]!==u?(be=(Be,We)=>{!r||d||(r.runningAt||u.has(r.id)?Ue(r.id,Be,We):E("chat.message",{sessionId:r.id,content:Be,...We&&We.length>0?{attachments:We}:{}}))},e[56]=Ue,e[57]=r,e[58]=d,e[59]=E,e[60]=u,e[61]=be):be=e[61];const Ve=be;let qe;e[62]!==y||e[63]!==E?(qe=(Be,We,ze)=>{y(Be),E("permission.response",{toolCallId:Be,allowed:We,alwaysAllow:ze})},e[62]=y,e[63]=E,e[64]=qe):qe=e[64];const ye=qe;let Me;e[65]!==r||e[66]!==E?(Me=()=>{r&&E("session.interrupt",{sessionId:r.id})},e[65]=r,e[66]=E,e[67]=Me):Me=e[67];const Re=Me;let we;e[68]!==c||e[69]!==E?(we=()=>{c&&E("permission.list",{workspaceId:c.id})},e[68]=c,e[69]=E,e[70]=we):we=e[70];const oe=we;let me;e[71]!==E?(me=Be=>{E("provider.connect",{provider:Be})},e[71]=E,e[72]=me):me=e[72];const Ne=me;let Le;e[73]!==E?(Le=Be=>{E("provider.disconnect",{provider:Be})},e[73]=E,e[74]=Le):Le=e[74];const Ge=Le;let Ke;e[75]!==k||e[76]!==j||e[77]!==x||e[78]!==m||e[79]!==E||e[80]!==g||e[81]!==_||e[82]!==l?(Ke=Be=>{var ze;g(l.find(rt=>rt.id===Be)||null),x.current=!0,k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),j.current.clear();const We=(ze=m[0])==null?void 0:ze.id;E("session.create",{preconfigId:We,workspaceId:Be}),_(!1)},e[75]=k,e[76]=j,e[77]=x,e[78]=m,e[79]=E,e[80]=g,e[81]=_,e[82]=l,e[83]=Ke):Ke=e[83];const Je=Ke;let lt;return e[84]!==Ue||e[85]!==q||e[86]!==M||e[87]!==Ne||e[88]!==L||e[89]!==Je||e[90]!==Ge||e[91]!==Y||e[92]!==Re||e[93]!==Ee||e[94]!==ye||e[95]!==se||e[96]!==Q||e[97]!==oe||e[98]!==je||e[99]!==F||e[100]!==H||e[101]!==W||e[102]!==Ve||e[103]!==E||e[104]!==V||e[105]!==ee||e[106]!==re?(lt={sendMessage:E,createSession:L,resumeSession:H,closeSession:q,reopenSession:F,permanentlyDeleteSession:Q,handleRenameSession:se,revertSession:W,forkSession:Y,compactSession:M,addToQueue:Ue,removeFromQueue:je,sendChatMessage:Ve,handlePermissionResponse:ye,handleInterruptSession:Re,updateSessionPreconfig:ee,updateSessionModel:V,updateSessionVariant:re,handleNavigateBack:Ee,refreshPermissions:oe,connectProvider:Ne,disconnectProvider:Ge,createSessionInWorkspace:Je},e[84]=Ue,e[85]=q,e[86]=M,e[87]=Ne,e[88]=L,e[89]=Je,e[90]=Ge,e[91]=Y,e[92]=Re,e[93]=Ee,e[94]=ye,e[95]=se,e[96]=Q,e[97]=oe,e[98]=je,e[99]=F,e[100]=H,e[101]=W,e[102]=Ve,e[103]=E,e[104]=V,e[105]=ee,e[106]=re,e[107]=lt):lt=e[107],lt}const t$=400,n$=typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window);var aS;const r$=typeof navigator<"u"&&((aS=navigator.platform)==null?void 0:aS.toUpperCase().includes("MAC"))===!0;function s$(){const t=['[data-slot="dialog-overlay"][data-state="open"]','[data-slot="dialog-content"][data-state="open"]','[role="dialog"][data-state="open"]'];for(const n of t)if(document.querySelector(n))return!0;const e=document.querySelectorAll('[role="dialog"]');for(const n of e)if(n instanceof HTMLElement&&i$(n))return!0;return!1}function i$(t){if(!t.isConnected)return!1;const e=window.getComputedStyle(t);return e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity)>0&&t.getBoundingClientRect().width>0&&t.getBoundingClientRect().height>0}function o$(){var e,n;const t=document.activeElement;return t?!!((e=t.hasAttribute)!=null&&e.call(t,"data-chat-input")||(n=t.closest)!=null&&n.call(t,'[data-chat-input="true"]')):!1}function a$(t){const e=he.c(5),n=R.useRef(t);let r;e[0]!==t?(r=()=>{n.current=t},e[0]=t,e[1]=r):r=e[1],R.useLayoutEffect(r);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={lastEscTime:0,armed:!1},e[2]=i):i=e[2];const l=R.useRef(i);let c,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const u=d=>{if(d.isComposing||d.repeat||d.key==="Escape"&&s$())return;const{onCloseFocusedPanel:m,onFocusChatInput:p,onStopStreaming:g,onOpenSidebar:_,onOpenTerminal:C,onOpenFilesPanel:w,onNewWindow:y,onNewSession:S,onToggleViewMode:b,onToggleAutoFollow:x}=n.current;if(d.shiftKey&&d.key==="Escape"){d.preventDefault(),m();return}if(d.key==="Escape"&&!d.metaKey&&!d.ctrlKey){const D=o$(),E=Date.now(),{lastEscTime:O,armed:L}=l.current,z=E-O;if(D&&L&&z<t$){d.preventDefault(),l.current={lastEscTime:0,armed:!1},g();return}if(D){l.current={lastEscTime:E,armed:!0};return}d.preventDefault(),p();return}const k=d.target,j=k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable,N=d.metaKey||d.ctrlKey;if(!(j&&!N)){if(!n$||!r$){if(N&&d.code==="Digit1"){d.preventDefault(),_();return}if(N&&d.code==="KeyT"){d.preventDefault(),C();return}}if(N&&d.code==="Digit2"){d.preventDefault(),w();return}if(N&&d.shiftKey&&d.code==="KeyN"){d.preventDefault(),y();return}if(N&&d.code==="KeyN"){d.preventDefault(),S();return}if(N&&d.code==="KeyO"){d.preventDefault(),b();return}if(N&&d.shiftKey&&d.code==="KeyF"){d.preventDefault(),x();return}}};return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},a=[],e[3]=c,e[4]=a):(c=e[3],a=e[4]),R.useEffect(c,a)}var H_;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})(H_||(H_={}));async function l$(t,e){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(t,e),await Jf("plugin:event|unlisten",{event:t,eventId:e})}async function $_(t,e,n){var r;const i=(r=void 0)!==null&&r!==void 0?r:{kind:"Any"};return Jf("plugin:event|listen",{event:t,target:i,handler:MH(e)}).then(l=>async()=>l$(t,l))}function c$(t){const e=he.c(39),{sidebarRef:n,terminalPanelRef:r,filesPanelRef:i,chatInputRef:l,activeWorkspace:c,primaryPreconfigs:a,handleInterruptSession:u,handleSidebarViewModeChange:d,createSession:m,setSidebarOpen:p,onToggleAutoFollow:g}=t;let _;e[0]!==p||e[1]!==n?(_=()=>{p(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var V;(V=n.current)==null||V.focusSessionPanel()})})},e[0]=p,e[1]=n,e[2]=_):_=e[2];const C=_;let w;e[3]!==r?(w=()=>{qt.getState().setShowTerminalPanel(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var V;(V=r.current)==null||V.focus()})})},e[3]=r,e[4]=w):w=e[4];const y=w,S=R.useRef(C);let b;e[5]!==C?(b=()=>{S.current=C},e[5]=C,e[6]=b):b=e[6],R.useLayoutEffect(b);const x=R.useRef(y);let k;e[7]!==y?(k=()=>{x.current=y},e[7]=y,e[8]=k):k=e[8],R.useLayoutEffect(k);const j=p$;let N;e[9]!==i?(N=()=>{requestAnimationFrame(()=>{var V;(V=i.current)==null||V.focus()})},e[9]=i,e[10]=N):N=e[10];const D=N,E=R.useRef(D);let O;e[11]!==D?(O=()=>{E.current=D},e[11]=D,e[12]=O):O=e[12],R.useLayoutEffect(O);let L;e[13]!==l?(L=()=>{var V;(V=l.current)==null||V.focus()},e[13]=l,e[14]=L):L=e[14];const z=L;let H;e[15]!==c||e[16]!==m||e[17]!==a?(H=()=>{c&&a[0]&&m(a[0].id)},e[15]=c,e[16]=m,e[17]=a,e[18]=H):H=e[18];const $=H,q=f$;let G;e[19]!==d?(G=()=>{d(d$)},e[19]=d,e[20]=G):G=e[20];const W=G;let X;e[21]!==p?(X=()=>{const V=document.activeElement;V!=null&&V.closest("[data-terminal-panel]")?j():V!=null&&V.closest('[data-panel-id="files"]')?qt.getState().setShowFilesPanel(!1):V!=null&&V.closest('[data-sidebar="sidebar"]')&&p(!1)},e[21]=p,e[22]=X):X=e[22];const Y=X;let I;e[23]!==u?(I=()=>{u()},e[23]=u,e[24]=I):I=e[24];const M=I;let P,F,B;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=()=>S.current(),F=()=>x.current(),B=()=>E.current(),e[25]=P,e[26]=F,e[27]=B):(P=e[25],F=e[26],B=e[27]);let Q;e[28]!==g?(Q=()=>g==null?void 0:g(),e[28]=g,e[29]=Q):Q=e[29];let J;e[30]!==z||e[31]!==Y||e[32]!==$||e[33]!==M||e[34]!==W||e[35]!==Q?(J={onOpenSidebar:P,onOpenTerminal:F,onOpenFilesPanel:B,onNewSession:$,onNewWindow:q,onToggleViewMode:W,onCloseFocusedPanel:Y,onFocusChatInput:z,onStopStreaming:M,onToggleAutoFollow:Q},e[30]=z,e[31]=Y,e[32]=$,e[33]=M,e[34]=W,e[35]=Q,e[36]=J):J=e[36],a$(J);let ee,K;e[37]===Symbol.for("react.memo_cache_sentinel")?(ee=()=>{if(!(typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window)))return;let te=!1;const re=[];return(async()=>{try{const se=await $_("jean2://accelerator/open-sidebar",()=>{S.current()});if(te){se();return}re.push(se)}catch(se){console.error("Failed to register open-sidebar accelerator listener:",se)}try{const se=await $_("jean2://accelerator/open-terminal",()=>{x.current()});if(te){se();return}re.push(se)}catch(se){console.error("Failed to register open-terminal accelerator listener:",se)}})(),()=>{te=!0,re.forEach(u$)}},K=[],e[37]=ee,e[38]=K):(ee=e[37],K=e[38]),R.useLayoutEffect(ee,K)}function u$(t){return t()}function d$(t){return t==="overview"?"default":"overview"}function f$(){Jf("create_new_window").catch(h$)}function h$(){}function p$(){qt.getState().setShowTerminalPanel(!1)}function m$(t){const e=he.c(3),{setOpen:n}=Wc();let r;return e[0]!==t||e[1]!==n?(r={...t,setSidebarOpen:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],c$(r),null}function U_(t){const e=he.c(17),{onServerSwitch:n,onSelectWorkspace:r}=t,[i,l]=R.useState(!1),c=R.useRef(!1),a=ol(),{quickConnections:u,switchServer:d,removeFromQuickConnections:m,isSwitching:p}=Qa(),g=L=>{d(L.serverId)&&(c.current=!0,n==null||n(),L.workspaceId&&r&&r(L.workspaceId))};let _,C;e[0]!==p||e[1]!==i?(_=()=>{!p&&i&&c.current&&(l(!1),c.current=!1)},C=[p,i],e[0]=p,e[1]=i,e[2]=_,e[3]=C):(_=e[2],C=e[3]),R.useEffect(_,C);let w;e[4]!==m?(w=(L,z)=>{L.stopPropagation(),m(z)},e[4]=m,e[5]=w):w=e[5];const y=w,S=()=>h.jsx(Av,{children:h.jsx(Nv,{className:"max-h-[50vh] overflow-y-auto",children:u.length>0?h.jsx(kc,{heading:"Quick Switch",children:u.map(L=>h.jsxs(Ha,{onSelect:()=>g(L),className:"justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Do,{className:"size-4 text-muted-foreground"}),h.jsxs("span",{children:[L.serverName,L.workspaceName&&h.jsxs("span",{className:"text-muted-foreground",children:[" / ",L.workspaceName]})]})]}),h.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",onClick:z=>y(z,L.id),children:h.jsx(Br,{className:"size-3 text-destructive"})})]},L.id))}):h.jsx(Rv,{className:"py-6",children:h.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[h.jsx(fm,{className:"size-8"}),h.jsx("p",{className:"text-sm font-medium",children:"No favorites yet"}),h.jsx("p",{className:"text-xs",children:"Star a workspace to add it here"})]})})})});if(a){let L;e[6]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(W8,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:h.jsx(fm,{className:"size-4"})})}),e[6]=L):L=e[6];let z;return e[7]===Symbol.for("react.memo_cache_sentinel")?(z=h.jsx(Uf,{children:h.jsx(Vf,{children:"Quick Switch"})}),e[7]=z):z=e[7],h.jsxs(Hf,{open:i,onOpenChange:l,children:[L,h.jsxs($f,{side:"bottom",className:"max-h-[80vh]",children:[z,h.jsx("div",{className:"mt-4",children:S()})]})]})}const b=Bf;let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=h.jsx(jv,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:h.jsx(fm,{className:"size-4"})})}),e[8]=x):x=e[8];const k=Ff,j="w-[300px] p-0",N="start",D=S();let E;e[9]!==k||e[10]!==D?(E=h.jsx(k,{className:j,align:N,children:D}),e[9]=k,e[10]=D,e[11]=E):E=e[11];let O;return e[12]!==b||e[13]!==i||e[14]!==x||e[15]!==E?(O=h.jsxs(b,{open:i,onOpenChange:l,children:[x,E]}),e[12]=b,e[13]=i,e[14]=x,e[15]=E,e[16]=O):O=e[16],O}function V_(t){const e=he.c(13),{viewMode:n,onViewModeChange:r}=t;let i;e[0]!==r||e[1]!==n?(i=()=>{r(n==="overview"?"default":"overview")},e[0]=r,e[1]=n,e[2]=i):i=e[2];const l=i,c=n==="overview";let a;e[3]!==c?(a=c?h.jsx(FA,{className:"h-4 w-4"}):h.jsx(zA,{className:"h-4 w-4"}),e[3]=c,e[4]=a):a=e[4];let u;e[5]!==a||e[6]!==l?(u=h.jsx(Ac,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:l,children:a})}),e[5]=a,e[6]=l,e[7]=u):u=e[7];const d=c?"Single workspace":"Overview";let m;e[8]!==d?(m=h.jsx(Nc,{children:d}),e[8]=d,e[9]=m):m=e[9];let p;return e[10]!==u||e[11]!==m?(p=h.jsx(Gd,{children:h.jsxs(Ec,{children:[u,m]})}),e[10]=u,e[11]=m,e[12]=p):p=e[12],p}function g$(t){const e=he.c(69),{headerTitle:n,isLoggedIn:r,activeWorkspace:i,onServerSwitch:l,onSelectWorkspace:c,onSidebarViewModeChange:a}=t,u=qt(_$),d=qt(x$),m=qt(b$),p=qt(y$),g=qt(v$);let _;e[0]!==r?(_=r&&h.jsx(Ix,{}),e[0]=r,e[1]=_):_=e[1];let C;e[2]!==n?(C=h.jsx("span",{className:"font-semibold",children:n}),e[2]=n,e[3]=C):C=e[3];let w;e[4]!==_||e[5]!==C?(w=h.jsxs("div",{className:"flex items-center gap-2",children:[_,C]}),e[4]=_,e[5]=C,e[6]=w):w=e[6];let y;e[7]!==r||e[8]!==c||e[9]!==l?(y=r&&h.jsx(U_,{onServerSwitch:l,onSelectWorkspace:c}),e[7]=r,e[8]=c,e[9]=l,e[10]=y):y=e[10];let S;e[11]!==r||e[12]!==a||e[13]!==u?(S=r&&h.jsx(V_,{viewMode:u,onViewModeChange:a}),e[11]=r,e[12]=a,e[13]=u,e[14]=S):S=e[14];let b;e[15]!==i||e[16]!==r||e[17]!==p||e[18]!==d?(b=r&&i&&h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>p(!d),title:d?"Hide Files":"Show Files",children:h.jsx(rg,{className:"w-4 h-4"})}),e[15]=i,e[16]=r,e[17]=p,e[18]=d,e[19]=b):b=e[19];let x;e[20]!==i||e[21]!==r||e[22]!==g||e[23]!==m?(x=r&&i&&h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>g(!m),title:m?"Hide Terminal":"Show Terminal",children:h.jsx(Kb,{className:"w-4 h-4"})}),e[20]=i,e[21]=r,e[22]=g,e[23]=m,e[24]=x):x=e[24];let k;e[25]!==y||e[26]!==S||e[27]!==b||e[28]!==x?(k=h.jsxs("div",{className:"flex items-center gap-1",children:[y,S,b,x]}),e[25]=y,e[26]=S,e[27]=b,e[28]=x,e[29]=k):k=e[29];let j;e[30]!==w||e[31]!==k?(j=h.jsxs("header",{className:"md:hidden flex items-center justify-between p-3 border-b border-border bg-background sticky top-0 z-10",children:[w,k]}),e[30]=w,e[31]=k,e[32]=j):j=e[32];let N;e[33]!==r?(N=r&&h.jsx(Ix,{}),e[33]=r,e[34]=N):N=e[34];let D;e[35]!==n?(D=h.jsx("span",{className:"font-semibold",children:n}),e[35]=n,e[36]=D):D=e[36];let E;e[37]!==N||e[38]!==D?(E=h.jsxs("div",{className:"flex items-center gap-2",children:[N,D]}),e[37]=N,e[38]=D,e[39]=E):E=e[39];let O;e[40]!==r||e[41]!==c||e[42]!==l?(O=r&&h.jsx(U_,{onServerSwitch:l,onSelectWorkspace:c}),e[40]=r,e[41]=c,e[42]=l,e[43]=O):O=e[43];let L;e[44]!==r||e[45]!==a||e[46]!==u?(L=r&&h.jsx(V_,{viewMode:u,onViewModeChange:a}),e[44]=r,e[45]=a,e[46]=u,e[47]=L):L=e[47];let z;e[48]!==i||e[49]!==r||e[50]!==p||e[51]!==d?(z=r&&i&&h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>p(!d),title:d?"Hide Files":"Show Files",children:h.jsx(rg,{className:"w-4 h-4"})}),e[48]=i,e[49]=r,e[50]=p,e[51]=d,e[52]=z):z=e[52];let H;e[53]!==i||e[54]!==r||e[55]!==g||e[56]!==m?(H=r&&i&&h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>g(!m),title:m?"Hide Terminal":"Show Terminal",children:h.jsx(Kb,{className:"w-4 h-4"})}),e[53]=i,e[54]=r,e[55]=g,e[56]=m,e[57]=H):H=e[57];let $;e[58]!==O||e[59]!==L||e[60]!==z||e[61]!==H?($=h.jsxs("div",{className:"flex items-center gap-2",children:[O,L,z,H]}),e[58]=O,e[59]=L,e[60]=z,e[61]=H,e[62]=$):$=e[62];let q;e[63]!==E||e[64]!==$?(q=h.jsxs("header",{className:"hidden md:flex items-center justify-between p-3 border-b border-border",children:[E,$]}),e[63]=E,e[64]=$,e[65]=q):q=e[65];let G;return e[66]!==q||e[67]!==j?(G=h.jsxs(h.Fragment,{children:[j,q]}),e[66]=q,e[67]=j,e[68]=G):G=e[68],G}function v$(t){return t.setShowTerminalPanel}function y$(t){return t.setShowFilesPanel}function b$(t){return t.showTerminalPanel}function x$(t){return t.showFilesPanel}function _$(t){return t.sidebarViewMode}function S$({cachedTerminal:t}){const e=R.useRef(null);return R.useEffect(()=>{const n=e.current;if(!n)return;const{terminal:r,fitAddon:i}=t;t.isOpened?r.element&&n.appendChild(r.element):(r.open(n),t.isOpened=!0),requestAnimationFrame(()=>{try{i.fit()}catch{}if(r.cols<=1||r.rows<=1){const c=()=>{try{if(i.fit(),r.cols>1&&r.rows>1)return}catch{}requestAnimationFrame(c)};requestAnimationFrame(c)}}),r.focus();const l=new ResizeObserver(()=>{requestAnimationFrame(()=>{try{i.fit()}catch{}})});return l.observe(n),()=>{l.disconnect(),r.element&&r.element.parentElement&&r.element.parentElement.removeChild(r.element)}},[t]),h.jsx("div",{ref:e,className:"w-full h-full",onFocus:()=>t.terminal.focus()})}var Xm={exports:{}},q_;function w$(){return q_||(q_=1,(function(t,e){(function(n,r){t.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(c,a,u){var d=this&&this.__decorate||function(b,x,k,j){var N,D=arguments.length,E=D<3?x:j===null?j=Object.getOwnPropertyDescriptor(x,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,x,k,j);else for(var O=b.length-1;O>=0;O--)(N=b[O])&&(E=(D<3?N(E):D>3?N(x,k,E):N(x,k))||E);return D>3&&E&&Object.defineProperty(x,k,E),E},m=this&&this.__param||function(b,x){return function(k,j){x(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const p=u(9042),g=u(9924),_=u(844),C=u(4725),w=u(2585),y=u(3656);let S=a.AccessibilityManager=class extends _.Disposable{constructor(b,x,k,j){super(),this._terminal=b,this._coreBrowserService=k,this._renderService=j,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 N=0;N<this._terminal.rows;N++)this._rowElements[N]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[N]);if(this._topBoundaryFocusListener=N=>this._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,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 g.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((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
613
+ `)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(b){for(let x=0;x<b;x++)this._handleChar(" ")}_handleChar(b){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==b&&(this._charsToAnnounce+=b):this._charsToAnnounce+=b,b===`
614
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(b){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(b)||this._charsToConsume.push(b)}_refreshRows(b,x){this._liveRegionDebouncer.refresh(b,x,this._terminal.rows)}_renderRows(b,x){const k=this._terminal.buffer,j=k.lines.length.toString();for(let N=b;N<=x;N++){const D=k.lines.get(k.ydisp+N),E=[],O=(D==null?void 0:D.translateToString(!0,void 0,void 0,E))||"",L=(k.ydisp+N+1).toString(),z=this._rowElements[N];z&&(O.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=O,this._rowColumns.set(z,E)),z.setAttribute("aria-posinset",L),z.setAttribute("aria-setsize",j))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(b,x){const k=b.target,j=this._rowElements[x===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||b.relatedTarget!==j)return;let N,D;if(x===0?(N=k,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(N=this._rowElements.shift(),D=k,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}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(),b.preventDefault(),b.stopImmediatePropagation()}_handleSelectionChange(){var O,L;if(this._rowElements.length===0)return;const b=document.getSelection();if(!b)return;if(b.isCollapsed)return void(this._rowContainer.contains(b.anchorNode)&&this._terminal.clearSelection());if(!b.anchorNode||!b.focusNode)return void console.error("anchorNode and/or focusNode are null");let x={node:b.anchorNode,offset:b.anchorOffset},k={node:b.focusNode,offset:b.focusOffset};if((x.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===k.node&&x.offset>k.offset)&&([x,k]=[k,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 j=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(j)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:j,offset:(L=(O=j.textContent)==null?void 0:O.length)!=null?L:0}),!this._rowContainer.contains(k.node))return;const N=({node:z,offset:H})=>{const $=z instanceof Text?z.parentNode:z;let q=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const G=this._rowColumns.get($);if(!G)return console.warn("columns is null. Race condition?"),null;let W=H<G.length?G[H]:G.slice(-1)[0]+1;return W>=this._terminal.cols&&(++q,W=0),{row:q,column:W}},D=N(x),E=N(k);if(D&&E){if(D.row>E.row||D.row===E.row&&D.column>=E.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(E.row-D.row)*this._terminal.cols-D.column+E.column)}}_handleResize(b){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>b;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const b=this._coreBrowserService.mainDocument.createElement("div");return b.setAttribute("role","listitem"),b.tabIndex=-1,this._refreshRowDimensions(b),b}_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 b=0;b<this._terminal.rows;b++)this._refreshRowDimensions(this._rowElements[b])}}_refreshRowDimensions(b){b.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=S=d([m(1,w.IInstantiationService),m(2,C.ICoreBrowserService),m(3,C.IRenderService)],S)},3614:(c,a)=>{function u(g){return g.replace(/\r?\n/g,"\r")}function d(g,_){return _?"\x1B[200~"+g+"\x1B[201~":g}function m(g,_,C,w){g=d(g=u(g),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(g,!0),_.value=""}function p(g,_,C){const w=C.getBoundingClientRect(),y=g.clientX-w.left-10,S=g.clientY-w.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${y}px`,_.style.top=`${S}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=u,a.bracketTextForPaste=d,a.copyHandler=function(g,_){g.clipboardData&&g.clipboardData.setData("text/plain",_.selectionText),g.preventDefault()},a.handlePasteEvent=function(g,_,C,w){g.stopPropagation(),g.clipboardData&&m(g.clipboardData.getData("text/plain"),_,C,w)},a.paste=m,a.moveTextAreaUnderMouseCursor=p,a.rightClickHandler=function(g,_,C,w,y){p(g,_,C),y&&w.rightClickSelect(g),_.value=w.selectionText,_.select()}},7239:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const d=u(1505);a.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(m,p,g){this._css.set(m,p,g)}getCss(m,p){return this._css.get(m,p)}setColor(m,p,g){this._color.set(m,p,g)}getColor(m,p){return this._color.get(m,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(u,d,m,p){u.addEventListener(d,m,p);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(d,m,p))}}}},3551:function(c,a,u){var d=this&&this.__decorate||function(S,b,x,k){var j,N=arguments.length,D=N<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,b,x,k);else for(var E=S.length-1;E>=0;E--)(j=S[E])&&(D=(N<3?j(D):N>3?j(b,x,D):j(b,x))||D);return N>3&&D&&Object.defineProperty(b,x,D),D},m=this&&this.__param||function(S,b){return function(x,k){b(x,k,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const p=u(3656),g=u(8460),_=u(844),C=u(2585),w=u(4725);let y=a.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(S,b,x,k,j){super(),this._element=S,this._mouseService=b,this._renderService=x,this._bufferService=k,this._linkProviderService=j,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const b=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!b)return;this._isMouseOut=!1;const x=S.composedPath();for(let k=0;k<x.length;k++){const j=x[k];if(j.classList.contains("xterm"))break;if(j.classList.contains("xterm-hover"))return}this._lastBufferCell&&b.x===this._lastBufferCell.x&&b.y===this._lastBufferCell.y||(this._handleHover(b),this._lastBufferCell=b)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,b){var k,j;this._activeProviderReplies&&b||((k=this._activeProviderReplies)==null||k.forEach((N=>{N==null||N.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let x=!1;for(const[N,D]of this._linkProviderService.linkProviders.entries())b?(j=this._activeProviderReplies)!=null&&j.get(N)&&(x=this._checkLinkProviderResult(N,S,x)):D.provideLinks(S.y,(E=>{var L,z;if(this._isMouseOut)return;const O=E==null?void 0:E.map((H=>({link:H})));(L=this._activeProviderReplies)==null||L.set(N,O),x=this._checkLinkProviderResult(N,S,x),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,b){const x=new Set;for(let k=0;k<b.size;k++){const j=b.get(k);if(j)for(let N=0;N<j.length;N++){const D=j[N],E=D.link.range.start.y<S?0:D.link.range.start.x,O=D.link.range.end.y>S?this._bufferService.cols:D.link.range.end.x;for(let L=E;L<=O;L++){if(x.has(L)){j.splice(N--,1);break}x.add(L)}}}}_checkLinkProviderResult(S,b,x){var N;if(!this._activeProviderReplies)return x;const k=this._activeProviderReplies.get(S);let j=!1;for(let D=0;D<S;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(j=!0);if(!j&&k){const D=k.find((E=>this._linkAtPosition(E.link,b)));D&&(x=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let D=0;D<this._activeProviderReplies.size;D++){const E=(N=this._activeProviderReplies.get(D))==null?void 0:N.find((O=>this._linkAtPosition(O.link,b)));if(E){x=!0,this._handleNewLink(E);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const b=this._positionFromMouseEvent(S,this._element,this._mouseService);b&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,b)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,b){this._currentLink&&this._lastMouseEvent&&(!S||!b||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=b)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._linkAtPosition(S.link,b)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var x,k;return(k=(x=this._currentLink)==null?void 0:x.state)==null?void 0:k.decorations.pointerCursor},set:x=>{var k;(k=this._currentLink)!=null&&k.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,k;return(k=(x=this._currentLink)==null?void 0:x.state)==null?void 0:k.decorations.underline},set:x=>{var k,j,N;(k=this._currentLink)!=null&&k.state&&((N=(j=this._currentLink)==null?void 0:j.state)==null?void 0:N.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((x=>{if(!this._currentLink)return;const k=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,j=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=j&&(this._clearCurrentLink(k,j),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(S,b,x){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(b,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),b.hover&&b.hover(x,b.text)}_fireUnderlineEvent(S,b){const x=S.range,k=this._bufferService.buffer.ydisp,j=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-k-1,x.end.x,x.end.y-k-1,void 0);(b?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(j)}_linkLeave(S,b,x){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(b,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),b.leave&&b.leave(x,b.text)}_linkAtPosition(S,b){const x=S.range.start.y*this._bufferService.cols+S.range.start.x,k=S.range.end.y*this._bufferService.cols+S.range.end.x,j=b.y*this._bufferService.cols+b.x;return x<=j&&j<=k}_positionFromMouseEvent(S,b,x){const k=x.getCoords(S,b,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,b,x,k,j){return{x1:S,y1:b,x2:x,y2:k,cols:this._bufferService.cols,fg:j}}};a.Linkifier=y=d([m(1,w.IMouseService),m(2,w.IRenderService),m(3,C.IBufferService),m(4,w.ILinkProviderService)],y)},9042:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(c,a,u){var d=this&&this.__decorate||function(w,y,S,b){var x,k=arguments.length,j=k<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,S,b);else for(var N=w.length-1;N>=0;N--)(x=w[N])&&(j=(k<3?x(j):k>3?x(y,S,j):x(y,S))||j);return k>3&&j&&Object.defineProperty(y,S,j),j},m=this&&this.__param||function(w,y){return function(S,b){y(S,b,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const p=u(511),g=u(2585);let _=a.OscLinkProvider=class{constructor(w,y,S){this._bufferService=w,this._optionsService=y,this._oscLinkService=S}provideLinks(w,y){var O;const S=this._bufferService.buffer.lines.get(w-1);if(!S)return void y(void 0);const b=[],x=this._optionsService.rawOptions.linkHandler,k=new p.CellData,j=S.getTrimmedLength();let N=-1,D=-1,E=!1;for(let L=0;L<j;L++)if(D!==-1||S.hasContent(L)){if(S.loadCell(L,k),k.hasExtendedAttrs()&&k.extended.urlId){if(D===-1){D=L,N=k.extended.urlId;continue}E=k.extended.urlId!==N}else D!==-1&&(E=!0);if(E||D!==-1&&L===j-1){const z=(O=this._oscLinkService.getLinkData(N))==null?void 0:O.uri;if(z){const H={start:{x:D+1,y:w},end:{x:L+(E||L!==j-1?0:1),y:w}};let $=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const q=new URL(z);["http:","https:"].includes(q.protocol)||($=!0)}catch{$=!0}$||b.push({text:z,range:H,activate:(q,G)=>x?x.activate(q,G,H):C(0,G),hover:(q,G)=>{var W;return(W=x==null?void 0:x.hover)==null?void 0:W.call(x,q,G,H)},leave:(q,G)=>{var W;return(W=x==null?void 0:x.leave)==null?void 0:W.call(x,q,G,H)}})}E=!1,k.hasExtendedAttrs()&&k.extended.urlId?(D=L,N=k.extended.urlId):(D=-1,N=-1)}}y(b)}};function C(w,y){if(confirm(`Do you want to navigate to ${y}?
615
+
616
+ WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=_=d([m(0,g.IBufferService),m(1,g.IOptionsService),m(2,g.IOscLinkService)],_)},6193:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,m){this._rowCount=m,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const d=u(3614),m=u(3656),p=u(3551),g=u(9042),_=u(3730),C=u(1680),w=u(3107),y=u(5744),S=u(2950),b=u(1296),x=u(428),k=u(4269),j=u(5114),N=u(8934),D=u(3230),E=u(9312),O=u(4725),L=u(6731),z=u(8055),H=u(8969),$=u(8460),q=u(844),G=u(6114),W=u(8437),X=u(2584),Y=u(7399),I=u(5941),M=u(9074),P=u(2585),F=u(5435),B=u(4567),Q=u(779);class J extends H.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(K={}){super(K),this.browser=G,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new q.MutableDisposable),this._onCursorMove=this.register(new $.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new $.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new $.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new $.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new $.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new $.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new $.EventEmitter),this._onBlur=this.register(new $.EventEmitter),this._onA11yCharEmitter=this.register(new $.EventEmitter),this._onA11yTabEmitter=this.register(new $.EventEmitter),this._onWillOpen=this.register(new $.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(O.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((V,te)=>this.refresh(V,te)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((V=>this._reportWindowsOptions(V)))),this.register(this._inputHandler.onColor((V=>this._handleColorEvent(V)))),this.register((0,$.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,$.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((V=>this._afterResize(V.cols,V.rows)))),this.register((0,q.toDisposable)((()=>{var V,te;this._customKeyEventHandler=void 0,(te=(V=this.element)==null?void 0:V.parentNode)==null||te.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const V of K){let te,re="";switch(V.index){case 256:te="foreground",re="10";break;case 257:te="background",re="11";break;case 258:te="cursor",re="12";break;default:te="ansi",re="4;"+V.index}switch(V.type){case 0:const ae=z.color.toColorRGB(te==="ansi"?this._themeService.colors.ansi[V.index]:this._themeService.colors[te]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${re};${(0,I.toRgbString)(ae)}${X.C1_ESCAPED.ST}`);break;case 1:if(te==="ansi")this._themeService.modifyColors((se=>se.ansi[V.index]=z.channels.toColor(...V.color)));else{const se=te;this._themeService.modifyColors((_e=>_e[se]=z.channels.toColor(...V.color)))}break;case 2:this._themeService.restoreColor(V.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(B.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.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 K=this.buffer.ybase+this.buffer.y,V=this.buffer.lines.get(K);if(!V)return;const te=Math.min(this.buffer.x,this.cols-1),re=this._renderService.dimensions.css.cell.height,ae=V.getWidth(te),se=this._renderService.dimensions.css.cell.width*ae,_e=this.buffer.y*this._renderService.dimensions.css.cell.height,Ee=te*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ee+"px",this.textarea.style.top=_e+"px",this.textarea.style.width=se+"px",this.textarea.style.height=re+"px",this.textarea.style.lineHeight=re+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(V=>{this.hasSelection()&&(0,d.copyHandler)(V,this._selectionService)})));const K=V=>(0,d.handlePasteEvent)(V,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,m.addDisposableDomListener)(this.element,"paste",K)),G.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(V=>{V.button===2&&(0,d.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(V=>{(0,d.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),G.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(V=>{V.button===1&&(0,d.moveTextAreaUnderMouseCursor)(V,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var te,re,ae;if(!K)throw new Error("Terminal requires a parent element.");if(K.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=K.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"),K.appendChild(this.element);const V=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),V.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),V.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),G.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(j.CoreBrowserService,this.textarea,(re=K.ownerDocument.defaultView)!=null?re:window,((ae=this._document)!=null?ae:typeof window<"u")?window.document:null)),this._instantiationService.setService(O.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(O.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(O.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(O.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(O.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(O.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(p.Linkifier,this.screenElement)),this.element.appendChild(V);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(O.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(B.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(b.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,V=this.element;function te(se){const _e=K._mouseService.getMouseReportCoords(se,K.screenElement);if(!_e)return!1;let Ee,De;switch(se.overrideType||se.type){case"mousemove":De=32,se.buttons===void 0?(Ee=3,se.button!==void 0&&(Ee=se.button<3?se.button:3)):Ee=1&se.buttons?0:4&se.buttons?1:2&se.buttons?2:3;break;case"mouseup":De=0,Ee=se.button<3?se.button:3;break;case"mousedown":De=1,Ee=se.button<3?se.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(se)===!1||K.viewport.getLinesScrolled(se)===0)return!1;De=se.deltaY<0?0:1,Ee=4;break;default:return!1}return!(De===void 0||Ee===void 0||Ee>4)&&K.coreMouseService.triggerMouseEvent({col:_e.col,row:_e.row,x:_e.x,y:_e.y,button:Ee,action:De,ctrl:se.ctrlKey,alt:se.altKey,shift:se.shiftKey})}const re={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ae={mouseup:se=>(te(se),se.buttons||(this._document.removeEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.removeEventListener("mousemove",re.mousedrag)),this.cancel(se)),wheel:se=>(te(se),this.cancel(se,!0)),mousedrag:se=>{se.buttons&&te(se)},mousemove:se=>{se.buttons||te(se)}};this.register(this.coreMouseService.onProtocolChange((se=>{se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(se)),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&se?re.mousemove||(V.addEventListener("mousemove",ae.mousemove),re.mousemove=ae.mousemove):(V.removeEventListener("mousemove",re.mousemove),re.mousemove=null),16&se?re.wheel||(V.addEventListener("wheel",ae.wheel,{passive:!1}),re.wheel=ae.wheel):(V.removeEventListener("wheel",re.wheel),re.wheel=null),2&se?re.mouseup||(re.mouseup=ae.mouseup):(this._document.removeEventListener("mouseup",re.mouseup),re.mouseup=null),4&se?re.mousedrag||(re.mousedrag=ae.mousedrag):(this._document.removeEventListener("mousemove",re.mousedrag),re.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(V,"mousedown",(se=>{if(se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(se))return te(se),re.mouseup&&this._document.addEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.addEventListener("mousemove",re.mousedrag),this.cancel(se)}))),this.register((0,m.addDisposableDomListener)(V,"wheel",(se=>{if(!re.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(se)===!1)return!1;if(!this.buffer.hasScrollback){const _e=this.viewport.getLinesScrolled(se);if(_e===0)return;const Ee=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(se.deltaY<0?"A":"B");let De="";for(let Ue=0;Ue<Math.abs(_e);Ue++)De+=Ee;return this.coreService.triggerDataEvent(De,!0),this.cancel(se,!0)}return this.viewport.handleWheel(se)?this.cancel(se):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(V,"touchstart",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(se),this.cancel(se)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(V,"touchmove",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(se)?void 0:this.cancel(se)}),{passive:!1}))}refresh(K,V){var te;(te=this._renderService)==null||te.refreshRows(K,V)}updateCursorStyle(K){var V;(V=this._selectionService)!=null&&V.shouldColumnSelect(K)?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(K,V,te=0){var re;te===1?(super.scrollLines(K,V,te),this.refresh(0,this.rows-1)):(re=this.viewport)==null||re.scrollLines(K)}paste(K){(0,d.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const V=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),V}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,V,te){this._selectionService.setSelection(K,V,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 K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,V){var te;(te=this._selectionService)==null||te.selectLines(K,V)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const V=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!V&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;V||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const te=(0,Y.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),te.type===3||te.type===2){const re=this.rows-1;return this.scrollLines(te.type===2?-re:re),this.cancel(K,!0)}return te.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(te.cancel&&this.cancel(K,!0),!te.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(te.key!==X.C0.ETX&&te.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:te.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(te.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,V){const te=K.isMac&&!this.options.macOptionIsMeta&&V.altKey&&!V.ctrlKey&&!V.metaKey||K.isWindows&&V.altKey&&V.ctrlKey&&!V.metaKey||K.isWindows&&V.getModifierState("AltGraph");return V.type==="keypress"?te:te&&(!V.keyCode||V.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function(V){return V.keyCode===16||V.keyCode===17||V.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let V;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)V=K.charCode;else if(K.which===null||K.which===void 0)V=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;V=K.which}return!(!V||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(V=String.fromCharCode(V),this._onKey.fire({key:V,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(V,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const V=K.data;return this.coreService.triggerDataEvent(V,!0),this.cancel(K),!0}return!1}resize(K,V){K!==this.cols||V!==this.rows?super.resize(K,V):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,V){var te,re;(te=this._charSizeService)==null||te.measure(),(re=this.viewport)==null||re.syncScrollArea(!0)}clear(){var K;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 V=1;V<this.rows;V++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var V,te;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),(V=this._selectionService)==null||V.reset(),this._decorationService.reset(),(te=this.viewport)==null||te.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const V=this._renderService.dimensions.css.canvas.width.toFixed(0),te=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${te};${V}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const re=this._renderService.dimensions.css.cell.width.toFixed(0),ae=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${ae};${re}t`)}}cancel(K,V){if(this.options.cancelEvents||V)return K.preventDefault(),K.stopPropagation(),!1}}a.Terminal=J},9924:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,m){this._rowCount=m,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=p-this._lastRefreshMs,_=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(c,a,u){var d=this&&this.__decorate||function(S,b,x,k){var j,N=arguments.length,D=N<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,b,x,k);else for(var E=S.length-1;E>=0;E--)(j=S[E])&&(D=(N<3?j(D):N>3?j(b,x,D):j(b,x))||D);return N>3&&D&&Object.defineProperty(b,x,D),D},m=this&&this.__param||function(S,b){return function(x,k){b(x,k,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const p=u(3656),g=u(4725),_=u(8460),C=u(844),w=u(2585);let y=a.Viewport=class extends C.Disposable{constructor(S,b,x,k,j,N,D,E){super(),this._viewportElement=S,this._scrollArea=b,this._bufferService=x,this._optionsService=k,this._charSizeService=j,this._renderService=N,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.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(E.colors),this.register(E.onChangeColors((O=>this._handleThemeChange(O)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.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(S){if(S)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 b=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==b&&(this._lastRecordedBufferHeight=b,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){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 b=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<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(S,b){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(b<0&&this._viewportElement.scrollTop!==0||b>0&&x<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const b=this._getPixelsScrolled(S);return b!==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+b:this._smoothScrollState.target+=b,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=b,this._bubbleScroll(S,b))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const b=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+b,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let b=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?b*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._currentRowHeight*this._bufferService.rows),b}getBufferElements(S,b){var E;let x,k="";const j=[],N=b!=null?b:this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let O=S;O<N;O++){const L=D.get(O);if(!L)continue;const z=(E=D.get(O+1))==null?void 0:E.isWrapped;if(k+=L.translateToString(!z),!z||O===D.length-1){const H=document.createElement("div");H.textContent=k,j.push(H),k.length>0&&(x=H),k=""}}return{bufferElements:j,cursorElement:x}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let b=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(b/=this._currentRowHeight+0,this._wheelPartialScroll+=b,b=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._bufferService.rows),b}_applyScrollModifier(S,b){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&b.altKey||x==="ctrl"&&b.ctrlKey||x==="shift"&&b.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const b=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,b!==0&&(this._viewportElement.scrollTop+=b,this._bubbleScroll(S,b))}};a.Viewport=y=d([m(2,w.IBufferService),m(3,w.IOptionsService),m(4,g.ICharSizeService),m(5,g.IRenderService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],y)},3107:function(c,a,u){var d=this&&this.__decorate||function(w,y,S,b){var x,k=arguments.length,j=k<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,S,b);else for(var N=w.length-1;N>=0;N--)(x=w[N])&&(j=(k<3?x(j):k>3?x(y,S,j):x(y,S))||j);return k>3&&j&&Object.defineProperty(y,S,j),j},m=this&&this.__param||function(w,y){return function(S,b){y(S,b,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const p=u(4725),g=u(844),_=u(2585);let C=a.BufferDecorationRenderer=class extends g.Disposable{constructor(w,y,S,b,x){super(),this._screenElement=w,this._bufferService=y,this._coreBrowserService=S,this._decorationService=b,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((k=>this._removeDecoration(k)))),this.register((0,g.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 b,x;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((b=w==null?void 0:w.options)==null?void 0:b.layer)==="top"),y.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=(x=w.options.x)!=null?x:0;return S&&S>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(w,y),y}_refreshStyle(w){const y=w.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let S=this._decorationElements.get(w);S||(S=this._createElement(w),w.element=S,this._decorationElements.set(w,S),this._container.appendChild(S),w.onDispose((()=>{this._decorationElements.delete(w),S.remove()}))),S.style.top=y*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(S)}}_refreshXPosition(w,y=w.element){var b;if(!y)return;const S=(b=w.options.x)!=null?b:0;(w.options.anchor||"left")==="right"?y.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var y;(y=this._decorationElements.get(w))==null||y.remove(),this._decorationElements.delete(w),w.dispose()}};a.BufferDecorationRenderer=C=d([m(1,_.IBufferService),m(2,p.ICoreBrowserService),m(3,_.IDecorationService),m(4,p.IRenderService)],C)},5871:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,m){return d>=u.startBufferLine-this._linePadding[m||"full"]&&d<=u.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(c,a,u){var d=this&&this.__decorate||function(x,k,j,N){var D,E=arguments.length,O=E<3?k:N===null?N=Object.getOwnPropertyDescriptor(k,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,k,j,N);else for(var L=x.length-1;L>=0;L--)(D=x[L])&&(O=(E<3?D(O):E>3?D(k,j,O):D(k,j))||O);return E>3&&O&&Object.defineProperty(k,j,O),O},m=this&&this.__param||function(x,k){return function(j,N){k(j,N,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const p=u(5871),g=u(4725),_=u(844),C=u(2585),w={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let b=a.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(x,k,j,N,D,E,O){var z;super(),this._viewportElement=x,this._screenElement=k,this._bufferService=j,this._decorationService=N,this._renderService=D,this._optionsService=E,this._coreBrowserService=O,this._colorZoneStore=new p.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(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)((()=>{var H;(H=this._canvas)==null||H.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),k=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=x,y.center=k,y.right=x,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=y.left,S.right=y.left+y.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const x=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(x,12),6)*this._coreBrowserService.dpr);w.left=k,w.center=k,w.right=k}_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 k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const x=this._colorZoneStore.zones;for(const k of x)k.position!=="full"&&this._renderColorZone(k);for(const k of x)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(x){this._ctx.fillStyle=x.color,this._ctx.fillRect(S[x.position||"full"],Math.round((this._canvas.height-1)*(x.startBufferLine/this._bufferService.buffers.active.lines.length)-w[x.position||"full"]/2),y[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,k){this._shouldUpdateDimensions=x||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=b=d([m(2,C.IBufferService),m(3,C.IDecorationService),m(4,g.IRenderService),m(5,C.IOptionsService),m(6,g.ICoreBrowserService)],b)},2950:function(c,a,u){var d=this&&this.__decorate||function(w,y,S,b){var x,k=arguments.length,j=k<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,S,b);else for(var N=w.length-1;N>=0;N--)(x=w[N])&&(j=(k<3?x(j):k>3?x(y,S,j):x(y,S))||j);return k>3&&j&&Object.defineProperty(y,S,j),j},m=this&&this.__param||function(w,y){return function(S,b){y(S,b,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const p=u(4725),g=u(2585),_=u(2584);let C=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,y,S,b,x,k){this._textarea=w,this._compositionView=y,this._bufferService=S,this._optionsService=b,this._coreService=x,this._renderService=k,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 y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,S=y.replace(w,"");this._dataAlreadySent=S,y.length>w.length?this._coreService.triggerDataEvent(S,!0):y.length<w.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):y.length===w.length&&y!==w&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,b=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,x=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=x+"px",this._compositionView.style.top=b+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=x+"px",this._textarea.style.top=b+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=C=d([m(2,g.IBufferService),m(3,g.IOptionsService),m(4,g.ICoreService),m(5,p.IRenderService)],C)},9806:(c,a)=>{function u(d,m,p){const g=p.getBoundingClientRect(),_=d.getComputedStyle(p),C=parseInt(_.getPropertyValue("padding-left")),w=parseInt(_.getPropertyValue("padding-top"));return[m.clientX-g.left-C,m.clientY-g.top-w]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=u,a.getCoords=function(d,m,p,g,_,C,w,y,S){if(!C)return;const b=u(d,m,p);return b?(b[0]=Math.ceil((b[0]+(S?w/2:0))/w),b[1]=Math.ceil(b[1]/y),b[0]=Math.min(Math.max(b[0],1),g+(S?1:0)),b[1]=Math.min(Math.max(b[1],1),_),b):void 0}},9504:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const d=u(2584);function m(y,S,b,x){const k=y-p(y,b),j=S-p(S,b),N=Math.abs(k-j)-(function(D,E,O){let L=0;const z=D-p(D,O),H=E-p(E,O);for(let $=0;$<Math.abs(z-H);$++){const q=g(D,E)==="A"?-1:1,G=O.buffer.lines.get(z+q*$);G!=null&&G.isWrapped&&L++}return L})(y,S,b);return w(N,C(g(y,S),x))}function p(y,S){let b=0,x=S.buffer.lines.get(y),k=x==null?void 0:x.isWrapped;for(;k&&y>=0&&y<S.rows;)b++,x=S.buffer.lines.get(--y),k=x==null?void 0:x.isWrapped;return b}function g(y,S){return y>S?"A":"B"}function _(y,S,b,x,k,j){let N=y,D=S,E="";for(;N!==b||D!==x;)N+=k?1:-1,k&&N>j.cols-1?(E+=j.buffer.translateBufferLineToString(D,!1,y,N),N=0,y=0,D++):!k&&N<0&&(E+=j.buffer.translateBufferLineToString(D,!1,0,y+1),N=j.cols-1,y=N,D--);return E+j.buffer.translateBufferLineToString(D,!1,y,N)}function C(y,S){const b=S?"O":"[";return d.C0.ESC+b+y}function w(y,S){y=Math.floor(y);let b="";for(let x=0;x<y;x++)b+=S;return b}a.moveToCellSequence=function(y,S,b,x){const k=b.buffer.x,j=b.buffer.y;if(!b.buffer.hasScrollback)return(function(E,O,L,z,H,$){return m(O,z,H,$).length===0?"":w(_(E,O,E,O-p(O,H),!1,H).length,C("D",$))})(k,j,0,S,b,x)+m(j,S,b,x)+(function(E,O,L,z,H,$){let q;q=m(O,z,H,$).length>0?z-p(z,H):O;const G=z,W=(function(X,Y,I,M,P,F){let B;return B=m(I,M,P,F).length>0?M-p(M,P):Y,X<I&&B<=M||X>=I&&B<M?"C":"D"})(E,O,L,z,H,$);return w(_(E,q,L,G,W==="C",H).length,C(W,$))})(k,j,y,S,b,x);let N;if(j===S)return N=k>y?"D":"C",w(Math.abs(k-y),C(N,x));N=j>S?"D":"C";const D=Math.abs(j-S);return w((function(E,O){return O.cols-E})(j>S?y:k,b)+(D-1)*b.cols+1+((j>S?k:y)-1),C(N,x))}},1296:function(c,a,u){var d=this&&this.__decorate||function($,q,G,W){var X,Y=arguments.length,I=Y<3?q:W===null?W=Object.getOwnPropertyDescriptor(q,G):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate($,q,G,W);else for(var M=$.length-1;M>=0;M--)(X=$[M])&&(I=(Y<3?X(I):Y>3?X(q,G,I):X(q,G))||I);return Y>3&&I&&Object.defineProperty(q,G,I),I},m=this&&this.__param||function($,q){return function(G,W){q(G,W,$)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const p=u(3787),g=u(2550),_=u(2223),C=u(6171),w=u(6052),y=u(4725),S=u(8055),b=u(8460),x=u(844),k=u(2585),j="xterm-dom-renderer-owner-",N="xterm-rows",D="xterm-fg-",E="xterm-bg-",O="xterm-focus",L="xterm-selection";let z=1,H=a.DomRenderer=class extends x.Disposable{constructor($,q,G,W,X,Y,I,M,P,F,B,Q,J){super(),this._terminal=$,this._document=q,this._element=G,this._screenElement=W,this._viewportElement=X,this._helperContainer=Y,this._linkifier2=I,this._charSizeService=P,this._optionsService=F,this._bufferService=B,this._coreBrowserService=Q,this._themeService=J,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new b.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),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(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.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=M.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(j+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(j+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const $=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*$,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*$),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/$),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/$),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const G of this._rowElements)G.style.width=`${this.dimensions.css.canvas.width}px`,G.style.height=`${this.dimensions.css.cell.height}px`,G.style.lineHeight=`${this.dimensions.css.cell.height}px`,G.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const q=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=q,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss($){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let q=`${this._terminalSelector} .${N} { color: ${$.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;q+=`${this._terminalSelector} .${N} .xterm-dim { color: ${S.color.multiplyOpacity($.foreground,.5).css};}`,q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const G=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;q+=`@keyframes ${G} { 50% { border-bottom-style: hidden; }}`,q+=`@keyframes ${W} { 50% { box-shadow: none; }}`,q+=`@keyframes ${X} { 0% { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css}; } 50% { background-color: inherit; color: ${$.cursor.css}; }}`,q+=`${this._terminalSelector} .${N}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${N}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${N}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${$.cursor.css} !important; color: ${$.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${$.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${$.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${$.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,q+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${$.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${$.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,I]of $.ansi.entries())q+=`${this._terminalSelector} .${D}${Y} { color: ${I.css}; }${this._terminalSelector} .${D}${Y}.xterm-dim { color: ${S.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${E}${Y} { background-color: ${I.css}; }`;q+=`${this._terminalSelector} .${D}${_.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque($.background).css}; }${this._terminalSelector} .${D}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque($.background),.5).css}; }${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR} { background-color: ${$.foreground.css}; }`,this._themeStyleElement.textContent=q}_setDefaultSpacing(){const $=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${$}px`,this._rowFactory.defaultSpacing=$}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements($,q){for(let G=this._rowElements.length;G<=q;G++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize($,q){this._refreshRowElements($,q),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,G){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged($,q,G),this.renderRows(0,this._bufferService.rows-1),!$||!q)return;this._selectionRenderModel.update(this._terminal,$,q,G);const W=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||I<0)return;const M=this._document.createDocumentFragment();if(G){const P=$[0]>q[0];M.appendChild(this._createSelectionElement(Y,P?q[0]:$[0],P?$[0]:q[0],I-Y+1))}else{const P=W===Y?$[0]:0,F=Y===X?q[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(Y,P,F));const B=I-Y-1;if(M.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,B)),Y!==I){const Q=X===I?q[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(I,0,Q))}}this._selectionContainer.appendChild(M)}_createSelectionElement($,q,G,W=1){const X=this._document.createElement("div"),Y=q*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(G-q);return Y+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-Y),X.style.height=W*this.dimensions.css.cell.height+"px",X.style.top=$*this.dimensions.css.cell.height+"px",X.style.left=`${Y}px`,X.style.width=`${I}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const $ of this._rowElements)$.replaceChildren()}renderRows($,q){const G=this._bufferService.buffer,W=G.ybase+G.y,X=Math.min(G.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=$;P<=q;P++){const F=P+G.ydisp,B=this._rowElements[P],Q=G.lines.get(F);if(!B||!Q)break;B.replaceChildren(...this._rowFactory.createRow(Q,F,F===W,I,M,X,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${j}${this._terminalClass}`}_handleLinkHover($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!0)}_handleLinkLeave($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!1)}_setCellUnderline($,q,G,W,X,Y){G<0&&($=0),W<0&&(q=0);const I=this._bufferService.rows-1;G=Math.max(Math.min(G,I),0),W=Math.max(Math.min(W,I),0),X=Math.min(X,this._bufferService.cols);const M=this._bufferService.buffer,P=M.ybase+M.y,F=Math.min(M.x,X-1),B=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=G;ee<=W;++ee){const K=ee+M.ydisp,V=this._rowElements[ee],te=M.lines.get(K);if(!V||!te)break;V.replaceChildren(...this._rowFactory.createRow(te,K,K===P,Q,J,F,B,this.dimensions.css.cell.width,this._widthCache,Y?ee===G?$:0:-1,Y?(ee===W?q:X)-1:-1))}}};a.DomRenderer=H=d([m(7,k.IInstantiationService),m(8,y.ICharSizeService),m(9,k.IOptionsService),m(10,k.IBufferService),m(11,y.ICoreBrowserService),m(12,y.IThemeService)],H)},3787:function(c,a,u){var d=this&&this.__decorate||function(N,D,E,O){var L,z=arguments.length,H=z<3?D:O===null?O=Object.getOwnPropertyDescriptor(D,E):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(N,D,E,O);else for(var $=N.length-1;$>=0;$--)(L=N[$])&&(H=(z<3?L(H):z>3?L(D,E,H):L(D,E))||H);return z>3&&H&&Object.defineProperty(D,E,H),H},m=this&&this.__param||function(N,D){return function(E,O){D(E,O,N)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const p=u(2223),g=u(643),_=u(511),C=u(2585),w=u(8055),y=u(4725),S=u(4269),b=u(6171),x=u(3734);let k=a.DomRendererRowFactory=class{constructor(N,D,E,O,L,z,H){this._document=N,this._characterJoinerService=D,this._optionsService=E,this._coreBrowserService=O,this._coreService=L,this._decorationService=z,this._themeService=H,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,D,E){this._selectionStart=N,this._selectionEnd=D,this._columnSelectMode=E}createRow(N,D,E,O,L,z,H,$,q,G,W){const X=[],Y=this._characterJoinerService.getJoinedCharacters(D),I=this._themeService.colors;let M,P=N.getNoBgTrimmedLength();E&&P<z+1&&(P=z+1);let F=0,B="",Q=0,J=0,ee=0,K=!1,V=0,te=!1,re=0;const ae=[],se=G!==-1&&W!==-1;for(let _e=0;_e<P;_e++){N.loadCell(_e,this._workCell);let Ee=this._workCell.getWidth();if(Ee===0)continue;let De=!1,Ue=_e,ce=this._workCell;if(Y.length>0&&_e===Y[0][0]){De=!0;const Je=Y.shift();ce=new S.JoinedCellData(this._workCell,N.translateToString(!0,Je[0],Je[1]),Je[1]-Je[0]),Ue=Je[1]-1,Ee=ce.getWidth()}const je=this._isCellInSelection(_e,D),be=E&&_e===z,Ve=se&&_e>=G&&_e<=W;let qe=!1;this._decorationService.forEachDecorationAtCell(_e,D,void 0,(Je=>{qe=!0}));let ye=ce.getChars()||g.WHITESPACE_CELL_CHAR;if(ye===" "&&(ce.isUnderline()||ce.isOverline())&&(ye=" "),re=Ee*$-q.get(ye,ce.isBold(),ce.isItalic()),M){if(F&&(je&&te||!je&&!te&&ce.bg===Q)&&(je&&te&&I.selectionForeground||ce.fg===J)&&ce.extended.ext===ee&&Ve===K&&re===V&&!be&&!De&&!qe){ce.isInvisible()?B+=g.WHITESPACE_CELL_CHAR:B+=ye,F++;continue}F&&(M.textContent=B),M=this._document.createElement("span"),F=0,B=""}else M=this._document.createElement("span");if(Q=ce.bg,J=ce.fg,ee=ce.extended.ext,K=Ve,V=re,te=je,De&&z>=_e&&z<=Ue&&(z=_e),!this._coreService.isCursorHidden&&be&&this._coreService.isCursorInitialized){if(ae.push("xterm-cursor"),this._coreBrowserService.isFocused)H&&ae.push("xterm-cursor-blink"),ae.push(O==="bar"?"xterm-cursor-bar":O==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":ae.push("xterm-cursor-outline");break;case"block":ae.push("xterm-cursor-block");break;case"bar":ae.push("xterm-cursor-bar");break;case"underline":ae.push("xterm-cursor-underline")}}if(ce.isBold()&&ae.push("xterm-bold"),ce.isItalic()&&ae.push("xterm-italic"),ce.isDim()&&ae.push("xterm-dim"),B=ce.isInvisible()?g.WHITESPACE_CELL_CHAR:ce.getChars()||g.WHITESPACE_CELL_CHAR,ce.isUnderline()&&(ae.push(`xterm-underline-${ce.extended.underlineStyle}`),B===" "&&(B=" "),!ce.isUnderlineColorDefault()))if(ce.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(ce.getUnderlineColor()).join(",")})`;else{let Je=ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ce.isBold()&&Je<8&&(Je+=8),M.style.textDecorationColor=I.ansi[Je].css}ce.isOverline()&&(ae.push("xterm-overline"),B===" "&&(B=" ")),ce.isStrikethrough()&&ae.push("xterm-strikethrough"),Ve&&(M.style.textDecoration="underline");let Me=ce.getFgColor(),Re=ce.getFgColorMode(),we=ce.getBgColor(),oe=ce.getBgColorMode();const me=!!ce.isInverse();if(me){const Je=Me;Me=we,we=Je;const lt=Re;Re=oe,oe=lt}let Ne,Le,Ge,Ke=!1;switch(this._decorationService.forEachDecorationAtCell(_e,D,void 0,(Je=>{Je.options.layer!=="top"&&Ke||(Je.backgroundColorRGB&&(oe=50331648,we=Je.backgroundColorRGB.rgba>>8&16777215,Ne=Je.backgroundColorRGB),Je.foregroundColorRGB&&(Re=50331648,Me=Je.foregroundColorRGB.rgba>>8&16777215,Le=Je.foregroundColorRGB),Ke=Je.options.layer==="top")})),!Ke&&je&&(Ne=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,we=Ne.rgba>>8&16777215,oe=50331648,Ke=!0,I.selectionForeground&&(Re=50331648,Me=I.selectionForeground.rgba>>8&16777215,Le=I.selectionForeground)),Ke&&ae.push("xterm-decoration-top"),oe){case 16777216:case 33554432:Ge=I.ansi[we],ae.push(`xterm-bg-${we}`);break;case 50331648:Ge=w.channels.toColor(we>>16,we>>8&255,255&we),this._addStyle(M,`background-color:#${j((we>>>0).toString(16),"0",6)}`);break;default:me?(Ge=I.foreground,ae.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):Ge=I.background}switch(Ne||ce.isDim()&&(Ne=w.color.multiplyOpacity(Ge,.5)),Re){case 16777216:case 33554432:ce.isBold()&&Me<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Me+=8),this._applyMinimumContrast(M,Ge,I.ansi[Me],ce,Ne,void 0)||ae.push(`xterm-fg-${Me}`);break;case 50331648:const Je=w.channels.toColor(Me>>16&255,Me>>8&255,255&Me);this._applyMinimumContrast(M,Ge,Je,ce,Ne,Le)||this._addStyle(M,`color:#${j(Me.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,Ge,I.foreground,ce,Ne,Le)||me&&ae.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}ae.length&&(M.className=ae.join(" "),ae.length=0),be||De||qe?M.textContent=B:F++,re!==this.defaultSpacing&&(M.style.letterSpacing=`${re}px`),X.push(M),_e=Ue}return M&&F&&(M.textContent=B),X}_applyMinimumContrast(N,D,E,O,L,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,b.treatGlyphAsBackgroundColor)(O.getCode()))return!1;const H=this._getContrastCache(O);let $;if(L||z||($=H.getColor(D.rgba,E.rgba)),$===void 0){const q=this._optionsService.rawOptions.minimumContrastRatio/(O.isDim()?2:1);$=w.color.ensureContrastRatio(L||D,z||E,q),H.setColor((L||D).rgba,(z||E).rgba,$!=null?$:null)}return!!$&&(this._addStyle(N,`color:${$.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,D){N.setAttribute("style",`${N.getAttribute("style")||""}${D};`)}_isCellInSelection(N,D){const E=this._selectionStart,O=this._selectionEnd;return!(!E||!O)&&(this._columnSelectMode?E[0]<=O[0]?N>=E[0]&&D>=E[1]&&N<O[0]&&D<=O[1]:N<E[0]&&D>=E[1]&&N>=O[0]&&D<=O[1]:D>E[1]&&D<O[1]||E[1]===O[1]&&D===E[1]&&N>=E[0]&&N<O[0]||E[1]<O[1]&&D===O[1]&&N<O[0]||E[1]<O[1]&&D===E[1]&&N>=E[0])}};function j(N,D,E){for(;N.length<E;)N=D+N;return N}a.DomRendererRowFactory=k=d([m(1,y.ICharacterJoinerService),m(2,C.IOptionsService),m(3,y.ICoreBrowserService),m(4,C.ICoreService),m(5,C.IDecorationService),m(6,y.IThemeService)],k)},2550:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=u.createElement("span");m.classList.add("xterm-char-measure-element");const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const _=u.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[m,p,g,_],this._container.appendChild(m),this._container.appendChild(p),this._container.appendChild(g),this._container.appendChild(_),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(u,d,m,p){u===this._font&&d===this._fontSize&&m===this._weight&&p===this._weightBold||(this._font=u,this._fontSize=d,this._weight=m,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(u,d,m){let p=0;if(!d&&!m&&u.length===1&&(p=u.charCodeAt(0))<256){if(this._flat[p]!==-9999)return this._flat[p];const C=this._measure(u,0);return C>0&&(this._flat[p]=C),C}let g=u;d&&(g+="B"),m&&(g+="I");let _=this._holey.get(g);if(_===void 0){let C=0;d&&(C|=1),m&&(C|=2),_=this._measure(u,C),_>0&&this._holey.set(g,_)}return _}_measure(u,d){const m=this._measureElements[d];return m.textContent=u.repeat(32),m.offsetWidth/32}}},2223:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(c,a)=>{function u(m){return 57508<=m&&m<=57558}function d(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},a.isPowerlineGlyph=u,a.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},a.isEmoji=d,a.allowRescaling=function(m,p,g,_){return p===1&&g>Math.ceil(1.5*_)&&m!==void 0&&m>255&&!d(m)&&!u(m)&&!(function(C){return 57344<=C&&C<=63743})(m)},a.treatGlyphAsBackgroundColor=function(m){return u(m)||(function(p){return 9472<=p&&p<=9631})(m)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(m,p,g=0){return(m-(2*Math.round(p)-g))%(2*Math.round(p))}},6052:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,p,g,_=!1){if(this.selectionStart=p,this.selectionEnd=g,!p||!g||p[0]===g[0]&&p[1]===g[1])return void this.clear();const C=m.buffers.active.ydisp,w=p[1]-C,y=g[1]-C,S=Math.max(w,0),b=Math.min(y,m.rows-1);S>=m.rows||b<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=w,this.viewportEndRow=y,this.viewportCappedStartRow=S,this.viewportCappedEndRow=b,this.startCol=p[0],this.endCol=g[0])}isCellSelected(m,p,g){return!!this.hasSelection&&(g-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?p>=this.startCol&&g>=this.viewportCappedStartRow&&p<this.endCol&&g<=this.viewportCappedEndRow:p<this.startCol&&g>=this.viewportCappedStartRow&&p>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&p>=this.startCol&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&p>=this.startCol)}}a.createSelectionRenderModel=function(){return new u}},456:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(c,a,u){var d=this&&this.__decorate||function(b,x,k,j){var N,D=arguments.length,E=D<3?x:j===null?j=Object.getOwnPropertyDescriptor(x,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,x,k,j);else for(var O=b.length-1;O>=0;O--)(N=b[O])&&(E=(D<3?N(E):D>3?N(x,k,E):N(x,k))||E);return D>3&&E&&Object.defineProperty(x,k,E),E},m=this&&this.__param||function(b,x){return function(k,j){x(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const p=u(2585),g=u(8460),_=u(844);let C=a.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(b,x,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new y(b,x,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const b=this._measureStrategy.measure();b.width===this.width&&b.height===this.height||(this.width=b.width,this.height=b.height,this._onCharSizeChange.fire())}};a.CharSizeService=C=d([m(2,p.IOptionsService)],C);class w extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(x,k){x!==void 0&&x>0&&k!==void 0&&k>0&&(this._result.width=x,this._result.height=k)}}class y extends w{constructor(x,k,j){super(),this._document=x,this._parentElement=k,this._optionsService=j,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 S extends w{constructor(x){super(),this._optionsService=x,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))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(c,a,u){var d=this&&this.__decorate||function(S,b,x,k){var j,N=arguments.length,D=N<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,b,x,k);else for(var E=S.length-1;E>=0;E--)(j=S[E])&&(D=(N<3?j(D):N>3?j(b,x,D):j(b,x))||D);return N>3&&D&&Object.defineProperty(b,x,D),D},m=this&&this.__param||function(S,b){return function(x,k){b(x,k,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const p=u(3734),g=u(643),_=u(511),C=u(2585);class w extends p.AttributeData{constructor(b,x,k){super(),this.content=0,this.combinedData="",this.fg=b.fg,this.bg=b.bg,this.combinedData=x,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(b){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=w;let y=a.CharacterJoinerService=class YE{constructor(b){this._bufferService=b,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(b){const x={id:this._nextCharacterJoinerId++,handler:b};return this._characterJoiners.push(x),x.id}deregister(b){for(let x=0;x<this._characterJoiners.length;x++)if(this._characterJoiners[x].id===b)return this._characterJoiners.splice(x,1),!0;return!1}getJoinedCharacters(b){if(this._characterJoiners.length===0)return[];const x=this._bufferService.buffer.lines.get(b);if(!x||x.length===0)return[];const k=[],j=x.translateToString(!0);let N=0,D=0,E=0,O=x.getFg(0),L=x.getBg(0);for(let z=0;z<x.getTrimmedLength();z++)if(x.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==O||this._workCell.bg!==L){if(z-N>1){const H=this._getJoinedRanges(j,E,D,x,N);for(let $=0;$<H.length;$++)k.push(H[$])}N=z,E=D,O=this._workCell.fg,L=this._workCell.bg}D+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const z=this._getJoinedRanges(j,E,D,x,N);for(let H=0;H<z.length;H++)k.push(z[H])}return k}_getJoinedRanges(b,x,k,j,N){const D=b.substring(x,k);let E=[];try{E=this._characterJoiners[0].handler(D)}catch(O){console.error(O)}for(let O=1;O<this._characterJoiners.length;O++)try{const L=this._characterJoiners[O].handler(D);for(let z=0;z<L.length;z++)YE._mergeRanges(E,L[z])}catch(L){console.error(L)}return this._stringRangesToCellRanges(E,j,N),E}_stringRangesToCellRanges(b,x,k){let j=0,N=!1,D=0,E=b[j];if(E){for(let O=k;O<this._bufferService.cols;O++){const L=x.getWidth(O),z=x.getString(O).length||g.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!N&&E[0]<=D&&(E[0]=O,N=!0),E[1]<=D){if(E[1]=O,E=b[++j],!E)break;E[0]<=D?(E[0]=O,N=!0):N=!1}D+=z}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(b,x){let k=!1;for(let j=0;j<b.length;j++){const N=b[j];if(k){if(x[1]<=N[0])return b[j-1][1]=x[1],b;if(x[1]<=N[1])return b[j-1][1]=Math.max(x[1],N[1]),b.splice(j,1),b;b.splice(j,1),j--}else{if(x[1]<=N[0])return b.splice(j,0,x),b;if(x[1]<=N[1])return N[0]=Math.min(x[0],N[0]),b;x[0]<N[1]&&(N[0]=Math.min(x[0],N[0]),k=!0)}}return k?b[b.length-1][1]=x[1]:b.push(x),b}};a.CharacterJoinerService=y=d([m(0,C.IBufferService)],y)},5114:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const d=u(844),m=u(8460),p=u(3656);class g extends d.Disposable{constructor(w,y,S){super(),this._textarea=w,this._window=y,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((b=>this._screenDprMonitor.setWindow(b)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}a.CoreBrowserService=g;class _ extends d.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,p.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:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const d=u(844);class m extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const _=this.linkProviders.indexOf(g);_!==-1&&this.linkProviders.splice(_,1)}}}}a.LinkProviderService=m},8934:function(c,a,u){var d=this&&this.__decorate||function(C,w,y,S){var b,x=arguments.length,k=x<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(C,w,y,S);else for(var j=C.length-1;j>=0;j--)(b=C[j])&&(k=(x<3?b(k):x>3?b(w,y,k):b(w,y))||k);return x>3&&k&&Object.defineProperty(w,y,k),k},m=this&&this.__param||function(C,w){return function(y,S){w(y,S,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const p=u(4725),g=u(9806);let _=a.MouseService=class{constructor(C,w){this._renderService=C,this._charSizeService=w}getCoords(C,w,y,S,b){return(0,g.getCoords)(window,C,w,y,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,b)}getMouseReportCoords(C,w){const y=(0,g.getCoordsRelativeToElement)(window,C,w);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};a.MouseService=_=d([m(0,p.IRenderService),m(1,p.ICharSizeService)],_)},3230:function(c,a,u){var d=this&&this.__decorate||function(b,x,k,j){var N,D=arguments.length,E=D<3?x:j===null?j=Object.getOwnPropertyDescriptor(x,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,x,k,j);else for(var O=b.length-1;O>=0;O--)(N=b[O])&&(E=(D<3?N(E):D>3?N(x,k,E):N(x,k))||E);return D>3&&E&&Object.defineProperty(x,k,E),E},m=this&&this.__param||function(b,x){return function(k,j){x(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const p=u(6193),g=u(4725),_=u(8460),C=u(844),w=u(7226),y=u(2585);let S=a.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(b,x,k,j,N,D,E,O){super(),this._rowCount=b,this._charSizeService=j,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new C.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 _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(((L,z)=>this._renderRows(L,z)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(O.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,x),this.register(E.onWindowChange((L=>this._registerIntersectionObserver(L,x))))}_registerIntersectionObserver(b,x){if("IntersectionObserver"in b){const k=new b.IntersectionObserver((j=>this._handleIntersectionChange(j[j.length-1])),{threshold:0});k.observe(x),this._observerDisposable.value=(0,C.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(b){this._isPaused=b.isIntersecting===void 0?b.intersectionRatio===0:!b.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(b,x,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(b,x,this._rowCount))}_renderRows(b,x){this._renderer.value&&(b=Math.min(b,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(b,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:b,end:x}),this._onRender.fire({start:b,end:x}),this._isNextRenderRedrawOnly=!0)}resize(b,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(b){this._renderer.value=b,this._renderer.value&&(this._renderer.value.onRequestRedraw((x=>this.refreshRows(x.start,x.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(b){return this._renderDebouncer.addRefreshCallback(b)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var b,x;this._renderer.value&&((x=(b=this._renderer.value).clearTextureAtlas)==null||x.call(b),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(b,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(b,x)})):this._renderer.value.handleResize(b,x),this._fullRefresh())}handleCharSizeChanged(){var b;(b=this._renderer.value)==null||b.handleCharSizeChanged()}handleBlur(){var b;(b=this._renderer.value)==null||b.handleBlur()}handleFocus(){var b;(b=this._renderer.value)==null||b.handleFocus()}handleSelectionChanged(b,x,k){var j;this._selectionState.start=b,this._selectionState.end=x,this._selectionState.columnSelectMode=k,(j=this._renderer.value)==null||j.handleSelectionChanged(b,x,k)}handleCursorMove(){var b;(b=this._renderer.value)==null||b.handleCursorMove()}clear(){var b;(b=this._renderer.value)==null||b.clear()}};a.RenderService=S=d([m(2,y.IOptionsService),m(3,g.ICharSizeService),m(4,y.IDecorationService),m(5,y.IBufferService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],S)},9312:function(c,a,u){var d=this&&this.__decorate||function(E,O,L,z){var H,$=arguments.length,q=$<3?O:z===null?z=Object.getOwnPropertyDescriptor(O,L):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(E,O,L,z);else for(var G=E.length-1;G>=0;G--)(H=E[G])&&(q=($<3?H(q):$>3?H(O,L,q):H(O,L))||q);return $>3&&q&&Object.defineProperty(O,L,q),q},m=this&&this.__param||function(E,O){return function(L,z){O(L,z,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const p=u(9806),g=u(9504),_=u(456),C=u(4725),w=u(8460),y=u(844),S=u(6114),b=u(4841),x=u(511),k=u(2585),j=" ",N=new RegExp(j,"g");let D=a.SelectionService=class extends y.Disposable{constructor(E,O,L,z,H,$,q,G,W){super(),this._element=E,this._screenElement=O,this._linkifier=L,this._bufferService=z,this._coreService=H,this._mouseService=$,this._optionsService=q,this._renderService=G,this._coreBrowserService=W,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=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,y.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const E=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!E||!O||E[0]===O[0]&&E[1]===O[1])}get selectionText(){const E=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;if(!E||!O)return"";const L=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(E[0]===O[0])return"";const H=E[0]<O[0]?E[0]:O[0],$=E[0]<O[0]?O[0]:E[0];for(let q=E[1];q<=O[1];q++){const G=L.translateBufferLineToString(q,!0,H,$);z.push(G)}}else{const H=E[1]===O[1]?O[0]:void 0;z.push(L.translateBufferLineToString(E[1],!0,E[0],H));for(let $=E[1]+1;$<=O[1]-1;$++){const q=L.lines.get($),G=L.translateBufferLineToString($,!0);q!=null&&q.isWrapped?z[z.length-1]+=G:z.push(G)}if(E[1]!==O[1]){const $=L.lines.get(O[1]),q=L.translateBufferLineToString(O[1],!0,0,O[0]);$&&$.isWrapped?z[z.length-1]+=q:z.push(q)}}return z.map((H=>H.replace(N," "))).join(S.isWindows?`\r
617
+ `:`
618
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&E&&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(E){const O=this._getMouseBufferCoords(E),L=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(L&&z&&O)&&this._areCoordsInSelection(O,L,z)}isCellInSelection(E,O){const L=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!L||!z)&&this._areCoordsInSelection([E,O],L,z)}_areCoordsInSelection(E,O,L){return E[1]>O[1]&&E[1]<L[1]||O[1]===L[1]&&E[1]===O[1]&&E[0]>=O[0]&&E[0]<L[0]||O[1]<L[1]&&E[1]===L[1]&&E[0]<L[0]||O[1]<L[1]&&E[1]===O[1]&&E[0]>=O[0]}_selectWordAtCursor(E,O){var H,$;const L=($=(H=this._linkifier.currentLink)==null?void 0:H.link)==null?void 0:$.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,b.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(E);return!!z&&(this._selectWordAt(z,O),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,O){this._model.clearSelection(),E=Math.max(E,0),O=Math.min(O,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,O],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const O=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(O)return O[0]--,O[1]--,O[1]+=this._bufferService.buffer.ydisp,O}_getMouseEventScrollAmount(E){let O=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return O>=0&&O<=L?0:(O>L&&(O-=L),O=Math.min(Math.max(O,-50),50),O/=50,O/Math.abs(O)+Math.round(14*O))}shouldForceSelection(E){return S.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey}handleMouseDown(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._handleIncrementalClick(E):E.detail===1?this._handleSingleClick(E):E.detail===2?this._handleDoubleClick(E):E.detail===3&&this._handleTripleClick(E),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(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))}_handleSingleClick(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),!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(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const O=this._getMouseBufferCoords(E);O&&(this._activeSelectionMode=2,this._selectLineAt(O[1]))}shouldColumnSelect(E){return E.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.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(E),!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(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const z=L.lines.get(this._model.selectionEnd[1]);z&&z.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 E=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}}_handleMouseUp(E){const O=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&O<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const z=(0,g.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,O=this._model.finalSelectionEnd,L=!(!E||!O||E[0]===O[0]&&E[1]===O[1]);L?E&&O&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&O[0]===this._oldSelectionEnd[0]&&O[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,O,L)):this._oldHasSelection&&this._fireOnSelectionChange(E,O,L)}_fireOnSelectionChange(E,O,L){this._oldSelectionStart=E,this._oldSelectionEnd=O,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((O=>this._handleTrim(O)))}_convertViewportColToCharacterIndex(E,O){let L=O;for(let z=0;O>=z;z++){const H=E.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:H>1&&O!==z&&(L+=H-1)}return L}setSelection(E,O,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,O],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,O,L=!0,z=!0){if(E[0]>=this._bufferService.cols)return;const H=this._bufferService.buffer,$=H.lines.get(E[1]);if(!$)return;const q=H.translateBufferLineToString(E[1],!1);let G=this._convertViewportColToCharacterIndex($,E[0]),W=G;const X=E[0]-G;let Y=0,I=0,M=0,P=0;if(q.charAt(G)===" "){for(;G>0&&q.charAt(G-1)===" ";)G--;for(;W<q.length&&q.charAt(W+1)===" ";)W++}else{let Q=E[0],J=E[0];$.getWidth(Q)===0&&(Y++,Q--),$.getWidth(J)===2&&(I++,J++);const ee=$.getString(J).length;for(ee>1&&(P+=ee-1,W+=ee-1);Q>0&&G>0&&!this._isCharWordSeparator($.loadCell(Q-1,this._workCell));){$.loadCell(Q-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,Q--):K>1&&(M+=K-1,G-=K-1),G--,Q--}for(;J<$.length&&W+1<q.length&&!this._isCharWordSeparator($.loadCell(J+1,this._workCell));){$.loadCell(J+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,J++):K>1&&(P+=K-1,W+=K-1),W++,J++}}W++;let F=G+X-Y+M,B=Math.min(this._bufferService.cols,W-G+Y+I-M-P);if(O||q.slice(G,W).trim()!==""){if(L&&F===0&&$.getCodePoint(0)!==32){const Q=H.lines.get(E[1]-1);if(Q&&$.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(J){const ee=this._bufferService.cols-J.start;F-=ee,B+=ee}}}if(z&&F+B===this._bufferService.cols&&$.getCodePoint(this._bufferService.cols-1)!==32){const Q=H.lines.get(E[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const J=this._getWordAt([0,E[1]+1],!1,!1,!0);J&&(B+=J.length)}}return{start:F,length:B}}}_selectWordAt(E,O){const L=this._getWordAt(E,O);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[L.start,E[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(E){const O=this._getWordAt(E,!0);if(O){let L=E[1];for(;O.start<0;)O.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;O.start+O.length>this._bufferService.cols;)O.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?O.start:O.start+O.length,L]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const O=this._bufferService.buffer.getWrappedRangeForLine(E),L={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,b.getRangeLength)(L,this._bufferService.cols)}};a.SelectionService=D=d([m(3,k.IBufferService),m(4,k.ICoreService),m(5,C.IMouseService),m(6,k.IOptionsService),m(7,C.IRenderService),m(8,C.ICoreBrowserService)],D)},4725:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const d=u(8343);a.ICharSizeService=(0,d.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),a.IMouseService=(0,d.createDecorator)("MouseService"),a.IRenderService=(0,d.createDecorator)("RenderService"),a.ISelectionService=(0,d.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,d.createDecorator)("ThemeService"),a.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(c,a,u){var d=this&&this.__decorate||function(D,E,O,L){var z,H=arguments.length,$=H<3?E:L===null?L=Object.getOwnPropertyDescriptor(E,O):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(D,E,O,L);else for(var q=D.length-1;q>=0;q--)(z=D[q])&&($=(H<3?z($):H>3?z(E,O,$):z(E,O))||$);return H>3&&$&&Object.defineProperty(E,O,$),$},m=this&&this.__param||function(D,E){return function(O,L){E(O,L,D)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const p=u(7239),g=u(8055),_=u(8460),C=u(844),w=u(2585),y=g.css.toColor("#ffffff"),S=g.css.toColor("#000000"),b=g.css.toColor("#ffffff"),x=g.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let O=0;O<216;O++){const L=E[O/36%6|0],z=E[O/6%6|0],H=E[O%6];D.push({css:g.channels.toCss(L,z,H),rgba:g.channels.toRgba(L,z,H)})}for(let O=0;O<24;O++){const L=8+10*O;D.push({css:g.channels.toCss(L,L,L),rgba:g.channels.toRgba(L,L,L)})}return D})());let j=a.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:S,cursor:b,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:g.color.blend(S,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:g.color.blend(S,k),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const E=this._colors;if(E.foreground=N(D.foreground,y),E.background=N(D.background,S),E.cursor=N(D.cursor,b),E.cursorAccent=N(D.cursorAccent,x),E.selectionBackgroundTransparent=N(D.selectionBackground,k),E.selectionBackgroundOpaque=g.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=N(D.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=g.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=D.selectionForeground?N(D.selectionForeground,g.NULL_COLOR):void 0,E.selectionForeground===g.NULL_COLOR&&(E.selectionForeground=void 0),g.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=g.color.opacity(E.selectionBackgroundTransparent,.3)),g.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=g.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=a.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=N(D.black,a.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=N(D.red,a.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=N(D.green,a.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=N(D.yellow,a.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=N(D.blue,a.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=N(D.magenta,a.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=N(D.cyan,a.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=N(D.white,a.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=N(D.brightBlack,a.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=N(D.brightRed,a.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=N(D.brightGreen,a.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=N(D.brightYellow,a.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=N(D.brightBlue,a.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=N(D.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=N(D.brightCyan,a.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=N(D.brightWhite,a.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const O=Math.min(E.ansi.length-16,D.extendedAnsi.length);for(let L=0;L<O;L++)E.ansi[L+16]=N(D.extendedAnsi[L],a.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function N(D,E){if(D!==void 0)try{return g.css.toColor(D)}catch{}return E}a.ThemeService=j=d([m(0,w.IOptionsService)],j)},6349:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const d=u(8460),m=u(844);class p extends m.Disposable{constructor(_){super(),this._maxLength=_,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(_){if(this._maxLength===_)return;const C=new Array(_);for(let w=0;w<Math.min(_,this.length);w++)C[w]=this._array[this._getCyclicIndex(w)];this._array=C,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let C=this._length;C<_;C++)this._array[C]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,C){this._array[this._getCyclicIndex(_)]=C}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,C,...w){if(C){for(let y=_;y<this._length-C;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+C)];this._length-=C,this.onDeleteEmitter.fire({index:_,amount:C})}for(let y=this._length-1;y>=_;y--)this._array[this._getCyclicIndex(y+w.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<w.length;y++)this._array[this._getCyclicIndex(_+y)]=w[y];if(w.length&&this.onInsertEmitter.fire({index:_,amount:w.length}),this._length+w.length>this._maxLength){const y=this._length+w.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=w.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,C,w){if(!(C<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let S=C-1;S>=0;S--)this.set(_+S+w,this.get(_+S));const y=_+C+w-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<C;y++)this.set(_+y+w,this.get(_+y))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}a.CircularList=p},1439:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function u(d,m=5){if(typeof d!="object")return d;const p=Array.isArray(d)?[]:{};for(const g in d)p[g]=m<=1?d[g]:d[g]&&u(d[g],m-1);return p}},8055:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let u=0,d=0,m=0,p=0;var g,_,C,w,y;function S(x){const k=x.toString(16);return k.length<2?"0"+k:k}function b(x,k){return x<k?(k+.05)/(x+.05):(x+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(x){x.toCss=function(k,j,N,D){return D!==void 0?`#${S(k)}${S(j)}${S(N)}${S(D)}`:`#${S(k)}${S(j)}${S(N)}`},x.toRgba=function(k,j,N,D=255){return(k<<24|j<<16|N<<8|D)>>>0},x.toColor=function(k,j,N,D){return{css:x.toCss(k,j,N,D),rgba:x.toRgba(k,j,N,D)}}})(g||(a.channels=g={})),(function(x){function k(j,N){return p=Math.round(255*N),[u,d,m]=y.toChannels(j.rgba),{css:g.toCss(u,d,m,p),rgba:g.toRgba(u,d,m,p)}}x.blend=function(j,N){if(p=(255&N.rgba)/255,p===1)return{css:N.css,rgba:N.rgba};const D=N.rgba>>24&255,E=N.rgba>>16&255,O=N.rgba>>8&255,L=j.rgba>>24&255,z=j.rgba>>16&255,H=j.rgba>>8&255;return u=L+Math.round((D-L)*p),d=z+Math.round((E-z)*p),m=H+Math.round((O-H)*p),{css:g.toCss(u,d,m),rgba:g.toRgba(u,d,m)}},x.isOpaque=function(j){return(255&j.rgba)==255},x.ensureContrastRatio=function(j,N,D){const E=y.ensureContrastRatio(j.rgba,N.rgba,D);if(E)return g.toColor(E>>24&255,E>>16&255,E>>8&255)},x.opaque=function(j){const N=(255|j.rgba)>>>0;return[u,d,m]=y.toChannels(N),{css:g.toCss(u,d,m),rgba:N}},x.opacity=k,x.multiplyOpacity=function(j,N){return p=255&j.rgba,k(j,p*N/255)},x.toColorRGB=function(j){return[j.rgba>>24&255,j.rgba>>16&255,j.rgba>>8&255]}})(_||(a.color=_={})),(function(x){let k,j;try{const N=document.createElement("canvas");N.width=1,N.height=1;const D=N.getContext("2d",{willReadFrequently:!0});D&&(k=D,k.globalCompositeOperation="copy",j=k.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return u=parseInt(N.slice(1,2).repeat(2),16),d=parseInt(N.slice(2,3).repeat(2),16),m=parseInt(N.slice(3,4).repeat(2),16),g.toColor(u,d,m);case 5:return u=parseInt(N.slice(1,2).repeat(2),16),d=parseInt(N.slice(2,3).repeat(2),16),m=parseInt(N.slice(3,4).repeat(2),16),p=parseInt(N.slice(4,5).repeat(2),16),g.toColor(u,d,m,p);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const D=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),d=parseInt(D[2]),m=parseInt(D[3]),p=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),g.toColor(u,d,m,p);if(!k||!j)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=j,k.fillStyle=N,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[u,d,m,p]=k.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,d,m,p),css:N}}})(C||(a.css=C={})),(function(x){function k(j,N,D){const E=j/255,O=N/255,L=D/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}x.relativeLuminance=function(j){return k(j>>16&255,j>>8&255,255&j)},x.relativeLuminance2=k})(w||(a.rgb=w={})),(function(x){function k(N,D,E){const O=N>>24&255,L=N>>16&255,z=N>>8&255;let H=D>>24&255,$=D>>16&255,q=D>>8&255,G=b(w.relativeLuminance2(H,$,q),w.relativeLuminance2(O,L,z));for(;G<E&&(H>0||$>0||q>0);)H-=Math.max(0,Math.ceil(.1*H)),$-=Math.max(0,Math.ceil(.1*$)),q-=Math.max(0,Math.ceil(.1*q)),G=b(w.relativeLuminance2(H,$,q),w.relativeLuminance2(O,L,z));return(H<<24|$<<16|q<<8|255)>>>0}function j(N,D,E){const O=N>>24&255,L=N>>16&255,z=N>>8&255;let H=D>>24&255,$=D>>16&255,q=D>>8&255,G=b(w.relativeLuminance2(H,$,q),w.relativeLuminance2(O,L,z));for(;G<E&&(H<255||$<255||q<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),$=Math.min(255,$+Math.ceil(.1*(255-$))),q=Math.min(255,q+Math.ceil(.1*(255-q))),G=b(w.relativeLuminance2(H,$,q),w.relativeLuminance2(O,L,z));return(H<<24|$<<16|q<<8|255)>>>0}x.blend=function(N,D){if(p=(255&D)/255,p===1)return D;const E=D>>24&255,O=D>>16&255,L=D>>8&255,z=N>>24&255,H=N>>16&255,$=N>>8&255;return u=z+Math.round((E-z)*p),d=H+Math.round((O-H)*p),m=$+Math.round((L-$)*p),g.toRgba(u,d,m)},x.ensureContrastRatio=function(N,D,E){const O=w.relativeLuminance(N>>8),L=w.relativeLuminance(D>>8);if(b(O,L)<E){if(L<O){const $=k(N,D,E),q=b(O,w.relativeLuminance($>>8));if(q<E){const G=j(N,D,E);return q>b(O,w.relativeLuminance(G>>8))?$:G}return $}const z=j(N,D,E),H=b(O,w.relativeLuminance(z>>8));if(H<E){const $=k(N,D,E);return H>b(O,w.relativeLuminance($>>8))?z:$}return z}},x.reduceLuminance=k,x.increaseLuminance=j,x.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(y||(a.rgba=y={})),a.toPaddedHex=S,a.contrastRatio=b},8969:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const d=u(844),m=u(2585),p=u(4348),g=u(7866),_=u(744),C=u(7302),w=u(6975),y=u(8460),S=u(1753),b=u(1480),x=u(7994),k=u(9282),j=u(5435),N=u(5981),D=u(2660);let E=!1;class O extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((z=>{var H;(H=this._onScrollApi)==null||H.fire(z.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(z){for(const H in z)this.optionsService.options[H]=z[H]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new C.OptionsService(z)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(b.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(x.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new j.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((H=>{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((H=>{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 N.WriteBuffer(((H,$)=>this._inputHandler.parse(H,$)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,H){this._writeBuffer.write(z,H)}writeSync(z,H){this._logService.logLevel<=m.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(z,H)}input(z,H=!0){this.coreService.triggerDataEvent(z,H)}resize(z,H){isNaN(z)||isNaN(H)||(z=Math.max(z,_.MINIMUM_COLS),H=Math.max(H,_.MINIMUM_ROWS),this._bufferService.resize(z,H))}scroll(z,H=!1){this._bufferService.scroll(z,H)}scrollLines(z,H,$){this._bufferService.scrollLines(z,H,$)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const H=z-this._bufferService.buffer.ydisp;H!==0&&this.scrollLines(H)}registerEscHandler(z,H){return this._inputHandler.registerEscHandler(z,H)}registerDcsHandler(z,H){return this._inputHandler.registerDcsHandler(z,H)}registerCsiHandler(z,H){return this._inputHandler.registerCsiHandler(z,H)}registerOscHandler(z,H){return this._inputHandler.registerOscHandler(z,H)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const H=this.optionsService.rawOptions.windowsPty;H&&H.buildNumber!==void 0&&H.buildNumber!==void 0?z=H.backend==="conpty"&&H.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const H of z)H.dispose()}))}}}a.CoreTerminal=O},8460:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const m=[];for(let p=0;p<this._listeners.length;p++)m.push(this._listeners[p]);for(let p=0;p<m.length;p++)m[p].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,d){return u((m=>d.fire(m)))},a.runAndSubscribe=function(u,d){return d(void 0),u((m=>d(m)))}},5435:function(c,a,u){var d=this&&this.__decorate||function(Y,I,M,P){var F,B=arguments.length,Q=B<3?I:P===null?P=Object.getOwnPropertyDescriptor(I,M):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(Y,I,M,P);else for(var J=Y.length-1;J>=0;J--)(F=Y[J])&&(Q=(B<3?F(Q):B>3?F(I,M,Q):F(I,M))||Q);return B>3&&Q&&Object.defineProperty(I,M,Q),Q},m=this&&this.__param||function(Y,I){return function(M,P){I(M,P,Y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const p=u(2584),g=u(7116),_=u(2015),C=u(844),w=u(482),y=u(8437),S=u(8460),b=u(643),x=u(511),k=u(3734),j=u(2585),N=u(1480),D=u(6242),E=u(6351),O=u(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function H(Y,I){if(Y>24)return I.setWinLines||!1;switch(Y){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var $;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})($||(a.WindowsOptionsReportType=$={}));let q=0;class G extends C.Disposable{getAttrData(){return this._curAttrData}constructor(I,M,P,F,B,Q,J,ee,K=new _.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=M,this._coreService=P,this._logService=F,this._optionsService=B,this._oscLinkService=Q,this._coreMouseService=J,this._unicodeService=ee,this._parser=K,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=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((V=>this._activeBuffer=V.activeBuffer))),this._parser.setCsiHandlerFallback(((V,te)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(V),params:te.toArray()})})),this._parser.setEscHandlerFallback((V=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(V)})})),this._parser.setExecuteHandlerFallback((V=>{this._logService.debug("Unknown EXECUTE code: ",{code:V})})),this._parser.setOscHandlerFallback(((V,te,re)=>{this._logService.debug("Unknown OSC code: ",{identifier:V,action:te,data:re})})),this._parser.setDcsHandlerFallback(((V,te,re)=>{te==="HOOK"&&(re=re.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(V),action:te,payload:re})})),this._parser.setPrintHandler(((V,te,re)=>this.print(V,te,re))),this._parser.registerCsiHandler({final:"@"},(V=>this.insertChars(V))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(V=>this.scrollLeft(V))),this._parser.registerCsiHandler({final:"A"},(V=>this.cursorUp(V))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(V=>this.scrollRight(V))),this._parser.registerCsiHandler({final:"B"},(V=>this.cursorDown(V))),this._parser.registerCsiHandler({final:"C"},(V=>this.cursorForward(V))),this._parser.registerCsiHandler({final:"D"},(V=>this.cursorBackward(V))),this._parser.registerCsiHandler({final:"E"},(V=>this.cursorNextLine(V))),this._parser.registerCsiHandler({final:"F"},(V=>this.cursorPrecedingLine(V))),this._parser.registerCsiHandler({final:"G"},(V=>this.cursorCharAbsolute(V))),this._parser.registerCsiHandler({final:"H"},(V=>this.cursorPosition(V))),this._parser.registerCsiHandler({final:"I"},(V=>this.cursorForwardTab(V))),this._parser.registerCsiHandler({final:"J"},(V=>this.eraseInDisplay(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(V=>this.eraseInDisplay(V,!0))),this._parser.registerCsiHandler({final:"K"},(V=>this.eraseInLine(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(V=>this.eraseInLine(V,!0))),this._parser.registerCsiHandler({final:"L"},(V=>this.insertLines(V))),this._parser.registerCsiHandler({final:"M"},(V=>this.deleteLines(V))),this._parser.registerCsiHandler({final:"P"},(V=>this.deleteChars(V))),this._parser.registerCsiHandler({final:"S"},(V=>this.scrollUp(V))),this._parser.registerCsiHandler({final:"T"},(V=>this.scrollDown(V))),this._parser.registerCsiHandler({final:"X"},(V=>this.eraseChars(V))),this._parser.registerCsiHandler({final:"Z"},(V=>this.cursorBackwardTab(V))),this._parser.registerCsiHandler({final:"`"},(V=>this.charPosAbsolute(V))),this._parser.registerCsiHandler({final:"a"},(V=>this.hPositionRelative(V))),this._parser.registerCsiHandler({final:"b"},(V=>this.repeatPrecedingCharacter(V))),this._parser.registerCsiHandler({final:"c"},(V=>this.sendDeviceAttributesPrimary(V))),this._parser.registerCsiHandler({prefix:">",final:"c"},(V=>this.sendDeviceAttributesSecondary(V))),this._parser.registerCsiHandler({final:"d"},(V=>this.linePosAbsolute(V))),this._parser.registerCsiHandler({final:"e"},(V=>this.vPositionRelative(V))),this._parser.registerCsiHandler({final:"f"},(V=>this.hVPosition(V))),this._parser.registerCsiHandler({final:"g"},(V=>this.tabClear(V))),this._parser.registerCsiHandler({final:"h"},(V=>this.setMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(V=>this.setModePrivate(V))),this._parser.registerCsiHandler({final:"l"},(V=>this.resetMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(V=>this.resetModePrivate(V))),this._parser.registerCsiHandler({final:"m"},(V=>this.charAttributes(V))),this._parser.registerCsiHandler({final:"n"},(V=>this.deviceStatus(V))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(V=>this.deviceStatusPrivate(V))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(V=>this.softReset(V))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(V=>this.setCursorStyle(V))),this._parser.registerCsiHandler({final:"r"},(V=>this.setScrollRegion(V))),this._parser.registerCsiHandler({final:"s"},(V=>this.saveCursor(V))),this._parser.registerCsiHandler({final:"t"},(V=>this.windowOptions(V))),this._parser.registerCsiHandler({final:"u"},(V=>this.restoreCursor(V))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(V=>this.insertColumns(V))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(V=>this.deleteColumns(V))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(V=>this.selectProtected(V))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(V=>this.requestMode(V,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(V=>this.requestMode(V,!1))),this._parser.setExecuteHandler(p.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(p.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(p.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(p.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(p.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(p.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(p.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(p.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(p.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((V=>(this.setTitle(V),this.setIconName(V),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((V=>this.setIconName(V)))),this._parser.registerOscHandler(2,new D.OscHandler((V=>this.setTitle(V)))),this._parser.registerOscHandler(4,new D.OscHandler((V=>this.setOrReportIndexedColor(V)))),this._parser.registerOscHandler(8,new D.OscHandler((V=>this.setHyperlink(V)))),this._parser.registerOscHandler(10,new D.OscHandler((V=>this.setOrReportFgColor(V)))),this._parser.registerOscHandler(11,new D.OscHandler((V=>this.setOrReportBgColor(V)))),this._parser.registerOscHandler(12,new D.OscHandler((V=>this.setOrReportCursorColor(V)))),this._parser.registerOscHandler(104,new D.OscHandler((V=>this.restoreIndexedColor(V)))),this._parser.registerOscHandler(110,new D.OscHandler((V=>this.restoreFgColor(V)))),this._parser.registerOscHandler(111,new D.OscHandler((V=>this.restoreBgColor(V)))),this._parser.registerOscHandler(112,new D.OscHandler((V=>this.restoreCursorColor(V)))),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 V in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:V},(()=>this.selectCharset("("+V))),this._parser.registerEscHandler({intermediates:")",final:V},(()=>this.selectCharset(")"+V))),this._parser.registerEscHandler({intermediates:"*",final:V},(()=>this.selectCharset("*"+V))),this._parser.registerEscHandler({intermediates:"+",final:V},(()=>this.selectCharset("+"+V))),this._parser.registerEscHandler({intermediates:"-",final:V},(()=>this.selectCharset("-"+V))),this._parser.registerEscHandler({intermediates:".",final:V},(()=>this.selectCharset("."+V))),this._parser.registerEscHandler({intermediates:"/",final:V},(()=>this.selectCharset("/"+V)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((V=>(this._logService.error("Parsing error: ",V),V))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((V,te)=>this.requestStatusString(V,te))))}_preserveStack(I,M,P,F){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=P,this._parseStack.position=F}_logSlowResolvingAsync(I){this._logService.logLevel<=j.LogLevelEnum.WARN&&Promise.race([I,new Promise(((M,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,M){let P,F=this._activeBuffer.x,B=this._activeBuffer.y,Q=0;const J=this._parseStack.paused;if(J){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(P),P;F=this._parseStack.cursorStartX,B=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>z&&(Q=this._parseStack.position+z)}if(this._logService.logLevel<=j.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(V=>String.fromCharCode(V))).join("")}"`),typeof I=="string"?I.split("").map((V=>V.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(I.length,z))),J||this._dirtyRowTracker.clearRange(),I.length>z)for(let V=Q;V<I.length;V+=z){const te=V+z<I.length?V+z:I.length,re=typeof I=="string"?this._stringDecoder.decode(I.substring(V,te),this._parseBuffer):this._utf8Decoder.decode(I.subarray(V,te),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,re))return this._preserveStack(F,B,re,V),this._logSlowResolvingAsync(P),P}else if(!J){const V=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,V))return this._preserveStack(F,B,V,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===F&&this._activeBuffer.y===B||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(I,M,P){let F,B;const Q=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,V=this._coreService.modes.insertMode,te=this._curAttrData;let re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-M>0&&re.getWidth(this._activeBuffer.x-1)===2&&re.setCellFromCodepoint(this._activeBuffer.x-1,0,1,te);let ae=this._parser.precedingJoinState;for(let se=M;se<P;++se){if(F=I[se],F<127&&Q){const Ue=Q[String.fromCharCode(F)];Ue&&(F=Ue.charCodeAt(0))}const _e=this._unicodeService.charProperties(F,ae);B=N.UnicodeService.extractWidth(_e);const Ee=N.UnicodeService.extractShouldJoin(_e),De=Ee?N.UnicodeService.extractWidth(ae):0;if(ae=_e,J&&this._onA11yChar.fire((0,w.stringFromCodePoint)(F)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+B-De>ee){if(K){const Ue=re;let ce=this._activeBuffer.x-De;for(this._activeBuffer.x=De,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),re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),De>0&&re instanceof y.BufferLine&&re.copyCellsFrom(Ue,ce,0,De,!1);ce<ee;)Ue.setCellFromCodepoint(ce++,0,1,te)}else if(this._activeBuffer.x=ee-1,B===2)continue}if(Ee&&this._activeBuffer.x){const Ue=re.getWidth(this._activeBuffer.x-1)?1:2;re.addCodepointToCell(this._activeBuffer.x-Ue,F,B);for(let ce=B-De;--ce>=0;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}else if(V&&(re.insertCells(this._activeBuffer.x,B-De,this._activeBuffer.getNullCell(te)),re.getWidth(ee-1)===2&&re.setCellFromCodepoint(ee-1,b.NULL_CELL_CODE,b.NULL_CELL_WIDTH,te)),re.setCellFromCodepoint(this._activeBuffer.x++,F,B,te),B>0)for(;--B;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}this._parser.precedingJoinState=ae,this._activeBuffer.x<ee&&P-M>0&&re.getWidth(this._activeBuffer.x)===0&&!re.hasContent(this._activeBuffer.x)&&re.setCellFromCodepoint(this._activeBuffer.x,0,1,te),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,M){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,M):this._parser.registerCsiHandler(I,(P=>!H(P.params[0],this._optionsService.rawOptions.windowOptions)||M(P)))}registerDcsHandler(I,M){return this._parser.registerDcsHandler(I,new E.DcsHandler(M))}registerEscHandler(I,M){return this._parser.registerEscHandler(I,M)}registerOscHandler(I,M){return this._parser.registerOscHandler(I,new D.OscHandler(M))}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 I;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&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=I,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+M)}cursorUp(I){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const M=I.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=I.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=I.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const M=I.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,M,P,F=!1,B=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Q.replaceCells(M,P,this._activeBuffer.getNullCell(this._eraseAttrData()),B),F&&(Q.isWrapped=!1)}_resetBufferLine(I,M=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),P.isWrapped=!1)}eraseInDisplay(I,M=!1){let P;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);P<this._bufferService.rows;P++)this._resetBufferLine(P,M);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,M);this._dirtyRowTracker.markDirty(0);break;case 3:const F=this._activeBuffer.lines.length-this._bufferService.rows;F>0&&(this._activeBuffer.lines.trimStart(F),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-F,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-F,0),this._onScroll.fire(0))}return!0}eraseInLine(I,M=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let M=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-F+1;for(;M--;)this._activeBuffer.lines.splice(B-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let M=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let F;for(F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-F;M--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let M=I.params[0]||1;for(;M--;)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(I){let M=I.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(y.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);F.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);F.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);F.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);F.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const M=this._parser.precedingJoinState;if(!M)return!0;const P=I.params[0]||1,F=N.UnicodeService.extractWidth(M),B=this._activeBuffer.x-F,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(B),J=new Uint32Array(Q.length*P);let ee=0;for(let V=0;V<Q.length;){const te=Q.codePointAt(V)||0;J[ee++]=te,V+=te>65535?2:1}let K=ee;for(let V=1;V<P;++V)J.copyWithin(K,0,ee),K+=ee;return this.print(J,0,K),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let M=0;M<I.length;M++)switch(I.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let M=0;M<I.length;M++)switch(I.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(I){for(let M=0;M<I.length;M++)switch(I.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let M=0;M<I.length;M++)switch(I.params[M]){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(),I.params[M]===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(I,M){const P=this._coreService.decPrivateModes,{activeProtocol:F,activeEncoding:B}=this._coreMouseService,Q=this._coreService,{buffers:J,cols:ee}=this._bufferService,{active:K,alt:V}=J,te=this._optionsService.rawOptions,re=Ee=>Ee?1:2,ae=I.params[0];return se=ae,_e=M?ae===2?4:ae===4?re(Q.modes.insertMode):ae===12?3:ae===20?re(te.convertEol):0:ae===1?re(P.applicationCursorKeys):ae===3?te.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:ae===6?re(P.origin):ae===7?re(P.wraparound):ae===8?3:ae===9?re(F==="X10"):ae===12?re(te.cursorBlink):ae===25?re(!Q.isCursorHidden):ae===45?re(P.reverseWraparound):ae===66?re(P.applicationKeypad):ae===67?4:ae===1e3?re(F==="VT200"):ae===1002?re(F==="DRAG"):ae===1003?re(F==="ANY"):ae===1004?re(P.sendFocus):ae===1005?4:ae===1006?re(B==="SGR"):ae===1015?4:ae===1016?re(B==="SGR_PIXELS"):ae===1048?1:ae===47||ae===1047||ae===1049?re(K===V):ae===2004?re(P.bracketedPasteMode):0,Q.triggerDataEvent(`${p.C0.ESC}[${M?"":"?"}${se};${_e}$y`),!0;var se,_e}_updateAttrColor(I,M,P,F,B){return M===2?(I|=50331648,I&=-16777216,I|=k.AttributeData.fromColorRGB([P,F,B])):M===5&&(I&=-50331904,I|=33554432|255&P),I}_extractColor(I,M,P){const F=[0,0,-1,0,0,0];let B=0,Q=0;do{if(F[Q+B]=I.params[M+Q],I.hasSubParams(M+Q)){const J=I.getSubParams(M+Q);let ee=0;do F[1]===5&&(B=1),F[Q+ee+1+B]=J[ee];while(++ee<J.length&&ee+Q+1+B<F.length);break}if(F[1]===5&&Q+B>=2||F[1]===2&&Q+B>=5)break;F[1]&&(B=1)}while(++Q+M<I.length&&Q+B<F.length);for(let J=2;J<F.length;++J)F[J]===-1&&(F[J]=0);switch(F[0]){case 38:P.fg=this._updateAttrColor(P.fg,F[1],F[3],F[4],F[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,F[1],F[3],F[4],F[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,F[1],F[3],F[4],F[5])}return Q}_processUnderline(I,M){M.extended=M.extended.clone(),(!~I||I>5)&&(I=1),M.extended.underlineStyle=I,M.fg|=268435456,I===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(I){I.fg=y.DEFAULT_ATTR_DATA.fg,I.bg=y.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=I.length;let P;const F=this._curAttrData;for(let B=0;B<M;B++)P=I.params[B],P>=30&&P<=37?(F.fg&=-50331904,F.fg|=16777216|P-30):P>=40&&P<=47?(F.bg&=-50331904,F.bg|=16777216|P-40):P>=90&&P<=97?(F.fg&=-50331904,F.fg|=16777224|P-90):P>=100&&P<=107?(F.bg&=-50331904,F.bg|=16777224|P-100):P===0?this._processSGR0(F):P===1?F.fg|=134217728:P===3?F.bg|=67108864:P===4?(F.fg|=268435456,this._processUnderline(I.hasSubParams(B)?I.getSubParams(B)[0]:1,F)):P===5?F.fg|=536870912:P===7?F.fg|=67108864:P===8?F.fg|=1073741824:P===9?F.fg|=2147483648:P===2?F.bg|=134217728:P===21?this._processUnderline(2,F):P===22?(F.fg&=-134217729,F.bg&=-134217729):P===23?F.bg&=-67108865:P===24?(F.fg&=-268435457,this._processUnderline(0,F)):P===25?F.fg&=-536870913:P===27?F.fg&=-67108865:P===28?F.fg&=-1073741825:P===29?F.fg&=2147483647:P===39?(F.fg&=-67108864,F.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):P===49?(F.bg&=-67108864,F.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?B+=this._extractColor(I,B,F):P===53?F.bg|=1073741824:P===55?F.bg&=-1073741825:P===59?(F.extended=F.extended.clone(),F.extended.underlineColor=-1,F.updateExtended()):P===100?(F.fg&=-67108864,F.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,F.bg&=-67108864,F.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${M};${P}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const M=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${M};${P}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const M=I.params[0]||1;switch(M){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 P=M%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(I){const M=I.params[0]||1;let P;return(I.length<2||(P=I.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(I){if(!H(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire($.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire($.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const M=[],P=I.split(";");for(;P.length>1;){const F=P.shift(),B=P.shift();if(/^\d+$/.exec(F)){const Q=parseInt(F);if(X(Q))if(B==="?")M.push({type:0,index:Q});else{const J=(0,O.parseColor)(B);J&&M.push({type:1,index:Q,color:J})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(I){const M=I.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(I,M){this._getCurrentLinkId()&&this._finishHyperlink();const P=I.split(":");let F;const B=P.findIndex((Q=>Q.startsWith("id=")));return B!==-1&&(F=P[B].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:F,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,M){const P=I.split(";");for(let F=0;F<P.length&&!(M>=this._specialColors.length);++F,++M)if(P[F]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const B=(0,O.parseColor)(P[F]);B&&this._onColor.fire([{type:1,index:this._specialColors[M],color:B}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const M=[],P=I.split(";");for(let F=0;F<P.length;++F)if(/^\d+$/.exec(P[F])){const B=parseInt(P[F]);X(B)&&M.push({type:2,index:B})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){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,g.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(L[I[0]],g.CHARSETS[I[1]]||g.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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new x.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const P=this._activeBuffer.ybase+this._activeBuffer.y+M,F=this._activeBuffer.lines.get(P);F&&(F.fill(I),F.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,M){const P=this._bufferService.buffer,F=this._optionsService.rawOptions;return(B=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${B}${p.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[F.cursorStyle]-(F.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,M){this._dirtyRowTracker.markRangeDirty(I,M)}}a.InputHandler=G;let W=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,I){Y>I&&(q=Y,Y=I,I=q),Y<this.start&&(this.start=Y),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(Y){return 0<=Y&&Y<256}W=d([m(0,j.IBufferService)],W)},844:(c,a)=>{function u(d){for(const m of d)m.dispose();d.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const m=this._disposables.indexOf(d);m!==-1&&this._disposables.splice(m,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var m;this._isDisposed||d===this._value||((m=this._value)==null||m.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}},a.toDisposable=function(d){return{dispose:d}},a.disposeArray=u,a.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(m,p,g){this._data[m]||(this._data[m]={}),this._data[m][p]=g}get(m,p){return this._data[m]?this._data[m][p]:void 0}clear(){this._data={}}}a.TwoKeyMap=u,a.FourKeyMap=class{constructor(){this._data=new u}set(d,m,p,g,_){this._data.get(d,m)||this._data.set(d,m,new u),this._data.get(d,m).set(p,g,_)}get(d,m,p,g){var _;return(_=this._data.get(d,m))==null?void 0:_.get(p,g)}clear(){this._data.clear()}}},6114:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const u=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=u.includes("Firefox"),a.isLegacyEdge=u.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(u),a.getSafariVersion=function(){if(!a.isSafari)return 0;const m=u.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(u)},6106:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let u=0;a.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const m=this._getKey(d);if(m===void 0||(u=this._search(m),u===-1)||this._getKey(this._array[u])!==m)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===m);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,m){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do m(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let m=0,p=this._array.length-1;for(;p>=m;){let g=m+p>>1;const _=this._getKey(this._array[g]);if(_>d)p=g-1;else{if(!(_<d)){for(;g>0&&this._getKey(this._array[g-1])===d;)g--;return g}m=g+1}}return m}}},7226:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=u(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let C=0,w=0,y=_.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),w=Math.max(C,w),S=_.timeRemaining(),1.5*w>S)return y-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-C))}ms`),void this._start();y=S}this.clear()}}class p extends m{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const C=Date.now()+_;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}a.PriorityTaskQueue=p,a.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:p,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const d=u(643);a.updateWindowsModeWrappedState=function(m){const p=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=p==null?void 0:p.get(m.cols-1),_=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);_&&g&&(_.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new u;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}get underlineVariantOffset(){const p=(3758096384&this._ext)>>29;return p<0?4294967288^p:p}set underlineVariantOffset(p){this._ext&=536870911,this._ext|=p<<29&3758096384}constructor(p=0,g=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=d},9092:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const d=u(6349),m=u(7226),p=u(3734),g=u(8437),_=u(4634),C=u(511),w=u(643),y=u(4863),S=u(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(b,x,k){this._hasScrollback=b,this._optionsService=x,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(b){return b?(this._nullCell.fg=b.fg,this._nullCell.bg=b.bg,this._nullCell.extended=b.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(b){return b?(this._whitespaceCell.fg=b.fg,this._whitespaceCell.bg=b.bg,this._whitespaceCell.extended=b.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(b,x){return new g.BufferLine(this._bufferService.cols,this.getNullCell(b),x)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const b=this.ybase+this.y-this.ydisp;return b>=0&&b<this._rows}_getCorrectBufferLength(b){if(!this._hasScrollback)return b;const x=b+this._optionsService.rawOptions.scrollback;return x>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:x}fillViewportRows(b){if(this.lines.length===0){b===void 0&&(b=g.DEFAULT_ATTR_DATA);let x=this._rows;for(;x--;)this.lines.push(this.getBlankLine(b))}}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(b,x){const k=this.getNullCell(g.DEFAULT_ATTR_DATA);let j=0;const N=this._getCorrectBufferLength(x);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols<b)for(let E=0;E<this.lines.length;E++)j+=+this.lines.get(E).resize(b,k);let D=0;if(this._rows<x)for(let E=this._rows;E<x;E++)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 g.BufferLine(b,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(b,k)));else for(let E=this._rows;E>x;E--)this.lines.length>x+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N<this.lines.maxLength){const E=this.lines.length-N;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=N}this.x=Math.min(this.x,b-1),this.y=Math.min(this.y,x-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,b-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(b,x),this._cols>b))for(let D=0;D<this.lines.length;D++)j+=+this.lines.get(D).resize(b,k);this._cols=b,this._rows=x,this._memoryCleanupQueue.clear(),j>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let b=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,b=!1);let x=0;for(;this._memoryCleanupPosition<this.lines.length;)if(x+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),x>100)return!0;return b}get _isReflowEnabled(){const b=this._optionsService.rawOptions.windowsPty;return b&&b.buildNumber?this._hasScrollback&&b.backend==="conpty"&&b.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(b,x){this._cols!==b&&(b>this._cols?this._reflowLarger(b,x):this._reflowSmaller(b,x))}_reflowLarger(b,x){const k=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,b,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(k.length>0){const j=(0,_.reflowLargerCreateNewLayout)(this.lines,k);(0,_.reflowLargerApplyNewLayout)(this.lines,j.layout),this._reflowLargerAdjustViewport(b,x,j.countRemoved)}}_reflowLargerAdjustViewport(b,x,k){const j=this.getNullCell(g.DEFAULT_ATTR_DATA);let N=k;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<x&&this.lines.push(new g.BufferLine(b,j))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(b,x){const k=this.getNullCell(g.DEFAULT_ATTR_DATA),j=[];let N=0;for(let D=this.lines.length-1;D>=0;D--){let E=this.lines.get(D);if(!E||!E.isWrapped&&E.getTrimmedLength()<=b)continue;const O=[E];for(;E.isWrapped&&D>0;)E=this.lines.get(--D),O.unshift(E);const L=this.ybase+this.y;if(L>=D&&L<D+O.length)continue;const z=O[O.length-1].getTrimmedLength(),H=(0,_.reflowSmallerGetNewLineLengths)(O,this._cols,b),$=H.length-O.length;let q;q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+$):Math.max(0,this.lines.length-this.lines.maxLength+$);const G=[];for(let P=0;P<$;P++){const F=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);G.push(F)}G.length>0&&(j.push({start:D+O.length+N,newLines:G}),N+=G.length),O.push(...G);let W=H.length-1,X=H[W];X===0&&(W--,X=H[W]);let Y=O.length-$-1,I=z;for(;Y>=0;){const P=Math.min(I,X);if(O[W]===void 0)break;if(O[W].copyCellsFrom(O[Y],I-P,X-P,P,!0),X-=P,X===0&&(W--,X=H[W]),I-=P,I===0){Y--;const F=Math.max(Y,0);I=(0,_.getWrappedLineTrimmedLength)(O,F,this._cols)}}for(let P=0;P<O.length;P++)H[P]<b&&O[P].setCell(H[P],k);let M=$-q;for(;M-- >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+N)-x&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+$,this.ybase+x-1)}if(j.length>0){const D=[],E=[];for(let W=0;W<this.lines.length;W++)E.push(this.lines.get(W));const O=this.lines.length;let L=O-1,z=0,H=j[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+N);let $=0;for(let W=Math.min(this.lines.maxLength-1,O+N-1);W>=0;W--)if(H&&H.start>L+$){for(let X=H.newLines.length-1;X>=0;X--)this.lines.set(W--,H.newLines[X]);W++,D.push({index:L+1,amount:H.newLines.length}),$+=H.newLines.length,H=j[++z]}else this.lines.set(W,E[L--]);let q=0;for(let W=D.length-1;W>=0;W--)D[W].index+=q,this.lines.onInsertEmitter.fire(D[W]),q+=D[W].amount;const G=Math.max(0,O+N-this.lines.maxLength);G>0&&this.lines.onTrimEmitter.fire(G)}}translateBufferLineToString(b,x,k=0,j){const N=this.lines.get(b);return N?N.translateToString(x,k,j):""}getWrappedRangeForLine(b){let x=b,k=b;for(;x>0&&this.lines.get(x).isWrapped;)x--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:x,last:k}}setupTabStops(b){for(b!=null?this.tabs[b]||(b=this.prevStop(b)):(this.tabs={},b=0);b<this._cols;b+=this._optionsService.rawOptions.tabStopWidth)this.tabs[b]=!0}prevStop(b){for(b==null&&(b=this.x);!this.tabs[--b]&&b>0;);return b>=this._cols?this._cols-1:b<0?0:b}nextStop(b){for(b==null&&(b=this.x);!this.tabs[++b]&&b<this._cols;);return b>=this._cols?this._cols-1:b<0?0:b}clearMarkers(b){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].line===b&&(this.markers[x].dispose(),this.markers.splice(x--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].dispose(),this.markers.splice(b--,1);this._isClearing=!1}addMarker(b){const x=new y.Marker(b);return this.markers.push(x),x.register(this.lines.onTrim((k=>{x.line-=k,x.line<0&&x.dispose()}))),x.register(this.lines.onInsert((k=>{x.line>=k.index&&(x.line+=k.amount)}))),x.register(this.lines.onDelete((k=>{x.line>=k.index&&x.line<k.index+k.amount&&x.dispose(),x.line>k.index&&(x.line-=k.amount)}))),x.register(x.onDispose((()=>this._removeMarker(x)))),x}_removeMarker(b){this._isClearing||this.markers.splice(this.markers.indexOf(b),1)}}},8437:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const d=u(3734),m=u(511),p=u(643),g=u(482);a.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let _=0;class C{constructor(y,S,b=!1){this.isWrapped=b,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const x=S||m.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let k=0;k<y;++k)this.setCell(k,x);this.length=y}get(y){const S=this._data[3*y+0],b=2097151&S;return[this._data[3*y+1],2097152&S?this._combined[y]:b?(0,g.stringFromCodePoint)(b):"",S>>22,2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):b]}set(y,S){this._data[3*y+1]=S[p.CHAR_DATA_ATTR_INDEX],S[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=S[1],this._data[3*y+0]=2097152|y|S[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&S}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y]:2097151&S?(0,g.stringFromCodePoint)(2097151&S):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,S){return _=3*y,S.content=this._data[_+0],S.fg=this._data[_+1],S.bg=this._data[_+2],2097152&S.content&&(S.combinedData=this._combined[y]),268435456&S.bg&&(S.extended=this._extendedAttrs[y]),S}setCell(y,S){2097152&S.content&&(this._combined[y]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[y]=S.extended),this._data[3*y+0]=S.content,this._data[3*y+1]=S.fg,this._data[3*y+2]=S.bg}setCellFromCodepoint(y,S,b,x){268435456&x.bg&&(this._extendedAttrs[y]=x.extended),this._data[3*y+0]=S|b<<22,this._data[3*y+1]=x.fg,this._data[3*y+2]=x.bg}addCodepointToCell(y,S,b){let x=this._data[3*y+0];2097152&x?this._combined[y]+=(0,g.stringFromCodePoint)(S):2097151&x?(this._combined[y]=(0,g.stringFromCodePoint)(2097151&x)+(0,g.stringFromCodePoint)(S),x&=-2097152,x|=2097152):x=S|4194304,b&&(x&=-12582913,x|=b<<22),this._data[3*y+0]=x}insertCells(y,S,b){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,b),S<this.length-y){const x=new m.CellData;for(let k=this.length-y-S-1;k>=0;--k)this.setCell(y+S+k,this.loadCell(y+k,x));for(let k=0;k<S;++k)this.setCell(y+k,b)}else for(let x=y;x<this.length;++x)this.setCell(x,b);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,b)}deleteCells(y,S,b){if(y%=this.length,S<this.length-y){const x=new m.CellData;for(let k=0;k<this.length-y-S;++k)this.setCell(y+k,this.loadCell(y+S+k,x));for(let k=this.length-S;k<this.length;++k)this.setCell(k,b)}else for(let x=y;x<this.length;++x)this.setCell(x,b);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,b),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,b)}replaceCells(y,S,b,x=!1){if(x)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,b),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,b);y<S&&y<this.length;)this.isProtected(y)||this.setCell(y,b),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,b),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,b);y<S&&y<this.length;)this.setCell(y++,b)}resize(y,S){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const b=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*b)this._data=new Uint32Array(this._data.buffer,0,b);else{const x=new Uint32Array(b);x.set(this._data),this._data=x}for(let x=this.length;x<y;++x)this.setCell(x,S)}else{this._data=this._data.subarray(0,b);const x=Object.keys(this._combined);for(let j=0;j<x.length;j++){const N=parseInt(x[j],10);N>=y&&delete this._combined[N]}const k=Object.keys(this._extendedAttrs);for(let j=0;j<k.length;j++){const N=parseInt(k[j],10);N>=y&&delete this._extendedAttrs[N]}}return this.length=y,4*b*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const y=new Uint32Array(this._data.length);return y.set(this._data),this._data=y,1}return 0}fill(y,S=!1){if(S)for(let b=0;b<this.length;++b)this.isProtected(b)||this.setCell(b,y);else{this._combined={},this._extendedAttrs={};for(let b=0;b<this.length;++b)this.setCell(b,y)}}copyFrom(y){this.length!==y.length?this._data=new Uint32Array(y._data):this._data.set(y._data),this.length=y.length,this._combined={};for(const S in y._combined)this._combined[S]=y._combined[S];this._extendedAttrs={};for(const S in y._extendedAttrs)this._extendedAttrs[S]=y._extendedAttrs[S];this.isWrapped=y.isWrapped}clone(){const y=new C(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const S in this._combined)y._combined[S]=this._combined[S];for(const S in this._extendedAttrs)y._extendedAttrs[S]=this._extendedAttrs[S];return y.isWrapped=this.isWrapped,y}getTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,S,b,x,k){const j=y._data;if(k)for(let D=x-1;D>=0;D--){for(let E=0;E<3;E++)this._data[3*(b+D)+E]=j[3*(S+D)+E];268435456&j[3*(S+D)+2]&&(this._extendedAttrs[b+D]=y._extendedAttrs[S+D])}else for(let D=0;D<x;D++){for(let E=0;E<3;E++)this._data[3*(b+D)+E]=j[3*(S+D)+E];268435456&j[3*(S+D)+2]&&(this._extendedAttrs[b+D]=y._extendedAttrs[S+D])}const N=Object.keys(y._combined);for(let D=0;D<N.length;D++){const E=parseInt(N[D],10);E>=S&&(this._combined[E-S+b]=y._combined[E])}}translateToString(y,S,b,x){S=S!=null?S:0,b=b!=null?b:this.length,y&&(b=Math.min(b,this.getTrimmedLength())),x&&(x.length=0);let k="";for(;S<b;){const j=this._data[3*S+0],N=2097151&j,D=2097152&j?this._combined[S]:N?(0,g.stringFromCodePoint)(N):p.WHITESPACE_CELL_CHAR;if(k+=D,x)for(let E=0;E<D.length;++E)x.push(S);S+=j>>22||1}return x&&x.push(S),k}}a.BufferLine=C},4841:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(c,a)=>{function u(d,m,p){if(m===d.length-1)return d[m].getTrimmedLength();const g=!d[m].hasContent(p-1)&&d[m].getWidth(p-1)===1,_=d[m+1].getWidth(0)===2;return g&&_?p-1:p}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(d,m,p,g,_){const C=[];for(let w=0;w<d.length-1;w++){let y=w,S=d.get(++y);if(!S.isWrapped)continue;const b=[d.get(w)];for(;y<d.length&&S.isWrapped;)b.push(S),S=d.get(++y);if(g>=w&&g<y){w+=b.length-1;continue}let x=0,k=u(b,x,m),j=1,N=0;for(;j<b.length;){const E=u(b,j,m),O=E-N,L=p-k,z=Math.min(O,L);b[x].copyCellsFrom(b[j],N,k,z,!1),k+=z,k===p&&(x++,k=0),N+=z,N===E&&(j++,N=0),k===0&&x!==0&&b[x-1].getWidth(p-1)===2&&(b[x].copyCellsFrom(b[x-1],p-1,k++,1,!1),b[x-1].setCell(p-1,_))}b[x].replaceCells(k,p,_);let D=0;for(let E=b.length-1;E>0&&(E>x||b[E].getTrimmedLength()===0);E--)D++;D>0&&(C.push(w+b.length-D),C.push(D)),w+=b.length-1}return C},a.reflowLargerCreateNewLayout=function(d,m){const p=[];let g=0,_=m[g],C=0;for(let w=0;w<d.length;w++)if(_===w){const y=m[++g];d.onDeleteEmitter.fire({index:w-C,amount:y}),w+=y-1,C+=y,_=m[++g]}else p.push(w);return{layout:p,countRemoved:C}},a.reflowLargerApplyNewLayout=function(d,m){const p=[];for(let g=0;g<m.length;g++)p.push(d.get(m[g]));for(let g=0;g<p.length;g++)d.set(g,p[g]);d.length=m.length},a.reflowSmallerGetNewLineLengths=function(d,m,p){const g=[],_=d.map(((S,b)=>u(d,b,m))).reduce(((S,b)=>S+b));let C=0,w=0,y=0;for(;y<_;){if(_-y<p){g.push(_-y);break}C+=p;const S=u(d,w,m);C>S&&(C-=S,w++);const b=d[w].getWidth(C-1)===2;b&&C--;const x=b?p-1:p;g.push(x),y+=x}return g},a.getWrappedLineTrimmedLength=u},5295:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const d=u(8460),m=u(844),p=u(9092);class g extends m.Disposable{constructor(C,w){super(),this._optionsService=C,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 p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.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(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,w){this._normal.resize(C,w),this._alt.resize(C,w),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}a.BufferSet=g},511:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=u(482),m=u(643),p=u(3734);class g extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const w=new g;return w.setFromCharData(C),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(C){this.fg=C[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(C[m.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(C[m.CHAR_DATA_CHAR_INDEX].length===2){const y=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const S=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(y-55296)+S-56320+65536|C[m.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[m.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=C[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=g},643:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const d=u(8460),m=u(844);class p{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=p._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,m.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}a.Marker=p,p._nextId=1},7116:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(c,a)=>{var u,d,m;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
619
+ `,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""})(u||(a.C0=u={})),(function(p){p.PAD="€",p.HOP="",p.BPH="‚",p.NBH="ƒ",p.IND="„",p.NEL="…",p.SSA="†",p.ESA="‡",p.HTS="ˆ",p.HTJ="‰",p.VTS="Š",p.PLD="‹",p.PLU="Œ",p.RI="",p.SS2="Ž",p.SS3="",p.DCS="",p.PU1="‘",p.PU2="’",p.STS="“",p.CCH="”",p.MW="•",p.SPA="–",p.EPA="—",p.SOS="˜",p.SGCI="™",p.SCI="š",p.CSI="›",p.ST="œ",p.OSC="",p.PM="ž",p.APC="Ÿ"})(d||(a.C1=d={})),(function(p){p.ST=`${u.ESC}\\`})(m||(a.C1_ESCAPED=m={}))},7399:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const d=u(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(p,g,_,C){const w={type:0,cancel:!1,key:void 0},y=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?w.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?w.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?w.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(w.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:w.key=p.ctrlKey?"\b":d.C0.DEL,p.altKey&&(w.key=d.C0.ESC+w.key);break;case 9:if(p.shiftKey){w.key=d.C0.ESC+"[Z";break}w.key=d.C0.HT,w.cancel=!0;break;case 13:w.key=p.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,w.cancel=!0;break;case 27:w.key=d.C0.ESC,p.altKey&&(w.key=d.C0.ESC+d.C0.ESC),w.cancel=!0;break;case 37:if(p.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"D",w.key===d.C0.ESC+"[1;3D"&&(w.key=d.C0.ESC+(_?"b":"[1;5D"))):w.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(p.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"C",w.key===d.C0.ESC+"[1;3C"&&(w.key=d.C0.ESC+(_?"f":"[1;5C"))):w.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(p.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"A",_||w.key!==d.C0.ESC+"[1;3A"||(w.key=d.C0.ESC+"[1;5A")):w.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(p.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"B",_||w.key!==d.C0.ESC+"[1;3B"||(w.key=d.C0.ESC+"[1;5B")):w.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(w.key=d.C0.ESC+"[2~");break;case 46:w.key=y?d.C0.ESC+"[3;"+(y+1)+"~":d.C0.ESC+"[3~";break;case 36:w.key=y?d.C0.ESC+"[1;"+(y+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:w.key=y?d.C0.ESC+"[1;"+(y+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:p.shiftKey?w.type=2:p.ctrlKey?w.key=d.C0.ESC+"[5;"+(y+1)+"~":w.key=d.C0.ESC+"[5~";break;case 34:p.shiftKey?w.type=3:p.ctrlKey?w.key=d.C0.ESC+"[6;"+(y+1)+"~":w.key=d.C0.ESC+"[6~";break;case 112:w.key=y?d.C0.ESC+"[1;"+(y+1)+"P":d.C0.ESC+"OP";break;case 113:w.key=y?d.C0.ESC+"[1;"+(y+1)+"Q":d.C0.ESC+"OQ";break;case 114:w.key=y?d.C0.ESC+"[1;"+(y+1)+"R":d.C0.ESC+"OR";break;case 115:w.key=y?d.C0.ESC+"[1;"+(y+1)+"S":d.C0.ESC+"OS";break;case 116:w.key=y?d.C0.ESC+"[15;"+(y+1)+"~":d.C0.ESC+"[15~";break;case 117:w.key=y?d.C0.ESC+"[17;"+(y+1)+"~":d.C0.ESC+"[17~";break;case 118:w.key=y?d.C0.ESC+"[18;"+(y+1)+"~":d.C0.ESC+"[18~";break;case 119:w.key=y?d.C0.ESC+"[19;"+(y+1)+"~":d.C0.ESC+"[19~";break;case 120:w.key=y?d.C0.ESC+"[20;"+(y+1)+"~":d.C0.ESC+"[20~";break;case 121:w.key=y?d.C0.ESC+"[21;"+(y+1)+"~":d.C0.ESC+"[21~";break;case 122:w.key=y?d.C0.ESC+"[23;"+(y+1)+"~":d.C0.ESC+"[23~";break;case 123:w.key=y?d.C0.ESC+"[24;"+(y+1)+"~":d.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(_&&!C||!p.altKey||p.metaKey)!_||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?w.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(w.key=d.C0.US),p.key==="@"&&(w.key=d.C0.NUL)):p.keyCode===65&&(w.type=1);else{const S=m[p.keyCode],b=S==null?void 0:S[p.shiftKey?1:0];if(b)w.key=d.C0.ESC+b;else if(p.keyCode>=65&&p.keyCode<=90){const x=p.ctrlKey?p.keyCode-64:p.keyCode+32;let k=String.fromCharCode(x);p.shiftKey&&(k=k.toUpperCase()),w.key=d.C0.ESC+k}else if(p.keyCode===32)w.key=d.C0.ESC+(p.ctrlKey?d.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let x=p.code.slice(3,4);p.shiftKey||(x=x.toLowerCase()),w.key=d.C0.ESC+x,w.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?w.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?w.key=d.C0.NUL:p.keyCode>=51&&p.keyCode<=55?w.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?w.key=d.C0.DEL:p.keyCode===219?w.key=d.C0.ESC:p.keyCode===220?w.key=d.C0.FS:p.keyCode===221&&(w.key=d.C0.GS)}return w}},482:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},a.utf32ToString=function(u,d=0,m=u.length){let p="";for(let g=d;g<m;++g){let _=u[g];_>65535?(_-=65536,p+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):p+=String.fromCharCode(_)}return p},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const m=u.length;if(!m)return 0;let p=0,g=0;if(this._interim){const _=u.charCodeAt(g++);56320<=_&&_<=57343?d[p++]=1024*(this._interim-55296)+_-56320+65536:(d[p++]=this._interim,d[p++]=_),this._interim=0}for(let _=g;_<m;++_){const C=u.charCodeAt(_);if(55296<=C&&C<=56319){if(++_>=m)return this._interim=C,p;const w=u.charCodeAt(_);56320<=w&&w<=57343?d[p++]=1024*(C-55296)+w-56320+65536:(d[p++]=C,d[p++]=w)}else C!==65279&&(d[p++]=C)}return p}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const m=u.length;if(!m)return 0;let p,g,_,C,w=0,y=0,S=0;if(this.interim[0]){let k=!1,j=this.interim[0];j&=(224&j)==192?31:(240&j)==224?15:7;let N,D=0;for(;(N=63&this.interim[++D])&&D<4;)j<<=6,j|=N;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,O=E-D;for(;S<O;){if(S>=m)return 0;if(N=u[S++],(192&N)!=128){S--,k=!0;break}this.interim[D++]=N,j<<=6,j|=63&N}k||(E===2?j<128?S--:d[w++]=j:E===3?j<2048||j>=55296&&j<=57343||j===65279||(d[w++]=j):j<65536||j>1114111||(d[w++]=j)),this.interim.fill(0)}const b=m-4;let x=S;for(;x<m;){for(;!(!(x<b)||128&(p=u[x])||128&(g=u[x+1])||128&(_=u[x+2])||128&(C=u[x+3]));)d[w++]=p,d[w++]=g,d[w++]=_,d[w++]=C,x+=4;if(p=u[x++],p<128)d[w++]=p;else if((224&p)==192){if(x>=m)return this.interim[0]=p,w;if(g=u[x++],(192&g)!=128){x--;continue}if(y=(31&p)<<6|63&g,y<128){x--;continue}d[w++]=y}else if((240&p)==224){if(x>=m)return this.interim[0]=p,w;if(g=u[x++],(192&g)!=128){x--;continue}if(x>=m)return this.interim[0]=p,this.interim[1]=g,w;if(_=u[x++],(192&_)!=128){x--;continue}if(y=(15&p)<<12|(63&g)<<6|63&_,y<2048||y>=55296&&y<=57343||y===65279)continue;d[w++]=y}else if((248&p)==240){if(x>=m)return this.interim[0]=p,w;if(g=u[x++],(192&g)!=128){x--;continue}if(x>=m)return this.interim[0]=p,this.interim[1]=g,w;if(_=u[x++],(192&_)!=128){x--;continue}if(x>=m)return this.interim[0]=p,this.interim[1]=g,this.interim[2]=_,w;if(C=u[x++],(192&C)!=128){x--;continue}if(y=(7&p)<<18|(63&g)<<12|(63&_)<<6|63&C,y<65536||y>1114111)continue;d[w++]=y}}return w}}},225:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=u(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],p=[[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 g;a.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let _=0;_<m.length;++_)g.fill(0,m[_][0],m[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?g[_]:(function(C,w){let y,S=0,b=w.length-1;if(C<w[0][0]||C>w[b][1])return!1;for(;b>=S;)if(y=S+b>>1,C>w[y][1])S=y+1;else{if(!(C<w[y][0]))return!0;b=y-1}return!1})(_,p)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,C){let w=this.wcwidth(_),y=w===0&&C!==0;if(y){const S=d.UnicodeService.extractWidth(C);S===0?y=!1:S>w&&(w=S)}return d.UnicodeService.createPropertyValue(0,w,y)}}},5981:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const d=u(8460),m=u(844);class p extends m.Disposable{constructor(_){super(),this._action=_,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(_,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,C){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+=_.length,this._writeBuffer.push(_),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C)}_innerWrite(_=0,C=!0){const w=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],S=this._action(y,C);if(S){const x=k=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(w,k);return void S.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(x)}const b=this._callbacks[this._bufferOffset];if(b&&b(),this._bufferOffset++,this._pendingData-=y.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()}}a.WriteBuffer=p},5941:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const u=/^([\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 m(p,g){const _=p.toString(16),C=_.length<2?"0"+_:_;switch(g){case 4:return _[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}a.parseColor=function(p){if(!p)return;let g=p.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const _=u.exec(g);if(_){const C=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/C*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/C*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/C*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const _=g.length/3,C=[0,0,0];for(let w=0;w<3;++w){const y=parseInt(g.slice(_*w,_*w+_),16);C[w]=_===1?y<<4:_===2?y:_===3?y>>4:y>>8}return C}},a.toRgbString=function(p,g=16){const[_,C,w]=p;return`rgb:${m(_,g)}/${m(C,g)}/${m(w,g)}`}},5770:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const d=u(482),m=u(8742),p=u(5770),g=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const y=this._handlers[C];return y.push(w),{dispose:()=>{const S=y.indexOf(w);S!==-1&&y.splice(S,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(C,w){if(this.reset(),this._ident=C,this._active=this._handlers[C]||g,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,y){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(C,w,y);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,w,y))}unhook(C,w=!0){if(this._active.length){let y=!1,S=this._active.length-1,b=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,y=w,b=this._stack.fallThrough,this._stack.paused=!1),!b&&y===!1){for(;S>=0&&(y=this._active[S].unhook(C),y!==!0);S--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,y;S--}for(;S>=0;S--)if(y=this._active[S].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",C);this._active=g,this._ident=0}};const _=new m.Params;_.addParam(0),a.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=_,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():_,this._data="",this._hitLimit=!1}put(C,w,y){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,w,y),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((y=>(this._params=_,this._data="",this._hitLimit=!1,y)));return this._params=_,this._data="",this._hitLimit=!1,w}}},2015:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const d=u(844),m=u(8742),p=u(6242),g=u(6351);class _{constructor(S){this.table=new Uint8Array(S)}setDefault(S,b){this.table.fill(S<<4|b)}add(S,b,x,k){this.table[b<<8|S]=x<<4|k}addMany(S,b,x,k){for(let j=0;j<S.length;j++)this.table[b<<8|S[j]]=x<<4|k}}a.TransitionTable=_;const C=160;a.VT500_TRANSITION_TABLE=(function(){const y=new _(4095),S=Array.apply(null,Array(256)).map(((D,E)=>E)),b=(D,E)=>S.slice(D,E),x=b(32,127),k=b(0,24);k.push(25),k.push.apply(k,b(28,32));const j=b(0,14);let N;for(N in y.setDefault(1,0),y.addMany(x,0,2,0),j)y.addMany([24,26,153,154],N,3,0),y.addMany(b(128,144),N,3,0),y.addMany(b(144,152),N,3,0),y.add(156,N,0,0),y.add(27,N,11,1),y.add(157,N,4,8),y.addMany([152,158,159],N,0,7),y.add(155,N,11,3),y.add(144,N,11,9);return y.addMany(k,0,3,0),y.addMany(k,1,3,1),y.add(127,1,0,1),y.addMany(k,8,0,8),y.addMany(k,3,3,3),y.add(127,3,0,3),y.addMany(k,4,3,4),y.add(127,4,0,4),y.addMany(k,6,3,6),y.addMany(k,5,3,5),y.add(127,5,0,5),y.addMany(k,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(x,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(b(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(x,7,0,7),y.addMany(k,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(b(64,127),3,7,0),y.addMany(b(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(b(48,60),4,8,4),y.addMany(b(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(b(32,64),6,0,6),y.add(127,6,0,6),y.addMany(b(64,127),6,0,0),y.addMany(b(32,48),3,9,5),y.addMany(b(32,48),5,9,5),y.addMany(b(48,64),5,0,6),y.addMany(b(64,127),5,7,0),y.addMany(b(32,48),4,9,5),y.addMany(b(32,48),1,9,2),y.addMany(b(32,48),2,9,2),y.addMany(b(48,127),2,10,0),y.addMany(b(48,80),1,10,0),y.addMany(b(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(b(96,127),1,10,0),y.add(80,1,11,9),y.addMany(k,9,0,9),y.add(127,9,0,9),y.addMany(b(28,32),9,0,9),y.addMany(b(32,48),9,9,12),y.addMany(b(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(k,11,0,11),y.addMany(b(32,128),11,0,11),y.addMany(b(28,32),11,0,11),y.addMany(k,10,0,10),y.add(127,10,0,10),y.addMany(b(28,32),10,0,10),y.addMany(b(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(b(32,48),10,9,12),y.addMany(k,12,0,12),y.add(127,12,0,12),y.addMany(b(28,32),12,0,12),y.addMany(b(32,48),12,9,12),y.addMany(b(48,64),12,0,11),y.addMany(b(64,127),12,12,13),y.addMany(b(64,127),10,12,13),y.addMany(b(64,127),9,12,13),y.addMany(k,13,13,13),y.addMany(x,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(C,0,2,0),y.add(C,8,5,8),y.add(C,6,0,6),y.add(C,11,0,11),y.add(C,13,13,13),y})();class w extends d.Disposable{constructor(S=a.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(b,x,k)=>{},this._executeHandlerFb=b=>{},this._csiHandlerFb=(b,x)=>{},this._escHandlerFb=b=>{},this._errorHandlerFb=b=>b,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 p.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,b=[64,126]){let x=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=S.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let j=0;j<S.intermediates.length;++j){const N=S.intermediates.charCodeAt(j);if(32>N||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=N}}if(S.final.length!==1)throw new Error("final must be a single byte");const k=S.final.charCodeAt(0);if(b[0]>k||k>b[1])throw new Error(`final must be in range ${b[0]} .. ${b[1]}`);return x<<=8,x|=k,x}identToString(S){const b=[];for(;S;)b.push(String.fromCharCode(255&S)),S>>=8;return b.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,b){const x=this._identifier(S,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const k=this._escHandlers[x];return k.push(b),{dispose:()=>{const j=k.indexOf(b);j!==-1&&k.splice(j,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,b){this._executeHandlers[S.charCodeAt(0)]=b}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,b){const x=this._identifier(S);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const k=this._csiHandlers[x];return k.push(b),{dispose:()=>{const j=k.indexOf(b);j!==-1&&k.splice(j,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,b){return this._dcsParser.registerHandler(this._identifier(S),b)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,b){return this._oscParser.registerHandler(S,b)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}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(S,b,x,k,j){this._parseStack.state=S,this._parseStack.handlers=b,this._parseStack.handlerPos=x,this._parseStack.transition=k,this._parseStack.chunkPos=j}parse(S,b,x){let k,j=0,N=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=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 E=this._parseStack.handlers;let O=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(x===!1&&O>-1){for(;O>=0&&(k=E[O](this._params),k!==!0);O--)if(k instanceof Promise)return this._parseStack.handlerPos=O,k}this._parseStack.handlers=[];break;case 4:if(x===!1&&O>-1){for(;O>=0&&(k=E[O](),k!==!0);O--)if(k instanceof Promise)return this._parseStack.handlerPos=O,k}this._parseStack.handlers=[];break;case 6:if(j=S[this._parseStack.chunkPos],k=this._dcsParser.unhook(j!==24&&j!==26,x),k)return k;j===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(j=S[this._parseStack.chunkPos],k=this._oscParser.end(j!==24&&j!==26,x),k)return k;j===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=D;E<b;++E){switch(j=S[E],N=this._transitions.table[this.currentState<<8|(j<160?j:C)],N>>4){case 2:for(let $=E+1;;++$){if($>=b||(j=S[$])<32||j>126&&j<C){this._printHandler(S,E,$),E=$-1;break}if(++$>=b||(j=S[$])<32||j>126&&j<C){this._printHandler(S,E,$),E=$-1;break}if(++$>=b||(j=S[$])<32||j>126&&j<C){this._printHandler(S,E,$),E=$-1;break}if(++$>=b||(j=S[$])<32||j>126&&j<C){this._printHandler(S,E,$),E=$-1;break}}break;case 3:this._executeHandlers[j]?this._executeHandlers[j]():this._executeHandlerFb(j),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:j,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const O=this._csiHandlers[this._collect<<8|j];let L=O?O.length-1:-1;for(;L>=0&&(k=O[L](this._params),k!==!0);L--)if(k instanceof Promise)return this._preserveStack(3,O,L,N,E),k;L<0&&this._csiHandlerFb(this._collect<<8|j,this._params),this.precedingJoinState=0;break;case 8:do switch(j){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(j-48)}while(++E<b&&(j=S[E])>47&&j<60);E--;break;case 9:this._collect<<=8,this._collect|=j;break;case 10:const z=this._escHandlers[this._collect<<8|j];let H=z?z.length-1:-1;for(;H>=0&&(k=z[H](),k!==!0);H--)if(k instanceof Promise)return this._preserveStack(4,z,H,N,E),k;H<0&&this._escHandlerFb(this._collect<<8|j),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|j,this._params);break;case 13:for(let $=E+1;;++$)if($>=b||(j=S[$])===24||j===26||j===27||j>127&&j<C){this._dcsParser.put(S,E,$),E=$-1;break}break;case 14:if(k=this._dcsParser.unhook(j!==24&&j!==26),k)return this._preserveStack(6,[],0,N,E),k;j===27&&(N|=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 $=E+1;;$++)if($>=b||(j=S[$])<32||j>127&&j<C){this._oscParser.put(S,E,$),E=$-1;break}break;case 6:if(k=this._oscParser.end(j!==24&&j!==26),k)return this._preserveStack(5,[],0,N,E),k;j===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&N}}}a.EscapeSequenceParser=w},6242:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const d=u(5770),m=u(482),p=[];a.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,_){this._handlers[g]===void 0&&(this._handlers[g]=[]);const C=this._handlers[g];return C.push(_),{dispose:()=>{const w=C.indexOf(_);w!==-1&&C.splice(w,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,_,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(g,_,C);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,_,C))}start(){this.reset(),this._state=1}put(g,_,C){if(this._state!==3){if(this._state===1)for(;_<C;){const w=g[_++];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&&C-_>0&&this._put(g,_,C)}}end(g,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,y=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=_,y=this._stack.fallThrough,this._stack.paused=!1),!y&&C===!1){for(;w>=0&&(C=this._active[w].end(g),C!==!0);w--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,C;w--}for(;w>=0;w--)if(C=this._active[w].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",g);this._active=p,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,_,C){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,_,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let _=!1;if(this._hitLimit)_=!1;else if(g&&(_=this._handler(this._data),_ instanceof Promise))return _.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,_}}},8742:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const u=2147483647;class d{static fromArray(p){const g=new d;if(!p.length)return g;for(let _=Array.isArray(p[0])?1:0;_<p.length;++_){const C=p[_];if(Array.isArray(C))for(let w=0;w<C.length;++w)g.addSubParam(C[w]);else g.addParam(C)}return g}constructor(p=32,g=32){if(this.maxLength=p,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new d(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let g=0;g<this.length;++g){p.push(this.params[g]);const _=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-_>0&&p.push(Array.prototype.slice.call(this._subParams,_,C))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>u?u:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>u?u:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const g=this._subParamsIdx[p]>>8,_=255&this._subParamsIdx[p];return _-g>0?this._subParams.subarray(g,_):null}getSubParamsAll(){const p={};for(let g=0;g<this.length;++g){const _=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-_>0&&(p[g]=this._subParams.slice(_,C))}return p}addDigit(p){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,C=_[g-1];_[g-1]=~C?Math.min(10*C+p,u):p}}a.Params=d},5741:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const m={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(m),d.dispose=()=>this._wrappedAddonDispose(m),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===u){d=m;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const d=u(3785),m=u(511);a.BufferApiView=class{constructor(p,g){this._buffer=p,this.type=g}init(p){return this._buffer=p,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(p){const g=this._buffer.lines.get(p);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const d=u(511);a.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,p){if(!(m<0||m>=this._line.length))return p?(this._line.loadCell(m,p),p):this._line.loadCell(m,new d.CellData)}translateToString(m,p,g){return this._line.translateToString(m,p,g)}}},8285:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const d=u(8771),m=u(8460),p=u(844);class g extends p.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new m.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)}}a.BufferNamespaceApi=g},7975:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(m=>d(m.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((m,p)=>d(m,p.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(c,a,u){var d=this&&this.__decorate||function(y,S,b,x){var k,j=arguments.length,N=j<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,S,b,x);else for(var D=y.length-1;D>=0;D--)(k=y[D])&&(N=(j<3?k(N):j>3?k(S,b,N):k(S,b))||N);return j>3&&N&&Object.defineProperty(S,b,N),N},m=this&&this.__param||function(y,S){return function(b,x){S(b,x,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const p=u(8460),g=u(844),_=u(5295),C=u(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let w=a.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(y,this))}resize(y,S){this.cols=y,this.rows=S,this.buffers.resize(y,S),this._onResize.fire({cols:y,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,S=!1){const b=this.buffer;let x;x=this._cachedBlankLine,x&&x.length===this.cols&&x.getFg(0)===y.fg&&x.getBg(0)===y.bg||(x=b.getBlankLine(y,S),this._cachedBlankLine=x),x.isWrapped=S;const k=b.ybase+b.scrollTop,j=b.ybase+b.scrollBottom;if(b.scrollTop===0){const N=b.lines.isFull;j===b.lines.length-1?N?b.lines.recycle().copyFrom(x):b.lines.push(x.clone()):b.lines.splice(j+1,0,x.clone()),N?this.isUserScrolling&&(b.ydisp=Math.max(b.ydisp-1,0)):(b.ybase++,this.isUserScrolling||b.ydisp++)}else{const N=j-k+1;b.lines.shiftElements(k+1,N-1,-1),b.lines.set(j,x.clone())}this.isUserScrolling||(b.ydisp=b.ybase),this._onScroll.fire(b.ydisp)}scrollLines(y,S,b){const x=this.buffer;if(y<0){if(x.ydisp===0)return;this.isUserScrolling=!0}else y+x.ydisp>=x.ybase&&(this.isUserScrolling=!1);const k=x.ydisp;x.ydisp=Math.max(Math.min(x.ydisp+y,x.ybase),0),k!==x.ydisp&&(S||this._onScroll.fire(x.ydisp))}};a.BufferService=w=d([m(0,C.IOptionsService)],w)},7994:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(c,a,u){var d=this&&this.__decorate||function(x,k,j,N){var D,E=arguments.length,O=E<3?k:N===null?N=Object.getOwnPropertyDescriptor(k,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,k,j,N);else for(var L=x.length-1;L>=0;L--)(D=x[L])&&(O=(E<3?D(O):E>3?D(k,j,O):D(k,j))||O);return E>3&&O&&Object.defineProperty(k,j,O),O},m=this&&this.__param||function(x,k){return function(j,N){k(j,N,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const p=u(2585),g=u(8460),_=u(844),C={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,k){let j=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(j|=64,j|=x.action):(j|=3&x.button,4&x.button&&(j|=64),8&x.button&&(j|=128),x.action===32?j|=32:x.action!==0||k||(j|=3)),j}const y=String.fromCharCode,S={DEFAULT:x=>{const k=[w(x,!1)+32,x.col+32,x.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${y(k[0])}${y(k[1])}${y(k[2])}`},SGR:x=>{const k=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${w(x,!0)};${x.col};${x.row}${k}`},SGR_PIXELS:x=>{const k=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${w(x,!0)};${x.x};${x.y}${k}`}};let b=a.CoreMouseService=class extends _.Disposable{constructor(x,k){super(),this._bufferService=x,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const j of Object.keys(C))this.addProtocol(j,C[j]);for(const j of Object.keys(S))this.addEncoding(j,S[j]);this.reset()}addProtocol(x,k){this._protocols[x]=k}addEncoding(x,k){this._encodings[x]=k}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 k=this._encodings[this._activeEncoding](x);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!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,k,j){if(j){if(x.x!==k.x||x.y!==k.y)return!1}else if(x.col!==k.col||x.row!==k.row)return!1;return x.button===k.button&&x.action===k.action&&x.ctrl===k.ctrl&&x.alt===k.alt&&x.shift===k.shift}};a.CoreMouseService=b=d([m(0,p.IBufferService),m(1,p.ICoreService)],b)},6975:function(c,a,u){var d=this&&this.__decorate||function(b,x,k,j){var N,D=arguments.length,E=D<3?x:j===null?j=Object.getOwnPropertyDescriptor(x,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,x,k,j);else for(var O=b.length-1;O>=0;O--)(N=b[O])&&(E=(D<3?N(E):D>3?N(x,k,E):N(x,k))||E);return D>3&&E&&Object.defineProperty(x,k,E),E},m=this&&this.__param||function(b,x){return function(k,j){x(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const p=u(1439),g=u(8460),_=u(844),C=u(2585),w=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=a.CoreService=class extends _.Disposable{constructor(b,x,k){super(),this._bufferService=b,this._logService=x,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(w),this.decPrivateModes=(0,p.clone)(y)}reset(){this.modes=(0,p.clone)(w),this.decPrivateModes=(0,p.clone)(y)}triggerDataEvent(b,x=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;x&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),x&&this._onUserInput.fire(),this._logService.debug(`sending data "${b}"`,(()=>b.split("").map((j=>j.charCodeAt(0))))),this._onData.fire(b)}triggerBinaryEvent(b){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${b}"`,(()=>b.split("").map((x=>x.charCodeAt(0))))),this._onBinary.fire(b))}};a.CoreService=S=d([m(0,C.IBufferService),m(1,C.ILogService),m(2,C.IOptionsService)],S)},9074:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const d=u(8055),m=u(8460),p=u(844),g=u(6106);let _=0,C=0;class w extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((b=>b==null?void 0:b.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)((()=>this.reset())))}registerDecoration(b){if(b.marker.isDisposed)return;const x=new y(b);if(x){const k=x.marker.onDispose((()=>x.dispose()));x.onDispose((()=>{x&&(this._decorations.delete(x)&&this._onDecorationRemoved.fire(x),k.dispose())})),this._decorations.insert(x),this._onDecorationRegistered.fire(x)}return x}reset(){for(const b of this._decorations.values())b.dispose();this._decorations.clear()}*getDecorationsAtCell(b,x,k){var D,E,O;let j=0,N=0;for(const L of this._decorations.getKeyIterator(x))j=(D=L.options.x)!=null?D:0,N=j+((E=L.options.width)!=null?E:1),b>=j&&b<N&&(!k||((O=L.options.layer)!=null?O:"bottom")===k)&&(yield L)}forEachDecorationAtCell(b,x,k,j){this._decorations.forEachByKey(x,(N=>{var D,E,O;_=(D=N.options.x)!=null?D:0,C=_+((E=N.options.width)!=null?E:1),b>=_&&b<C&&(!k||((O=N.options.layer)!=null?O:"bottom")===k)&&j(N)}))}}a.DecorationService=w;class y extends p.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(b){super(),this.options=b,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=b.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const d=u(2585),m=u(8343);class p{constructor(..._){this._entries=new Map;for(const[C,w]of _)this.set(C,w)}set(_,C){const w=this._entries.get(_);return this._entries.set(_,C),w}forEach(_){for(const[C,w]of this._entries.entries())_(C,w)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}a.ServiceCollection=p,a.InstantiationService=class{constructor(){this._services=new p,this._services.set(d.IInstantiationService,this)}setService(g,_){this._services.set(g,_)}getService(g){return this._services.get(g)}createInstance(g,..._){const C=(0,m.getServiceDependencies)(g).sort(((S,b)=>S.index-b.index)),w=[];for(const S of C){const b=this._services.get(S.id);if(!b)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${S.id}.`);w.push(b)}const y=C.length>0?C[0].index:_.length;if(_.length!==y)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${y+1} conflicts with ${_.length} static arguments`);return new g(..._,...w)}}},7866:function(c,a,u){var d=this&&this.__decorate||function(y,S,b,x){var k,j=arguments.length,N=j<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,S,b,x);else for(var D=y.length-1;D>=0;D--)(k=y[D])&&(N=(j<3?k(N):j>3?k(S,b,N):k(S,b))||N);return j>3&&N&&Object.defineProperty(S,b,N),N},m=this&&this.__param||function(y,S){return function(b,x){S(b,x,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const p=u(844),g=u(2585),_={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let C,w=a.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let S=0;S<y.length;S++)typeof y[S]=="function"&&(y[S]=y[S]())}_log(y,S,b){this._evalLazyOptionalParams(b),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...b)}trace(y,...S){var b,x;this._logLevel<=g.LogLevelEnum.TRACE&&this._log((x=(b=this._optionsService.options.logger)==null?void 0:b.trace.bind(this._optionsService.options.logger))!=null?x:console.log,y,S)}debug(y,...S){var b,x;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log((x=(b=this._optionsService.options.logger)==null?void 0:b.debug.bind(this._optionsService.options.logger))!=null?x:console.log,y,S)}info(y,...S){var b,x;this._logLevel<=g.LogLevelEnum.INFO&&this._log((x=(b=this._optionsService.options.logger)==null?void 0:b.info.bind(this._optionsService.options.logger))!=null?x:console.info,y,S)}warn(y,...S){var b,x;this._logLevel<=g.LogLevelEnum.WARN&&this._log((x=(b=this._optionsService.options.logger)==null?void 0:b.warn.bind(this._optionsService.options.logger))!=null?x:console.warn,y,S)}error(y,...S){var b,x;this._logLevel<=g.LogLevelEnum.ERROR&&this._log((x=(b=this._optionsService.options.logger)==null?void 0:b.error.bind(this._optionsService.options.logger))!=null?x:console.error,y,S)}};a.LogService=w=d([m(0,g.IOptionsService)],w),a.setTraceLogger=function(y){C=y},a.traceCall=function(y,S,b){if(typeof b.value!="function")throw new Error("not supported");const x=b.value;b.value=function(...k){if(C.logLevel!==g.LogLevelEnum.TRACE)return x.apply(this,k);C.trace(`GlyphRenderer#${x.name}(${k.map((N=>JSON.stringify(N))).join(", ")})`);const j=x.apply(this,k);return C.trace(`GlyphRenderer#${x.name} return`,j),j}}},7302:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const d=u(8460),m=u(844),p=u(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends m.Disposable{constructor(w){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...a.DEFAULT_OPTIONS};for(const S in w)if(S in y)try{const b=w[S];y[S]=this._sanitizeAndValidateOption(S,b)}catch(b){console.error(b)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,y){return this.onOptionChange((S=>{S===w&&y(this.rawOptions[w])}))}onMultipleOptionChange(w,y){return this.onOptionChange((S=>{w.indexOf(S)!==-1&&y()}))}_setupOptions(){const w=S=>{if(!(S in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},y=(S,b)=>{if(!(S in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);b=this._sanitizeAndValidateOption(S,b),this.rawOptions[S]!==b&&(this.rawOptions[S]=b,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const b={get:w.bind(this,S),set:y.bind(this,S)};Object.defineProperty(this.options,S,b)}}_sanitizeAndValidateOption(w,y){switch(w){case"cursorStyle":if(y||(y=a.DEFAULT_OPTIONS[w]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${w}`);break;case"wordSeparator":y||(y=a.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=g.includes(y)?y:a.DEFAULT_OPTIONS[w];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${w} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${w} must be numeric, value: ${y}`);break;case"windowsPty":y=y!=null?y:{}}return y}}a.OptionsService=_},2660:function(c,a,u){var d=this&&this.__decorate||function(_,C,w,y){var S,b=arguments.length,x=b<3?C:y===null?y=Object.getOwnPropertyDescriptor(C,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(_,C,w,y);else for(var k=_.length-1;k>=0;k--)(S=_[k])&&(x=(b<3?S(x):b>3?S(C,w,x):S(C,w))||x);return b>3&&x&&Object.defineProperty(C,w,x),x},m=this&&this.__param||function(_,C){return function(w,y){C(w,y,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const p=u(2585);let g=a.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const C=this._bufferService.buffer;if(_.id===void 0){const k=C.addMarker(C.ybase+C.y),j={data:_,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(j,k))),this._dataByLinkId.set(j.id,j),j.id}const w=_,y=this._getEntryIdKey(w),S=this._entriesWithId.get(y);if(S)return this.addLineToLink(S.id,C.ybase+C.y),S.id;const b=C.addMarker(C.ybase+C.y),x={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[b]};return b.onDispose((()=>this._removeMarkerFromLink(x,b))),this._entriesWithId.set(x.key,x),this._dataByLinkId.set(x.id,x),x.id}addLineToLink(_,C){const w=this._dataByLinkId.get(_);if(w&&w.lines.every((y=>y.line!==C))){const y=this._bufferService.buffer.addMarker(C);w.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(w,y)))}}getLinkData(_){var C;return(C=this._dataByLinkId.get(_))==null?void 0:C.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,C){const w=_.lines.indexOf(C);w!==-1&&(_.lines.splice(w,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};a.OscLinkService=g=d([m(0,p.IBufferService)],g)},8343:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const u="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(m){return m[d]||[]},a.createDecorator=function(m){if(a.serviceRegistry.has(m))return a.serviceRegistry.get(m);const p=function(g,_,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,y,S){y[u]===y?y[d].push({id:w,index:S}):(y[d]=[{id:w,index:S}],y[u]=y)})(p,g,C)};return p.toString=()=>m,a.serviceRegistry.set(m,p),p}},2585:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const d=u(8343);var m;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"})(m||(a.LogLevelEnum=m={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=u(8460),m=u(225);class p{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,C,w=!1){return(16777215&_)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const _=new m.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let C=0,w=0;const y=_.length;for(let S=0;S<y;++S){let b=_.charCodeAt(S);if(55296<=b&&b<=56319){if(++S>=y)return C+this.wcwidth(b);const j=_.charCodeAt(S);56320<=j&&j<=57343?b=1024*(b-55296)+j-56320+65536:C+=this.wcwidth(j)}const x=this.charProperties(b,w);let k=p.extractWidth(x);p.extractShouldJoin(x)&&(k-=p.extractWidth(w)),C+=k,w=x}return C}charProperties(_,C){return this._activeProvider.charProperties(_,C)}}a.UnicodeService=p}},r={};function i(c){var a=r[c];if(a!==void 0)return a.exports;var u=r[c]={exports:{}};return n[c].call(u.exports,u,u.exports,i),u.exports}var l={};return(()=>{var c=l;Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const a=i(9042),u=i(3236),d=i(844),m=i(5741),p=i(8285),g=i(7975),_=i(7090),C=["cols","rows"];class w extends d.Disposable{constructor(S){super(),this._core=this.register(new u.Terminal(S)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const b=k=>this._core.options[k],x=(k,j)=>{this._checkReadonlyOptions(k),this._core.options[k]=j};for(const k in this._core.options){const j={get:b.bind(this,k),set:x.bind(this,k)};Object.defineProperty(this._publicOptions,k,j)}}_checkReadonlyOptions(S){if(C.includes(S))throw new Error(`Option "${S}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.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 p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let b="none";switch(this._core.coreMouseService.activeProtocol){case"X10":b="x10";break;case"VT200":b="vt200";break;case"DRAG":b="drag";break;case"ANY":b="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:b,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const b in S)this._publicOptions[b]=S[b]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,b=!0){this._core.input(S,b)}resize(S,b){this._verifyIntegers(S,b),this._core.resize(S,b)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){var b,x,k;return this._checkProposedApi(),this._verifyPositiveIntegers((b=S.x)!=null?b:0,(x=S.width)!=null?x:0,(k=S.height)!=null?k:0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,b,x){this._verifyIntegers(S,b,x),this._core.select(S,b,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,b){this._verifyIntegers(S,b),this._core.selectLines(S,b)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,b){this._core.write(S,b)}writeln(S,b){this._core.write(S),this._core.write(`\r
620
+ `,b)}paste(S){this._core.paste(S)}refresh(S,b){this._verifyIntegers(S,b),this._core.refresh(S,b)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return a}_verifyIntegers(...S){for(const b of S)if(b===1/0||isNaN(b)||b%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const b of S)if(b&&(b===1/0||isNaN(b)||b%1!=0||b<0))throw new Error("This API only accepts positive integers")}}c.Terminal=w})(),l})()))})(Xm)),Xm.exports}var C$=w$(),Qm={exports:{}},W_;function k$(){return W_||(W_=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const l=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(l._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,l=i._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),p=u-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=d-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(g/l.css.cell.width)),rows:Math.max(1,Math.floor(p/l.css.cell.height))}}}})(),n})()))})(Qm)),Qm.exports}var E$=k$(),Zm={exports:{}},G_;function A$(){return G_||(G_=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={6:(c,a)=>{function u(m){try{const p=new URL(m),g=p.password&&p.username?`${p.protocol}//${p.username}:${p.password}@${p.host}`:p.username?`${p.protocol}//${p.username}@${p.host}`:`${p.protocol}//${p.host}`;return m.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(m,p,g,_={}){this._terminal=m,this._regex=p,this._handler=g,this._options=_}provideLinks(m,p){const g=d.computeLink(m,this._regex,this._terminal,this._handler);p(this._addCallbacks(g))}_addCallbacks(m){return m.map((p=>(p.leave=this._options.leave,p.hover=(g,_)=>{if(this._options.hover){const{range:C}=p;this._options.hover(g,_,C)}},p)))}};class d{static computeLink(p,g,_,C){const w=new RegExp(g.source,(g.flags||"")+"g"),[y,S]=d._getWindowedLineStrings(p-1,_),b=y.join("");let x;const k=[];for(;x=w.exec(b);){const j=x[0];if(!u(j))continue;const[N,D]=d._mapStrIdx(_,S,0,x.index),[E,O]=d._mapStrIdx(_,N,D,j.length);if(N===-1||D===-1||E===-1||O===-1)continue;const L={start:{x:D+1,y:N+1},end:{x:O,y:E+1}};k.push({range:L,text:j,activate:C})}return k}static _getWindowedLineStrings(p,g){let _,C=p,w=p,y=0,S="";const b=[];if(_=g.buffer.active.getLine(p)){const x=_.translateToString(!0);if(_.isWrapped&&x[0]!==" "){for(y=0;(_=g.buffer.active.getLine(--C))&&y<2048&&(S=_.translateToString(!0),y+=S.length,b.push(S),_.isWrapped&&S.indexOf(" ")===-1););b.reverse()}for(b.push(x),y=0;(_=g.buffer.active.getLine(++w))&&_.isWrapped&&y<2048&&(S=_.translateToString(!0),y+=S.length,b.push(S),S.indexOf(" ")===-1););}return[b,C]}static _mapStrIdx(p,g,_,C){const w=p.buffer.active,y=w.getNullCell();let S=_;for(;C;){const b=w.getLine(g);if(!b)return[-1,-1];for(let x=S;x<b.length;++x){b.getCell(x,y);const k=y.getChars();if(y.getWidth()&&(C-=k.length||1,x===b.length-1&&k==="")){const j=w.getLine(g+1);j&&j.isWrapped&&(j.getCell(0,y),y.getWidth()===2&&(C+=1))}if(C<0)return[g,x]}g++,S=0}return[g,S]}}a.LinkComputer=d}},r={};function i(c){var a=r[c];if(a!==void 0)return a.exports;var u=r[c]={exports:{}};return n[c](u,u.exports,i),u.exports}var l={};return(()=>{var c=l;Object.defineProperty(c,"__esModule",{value:!0}),c.WebLinksAddon=void 0;const a=i(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(m,p){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}c.WebLinksAddon=class{constructor(m=d,p={}){this._handler=m,this._options=p}activate(m){this._terminal=m;const p=this._options,g=p.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,g,this._handler,p))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),l})()))})(Zm)),Zm.exports}var N$=A$();const Oi={INPUT:1,RESIZE:2,CLOSE:3,OUTPUT:4,EXIT:5,ERROR:6,INIT_ACK:7,TITLE:8};function Jm(t,e){const n=new Uint8Array(1+e.length);return n[0]=t,n.set(e,1),n}function R$(){const t=new Map;return{get(e){return t.get(e)},set(e,n){t.set(e,n)},delete(e){t.delete(e)},has(e){return t.has(e)},clear(){t.clear()},dispose(e){const n=t.get(e);n&&(n.terminal.dispose(),t.delete(e))},disposeAll(){for(const e of t.values())e.terminal.dispose();t.clear()}}}function j$(t){const e=new C$.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)"}}),n=new E$.FitAddon,r=new N$.WebLinksAddon;return e.loadAddon(n),e.loadAddon(r),{terminal:e,fitAddon:n}}function T$(t,e){const n=he.c(21),{serverUrl:r,apiToken:i,cwd:l}=e,c=R.useRef(null),a=R.useRef("disconnected"),u=R.useRef(!1),d=R.useRef(0),m=R.useRef(e.onOutput),p=R.useRef(e.onStatusChange),g=R.useRef(e.onExit),_=R.useRef(e.onSessionInit),C=R.useRef(e.onTitleChange),w=R.useRef(r),y=R.useRef(i),S=R.useRef(l),b=R.useRef(e.serverSessionId),x=R.useRef(e.terminal);let k;n[0]!==e.onExit||n[1]!==e.onOutput||n[2]!==e.onSessionInit||n[3]!==e.onStatusChange||n[4]!==e.onTitleChange?(k=()=>{m.current=e.onOutput,p.current=e.onStatusChange,g.current=e.onExit,_.current=e.onSessionInit,C.current=e.onTitleChange},n[0]=e.onExit,n[1]=e.onOutput,n[2]=e.onSessionInit,n[3]=e.onStatusChange,n[4]=e.onTitleChange,n[5]=k):k=n[5],R.useEffect(k);let j,N;n[6]!==i||n[7]!==l||n[8]!==e.serverSessionId||n[9]!==e.terminal||n[10]!==r?(j=()=>{w.current=r,y.current=i,S.current=l,b.current=e.serverSessionId,x.current=e.terminal},N=[r,i,l,e.serverSessionId,e.terminal],n[6]=i,n[7]=l,n[8]=e.serverSessionId,n[9]=e.terminal,n[10]=r,n[11]=j,n[12]=N):(j=n[11],N=n[12]),R.useEffect(j,N);let D;n[13]===Symbol.for("react.memo_cache_sentinel")?(D=Y=>{var I;a.current=Y,(I=p.current)==null||I.call(p,Y)},n[13]=D):D=n[13];const E=D;let O;n[14]===Symbol.for("react.memo_cache_sentinel")?(O=Y=>{const I=d.current=d.current+1,M=c.current;M&&(M.onopen=null,M.onclose=null,M.onmessage=null,M.onerror=null,M.close(),c.current=null),Y&&x.current&&x.current.clear(),E("connecting");const P=Y?Wd(w.current,`/ws/terminal?token=${y.current}&cwd=${encodeURIComponent(S.current)}&sessionId=${Y}`):Wd(w.current,`/ws/terminal?token=${y.current}&cwd=${encodeURIComponent(S.current)}`),F=new WebSocket(P);F.binaryType="arraybuffer",F.onopen=()=>{if(d.current!==I){F.close();return}c.current=F},F.onmessage=B=>{var K,V,te,re,ae,se;if(d.current!==I||!(B.data instanceof ArrayBuffer))return;const Q=new Uint8Array(B.data);if(Q.length<1)return;const J=Q[0],ee=Q.slice(1);e:switch(J){case Oi.OUTPUT:{(K=m.current)==null||K.call(m,new TextDecoder().decode(ee));break e}case Oi.EXIT:{const{exitCode:_e}=JSON.parse(new TextDecoder().decode(ee));E("exited"),(V=g.current)==null||V.call(g,_e),F.close();break e}case Oi.ERROR:{const{message:_e}=JSON.parse(new TextDecoder().decode(ee));console.error("[useTerminal] Server error:",_e),E("disconnected");break e}case Oi.INIT_ACK:{const _e=JSON.parse(new TextDecoder().decode(ee));(te=_.current)==null||te.call(_,_e),_e.isReconnect&&_e.status==="exited"?(E("exited"),(re=g.current)==null||re.call(g,_e.exitCode)):_e.isReconnect&&_e.inAlternateScreen?(E("connected"),(ae=m.current)==null||ae.call(m,`\r
621
+ \x1B[33m[Reconnected — a full-screen application is running. Press Ctrl+C to exit it.]\x1B[0m\r
622
+ `)):E("connected");break e}case Oi.TITLE:{const{title:_e}=JSON.parse(new TextDecoder().decode(ee));(se=C.current)==null||se.call(C,_e)}}},F.onclose=()=>{d.current===I&&(c.current=null,(a.current==="connecting"||a.current==="connected")&&E("disconnected"))},F.onerror=D$},n[14]=O):O=n[14];const L=O;let z,H;n[15]!==t?(z=()=>{if(!t)return;u.current=!1;const Y=t.onData(M=>{const P=c.current;if(!P||P.readyState!==WebSocket.OPEN)return;const F=new TextEncoder().encode(M);P.send(Jm(Oi.INPUT,F))}),I=t.onResize(M=>{const{cols:P,rows:F}=M,B=c.current;if(!B||B.readyState!==WebSocket.OPEN)return;const Q=new TextEncoder().encode(JSON.stringify({cols:P,rows:F}));B.send(Jm(Oi.RESIZE,Q))});return()=>{Y.dispose(),I.dispose(),u.current=!0;const M=c.current;M&&(M.onopen=null,M.onclose=null,M.onmessage=null,M.onerror=null,M.close(),c.current=null)}},H=[t],n[15]=t,n[16]=z,n[17]=H):(z=n[16],H=n[17]),R.useEffect(z,H);let $;n[18]===Symbol.for("react.memo_cache_sentinel")?($=()=>{const Y=c.current;Y&&(Y.onopen=null,Y.onclose=null,Y.onmessage=null,Y.onerror=null,Y.close(),c.current=null)},n[18]=$):$=n[18];const q=$;let G;n[19]===Symbol.for("react.memo_cache_sentinel")?(G=()=>{const Y=c.current;if(Y){try{Y.send(Jm(Oi.CLOSE,new Uint8Array(0)))}catch{}Y.close(),c.current=null}u.current=!0},n[19]=G):G=n[19];const W=G;let X;return n[20]===Symbol.for("react.memo_cache_sentinel")?(X={connect:L,disconnect:q,destroy:W},n[20]=X):X=n[20],X}function D$(){}function M$(){const t=he.c(2),[e,n]=R.useState(O$);let r,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=window.visualViewport;if(!l)return;const c=()=>{n({height:l.height,offsetTop:l.offsetTop,scale:l.scale})};return c(),l.addEventListener("resize",c),l.addEventListener("scroll",c),()=>{l.removeEventListener("resize",c),l.removeEventListener("scroll",c)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),R.useEffect(r,i),e}function O$(){return{height:typeof window<"u"?window.innerHeight:0,offsetTop:0,scale:1}}const L$=300,I$=200,P$=.7,z$=R.forwardRef(function({workspaceId:e,workspacePath:n,workspaceName:r,serverUrl:i,apiToken:l,isOpen:c,onClose:a},u){var Ee,De,Ue;const d=ol(),m=M$(),[p,g]=R.useState([]),[_,C]=R.useState(null),[w,y]=R.useState(L$),S=R.useRef(!1),b=R.useRef(0),x=R.useRef(0),k=R.useRef(R$()),j=R.useRef(null),N=R.useRef(null),D=R.useRef([]),E=R.useRef(()=>{}),O=R.useRef(!1),L=R.useRef(void 0),z=R.useRef(new Set),H=R.useRef(()=>{});R.useEffect(()=>{D.current=p},[p]);const $=R.useCallback(ce=>{switch(ce.type){case"snapshot":{const je=z.current;if(g(ce.sessions.map(be=>({serverSessionId:be.id,title:be.title,status:be.status==="exited"?"exited":"disconnected",cwd:be.cwd,shell:be.shell}))),ce.sessions.length>0?C(be=>be&&ce.sessions.some(Ve=>Ve.id===be)?be:ce.sessions[0].id):(C(null),O.current||(O.current=!0,H.current())),je.size>0){const be=new Set(ce.sessions.map(qe=>qe.id)),Ve=[...je].filter(qe=>!be.has(qe));for(const qe of Ve)H.current()}break}case"created":{g(je=>je.some(be=>be.serverSessionId===ce.session.id)?je:[...je,{serverSessionId:ce.session.id,title:ce.session.title,status:"disconnected",cwd:ce.session.cwd,shell:ce.session.shell}]),C(ce.session.id);break}case"destroyed":{g(je=>je.filter(be=>be.serverSessionId!==ce.sessionId)),k.current.dispose(ce.sessionId),C(je=>{if(je!==ce.sessionId)return je;const be=D.current.filter(Ve=>Ve.serverSessionId!==ce.sessionId);return be.length>0?be[0].serverSessionId:null});break}case"exited":{g(je=>je.map(be=>be.serverSessionId===ce.sessionId?{...be,status:"exited"}:be));break}case"title_changed":{g(je=>je.map(be=>be.serverSessionId===ce.sessionId?{...be,title:ce.title}:be));break}case"status_changed":{g(je=>je.map(be=>be.serverSessionId===ce.sessionId?{...be,status:ce.status==="exited"?"exited":"connected"}:be));break}}},[]);R.useEffect(()=>{E.current=$},[$]),R.useEffect(()=>{if(!e||!c||!i||!l){g([]),C(null),z.current=new Set,O.current=!1,j.current&&(j.current.disconnect(),j.current=null),I(null),k.current.disposeAll();const be=N.current;be&&(be.onopen=null,be.onclose=null,be.onmessage=null,be.onerror=null,be.close(),N.current=null);return}j.current&&(j.current.disconnect(),j.current=null),I(null),k.current.disposeAll(),z.current=new Set(D.current.map(be=>be.serverSessionId));const ce=Wd(i,`/ws/terminal/events?token=${l}&workspaceId=${encodeURIComponent(e)}`),je=new WebSocket(ce);return N.current=je,je.onmessage=be=>{try{const Ve=JSON.parse(be.data);E.current(Ve)}catch(Ve){console.error("[TerminalPanel] Failed to parse event:",Ve)}},()=>{const be=N.current;be&&(be.onopen=null,be.onclose=null,be.onmessage=null,be.onerror=null,be.close(),N.current=null)}},[e,c,i,l]);const q=R.useCallback(ce=>je=>{const be=k.current.get(ce);be==null||be.terminal.write(je)},[]),G=R.useCallback(ce=>je=>{g(be=>be.map(Ve=>Ve.serverSessionId===ce?{...Ve,status:je}:Ve))},[]),W=R.useCallback(ce=>je=>{const be=k.current.get(ce);be&&(be.serverSessionId=je.sessionId),g(Ve=>Ve.map(qe=>qe.serverSessionId===ce?{...qe,title:je.title||qe.title}:qe))},[]),X=R.useCallback(ce=>je=>{g(be=>be.map(Ve=>Ve.serverSessionId===ce?{...Ve,title:je}:Ve))},[]),[Y,I]=R.useState(null),{connect:M,disconnect:P,destroy:F}=T$((Ee=Y==null?void 0:Y.terminal)!=null?Ee:null,Y&&i&&l&&n&&Y.serverSessionId?{terminal:Y.terminal,serverUrl:i,apiToken:l,cwd:(Ue=(De=p.find(ce=>ce.serverSessionId===Y.serverSessionId))==null?void 0:De.cwd)!=null?Ue:n,serverSessionId:Y.serverSessionId,onOutput:q(Y.serverSessionId),onStatusChange:G(Y.serverSessionId),onSessionInit:W(Y.serverSessionId),onTitleChange:X(Y.serverSessionId)}:{terminal:null,serverUrl:"",apiToken:"",cwd:"",onOutput:()=>{},onStatusChange:()=>{}});R.useEffect(()=>{Y&&Y.serverSessionId&&(j.current={serverSessionId:Y.serverSessionId,disconnect:P,destroy:F},M(Y.serverSessionId))},[Y,M,P,F]);const B=R.useCallback(()=>{if(!_||!i||!l||!n)return;const ce=k.current.get(_);let je;if(ce)je=ce;else{const{terminal:be,fitAddon:Ve}=j$();je={terminal:be,fitAddon:Ve,serverSessionId:_,status:"connecting",isOpened:!1},k.current.set(_,je)}j.current&&(j.current.disconnect(),j.current=null),I(je)},[_,i,l,n]);R.useEffect(()=>{!c||!_||B()},[c,_,B]);const Q=R.useCallback(async()=>{if(!(!e||!n||!i||!l))try{const ce=await fetch(Xn(i,`/api/workspaces/${e}/terminals`),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify({cwd:n})});ce.ok||console.error("[TerminalPanel] Failed to create terminal:",ce.statusText)}catch(ce){console.error("[TerminalPanel] Failed to create terminal:",ce)}},[e,n,i,l]);R.useEffect(()=>{H.current=Q},[Q]);const J=R.useCallback(async ce=>{var je;if(!(!e||!i||!l)){((je=j.current)==null?void 0:je.serverSessionId)===ce&&(j.current.destroy(),j.current=null,I(null)),k.current.dispose(ce);try{await fetch(Xn(i,`/api/workspaces/${e}/terminals/${ce}`),{method:"DELETE",headers:{Authorization:`Bearer ${l}`}})}catch(be){console.error("[TerminalPanel] Failed to destroy terminal:",be)}}},[e,i,l]);R.useEffect(()=>{L.current!==e&&(L.current=e,O.current=!1)},[e]),R.useEffect(()=>{z.current=new Set},[e]),R.useEffect(()=>()=>{k.current.disposeAll()},[]);const ee=R.useCallback(()=>{if(_){const ce=k.current.get(_);ce==null||ce.terminal.focus()}},[_]);R.useImperativeHandle(u,()=>({focus:ee}),[ee]),R.useEffect(()=>{if(!c||!_)return;const ce=setTimeout(ee,300);return()=>clearTimeout(ce)},[c,_,ee]);const K=R.useCallback(ce=>{ce.preventDefault(),S.current=!0;const je="touches"in ce?ce.touches[0].clientY:ce.clientY;b.current=je,x.current=w;const be=qe=>{if(!S.current)return;const ye="touches"in qe?qe.touches[0].clientY:qe.clientY,Me=b.current-ye,Re=window.innerHeight*P$,we=Math.min(Math.max(x.current+Me,I$),Re);y(we)},Ve=()=>{S.current=!1,document.removeEventListener("mousemove",be),document.removeEventListener("mouseup",Ve),document.removeEventListener("touchmove",be),document.removeEventListener("touchend",Ve)};document.addEventListener("mousemove",be),document.addEventListener("mouseup",Ve),document.addEventListener("touchmove",be,{passive:!1}),document.addEventListener("touchend",Ve)},[w]);if(!e||!n||!i||!l)return h.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 V=r||n.split("/").pop()||"ws",te=p.find(ce=>ce.serverSessionId===_),re=_?k.current.get(_):null,ae=ce=>{switch(ce){case"connecting":return"bg-warning";case"connected":return"bg-success";case"disconnected":return"bg-muted-foreground";case"exited":return"bg-error"}},se=()=>h.jsxs("div",{className:"flex items-center gap-0.5 overflow-x-auto px-1 min-h-[32px]",children:[p.map(ce=>h.jsxs("div",{className:Ae("group flex items-center gap-1.5 px-2 py-1 text-xs cursor-pointer rounded-sm whitespace-nowrap border border-transparent",ce.serverSessionId===_?"bg-accent text-accent-foreground border-border":"text-muted-foreground hover:bg-muted"),onClick:()=>C(ce.serverSessionId),children:[h.jsx("span",{className:Ae("w-1.5 h-1.5 rounded-full shrink-0",ae(ce.status))}),h.jsxs("span",{children:[V," ",ce.title]}),h.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-destructive transition-opacity ml-0.5",onClick:je=>{je.stopPropagation(),J(ce.serverSessionId)},children:h.jsx(zn,{className:"w-3 h-3"})})]},ce.serverSessionId)),h.jsx(Te,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:Q,title:"New terminal tab",children:h.jsx(Qr,{className:"w-3.5 h-3.5"})})]}),_e=()=>h.jsx("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:re&&te?h.jsx(S$,{cachedTerminal:re},_):h.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No terminal sessions"})});if(d){const je=m.height<window.innerHeight*.85?`calc(${m.height}px - env(safe-area-inset-top, 0px))`:Math.min(window.innerHeight*.7,m.height);return c?h.jsx(Hf,{open:c,onOpenChange:be=>!be&&a(),children:h.jsxs($f,{side:"top",className:"p-0 bg-background [&>button]:hidden flex flex-col",style:{height:je},children:[h.jsx(Uf,{className:"sr-only",children:h.jsx(Vf,{children:"Terminal"})}),h.jsxs("div",{className:"flex items-center justify-between p-2 border-b border-border shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Yb,{className:"w-4 h-4"}),h.jsx("span",{className:"font-semibold text-sm",children:"Terminal"})]}),h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:a,children:h.jsx(zn,{className:"w-4 h-4"})})]}),se(),_e()]})}):null}return c?h.jsxs("div",{"data-terminal-panel":"",children:[h.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:K,onTouchStart:K,children:h.jsx("div",{className:"w-10 h-0.5 bg-muted-foreground/30 rounded-full"})}),h.jsxs("div",{className:"flex flex-col border-t border-border bg-background overflow-hidden shrink-0",style:{height:w},children:[h.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Yb,{className:"w-3.5 h-3.5 text-muted-foreground"}),h.jsx("span",{className:"font-medium text-xs text-muted-foreground",children:"Terminal"})]}),h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:a,children:h.jsx(zn,{className:"w-3.5 h-3.5"})})]}),se(),_e()]})]}):null});function B$(t){const e=he.c(11),{workspaceId:n,workspacePath:r,workspaceName:i,serverUrl:l,apiToken:c,terminalPanelRef:a}=t,u=qt(H$),d=qt(F$);let m;e[0]!==d?(m=()=>d(!1),e[0]=d,e[1]=m):m=e[1];let p;return e[2]!==c||e[3]!==l||e[4]!==u||e[5]!==m||e[6]!==a||e[7]!==n||e[8]!==i||e[9]!==r?(p=h.jsx(z$,{ref:a,workspaceId:n,workspacePath:r,workspaceName:i,serverUrl:l,apiToken:c,isOpen:u,onClose:m}),e[2]=c,e[3]=l,e[4]=u,e[5]=m,e[6]=a,e[7]=n,e[8]=i,e[9]=r,e[10]=p):p=e[10],p}function F$(t){return t.setShowTerminalPanel}function H$(t){return t.showTerminalPanel}function K_(t){const e=he.c(3),{message:n}=t,r=n===void 0?"Connecting to server...":n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(Wt,{className:"size-8 animate-spin"}),e[0]=i):i=e[0];let l;return e[1]!==r?(l=h.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-muted-foreground",children:[i,h.jsx("p",{className:"text-sm",children:r})]}),e[1]=r,e[2]=l):l=e[2],l}const $$=t=>{const e=he.c(26),{serverUrl:n,authError:r,retryCount:i,nextRetryIn:l,onRetry:c,onLogout:a}=t;let u,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(DS,{className:"size-12 text-destructive mb-4"}),d=h.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Unable to connect to server"}),e[0]=u,e[1]=d):(u=e[0],d=e[1]);const m=r||"Please check that the server is running.";let p;e[2]!==m?(p=h.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-[400px]",children:m}),e[2]=m,e[3]=p):p=e[3];let g;e[4]!==n?(g=n&&h.jsx("p",{className:"text-xs text-muted-foreground mb-6 font-mono bg-muted px-3 py-1.5 rounded",children:n}),e[4]=n,e[5]=g):g=e[5];let _;e[6]!==l?(_=h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Retrying in ",l,"s..."]}),e[6]=l,e[7]=_):_=e[7];let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(Pi,{className:"size-4 mr-2","data-icon":"inline-start"}),e[8]=C):C=e[8];let w;e[9]!==c?(w=h.jsxs(Te,{onClick:c,variant:"default",children:[C,"Retry Now"]}),e[9]=c,e[10]=w):w=e[10];let y;e[11]!==a?(y=h.jsx(Te,{onClick:a,variant:"ghost",children:"Change Server"}),e[11]=a,e[12]=y):y=e[12];let S;e[13]!==w||e[14]!==y?(S=h.jsxs("div",{className:"flex items-center gap-2",children:[w,y]}),e[13]=w,e[14]=y,e[15]=S):S=e[15];let b;e[16]!==i?(b=i>0&&h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retry attempt: ",i]}),e[16]=i,e[17]=b):b=e[17];let x;e[18]!==S||e[19]!==b||e[20]!==_?(x=h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[_,S,b]}),e[18]=S,e[19]=b,e[20]=_,e[21]=x):x=e[21];let k;return e[22]!==x||e[23]!==p||e[24]!==g?(k=h.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] px-4 text-center",children:[u,d,p,g,x]}),e[22]=x,e[23]=p,e[24]=g,e[25]=k):k=e[25],k};function Y_(t){const e=he.c(40),{onServerAdded:n,error:r}=t,[i,l]=R.useState(""),[c,a]=R.useState("localhost:8742"),[u,d]=R.useState(""),[m,p]=R.useState(!1),[g,_]=R.useState(null);let C;e[0]!==i||e[1]!==n||e[2]!==u||e[3]!==c?(C=I=>{I.preventDefault();const M=i.trim(),P=c.trim(),F=u.trim();if(!M){_("Please enter a server name");return}if(!P){_("Please enter a server URL");return}if(!F){_("Please enter an API token");return}if(!mS(F)){_("Invalid token format. Token should be 64 hex characters (0-9, a-f).");return}const B=Md(P),Q={id:crypto.randomUUID(),name:M,url:B,token:F,createdAt:new Date().toISOString()};n(Q)},e[0]=i,e[1]=n,e[2]=u,e[3]=c,e[4]=C):C=e[4];const w=C;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsxs("div",{className:"px-6 pt-6 pb-4 text-center border-b border-border",children:[h.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Add your first server"}),h.jsx("p",{className:"text-muted-foreground mt-1",children:"Connect to a Jean2 server to get started"})]}),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx("label",{htmlFor:"serverName",className:"text-sm font-medium text-foreground",children:"Server Name"}),e[6]=S):S=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=I=>{l(I.target.value),_(null)},e[7]=b):b=e[7];let x;e[8]!==i?(x=h.jsxs("div",{className:"space-y-2",children:[S,h.jsx("input",{id:"serverName",type:"text",value:i,onChange:b,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"})]}),e[8]=i,e[9]=x):x=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx("label",{htmlFor:"serverUrl",className:"text-sm font-medium text-foreground",children:"Server URL"}),e[10]=k):k=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=I=>{a(I.target.value),_(null)},e[11]=j):j=e[11];let N;e[12]!==c?(N=h.jsxs("div",{className:"space-y-2",children:[k,h.jsx("input",{id:"serverUrl",type:"text",value:c,onChange:j,placeholder:"localhost:8742",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"})]}),e[12]=c,e[13]=N):N=e[13];let D;e[14]===Symbol.for("react.memo_cache_sentinel")?(D=h.jsx("label",{htmlFor:"token",className:"text-sm font-medium text-foreground",children:"API Token"}),e[14]=D):D=e[14];const E=m?"text":"password";let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=I=>{d(I.target.value),_(null)},e[15]=O):O=e[15];let L;e[16]!==E||e[17]!==u?(L=h.jsx("input",{id:"token",type:E,value:u,onChange:O,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"}),e[16]=E,e[17]=u,e[18]=L):L=e[18];let z;e[19]!==m?(z=()=>p(!m),e[19]=m,e[20]=z):z=e[20];const H=m?"Hide token":"Show token";let $;e[21]!==m?($=m?h.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.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"})}):h.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),h.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"})]}),e[21]=m,e[22]=$):$=e[22];let q;e[23]!==z||e[24]!==H||e[25]!==$?(q=h.jsx("button",{type:"button",onClick:z,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":H,children:$}),e[23]=z,e[24]=H,e[25]=$,e[26]=q):q=e[26];let G;e[27]!==L||e[28]!==q?(G=h.jsxs("div",{className:"space-y-2",children:[D,h.jsxs("div",{className:"relative",children:[L,q]})]}),e[27]=L,e[28]=q,e[29]=G):G=e[29];let W;e[30]!==r||e[31]!==g?(W=(g||r)&&h.jsx("div",{className:"px-3 py-2 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive text-sm",children:g||r}),e[30]=r,e[31]=g,e[32]=W):W=e[32];let X;e[33]===Symbol.for("react.memo_cache_sentinel")?(X=h.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"}),e[33]=X):X=e[33];let Y;return e[34]!==w||e[35]!==G||e[36]!==W||e[37]!==x||e[38]!==N?(Y=h.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:h.jsx("div",{className:"w-full max-w-md",children:h.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[y,h.jsxs("form",{onSubmit:w,className:"p-6 space-y-4",children:[x,N,G,W,X]})]})})}),e[34]=w,e[35]=G,e[36]=W,e[37]=x,e[38]=N,e[39]=Y):Y=e[39],Y}function U$(t){const e=he.c(12);let n,r,i;e[0]!==t?({className:n,value:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let l;e[4]!==n?(l=Ae("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",n),e[4]=n,e[5]=l):l=e[5];const c=`translateX(-${100-(i||0)}%)`;let a;e[6]!==c?(a=h.jsx(ID,{"data-slot":"progress-indicator",className:"size-full flex-1 bg-primary transition-all",style:{transform:c}}),e[6]=c,e[7]=a):a=e[7];let u;return e[8]!==r||e[9]!==l||e[10]!==a?(u=h.jsx(LD,{"data-slot":"progress",className:l,...r,children:a}),e[8]=r,e[9]=l,e[10]=a,e[11]=u):u=e[11],u}function Cd(t){return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":t.toString()}function V$(t){return t>=60?"critical":t>=40?"warning":"normal"}function q$(t){const e=he.c(41),{totalTokens:n,contextWindow:r,modelName:i,compact:l}=t,c=n===void 0?0:n,a=r===void 0?0:r,u=l===void 0?!1:l,d=c===0?0:a;let m;e[0]!==d||e[1]!==c?(m=d===0?0:Math.min(100,Math.round(c/d*100)),e[0]=d,e[1]=c,e[2]=m):m=e[2];const p=m;let g;e[3]!==p?(g=V$(p),e[3]=p,e[4]=g):g=e[4];const _=g;if(u){let L;e[5]!==c?(L=Cd(c),e[5]=c,e[6]=L):L=e[6];let z;e[7]!==d?(z=Cd(d),e[7]=d,e[8]=z):z=e[8];let H;e[9]!==L||e[10]!==z?(H=h.jsxs("span",{className:"text-xs font-mono",children:[L,"/",z]}),e[9]=L,e[10]=z,e[11]=H):H=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=h.jsx(Ac,{asChild:!0,children:h.jsx(DA,{className:"size-3 text-muted-foreground cursor-help"})}),e[12]=$):$=e[12];let q;e[13]!==p?(q=h.jsx(Gd,{children:h.jsxs(Ec,{children:[$,h.jsx(Nc,{side:"bottom",children:h.jsxs("p",{className:"text-xs",children:[p,"% of context window used"]})})]})}),e[13]=p,e[14]=q):q=e[14];let G;return e[15]!==q||e[16]!==H?(G=h.jsxs("div",{className:"flex items-center gap-1.5",children:[H,q]}),e[15]=q,e[16]=H,e[17]=G):G=e[17],G}let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx("span",{className:"text-xs text-muted-foreground",children:"Tokens:"}),e[18]=C):C=e[18];let w;e[19]!==c?(w=Cd(c),e[19]=c,e[20]=w):w=e[20];let y;e[21]!==d?(y=Cd(d),e[21]=d,e[22]=y):y=e[22];let S;e[23]!==w||e[24]!==y?(S=h.jsxs("div",{className:"flex items-center gap-2",children:[C,h.jsxs("span",{className:"text-xs font-mono",children:[w,"/",y]})]}),e[23]=w,e[24]=y,e[25]=S):S=e[25];const b=_==="critical"&&"[&>div]:bg-destructive",x=_==="warning"&&"[&>div]:bg-warning",k=_==="normal"&&"[&>div]:bg-primary";let j;e[26]!==b||e[27]!==x||e[28]!==k?(j=Ae("h-1 w-20",b,x,k),e[26]=b,e[27]=x,e[28]=k,e[29]=j):j=e[29];let N;e[30]!==p||e[31]!==j?(N=h.jsx(U$,{value:p,className:j}),e[30]=p,e[31]=j,e[32]=N):N=e[32];let D;e[33]!==p?(D=h.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["(",p,"%)"]}),e[33]=p,e[34]=D):D=e[34];let E;e[35]!==N||e[36]!==D?(E=h.jsxs("div",{className:"flex items-center gap-2",children:[N,D]}),e[35]=N,e[36]=D,e[37]=E):E=e[37];let O;return e[38]!==S||e[39]!==E?(O=h.jsx("div",{className:"flex items-center gap-3",children:h.jsxs("div",{className:"flex flex-col gap-1",children:[S,E]})}),e[38]=S,e[39]=E,e[40]=O):O=e[40],O}function Xv(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(yM,{"data-slot":"select",...n}),e[2]=n,e[3]=r):r=e[3],r}function W$(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("scroll-my-1 p-1",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(kM,{"data-slot":"select-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Ya(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(xM,{"data-slot":"select-value",...n}),e[2]=n,e[3]=r):r=e[3],r}function Qv(t){const e=he.c(13);let n,r,i,l;e[0]!==t?({className:r,size:l,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?"default":l;let a;e[5]!==r?(a=Ae("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",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(_M,{asChild:!0,children:h.jsx(Za,{className:"pointer-events-none size-4 text-muted-foreground"})}),e[7]=u):u=e[7];let d;return e[8]!==n||e[9]!==i||e[10]!==c||e[11]!==a?(d=h.jsxs(bM,{"data-slot":"select-trigger","data-size":c,className:a,...i,children:[n,u]}),e[8]=n,e[9]=i,e[10]=c,e[11]=a,e[12]=d):d=e[12],d}function Zv(t){const e=he.c(24);let n,r,i,l,c;e[0]!==t?({className:r,children:n,position:l,align:c,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5]);const a=l===void 0?"item-aligned":l,u=c===void 0?"center":c,d=a==="item-aligned",m=a==="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";let p;e[6]!==r||e[7]!==m?(p=Ae("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",m,r),e[6]=r,e[7]=m,e[8]=p):p=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(K$,{}),e[9]=g):g=e[9];const _=a==="popper"&&"";let C;e[10]!==_?(C=Ae("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",_),e[10]=_,e[11]=C):C=e[11];let w;e[12]!==n||e[13]!==a||e[14]!==C?(w=h.jsx(CM,{"data-position":a,className:C,children:n}),e[12]=n,e[13]=a,e[14]=C,e[15]=w):w=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(Y$,{}),e[16]=y):y=e[16];let S;return e[17]!==u||e[18]!==a||e[19]!==i||e[20]!==d||e[21]!==p||e[22]!==w?(S=h.jsx(SM,{children:h.jsxs(wM,{"data-slot":"select-content","data-align-trigger":d,className:p,position:a,align:u,...i,children:[g,w,y]})}),e[17]=u,e[18]=a,e[19]=i,e[20]=d,e[21]=p,e[22]=w,e[23]=S):S=e[23],S}function G$(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("px-1.5 py-1 text-xs text-muted-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(EM,{"data-slot":"select-label",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function eh(t){const e=he.c(13);let n,r,i;e[0]!==t?({className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let l;e[4]!==r?(l=Ae("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",r),e[4]=r,e[5]=l):l=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:h.jsx(RM,{children:h.jsx(Vn,{className:"pointer-events-none"})})}),e[6]=c):c=e[6];let a;e[7]!==n?(a=h.jsx(NM,{children:n}),e[7]=n,e[8]=a):a=e[8];let u;return e[9]!==i||e[10]!==l||e[11]!==a?(u=h.jsxs(AM,{"data-slot":"select-item",className:l,...i,children:[c,a]}),e[9]=i,e[10]=l,e[11]=a,e[12]=u):u=e[12],u}function K$(t){const e=he.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=i):i=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(G5,{}),e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==i?(c=h.jsx(jM,{"data-slot":"select-scroll-up-button",className:i,...r,children:l}),e[6]=r,e[7]=i,e[8]=c):c=e[8],c}function Y$(t){const e=he.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ae("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=i):i=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(Za,{}),e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==i?(c=h.jsx(TM,{"data-slot":"select-scroll-down-button",className:i,...r,children:l}),e[6]=r,e[7]=i,e[8]=c):c=e[8],c}function X$(t){switch(t){case"budget":return"$";case"standard":return"$$";case"premium":return"$$$";default:return""}}function Q$(t){const e=he.c(43),{models:n,selectedModelId:r,onChangeModel:i,disabled:l,compact:c,iconOnly:a}=t,u=c===void 0?!1:c,d=a===void 0?!1:a;let m,p,g,_,C,w,y,S,b;if(e[0]!==u||e[1]!==l||e[2]!==d||e[3]!==n||e[4]!==i||e[5]!==r){const N=n.reduce(eU,{});let D;e[15]!==n||e[16]!==i?(D=$=>{const q=n.find(G=>G.id===$);q&&i($,q.providerId)},e[15]=n,e[16]=i,e[17]=D):D=e[17];const E=D,O=u&&!d;S="flex items-center gap-2",e[18]!==d||e[19]!==O?(b=!d&&h.jsx(xt,{className:"text-xs text-muted-foreground",children:O?h.jsx(Gb,{className:"size-3.5"}):"Model:"}),e[18]=d,e[19]=O,e[20]=b):b=e[20],p=Xv,_=r||"",C=E,w=l;const L=d?"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";let z;e[21]!==d?(z=d&&h.jsxs(h.Fragment,{children:[h.jsx(Gb,{className:"size-4"}),h.jsx(Ya,{className:"sr-only"})]}),e[21]=d,e[22]=z):z=e[22];let H;e[23]!==d?(H=!d&&h.jsx(Ya,{placeholder:"Select model"}),e[23]=d,e[24]=H):H=e[24],e[25]!==L||e[26]!==z||e[27]!==H?(y=h.jsxs(Qv,{className:L,children:[z,H]}),e[25]=L,e[26]=z,e[27]=H,e[28]=y):y=e[28],m=Zv,g=Object.entries(N).map(Z$),e[0]=u,e[1]=l,e[2]=d,e[3]=n,e[4]=i,e[5]=r,e[6]=m,e[7]=p,e[8]=g,e[9]=_,e[10]=C,e[11]=w,e[12]=y,e[13]=S,e[14]=b}else m=e[6],p=e[7],g=e[8],_=e[9],C=e[10],w=e[11],y=e[12],S=e[13],b=e[14];let x;e[29]!==m||e[30]!==g?(x=h.jsx(m,{children:g}),e[29]=m,e[30]=g,e[31]=x):x=e[31];let k;e[32]!==p||e[33]!==x||e[34]!==_||e[35]!==C||e[36]!==w||e[37]!==y?(k=h.jsxs(p,{value:_,onValueChange:C,disabled:w,children:[y,x]}),e[32]=p,e[33]=x,e[34]=_,e[35]=C,e[36]=w,e[37]=y,e[38]=k):k=e[38];let j;return e[39]!==k||e[40]!==S||e[41]!==b?(j=h.jsxs("div",{className:S,children:[b,k]}),e[39]=k,e[40]=S,e[41]=b,e[42]=j):j=e[42],j}function Z$(t){const[e,n]=t;return h.jsxs(W$,{children:[h.jsx(G$,{children:e}),n.map(J$)]},e)}function J$(t){return h.jsx(eh,{value:t.id,children:h.jsxs("span",{className:"flex items-center gap-2",children:[t.name,h.jsx("span",{className:"text-muted-foreground text-xs",children:X$(t.tier)})]})},t.id)}function eU(t,e){return t[e.providerName]||(t[e.providerName]=[]),t[e.providerName].push(e),t}const tU={low:"Low",medium:"Medium",high:"High",xhigh:"X-High",minimal:"Minimal",max:"Max"};function nU(t){return tU[t]||t.charAt(0).toUpperCase()+t.slice(1)}function rU(t){const e=he.c(45),{variants:n,selectedVariant:r,onChangeVariant:i,disabled:l,compact:c,iconOnly:a}=t,u=c===void 0?!1:c,d=a===void 0?!1:a,m=u&&!d;if(!n||Object.keys(n).length===0)return null;let p,g,_,C,w,y,S,b,x,k;if(e[0]!==l||e[1]!==d||e[2]!==i||e[3]!==r||e[4]!==m||e[5]!==n){const E=Object.keys(n);let O;e[16]!==i?(O=q=>{i(q==="__none__"?null:q)},e[16]=i,e[17]=O):O=e[17];const L=O;k="flex items-center gap-2",e[18]!==d||e[19]!==m?(_=!d&&h.jsx(xt,{className:"text-xs text-muted-foreground",children:m?h.jsx(Wb,{className:"size-3.5"}):"Thinking:"}),e[18]=d,e[19]=m,e[20]=_):_=e[20],g=Xv,y=r||"__none__",S=L,b=l;const z=d?"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";let H;e[21]!==d?(H=d&&h.jsxs(h.Fragment,{children:[h.jsx(Wb,{className:"size-4"}),h.jsx(Ya,{className:"sr-only"})]}),e[21]=d,e[22]=H):H=e[22];let $;e[23]!==d?($=!d&&h.jsx(Ya,{placeholder:"Default"}),e[23]=d,e[24]=$):$=e[24],e[25]!==z||e[26]!==H||e[27]!==$?(x=h.jsxs(Qv,{className:z,children:[H,$]}),e[25]=z,e[26]=H,e[27]=$,e[28]=x):x=e[28],p=Zv,e[29]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(eh,{value:"__none__",children:"Default"}),e[29]=C):C=e[29],w=E.map(sU),e[0]=l,e[1]=d,e[2]=i,e[3]=r,e[4]=m,e[5]=n,e[6]=p,e[7]=g,e[8]=_,e[9]=C,e[10]=w,e[11]=y,e[12]=S,e[13]=b,e[14]=x,e[15]=k}else p=e[6],g=e[7],_=e[8],C=e[9],w=e[10],y=e[11],S=e[12],b=e[13],x=e[14],k=e[15];let j;e[30]!==p||e[31]!==C||e[32]!==w?(j=h.jsxs(p,{children:[C,w]}),e[30]=p,e[31]=C,e[32]=w,e[33]=j):j=e[33];let N;e[34]!==g||e[35]!==j||e[36]!==y||e[37]!==S||e[38]!==b||e[39]!==x?(N=h.jsxs(g,{value:y,onValueChange:S,disabled:b,children:[x,j]}),e[34]=g,e[35]=j,e[36]=y,e[37]=S,e[38]=b,e[39]=x,e[40]=N):N=e[40];let D;return e[41]!==_||e[42]!==N||e[43]!==k?(D=h.jsxs("div",{className:k,children:[_,N]}),e[41]=_,e[42]=N,e[43]=k,e[44]=D):D=e[44],D}function sU(t){return h.jsx(eh,{value:t,children:nU(t)},t)}function iU(t){const e=he.c(24),{preconfigs:n,selectedPreconfigId:r,onChangePreconfig:i,disabled:l,compact:c,iconOnly:a}=t,u=c===void 0?!1:c,d=a===void 0?!1:a,m=u&&!d;let p;e[0]!==d||e[1]!==m?(p=!d&&h.jsx(xt,{className:"text-xs text-muted-foreground",children:m?h.jsx(sA,{className:"size-3.5"}):"Config:"}),e[0]=d,e[1]=m,e[2]=p):p=e[2];const g=r||"",_=d?"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";let C;e[3]!==d?(C=d&&h.jsxs(h.Fragment,{children:[h.jsx(NS,{className:"size-4"}),h.jsx(Ya,{className:"sr-only"})]}),e[3]=d,e[4]=C):C=e[4];let w;e[5]!==d?(w=!d&&h.jsx(Ya,{placeholder:"Select config"}),e[5]=d,e[6]=w):w=e[6];let y;e[7]!==_||e[8]!==C||e[9]!==w?(y=h.jsxs(Qv,{className:_,children:[C,w]}),e[7]=_,e[8]=C,e[9]=w,e[10]=y):y=e[10];let S;e[11]!==n?(S=n.map(oU),e[11]=n,e[12]=S):S=e[12];let b;e[13]!==S?(b=h.jsx(Zv,{children:S}),e[13]=S,e[14]=b):b=e[14];let x;e[15]!==l||e[16]!==i||e[17]!==b||e[18]!==g||e[19]!==y?(x=h.jsxs(Xv,{value:g,onValueChange:i,disabled:l,children:[y,b]}),e[15]=l,e[16]=i,e[17]=b,e[18]=g,e[19]=y,e[20]=x):x=e[20];let k;return e[21]!==x||e[22]!==p?(k=h.jsxs("div",{className:"flex items-center gap-2",children:[p,x]}),e[21]=x,e[22]=p,e[23]=k):k=e[23],k}function oU(t){return h.jsxs(eh,{value:t.id,children:[t.name,t.isDefault&&h.jsx("span",{className:"ml-2 text-muted-foreground text-xs",children:"(default)"})]},t.id)}function aU(t){var Ge;const e=he.c(102),{session:n,preconfigs:r,models:i,usage:l,modelName:c,onChangePreconfig:a,onChangeModel:u,onChangeVariant:d,onRename:m,onNavigateBack:p,isStreaming:g,onInterrupt:_,onCompact:C,isCompacting:w,canCompact:y,selectedVariant:S,variants:b}=t,[x,k]=R.useState(!1),[j,N]=R.useState(n.title||""),D=R.useRef(null),E=ol(),O=q8();let L,z;e[0]!==x?(L=()=>{x&&D.current&&(D.current.focus(),D.current.select())},z=[x],e[0]=x,e[1]=L,e[2]=z):(L=e[1],z=e[2]),R.useEffect(L,z);let H;e[3]!==n.title?(H=()=>{N(n.title||""),k(!0)},e[3]=n.title,e[4]=H):H=e[4];const $=H;let q;e[5]!==j||e[6]!==m||e[7]!==n.id||e[8]!==n.title?(q=()=>{const Ke=j.trim();Ke&&Ke!==n.title&&m(n.id,Ke),k(!1)},e[5]=j,e[6]=m,e[7]=n.id,e[8]=n.title,e[9]=q):q=e[9];const G=q;let W;e[10]!==G||e[11]!==n.title?(W=Ke=>{Ke.key==="Enter"?G():Ke.key==="Escape"&&(N(n.title||""),k(!1))},e[10]=G,e[11]=n.title,e[12]=W):W=e[12];const X=W;let Y;e[13]!==c||e[14]!==r||e[15]!==n.preconfigId||e[16]!==n.selectedModel?(Y=n.selectedModel||((Ge=r.find(Ke=>Ke.id===n.preconfigId))==null?void 0:Ge.model)||c,e[13]=c,e[14]=r,e[15]=n.preconfigId,e[16]=n.selectedModel,e[17]=Y):Y=e[17];const I=Y;let M;if(e[18]!==i||e[19]!==I){let Ke;e[21]!==I?(Ke=Je=>Je.id===I,e[21]=I,e[22]=Ke):Ke=e[22],M=i.find(Ke),e[18]=i,e[19]=I,e[20]=M}else M=e[20];const P=M,F=P==null?void 0:P.contextWindow;let B;e[23]!==p||e[24]!==n.parentId?(B=n.parentId&&p&&h.jsxs(Te,{variant:"ghost",size:"sm",onClick:p,className:"h-7",children:[h.jsx(Bg,{className:"size-4","data-icon":"inline-start"}),"Back"]}),e[23]=p,e[24]=n.parentId,e[25]=B):B=e[25];let Q;e[26]!==j||e[27]!==X||e[28]!==$||e[29]!==G||e[30]!==x||e[31]!==n.title?(Q=x?h.jsx("input",{ref:D,type:"text",value:j,onChange:Ke=>N(Ke.target.value),onBlur:G,onKeyDown:X,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}):h.jsx("h2",{className:"text-lg font-semibold cursor-pointer px-2 py-0.5 -mx-2 rounded hover:bg-accent transition-colors truncate min-w-0",onDoubleClick:$,children:n.title||"Untitled Session"}),e[26]=j,e[27]=X,e[28]=$,e[29]=G,e[30]=x,e[31]=n.title,e[32]=Q):Q=e[32];let J;e[33]!==n.id?(J=n.id.slice(0,8),e[33]=n.id,e[34]=J):J=e[34];let ee;e[35]!==J?(ee=h.jsx(Ft,{variant:"outline",className:"font-mono text-xs",children:J}),e[35]=J,e[36]=ee):ee=e[36];let K;e[37]!==n.status?(K=n.status==="closed"&&h.jsxs(Ft,{variant:"secondary",children:[h.jsx(D5,{className:"size-3","data-icon":"inline-start"}),"Archived"]}),e[37]=n.status,e[38]=K):K=e[38];let V;e[39]!==ee||e[40]!==K||e[41]!==B||e[42]!==Q?(V=h.jsx("div",{className:"flex items-center justify-start px-4 py-2 overflow-hidden",children:h.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[B,Q,ee,K]})}),e[39]=ee,e[40]=K,e[41]=B,e[42]=Q,e[43]=V):V=e[43];let te;e[44]===Symbol.for("react.memo_cache_sentinel")?(te=h.jsx(_n,{}),e[44]=te):te=e[44];let re;e[45]!==F||e[46]!==E||e[47]!==c||e[48]!==l.completionTokens||e[49]!==l.promptTokens||e[50]!==l.totalTokens?(re=h.jsx(q$,{promptTokens:l.promptTokens,completionTokens:l.completionTokens,totalTokens:l.totalTokens,contextWindow:F,modelName:c,compact:E}),e[45]=F,e[46]=E,e[47]=c,e[48]=l.completionTokens,e[49]=l.promptTokens,e[50]=l.totalTokens,e[51]=re):re=e[51];let ae;e[52]===Symbol.for("react.memo_cache_sentinel")?(ae=h.jsx(_n,{orientation:"vertical",className:"hidden sm:block"}),e[52]=ae):ae=e[52];const se=n.status==="closed"||!!n.parentId;let _e;e[53]!==O||e[54]!==E||e[55]!==i||e[56]!==u||e[57]!==I||e[58]!==se?(_e=h.jsx(Q$,{models:i,selectedModelId:I,onChangeModel:u,disabled:se,compact:O,iconOnly:E}),e[53]=O,e[54]=E,e[55]=i,e[56]=u,e[57]=I,e[58]=se,e[59]=_e):_e=e[59];const Ee=n.status==="closed"||!!n.parentId;let De;e[60]!==O||e[61]!==E||e[62]!==d||e[63]!==S||e[64]!==Ee||e[65]!==b?(De=h.jsx(rU,{variants:b,selectedVariant:S,onChangeVariant:d,disabled:Ee,compact:O,iconOnly:E}),e[60]=O,e[61]=E,e[62]=d,e[63]=S,e[64]=Ee,e[65]=b,e[66]=De):De=e[66];const Ue=n.status==="closed"||!!n.parentId;let ce;e[67]!==O||e[68]!==E||e[69]!==a||e[70]!==r||e[71]!==n.preconfigId||e[72]!==Ue?(ce=h.jsx(iU,{preconfigs:r,selectedPreconfigId:n.preconfigId,onChangePreconfig:a,disabled:Ue,compact:O,iconOnly:E}),e[67]=O,e[68]=E,e[69]=a,e[70]=r,e[71]=n.preconfigId,e[72]=Ue,e[73]=ce):ce=e[73];let je;e[74]===Symbol.for("react.memo_cache_sentinel")?(je=h.jsx(_n,{orientation:"vertical",className:"hidden sm:block"}),e[74]=je):je=e[74];let be;e[75]!==y||e[76]!==O||e[77]!==w||e[78]!==g||e[79]!==C?(be=C&&h.jsxs(h.Fragment,{children:[h.jsxs(Te,{variant:"outline",size:O?"icon":"sm",onClick:C,disabled:g||w||!y,title:w?"Compacting...":"Compact older messages",children:[h.jsx(kS,{className:"size-4"}),!O&&h.jsx("span",{className:"ml-1",children:w?"Compacting...":"Compact"})]}),h.jsx(_n,{orientation:"vertical",className:"hidden sm:block"})]}),e[75]=y,e[76]=O,e[77]=w,e[78]=g,e[79]=C,e[80]=be):be=e[80];const Ve=g?"destructive":"outline",qe=O?"icon":"sm",ye=!_,Me=g?"":"opacity-60 hover:opacity-100",Re=g?"Interrupt operation":"Interrupt (no active operation)";let we;e[81]===Symbol.for("react.memo_cache_sentinel")?(we=h.jsx(jS,{className:"size-4"}),e[81]=we):we=e[81];let oe;e[82]!==O?(oe=!O&&h.jsx("span",{className:"ml-1",children:"Stop"}),e[82]=O,e[83]=oe):oe=e[83];let me;e[84]!==_||e[85]!==Ve||e[86]!==qe||e[87]!==ye||e[88]!==Me||e[89]!==Re||e[90]!==oe?(me=h.jsxs(Te,{variant:Ve,size:qe,onClick:_,disabled:ye,className:Me,title:Re,children:[we,oe]}),e[84]=_,e[85]=Ve,e[86]=qe,e[87]=ye,e[88]=Me,e[89]=Re,e[90]=oe,e[91]=me):me=e[91];let Ne;e[92]!==re||e[93]!==_e||e[94]!==De||e[95]!==ce||e[96]!==be||e[97]!==me?(Ne=h.jsxs("div",{className:"inline-flex align-middle items-center gap-3 sm:gap-4 px-4 py-2 flex-wrap",children:[re,ae,_e,De,ce,je,be,me]}),e[92]=re,e[93]=_e,e[94]=De,e[95]=ce,e[96]=be,e[97]=me,e[98]=Ne):Ne=e[98];let Le;return e[99]!==V||e[100]!==Ne?(Le=h.jsxs("header",{className:"flex flex-col border-b border-border bg-card",children:[V,te,Ne]}),e[99]=V,e[100]=Ne,e[101]=Le):Le=e[101],Le}function lU(t){const e=he.c(33),{workspaceId:n,searchQuery:r,selectedIndex:i,onSelect:l,onFilesChange:c,showHidden:a,serverUrl:u,apiToken:d}=t,m=a===void 0?!0:a;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[g,_]=R.useState(p),[C,w]=R.useState(!1),[y,S]=R.useState(r),{fetchWithAuth:b}=ns(),x=R.useRef(0);let k,j;e[1]!==r?(k=()=>{const G=setTimeout(()=>{S(r)},300);return()=>clearTimeout(G)},j=[r],e[1]=r,e[2]=k,e[3]=j):(k=e[2],j=e[3]),R.useEffect(k,j);let N,D;if(e[4]!==d||e[5]!==y||e[6]!==b||e[7]!==c||e[8]!==u||e[9]!==m||e[10]!==n?(N=()=>{if(!y||y.length<2){_([]),c([]);return}const G=x.current=x.current+1;w(!0);const W=new AbortController;return b(`/api/workspaces/${n}/files?search=${encodeURIComponent(y)}&showHidden=${m}`,{signal:W.signal},{serverUrl:u,token:d}).then(uU).then(X=>{if(G!==x.current)return;const Y=X.files||[];_(Y),c(Y)}).catch(cU).finally(()=>{G===x.current&&w(!1)}),()=>W.abort()},D=[n,y,c,m,b,u,d],e[4]=d,e[5]=y,e[6]=b,e[7]=c,e[8]=u,e[9]=m,e[10]=n,e[11]=N,e[12]=D):(N=e[11],D=e[12]),R.useEffect(N,D),!r||r.length<2){let G;return e[13]===Symbol.for("react.memo_cache_sentinel")?(G=h.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"Type at least 2 characters to search files..."}),e[13]=G):G=e[13],G}if(C){let G;return e[14]===Symbol.for("react.memo_cache_sentinel")?(G=h.jsxs("div",{className:"flex items-center justify-center p-4 text-muted-foreground",children:[h.jsx(Wt,{className:"w-4 h-4 animate-spin mr-2"}),"Searching..."]}),e[14]=G):G=e[14],G}if(g.length===0){let G;return e[15]!==r?(G=h.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No files found matching "',r,'"']}),e[15]=r,e[16]=G):G=e[16],G}let E;if(e[17]!==g||e[18]!==l||e[19]!==i){let G;e[21]!==l||e[22]!==i?(G=(W,X)=>h.jsxs("button",{onClick:()=>l(W),className:Ae("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",X===i&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[W.type==="directory"?h.jsx(Vs,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}):h.jsx(Pr,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),h.jsx("span",{className:"truncate flex-1",children:W.path}),W.extension&&h.jsx("span",{className:"text-xs text-muted-foreground",children:W.extension})]},W.path),e[21]=l,e[22]=i,e[23]=G):G=e[23],E=g.map(G),e[17]=g,e[18]=l,e[19]=i,e[20]=E}else E=e[20];const O=g.length!==1?"s":"";let L;e[24]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[24]=L):L=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[25]=z):z=e[25];let H;e[26]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[26]=H):H=e[26];let $;e[27]!==g.length||e[28]!==O?($=h.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[g.length," result",O," •",L," navigate",z," select",H," close"]}),e[27]=g.length,e[28]=O,e[29]=$):$=e[29];let q;return e[30]!==$||e[31]!==E?(q=h.jsxs("div",{className:"p-1",children:[E,$]}),e[30]=$,e[31]=E,e[32]=q):q=e[32],q}function cU(t){t.name!=="AbortError"&&console.error("File search failed:",t)}function uU(t){return t.json()}function dU(t){const e=he.c(25),{prompts:n,query:r,selectedIndex:i,onSelect:l}=t;let c,a,u,d;if(e[0]!==l||e[1]!==n||e[2]!==r||e[3]!==i){d=Symbol.for("react.early_return_sentinel");e:{let y;if(e[8]!==r?(y=b=>b.name.toLowerCase().includes(r.toLowerCase()),e[8]=r,e[9]=y):y=e[9],c=n.filter(y),c.length===0){let b;e[10]!==r?(b=h.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No prompts matching "/',r,'"']}),e[10]=r,e[11]=b):b=e[11],d=b;break e}a="p-1";let S;e[12]!==l||e[13]!==i?(S=(b,x)=>h.jsxs("button",{onClick:()=>l(b),className:Ae("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",x===i&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[h.jsx(GA,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"font-mono text-xs",children:["/",b.name]}),h.jsx("div",{className:"text-xs text-muted-foreground truncate",children:b.description})]})]},b.name),e[12]=l,e[13]=i,e[14]=S):S=e[14],u=c.map(S)}e[0]=l,e[1]=n,e[2]=r,e[3]=i,e[4]=c,e[5]=a,e[6]=u,e[7]=d}else c=e[4],a=e[5],u=e[6],d=e[7];if(d!==Symbol.for("react.early_return_sentinel"))return d;const m=c.length!==1?"s":"";let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[15]=p):p=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[16]=g):g=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[17]=_):_=e[17];let C;e[18]!==c.length||e[19]!==m?(C=h.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[c.length," prompt",m," •",p," navigate",g," select",_," close"]}),e[18]=c.length,e[19]=m,e[20]=C):C=e[20];let w;return e[21]!==a||e[22]!==u||e[23]!==C?(w=h.jsxs("div",{className:a,children:[u,C]}),e[21]=a,e[22]=u,e[23]=C,e[24]=w):w=e[24],w}function fU(t){const e=he.c(26),{id:n,kind:r,filename:i,size:l,previewUrl:c,isUploading:a,onRemove:u}=t,d=a&&"opacity-50";let m;e[0]!==d?(m=Ae("flex items-center gap-2 px-2 py-1.5 bg-muted rounded-lg border border-border max-w-[180px]",d),e[0]=d,e[1]=m):m=e[1];let p;e[2]!==i||e[3]!==r||e[4]!==c?(p=r==="image"&&c?h.jsx("img",{src:c,alt:i,className:"size-8 rounded object-cover shrink-0"}):r==="image"?h.jsx(jA,{className:"size-4 text-muted-foreground shrink-0"}):h.jsx(Pr,{className:"size-4 text-muted-foreground shrink-0"}),e[2]=i,e[3]=r,e[4]=c,e[5]=p):p=e[5];let g;e[6]!==i?(g=h.jsx("div",{className:"text-xs truncate",children:i}),e[6]=i,e[7]=g):g=e[7];let _;e[8]!==l?(_=hU(l),e[8]=l,e[9]=_):_=e[9];let C;e[10]!==_?(C=h.jsx("div",{className:"text-[10px] text-muted-foreground",children:_}),e[10]=_,e[11]=C):C=e[11];let w;e[12]!==g||e[13]!==C?(w=h.jsxs("div",{className:"min-w-0 flex-1",children:[g,C]}),e[12]=g,e[13]=C,e[14]=w):w=e[14];let y;e[15]!==n||e[16]!==u?(y=()=>u(n),e[15]=n,e[16]=u,e[17]=y):y=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx(zn,{className:"size-3 text-muted-foreground"}),e[18]=S):S=e[18];let b;e[19]!==y?(b=h.jsx("button",{type:"button",onClick:y,className:"shrink-0 p-0.5 hover:bg-accent rounded",children:S}),e[19]=y,e[20]=b):b=e[20];let x;return e[21]!==b||e[22]!==m||e[23]!==p||e[24]!==w?(x=h.jsxs("div",{className:m,children:[p,w,b]}),e[21]=b,e[22]=m,e[23]=p,e[24]=w,e[25]=x):x=e[25],x}function hU(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function pU(t){const e=he.c(9),[n,r]=R.useState(""),[i,l]=R.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,u]=R.useState(c);let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=w=>{const y={type:"file",path:w.path,display:w.name};return u(S=>[...S,y]),l(!1),r(""),y},e[1]=d):d=e[1];const m=d,p=mU;let g;e[2]!==a?(g=w=>{const y=/@([^\s@]+)/g,S=[];let b;for(;(b=y.exec(w))!==null;){const x=b[1];a.some(k=>k.path===x)&&!S.some(k=>k.path===x)&&S.push({type:"file",path:x,display:x.split("/").pop()||x})}return S},e[2]=a,e[3]=g):g=e[3];const _=g;let C;return e[4]!==_||e[5]!==a||e[6]!==n||e[7]!==i?(C={query:n,setQuery:r,showAutocomplete:i,setShowAutocomplete:l,mentions:a,handleFileSelect:m,insertMention:p,extractMentions:_},e[4]=_,e[5]=a,e[6]=n,e[7]=i,e[8]=C):C=e[8],C}function mU(t,e,n){const r=t.lastIndexOf("@",e);if(r===-1)return{text:t,cursorPos:e};const i=t.slice(0,r)+`@${n.path}`+t.slice(e),l=r+n.path.length+1;return{text:i,cursorPos:l}}function gU(t,e){return e?t.content.includes("ARG")?t.content.replace("ARG",e):`${t.content}
623
+ ${e}`:t.content}function vU(t){const e=t.trimStart();if(!e.startsWith("/"))return null;const n=e.indexOf(" ");return n===-1?{command:e.slice(1),rest:""}:{command:e.slice(1,n),rest:e.slice(n+1).trim()}}const yU=R.forwardRef(function({onSendMessage:e,disabled:n,isStreaming:r,onStopStreaming:i,placeholder:l="Type a message...",workspaceId:c,serverUrl:a,apiToken:u,prompts:d=[],sessionId:m,modelSupportsImage:p},g){const[_,C]=R.useState(""),[w,y]=R.useState(0),[S,b]=R.useState([]),[x,k]=R.useState(0),[j,N]=R.useState("none"),[D,E]=R.useState(""),[O,L]=R.useState([]),[z,H]=R.useState(!1),$=R.useRef(null),q=R.useRef(null);R.useImperativeHandle(g,()=>({focus:()=>{var ye;return(ye=$.current)==null?void 0:ye.focus()}}),[]);const{query:G,setQuery:W,showAutocomplete:X,setShowAutocomplete:Y,handleFileSelect:I,insertMention:M}=pU();R.useEffect(()=>{k(0)},[S,D,d]),R.useEffect(()=>{const ye=$.current;ye&&(ye.style.height="auto",ye.style.height=`${Math.min(ye.scrollHeight,150)}px`)},[_]);const P=d.filter(ye=>ye.name.toLowerCase().includes(D.toLowerCase())),F=j==="prompts"&&d.length>0,B=j==="files"&&X&&!!c,Q=R.useCallback(ye=>{const Me=ye.target.value,Re=ye.target.selectionStart||0;C(Me),y(Re);const we=Me.lastIndexOf("/",Re);if(we!==-1){const me=we>0?Me[we-1]:`
624
+ `,Ne=Me.slice(we+1,Re);if((me===`
625
+ `||me===" "||me==="")&&!Ne.includes(" ")){E(Ne),N("prompts");return}}const oe=Me.lastIndexOf("@",Re);if(oe!==-1){const me=Me.slice(oe+1,Re);if(!me.includes(" ")){W(me),Y(!0),N("files");return}}N("none"),Y(!1)},[W,Y]),J=R.useCallback(ye=>{const Me=I(ye),Re=M(_,w,Me);C(Re.text),N("none"),Y(!1),b([]),setTimeout(()=>{$.current&&($.current.focus(),$.current.setSelectionRange(Re.cursorPos,Re.cursorPos))},0)},[_,w,I,M,Y]),ee=R.useCallback(ye=>{const Me=_.lastIndexOf("/",w),Re=_.slice(0,Me),we=_.slice(Me+1),oe=we.indexOf(" "),me=oe!==-1?we.slice(oe):"",Ne=`${Re}/${ye.name}${me}`,Le=Me+1+ye.name.length+0;C(Ne),N("none"),setTimeout(()=>{$.current&&($.current.focus(),$.current.setSelectionRange(Le,Le))},0)},[_,w]),K=R.useCallback(()=>{for(const ye of O)ye.previewUrl&&URL.revokeObjectURL(ye.previewUrl);L([]),C("")},[O]),V=R.useCallback(async ye=>{if(!a||!u||!m)return null;try{const Me=new FormData;Me.append("file",ye);const Re=await fetch(Xn(a,`/api/sessions/${m}/attachments`),{method:"POST",headers:{Authorization:`Bearer ${u}`},body:Me});if(!Re.ok){const oe=await Re.json().catch(()=>({message:"Upload failed"}));return console.error("Upload failed:",oe.message),null}const we=await Re.json();return{id:crypto.randomUUID(),kind:we.kind,filename:we.filename,size:we.size,previewUrl:ye.type.startsWith("image/")?URL.createObjectURL(ye):void 0,uploadedId:we.id,uploadedKind:we.kind}}catch(Me){return console.error("Upload error:",Me),null}},[a,u,m]),te=R.useCallback(ye=>{L(Me=>{const Re=Me.find(we=>we.id===ye);return Re!=null&&Re.previewUrl&&URL.revokeObjectURL(Re.previewUrl),Me.filter(we=>we.id!==ye)})},[]),re=R.useCallback(async ye=>{const Me=Array.from(ye);for(const Re of Me){if(Re.size>20*1024*1024)continue;const we=Re.type.startsWith("image/")?"image":Re.type.startsWith("video/")?"video":"file",oe={id:crypto.randomUUID(),kind:we,filename:Re.name,size:Re.size,previewUrl:Re.type.startsWith("image/")?URL.createObjectURL(Re):void 0,isUploading:!0};L(Ne=>[...Ne,oe]);const me=await V(Re);L(me?Ne=>Ne.map(Le=>Le.id===oe.id?(Le.previewUrl&&Le.previewUrl!==me.previewUrl&&URL.revokeObjectURL(Le.previewUrl),{...me,isUploading:!1}):Le):Ne=>Ne.filter(Le=>Le.id!==oe.id))}},[V]),ae=R.useCallback(ye=>{var Re;const Me=(Re=ye.clipboardData)==null?void 0:Re.files;Me&&Me.length>0&&(ye.preventDefault(),re(Me))},[re]),se=R.useCallback(ye=>{ye.preventDefault(),ye.stopPropagation(),H(!0)},[]),_e=R.useCallback(ye=>{ye.preventDefault(),ye.stopPropagation(),H(!1)},[]),Ee=R.useCallback(ye=>{var Re;ye.preventDefault(),ye.stopPropagation(),H(!1);const Me=(Re=ye.dataTransfer)==null?void 0:Re.files;Me&&Me.length>0&&re(Me)},[re]),De=async ye=>{ye==null||ye.preventDefault();const Me=_.trim();if(!Me&&O.length===0||n)return;const Re=vU(_);if(Re){const oe=d.find(me=>me.name===Re.command);if(oe){const me=gU(oe,Re.rest),Ne=O.filter(Le=>Le.uploadedId).map(Le=>({id:Le.uploadedId,kind:Le.uploadedKind}));e(me,Ne.length>0?Ne:void 0),K();return}}const we=O.filter(oe=>oe.uploadedId).map(oe=>({id:oe.uploadedId,kind:oe.uploadedKind}));e(Me||"",we.length>0?we:void 0),K()},Ue=ye=>{if(!ye.nativeEvent.isComposing){if(F&&P.length>0)switch(ye.key){case"ArrowDown":ye.preventDefault(),k(Me=>Math.min(Me+1,P.length-1));return;case"ArrowUp":ye.preventDefault(),k(Me=>Math.max(Me-1,0));return;case"Enter":if(ye.shiftKey)return;ye.preventDefault(),P[x]&&ee(P[x]);return;case"Tab":ye.preventDefault(),P[x]&&ee(P[x]);return;case"Escape":ye.preventDefault(),N("none");return}if(B&&S.length>0)switch(ye.key){case"ArrowDown":ye.preventDefault(),k(Me=>Math.min(Me+1,S.length-1));return;case"ArrowUp":ye.preventDefault(),k(Me=>Math.max(Me-1,0));return;case"Enter":ye.preventDefault(),S[x]&&J(S[x]);return;case"Escape":ye.preventDefault(),Y(!1),N("none");return;case"Tab":ye.preventDefault(),S[x]&&J(S[x]);return}ye.key==="Enter"&&!ye.shiftKey&&(ye.preventDefault(),De())}},ce=R.useCallback(ye=>{b(ye)},[]);if(r&&i)return h.jsx("div",{className:"p-4 border-t border-border bg-card",children:h.jsxs("div",{className:"flex items-center justify-center gap-3",children:[h.jsxs("div",{className:"animate-pulse flex items-center gap-2 text-muted-foreground",children:[h.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce"}),h.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.1s]"}),h.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.2s]"}),h.jsx("span",{className:"text-sm ml-2",children:"Generating..."})]}),h.jsxs(Te,{variant:"outline",size:"sm",onClick:i,children:[h.jsx(jS,{className:"size-4","data-icon":"inline-start"}),"Stop"]})]})});const je=_.trim(),be=O.some(ye=>ye.isUploading),qe=!(je||O.length>0)||n||be;return h.jsxs("form",{onSubmit:De,onDragOver:se,onDragLeave:_e,onDrop:Ee,className:Ae("p-4 border-t border-border bg-card",z&&"ring-2 ring-primary"),children:[(O.length>0||!r)&&h.jsx("div",{className:"flex gap-2 flex-wrap mb-2",children:O.map(ye=>h.jsx(fU,{id:ye.id,kind:ye.kind,filename:ye.filename,size:ye.size,previewUrl:ye.previewUrl,isUploading:ye.isUploading,onRemove:te},ye.id))}),O.length>0&&p===!1&&h.jsxs("div",{className:"flex items-center gap-1.5 mb-2 text-xs text-amber-600 dark:text-amber-400",children:[h.jsx(Ua,{className:"size-3 shrink-0"}),h.jsx("span",{children:"This model will not inspect images directly. They will be sent as file paths instead."})]}),h.jsxs("div",{className:"flex gap-3 items-end",children:[h.jsx("div",{className:"flex-1 relative",children:h.jsxs(Bf,{open:F||B,onOpenChange:ye=>{ye||(N("none"),Y(!1))},children:[h.jsx(H8,{asChild:!0,children:h.jsx(Ck,{ref:$,value:_,onChange:Q,onKeyDown:Ue,onPaste:ae,placeholder:l,disabled:n,className:Ae("min-h-[44px] max-h-[150px] resize-none pr-12 chat-input-scrollbar","focus-visible:ring-1"),rows:1,"data-chat-input":"true"})}),h.jsx(Ff,{className:"w-72 p-0",align:"start",side:"top",sideOffset:8,onOpenAutoFocus:ye=>ye.preventDefault(),onCloseAutoFocus:ye=>ye.preventDefault(),children:B?h.jsx(lU,{workspaceId:c||"",searchQuery:G,selectedIndex:x,onSelect:J,onFilesChange:ce,serverUrl:a,apiToken:u}):h.jsx(dU,{prompts:d,query:D,selectedIndex:x,onSelect:ee})})]})}),h.jsx("button",{type:"button",className:"flex items-center justify-center size-11 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50 disabled:pointer-events-none",onClick:()=>{var ye;return(ye=q.current)==null?void 0:ye.click()},disabled:n,children:h.jsx(sN,{className:"size-4"})}),h.jsx("input",{ref:q,type:"file",accept:"image/*,video/*,.pdf,.doc,.docx,.txt,.csv,.json,.xml,.md",multiple:!0,className:"hidden",onChange:ye=>{ye.target.files&&re(ye.target.files),ye.target.value=""}}),h.jsx(Te,{type:"submit",disabled:qe,size:"default",className:"h-11",children:h.jsx(gN,{className:"size-4"})})]}),h.jsxs("div",{className:"mt-2 text-xs text-muted-foreground text-center hidden sm:flex items-center justify-center gap-1",children:[h.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"/"}),h.jsx("span",{children:"prompts"}),h.jsx("span",{className:"mx-2",children:"•"}),h.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"@"}),h.jsx("span",{children:"files"}),h.jsx("span",{className:"mx-2",children:"•"}),h.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Enter"}),h.jsx("span",{children:"to send"}),h.jsx("span",{className:"mx-2",children:"•"}),h.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Shift + Enter"}),h.jsx("span",{children:"for new line"})]})]})});function bU(t){const e=he.c(3),n=R.useRef(t);let r;e[0]!==t?(r=()=>{n.current=t},e[0]=t,e[1]=r):r=e[1],R.useLayoutEffect(r);let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(...c)=>{const a=c;return n.current(...a)},e[2]=i):i=e[2],i}function Oa(t,e,n){var a;let r=(a=n.initialDeps)!=null?a:[],i,l=!0;function c(){var u,d,m;let p;n.key&&((u=n.debug)!=null&&u.call(n))&&(p=Date.now());const g=t();if(!(g.length!==r.length||g.some((w,y)=>r[y]!==w)))return i;r=g;let C;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(C=Date.now()),i=e(...g),n.key&&((m=n.debug)!=null&&m.call(n))){const w=Math.round((Date.now()-p)*100)/100,y=Math.round((Date.now()-C)*100)/100,S=y/16,b=(x,k)=>{for(x=String(x);x.length<k;)x=" "+x;return x};console.info(`%c⏱ ${b(y,5)} /${b(w,5)} ms`,`
626
+ font-size: .6rem;
627
+ font-weight: bold;
628
+ color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(l&&n.skipInitialOnChange)&&n.onChange(i),l=!1,i}return c.updateDeps=u=>{r=u},c}function X_(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const xU=(t,e)=>Math.abs(t-e)<1.01,_U=(t,e,n)=>{let r;return function(...i){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,i),n)}},Q_=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},SU=t=>t,wU=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let i=e;i<=n;i++)r.push(i);return r},CU=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const i=c=>{const{width:a,height:u}=c;e({width:Math.round(a),height:Math.round(u)})};if(i(Q_(n)),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver(c=>{const a=()=>{const u=c[0];if(u!=null&&u.borderBoxSize){const d=u.borderBoxSize[0];if(d){i({width:d.inlineSize,height:d.blockSize});return}}i(Q_(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},Z_={passive:!0},J_=typeof window>"u"?!0:"onscrollend"in window,kU=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let i=0;const l=t.options.useScrollendEvent&&J_?()=>{}:_U(r,()=>{e(i,!1)},t.options.isScrollingResetDelay),c=m=>()=>{const{horizontal:p,isRtl:g}=t.options;i=p?n.scrollLeft*(g&&-1||1):n.scrollTop,l(),e(i,m)},a=c(!0),u=c(!1);n.addEventListener("scroll",a,Z_);const d=t.options.useScrollendEvent&&J_;return d&&n.addEventListener("scrollend",u,Z_),()=>{n.removeEventListener("scroll",a),d&&n.removeEventListener("scrollend",u)}},EU=(t,e,n)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},AU=(t,{adjustments:e=0,behavior:n},r)=>{var i,l;const c=t+e;(l=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||l.call(i,{[r.options.horizontal?"left":"top"]:c,behavior:n})};class NU{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var l;var n,r,i;return(l=(i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))!=null?l:Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(l=>{const c=()=>{const a=l.target,u=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(a,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var l;return(l=r())==null?void 0:l.observe(i,{box:"border-box"})},unobserve:i=>{var l;return(l=r())==null?void 0:l.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:SU,rangeExtractor:wU,onChange:()=>{},measureElement:EU,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Oa(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(i=(n=this.scrollElement)==null?void 0:n.window)!=null?i:null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,c)=>{this.scrollAdjustments=0,this.scrollDirection=c?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=c,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>{var n;return this.options.enabled?(this.scrollRect=(n=this.scrollRect)!=null?n:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var n;return this.options.enabled?(this.scrollOffset=(n=this.scrollOffset)!=null?n:typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(n,r)=>{const i=new Map,l=new Map;for(let c=r-1;c>=0;c--){const a=n[c];if(i.has(a.lane))continue;const u=l.get(a.lane);if(u==null||a.end>u.end?l.set(a.lane,a):a.end<u.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((c,a)=>c.end===a.end?c.index-a.index:c.end-a.end)[0]:void 0},this.getMeasurementOptions=Oa(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,i,l,c,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:l,enabled:c,lanes:a}),{key:!1}),this.getMeasurements=Oa(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:l,enabled:c,lanes:a},u)=>{if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const g of this.laneAssignments.keys())g>=n&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,d),p=new Array(a).fill(void 0);for(let g=0;g<d;g++){const _=m[g];_&&(p[_.lane]=g)}for(let g=d;g<n;g++){const _=l(g),C=this.laneAssignments.get(g);let w,y;if(C!==void 0&&this.options.lanes>1){w=C;const k=p[w],j=k!==void 0?m[k]:void 0;y=j?j.end+this.options.gap:r+i}else{const k=this.options.lanes===1?m[g-1]:this.getFurthestMeasurement(m,g);y=k?k.end+this.options.gap:r+i,w=k?k.lane:g%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(g,w)}const S=u.get(_),b=typeof S=="number"?S:this.options.estimateSize(g),x=y+b;m[g]={index:g,start:y,size:b,end:x,key:_,lane:w},p[w]=g}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Oa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,l)=>this.range=n.length>0&&r>0?RU({measurements:n,outerSize:r,scrollOffset:i,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Oa(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,l,c)=>l===null||c===null?[]:n({startIndex:l,endIndex:c,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var l;var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=(l=this.scrollState.index)!=null?l:(r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index;if(i!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,i-c),u=Math.min(this.options.count-1,i+c);return n>=a&&n<=u}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((c,a)=>{c.isConnected||(this.observer.unobserve(c),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),i=this.options.getItemKey(r),l=this.elementsCache.get(i);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(i,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var u;var i;const l=this.measurementsCache[n];if(!l)return;const c=(u=this.itemSizeCache.get(l.key))!=null?u:l.size,a=r-c;a!==0&&(((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,a,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,r)),this.notify(!1))},this.getVirtualItems=Oa(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let l=0,c=n.length;l<c;l++){const a=n[l],u=r[a];i.push(u)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return X_(r[XE(0,r.length-1,i=>X_(r[i]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),c=this.getScrollOffset();r==="auto"&&(r=n>=c+l?"end":"start"),r==="center"?n+=(i-l)/2:r==="end"&&(n-=l);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),l=this.getScrollOffset(),c=this.measurementsCache[n];if(!c)return;if(r==="auto")if(c.end>=l+i-this.options.scrollPaddingEnd)r="end";else if(c.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?c.end+this.options.scrollPaddingEnd:c.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,c.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{const l=this.getOffsetForAlignment(n,r),c=this.now();this.scrollState={index:null,align:r,behavior:i,startedAt:c,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:i="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const l=this.getOffsetForIndex(n,r);if(!l)return;const[c,a]=l,u=this.now();this.scrollState={index:n,align:a,behavior:i,startedAt:u,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getScrollOffset()+n,l=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var l;var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=(l=(n=r[r.length-1])==null?void 0:n.end)!=null?l:0;else{const c=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&c.some(u=>u===null);){const u=r[a];c[u.lane]===null&&(c[u.lane]=u.end),a--}i=Math.max(...c.filter(u=>u!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=r?r[0]:this.scrollState.lastTargetOffset,l=1,c=i!==this.scrollState.lastTargetOffset;if(!c&&xU(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,c&&(this.scrollState.lastTargetOffset=i,this.scrollState.behavior="auto",this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const XE=(t,e,n,r)=>{for(;t<=e;){const i=(t+e)/2|0,l=n(i);if(l<r)t=i+1;else if(l>r)e=i-1;else return i}return t>0?t-1:0};function RU({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const i=t.length-1,l=u=>t[u].start;if(t.length<=r)return{startIndex:0,endIndex:i};let c=XE(0,i,l,n),a=c;if(r===1)for(;a<i&&t[a].end<n+e;)a++;else if(r>1){const u=Array(r).fill(0);for(;a<i&&u.some(m=>m<n+e);){const m=t[a];u[m.lane]=m.end,a++}const d=Array(r).fill(n+e);for(;c>=0&&d.some(m=>m>=n);){const m=t[c];d[m.lane]=m.start,c--}c=Math.max(0,c-c%r),a=Math.min(i,a+(r-1-a%r))}return{startIndex:c,endIndex:a}}const eS=typeof document<"u"?R.useLayoutEffect:R.useEffect;function jU({useFlushSync:t=!0,...e}){const n=R.useReducer(()=>({}),{})[1],r={...e,onChange:(l,c)=>{var a;t&&c?el.flushSync(n):n(),(a=e.onChange)==null||a.call(e,l,c)}},[i]=R.useState(()=>new NU(r));return i.setOptions(r),eS(()=>i._didMount(),[]),eS(()=>i._willUpdate()),i}function TU(t){return jU({observeElementRect:CU,observeElementOffset:kU,scrollToFn:AU,...t})}function DU(t){const e=he.c(47),{message:n,textContent:r,children:i,isQueued:l,onRemove:c,onRevert:a,canRevert:u,onFork:d,canFork:m}=t,p=l===void 0?!1:l,g=u===void 0?!1:u,_=m===void 0?!1:m,[C,w]=R.useState(!1),[y,S]=R.useState(!1),[b,x]=R.useState(!1),k=n.role==="user";let j;e[0]!==r?(j=async()=>{const Q=r||"";await navigator.clipboard.writeText(Q),w(!0),setTimeout(()=>w(!1),2e3)},e[0]=r,e[1]=j):j=e[1];const N=j,D=k?"items-end":"items-start";let E;e[2]!==D?(E=Ae("flex flex-col gap-1 animate-slide-up min-w-0",D),e[2]=D,e[3]=E):E=e[3];const O=k?"mr-3":"ml-3";let L;e[4]!==O?(L=Ae("flex items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground",O),e[4]=O,e[5]=L):L=e[5];let z;e[6]!==_||e[7]!==g||e[8]!==C||e[9]!==N||e[10]!==p||e[11]!==k||e[12]!==n.role||e[13]!==d||e[14]!==a?(z=k?h.jsxs(h.Fragment,{children:[!p&&h.jsxs(h.Fragment,{children:[g&&a&&h.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>S(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Revert to this point",children:h.jsx(TN,{className:"size-3"})}),_&&d&&h.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>x(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Fork from this point",children:h.jsx(EA,{className:"size-3"})}),h.jsx(Te,{variant:"ghost",size:"icon",onClick:N,className:"size-5 text-muted-foreground hover:text-foreground",children:C?h.jsx(Vn,{className:"size-3"}):h.jsx(yc,{className:"size-3"})})]}),h.jsx(TS,{className:"size-3"}),n.role]}):h.jsxs(h.Fragment,{children:[h.jsx(P5,{className:"size-3"}),n.role,h.jsx(Te,{variant:"ghost",size:"icon",onClick:N,className:"size-5 text-muted-foreground hover:text-foreground",children:C?h.jsx(Vn,{className:"size-3"}):h.jsx(yc,{className:"size-3"})})]}),e[6]=_,e[7]=g,e[8]=C,e[9]=N,e[10]=p,e[11]=k,e[12]=n.role,e[13]=d,e[14]=a,e[15]=z):z=e[15];let H;e[16]!==L||e[17]!==z?(H=h.jsx("div",{className:L,children:z}),e[16]=L,e[17]=z,e[18]=H):H=e[18];const $=k?"max-w-[90%]":"max-w-full",q=p?"bg-muted border-2 border-dashed border-muted-foreground/30 opacity-80":k?"bg-primary text-primary-foreground rounded-br-md":"bg-card text-card-foreground border border-border rounded-bl-md";let G;e[19]!==$||e[20]!==q?(G=Ae("rounded-2xl px-4 py-3 relative group min-w-0 overflow-hidden",$,q),e[19]=$,e[20]=q,e[21]=G):G=e[21];let W;e[22]!==p||e[23]!==c?(W=p&&h.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 pb-2 border-b border-muted-foreground/20",children:[h.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[h.jsx(xS,{className:"size-3 animate-pulse"}),h.jsx("span",{children:"Pending"})]}),c&&h.jsx(Te,{variant:"ghost",size:"icon",onClick:c,className:"size-6 text-muted-foreground hover:text-destructive hover:bg-destructive/10",title:"Remove from queue",children:h.jsx(zn,{className:"size-3"})})]}),e[22]=p,e[23]=c,e[24]=W):W=e[24];let X;e[25]!==i?(X=h.jsx("div",{className:"min-w-0",children:i}),e[25]=i,e[26]=X):X=e[26];let Y;e[27]!==G||e[28]!==W||e[29]!==X?(Y=h.jsxs("div",{className:G,children:[W,X]}),e[27]=G,e[28]=W,e[29]=X,e[30]=Y):Y=e[30];let I;e[31]!==a?(I=()=>{a==null||a()},e[31]=a,e[32]=I):I=e[32];let M;e[33]!==y||e[34]!==I?(M=h.jsx(xg,{open:y,onOpenChange:S,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:I,variant:"destructive"}),e[33]=y,e[34]=I,e[35]=M):M=e[35];let P;e[36]!==d?(P=()=>{d==null||d()},e[36]=d,e[37]=P):P=e[37];let F;e[38]!==b||e[39]!==P?(F=h.jsx(xg,{open:b,onOpenChange:x,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:P}),e[38]=b,e[39]=P,e[40]=F):F=e[40];let B;return e[41]!==H||e[42]!==Y||e[43]!==M||e[44]!==F||e[45]!==E?(B=h.jsxs("div",{className:E,children:[H,Y,M,F]}),e[41]=H,e[42]=Y,e[43]=M,e[44]=F,e[45]=E,e[46]=B):B=e[46],B}const MU=cl.oneDark;function OU(t){var r;const e=(r=t.split(".").pop())==null?void 0:r.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"}[e||""]||e||"text"}const LU=R.memo(function(e){const n=he.c(28),{type:r,content:i,lineNumber:l,newLineNumber:c,language:a}=e,u=r==="added"&&"bg-green-500/20",d=r==="removed"&&"bg-red-500/20",m=r==="context"&&"bg-muted/30";let p;n[0]!==u||n[1]!==d||n[2]!==m?(p=Ae("flex font-mono text-xs",u,d,m),n[0]=u,n[1]=d,n[2]=m,n[3]=p):p=n[3];const g=p,_=r==="added"&&"text-green-400",C=r==="removed"&&"text-red-400",w=r==="context"&&"text-muted-foreground/50";let y;n[4]!==_||n[5]!==C||n[6]!==w?(y=Ae("font-bold w-4 select-none",_,C,w),n[4]=_,n[5]=C,n[6]=w,n[7]=y):y=n[7];const S=y,b=l!=null?l:"";let x;n[8]!==b?(x=h.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:b}),n[8]=b,n[9]=x):x=n[9];const k=c!=null?c:"";let j;n[10]!==k?(j=h.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:k}),n[10]=k,n[11]=j):j=n[11];const N=r==="added"&&"+",D=r==="removed"&&"-",E=r==="context"&&" ";let O;n[12]!==S||n[13]!==N||n[14]!==D||n[15]!==E?(O=h.jsxs("span",{className:S,children:[N,D,E]}),n[12]=S,n[13]=N,n[14]=D,n[15]=E,n[16]=O):O=n[16];let L;n[17]!==i||n[18]!==a?(L=h.jsx(Zf,{theme:MU,code:i,language:a,children:IU}),n[17]=i,n[18]=a,n[19]=L):L=n[19];let z;n[20]!==O||n[21]!==L?(z=h.jsxs("span",{className:"pl-2 flex-1 whitespace-pre flex",children:[O,L]}),n[20]=O,n[21]=L,n[22]=z):z=n[22];let H;return n[23]!==x||n[24]!==j||n[25]!==z||n[26]!==g?(H=h.jsxs("div",{className:g,children:[x,j,z]}),n[23]=x,n[24]=j,n[25]=z,n[26]=g,n[27]=H):H=n[27],H}),QE=R.memo(function(e){const n=he.c(33),{hunks:r,path:i,language:l,additions:c,deletions:a}=e,[u,d]=R.useState(!0);let m;n[0]!==i||n[1]!==l?(m=l||OU(i),n[0]=i,n[1]=l,n[2]=m):m=n[2];const p=m,g=qt(PU),_=zg(zU);let C;n[3]!==_||n[4]!==g||n[5]!==i?(C=()=>{_&&g({workspaceId:_.id,path:i,name:i.split("/").pop()||i})},n[3]=_,n[4]=g,n[5]=i,n[6]=C):C=n[6];const w=C;let y;n[7]!==u?(y=()=>d(!u),n[7]=u,n[8]=y):y=n[8];let S;n[9]!==u?(S=u?h.jsx(Za,{className:"size-3"}):h.jsx(Hr,{className:"size-3"}),n[9]=u,n[10]=S):S=n[10];let b;n[11]!==y||n[12]!==S?(b=h.jsx("button",{onClick:y,className:"px-1 py-1 hover:bg-muted rounded",children:S}),n[11]=y,n[12]=S,n[13]=b):b=n[13];let x;n[14]===Symbol.for("react.memo_cache_sentinel")?(x=h.jsx(Mc,{className:"size-3"}),n[14]=x):x=n[14];let k;n[15]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(bc,{className:"size-2.5 opacity-0 group-hover/path:opacity-100 transition-opacity"}),n[15]=k):k=n[15];let j;n[16]!==w||n[17]!==i?(j=h.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-1 font-mono pr-2 hover:text-foreground transition-colors cursor-pointer rounded px-1 py-0.5 -mx-1 hover:bg-muted",title:"Open file preview",children:[i,k]}),n[16]=w,n[17]=i,n[18]=j):j=n[18];let N;n[19]!==c||n[20]!==a?(N=c!==void 0&&a!==void 0&&h.jsxs("span",{className:"ml-auto mr-2 text-muted-foreground",children:["+",c," -",a]}),n[19]=c,n[20]=a,n[21]=N):N=n[21];let D;n[22]!==b||n[23]!==j||n[24]!==N?(D=h.jsxs("div",{className:"group/path flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[b,x,j,N]}),n[22]=b,n[23]=j,n[24]=N,n[25]=D):D=n[25];let E;n[26]!==u||n[27]!==r||n[28]!==p?(E=u&&h.jsx("div",{style:{backgroundColor:"#282c34"},children:r.map((L,z)=>h.jsx("div",{className:"divide-y divide-white/5",children:L.changes.map((H,$)=>h.jsx(LU,{...H,language:p},$))},z))}),n[26]=u,n[27]=r,n[28]=p,n[29]=E):E=n[29];let O;return n[30]!==D||n[31]!==E?(O=h.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:h.jsxs("div",{children:[D,E]})}),n[30]=D,n[31]=E,n[32]=O):O=n[32],O});function IU(t){const{tokens:e,getTokenProps:n}=t;return h.jsx(h.Fragment,{children:e.map((r,i)=>h.jsx("span",{children:r.map((l,c)=>h.jsx("span",{...n({token:l})},c))},i))})}function PU(t){return t.openFilePreview}function zU(t){return t.activeWorkspace}const BU=cl.oneDark,FU=20;function HU(t){var r;const e=(r=t.split(".").pop())==null?void 0:r.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"}[e||""]||e||"text"}const $U=R.memo(t=>{const e=he.c(46),{content:n,path:r,language:i,created:l,highlightLines:c}=t;let a;e[0]!==c?(a=c===void 0?[]:c,e[0]=c,e[1]=a):a=e[1];const u=a,[d,m]=R.useState(!1),p=qt(UU),g=zg(VU);let _;e[2]!==g||e[3]!==p||e[4]!==r?(_=()=>{g&&p({workspaceId:g.id,path:r,name:r.split("/").pop()||r})},e[2]=g,e[3]=p,e[4]=r,e[5]=_):_=e[5];const C=_;let w;e[6]!==i||e[7]!==r?(w=i||HU(r),e[6]=i,e[7]=r,e[8]=w):w=e[8];const y=w;let S;e[9]!==u?(S=new Set(u),e[9]=u,e[10]=S):S=e[10];const b=S;let x;e[11]!==n?(x=n.split(`
629
+ `),e[11]=n,e[12]=x):x=e[12];const k=x.length;let j;e[13]!==d?(j=()=>m(!d),e[13]=d,e[14]=j):j=e[14];let N;e[15]!==d?(N=d?h.jsx(Za,{className:"size-3"}):h.jsx(Hr,{className:"size-3"}),e[15]=d,e[16]=N):N=e[16];let D;e[17]!==j||e[18]!==N?(D=h.jsx("button",{onClick:j,className:"flex items-center gap-2 px-2 py-1 hover:bg-muted",children:N}),e[17]=j,e[18]=N,e[19]=D):D=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=h.jsx(Mc,{className:"size-3"}),e[20]=E):E=e[20];let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=h.jsx(bc,{className:"size-2.5 opacity-0 group-hover/path:opacity-100 transition-opacity"}),e[21]=O):O=e[21];let L;e[22]!==C||e[23]!==r?(L=h.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-1 font-mono pr-2 hover:text-foreground transition-colors cursor-pointer rounded px-1 py-0.5 -mx-1 hover:bg-muted",title:"Open file preview",children:[r,O]}),e[22]=C,e[23]=r,e[24]=L):L=e[24];let z;e[25]!==d||e[26]!==k?(z=!d&&h.jsxs("span",{className:"text-xs text-muted-foreground/70",children:[k," lines"]}),e[25]=d,e[26]=k,e[27]=z):z=e[27];let H;e[28]!==l?(H=l===!1?h.jsxs("span",{className:"flex items-center gap-1 text-warning ml-auto mr-2",children:[h.jsx(To,{className:"size-3"}),"Overwrote"]}):h.jsxs("span",{className:"flex items-center gap-1 text-success ml-auto mr-2",children:[h.jsx(Vn,{className:"size-3"}),"Created"]}),e[28]=l,e[29]=H):H=e[29];let $;e[30]!==L||e[31]!==z||e[32]!==H||e[33]!==D?($=h.jsxs("div",{className:"group/path flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[D,E,L,z,H]}),e[30]=L,e[31]=z,e[32]=H,e[33]=D,e[34]=$):$=e[34];let q;e[35]===Symbol.for("react.memo_cache_sentinel")?(q={backgroundColor:"#282c34"},e[35]=q):q=e[35];let G;e[36]!==d||e[37]!==b?(G=Y=>{const{tokens:I,getTokenProps:M}=Y,P=d?I:I.slice(0,FU);return h.jsx(h.Fragment,{children:P.map((F,B)=>h.jsxs("div",{className:`flex font-mono text-xs ${b.has(B+1)?"bg-yellow-500/20":""}`,children:[h.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:B+1}),h.jsx("span",{className:"pl-2 flex-1 whitespace-pre",children:F.map((Q,J)=>h.jsx("span",{...M({token:Q})},J))})]},B))})},e[36]=d,e[37]=b,e[38]=G):G=e[38];let W;e[39]!==n||e[40]!==y||e[41]!==G?(W=h.jsx("div",{style:q,children:h.jsx(Zf,{theme:BU,code:n,language:y,children:G})}),e[39]=n,e[40]=y,e[41]=G,e[42]=W):W=e[42];let X;return e[43]!==$||e[44]!==W?(X=h.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:h.jsxs("div",{children:[$,W]})}),e[43]=$,e[44]=W,e[45]=X):X=e[45],X});function UU(t){return t.openFilePreview}function VU(t){return t.activeWorkspace}function qU(t){const e=he.c(3),{message:n}=t,r=n===void 0?"Success":n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(Dc,{className:"size-4"}),e[0]=i):i=e[0];let l;return e[1]!==r?(l=h.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i,h.jsx("span",{className:"break-all",children:r})]}),e[1]=r,e[2]=l):l=e[2],l}const WU={edit:gA,plus:Qr,trash:Br,search:Hg};function GU(t){const e=he.c(7),{text:n}=t,[r,i]=R.useState(!1);let l;e[0]!==n?(l=async()=>{await navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),1500)},e[0]=n,e[1]=l):l=e[1];const c=l;let a;e[2]!==r?(a=r?h.jsx("span",{className:"text-success text-xs",children:"Copied!"}):h.jsx(yc,{className:"size-3"}),e[2]=r,e[3]=a):a=e[3];let u;return e[4]!==c||e[5]!==a?(u=h.jsx("button",{onClick:c,className:"text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:a}),e[4]=c,e[5]=a,e[6]=u):u=e[6],u}function KU(t){const e=he.c(16),{title:n,groups:r,files:i,total:l}=t;let c;e[0]!==i?(c=i||[],e[0]=i,e[1]=c):c=e[1];let a;e[2]!==c?(a={label:"Files",files:c,icon:void 0},e[2]=c,e[3]=a):a=e[3];const u=a;let d;e[4]!==u||e[5]!==i||e[6]!==r?(d=r||(i?[u]:[]),e[4]=u,e[5]=i,e[6]=r,e[7]=d):d=e[7];const m=d;if(m.length===0)return null;let p;e[8]!==n||e[9]!==l?(p=n&&h.jsxs("div",{className:"text-sm font-medium text-foreground",children:[n,l!==void 0&&h.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",l," files)"]})]}),e[8]=n,e[9]=l,e[10]=p):p=e[10];let g;e[11]!==m?(g=m.map(YU),e[11]=m,e[12]=g):g=e[12];let _;return e[13]!==p||e[14]!==g?(_=h.jsxs("div",{className:"flex flex-col gap-3",children:[p,g]}),e[13]=p,e[14]=g,e[15]=_):_=e[15],_}function YU(t,e){return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.icon&&h.jsx("span",{className:"flex items-center",children:(()=>{const n=WU[t.icon];return h.jsx(n,{className:"size-3"})})()}),h.jsx("span",{children:t.label}),h.jsxs("span",{className:"text-muted-foreground/50",children:["(",t.files.length,")"]})]}),h.jsx("div",{className:"flex flex-col gap-0.5 pl-5",children:t.files.map(XU)})]},e)}function XU(t,e){return h.jsxs("div",{className:"flex items-center gap-2 text-xs group",children:[h.jsx(Mc,{className:"size-3 text-muted-foreground shrink-0"}),h.jsx("span",{className:"font-mono text-foreground/80 truncate",children:t.path}),t.line!==void 0&&h.jsxs("span",{className:"text-muted-foreground shrink-0",children:[":",t.line]}),t.action&&h.jsx("span",{className:Ae("text-xs px-1 rounded shrink-0",t.action==="created"&&"bg-success/20 text-success",t.action==="modified"&&"bg-warning/20 text-warning",t.action==="deleted"&&"bg-destructive/20 text-destructive"),children:t.action}),h.jsx(GU,{text:t.path})]},e)}function QU(t){const e=he.c(15),{command:n,stdout:r,stderr:i,exitCode:l}=t,c=l===0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx("span",{className:"text-muted-foreground",children:"$ "}),e[0]=a):a=e[0];let u;e[1]!==n?(u=h.jsxs("div",{className:"font-mono text-xs text-muted-foreground truncate flex-1 mr-2",children:[a,h.jsx("span",{className:"text-foreground",children:n})]}),e[1]=n,e[2]=u):u=e[2];const d=`text-xs font-mono px-2 py-0.5 rounded ${c?"bg-muted text-muted-foreground":"bg-red-500/20 text-red-400"}`;let m;e[3]!==l||e[4]!==d?(m=h.jsxs("span",{className:d,children:["[",l,"]"]}),e[3]=l,e[4]=d,e[5]=m):m=e[5];let p;e[6]!==u||e[7]!==m?(p=h.jsxs("div",{className:"bg-muted px-3 py-2 flex items-center justify-between",children:[u,m]}),e[6]=u,e[7]=m,e[8]=p):p=e[8];let g;e[9]!==i||e[10]!==r?(g=(r||i)&&h.jsxs("div",{className:"bg-black px-3 py-2 font-mono text-xs overflow-x-auto",children:[r&&h.jsx("pre",{className:"text-gray-300 whitespace-pre-wrap",children:r}),i&&h.jsx("pre",{className:"text-red-400 whitespace-pre-wrap mt-1",children:i})]}),e[9]=i,e[10]=r,e[11]=g):g=e[11];let _;return e[12]!==p||e[13]!==g?(_=h.jsxs("div",{className:"visualization-container border border-white/10 rounded-md overflow-hidden",children:[p,g]}),e[12]=p,e[13]=g,e[14]=_):_=e[14],_}const ZU={pending:{icon:tA,color:"text-muted-foreground"},in_progress:{icon:Wt,color:"text-warning",animate:!0},completed:{icon:Dc,color:"text-success"},cancelled:{icon:lf,color:"text-destructive"}},JU={high:{label:"high",className:"bg-destructive/20 text-destructive"},medium:{label:"",className:""},low:{label:"low",className:"text-muted-foreground"}};function eV(t){const e=he.c(13),{title:n,items:r}=t;if(r.length===0)return null;let i;e[0]!==r?(i=r.filter(sV),e[0]=r,e[1]=i):i=e[1];const l=i.length;r.filter(rV),r.filter(nV);let c;e[2]!==l||e[3]!==r.length||e[4]!==n?(c=(n||r.length>0)&&h.jsxs("div",{className:"text-sm font-medium text-foreground",children:[n||"Todo List",h.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",r.length,")"]}),l>0&&h.jsxs("span",{className:"ml-2 text-success text-xs",children:[l," completed"]})]}),e[2]=l,e[3]=r.length,e[4]=n,e[5]=c):c=e[5];let a;e[6]!==r?(a=r.map(tV),e[6]=r,e[7]=a):a=e[7];let u;e[8]!==a?(u=h.jsx("div",{className:"flex flex-col gap-1 w-full",children:a}),e[8]=a,e[9]=u):u=e[9];let d;return e[10]!==c||e[11]!==u?(d=h.jsxs("div",{className:"flex flex-col gap-3 w-full overflow-hidden",children:[c,u]}),e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function tV(t,e){const n=ZU[t.status],r=n.icon,i=JU[t.priority];return h.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[h.jsx(r,{className:Ae("size-4 shrink-0",n.color,n.animate&&"animate-spin")}),h.jsx("span",{className:Ae("flex-1 break-all",t.status==="completed"&&"line-through text-muted-foreground",t.status==="cancelled"&&"text-muted-foreground"),children:t.content}),i.label&&t.priority==="high"&&h.jsx("span",{className:Ae("text-xs px-1.5 py-0.5 rounded shrink-0",i.className),children:i.label}),t.priority==="low"&&t.status!=="completed"&&t.status!=="cancelled"&&h.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:i.label})]},e)}function nV(t){return t.status==="pending"}function rV(t){return t.status==="in_progress"}function sV(t){return t.status==="completed"}const iV=R.memo(function(e){const n=he.c(38),{visualization:r}=e;if(!r)return null;switch(r.type){case"diff":{let i;return n[0]!==r.additions||n[1]!==r.deletions||n[2]!==r.hunks||n[3]!==r.language||n[4]!==r.matchInfo||n[5]!==r.path?(i=h.jsx(QE,{path:r.path,hunks:r.hunks,language:r.language,additions:r.additions,deletions:r.deletions,matchInfo:r.matchInfo}),n[0]=r.additions,n[1]=r.deletions,n[2]=r.hunks,n[3]=r.language,n[4]=r.matchInfo,n[5]=r.path,n[6]=i):i=n[6],i}case"diffs":{let i;n[7]!==r.items?(i=r.items.map(oV),n[7]=r.items,n[8]=i):i=n[8];let l;return n[9]!==i?(l=h.jsx("div",{className:"space-y-3",children:i}),n[9]=i,n[10]=l):l=n[10],l}case"code":{let i;return n[11]!==r.content||n[12]!==r.created||n[13]!==r.highlightLines||n[14]!==r.language||n[15]!==r.path?(i=h.jsx($U,{path:r.path,content:r.content,language:r.language,created:r.created,highlightLines:r.highlightLines}),n[11]=r.content,n[12]=r.created,n[13]=r.highlightLines,n[14]=r.language,n[15]=r.path,n[16]=i):i=n[16],i}case"file-list":{let i;return n[17]!==r.files||n[18]!==r.groups||n[19]!==r.title||n[20]!==r.total?(i=h.jsx(KU,{title:r.title,groups:r.groups,files:r.files,total:r.total}),n[17]=r.files,n[18]=r.groups,n[19]=r.title,n[20]=r.total,n[21]=i):i=n[21],i}case"table":{let i;n[22]!==r.rows?(i=JSON.stringify(r.rows,null,2),n[22]=r.rows,n[23]=i):i=n[23];let l;return n[24]!==i?(l=h.jsx("pre",{className:"text-xs bg-muted/50 border rounded-md p-2 overflow-x-auto",children:i}),n[24]=i,n[25]=l):l=n[25],l}case"markdown":{let i;return n[26]!==r.content?(i=h.jsx("div",{className:"prose prose-sm dark:prose-invert",children:r.content}),n[26]=r.content,n[27]=i):i=n[27],i}case"none":{let i;return n[28]!==r.message?(i=h.jsx(qU,{message:r.message}),n[28]=r.message,n[29]=i):i=n[29],i}case"shell-output":{let i;return n[30]!==r.command||n[31]!==r.exitCode||n[32]!==r.stderr||n[33]!==r.stdout?(i=h.jsx(QU,{command:r.command,stdout:r.stdout,stderr:r.stderr,exitCode:r.exitCode}),n[30]=r.command,n[31]=r.exitCode,n[32]=r.stderr,n[33]=r.stdout,n[34]=i):i=n[34],i}case"todo-list":{let i;return n[35]!==r.items||n[36]!==r.title?(i=h.jsx(eV,{title:r.title,items:r.items}),n[35]=r.items,n[36]=r.title,n[37]=i):i=n[37],i}default:return null}});function oV(t,e){return h.jsx(QE,{path:t.path,hunks:t.hunks,language:t.language,additions:t.additions,deletions:t.deletions,matchInfo:t.matchInfo},`${t.path}-${e}`)}const tS=1536,nS=R.memo(function(e){const n=he.c(16),{content:r,className:i}=e,[l,c]=R.useState(!1);let a;n[0]!==r?(a=new Blob([r]),n[0]=r,n[1]=a):a=n[1];const u=a.size,d=u>tS,m=d?r.slice(0,tS)+`
630
+ ...`:null;if(!d){let x;return n[2]!==i||n[3]!==r?(x=h.jsx("pre",{className:i,children:r}),n[2]=i,n[3]=r,n[4]=x):x=n[4],x}let p;n[5]!==u?(p=u>1048576?`${(u/1048576).toFixed(1)} MB`:u>1024?`${(u/1024).toFixed(1)} KB`:`${u} bytes`,n[5]=u,n[6]=p):p=n[6];const g=p,_=l?r:m;let C;n[7]!==i||n[8]!==_?(C=h.jsx("pre",{className:i,children:_}),n[7]=i,n[8]=_,n[9]=C):C=n[9];let w;n[10]===Symbol.for("react.memo_cache_sentinel")?(w=()=>c(dV),n[10]=w):w=n[10];const y=l?"Show less":`Show full output (${g})`;let S;n[11]!==y?(S=h.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground mt-1 transition-colors cursor-pointer",onClick:w,children:y}),n[11]=y,n[12]=S):S=n[12];let b;return n[13]!==C||n[14]!==S?(b=h.jsxs("div",{children:[C,S]}),n[13]=C,n[14]=S,n[15]=b):b=n[15],b});function aV(t){switch(t){case"pending":return h.jsx(xS,{className:"size-3 text-warning"});case"running":return h.jsx(Wt,{className:"size-3 text-warning animate-spin"});case"completed":return h.jsx(Dc,{className:"size-3 text-success"});case"error":return h.jsx(lf,{className:"size-3 text-destructive"});case"interrupted":return h.jsx(ES,{className:"size-3 text-warning"});default:return null}}function lV(t){if(t&&typeof t=="object"&&"_visualization"in t)return t._visualization}const cV=(t,e)=>{if(t.part!==e.part||t.onNavigateToSubagent!==e.onNavigateToSubagent)return!1;if(t.part.state.status!=="pending")return!0;const r=t.pendingPermissions.find(l=>l.toolCallId===t.part.callId),i=e.pendingPermissions.find(l=>l.toolCallId===e.part.callId);return r===i},uV=R.memo(function({part:e,pendingPermissions:n,onPermissionResponse:r,onNavigateToSubagent:i}){var x;const[l,c]=R.useState(!1),[a,u]=R.useState(!1),d=e.state,m=d.status,p=R.useMemo(()=>{if(!l)return"";try{return JSON.stringify(d.input,null,2)}catch{return String(d.input)}},[d.input,l]),g=R.useMemo(()=>!l||m!=="completed"||!("output"in d)?null:typeof d.output=="string"?d.output:JSON.stringify(d.output,null,2),[m,d,l]),_=m==="completed"&&"output"in d?lV(d.output):void 0,C=m==="pending"?n.find(k=>k.toolCallId===e.callId):void 0,w=C?typeof((x=C.args)==null?void 0:x.command)=="string"?C.args.command:JSON.stringify(C.args,null,2):null;let y=null;if(e.name==="task"){if("childSessionId"in d&&d.childSessionId)y=d.childSessionId;else if(m==="completed"&&"output"in d){const j=(typeof d.output=="string"?d.output:"").match(/task_id:\s*([a-f0-9-]{36})/i);j&&(y=j[1])}}const S=async()=>{if("output"in d){const k=typeof d.output=="string"?d.output:JSON.stringify(d.output,null,2);await navigator.clipboard.writeText(k),u(!0),setTimeout(()=>u(!1),2e3)}},b=(()=>{try{const k=JSON.stringify(d.input);return k.length>50?k.slice(0,47)+"...":k}catch{return String(d.input)}})();return h.jsxs("div",{className:"my-1",children:[h.jsxs(Ks,{open:l,onOpenChange:c,children:[h.jsx($i,{asChild:!0,children:h.jsxs("div",{className:"flex items-center gap-2 py-1 cursor-pointer hover:text-foreground transition-colors text-muted-foreground",children:[l?h.jsx(Za,{className:"size-4 text-muted-foreground"}):h.jsx(Hr,{className:"size-4 text-muted-foreground"}),h.jsx(UN,{className:"size-3"}),h.jsx("span",{className:"text-xs truncate max-w-[120px] sm:max-w-none",children:e.name}),!l&&h.jsx("span",{className:"text-xs text-muted-foreground font-mono truncate flex-1 min-w-0 sm:max-w-[200px] hidden sm:block",children:b}),h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[aV(m),y&&i&&h.jsxs(Te,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 sm:w-auto sm:px-2",onClick:k=>{k.stopPropagation(),i(y)},title:"View session",children:[h.jsx(bc,{className:"size-3"}),h.jsx("span",{className:"hidden sm:inline ml-1",children:"View"})]})]})]})}),l&&h.jsx(Ys,{children:h.jsxs("div",{className:"pl-5 pb-2 flex flex-col gap-2",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Input"}),h.jsx(nS,{content:p,className:"text-xs bg-background border rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words"})]}),(m==="running"||m==="completed")&&y&&i&&h.jsxs(Te,{variant:"outline",className:"w-full",size:"sm",onClick:()=>i(y),children:[h.jsx(bc,{className:"size-4","data-icon":"inline-start"}),m==="running"?"Watch Subagent":"View Session"]}),m==="completed"&&g!==null&&h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:"Output"}),h.jsx(Te,{variant:"ghost",size:"icon",onClick:S,className:"size-6",children:a?h.jsx(Vn,{className:"size-3 text-success"}):h.jsx(yc,{className:"size-3"})})]}),h.jsx(nS,{content:g,className:"text-xs bg-success/10 border border-success/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words"})]}),m==="error"&&"error"in d&&h.jsxs("div",{children:[h.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Error"}),h.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:d.error})]})]})})]}),m==="pending"&&C&&h.jsxs("div",{className:"border border-warning/50 bg-warning/10 rounded-md p-3 flex flex-col gap-3 mt-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ua,{className:"size-4 text-warning"}),h.jsx("span",{className:"text-sm font-medium",children:"Permission Required"})]}),C.message&&h.jsx("p",{className:"text-sm",children:C.message}),C.dangerous&&h.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive font-medium",children:[h.jsx(Ua,{className:"size-4"}),"This operation is marked as dangerous"]}),w&&h.jsxs(Ks,{children:[h.jsx($i,{asChild:!0,children:h.jsxs("button",{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors w-full text-left",children:[h.jsx(Hr,{className:"size-3"}),h.jsx("span",{className:"uppercase tracking-wide",children:"Command"})]})}),h.jsx(Ys,{children:h.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 mt-1 overflow-x-auto whitespace-pre-wrap break-words overflow-wrap-break",children:w})})]}),h.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[h.jsx(Te,{variant:"outline",size:"sm",onClick:()=>r(e.callId,!1,!1),children:"Deny"}),h.jsx(Te,{variant:"secondary",size:"sm",onClick:()=>r(e.callId,!0,!1),children:"Approve"}),h.jsx(Te,{size:"sm",onClick:()=>r(e.callId,!0,!0),children:"Always Allow"})]})]}),m==="completed"&&_&&h.jsx("div",{className:"mt-2",children:h.jsx(iV,{visualization:_})})]})},cV);function dV(t){return!t}const eg=60,rS=300,Ro=16;function sS(t){if(t.length===0)return!1;const e=t[t.length-1];return Pg(e.message)&&e.message.status==="streaming"}function iS(t){return t.filter(e=>e.type==="text").map(e=>e.text).join("")}function fV(t,e){const n=e.findIndex(r=>r.message.id===t);if(n<=0)return null;for(let r=n-1;r>=0;r--){const i=e[r];if(i.message.role==="assistant"&&i.message.status!=="streaming")return i.message.id}return null}function hV(){const t=he.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground bg-muted rounded-lg px-3 py-2 border border-border shadow-sm",children:[h.jsx(kS,{className:"size-4 animate-pulse"}),h.jsx("span",{children:"Compacting conversation..."})]}),t[0]=e):e=t[0],e}function pV(){const t=he.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-green-700 dark:text-green-400 bg-green-500/15 rounded-lg px-3 py-2 border border-green-500/30 shadow-sm",children:[h.jsx(Z5,{className:"size-4"}),h.jsx("span",{children:"Compaction complete"})]}),t[0]=e):e=t[0],e}function mV(t){const e=he.c(8),{message:n,textContent:r,onRetry:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs("div",{className:"flex items-center gap-1.5 text-xs uppercase tracking-wide text-destructive ml-3",children:[h.jsx(Ua,{className:"size-3"}),"Compaction Failed"]}),e[0]=l):l=e[0];const c=r||n.error||"Compaction failed. The conversation could not be summarized.";let a;e[1]!==c?(a=h.jsx("p",{className:"text-sm text-destructive/90",children:c}),e[1]=c,e[2]=a):a=e[2];let u;e[3]!==i?(u=i&&h.jsxs(Te,{variant:"outline",size:"sm",onClick:i,className:"mt-2 h-7 text-xs gap-1.5",children:[h.jsx(AS,{className:"size-3"}),"Retry"]}),e[3]=i,e[4]=u):u=e[4];let d;return e[5]!==a||e[6]!==u?(d=h.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[l,h.jsxs("div",{className:"rounded-2xl px-4 py-3 max-w-full bg-destructive/10 border border-destructive/30 rounded-bl-md",children:[a,u]})]}),e[5]=a,e[6]=u,e[7]=d):d=e[7],d}function gV(t,e){var r;return(t==null?void 0:t.split("/").pop())||((r=e==null?void 0:e.split(".").pop())==null?void 0:r.toLowerCase())||""}function vV(t){const e=he.c(15),{part:n}=t,[r,i]=R.useState(!1),l=n.overflow?"overflow":n.auto?"auto":"manual";let c;e[0]!==r?(c=()=>i(!r),e[0]=r,e[1]=c):c=e[1];let a;e[2]!==r?(a=r?h.jsx(Za,{className:"size-3"}):h.jsx(Hr,{className:"size-3"}),e[2]=r,e[3]=a):a=e[3];const u=l==="overflow"?"Context overflow":l==="auto"?"Auto":"Manual";let d;e[4]!==u?(d=h.jsxs("span",{className:"border-b border-dashed border-muted-foreground/40 pb-px",children:[u," compaction"]}),e[4]=u,e[5]=d):d=e[5];let m;e[6]!==c||e[7]!==a||e[8]!==d?(m=h.jsxs("button",{onClick:c,className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[a,d]}),e[6]=c,e[7]=a,e[8]=d,e[9]=m):m=e[9];let p;e[10]!==r?(p=r&&h.jsx("div",{className:"mt-2 text-xs text-muted-foreground italic",children:"Summary available in the assistant message below"}),e[10]=r,e[11]=p):p=e[11];let g;return e[12]!==m||e[13]!==p?(g=h.jsxs("div",{className:"flex flex-col items-center py-3",children:[m,p]}),e[12]=m,e[13]=p,e[14]=g):g=e[14],g}const yV=R.memo(function(e){const n=he.c(15),{parts:r,pendingPermissions:i,onPermissionResponse:l,onNavigateToSubagent:c,inverted:a,serverUrl:u}=e,d=a===void 0?!1:a;let m;if(n[0]!==d||n[1]!==c||n[2]!==l||n[3]!==r||n[4]!==i||n[5]!==u){const g=[...r].sort(_V);let _;n[7]!==d||n[8]!==c||n[9]!==l||n[10]!==i||n[11]!==u?(_=C=>{switch(C.type){case"text":return h.jsx("div",{className:"min-w-0",children:h.jsx(KE,{inverted:d,children:C.text||"..."})},C.id);case"reasoning":return h.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:C.text},C.id);case"tool":return h.jsx(uV,{part:C,pendingPermissions:i,onPermissionResponse:l,onNavigateToSubagent:c},C.id);case"image":{const w=u?Xn(u,C.url):C.url;return h.jsx("img",{src:w,alt:"",className:Ae("max-w-full max-h-64 rounded-xl mt-2 object-contain",d&&"ring-2 ring-white/20")},C.id)}case"file":{const w=u?Xn(u,C.url):C.url,y=gV(C.mimeType,C.filename),S=C.filename||"",b=S.length>30?S.slice(0,27)+"...":S||"unnamed";return h.jsxs("a",{href:w,className:Ae("mt-2 p-2 rounded-lg text-sm flex items-center gap-2 transition-colors",d?"bg-white/15 hover:bg-white/25 text-primary-foreground":"bg-muted hover:bg-accent"),target:"_blank",rel:"noopener noreferrer",children:[h.jsx(Pr,{className:"size-4 shrink-0"}),h.jsx("span",{className:"truncate",children:b}),y&&h.jsx("span",{className:Ae("px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide ml-auto shrink-0",d?"bg-white/25 text-primary-foreground":"bg-secondary text-secondary-foreground"),children:y}),h.jsx(lA,{className:"size-3.5 shrink-0 opacity-60"})]},C.id)}default:return null}},n[7]=d,n[8]=c,n[9]=l,n[10]=i,n[11]=u,n[12]=_):_=n[12],m=g.map(_),n[0]=d,n[1]=c,n[2]=l,n[3]=r,n[4]=i,n[5]=u,n[6]=m}else m=n[6];let p;return n[13]!==m?(p=h.jsx(h.Fragment,{children:m}),n[13]=m,n[14]=p):p=n[14],p},(t,e)=>{if(t.parts!==e.parts||t.inverted!==e.inverted||t.onPermissionResponse!==e.onPermissionResponse||t.onNavigateToSubagent!==e.onNavigateToSubagent||t.serverUrl!==e.serverUrl)return!1;if(!t.parts.some(c=>c.type==="tool"&&c.state.status==="pending"))return!0;const r=new Set(t.parts.filter(c=>c.type==="tool").map(c=>c.callId)),i=t.pendingPermissions.filter(c=>r.has(c.toolCallId)),l=e.pendingPermissions.filter(c=>r.has(c.toolCallId));if(i.length!==l.length)return!1;for(let c=0;c<i.length;c++)if(i[c].toolCallId!==l[c].toolCallId)return!1;return!0}),bV=R.memo(function(e){const n=he.c(46),{item:r,messagesWithParts:i,sessionId:l,pendingPermissions:c,onPermissionResponse:a,onNavigateToSubagent:u,onRemoveFromQueue:d,onRevert:m,onFork:p,isMainActiveSession:g,isCompacting:_,onCompact:C,serverUrl:w}=e,y=g===void 0?!1:g,S=_===void 0?!1:_;let b;n[0]!==r.parts?(b=r.parts.find(SV),n[0]=r.parts,n[1]=b):b=n[1];const x=b;if(Pg(r.message)&&r.message.mode==="compact_failed"){const X=r.message;let Y;n[2]!==r.parts?(Y=iS(r.parts),n[2]=r.parts,n[3]=Y):Y=n[3];const I=y&&!S?C:void 0;let M;return n[4]!==X||n[5]!==Y||n[6]!==I?(M=h.jsx(mV,{message:X,textContent:Y,onRetry:I}),n[4]=X,n[5]=Y,n[6]=I,n[7]=M):M=n[7],M}if(x){let X;return n[8]!==x?(X=h.jsx(vV,{part:x}),n[8]=x,n[9]=X):X=n[9],X}const j=!r.isQueued&&r.message.role==="user";let N;n[10]!==j||n[11]!==r.message||n[12]!==i?(N=j?fV(r.message.id,i):null,n[10]=j,n[11]=r.message,n[12]=i,n[13]=N):N=n[13];const D=N,E=r.message;let O;n[14]!==r.parts?(O=iS(r.parts),n[14]=r.parts,n[15]=O):O=n[15];let L;n[16]!==r.isQueued||n[17]!==r.queueId||n[18]!==d?(L=r.isQueued?()=>d(r.queueId):void 0,n[16]=r.isQueued,n[17]=r.queueId,n[18]=d,n[19]=L):L=n[19];const z=j&&D!==null;let H;n[20]!==m||n[21]!==D||n[22]!==l?(H=D?()=>m==null?void 0:m(l,D):void 0,n[20]=m,n[21]=D,n[22]=l,n[23]=H):H=n[23];const $=j&&D!==null;let q;n[24]!==r.message||n[25]!==p||n[26]!==D||n[27]!==l?(q=D?()=>p==null?void 0:p(l,r.message.id):void 0,n[24]=r.message,n[25]=p,n[26]=D,n[27]=l,n[28]=q):q=n[28];let G;n[29]!==r.message||n[30]!==r.parts||n[31]!==u||n[32]!==a||n[33]!==c||n[34]!==w?(G=r.parts.length===0?h.jsx("span",{className:"opacity-50",children:"..."}):h.jsx(yV,{parts:r.parts,pendingPermissions:c,onPermissionResponse:a,onNavigateToSubagent:u,inverted:r.message.role==="user",serverUrl:w}),n[29]=r.message,n[30]=r.parts,n[31]=u,n[32]=a,n[33]=c,n[34]=w,n[35]=G):G=n[35];let W;return n[36]!==r.isQueued||n[37]!==r.message||n[38]!==$||n[39]!==q||n[40]!==G||n[41]!==O||n[42]!==L||n[43]!==z||n[44]!==H?(W=h.jsx(DU,{message:E,textContent:O,isQueued:r.isQueued,onRemove:L,canRevert:z,onRevert:H,canFork:$,onFork:q,children:G}),n[36]=r.isQueued,n[37]=r.message,n[38]=$,n[39]=q,n[40]=G,n[41]=O,n[42]=L,n[43]=z,n[44]=H,n[45]=W):W=n[45],W});function xV({displayItems:t,messagesWithParts:e,sessionId:n,sessionStatus:r,pendingPermissions:i,isCompacting:l=!1,compactionSuccess:c=!1,onClearCompactionSuccess:a,onPermissionResponse:u,onNavigateToSubagent:d,onRemoveFromQueue:m,onRevert:p,onFork:g,onCompact:_,isMainActiveSession:C=!1,autoFollow:w=!0,onAutoScrollChange:y,scrollToBottomRef:S,serverUrl:b}){var B,Q;const x=R.useRef(null),[k,j]=R.useState(!1),N=R.useRef(w),D=R.useRef(t.length),E=R.useRef(0),O=R.useRef(!1),L=R.useRef(!1),z=R.useRef(""),H=R.useCallback(J=>{if(J.length===0)return"";const ee=J[J.length-1],V=ee.parts.filter(ae=>ae.type==="text").reduce((ae,se)=>ae+se.text.length,0),te=ee.message.id,re=Pg(ee.message)?ee.message.status:"n/a";return`${te}:${re}:${ee.parts.length}:${V}`},[]),$=R.useRef(null),q=R.useRef(null),G=R.useRef(new Map),W=R.useRef(t);W.current=t;const X=R.useCallback(J=>{const ee=W.current[J];if(!ee)return eg+Ro;if(ee.message.role==="assistant"){let V=100;return ee.parts.some(ae=>{var se,_e;return ae.type==="text"&&((se=ae.text)==null?void 0:se.includes("```"))||ae.type==="tool"&&((_e=ae.state.input)==null?void 0:_e.command)})&&(V=180),ee.parts.some(ae=>ae.type==="tool")&&(V=Math.max(V,150)),ee.parts.some(ae=>ae.type==="compaction")&&(V=60),ee.message.mode==="compact_failed"&&(V=100),Math.min(Math.max(V+Ro,eg+Ro),rS+Ro)}const K=ee.parts.length>1?80:60;return Math.min(Math.max(K+Ro,eg+Ro),rS+Ro)},[]);R.useLayoutEffect(()=>{const J=x.current;if(!J)return;const ee=requestAnimationFrame(()=>{J.querySelectorAll("[data-index]").forEach(V=>{const te=V.getAttribute("data-index");if(te===null)return;const re=parseInt(te,10);G.current.set(re,V.offsetHeight)})});return()=>cancelAnimationFrame(ee)},[t.length]);const Y=R.useRef(null);R.useLayoutEffect(()=>{const J=x.current;if(!J)return;Y.current&&Y.current.disconnect();const ee=new ResizeObserver(V=>{V.forEach(te=>{const re=te.target,ae=re.getAttribute("data-index");if(ae===null)return;const se=parseInt(ae,10),_e=re.offsetHeight;G.current.set(se,_e)})});return Y.current=ee,J.querySelectorAll("[data-index]").forEach(V=>ee.observe(V)),()=>ee.disconnect()},[t.length]);const I=TU({count:t.length,getScrollElement:()=>x.current,estimateSize:X,overscan:5,getItemKey:J=>{var K,V;const ee=t[J];return(V=(K=ee==null?void 0:ee.message)==null?void 0:K.id)!=null?V:`fallback-${J}`}});R.useLayoutEffect(()=>{N.current=w,D.current=t.length,E.current=0,O.current=!1,z.current="",t.length!==0&&(I.scrollToIndex(t.length-1,{align:"end"}),O.current=!0)},[n]),R.useEffect(()=>{const J=x.current;if(!J)return;const ee=K=>{N.current&&K.deltaY<0&&(N.current=!1,y==null||y(!1))};return J.addEventListener("wheel",ee,{passive:!1}),()=>J.removeEventListener("wheel",ee)},[y]);const M=bU(()=>{if(L.current)return;const J=x.current;if(J)if(N.current){const{scrollTop:ee,scrollHeight:K,clientHeight:V}=J;K-ee-V>0&&(L.current=!0,J.scrollTop=K,requestAnimationFrame(()=>{L.current=!1}))}else{const{scrollTop:ee,scrollHeight:K,clientHeight:V}=J;K-ee-V<=5&&(N.current=!0,y==null||y(!0))}});R.useLayoutEffect(()=>{j(l)},[l]);const P=H(t);R.useLayoutEffect(()=>{var Ee;const J=t.length,ee=D.current,K=J!==ee,V=P,te=V!==z.current;z.current=V;const re=J-1;let ae=0;re>=0&&(ae=(Ee=G.current.get(re))!=null?Ee:0);const se=E.current,_e=re>=0&&ae>se&&se>0;if(D.current=J,E.current=ae,!(J===0||!K&&!te&&!_e)){if(ee===0&&J>0&&se===0&&!O.current){I.scrollToIndex(J-1,{align:"end"}),O.current=!0;return}N.current&&(x.current.scrollTop=x.current.scrollHeight)}},[t.length,P,I]),R.useEffect(()=>{var te;const J=I.getVirtualItems(),ee=J.length-1;if(ee<0)return;const K=J[ee],V=(te=x.current)==null?void 0:te.querySelector(`[data-index="${K.index}"]`);if($.current&&$.current.disconnect(),!!V&&(q.current=V,!(!sS(t)||!N.current)))return $.current=new ResizeObserver(re=>{N.current&&sS(t)&&requestAnimationFrame(()=>{N.current&&(x.current.scrollTop=x.current.scrollHeight)})}),$.current.observe(V),()=>{$.current&&($.current.disconnect(),$.current=null)}},[t,I]),R.useEffect(()=>{if(c){const J=setTimeout(()=>{a==null||a()},3e3);return()=>clearTimeout(J)}},[c,a]),R.useLayoutEffect(()=>{S&&(S.current=()=>{N.current=!0,L.current=!0,x.current.scrollTop=x.current.scrollHeight,requestAnimationFrame(()=>{L.current=!1})})},[S]),R.useLayoutEffect(()=>{N.current=w},[w]);const F=I.getVirtualItems();return h.jsxs("div",{ref:x,className:"flex-1 min-h-0 overflow-y-auto relative chat-transcript-scrollbar",style:{WebkitOverflowScrolling:"touch"},onScroll:M,children:[k&&h.jsx("div",{className:"sticky top-0 z-10 px-4 pt-4 pb-1 bg-gradient-to-b from-background via-background/95 to-transparent",children:h.jsx(hV,{})}),c&&h.jsx("div",{className:"sticky top-0 z-10 px-4 pt-4 pb-1 bg-gradient-to-b from-background via-background/95 to-transparent",children:h.jsx(pV,{})}),r==="closed"&&h.jsx(Nd,{className:"mx-4 mt-4",children:h.jsx(Rd,{children:"This session is archived. You can reopen it from the sidebar."})}),h.jsx("div",{className:"relative w-full",style:{height:`${I.getTotalSize()}px`},children:t.length===0?h.jsxs("div",{className:"text-center py-16 text-muted-foreground px-4",children:[h.jsx("p",{className:"text-lg mb-2",children:"Start a conversation"}),h.jsx("p",{className:"text-sm",children:"Send a message below to begin."})]}):h.jsx("div",{className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${(Q=(B=F[0])==null?void 0:B.start)!=null?Q:0}px)`},children:F.map(J=>{const ee=t[J.index];return h.jsx("div",{"data-index":J.index,ref:I.measureElement,className:"px-4 py-4",children:h.jsx(bV,{item:ee,messagesWithParts:e,sessionId:n,pendingPermissions:i,onPermissionResponse:u,onNavigateToSubagent:d,onRemoveFromQueue:m,onRevert:p,onFork:g,isMainActiveSession:C,isCompacting:l,onCompact:_,serverUrl:b})},ee.message.id)})})})]})}function _V(t,e){return t.createdAt-e.createdAt}function SV(t){return t.type==="compaction"}function wV(t,e){const n=t.map(c=>({message:c.message,parts:c.parts,isQueued:!1})),r=e.map(c=>{const a=(c.attachments||[]).map(u=>{const d=`/api/sessions/${c.sessionId}/attachments/${u.id}/content?key=${u.accessKey}`;return u.kind==="image"?{id:`${c.id}-att-${u.id}`,messageId:c.id,createdAt:c.createdAt,type:"image",url:d,mimeType:u.mimeType}:{id:`${c.id}-att-${u.id}`,messageId:c.id,createdAt:c.createdAt,type:"file",url:d,mimeType:u.mimeType||"",filename:u.filename}});return{message:{id:c.id,role:"user",sessionId:c.sessionId,createdAt:c.createdAt},parts:[...a,...c.content.trim()?[{id:`${c.id}-part`,messageId:c.id,createdAt:c.createdAt,type:"text",text:c.content}]:[]],isQueued:!0,queueId:c.id}}),i=[...n].sort((c,a)=>c.message.createdAt-a.message.createdAt),l=[...r].sort((c,a)=>c.message.createdAt-a.message.createdAt);return[...i,...l]}function CV(t){const e=he.c(8),{permissions:n,onPermissionResponse:r}=t;if(n.length===0)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide font-medium",children:"Pending Requests"}),e[0]=i):i=e[0];let l;if(e[1]!==r||e[2]!==n){let a;e[4]!==r?(a=u=>{var m;const d=typeof((m=u.args)==null?void 0:m.command)=="string"?u.args.command:JSON.stringify(u.args,null,2);return h.jsxs("div",{className:"p-3 bg-warning/10 border border-warning/30 rounded-lg flex flex-col gap-2",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"text-sm font-medium",children:u.toolName})}),h.jsx("p",{className:"text-sm",children:u.message}),h.jsxs(Ks,{children:[h.jsx($i,{asChild:!0,children:h.jsxs("button",{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors w-full text-left",children:[h.jsx(Hr,{className:"size-3"}),h.jsx("span",{className:"uppercase tracking-wide",children:"Command"})]})}),h.jsx(Ys,{children:h.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 mt-1 overflow-x-auto whitespace-pre-wrap break-words",children:d})})]}),h.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[h.jsx(Te,{variant:"outline",size:"sm",onClick:()=>r(u.toolCallId,!1,!1),children:"Deny"}),h.jsx(Te,{variant:"secondary",size:"sm",onClick:()=>r(u.toolCallId,!0,!1),children:"Approve"}),h.jsx(Te,{size:"sm",onClick:()=>r(u.toolCallId,!0,!0),children:"Always Allow"})]})]},u.toolCallId)},e[4]=r,e[5]=a):a=e[5],l=n.map(a),e[1]=r,e[2]=n,e[3]=l}else l=e[3];let c;return e[6]!==l?(c=h.jsxs("div",{className:"border-t border-border bg-muted/30 flex flex-col gap-2 p-4",children:[i,l]}),e[6]=l,e[7]=c):c=e[7],c}function kV(t){const e=he.c(86),{session:n,messagesWithParts:r,queuedMessages:i,preconfigs:l,prompts:c,models:a,defaultModel:u,onSendMessage:d,onRemoveFromQueue:m,onChangePreconfig:p,onChangeModel:g,onChangeVariant:_,pendingPermissions:C,onPermissionResponse:w,onRename:y,usage:S,modelName:b,modelSupportsImage:x,onNavigateToSubagent:k,onNavigateBack:j,isStreaming:N,onInterrupt:D,onRevert:E,onFork:O,onCompact:L,isCompacting:z,compactionSuccess:H,onClearCompactionSuccess:$,serverUrl:q,apiToken:G,selectedVariant:W,variants:X,inputRef:Y,scrollToBottomRef:I,autoFollowToggleRef:M}=t,F=!n.parentId&&n.status==="active",[B,Q]=R.useState(!0);let J;e[0]!==I?(J=()=>{Q(Re=>{var oe;const we=!Re;return we&&((oe=I==null?void 0:I.current)==null||oe.call(I)),we})},e[0]=I,e[1]=J):J=e[1];const ee=J;let K,V;e[2]!==M||e[3]!==ee?(K=()=>{M&&(M.current={toggle:()=>{ee()}})},V=[M,ee],e[2]=M,e[3]=ee,e[4]=K,e[5]=V):(K=e[4],V=e[5]),R.useEffect(K,V);let te;e[6]!==r||e[7]!==i?(te=wV(r,i),e[6]=r,e[7]=i,e[8]=te):te=e[8];const re=te;let ae;if(e[9]!==r||e[10]!==C||e[11]!==n.id){let Re;e[13]!==r||e[14]!==n.id?(Re=we=>we.sessionId!==n.id?!1:!r.some(oe=>oe.parts.some(me=>me.type==="tool"&&me.callId===we.toolCallId)),e[13]=r,e[14]=n.id,e[15]=Re):Re=e[15],ae=C.filter(Re),e[9]=r,e[10]=C,e[11]=n.id,e[12]=ae}else ae=e[12];const se=ae,_e=r.length>=4;let Ee;e[16]!==u||e[17]!==z||e[18]!==N||e[19]!==b||e[20]!==a||e[21]!==g||e[22]!==p||e[23]!==_||e[24]!==L||e[25]!==D||e[26]!==j||e[27]!==y||e[28]!==l||e[29]!==W||e[30]!==n||e[31]!==_e||e[32]!==S||e[33]!==X?(Ee=h.jsx(aU,{session:n,preconfigs:l,models:a,defaultModel:u,usage:S,modelName:b,onChangePreconfig:p,onChangeModel:g,onChangeVariant:_,onRename:y,onNavigateBack:j,isStreaming:N,onInterrupt:D,onCompact:L,isCompacting:z,canCompact:_e,selectedVariant:W,variants:X}),e[16]=u,e[17]=z,e[18]=N,e[19]=b,e[20]=a,e[21]=g,e[22]=p,e[23]=_,e[24]=L,e[25]=D,e[26]=j,e[27]=y,e[28]=l,e[29]=W,e[30]=n,e[31]=_e,e[32]=S,e[33]=X,e[34]=Ee):Ee=e[34];let De;e[35]!==O||e[36]!==E||e[37]!==B||e[38]!==H||e[39]!==re||e[40]!==z||e[41]!==F||e[42]!==r||e[43]!==$||e[44]!==L||e[45]!==k||e[46]!==w||e[47]!==m||e[48]!==C||e[49]!==I||e[50]!==q||e[51]!==n.id||e[52]!==n.status?(De=h.jsx(xV,{displayItems:re,messagesWithParts:r,sessionId:n.id,sessionStatus:n.status,pendingPermissions:C,isCompacting:z,compactionSuccess:H,onClearCompactionSuccess:$,onPermissionResponse:w,onNavigateToSubagent:k,onRemoveFromQueue:m,onRevert:E,onFork:O,onCompact:L,isMainActiveSession:F,autoFollow:B,onAutoScrollChange:Q,scrollToBottomRef:I,serverUrl:q}),e[35]=O,e[36]=E,e[37]=B,e[38]=H,e[39]=re,e[40]=z,e[41]=F,e[42]=r,e[43]=$,e[44]=L,e[45]=k,e[46]=w,e[47]=m,e[48]=C,e[49]=I,e[50]=q,e[51]=n.id,e[52]=n.status,e[53]=De):De=e[53];const Ue=B?"Auto-follow enabled (Cmd+Shift+F)":"Auto-follow disabled (Cmd+Shift+F)";let ce;e[54]!==B?(ce=B?h.jsxs(h.Fragment,{children:[h.jsx(O5,{className:"size-3"}),h.jsx("span",{children:"Follow"})]}):h.jsxs(h.Fragment,{children:[h.jsx(Fg,{className:"size-3"}),h.jsx("span",{children:"Free"})]}),e[54]=B,e[55]=ce):ce=e[55];let je;e[56]!==ee||e[57]!==ce||e[58]!==Ue?(je=h.jsx("button",{onClick:ee,className:"absolute bottom-4 right-4 z-50 flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-full transition-colors cursor-pointer bg-background/80 backdrop-blur-sm hover:bg-background border border-border/50 shadow-sm pointer-events-auto",title:Ue,children:ce}),e[56]=ee,e[57]=ce,e[58]=Ue,e[59]=je):je=e[59];let be;e[60]!==je||e[61]!==De?(be=h.jsxs("div",{className:"relative flex flex-col flex-1 min-h-0",children:[De,je]}),e[60]=je,e[61]=De,e[62]=be):be=e[62];let Ve;e[63]!==w||e[64]!==se?(Ve=se.length>0&&h.jsx(CV,{permissions:se,onPermissionResponse:w}),e[63]=w,e[64]=se,e[65]=Ve):Ve=e[65];let qe;e[66]!==G||e[67]!==Y||e[68]!==z||e[69]!==x||e[70]!==d||e[71]!==c||e[72]!==q||e[73]!==n.id||e[74]!==n.parentId||e[75]!==n.status||e[76]!==n.workspaceId?(qe=n.status==="active"&&!n.parentId&&h.jsx(yU,{ref:Y,onSendMessage:d,disabled:z,workspaceId:n.workspaceId,serverUrl:q,apiToken:G,prompts:c,sessionId:n.id,modelSupportsImage:x}),e[66]=G,e[67]=Y,e[68]=z,e[69]=x,e[70]=d,e[71]=c,e[72]=q,e[73]=n.id,e[74]=n.parentId,e[75]=n.status,e[76]=n.workspaceId,e[77]=qe):qe=e[77];let ye;e[78]!==n.parentId?(ye=n.parentId&&h.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:[h.jsx(qA,{className:"size-4"}),"This is a subagent session (read-only)"]}),e[78]=n.parentId,e[79]=ye):ye=e[79];let Me;return e[80]!==be||e[81]!==Ve||e[82]!==qe||e[83]!==ye||e[84]!==Ee?(Me=h.jsxs("div",{className:"flex flex-col flex-1 min-h-0 relative",children:[Ee,be,Ve,qe,ye]}),e[80]=be,e[81]=Ve,e[82]=qe,e[83]=ye,e[84]=Ee,e[85]=Me):Me=e[85],Me}function EV(t){var lt,Be,We;const e=he.c(79),{servers:n,activeServer:r,isSwitching:i,connected:l,authError:c,connectionTimedOut:a,retryCount:u,nextRetryIn:d,serverUrl:m,currentSession:p,messagesWithParts:g,queuedMessages:_,preconfigs:C,primaryPreconfigs:w,prompts:y,models:S,defaultModel:b,selectedVariant:x,pendingPermissions:k,sessionUsage:j,currentModel:N,streamingSessionIds:D,isCompacting:E,compactionSuccess:O,isPrimarySession:L,inputRef:z,apiToken:H,onFirstServerAdded:$,onRetry:q,onLogout:G,onSendMessage:W,onRemoveFromQueue:X,onChangePreconfig:Y,onChangeModel:I,onChangeVariant:M,onPermissionResponse:P,onRename:F,onNavigateToSubagent:B,onNavigateBack:Q,onInterrupt:J,onRevert:ee,onFork:K,onCompact:V,onClearCompactionSuccess:te,scrollToBottomRef:re,autoFollowToggleRef:ae}=t,se=!!r;let _e;e[0]!==Y?(_e=ze=>{Y(ze)},e[0]=Y,e[1]=_e):_e=e[1];const Ee=_e;let De;e[2]!==M?(De=ze=>{M(ze)},e[2]=M,e[3]=De):De=e[3];const Ue=De;let ce;e[4]!==J?(ce=()=>{J()},e[4]=J,e[5]=ce):ce=e[5];const je=ce;if(n.length===0){const ze=c||void 0;let rt;return e[6]!==$||e[7]!==ze?(rt=h.jsx(Y_,{onServerAdded:$,error:ze}),e[6]=$,e[7]=ze,e[8]=rt):rt=e[8],rt}if(!se){const ze=c||void 0;let rt;return e[9]!==$||e[10]!==ze?(rt=h.jsx(Y_,{onServerAdded:$,error:ze}),e[9]=$,e[10]=ze,e[11]=rt):rt=e[11],rt}if(i){const ze=`Connecting to ${(r==null?void 0:r.name)||"server"}...`;let rt;return e[12]!==ze?(rt=h.jsx("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:h.jsx(K_,{message:ze})}),e[12]=ze,e[13]=rt):rt=e[13],rt}if(!l&&n.length>0){if(a){let kt;return e[14]!==c||e[15]!==d||e[16]!==G||e[17]!==q||e[18]!==u||e[19]!==m?(kt=h.jsx("div",{className:"flex w-full h-full items-center justify-center bg-background",children:h.jsx($$,{serverUrl:m,authError:c,retryCount:u,nextRetryIn:d,onRetry:q,onLogout:G})}),e[14]=c,e[15]=d,e[16]=G,e[17]=q,e[18]=u,e[19]=m,e[20]=kt):kt=e[20],kt}let ze;e[21]===Symbol.for("react.memo_cache_sentinel")?(ze=h.jsx(K_,{}),e[21]=ze):ze=e[21];let rt;return e[22]!==G?(rt=h.jsxs("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:[ze,h.jsx(Te,{variant:"ghost",size:"sm",onClick:G,className:"text-muted-foreground",children:"Change Server"})]}),e[22]=G,e[23]=rt):rt=e[23],rt}if(!p){let ze;return e[24]===Symbol.for("react.memo_cache_sentinel")?(ze=h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center text-muted-foreground px-6",children:[h.jsx("h2",{className:"mb-2",children:"Select or create a session"}),h.jsx("p",{children:"Choose a session from the sidebar or create a new one to start chatting."})]}),e[24]=ze):ze=e[24],ze}let be;e[25]!==g?(be=g.filter(AV),e[25]=g,e[26]=be):be=e[26];const qe=be.length>=4;let ye;if(e[27]!==N||e[28]!==S){let ze;e[30]!==N?(ze=rt=>rt.id===N,e[30]=N,e[31]=ze):ze=e[31],ye=S.find(ze),e[27]=N,e[28]=S,e[29]=ye}else ye=e[29];const Me=ye;let Re;e[32]!==p.id||e[33]!==_?(Re=_[p.id]||[],e[32]=p.id,e[33]=_,e[34]=Re):Re=e[34];const we=L?w:C,oe=Me==null?void 0:Me.variants,me=(We=(Be=(lt=Me==null?void 0:Me.capabilities)==null?void 0:lt.input)==null?void 0:Be.image)!=null?We:!1;let Ne;e[35]!==p.id||e[36]!==p.runningAt||e[37]!==D?(Ne=D.has(p.id)||!!p.runningAt,e[35]=p.id,e[36]=p.runningAt,e[37]=D,e[38]=Ne):Ne=e[38];let Le;e[39]!==qe||e[40]!==p.id||e[41]!==V?(Le=qe?()=>V(p.id):void 0,e[39]=qe,e[40]=p.id,e[41]=V,e[42]=Le):Le=e[42];const Ge=m!=null?m:void 0,Ke=H!=null?H:void 0;let Je;return e[43]!==ae||e[44]!==O||e[45]!==N||e[46]!==p||e[47]!==b||e[48]!==Ee||e[49]!==Ue||e[50]!==je||e[51]!==z||e[52]!==E||e[53]!==g||e[54]!==S||e[55]!==I||e[56]!==te||e[57]!==K||e[58]!==Q||e[59]!==B||e[60]!==P||e[61]!==X||e[62]!==F||e[63]!==ee||e[64]!==W||e[65]!==k||e[66]!==y||e[67]!==re||e[68]!==x||e[69]!==j||e[70]!==Ne||e[71]!==Le||e[72]!==Ge||e[73]!==Ke||e[74]!==Re||e[75]!==we||e[76]!==oe||e[77]!==me?(Je=h.jsx(kV,{inputRef:z,session:p,messagesWithParts:g,queuedMessages:Re,preconfigs:we,prompts:y,models:S,defaultModel:b,onSendMessage:W,onRemoveFromQueue:X,onChangePreconfig:Ee,onChangeModel:I,onChangeVariant:Ue,selectedVariant:x,variants:oe,pendingPermissions:k,onPermissionResponse:P,onRename:F,usage:j,modelName:N,modelSupportsImage:me,onNavigateToSubagent:B,onNavigateBack:Q,isStreaming:Ne,onInterrupt:je,onRevert:ee,onFork:K,onCompact:Le,isCompacting:E,compactionSuccess:O,onClearCompactionSuccess:te,serverUrl:Ge,apiToken:Ke,scrollToBottomRef:re,autoFollowToggleRef:ae}),e[43]=ae,e[44]=O,e[45]=N,e[46]=p,e[47]=b,e[48]=Ee,e[49]=Ue,e[50]=je,e[51]=z,e[52]=E,e[53]=g,e[54]=S,e[55]=I,e[56]=te,e[57]=K,e[58]=Q,e[59]=B,e[60]=P,e[61]=X,e[62]=F,e[63]=ee,e[64]=W,e[65]=k,e[66]=y,e[67]=re,e[68]=x,e[69]=j,e[70]=Ne,e[71]=Le,e[72]=Ge,e[73]=Ke,e[74]=Re,e[75]=we,e[76]=oe,e[77]=me,e[78]=Je):Je=e[78],Je}function AV(t){return t.message.role!=="system"}const NV={".ts":{icon:Pr,color:"text-blue-500"},".tsx":{icon:Pr,color:"text-blue-500"},".js":{icon:Pr,color:"text-yellow-500"},".jsx":{icon:Pr,color:"text-yellow-500"},".json":{icon:Pr,color:"text-yellow-600"},".md":{icon:Pr,color:"text-gray-500"},".css":{icon:Pr,color:"text-purple-500"},".html":{icon:Pr,color:"text-orange-500"}};function ZE({entry:t,workspaceId:e,parentPath:n,depth:r,onFileSelect:i,showHidden:l=!0,serverUrl:c,apiToken:a}){const{fetchWithAuth:u}=ns(),[d,m]=R.useState(!1),[p,g]=R.useState([]),[_,C]=R.useState(!1),[w,y]=R.useState(!1),S=n?`${n}/${t.path}`:t.path,b=t.type==="directory",x=async()=>{if(!(w||_)){C(!0);try{const z=await(await u(`/api/workspaces/${e}/files?path=${encodeURIComponent(S)}&showHidden=${l}`,{},{serverUrl:c,token:a})).json();g(z.files||[]),y(!0)}catch(L){console.error("Failed to load children:",L)}finally{C(!1)}}},k=L=>{var z;(z=document.activeElement)==null||z.focus(),m(L),L&&b&&x()},j=L=>{L.currentTarget.focus(),!b&&i&&i({...t,path:S})},N=L=>{L.key==="Enter"&&(L.preventDefault(),j(L))},D=t.extension?NV[t.extension]:null,E=b?d?rg:Vs:(D==null?void 0:D.icon)||Pr,O=b?"text-amber-500":(D==null?void 0:D.color)||"text-muted-foreground";return b?h.jsxs(Ks,{open:d,onOpenChange:k,children:[h.jsx($i,{asChild:!0,children:h.jsxs("button",{"data-file-node":!0,"data-file-type":"directory","data-file-is-open":d||void 0,className:Ae("flex items-center gap-2 w-full min-w-0 overflow-hidden rounded-md p-2 text-left text-sm","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus:ring-1 focus:ring-inset ring-sidebar-ring outline-hidden","[&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate"),style:{paddingLeft:`${r*12+8}px`},children:[_?h.jsx(Wt,{className:"w-3 h-3 animate-spin shrink-0"}):h.jsx(Hr,{className:Ae("w-3 h-3 shrink-0 transition-transform",d&&"rotate-90")}),h.jsx(E,{className:O}),h.jsx("div",{className:"flex-1 min-w-0 truncate",children:t.name})]})}),h.jsx(Ys,{children:p.map(L=>h.jsx(ZE,{entry:L,workspaceId:e,parentPath:S,depth:r+1,onFileSelect:i,showHidden:l,serverUrl:c,apiToken:a},`${S}/${L.path}`))})]}):h.jsxs("button",{"data-file-node":!0,"data-file-type":"file",onClick:j,onKeyDown:N,className:Ae("flex items-center gap-2 w-full min-w-0 overflow-hidden rounded-md p-2 text-left text-sm","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus:ring-1 focus:ring-inset ring-sidebar-ring outline-hidden","[&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate"),style:{paddingLeft:`${r*12+8}px`},children:[h.jsx(E,{className:O}),h.jsx("div",{className:"flex-1 min-w-0 truncate",children:t.name})]})}const Lg=R.forwardRef(({workspaceId:t,serverUrl:e,apiToken:n,onFileSelect:r,showHidden:i=!0,width:l},c)=>{const[a,u]=R.useState([]),[d,m]=R.useState(""),[p,g]=R.useState(!0),[_,C]=R.useState(null),{fetchWithAuth:w}=ns(),y=R.useRef(null),S=R.useCallback(async()=>{g(!0),C(null);try{const x=await w(`/api/workspaces/${t}/files?showHidden=${i}`,{},{serverUrl:e,token:n}),k=await x.json();if(!x.ok)throw new Error(k.message||"Failed to load files");u(k.files),m(k.currentPath)}catch(x){C(x instanceof Error?x.message:"Failed to load files")}finally{g(!1)}},[t,i,w,e,n]);R.useEffect(()=>{S()},[S]),R.useImperativeHandle(c,()=>({refresh:S,focus:()=>{const x=y.current;if(!x)return;const k=x.querySelector("[data-file-node]");k?k.focus():x.focus()}}),[S]);const b=R.useCallback(x=>{var D,E,O,L,z,H,$;const k=y.current;if(!k)return;const j=Array.from(k.querySelectorAll("[data-file-node]"));if(j.length===0)return;const N=j.indexOf(document.activeElement);switch(x.key){case"ArrowDown":{x.preventDefault();const q=N<j.length-1?N+1:0;(D=j[q])==null||D.focus();break}case"ArrowUp":{x.preventDefault();const q=N>0?N-1:j.length-1;(E=j[q])==null||E.focus();break}case"ArrowRight":{x.preventDefault();const q=document.activeElement;if(!q)break;if(q.getAttribute("data-file-type")==="directory")if(q.getAttribute("data-file-is-open")!=="true")q.click();else{const X=N<j.length-1?N+1:-1;X>=0&&((O=j[X])==null||O.focus())}else{const W=N<j.length-1?N+1:-1;W>=0&&((L=j[W])==null||L.focus())}break}case"ArrowLeft":{x.preventDefault();const q=document.activeElement;if(!q)break;if(q.getAttribute("data-file-type")==="directory")if(q.getAttribute("data-file-is-open")==="true")q.click();else{const X=N>0?N-1:-1;X>=0&&((z=j[X])==null||z.focus())}else{const W=N>0?N-1:-1;W>=0&&((H=j[W])==null||H.focus())}break}case"Enter":{document.activeElement instanceof HTMLButtonElement&&document.activeElement.click();break}case"Escape":{x.preventDefault(),($=document.activeElement)==null||$.blur();break}}},[]);return p?h.jsxs("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:[h.jsx(Wt,{className:"w-4 h-4 animate-spin mr-2"}),"Loading files..."]}):_?h.jsxs("div",{className:"p-4 text-sm text-destructive",children:[_,h.jsx(Te,{variant:"ghost",size:"sm",onClick:S,className:"ml-2",children:h.jsx(Pi,{className:"w-3 h-3"})})]}):a.length===0?h.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Empty workspace",h.jsx(Te,{variant:"ghost",size:"sm",onClick:S,className:"ml-2",children:h.jsx(Pi,{className:"w-3 h-3"})})]}):h.jsx("div",{ref:y,tabIndex:-1,onKeyDown:b,className:"flex-1 min-h-0 min-w-0 w-full outline-none",children:h.jsx(ds,{className:"h-full",children:h.jsx("div",{className:"px-2 pb-2 w-full min-w-0",style:l?{width:`${l-8}px`}:void 0,children:h.jsx("div",{className:"space-y-0.5 min-w-0",children:a.map(x=>h.jsx(ZE,{entry:x,workspaceId:t,parentPath:d,depth:0,onFileSelect:r,showHidden:i,serverUrl:e,apiToken:n},x.path))})})})})});Lg.displayName="FileTree";const JE=R.forwardRef((t,e)=>{const n=he.c(43),{workspaceId:r,serverUrl:i,apiToken:l,isOpen:c,onClose:a}=t,u=ol(),d=R.useRef(null),m=qt(RV),p=qt(jV);let g;n[0]!==p?(g=()=>{p(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var z;(z=d.current)==null||z.focus()})})},n[0]=p,n[1]=g):g=n[1];const _=g;let C,w;n[2]!==_?(C=()=>({focus:_}),w=[_],n[2]=_,n[3]=C,n[4]=w):(C=n[3],w=n[4]),R.useImperativeHandle(e,C,w);const y=qt(TV);let S;n[5]!==y||n[6]!==r?(S=z=>{z.type==="file"&&r&&y({workspaceId:r,path:z.path,name:z.name})},n[5]=y,n[6]=r,n[7]=S):S=n[7];const b=S;if(!r)return null;if(u){let z;n[8]!==a?(z=I=>!I&&a(),n[8]=a,n[9]=z):z=n[9];let H;n[10]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(Uf,{className:"sr-only",children:h.jsx(Vf,{children:"Files"})}),n[10]=H):H=n[10];let $;n[11]===Symbol.for("react.memo_cache_sentinel")?($=h.jsx("span",{className:"font-semibold text-sm text-sidebar-foreground",children:"Files"}),n[11]=$):$=n[11];let q;n[12]===Symbol.for("react.memo_cache_sentinel")?(q=h.jsx(zn,{className:"size-4"}),n[12]=q):q=n[12];let G;n[13]!==a?(G=h.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[$,h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:a,children:q})]}),n[13]=a,n[14]=G):G=n[14];let W;n[15]!==l||n[16]!==b||n[17]!==i||n[18]!==r?(W=h.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:h.jsx(Lg,{ref:d,workspaceId:r,serverUrl:i,apiToken:l,showHidden:!0,onFileSelect:b},r)}),n[15]=l,n[16]=b,n[17]=i,n[18]=r,n[19]=W):W=n[19];let X;n[20]!==W||n[21]!==G?(X=h.jsxs($f,{side:"right",className:"w-72 p-0 bg-sidebar [&>button]:hidden",children:[H,G,W]}),n[20]=W,n[21]=G,n[22]=X):X=n[22];let Y;return n[23]!==c||n[24]!==X||n[25]!==z?(Y=h.jsx(Hf,{open:c,onOpenChange:z,children:X}),n[23]=c,n[24]=X,n[25]=z,n[26]=Y):Y=n[26],Y}const x=`${m}px`;let k;n[27]!==x?(k={"--sidebar-width":x},n[27]=x,n[28]=k):k=n[28];const j=k;let N;n[29]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(Dk,{side:"right",panelId:"files"}),n[29]=N):N=n[29];let D;n[30]===Symbol.for("react.memo_cache_sentinel")?(D=h.jsx(jk,{children:h.jsx(jo,{children:h.jsx(Hs,{children:h.jsxs(Ii,{className:"w-full justify-between",onClick:()=>{var z;return(z=d.current)==null?void 0:z.refresh()},children:[h.jsx("span",{className:"text-sm font-semibold",children:"Files"}),h.jsx(Pi,{className:"size-4"})]})})})}),n[30]=D):D=n[30];let E;n[31]!==l||n[32]!==m||n[33]!==b||n[34]!==i||n[35]!==r?(E=h.jsx(Tk,{className:"overflow-hidden",children:h.jsx(Lg,{ref:d,workspaceId:r,serverUrl:i,apiToken:l,showHidden:!0,width:m,onFileSelect:b},r)}),n[31]=l,n[32]=m,n[33]=b,n[34]=i,n[35]=r,n[36]=E):E=n[36];let O;n[37]!==c||n[38]!==E?(O=h.jsxs(Rk,{side:"right",isOpen:c,children:[N,D,E]}),n[37]=c,n[38]=E,n[39]=O):O=n[39];let L;return n[40]!==O||n[41]!==j?(L=h.jsx(Nk,{panelId:"files",defaultOpen:!0,className:"w-0 shrink-0",style:j,children:O}),n[40]=O,n[41]=j,n[42]=L):L=n[42],L});JE.displayName="FilesPanel";function RV(t){return t.filesPanelWidth}function jV(t){return t.setShowFilesPanel}function TV(t){return t.openFilePreview}function DV(t,e){var C;const{session:n}=t,{setSessions:r,setCurrentSession:i,setMessagesBySession:l,setPartsBySession:c,setSessionUsage:a,setCurrentModel:u,setSelectedVariant:d,pendingSessionCreateRef:m,sessionAccessTimesRef:p,partIdIndexRef:g,defaultModel:_}=e;r(w=>[n,...w]),m.current&&(i(n),l({[n.id]:[]}),c({[n.id]:{}}),g.current.clear(),a({promptTokens:0,completionTokens:0,totalTokens:0}),u(n.selectedModel||_),d((C=n.selectedVariant)!=null?C:null),m.current=!1),p.current.set(n.id,Date.now())}function MV(t,e){var D;const{session:n,messages:r,usage:i,isRunning:l}=t,{setCurrentSession:c,removeInterruptedSession:a,addStreamingSession:u,removeStreamingSession:d,skipFinishSoundSessionIdsRef:m,setMessagesBySession:p,setPartsBySession:g,setSessionUsage:_,setCurrentModel:C,setSelectedVariant:w,sessionAccessTimesRef:y,partIdIndexRef:S,models:b,defaultModel:x,clearCompletion:k}=e;if(c(n),a(n.id),k(n.id),l?u(n.id):(d(n.id),m.current.add(n.id)),r){p({[n.id]:r.map(E=>E.message)}),g(()=>{const E={};E[n.id]={};for(const O of r)E[n.id][O.message.id]=O.parts;return E}),S.current.clear();for(const E of r)for(let O=0;O<E.parts.length;O++)S.current.set(E.parts[O].id,{sessionId:n.id,messageId:E.message.id,index:O})}_(i!=null?i:{promptTokens:0,completionTokens:0,totalTokens:0}),C(n.selectedModel||x),w(n.selectedVariant||null);const j=n.selectedModel||x,N=(D=b.find(E=>E.id===j))==null?void 0:D.variants;n.selectedVariant&&N&&!N[n.selectedVariant]&&w(null),y.current.set(n.id,Date.now())}function OV(t,e){const{sessionId:n}=t,{setSessions:r,setMessagesBySession:i,setPartsBySession:l,setCurrentSession:c,partIdIndexRef:a,partAppendRafRef:u,pendingPartAppendsRef:d,sessionAccessTimesRef:m,currentSessionIdRef:p,clearCompletion:g}=e;r(_=>_.map(C=>C.id===n?{...C,status:"closed"}:C)),g(n),p.current===n&&(u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),d.current.clear()),i(_=>{const C={..._};return delete C[n],C}),l(_=>{const C={..._};return delete C[n],C});for(const[_,C]of a.current)C.sessionId===n&&a.current.delete(_);m.current.delete(n),p.current===n&&c(null)}function LV(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:i,currentSessionIdRef:l}=e;r(c=>c.map(a=>a.id===n.id?n:a)),l.current===n.id&&i(n)}function IV(t,e){const{sessionId:n}=t,{setSessions:r,setMessagesBySession:i,setPartsBySession:l,removeInterruptedSession:c,partIdIndexRef:a,sessionAccessTimesRef:u,setCurrentSession:d,currentSessionIdRef:m,clearCompletion:p}=e;r(g=>g.filter(_=>_.id!==n)),p(n),i(g=>{const _={...g};return delete _[n],_}),l(g=>{const _={...g};return delete _[n],_}),c(n);for(const[g,_]of a.current)_.sessionId===n&&a.current.delete(g);u.current.delete(n),m.current===n&&d(null)}function PV(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:i,setSelectedVariant:l,setCurrentModel:c,currentSessionIdRef:a}=e;r(u=>u.map(d=>d.id===n.id?n:d)),a.current===n.id&&(i(n),n.selectedVariant!==void 0&&l(n.selectedVariant),n.selectedModel&&c(n.selectedModel))}function zV(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:i,currentSessionIdRef:l}=e;r(c=>c.map(a=>a.id===n.id?n:a)),l.current===n.id&&i(n)}function BV(t,e){const{sessionId:n,result:r}=t,{addInterruptedSession:i,skipFinishSoundSessionIdsRef:l,removeStreamingSession:c}=e;i(n),l.current.add(n),c(n),r.cascadedTo.length>0&&console.log(`Session ${n} interrupted. Cascaded to:`,r.cascadedTo)}function FV(t,e){const{sessionId:n,revertedTo:r,removed:i}=t;console.log(`Session ${n} reverted to message ${r.messageId}, removed ${i.messageIds.length} messages`)}function HV(t,e){const{forkedSession:n,messages:r}=t,{setSessions:i,setCurrentSession:l,setMessagesBySession:c,setPartsBySession:a,setSessionUsage:u,sessionAccessTimesRef:d,partIdIndexRef:m,clearCompletion:p}=e;i(g=>[n,...g]),c({[n.id]:r.map(g=>g.message)}),a(()=>{const g={};g[n.id]={};for(const _ of r)g[n.id][_.message.id]=_.parts;return g}),m.current.clear();for(const g of r)for(let _=0;_<g.parts.length;_++)m.current.set(g.parts[_].id,{sessionId:n.id,messageId:g.message.id,index:_});l(n),u({promptTokens:0,completionTokens:0,totalTokens:0}),d.current.set(n.id,Date.now()),p(n.id)}function $V(t,e){const{sessionId:n,messages:r}=t,{setMessagesBySession:i,setPartsBySession:l,partIdIndexRef:c,partAppendRafRef:a,skipFinishSoundSessionIdsRef:u,removeStreamingSession:d,sessionAccessTimesRef:m,flushPendingPartAppends:p,currentSessionIdRef:g,clearCompletion:_}=e;if(g.current===n&&(a.current!==null&&(cancelAnimationFrame(a.current),a.current=null),p()),g.current===n){i({[n]:r.map(C=>C.message)}),l(()=>{const C={};C[n]={};for(const w of r)C[n][w.message.id]=w.parts;return C}),c.current.clear();for(const C of r)for(let w=0;w<C.parts.length;w++)c.current.set(C.parts[w].id,{sessionId:n,messageId:C.message.id,index:w})}u.current.add(n),d(n),m.current.set(n,Date.now()),_(n)}const UV={"session.created":DV,"session.resumed":MV,"session.closed":OV,"session.reopened":LV,"session.deleted":IV,"session.updated":PV,"session.renamed":zV,"session.interrupted":BV,"session.reverted":FV,"session.forked":HV,"session.state":$V};function VV(t,e){const{message:n}=t,{setMessagesBySession:r,setPartsBySession:i,addStreamingSession:l,removeInterruptedSession:c,currentSessionIdRef:a,clearCompletion:u}=e;u(n.sessionId),n.sessionId===a.current&&(r(d=>({...d,[n.sessionId]:[...d[n.sessionId]||[],n]})),i(d=>({...d,[n.sessionId]:{...d[n.sessionId],[n.id]:[]}}))),n.sessionId===a.current&&"status"in n&&n.status==="streaming"&&(l(n.sessionId),c(n.sessionId))}function qV(t,e){const{message:n}=t,{setMessagesBySession:r,removeStreamingSession:i,partAppendRafRef:l,partAppendTimeoutRef:c,flushPendingPartAppends:a,currentSessionIdRef:u,sessionsRef:d,setCompletion:m,chatFinishSoundEnabledRef:p,playChatFinishSound:g}=e;if(n.sessionId===u.current&&("status"in n&&n.status!=="streaming"&&(l.current!==null&&(cancelAnimationFrame(l.current),l.current=null),c.current!==null&&(clearTimeout(c.current),c.current=null),a()),r(_=>({..._,[n.sessionId]:(_[n.sessionId]||[]).map(C=>C.id===n.id?n:C)}))),"status"in n&&n.status!=="streaming"){i(n.sessionId);const _=d.current.find(w=>w.id===n.sessionId);if(_&&_.parentId===null){const w=Date.now();m(n.sessionId,{type:"flash-only",flashStartedAt:w}),p.current&&g()}}}function WV(t,e){const{sessionId:n,part:r}=t,{setPartsBySession:i,partIdIndexRef:l,currentSessionIdRef:c,clearCompletion:a}=e;if(a(n),n===c.current){i(d=>{const m=d[n]||{},p=m[r.messageId]||[];return{...d,[n]:{...m,[r.messageId]:[...p,r]}}});let u=0;for(const d of l.current.values())d.sessionId===n&&d.messageId===r.messageId&&(u=Math.max(u,d.index+1));l.current.set(r.id,{sessionId:n,messageId:r.messageId,index:u})}}function GV(t,e){const{sessionId:n,part:r}=t,{setPartsBySession:i,partIdIndexRef:l,currentSessionIdRef:c,clearCompletion:a}=e;if(a(n),n===c.current){const u=l.current.get(r.id);i(u?d=>{const m=d[u.sessionId];if(!m)return d;const p=m[u.messageId];if(!p)return d;const g=[...p];return g[u.index]=r,{...d,[u.sessionId]:{...m,[u.messageId]:g}}}:d=>{const m=d[n]||{},p=m[r.messageId]||[];return{...d,[n]:{...m,[r.messageId]:p.map(g=>g.id===r.id?r:g)}}})}}function KV(t,e){const{sessionId:n,partId:r,delta:i}=t,{addStreamingSession:l,pendingPartAppendsRef:c,partAppendRafRef:a,lastPartAppendFlushAtRef:u,partAppendTimeoutRef:d,interruptedSessions:m,currentSessionIdRef:p,flushPendingPartAppends:g,clearCompletion:_}=e;if(_(n),n===p.current&&!m.has(n)&&l(n),n===p.current){const C=c.current.get(r);c.current.set(r,(C||"")+i);const y=Date.now()-u.current,S=50;if(y<S){if(d.current===null){const b=S-y;d.current=setTimeout(()=>{d.current=null,a.current===null&&(a.current=requestAnimationFrame(()=>{g()}))},b)}}else a.current===null&&(a.current=requestAnimationFrame(()=>{g()}))}}function YV(t,e){const{sessionId:n,usage:r,model:i}=t,{setSessionUsage:l,setCurrentModel:c,currentSessionIdRef:a}=e;n===a.current&&(l({promptTokens:r.promptTokens,completionTokens:r.completionTokens,totalTokens:r.totalTokens}),c(i))}function XV(t,e){const{sessionId:n}=t,{setCompactionSuccess:r,currentSessionIdRef:i}=e;n===i.current&&r(!0)}function QV(t,e){const{code:n,message:r}=t;console.error("Server error:",n,r)}const ZV={"message.created":VV,"message.updated":qV,"part.created":WV,"part.updated":GV,"part.append":KV,"chat.usage":YV,"compaction.complete":XV,error:QV};function JV(t,e){const{permissions:n}=t,{setPermissions:r}=e;r(n)}function eq(t,e){const{approvals:n}=t,{mergePendingPermissions:r}=e;r(n.map(i=>({toolCallId:i.toolCallId,sessionId:i.sessionId,toolName:i.toolName,args:i.args,permissionType:i.permissionType,permissionKey:i.permissionKey,message:i.message,details:i.details,dangerous:i.dangerous,childSessionId:i.childSessionId,subagentName:i.subagentName})))}function tq(t,e){const{permissionId:n}=t,{setPermissions:r}=e;r(i=>i.map(l=>l.id===n?{...l,revokedAt:new Date().toISOString()}:l))}function nq(t,e){const{setPermissions:n}=e;n(r=>{const i=new Date().toISOString();return r.map(l=>({...l,revokedAt:i}))})}function rq(t,e){const{sessionId:n,toolCallId:r,toolName:i,args:l,permissionType:c,permissionKey:a,message:u,details:d,dangerous:m,childSessionId:p,subagentName:g}=t,{addPendingPermission:_,sessionsRef:C,notifiedToolCallIdsRef:w,permissionSoundEnabledRef:y,playPermissionSound:S}=e;_({toolCallId:r,sessionId:n,toolName:i,args:l,permissionType:c,permissionKey:a,message:u,details:d,dangerous:m,childSessionId:p,subagentName:g});const x=C.current.find(k=>k.id===n);(x==null?void 0:x.parentId)===null&&y.current&&!w.current.has(r)&&(S(),w.current.add(r))}function sq(t,e){const{toolCallId:n}=t,{removePendingPermissionByToolCallId:r}=e;r(n)}function iq(t,e){const{sessionId:n,messages:r}=t,{setQueuedMessagesForSession:i}=e;i(n,r)}function oq(t,e){const{sessionId:n,message:r}=t,{addQueuedMessage:i}=e;i(n,r)}function aq(t,e){const{sessionId:n,queueId:r}=t,{removeQueuedMessageById:i}=e;i(n,r)}function lq(t,e){const{sessionId:n,queueId:r}=t,{removeQueuedMessageById:i}=e;i(n,r)}const cq={"permission.list":JV,"permissions.sync":eq,"permission.revoked":tq,"permission.all_revoked":nq,"permission.request":rq,"permission.granted":sq,"queue.list":iq,"queue.added":oq,"queue.removed":aq,"queue.sending":lq};function uq(t,e){const{provider:n,connected:r,authorizationUrl:i,error:l}=t,{setProviderStatuses:c}=e;c(a=>a.find(d=>d.provider===n)?a.map(d=>d.provider===n?{...d,connected:r,authorizationUrl:i,error:l}:d):[...a,{provider:n,connected:r,authorizationUrl:i,error:l}])}function dq(t,e){const{provider:n,connected:r,connectedAt:i,accountId:l}=t,{setProviderStatuses:c}=e;c(a=>a.map(u=>u.provider===n?{...u,connected:r,connectedAt:i,accountId:l}:u))}const fq={"provider.status":uq,"provider.connected":dq},oS=t=>t?Xn(t,"/api"):null;function hq(){var su,vl,iu,ou,au;const{servers:t,activeServer:e,addServer:n,removeServer:r,isSwitching:i,clearSwitchingState:l,quickConnections:c,isAddingServerRef:a,prepareForServerAdd:u,removeFromQuickConnectionsByWorkspace:d}=Qa(),{sessions:m,currentSession:p,setSessions:g,setCurrentSession:_,clearSessionState:C}=m5(ko(de=>({sessions:de.sessions,currentSession:de.currentSession,setSessions:de.setSessions,setCurrentSession:de.setCurrentSession,clearSessionState:de.clearSessionState}))),[w,y]=R.useState([]),[S,b]=R.useState([]),{setMessagesBySession:x,setPartsBySession:k}=sc(ko(de=>({setMessagesBySession:de.setMessagesBySession,setPartsBySession:de.setPartsBySession}))),j=p==null?void 0:p.id,N=sc(ko(de=>j?de.messagesBySession[j]||[]:[])),D=sc(ko(de=>j?de.partsBySession[j]||{}:{})),E=R.useRef({});R.useLayoutEffect(()=>{E.current=sc.getState().messagesBySession});const O=1,L=R.useRef(new Map),z=R.useRef(0),[H,$]=R.useState(null),q=R.useRef(null),G=R.useRef(null),W=R.useRef(null),X=R.useRef(null),Y=R.useRef(null),I=R.useRef(null),M=R.useRef(null),P=R.useRef(null),[F,B]=R.useState(!1),Q=R.useRef([]),{streamingSessionIds:J,interruptedSessions:ee,clearStreamingSessions:K,clearInterruptedSessions:V,addStreamingSession:te,removeStreamingSession:re,addInterruptedSession:ae,removeInterruptedSession:se}=tg(ko(de=>({streamingSessionIds:de.streamingSessionIds,interruptedSessions:de.interruptedSessions,clearStreamingSessions:de.clearStreamingSessions,clearInterruptedSessions:de.clearInterruptedSessions,addStreamingSession:de.addStreamingSession,removeStreamingSession:de.removeStreamingSession,addInterruptedSession:de.addInterruptedSession,removeInterruptedSession:de.removeInterruptedSession}))),[_e,Ee]=R.useState({promptTokens:0,completionTokens:0,totalTokens:0}),[De,Ue]=R.useState("gpt-4o"),[ce,je]=R.useState(null),[be,Ve]=R.useState([]),[qe,ye]=R.useState("gpt-4o");R.useEffect(()=>{var ft;const de=(ft=be.find(Ht=>Ht.id===De))==null?void 0:ft.variants;ce&&de&&!de[ce]&&je(null)},[De,ce,be]);const[Me,Re]=R.useState([]),[we,oe]=R.useState(null),me=zg(de=>de.setActiveWorkspace);R.useLayoutEffect(()=>{me(we)},[we,me]);const{showSettings:Ne,showMCPDialog:Le,showAddServer:Ge,showConfiguration:Ke,editServerData:Je,showFilesPanel:lt,setShowFilesPanel:Be,filesPanelWidth:We,setShowSettings:ze,setShowMCPDialog:rt,setShowAddServer:kt,setShowConfiguration:mn,setEditServerData:gn,setCompletion:Zt,clearCompletion:rn,clearAllCompletions:Jt,filePreviewTarget:ge,closeFilePreview:He}=qt(ko(de=>({showSettings:de.showSettings,showMCPDialog:de.showMCPDialog,showAddServer:de.showAddServer,showConfiguration:de.showConfiguration,editServerData:de.editServerData,showFilesPanel:de.showFilesPanel,setShowFilesPanel:de.setShowFilesPanel,filesPanelWidth:de.filesPanelWidth,setShowSettings:de.setShowSettings,setShowMCPDialog:de.setShowMCPDialog,setShowAddServer:de.setShowAddServer,setShowConfiguration:de.setShowConfiguration,setEditServerData:de.setEditServerData,setCompletion:de.setCompletion,clearCompletion:de.clearCompletion,clearAllCompletions:de.clearAllCompletions,filePreviewTarget:de.filePreviewTarget,closeFilePreview:de.closeFilePreview}))),[tt,Oe]=R.useState(()=>{const de=localStorage.getItem("jean2_sound_chat_finish_enabled");return de!==null?de==="true":!0}),[Ie,ot]=R.useState(()=>{const de=localStorage.getItem("jean2_sound_permission_enabled");return de!==null?de==="true":!0}),Tt=R.useRef(Ie);R.useLayoutEffect(()=>{Tt.current=Ie},[Ie]);const[Gt,Kt]=R.useState([]),[lr,An]=R.useState([]),{pendingPermissions:vn,queuedMessages:Nn,clearPendingPermissions:Rn,clearQueuedMessages:Mt,mergePendingPermissions:Nt,addPendingPermission:Dt,removePendingPermissionByToolCallId:jn,removePendingPermissionsBySessionId:bs,setQueuedMessagesForSession:Zs,addQueuedMessage:Js,removeQueuedMessageById:xs}=p5(ko(de=>({pendingPermissions:de.pendingPermissions,queuedMessages:de.queuedMessages,clearPendingPermissions:de.clearPendingPermissions,clearQueuedMessages:de.clearQueuedMessages,mergePendingPermissions:de.mergePendingPermissions,addPendingPermission:de.addPendingPermission,removePendingPermissionByToolCallId:de.removePendingPermissionByToolCallId,removePendingPermissionsBySessionId:de.removePendingPermissionsBySessionId,setQueuedMessagesForSession:de.setQueuedMessagesForSession,addQueuedMessage:de.addQueuedMessage,removeQueuedMessageById:de.removeQueuedMessageById}))),[kr,Er]=R.useState(null),[Bn,Wn]=R.useState(!1),[Gn,wn]=R.useState(0),[en,Ur]=R.useState(0),[_s,Zn]=R.useState(0),cr=(su=p==null?void 0:p.compacting)!=null?su:!1,[rs,Jn]=R.useState(!1),ur=R.useRef(new Set),ul=R.useRef(0),dr=R.useRef(new Map),Ar=R.useRef(new Map),yn=R.useRef(null),Tn=R.useRef(0),Vr=R.useRef(null),Xc=R.useCallback(()=>{if(yn.current!==null&&(cancelAnimationFrame(yn.current),yn.current=null),Vr.current!==null&&(clearTimeout(Vr.current),Vr.current=null),Ar.current.size===0)return;const de=new Map(Ar.current);Ar.current.clear(),Tn.current=Date.now(),k(ft=>{const Ht={...ft};let _t=!1;for(const[nn,St]of de){const Rt=dr.current.get(nn);if(!Rt)continue;const ao=Ht[Rt.sessionId];if(!ao)continue;const yl=ao[Rt.messageId];if(!yl)continue;const lo=yl[Rt.index];if(!lo||lo.type!=="text"&&lo.type!=="reasoning")continue;_t=!0;const lu=[...yl];lu[Rt.index]={...lo,text:lo.text+St},Ht[Rt.sessionId]={...ao,[Rt.messageId]:lu}}return _t?Ht:ft})},[k]),{playChatFinishSound:qo,playPermissionSound:dl}=zH(),Ss=R.useRef(new Set),Qc=R.useRef(null),Fn=R.useRef(tt);R.useLayoutEffect(()=>{Fn.current=tt},[tt]),R.useEffect(()=>{localStorage.setItem("jean2_sound_chat_finish_enabled",String(tt))},[tt]),R.useEffect(()=>{localStorage.setItem("jean2_sound_permission_enabled",String(Ie))},[Ie]),R.useLayoutEffect(()=>{const de=sc.getState().getMessagesBySessionKeysCount();if(de<=z.current){z.current=de;return}if(z.current=de,de<=O)return;const ft=E.current,Ht=Object.keys(ft);for(;Ht.length>O;){let _t=null,nn=1/0;for(const St of Ht){if(St===(p==null?void 0:p.id))continue;const Rt=L.current.get(St);Rt!==void 0&&Rt<nn&&(nn=Rt,_t=St)}if(!_t)break;L.current.delete(_t);for(const[St,Rt]of dr.current)Rt.sessionId===_t&&dr.current.delete(St);Ht.splice(Ht.indexOf(_t),1),x(St=>{if(!(_t in St))return St;const Rt={...St};return delete Rt[_t],Rt}),k(St=>{if(!(_t in St))return St;const Rt={...St};return delete Rt[_t],Rt})}},[p,x,k]);const Wo=R.useRef(null),[,Zc]=R.useState(!1),Yt=(vl=e==null?void 0:e.token)!=null?vl:null,It=(iu=e==null?void 0:e.url)!=null?iu:null;R.useEffect(()=>{q.current=H},[H]),R.useEffect(()=>{var de;G.current=(de=p==null?void 0:p.id)!=null?de:null},[p]),R.useEffect(()=>{ur.current.clear()},[p==null?void 0:p.id]),R.useLayoutEffect(()=>{Q.current=m},[m]);const Ji=R.useRef(null),Go=R.useRef(!1),ei=R.useCallback(de=>{var ft;(ft=Ji.current)==null||ft.call(Ji,de)},[]),th=R.useCallback(de=>{u(),n(de.name,de.url,de.token)},[n,u]),ti=R.useCallback(()=>{e&&r(e.id),q.current&&q.current.close(),$(null),B(!1),Wn(!1),wn(0),Ur(0)},[e,r]),Jc=R.useCallback(()=>{wn(de=>de+1),Wn(!1),Ur(0)},[]),ni=R.useCallback(()=>{ul.current+=1,q.current&&q.current.close(),$(null),B(!1),Wn(!1),wn(0),Ur(0),C(),y([]),x({}),k({}),L.current.clear(),z.current=0,Ss.current=new Set(tg.getState().streamingSessionIds),ur.current.clear(),K(),V(),Ee({promptTokens:0,completionTokens:0,totalTokens:0}),Ue("gpt-4o"),Ve([]),Re([]),oe(null),Kt([]),Rn(),Mt(),Jt(),dr.current.clear(),yn.current!==null&&(cancelAnimationFrame(yn.current),yn.current=null),Vr.current!==null&&(clearTimeout(Vr.current),Vr.current=null),Ar.current.clear(),Tn.current=0,Zn(de=>de+1)},[]);R.useEffect(()=>{var de;(e==null?void 0:e.id)!==Wo.current&&a.current&&(a.current=!1,Wo.current=(de=e==null?void 0:e.id)!=null?de:null,ni())},[e,ni,a]);const ri=R.useCallback(async(de,ft={})=>{if(!Yt)throw new Error("No API token available");const Ht=new Headers(ft.headers||{});Ht.set("Authorization",`Bearer ${Yt}`);const _t=await fetch(de,{...ft,signal:ft.signal,headers:Ht});if(_t.status===401)throw Er("Authentication failed. Your token may have been regenerated."),ti(),new Error("Unauthorized");return _t},[Yt,ti]),nh=R.useCallback(de=>de!==j?[]:N.map(ft=>({message:ft,parts:(D[ft.id]||[]).sort((Ht,_t)=>Ht.createdAt-_t.createdAt)})),[j,N,D]);VH({apiToken:Yt,serverUrl:It,wsRef:q,serverEpochRef:ul,currentSessionIdRef:G,clearPendingPermissions:Rn,handleLogout:ti,setWs:$,setConnected:B,setAuthError:Er,setConnectionTimedOut:Wn,setRetryCount:wn,setNextRetryIn:Ur,setReconnectTrigger:Zn,reconnectTrigger:_s,connected:F,connectionTimedOut:Bn,retryCount:Gn,onMessage:ei}),WH({apiToken:Yt,serverUrl:It,reconnectTrigger:_s,serverEpochRef:ul,fetchWithAuth:ri,clearSwitchingState:l,setSessions:g,setPreconfigs:y,setPrompts:b,setModels:Ve,setDefaultModel:ye,setProviderStatuses:An,setWorkspaces:Re,setActiveWorkspace:oe,activeWorkspace:we,setIsLoadingServerData:Zc,setAuthError:Er,pendingWorkspaceIdRef:Qc}),R.useEffect(()=>{if(!Ke&&Yt&&It){const de=Xn(It,"/api");Promise.all([ri(`${de}/preconfigs`).then(ft=>ft.json()),ri(`${de}/prompts`).then(ft=>ft.json()),ri(`${de}/models`).then(ft=>ft.json())]).then(([ft,Ht,_t])=>{y(ft.preconfigs||[]),b(Ht.prompts||[]),Ve((_t.models||[]).filter(nn=>{var St;return(St=nn.runtimeStatus)==null?void 0:St.usable})),ye(_t.defaultModel||"gpt-4o")}).catch(()=>{})}},[Ke]);const eo=async(de,ft,Ht)=>{const _t=oS(It);if(!_t)return;const Rt=(await(await ri(`${_t}/workspaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:de,path:ft,isVirtual:Ht})})).json()).workspace;return Re(ao=>[...ao,Rt]),oe(Rt),_(null),Rt},qr=de=>{oe(de),_(null)},fl=de=>{Qc.current=de},hl=async de=>{const ft=oS(It);if(!ft)return;const Ht=await ri(`${ft}/workspaces/${de}`,{method:"DELETE"});if(!Ht.ok){const nn=await Ht.json().catch(()=>({message:"Failed to delete workspace"}));console.error("Failed to delete workspace:",nn.message);return}const{deletedSessions:_t}=await Ht.json();d(de),p&&(p.workspaceId===de||_t.includes(p.id))&&_(null),g(nn=>nn.filter(St=>!_t.includes(St.id))),x(nn=>{const St={...nn};return _t.forEach(Rt=>delete St[Rt]),St}),k(nn=>{const St={...nn};return _t.forEach(Rt=>delete St[Rt]),St}),_t.forEach(nn=>L.current.delete(nn));for(const[nn,St]of dr.current)_t.includes(St.sessionId)&&dr.current.delete(nn);Re(nn=>{const St=nn.filter(Rt=>Rt.id!==de);return(we==null?void 0:we.id)===de&&oe(St[0]||null),St})},si=async()=>{const de=`Workspace ${Me.length+1}`,ft=`~/.jean2/workspaces/${crypto.randomUUID()}`;await eo(de,ft,!0)},ii=async de=>{const ft=de.split("/").pop()||de.split("\\").pop()||"Workspace";await eo(ft,de,!1)},oi=R.useMemo(()=>({setSessions:g,setCurrentSession:_,setMessagesBySession:x,setPartsBySession:k,setSessionUsage:Ee,setCurrentModel:Ue,setSelectedVariant:je,addStreamingSession:te,removeStreamingSession:re,addInterruptedSession:ae,removeInterruptedSession:se,setQueuedMessagesForSession:Zs,addQueuedMessage:Js,removeQueuedMessageById:xs,clearPendingPermissions:Rn,clearQueuedMessages:Mt,setCompactionSuccess:Jn,setCompletion:Zt,clearCompletion:rn,clearAllCompletions:Jt,pendingSessionCreateRef:Go,sessionAccessTimesRef:L,partIdIndexRef:dr,partAppendRafRef:yn,pendingPartAppendsRef:Ar,lastPartAppendFlushAtRef:Tn,partAppendTimeoutRef:Vr,skipFinishSoundSessionIdsRef:Ss,currentSessionIdRef:G,models:be,defaultModel:qe,interruptedSessions:ee,sessionsRef:Q,flushPendingPartAppends:Xc,setProviderStatuses:An,setPermissions:Kt,mergePendingPermissions:Nt,addPendingPermission:Dt,removePendingPermissionByToolCallId:jn,notifiedToolCallIdsRef:ur,permissionSoundEnabledRef:Tt,playPermissionSound:dl,chatFinishSoundEnabledRef:Fn,playChatFinishSound:qo}),[g,_,x,k,Ee,Ue,je,te,re,ae,se,Zs,Js,xs,Rn,Mt,Jn,Go,L,dr,yn,Ar,Tn,Vr,Ss,G,be,qe,ee,Q,Xc,An,Kt,Nt,Dt,jn,ur,Tt,dl,Zt,rn,Jt,Fn,qo]),Ko=R.useCallback(de=>{switch(de.type){case"session.created":case"session.resumed":case"session.closed":case"session.reopened":case"session.deleted":case"session.updated":case"session.renamed":case"session.interrupted":case"session.reverted":case"session.forked":case"session.state":UV[de.type](de,oi);break;case"message.created":case"message.updated":case"part.created":case"part.updated":case"part.append":case"chat.usage":case"compaction.complete":case"error":ZV[de.type](de,oi);break;case"permission.list":case"permissions.sync":case"permission.revoked":case"permission.all_revoked":case"permission.request":case"permission.granted":case"queue.list":case"queue.added":case"queue.removed":case"queue.sending":cq[de.type](de,oi);break;case"provider.status":case"provider.connected":fq[de.type](de,oi);break;default:{console.warn(`[handleServerMessage] Unknown message type: ${de.type}`);break}}},[oi]);R.useEffect(()=>{Ji.current=Ko},[Ko]);const to=w.filter(de=>de.mode!=="subagent"),{sendMessage:ai,createSession:Nr,resumeSession:Yo,closeSession:no,reopenSession:ss,permanentlyDeleteSession:pl,handleRenameSession:ro,revertSession:eu,forkSession:Xo,compactSession:Qo,removeFromQueue:tu,sendChatMessage:Hn,handlePermissionResponse:ws,handleInterruptSession:so,updateSessionPreconfig:io,updateSessionModel:rh,updateSessionVariant:ml,handleNavigateBack:gl,refreshPermissions:oo,createSessionInWorkspace:Zo}=e$({ws:H,currentSession:p,sessions:m,workspaces:Me,activeWorkspace:we,currentModel:De,streamingSessionIds:J,isCompacting:cr,primaryPreconfigs:to,setCurrentSession:_,setActiveWorkspace:oe,setCompactionSuccess:Jn,setCurrentModel:Ue,setSelectedVariant:je,removePendingPermissionByToolCallId:jn,removePendingPermissionsBySessionId:bs,clearStreamingSessions:K,pendingSessionCreateRef:Go,partAppendRafRef:yn,pendingPartAppendsRef:Ar,skipFinishSoundSessionIdsRef:Ss}),nu=m.filter(de=>de.workspaceId===(we==null?void 0:we.id)),sh=c.filter(de=>de.serverId===(e==null?void 0:e.id)&&de.workspaceId).map(de=>de.workspaceId),ih=p?nh(p.id):[],oh=p&&(ou=we==null?void 0:we.name)!=null?ou:"Jean2",Jo=qt(de=>de.setSidebarViewMode),ah=qt(de=>de.sessionsPanelWidth),ru=R.useCallback(de=>{const ft=qt.getState().sidebarViewMode,Ht=typeof de=="function"?de(ft):de;Jo(Ht),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var _t;(_t=I.current)==null||_t.focusSessionPanel()})})},[I,Jo]),lh=!(p!=null&&p.parentId),li=!!e;return h.jsxs(Nk,{panelId:"sessions",defaultOpen:!0,style:{"--sidebar-width":`${ah}px`},children:[h.jsx(m$,{sidebarRef:I,terminalPanelRef:X,filesPanelRef:Y,chatInputRef:W,activeWorkspace:we,primaryPreconfigs:to,handleInterruptSession:so,handleSidebarViewModeChange:ru,createSession:Nr,onToggleAutoFollow:()=>{var de;return(de=P.current)==null?void 0:de.toggle()}}),li&&h.jsx(yL,{ref:I,allSessions:m,favoritedWorkspaceIds:sh,sessions:nu,currentSession:p,currentSessionId:(au=p==null?void 0:p.id)!=null?au:null,streamingSessionIds:J,connected:F,workspaces:Me,activeWorkspace:we,onCreateSession:()=>{var de;return Nr((de=to[0])==null?void 0:de.id)},onResumeSession:Yo,onCloseSession:no,onReopenSession:ss,onDeleteSession:pl,onRenameSession:ro,onSelectWorkspace:qr,onCreateVirtualWorkspace:si,onCreatePhysicalWorkspace:ii,onDeleteWorkspace:hl,onOpenSettings:()=>ze(!0),onOpenMCP:()=>rt(!0),onOpenAddServer:()=>kt(!0),onOpenConfiguration:()=>mn(!0),onServerSwitch:ni,onEscape:()=>{var de;p&&((de=W.current)==null||de.focus())},onCreateSessionInWorkspace:Zo,pendingPermissions:vn}),li&&h.jsx(JE,{ref:Y,workspaceId:we==null?void 0:we.id,serverUrl:It!=null?It:void 0,apiToken:Yt!=null?Yt:void 0,isOpen:lt,onClose:()=>Be(!1)}),h.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:[h.jsx(g$,{headerTitle:oh,isLoggedIn:li,activeWorkspace:we,onServerSwitch:ni,onSelectWorkspace:fl,onSidebarViewModeChange:ru}),h.jsx(EV,{servers:t,activeServer:e,isSwitching:i,connected:F,authError:kr,connectionTimedOut:Bn,retryCount:Gn,nextRetryIn:en,serverUrl:It,currentSession:p,messagesWithParts:ih,queuedMessages:Nn,preconfigs:w,primaryPreconfigs:to,prompts:S,models:be,defaultModel:qe,selectedVariant:ce,pendingPermissions:vn,sessionUsage:_e,currentModel:De,streamingSessionIds:J,isCompacting:cr,compactionSuccess:rs,isPrimarySession:lh,inputRef:W,apiToken:Yt,onFirstServerAdded:th,onRetry:Jc,onLogout:ti,onSendMessage:Hn,onRemoveFromQueue:tu,onChangePreconfig:io,onChangeModel:rh,onChangeVariant:ml,onPermissionResponse:ws,onRename:ro,onNavigateToSubagent:Yo,onNavigateBack:gl,onInterrupt:so,onRevert:eu,onFork:Xo,onCompact:Qo,onClearCompactionSuccess:()=>Jn(!1),scrollToBottomRef:M,autoFollowToggleRef:P}),h.jsx(B$,{workspaceId:we==null?void 0:we.id,workspacePath:we==null?void 0:we.path,workspaceName:we==null?void 0:we.name,serverUrl:It!=null?It:void 0,apiToken:Yt!=null?Yt:void 0,terminalPanelRef:X})]}),li&&h.jsx("div",{"data-panel-gap":"files",className:`relative bg-transparent transition-[width] duration-200 ease-linear shrink-0 ${lt?"":"w-0"}`,style:{width:lt?We:0}}),li&&h.jsxs(h.Fragment,{children:[h.jsx(LL,{open:Ne,onOpenChange:ze,permissions:Gt,onRefreshPermissions:oo,onRevokePermission:de=>{ai("permission.revoke",{permissionId:de})},onRevokeAllPermissions:()=>{ai("permission.revoke_all",{workspaceId:we==null?void 0:we.id})},apiToken:Yt,onLogout:ti,chatFinishSoundEnabled:tt,onChatFinishSoundEnabledChange:Oe,permissionSoundEnabled:Ie,onPermissionSoundEnabledChange:ot,serverUrl:It}),h.jsx(HL,{open:Le,onOpenChange:rt,workspaceId:we==null?void 0:we.id,workspacePath:we==null?void 0:we.path,serverUrl:It!=null?It:void 0,apiToken:Yt!=null?Yt:void 0}),h.jsx(XL,{open:Ke,onOpenChange:mn,serverUrl:It,apiToken:Yt})]}),h.jsx(QL,{open:Ge,onOpenChange:de=>{kt(de),de||gn(null)},editServer:Je}),li&&h.jsx(TH,{workspaceId:we==null?void 0:we.id,target:ge,serverUrl:It!=null?It:void 0,apiToken:Yt!=null?Yt:void 0,open:ge!==null,onOpenChange:de=>{de||He()}})]})}function pq(){const t=he.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(k5,{children:h.jsx(hq,{})}),t[0]=e):e=t[0],e}document.addEventListener("dragover",t=>t.preventDefault());document.addEventListener("drop",t=>t.preventDefault());V4.createRoot(document.getElementById("root")).render(h.jsx(R.StrictMode,{children:h.jsx(K4,{defaultMode:"system",defaultScheme:"neutral",children:h.jsx(pq,{})})}));