kanna-code 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/index-BBq_6S76.js +503 -0
- package/dist/client/assets/index-C6-Y890P.css +32 -0
- package/dist/client/index.html +2 -2
- package/package.json +2 -2
- package/src/server/cli-runtime.test.ts +21 -1
- package/src/server/cli-runtime.ts +4 -0
- package/src/server/event-store.test.ts +22 -0
- package/src/server/event-store.ts +52 -44
- package/src/server/keybindings.test.ts +132 -0
- package/src/server/keybindings.ts +175 -0
- package/src/server/server.ts +5 -6
- package/src/server/ws-router.test.ts +107 -63
- package/src/server/ws-router.ts +22 -35
- package/src/shared/branding.test.ts +31 -0
- package/src/shared/branding.ts +41 -6
- package/src/shared/protocol.ts +6 -20
- package/src/shared/types.ts +30 -33
- package/dist/client/assets/index-Yjf7kxJf.js +0 -533
- package/dist/client/assets/index-gEOLdGK-.css +0 -32
- package/src/server/file-tree-manager.test.ts +0 -116
- package/src/server/file-tree-manager.ts +0 -372
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
var x3=Object.defineProperty;var FS=e=>{throw TypeError(e)};var S3=(e,t,n)=>t in e?x3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var en=(e,t,n)=>S3(e,typeof t!="symbol"?t+"":t,n),US=(e,t,n)=>t.has(e)||FS("Cannot "+n);var yc=(e,t,n)=>(US(e,t,"read from private field"),n?n.call(e):t.get(e)),$S=(e,t,n)=>t.has(e)?FS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),WS=(e,t,n,r)=>(US(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function w3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function Df(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Eg={exports:{}},bc={};/**
|
|
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 qS;function C3(){if(qS)return bc;qS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:a}}return bc.Fragment=t,bc.jsx=n,bc.jsxs=n,bc}var VS;function k3(){return VS||(VS=1,Eg.exports=C3()),Eg.exports}var g=k3(),Rg={exports:{}},Ie={};/**
|
|
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 KS;function E3(){if(KS)return Ie;KS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),_=Symbol.iterator;function y(P){return P===null||typeof P!="object"?null:(P=_&&P[_]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function k(P,Z,D){this.props=P,this.context=Z,this.refs=C,this.updater=D||S}k.prototype.isReactComponent={},k.prototype.setState=function(P,Z){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,Z,"setState")},k.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function T(){}T.prototype=k.prototype;function R(P,Z,D){this.props=P,this.context=Z,this.refs=C,this.updater=D||S}var M=R.prototype=new T;M.constructor=R,w(M,k.prototype),M.isPureReactComponent=!0;var L=Array.isArray;function O(){}var z={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function G(P,Z,D){var K=D.ref;return{$$typeof:e,type:P,key:Z,ref:K!==void 0?K:null,props:D}}function B(P,Z){return G(P.type,Z,P.props)}function $(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function I(P){var Z={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(D){return Z[D]})}var U=/\/+/g;function V(P,Z){return typeof P=="object"&&P!==null&&P.key!=null?I(""+P.key):Z.toString(36)}function F(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(O,O):(P.status="pending",P.then(function(Z){P.status==="pending"&&(P.status="fulfilled",P.value=Z)},function(Z){P.status==="pending"&&(P.status="rejected",P.reason=Z)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function j(P,Z,D,K,ee){var ie=typeof P;(ie==="undefined"||ie==="boolean")&&(P=null);var ge=!1;if(P===null)ge=!0;else switch(ie){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(P.$$typeof){case e:case t:ge=!0;break;case p:return ge=P._init,j(ge(P._payload),Z,D,K,ee)}}if(ge)return ee=ee(P),ge=K===""?"."+V(P,0):K,L(ee)?(D="",ge!=null&&(D=ge.replace(U,"$&/")+"/"),j(ee,Z,D,"",function(ke){return ke})):ee!=null&&($(ee)&&(ee=B(ee,D+(ee.key==null||P&&P.key===ee.key?"":(""+ee.key).replace(U,"$&/")+"/")+ge)),Z.push(ee)),1;ge=0;var Te=K===""?".":K+":";if(L(P))for(var ve=0;ve<P.length;ve++)K=P[ve],ie=Te+V(K,ve),ge+=j(K,Z,D,ie,ee);else if(ve=y(P),typeof ve=="function")for(P=ve.call(P),ve=0;!(K=P.next()).done;)K=K.value,ie=Te+V(K,ve++),ge+=j(K,Z,D,ie,ee);else if(ie==="object"){if(typeof P.then=="function")return j(F(P),Z,D,K,ee);throw Z=String(P),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return ge}function Y(P,Z,D){if(P==null)return P;var K=[],ee=0;return j(P,K,"","",function(ie){return Z.call(D,ie,ee++)}),K}function W(P){if(P._status===-1){var Z=P._result;Z=Z(),Z.then(function(D){(P._status===0||P._status===-1)&&(P._status=1,P._result=D)},function(D){(P._status===0||P._status===-1)&&(P._status=2,P._result=D)}),P._status===-1&&(P._status=0,P._result=Z)}if(P._status===1)return P._result.default;throw P._result}var Q=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=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(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},A={map:Y,forEach:function(P,Z,D){Y(P,function(){Z.apply(this,arguments)},D)},count:function(P){var Z=0;return Y(P,function(){Z++}),Z},toArray:function(P){return Y(P,function(Z){return Z})||[]},only:function(P){if(!$(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Ie.Activity=m,Ie.Children=A,Ie.Component=k,Ie.Fragment=n,Ie.Profiler=s,Ie.PureComponent=R,Ie.StrictMode=r,Ie.Suspense=d,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(P){return z.H.useMemoCache(P)}},Ie.cache=function(P){return function(){return P.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(P,Z,D){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var K=w({},P.props),ee=P.key;if(Z!=null)for(ie in Z.key!==void 0&&(ee=""+Z.key),Z)!H.call(Z,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&Z.ref===void 0||(K[ie]=Z[ie]);var ie=arguments.length-2;if(ie===1)K.children=D;else if(1<ie){for(var ge=Array(ie),Te=0;Te<ie;Te++)ge[Te]=arguments[Te+2];K.children=ge}return G(P.type,ee,K)},Ie.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:a,_context:P},P},Ie.createElement=function(P,Z,D){var K,ee={},ie=null;if(Z!=null)for(K in Z.key!==void 0&&(ie=""+Z.key),Z)H.call(Z,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(ee[K]=Z[K]);var ge=arguments.length-2;if(ge===1)ee.children=D;else if(1<ge){for(var Te=Array(ge),ve=0;ve<ge;ve++)Te[ve]=arguments[ve+2];ee.children=Te}if(P&&P.defaultProps)for(K in ge=P.defaultProps,ge)ee[K]===void 0&&(ee[K]=ge[K]);return G(P,ie,ee)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(P){return{$$typeof:u,render:P}},Ie.isValidElement=$,Ie.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:W}},Ie.memo=function(P,Z){return{$$typeof:h,type:P,compare:Z===void 0?null:Z}},Ie.startTransition=function(P){var Z=z.T,D={};z.T=D;try{var K=P(),ee=z.S;ee!==null&&ee(D,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(O,Q)}catch(ie){Q(ie)}finally{Z!==null&&D.types!==null&&(Z.types=D.types),z.T=Z}},Ie.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Ie.use=function(P){return z.H.use(P)},Ie.useActionState=function(P,Z,D){return z.H.useActionState(P,Z,D)},Ie.useCallback=function(P,Z){return z.H.useCallback(P,Z)},Ie.useContext=function(P){return z.H.useContext(P)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(P,Z){return z.H.useDeferredValue(P,Z)},Ie.useEffect=function(P,Z){return z.H.useEffect(P,Z)},Ie.useEffectEvent=function(P){return z.H.useEffectEvent(P)},Ie.useId=function(){return z.H.useId()},Ie.useImperativeHandle=function(P,Z,D){return z.H.useImperativeHandle(P,Z,D)},Ie.useInsertionEffect=function(P,Z){return z.H.useInsertionEffect(P,Z)},Ie.useLayoutEffect=function(P,Z){return z.H.useLayoutEffect(P,Z)},Ie.useMemo=function(P,Z){return z.H.useMemo(P,Z)},Ie.useOptimistic=function(P,Z){return z.H.useOptimistic(P,Z)},Ie.useReducer=function(P,Z,D){return z.H.useReducer(P,Z,D)},Ie.useRef=function(P){return z.H.useRef(P)},Ie.useState=function(P){return z.H.useState(P)},Ie.useSyncExternalStore=function(P,Z,D){return z.H.useSyncExternalStore(P,Z,D)},Ie.useTransition=function(){return z.H.useTransition()},Ie.version="19.2.1",Ie}var GS;function cy(){return GS||(GS=1,Rg.exports=E3()),Rg.exports}var x=cy();const bt=Df(x),Uk=w3({__proto__:null,default:bt},[x]);var Tg={exports:{}},xc={},Mg={exports:{}},Ag={};/**
|
|
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 YS;function R3(){return YS||(YS=1,(function(e){function t(j,Y){var W=j.length;j.push(Y);e:for(;0<W;){var Q=W-1>>>1,A=j[Q];if(0<s(A,Y))j[Q]=Y,j[W]=A,W=Q;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var Y=j[0],W=j.pop();if(W!==Y){j[0]=W;e:for(var Q=0,A=j.length,P=A>>>1;Q<P;){var Z=2*(Q+1)-1,D=j[Z],K=Z+1,ee=j[K];if(0>s(D,W))K<A&&0>s(ee,D)?(j[Q]=ee,j[K]=W,Q=K):(j[Q]=D,j[Z]=W,Q=Z);else if(K<A&&0>s(ee,W))j[Q]=ee,j[K]=W,Q=K;else break e}}return Y}function s(j,Y){var W=j.sortIndex-Y.sortIndex;return W!==0?W:j.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],h=[],p=1,m=null,_=3,y=!1,S=!1,w=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function M(j){for(var Y=n(h);Y!==null;){if(Y.callback===null)r(h);else if(Y.startTime<=j)r(h),Y.sortIndex=Y.expirationTime,t(d,Y);else break;Y=n(h)}}function L(j){if(w=!1,M(j),!S)if(n(d)!==null)S=!0,O||(O=!0,I());else{var Y=n(h);Y!==null&&F(L,Y.startTime-j)}}var O=!1,z=-1,H=5,G=-1;function B(){return C?!0:!(e.unstable_now()-G<H)}function $(){if(C=!1,O){var j=e.unstable_now();G=j;var Y=!0;try{e:{S=!1,w&&(w=!1,T(z),z=-1),y=!0;var W=_;try{t:{for(M(j),m=n(d);m!==null&&!(m.expirationTime>j&&B());){var Q=m.callback;if(typeof Q=="function"){m.callback=null,_=m.priorityLevel;var A=Q(m.expirationTime<=j);if(j=e.unstable_now(),typeof A=="function"){m.callback=A,M(j),Y=!0;break t}m===n(d)&&r(d),M(j)}else r(d);m=n(d)}if(m!==null)Y=!0;else{var P=n(h);P!==null&&F(L,P.startTime-j),Y=!1}}break e}finally{m=null,_=W,y=!1}Y=void 0}}finally{Y?I():O=!1}}}var I;if(typeof R=="function")I=function(){R($)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=$,I=function(){V.postMessage(null)}}else I=function(){k($,0)};function F(j,Y){z=k(function(){j(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(j){switch(_){case 1:case 2:case 3:var Y=3;break;default:Y=_}var W=_;_=Y;try{return j()}finally{_=W}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(j,Y){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var W=_;_=j;try{return Y()}finally{_=W}},e.unstable_scheduleCallback=function(j,Y,W){var Q=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Q+W:Q):W=Q,j){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=W+A,j={id:p++,callback:Y,priorityLevel:j,startTime:W,expirationTime:A,sortIndex:-1},W>Q?(j.sortIndex=W,t(h,j),n(d)===null&&j===n(h)&&(w?(T(z),z=-1):w=!0,F(L,W-Q))):(j.sortIndex=A,t(d,j),S||y||(S=!0,O||(O=!0,I()))),j},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(j){var Y=_;return function(){var W=_;_=Y;try{return j.apply(this,arguments)}finally{_=W}}}})(Ag)),Ag}var XS;function T3(){return XS||(XS=1,Mg.exports=R3()),Mg.exports}var Ng={exports:{}},Tn={};/**
|
|
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 ZS;function M3(){if(ZS)return Tn;ZS=1;var e=cy();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+h+" 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(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(d,h,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:d,containerInfo:h,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Tn.createPortal=function(d,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return a(d,h,null,p)},Tn.flushSync=function(d){var h=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=h,r.p=p,r.d.f()}},Tn.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},Tn.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Tn.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var p=h.as,m=u(p,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:_,fetchPriority:y}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:_,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Tn.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=u(h.as,h.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(d)},Tn.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,m=u(p,h.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Tn.preloadModule=function(d,h){if(typeof d=="string")if(h){var p=u(h.as,h.crossOrigin);r.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(d)},Tn.requestFormReset=function(d){r.d.r(d)},Tn.unstable_batchedUpdates=function(d,h){return d(h)},Tn.useFormState=function(d,h,p){return l.H.useFormState(d,h,p)},Tn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Tn.version="19.2.1",Tn}var QS;function $k(){if(QS)return Ng.exports;QS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ng.exports=M3(),Ng.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 JS;function A3(){if(JS)return xc;JS=1;var e=T3(),t=cy(),n=$k();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function d(i){if(a(i)!==i)throw Error(r(188))}function h(i){var o=i.alternate;if(!o){if(o=a(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,f=o;;){var v=c.return;if(v===null)break;var b=v.alternate;if(b===null){if(f=v.return,f!==null){c=f;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===c)return d(v),i;if(b===f)return d(v),o;b=b.sibling}throw Error(r(188))}if(c.return!==f.return)c=v,f=b;else{for(var E=!1,N=v.child;N;){if(N===c){E=!0,c=v,f=b;break}if(N===f){E=!0,f=v,c=b;break}N=N.sibling}if(!E){for(N=b.child;N;){if(N===c){E=!0,c=b,f=v;break}if(N===f){E=!0,f=b,c=v;break}N=N.sibling}if(!E)throw Error(r(189))}}if(c.alternate!==f)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:o}function p(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=p(i),o!==null)return o;i=i.sibling}return null}var m=Object.assign,_=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function I(i){return i===null||typeof i!="object"?null:(i=$&&i[$]||i["@@iterator"],typeof i=="function"?i:null)}var U=Symbol.for("react.client.reference");function V(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===U?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case O:return"SuspenseList";case G:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case R:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case M:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case z:return o=i.displayName||null,o!==null?o:V(i.type)||"Memo";case H:o=i._payload,i=i._init;try{return V(i(o))}catch{}}return null}var F=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},Q=[],A=-1;function P(i){return{current:i}}function Z(i){0>A||(i.current=Q[A],Q[A]=null,A--)}function D(i,o){A++,Q[A]=i.current,i.current=o}var K=P(null),ee=P(null),ie=P(null),ge=P(null);function Te(i,o){switch(D(ie,o),D(ee,i),D(K,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?uS(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=uS(o),i=hS(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Z(K),D(K,i)}function ve(){Z(K),Z(ee),Z(ie)}function ke(i){i.memoizedState!==null&&D(ge,i);var o=K.current,c=hS(o,i.type);o!==c&&(D(ee,i),D(K,c))}function We(i){ee.current===i&&(Z(K),Z(ee)),ge.current===i&&(Z(ge),mc._currentValue=W)}var fe,_e;function He(i){if(fe===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);fe=o&&o[1]||"",_e=-1<c.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+fe+i+_e}var he=!1;function et(i,o){if(!i||he)return"";he=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={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(se){var re=se}Reflect.construct(i,[],ce)}else{try{ce.call()}catch(se){re=se}i.call(ce.prototype)}}else{try{throw Error()}catch(se){re=se}(ce=i())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(se){if(se&&re&&typeof se.stack=="string")return[se.stack,re.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=f.DetermineComponentFrameRoot(),E=b[0],N=b[1];if(E&&N){var q=E.split(`
|
|
44
|
+
`),ne=N.split(`
|
|
45
|
+
`);for(v=f=0;f<q.length&&!q[f].includes("DetermineComponentFrameRoot");)f++;for(;v<ne.length&&!ne[v].includes("DetermineComponentFrameRoot");)v++;if(f===q.length||v===ne.length)for(f=q.length-1,v=ne.length-1;1<=f&&0<=v&&q[f]!==ne[v];)v--;for(;1<=f&&0<=v;f--,v--)if(q[f]!==ne[v]){if(f!==1||v!==1)do if(f--,v--,0>v||q[f]!==ne[v]){var ae=`
|
|
46
|
+
`+q[f].replace(" at new "," at ");return i.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",i.displayName)),ae}while(1<=f&&0<=v);break}}}finally{he=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?He(c):""}function gt(i,o){switch(i.tag){case 26:case 27:case 5:return He(i.type);case 16:return He("Lazy");case 13:return i.child!==o&&o!==null?He("Suspense Fallback"):He("Suspense");case 19:return He("SuspenseList");case 0:case 15:return et(i.type,!1);case 11:return et(i.type.render,!1);case 1:return et(i.type,!0);case 31:return He("Activity");default:return""}}function Wn(i){try{var o="",c=null;do o+=gt(i,c),c=i,i=i.return;while(i);return o}catch(f){return`
|
|
47
|
+
Error generating stack: `+f.message+`
|
|
48
|
+
`+f.stack}}var Zt=Object.prototype.hasOwnProperty,jt=e.unstable_scheduleCallback,qn=e.unstable_cancelCallback,Sr=e.unstable_shouldYield,cs=e.unstable_requestPaint,$t=e.unstable_now,io=e.unstable_getCurrentPriorityLevel,oe=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,Ae=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,Ze=e.unstable_IdlePriority,xt=e.log,On=e.unstable_setDisableYieldValue,de=null,ye=null;function Oe(i){if(typeof xt=="function"&&On(i),ye&&typeof ye.setStrictMode=="function")try{ye.setStrictMode(de,i)}catch{}}var Ne=Math.clz32?Math.clz32:gp,ut=Math.log,Ln=Math.LN2;function gp(i){return i>>>=0,i===0?32:31-(ut(i)/Ln|0)|0}var Jo=256,ea=262144,Bt=4194304;function Pt(i){var o=i&42;if(o!==0)return o;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function an(i,o,c){var f=i.pendingLanes;if(f===0)return 0;var v=0,b=i.suspendedLanes,E=i.pingedLanes;i=i.warmLanes;var N=f&134217727;return N!==0?(f=N&~b,f!==0?v=Pt(f):(E&=N,E!==0?v=Pt(E):c||(c=N&~i,c!==0&&(v=Pt(c))))):(N=f&~b,N!==0?v=Pt(N):E!==0?v=Pt(E):c||(c=f&~i,c!==0&&(v=Pt(c)))),v===0?0:o!==0&&o!==v&&(o&b)===0&&(b=v&-v,c=o&-o,b>=c||b===32&&(c&4194048)!==0)?o:v}function Vn(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Kn(i,o){switch(i){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 Rn(){var i=Bt;return Bt<<=1,(Bt&62914560)===0&&(Bt=4194304),i}function Gn(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function wr(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Qt(i,o,c,f,v,b){var E=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var N=i.entanglements,q=i.expirationTimes,ne=i.hiddenUpdates;for(c=E&~c;0<c;){var ae=31-Ne(c),ce=1<<ae;N[ae]=0,q[ae]=-1;var re=ne[ae];if(re!==null)for(ne[ae]=null,ae=0;ae<re.length;ae++){var se=re[ae];se!==null&&(se.lane&=-536870913)}c&=~ce}f!==0&&Vr(i,f,0),b!==0&&v===0&&i.tag!==0&&(i.suspendedLanes|=b&~(E&~o))}function Vr(i,o,c){i.pendingLanes|=o,i.suspendedLanes&=~o;var f=31-Ne(o);i.entangledLanes|=o,i.entanglements[f]=i.entanglements[f]|1073741824|c&261930}function ar(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var f=31-Ne(c),v=1<<f;v&o|i[f]&o&&(i[f]|=o),c&=~v}}function Cr(i,o){var c=o&-o;return c=(c&42)!==0?1:Ti(c),(c&(i.suspendedLanes|o))!==0?0:c}function Ti(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Mi(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Kr(){var i=Y.p;return i!==0?i:(i=window.event,i===void 0?32:LS(i.type))}function us(i,o){var c=Y.p;try{return Y.p=i,o()}finally{Y.p=c}}var kr=Math.random().toString(36).slice(2),yn="__reactFiber$"+kr,Yn="__reactProps$"+kr,ta="__reactContainer$"+kr,vp="__reactEvents$"+kr,uN="__reactListeners$"+kr,hN="__reactHandles$"+kr,Zb="__reactResources$"+kr,Al="__reactMarker$"+kr;function _p(i){delete i[yn],delete i[Yn],delete i[vp],delete i[uN],delete i[hN]}function na(i){var o=i[yn];if(o)return o;for(var c=i.parentNode;c;){if(o=c[ta]||c[yn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=_S(i);i!==null;){if(c=i[yn])return c;i=_S(i)}return o}i=c,c=i.parentNode}return null}function ra(i){if(i=i[yn]||i[ta]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Nl(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function ia(i){var o=i[Zb];return o||(o=i[Zb]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function ln(i){i[Al]=!0}var Qb=new Set,Jb={};function so(i,o){sa(i,o),sa(i+"Capture",o)}function sa(i,o){for(Jb[i]=o,i=0;i<o.length;i++)Qb.add(o[i])}var dN=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]*$"),e0={},t0={};function fN(i){return Zt.call(t0,i)?!0:Zt.call(e0,i)?!1:dN.test(i)?t0[i]=!0:(e0[i]=!0,!1)}function $u(i,o,c){if(fN(o))if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var f=o.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+c)}}function Wu(i,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+c)}}function Ai(i,o,c,f){if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(o,c,""+f)}}function Er(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function n0(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function pN(i,o,c){var f=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var v=f.get,b=f.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return v.call(this)},set:function(E){c=""+E,b.call(this,E)}}),Object.defineProperty(i,o,{enumerable:f.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function yp(i){if(!i._valueTracker){var o=n0(i)?"checked":"value";i._valueTracker=pN(i,o,""+i[o])}}function r0(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),f="";return i&&(f=n0(i)?i.checked?"true":"false":i.value),i=f,i!==c?(o.setValue(i),!0):!1}function qu(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var mN=/[\n"\\]/g;function Rr(i){return i.replace(mN,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function bp(i,o,c,f,v,b,E,N){i.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.type=E:i.removeAttribute("type"),o!=null?E==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+Er(o)):i.value!==""+Er(o)&&(i.value=""+Er(o)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),o!=null?xp(i,E,Er(o)):c!=null?xp(i,E,Er(c)):f!=null&&i.removeAttribute("value"),v==null&&b!=null&&(i.defaultChecked=!!b),v!=null&&(i.checked=v&&typeof v!="function"&&typeof v!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+Er(N):i.removeAttribute("name")}function i0(i,o,c,f,v,b,E,N){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.type=b),o!=null||c!=null){if(!(b!=="submit"&&b!=="reset"||o!=null)){yp(i);return}c=c!=null?""+Er(c):"",o=o!=null?""+Er(o):c,N||o===i.value||(i.value=o),i.defaultValue=o}f=f??v,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=N?i.checked:!!f,i.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),yp(i)}function xp(i,o,c){o==="number"&&qu(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function oa(i,o,c,f){if(i=i.options,o){o={};for(var v=0;v<c.length;v++)o["$"+c[v]]=!0;for(c=0;c<i.length;c++)v=o.hasOwnProperty("$"+i[c].value),i[c].selected!==v&&(i[c].selected=v),v&&f&&(i[c].defaultSelected=!0)}else{for(c=""+Er(c),o=null,v=0;v<i.length;v++){if(i[v].value===c){i[v].selected=!0,f&&(i[v].defaultSelected=!0);return}o!==null||i[v].disabled||(o=i[v])}o!==null&&(o.selected=!0)}}function s0(i,o,c){if(o!=null&&(o=""+Er(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+Er(c):""}function o0(i,o,c,f){if(o==null){if(f!=null){if(c!=null)throw Error(r(92));if(F(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),o=c}c=Er(o),i.defaultValue=c,f=i.textContent,f===c&&f!==""&&f!==null&&(i.value=f),yp(i)}function aa(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var gN=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 a0(i,o,c){var f=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?f?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":f?i.setProperty(o,c):typeof c!="number"||c===0||gN.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function l0(i,o,c){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,c!=null){for(var f in c)!c.hasOwnProperty(f)||o!=null&&o.hasOwnProperty(f)||(f.indexOf("--")===0?i.setProperty(f,""):f==="float"?i.cssFloat="":i[f]="");for(var v in o)f=o[v],o.hasOwnProperty(v)&&c[v]!==f&&a0(i,v,f)}else for(var b in o)o.hasOwnProperty(b)&&a0(i,b,o[b])}function Sp(i){if(i.indexOf("-")===-1)return!1;switch(i){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 vN=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"]]),_N=/^[\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 Vu(i){return _N.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ni(){}var wp=null;function Cp(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var la=null,ca=null;function c0(i){var o=ra(i);if(o&&(i=o.stateNode)){var c=i[Yn]||null;e:switch(i=o.stateNode,o.type){case"input":if(bp(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Rr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var f=c[o];if(f!==i&&f.form===i.form){var v=f[Yn]||null;if(!v)throw Error(r(90));bp(f,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(o=0;o<c.length;o++)f=c[o],f.form===i.form&&r0(f)}break e;case"textarea":s0(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&oa(i,!!c.multiple,o,!1)}}}var kp=!1;function u0(i,o,c){if(kp)return i(o,c);kp=!0;try{var f=i(o);return f}finally{if(kp=!1,(la!==null||ca!==null)&&(Oh(),la&&(o=la,i=ca,ca=la=null,c0(o),i)))for(o=0;o<i.length;o++)c0(i[o])}}function Dl(i,o){var c=i.stateNode;if(c===null)return null;var f=c[Yn]||null;if(f===null)return null;c=f[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":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,o,typeof c));return c}var Di=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ep=!1;if(Di)try{var Ol={};Object.defineProperty(Ol,"passive",{get:function(){Ep=!0}}),window.addEventListener("test",Ol,Ol),window.removeEventListener("test",Ol,Ol)}catch{Ep=!1}var hs=null,Rp=null,Ku=null;function h0(){if(Ku)return Ku;var i,o=Rp,c=o.length,f,v="value"in hs?hs.value:hs.textContent,b=v.length;for(i=0;i<c&&o[i]===v[i];i++);var E=c-i;for(f=1;f<=E&&o[c-f]===v[b-f];f++);return Ku=v.slice(i,1<f?1-f:void 0)}function Gu(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Yu(){return!0}function d0(){return!1}function Xn(i){function o(c,f,v,b,E){this._reactName=c,this._targetInst=v,this.type=f,this.nativeEvent=b,this.target=E,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(c=i[N],this[N]=c?c(b):b[N]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Yu:d0,this.isPropagationStopped=d0,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Yu)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Yu)},persist:function(){},isPersistent:Yu}),o}var oo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xu=Xn(oo),Ll=m({},oo,{view:0,detail:0}),yN=Xn(Ll),Tp,Mp,zl,Zu=m({},Ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Np,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==zl&&(zl&&i.type==="mousemove"?(Tp=i.screenX-zl.screenX,Mp=i.screenY-zl.screenY):Mp=Tp=0,zl=i),Tp)},movementY:function(i){return"movementY"in i?i.movementY:Mp}}),f0=Xn(Zu),bN=m({},Zu,{dataTransfer:0}),xN=Xn(bN),SN=m({},Ll,{relatedTarget:0}),Ap=Xn(SN),wN=m({},oo,{animationName:0,elapsedTime:0,pseudoElement:0}),CN=Xn(wN),kN=m({},oo,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),EN=Xn(kN),RN=m({},oo,{data:0}),p0=Xn(RN),TN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MN={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"},AN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NN(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=AN[i])?!!o[i]:!1}function Np(){return NN}var DN=m({},Ll,{key:function(i){if(i.key){var o=TN[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Gu(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?MN[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Np,charCode:function(i){return i.type==="keypress"?Gu(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Gu(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),ON=Xn(DN),LN=m({},Zu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),m0=Xn(LN),zN=m({},Ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Np}),jN=Xn(zN),BN=m({},oo,{propertyName:0,elapsedTime:0,pseudoElement:0}),PN=Xn(BN),IN=m({},Zu,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),HN=Xn(IN),FN=m({},oo,{newState:0,oldState:0}),UN=Xn(FN),$N=[9,13,27,32],Dp=Di&&"CompositionEvent"in window,jl=null;Di&&"documentMode"in document&&(jl=document.documentMode);var WN=Di&&"TextEvent"in window&&!jl,g0=Di&&(!Dp||jl&&8<jl&&11>=jl),v0=" ",_0=!1;function y0(i,o){switch(i){case"keyup":return $N.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ua=!1;function qN(i,o){switch(i){case"compositionend":return b0(o);case"keypress":return o.which!==32?null:(_0=!0,v0);case"textInput":return i=o.data,i===v0&&_0?null:i;default:return null}}function VN(i,o){if(ua)return i==="compositionend"||!Dp&&y0(i,o)?(i=h0(),Ku=Rp=hs=null,ua=!1,i):null;switch(i){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 g0&&o.locale!=="ko"?null:o.data;default:return null}}var KN={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 x0(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!KN[i.type]:o==="textarea"}function S0(i,o,c,f){la?ca?ca.push(f):ca=[f]:la=f,o=Hh(o,"onChange"),0<o.length&&(c=new Xu("onChange","change",null,c,f),i.push({event:c,listeners:o}))}var Bl=null,Pl=null;function GN(i){iS(i,0)}function Qu(i){var o=Nl(i);if(r0(o))return i}function w0(i,o){if(i==="change")return o}var C0=!1;if(Di){var Op;if(Di){var Lp="oninput"in document;if(!Lp){var k0=document.createElement("div");k0.setAttribute("oninput","return;"),Lp=typeof k0.oninput=="function"}Op=Lp}else Op=!1;C0=Op&&(!document.documentMode||9<document.documentMode)}function E0(){Bl&&(Bl.detachEvent("onpropertychange",R0),Pl=Bl=null)}function R0(i){if(i.propertyName==="value"&&Qu(Pl)){var o=[];S0(o,Pl,i,Cp(i)),u0(GN,o)}}function YN(i,o,c){i==="focusin"?(E0(),Bl=o,Pl=c,Bl.attachEvent("onpropertychange",R0)):i==="focusout"&&E0()}function XN(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Qu(Pl)}function ZN(i,o){if(i==="click")return Qu(o)}function QN(i,o){if(i==="input"||i==="change")return Qu(o)}function JN(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var lr=typeof Object.is=="function"?Object.is:JN;function Il(i,o){if(lr(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),f=Object.keys(o);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var v=c[f];if(!Zt.call(o,v)||!lr(i[v],o[v]))return!1}return!0}function T0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function M0(i,o){var c=T0(i);i=0;for(var f;c;){if(c.nodeType===3){if(f=i+c.textContent.length,i<=o&&f>=o)return{node:c,offset:o-i};i=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=T0(c)}}function A0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?A0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function N0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=qu(i.document);o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)i=o.contentWindow;else break;o=qu(i.document)}return o}function zp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var eD=Di&&"documentMode"in document&&11>=document.documentMode,ha=null,jp=null,Hl=null,Bp=!1;function D0(i,o,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Bp||ha==null||ha!==qu(f)||(f=ha,"selectionStart"in f&&zp(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Hl&&Il(Hl,f)||(Hl=f,f=Hh(jp,"onSelect"),0<f.length&&(o=new Xu("onSelect","select",null,o,c),i.push({event:o,listeners:f}),o.target=ha)))}function ao(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var da={animationend:ao("Animation","AnimationEnd"),animationiteration:ao("Animation","AnimationIteration"),animationstart:ao("Animation","AnimationStart"),transitionrun:ao("Transition","TransitionRun"),transitionstart:ao("Transition","TransitionStart"),transitioncancel:ao("Transition","TransitionCancel"),transitionend:ao("Transition","TransitionEnd")},Pp={},O0={};Di&&(O0=document.createElement("div").style,"AnimationEvent"in window||(delete da.animationend.animation,delete da.animationiteration.animation,delete da.animationstart.animation),"TransitionEvent"in window||delete da.transitionend.transition);function lo(i){if(Pp[i])return Pp[i];if(!da[i])return i;var o=da[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in O0)return Pp[i]=o[c];return i}var L0=lo("animationend"),z0=lo("animationiteration"),j0=lo("animationstart"),tD=lo("transitionrun"),nD=lo("transitionstart"),rD=lo("transitioncancel"),B0=lo("transitionend"),P0=new Map,Ip="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(" ");Ip.push("scrollEnd");function Gr(i,o){P0.set(i,o),so(o,[i])}var Ju=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Tr=[],fa=0,Hp=0;function eh(){for(var i=fa,o=Hp=fa=0;o<i;){var c=Tr[o];Tr[o++]=null;var f=Tr[o];Tr[o++]=null;var v=Tr[o];Tr[o++]=null;var b=Tr[o];if(Tr[o++]=null,f!==null&&v!==null){var E=f.pending;E===null?v.next=v:(v.next=E.next,E.next=v),f.pending=v}b!==0&&I0(c,v,b)}}function th(i,o,c,f){Tr[fa++]=i,Tr[fa++]=o,Tr[fa++]=c,Tr[fa++]=f,Hp|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function Fp(i,o,c,f){return th(i,o,c,f),nh(i)}function co(i,o){return th(i,null,null,o),nh(i)}function I0(i,o,c){i.lanes|=c;var f=i.alternate;f!==null&&(f.lanes|=c);for(var v=!1,b=i.return;b!==null;)b.childLanes|=c,f=b.alternate,f!==null&&(f.childLanes|=c),b.tag===22&&(i=b.stateNode,i===null||i._visibility&1||(v=!0)),i=b,b=b.return;return i.tag===3?(b=i.stateNode,v&&o!==null&&(v=31-Ne(c),i=b.hiddenUpdates,f=i[v],f===null?i[v]=[o]:f.push(o),o.lane=c|536870912),b):null}function nh(i){if(50<lc)throw lc=0,Xm=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var pa={};function iD(i,o,c,f){this.tag=i,this.key=c,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=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cr(i,o,c,f){return new iD(i,o,c,f)}function Up(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Oi(i,o){var c=i.alternate;return c===null?(c=cr(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function H0(i,o){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,o=c.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function rh(i,o,c,f,v,b){var E=0;if(f=i,typeof i=="function")Up(i)&&(E=1);else if(typeof i=="string")E=c3(i,c,K.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case G:return i=cr(31,c,o,v),i.elementType=G,i.lanes=b,i;case w:return uo(c.children,v,b,o);case C:E=8,v|=24;break;case k:return i=cr(12,c,o,v|2),i.elementType=k,i.lanes=b,i;case L:return i=cr(13,c,o,v),i.elementType=L,i.lanes=b,i;case O:return i=cr(19,c,o,v),i.elementType=O,i.lanes=b,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:E=10;break e;case T:E=9;break e;case M:E=11;break e;case z:E=14;break e;case H:E=16,f=null;break e}E=29,c=Error(r(130,i===null?"null":typeof i,"")),f=null}return o=cr(E,c,o,v),o.elementType=i,o.type=f,o.lanes=b,o}function uo(i,o,c,f){return i=cr(7,i,f,o),i.lanes=c,i}function $p(i,o,c){return i=cr(6,i,null,o),i.lanes=c,i}function F0(i){var o=cr(18,null,null,0);return o.stateNode=i,o}function Wp(i,o,c){return o=cr(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var U0=new WeakMap;function Mr(i,o){if(typeof i=="object"&&i!==null){var c=U0.get(i);return c!==void 0?c:(o={value:i,source:o,stack:Wn(o)},U0.set(i,o),o)}return{value:i,source:o,stack:Wn(o)}}var ma=[],ga=0,ih=null,Fl=0,Ar=[],Nr=0,ds=null,ai=1,li="";function Li(i,o){ma[ga++]=Fl,ma[ga++]=ih,ih=i,Fl=o}function $0(i,o,c){Ar[Nr++]=ai,Ar[Nr++]=li,Ar[Nr++]=ds,ds=i;var f=ai;i=li;var v=32-Ne(f)-1;f&=~(1<<v),c+=1;var b=32-Ne(o)+v;if(30<b){var E=v-v%5;b=(f&(1<<E)-1).toString(32),f>>=E,v-=E,ai=1<<32-Ne(o)+v|c<<v|f,li=b+i}else ai=1<<b|c<<v|f,li=i}function qp(i){i.return!==null&&(Li(i,1),$0(i,1,0))}function Vp(i){for(;i===ih;)ih=ma[--ga],ma[ga]=null,Fl=ma[--ga],ma[ga]=null;for(;i===ds;)ds=Ar[--Nr],Ar[Nr]=null,li=Ar[--Nr],Ar[Nr]=null,ai=Ar[--Nr],Ar[Nr]=null}function W0(i,o){Ar[Nr++]=ai,Ar[Nr++]=li,Ar[Nr++]=ds,ai=o.id,li=o.overflow,ds=i}var bn=null,St=null,tt=!1,fs=null,Dr=!1,Kp=Error(r(519));function ps(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ul(Mr(o,i)),Kp}function q0(i){var o=i.stateNode,c=i.type,f=i.memoizedProps;switch(o[yn]=i,o[Yn]=f,c){case"dialog":Ye("cancel",o),Ye("close",o);break;case"iframe":case"object":case"embed":Ye("load",o);break;case"video":case"audio":for(c=0;c<uc.length;c++)Ye(uc[c],o);break;case"source":Ye("error",o);break;case"img":case"image":case"link":Ye("error",o),Ye("load",o);break;case"details":Ye("toggle",o);break;case"input":Ye("invalid",o),i0(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Ye("invalid",o);break;case"textarea":Ye("invalid",o),o0(o,f.value,f.defaultValue,f.children)}c=f.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||f.suppressHydrationWarning===!0||lS(o.textContent,c)?(f.popover!=null&&(Ye("beforetoggle",o),Ye("toggle",o)),f.onScroll!=null&&Ye("scroll",o),f.onScrollEnd!=null&&Ye("scrollend",o),f.onClick!=null&&(o.onclick=Ni),o=!0):o=!1,o||ps(i,!0)}function V0(i){for(bn=i.return;bn;)switch(bn.tag){case 5:case 31:case 13:Dr=!1;return;case 27:case 3:Dr=!0;return;default:bn=bn.return}}function va(i){if(i!==bn)return!1;if(!tt)return V0(i),tt=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||hg(i.type,i.memoizedProps)),c=!c),c&&St&&ps(i),V0(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=vS(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=vS(i)}else o===27?(o=St,Ts(i.type)?(i=gg,gg=null,St=i):St=o):St=bn?Lr(i.stateNode.nextSibling):null;return!0}function ho(){St=bn=null,tt=!1}function Gp(){var i=fs;return i!==null&&(er===null?er=i:er.push.apply(er,i),fs=null),i}function Ul(i){fs===null?fs=[i]:fs.push(i)}var Yp=P(null),fo=null,zi=null;function ms(i,o,c){D(Yp,o._currentValue),o._currentValue=c}function ji(i){i._currentValue=Yp.current,Z(Yp)}function Xp(i,o,c){for(;i!==null;){var f=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),i===c)break;i=i.return}}function Zp(i,o,c,f){var v=i.child;for(v!==null&&(v.return=i);v!==null;){var b=v.dependencies;if(b!==null){var E=v.child;b=b.firstContext;e:for(;b!==null;){var N=b;b=v;for(var q=0;q<o.length;q++)if(N.context===o[q]){b.lanes|=c,N=b.alternate,N!==null&&(N.lanes|=c),Xp(b.return,c,i),f||(E=null);break e}b=N.next}}else if(v.tag===18){if(E=v.return,E===null)throw Error(r(341));E.lanes|=c,b=E.alternate,b!==null&&(b.lanes|=c),Xp(E,c,i),E=null}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===i){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}}function _a(i,o,c,f){i=null;for(var v=o,b=!1;v!==null;){if(!b){if((v.flags&524288)!==0)b=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var E=v.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var N=v.type;lr(v.pendingProps.value,E.value)||(i!==null?i.push(N):i=[N])}}else if(v===ge.current){if(E=v.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(i!==null?i.push(mc):i=[mc])}v=v.return}i!==null&&Zp(o,i,c,f),o.flags|=262144}function sh(i){for(i=i.firstContext;i!==null;){if(!lr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function po(i){fo=i,zi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function xn(i){return K0(fo,i)}function oh(i,o){return fo===null&&po(i),K0(i,o)}function K0(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},zi===null){if(i===null)throw Error(r(308));zi=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else zi=zi.next=o;return c}var sD=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(c,f){i.push(f)}};this.abort=function(){o.aborted=!0,i.forEach(function(c){return c()})}},oD=e.unstable_scheduleCallback,aD=e.unstable_NormalPriority,Wt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qp(){return{controller:new sD,data:new Map,refCount:0}}function $l(i){i.refCount--,i.refCount===0&&oD(aD,function(){i.controller.abort()})}var Wl=null,Jp=0,ya=0,ba=null;function lD(i,o){if(Wl===null){var c=Wl=[];Jp=0,ya=ng(),ba={status:"pending",value:void 0,then:function(f){c.push(f)}}}return Jp++,o.then(G0,G0),o}function G0(){if(--Jp===0&&Wl!==null){ba!==null&&(ba.status="fulfilled");var i=Wl;Wl=null,ya=0,ba=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function cD(i,o){var c=[],f={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return i.then(function(){f.status="fulfilled",f.value=o;for(var v=0;v<c.length;v++)(0,c[v])(o)},function(v){for(f.status="rejected",f.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),f}var Y0=j.S;j.S=function(i,o){D1=$t(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&lD(i,o),Y0!==null&&Y0(i,o)};var mo=P(null);function em(){var i=mo.current;return i!==null?i:vt.pooledCache}function ah(i,o){o===null?D(mo,mo.current):D(mo,o.pool)}function X0(){var i=em();return i===null?null:{parent:Wt._currentValue,pool:i}}var xa=Error(r(460)),tm=Error(r(474)),lh=Error(r(542)),ch={then:function(){}};function Z0(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Q0(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Ni,Ni),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,ex(i),i;default:if(typeof o.status=="string")o.then(Ni,Ni);else{if(i=vt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(f){if(o.status==="pending"){var v=o;v.status="fulfilled",v.value=f}},function(f){if(o.status==="pending"){var v=o;v.status="rejected",v.reason=f}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,ex(i),i}throw vo=o,xa}}function go(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(vo=c,xa):c}}var vo=null;function J0(){if(vo===null)throw Error(r(459));var i=vo;return vo=null,i}function ex(i){if(i===xa||i===lh)throw Error(r(483))}var Sa=null,ql=0;function uh(i){var o=ql;return ql+=1,Sa===null&&(Sa=[]),Q0(Sa,i,o)}function Vl(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function hh(i,o){throw o.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function tx(i){function o(J,X){if(i){var te=J.deletions;te===null?(J.deletions=[X],J.flags|=16):te.push(X)}}function c(J,X){if(!i)return null;for(;X!==null;)o(J,X),X=X.sibling;return null}function f(J){for(var X=new Map;J!==null;)J.key!==null?X.set(J.key,J):X.set(J.index,J),J=J.sibling;return X}function v(J,X){return J=Oi(J,X),J.index=0,J.sibling=null,J}function b(J,X,te){return J.index=te,i?(te=J.alternate,te!==null?(te=te.index,te<X?(J.flags|=67108866,X):te):(J.flags|=67108866,X)):(J.flags|=1048576,X)}function E(J){return i&&J.alternate===null&&(J.flags|=67108866),J}function N(J,X,te,le){return X===null||X.tag!==6?(X=$p(te,J.mode,le),X.return=J,X):(X=v(X,te),X.return=J,X)}function q(J,X,te,le){var De=te.type;return De===w?ae(J,X,te.props.children,le,te.key):X!==null&&(X.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===H&&go(De)===X.type)?(X=v(X,te.props),Vl(X,te),X.return=J,X):(X=rh(te.type,te.key,te.props,null,J.mode,le),Vl(X,te),X.return=J,X)}function ne(J,X,te,le){return X===null||X.tag!==4||X.stateNode.containerInfo!==te.containerInfo||X.stateNode.implementation!==te.implementation?(X=Wp(te,J.mode,le),X.return=J,X):(X=v(X,te.children||[]),X.return=J,X)}function ae(J,X,te,le,De){return X===null||X.tag!==7?(X=uo(te,J.mode,le,De),X.return=J,X):(X=v(X,te),X.return=J,X)}function ce(J,X,te){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=$p(""+X,J.mode,te),X.return=J,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case y:return te=rh(X.type,X.key,X.props,null,J.mode,te),Vl(te,X),te.return=J,te;case S:return X=Wp(X,J.mode,te),X.return=J,X;case H:return X=go(X),ce(J,X,te)}if(F(X)||I(X))return X=uo(X,J.mode,te,null),X.return=J,X;if(typeof X.then=="function")return ce(J,uh(X),te);if(X.$$typeof===R)return ce(J,oh(J,X),te);hh(J,X)}return null}function re(J,X,te,le){var De=X!==null?X.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return De!==null?null:N(J,X,""+te,le);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return te.key===De?q(J,X,te,le):null;case S:return te.key===De?ne(J,X,te,le):null;case H:return te=go(te),re(J,X,te,le)}if(F(te)||I(te))return De!==null?null:ae(J,X,te,le,null);if(typeof te.then=="function")return re(J,X,uh(te),le);if(te.$$typeof===R)return re(J,X,oh(J,te),le);hh(J,te)}return null}function se(J,X,te,le,De){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return J=J.get(te)||null,N(X,J,""+le,De);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case y:return J=J.get(le.key===null?te:le.key)||null,q(X,J,le,De);case S:return J=J.get(le.key===null?te:le.key)||null,ne(X,J,le,De);case H:return le=go(le),se(J,X,te,le,De)}if(F(le)||I(le))return J=J.get(te)||null,ae(X,J,le,De,null);if(typeof le.then=="function")return se(J,X,te,uh(le),De);if(le.$$typeof===R)return se(J,X,te,oh(X,le),De);hh(X,le)}return null}function we(J,X,te,le){for(var De=null,it=null,Re=X,Ue=X=0,Je=null;Re!==null&&Ue<te.length;Ue++){Re.index>Ue?(Je=Re,Re=null):Je=Re.sibling;var st=re(J,Re,te[Ue],le);if(st===null){Re===null&&(Re=Je);break}i&&Re&&st.alternate===null&&o(J,Re),X=b(st,X,Ue),it===null?De=st:it.sibling=st,it=st,Re=Je}if(Ue===te.length)return c(J,Re),tt&&Li(J,Ue),De;if(Re===null){for(;Ue<te.length;Ue++)Re=ce(J,te[Ue],le),Re!==null&&(X=b(Re,X,Ue),it===null?De=Re:it.sibling=Re,it=Re);return tt&&Li(J,Ue),De}for(Re=f(Re);Ue<te.length;Ue++)Je=se(Re,J,Ue,te[Ue],le),Je!==null&&(i&&Je.alternate!==null&&Re.delete(Je.key===null?Ue:Je.key),X=b(Je,X,Ue),it===null?De=Je:it.sibling=Je,it=Je);return i&&Re.forEach(function(Os){return o(J,Os)}),tt&&Li(J,Ue),De}function ze(J,X,te,le){if(te==null)throw Error(r(151));for(var De=null,it=null,Re=X,Ue=X=0,Je=null,st=te.next();Re!==null&&!st.done;Ue++,st=te.next()){Re.index>Ue?(Je=Re,Re=null):Je=Re.sibling;var Os=re(J,Re,st.value,le);if(Os===null){Re===null&&(Re=Je);break}i&&Re&&Os.alternate===null&&o(J,Re),X=b(Os,X,Ue),it===null?De=Os:it.sibling=Os,it=Os,Re=Je}if(st.done)return c(J,Re),tt&&Li(J,Ue),De;if(Re===null){for(;!st.done;Ue++,st=te.next())st=ce(J,st.value,le),st!==null&&(X=b(st,X,Ue),it===null?De=st:it.sibling=st,it=st);return tt&&Li(J,Ue),De}for(Re=f(Re);!st.done;Ue++,st=te.next())st=se(Re,J,Ue,st.value,le),st!==null&&(i&&st.alternate!==null&&Re.delete(st.key===null?Ue:st.key),X=b(st,X,Ue),it===null?De=st:it.sibling=st,it=st);return i&&Re.forEach(function(b3){return o(J,b3)}),tt&&Li(J,Ue),De}function ft(J,X,te,le){if(typeof te=="object"&&te!==null&&te.type===w&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case y:e:{for(var De=te.key;X!==null;){if(X.key===De){if(De=te.type,De===w){if(X.tag===7){c(J,X.sibling),le=v(X,te.props.children),le.return=J,J=le;break e}}else if(X.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===H&&go(De)===X.type){c(J,X.sibling),le=v(X,te.props),Vl(le,te),le.return=J,J=le;break e}c(J,X);break}else o(J,X);X=X.sibling}te.type===w?(le=uo(te.props.children,J.mode,le,te.key),le.return=J,J=le):(le=rh(te.type,te.key,te.props,null,J.mode,le),Vl(le,te),le.return=J,J=le)}return E(J);case S:e:{for(De=te.key;X!==null;){if(X.key===De)if(X.tag===4&&X.stateNode.containerInfo===te.containerInfo&&X.stateNode.implementation===te.implementation){c(J,X.sibling),le=v(X,te.children||[]),le.return=J,J=le;break e}else{c(J,X);break}else o(J,X);X=X.sibling}le=Wp(te,J.mode,le),le.return=J,J=le}return E(J);case H:return te=go(te),ft(J,X,te,le)}if(F(te))return we(J,X,te,le);if(I(te)){if(De=I(te),typeof De!="function")throw Error(r(150));return te=De.call(te),ze(J,X,te,le)}if(typeof te.then=="function")return ft(J,X,uh(te),le);if(te.$$typeof===R)return ft(J,X,oh(J,te),le);hh(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,X!==null&&X.tag===6?(c(J,X.sibling),le=v(X,te),le.return=J,J=le):(c(J,X),le=$p(te,J.mode,le),le.return=J,J=le),E(J)):c(J,X)}return function(J,X,te,le){try{ql=0;var De=ft(J,X,te,le);return Sa=null,De}catch(Re){if(Re===xa||Re===lh)throw Re;var it=cr(29,Re,null,J.mode);return it.lanes=le,it.return=J,it}finally{}}}var _o=tx(!0),nx=tx(!1),gs=!1;function nm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rm(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function vs(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function _s(i,o,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(ot&2)!==0){var v=f.pending;return v===null?o.next=o:(o.next=v.next,v.next=o),f.pending=o,o=nh(i),I0(i,null,c),o}return th(i,f,o,c),nh(i)}function Kl(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,ar(i,c)}}function im(i,o){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var v=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};b===null?v=b=E:b=b.next=E,c=c.next}while(c!==null);b===null?v=b=o:b=b.next=o}else v=b=o;c={baseState:f.baseState,firstBaseUpdate:v,lastBaseUpdate:b,shared:f.shared,callbacks:f.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}var sm=!1;function Gl(){if(sm){var i=ba;if(i!==null)throw i}}function Yl(i,o,c,f){sm=!1;var v=i.updateQueue;gs=!1;var b=v.firstBaseUpdate,E=v.lastBaseUpdate,N=v.shared.pending;if(N!==null){v.shared.pending=null;var q=N,ne=q.next;q.next=null,E===null?b=ne:E.next=ne,E=q;var ae=i.alternate;ae!==null&&(ae=ae.updateQueue,N=ae.lastBaseUpdate,N!==E&&(N===null?ae.firstBaseUpdate=ne:N.next=ne,ae.lastBaseUpdate=q))}if(b!==null){var ce=v.baseState;E=0,ae=ne=q=null,N=b;do{var re=N.lane&-536870913,se=re!==N.lane;if(se?(Qe&re)===re:(f&re)===re){re!==0&&re===ya&&(sm=!0),ae!==null&&(ae=ae.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var we=i,ze=N;re=o;var ft=c;switch(ze.tag){case 1:if(we=ze.payload,typeof we=="function"){ce=we.call(ft,ce,re);break e}ce=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ze.payload,re=typeof we=="function"?we.call(ft,ce,re):we,re==null)break e;ce=m({},ce,re);break e;case 2:gs=!0}}re=N.callback,re!==null&&(i.flags|=64,se&&(i.flags|=8192),se=v.callbacks,se===null?v.callbacks=[re]:se.push(re))}else se={lane:re,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ae===null?(ne=ae=se,q=ce):ae=ae.next=se,E|=re;if(N=N.next,N===null){if(N=v.shared.pending,N===null)break;se=N,N=se.next,se.next=null,v.lastBaseUpdate=se,v.shared.pending=null}}while(!0);ae===null&&(q=ce),v.baseState=q,v.firstBaseUpdate=ne,v.lastBaseUpdate=ae,b===null&&(v.shared.lanes=0),ws|=E,i.lanes=E,i.memoizedState=ce}}function rx(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function ix(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)rx(c[i],o)}var wa=P(null),dh=P(0);function sx(i,o){i=qi,D(dh,i),D(wa,o),qi=i|o.baseLanes}function om(){D(dh,qi),D(wa,wa.current)}function am(){qi=dh.current,Z(wa),Z(dh)}var ur=P(null),Or=null;function ys(i){var o=i.alternate;D(It,It.current&1),D(ur,i),Or===null&&(o===null||wa.current!==null||o.memoizedState!==null)&&(Or=i)}function lm(i){D(It,It.current),D(ur,i),Or===null&&(Or=i)}function ox(i){i.tag===22?(D(It,It.current),D(ur,i),Or===null&&(Or=i)):bs()}function bs(){D(It,It.current),D(ur,ur.current)}function hr(i){Z(ur),Or===i&&(Or=null),Z(It)}var It=P(0);function fh(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||pg(c)||mg(c)))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===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Bi=0,Fe=null,ht=null,qt=null,ph=!1,Ca=!1,yo=!1,mh=0,Xl=0,ka=null,uD=0;function Nt(){throw Error(r(321))}function cm(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!lr(i[c],o[c]))return!1;return!0}function um(i,o,c,f,v,b){return Bi=b,Fe=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,j.H=i===null||i.memoizedState===null?$x:km,yo=!1,b=c(f,v),yo=!1,Ca&&(b=lx(o,c,f,v)),ax(i),b}function ax(i){j.H=Jl;var o=ht!==null&&ht.next!==null;if(Bi=0,qt=ht=Fe=null,ph=!1,Xl=0,ka=null,o)throw Error(r(300));i===null||Vt||(i=i.dependencies,i!==null&&sh(i)&&(Vt=!0))}function lx(i,o,c,f){Fe=i;var v=0;do{if(Ca&&(ka=null),Xl=0,Ca=!1,25<=v)throw Error(r(301));if(v+=1,qt=ht=null,i.updateQueue!=null){var b=i.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}j.H=Wx,b=o(c,f)}while(Ca);return b}function hD(){var i=j.H,o=i.useState()[0];return o=typeof o.then=="function"?Zl(o):o,i=i.useState()[0],(ht!==null?ht.memoizedState:null)!==i&&(Fe.flags|=1024),o}function hm(){var i=mh!==0;return mh=0,i}function dm(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function fm(i){if(ph){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}ph=!1}Bi=0,qt=ht=Fe=null,Ca=!1,Xl=mh=0,ka=null}function zn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?Fe.memoizedState=qt=i:qt=qt.next=i,qt}function Ht(){if(ht===null){var i=Fe.alternate;i=i!==null?i.memoizedState:null}else i=ht.next;var o=qt===null?Fe.memoizedState:qt.next;if(o!==null)qt=o,ht=i;else{if(i===null)throw Fe.alternate===null?Error(r(467)):Error(r(310));ht=i,i={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},qt===null?Fe.memoizedState=qt=i:qt=qt.next=i}return qt}function gh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zl(i){var o=Xl;return Xl+=1,ka===null&&(ka=[]),i=Q0(ka,i,o),o=Fe,(qt===null?o.memoizedState:qt.next)===null&&(o=o.alternate,j.H=o===null||o.memoizedState===null?$x:km),i}function vh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Zl(i);if(i.$$typeof===R)return xn(i)}throw Error(r(438,String(i)))}function pm(i){var o=null,c=Fe.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var f=Fe.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(o={data:f.data.map(function(v){return v.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=gh(),Fe.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(i),f=0;f<i;f++)c[f]=B;return o.index++,c}function Pi(i,o){return typeof o=="function"?o(i):o}function _h(i){var o=Ht();return mm(o,ht,i)}function mm(i,o,c){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=c;var v=i.baseQueue,b=f.pending;if(b!==null){if(v!==null){var E=v.next;v.next=b.next,b.next=E}o.baseQueue=v=b,f.pending=null}if(b=i.baseState,v===null)i.memoizedState=b;else{o=v.next;var N=E=null,q=null,ne=o,ae=!1;do{var ce=ne.lane&-536870913;if(ce!==ne.lane?(Qe&ce)===ce:(Bi&ce)===ce){var re=ne.revertLane;if(re===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ce===ya&&(ae=!0);else if((Bi&re)===re){ne=ne.next,re===ya&&(ae=!0);continue}else ce={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},q===null?(N=q=ce,E=b):q=q.next=ce,Fe.lanes|=re,ws|=re;ce=ne.action,yo&&c(b,ce),b=ne.hasEagerState?ne.eagerState:c(b,ce)}else re={lane:ce,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},q===null?(N=q=re,E=b):q=q.next=re,Fe.lanes|=ce,ws|=ce;ne=ne.next}while(ne!==null&&ne!==o);if(q===null?E=b:q.next=N,!lr(b,i.memoizedState)&&(Vt=!0,ae&&(c=ba,c!==null)))throw c;i.memoizedState=b,i.baseState=E,i.baseQueue=q,f.lastRenderedState=b}return v===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function gm(i){var o=Ht(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=c.dispatch,v=c.pending,b=o.memoizedState;if(v!==null){c.pending=null;var E=v=v.next;do b=i(b,E.action),E=E.next;while(E!==v);lr(b,o.memoizedState)||(Vt=!0),o.memoizedState=b,o.baseQueue===null&&(o.baseState=b),c.lastRenderedState=b}return[b,f]}function cx(i,o,c){var f=Fe,v=Ht(),b=tt;if(b){if(c===void 0)throw Error(r(407));c=c()}else c=o();var E=!lr((ht||v).memoizedState,c);if(E&&(v.memoizedState=c,Vt=!0),v=v.queue,ym(dx.bind(null,f,v,i),[i]),v.getSnapshot!==o||E||qt!==null&&qt.memoizedState.tag&1){if(f.flags|=2048,Ea(9,{destroy:void 0},hx.bind(null,f,v,c,o),null),vt===null)throw Error(r(349));b||(Bi&127)!==0||ux(f,o,c)}return c}function ux(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=Fe.updateQueue,o===null?(o=gh(),Fe.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function hx(i,o,c,f){o.value=c,o.getSnapshot=f,fx(o)&&px(i)}function dx(i,o,c){return c(function(){fx(o)&&px(i)})}function fx(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!lr(i,c)}catch{return!0}}function px(i){var o=co(i,2);o!==null&&tr(o,i,2)}function vm(i){var o=zn();if(typeof i=="function"){var c=i;if(i=c(),yo){Oe(!0);try{c()}finally{Oe(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:i},o}function mx(i,o,c,f){return i.baseState=c,mm(i,ht,typeof f=="function"?f:Pi)}function dD(i,o,c,f,v){if(xh(i))throw Error(r(485));if(i=o.action,i!==null){var b={payload:v,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){b.listeners.push(E)}};j.T!==null?c(!0):b.isTransition=!1,f(b),c=o.pending,c===null?(b.next=o.pending=b,gx(o,b)):(b.next=c.next,o.pending=c.next=b)}}function gx(i,o){var c=o.action,f=o.payload,v=i.state;if(o.isTransition){var b=j.T,E={};j.T=E;try{var N=c(v,f),q=j.S;q!==null&&q(E,N),vx(i,o,N)}catch(ne){_m(i,o,ne)}finally{b!==null&&E.types!==null&&(b.types=E.types),j.T=b}}else try{b=c(v,f),vx(i,o,b)}catch(ne){_m(i,o,ne)}}function vx(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){_x(i,o,f)},function(f){return _m(i,o,f)}):_x(i,o,c)}function _x(i,o,c){o.status="fulfilled",o.value=c,yx(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,gx(i,c)))}function _m(i,o,c){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do o.status="rejected",o.reason=c,yx(o),o=o.next;while(o!==f)}i.action=null}function yx(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function bx(i,o){return o}function xx(i,o){if(tt){var c=vt.formState;if(c!==null){e:{var f=Fe;if(tt){if(St){t:{for(var v=St,b=Dr;v.nodeType!==8;){if(!b){v=null;break t}if(v=Lr(v.nextSibling),v===null){v=null;break t}}b=v.data,v=b==="F!"||b==="F"?v:null}if(v){St=Lr(v.nextSibling),f=v.data==="F!";break e}}ps(f)}f=!1}f&&(o=c[0])}}return c=zn(),c.memoizedState=c.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bx,lastRenderedState:o},c.queue=f,c=Hx.bind(null,Fe,f),f.dispatch=c,f=vm(!1),b=Cm.bind(null,Fe,!1,f.queue),f=zn(),v={state:o,dispatch:null,action:i,pending:null},f.queue=v,c=dD.bind(null,Fe,v,b,c),v.dispatch=c,f.memoizedState=i,[o,c,!1]}function Sx(i){var o=Ht();return wx(o,ht,i)}function wx(i,o,c){if(o=mm(i,o,bx)[0],i=_h(Pi)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=Zl(o)}catch(E){throw E===xa?lh:E}else f=o;o=Ht();var v=o.queue,b=v.dispatch;return c!==o.memoizedState&&(Fe.flags|=2048,Ea(9,{destroy:void 0},fD.bind(null,v,c),null)),[f,b,i]}function fD(i,o){i.action=o}function Cx(i){var o=Ht(),c=ht;if(c!==null)return wx(o,c,i);Ht(),o=o.memoizedState,c=Ht();var f=c.queue.dispatch;return c.memoizedState=i,[o,f,!1]}function Ea(i,o,c,f){return i={tag:i,create:c,deps:f,inst:o,next:null},o=Fe.updateQueue,o===null&&(o=gh(),Fe.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=i.next=i:(f=c.next,c.next=i,i.next=f,o.lastEffect=i),i}function kx(){return Ht().memoizedState}function yh(i,o,c,f){var v=zn();Fe.flags|=i,v.memoizedState=Ea(1|o,{destroy:void 0},c,f===void 0?null:f)}function bh(i,o,c,f){var v=Ht();f=f===void 0?null:f;var b=v.memoizedState.inst;ht!==null&&f!==null&&cm(f,ht.memoizedState.deps)?v.memoizedState=Ea(o,b,c,f):(Fe.flags|=i,v.memoizedState=Ea(1|o,b,c,f))}function Ex(i,o){yh(8390656,8,i,o)}function ym(i,o){bh(2048,8,i,o)}function pD(i){Fe.flags|=4;var o=Fe.updateQueue;if(o===null)o=gh(),Fe.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function Rx(i){var o=Ht().memoizedState;return pD({ref:o,nextImpl:i}),function(){if((ot&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function Tx(i,o){return bh(4,2,i,o)}function Mx(i,o){return bh(4,4,i,o)}function Ax(i,o){if(typeof o=="function"){i=i();var c=o(i);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function Nx(i,o,c){c=c!=null?c.concat([i]):null,bh(4,4,Ax.bind(null,o,i),c)}function bm(){}function Dx(i,o){var c=Ht();o=o===void 0?null:o;var f=c.memoizedState;return o!==null&&cm(o,f[1])?f[0]:(c.memoizedState=[i,o],i)}function Ox(i,o){var c=Ht();o=o===void 0?null:o;var f=c.memoizedState;if(o!==null&&cm(o,f[1]))return f[0];if(f=i(),yo){Oe(!0);try{i()}finally{Oe(!1)}}return c.memoizedState=[f,o],f}function xm(i,o,c){return c===void 0||(Bi&1073741824)!==0&&(Qe&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=L1(),Fe.lanes|=i,ws|=i,c)}function Lx(i,o,c,f){return lr(c,o)?c:wa.current!==null?(i=xm(i,c,f),lr(i,o)||(Vt=!0),i):(Bi&42)===0||(Bi&1073741824)!==0&&(Qe&261930)===0?(Vt=!0,i.memoizedState=c):(i=L1(),Fe.lanes|=i,ws|=i,o)}function zx(i,o,c,f,v){var b=Y.p;Y.p=b!==0&&8>b?b:8;var E=j.T,N={};j.T=N,Cm(i,!1,o,c);try{var q=v(),ne=j.S;if(ne!==null&&ne(N,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var ae=cD(q,f);Ql(i,o,ae,pr(i))}else Ql(i,o,f,pr(i))}catch(ce){Ql(i,o,{then:function(){},status:"rejected",reason:ce},pr())}finally{Y.p=b,E!==null&&N.types!==null&&(E.types=N.types),j.T=E}}function mD(){}function Sm(i,o,c,f){if(i.tag!==5)throw Error(r(476));var v=jx(i).queue;zx(i,v,o,W,c===null?mD:function(){return Bx(i),c(f)})}function jx(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:W},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function Bx(i){var o=jx(i);o.next===null&&(o=i.alternate.memoizedState),Ql(i,o.next.queue,{},pr())}function wm(){return xn(mc)}function Px(){return Ht().memoizedState}function Ix(){return Ht().memoizedState}function gD(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=pr();i=vs(c);var f=_s(o,i,c);f!==null&&(tr(f,o,c),Kl(f,o,c)),o={cache:Qp()},i.payload=o;return}o=o.return}}function vD(i,o,c){var f=pr();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},xh(i)?Fx(o,c):(c=Fp(i,o,c,f),c!==null&&(tr(c,i,f),Ux(c,o,f)))}function Hx(i,o,c){var f=pr();Ql(i,o,c,f)}function Ql(i,o,c,f){var v={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(xh(i))Fx(o,v);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=o.lastRenderedReducer,b!==null))try{var E=o.lastRenderedState,N=b(E,c);if(v.hasEagerState=!0,v.eagerState=N,lr(N,E))return th(i,o,v,0),vt===null&&eh(),!1}catch{}finally{}if(c=Fp(i,o,v,f),c!==null)return tr(c,i,f),Ux(c,o,f),!0}return!1}function Cm(i,o,c,f){if(f={lane:2,revertLane:ng(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},xh(i)){if(o)throw Error(r(479))}else o=Fp(i,c,f,2),o!==null&&tr(o,i,2)}function xh(i){var o=i.alternate;return i===Fe||o!==null&&o===Fe}function Fx(i,o){Ca=ph=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function Ux(i,o,c){if((c&4194048)!==0){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,ar(i,c)}}var Jl={readContext:xn,use:vh,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};Jl.useEffectEvent=Nt;var $x={readContext:xn,use:vh,useCallback:function(i,o){return zn().memoizedState=[i,o===void 0?null:o],i},useContext:xn,useEffect:Ex,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,yh(4194308,4,Ax.bind(null,o,i),c)},useLayoutEffect:function(i,o){return yh(4194308,4,i,o)},useInsertionEffect:function(i,o){yh(4,2,i,o)},useMemo:function(i,o){var c=zn();o=o===void 0?null:o;var f=i();if(yo){Oe(!0);try{i()}finally{Oe(!1)}}return c.memoizedState=[f,o],f},useReducer:function(i,o,c){var f=zn();if(c!==void 0){var v=c(o);if(yo){Oe(!0);try{c(o)}finally{Oe(!1)}}}else v=o;return f.memoizedState=f.baseState=v,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:v},f.queue=i,i=i.dispatch=vD.bind(null,Fe,i),[f.memoizedState,i]},useRef:function(i){var o=zn();return i={current:i},o.memoizedState=i},useState:function(i){i=vm(i);var o=i.queue,c=Hx.bind(null,Fe,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:bm,useDeferredValue:function(i,o){var c=zn();return xm(c,i,o)},useTransition:function(){var i=vm(!1);return i=zx.bind(null,Fe,i.queue,!0,!1),zn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var f=Fe,v=zn();if(tt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),vt===null)throw Error(r(349));(Qe&127)!==0||ux(f,o,c)}v.memoizedState=c;var b={value:c,getSnapshot:o};return v.queue=b,Ex(dx.bind(null,f,b,i),[i]),f.flags|=2048,Ea(9,{destroy:void 0},hx.bind(null,f,b,c,o),null),c},useId:function(){var i=zn(),o=vt.identifierPrefix;if(tt){var c=li,f=ai;c=(f&~(1<<32-Ne(f)-1)).toString(32)+c,o="_"+o+"R_"+c,c=mh++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=uD++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:wm,useFormState:xx,useActionState:xx,useOptimistic:function(i){var o=zn();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Cm.bind(null,Fe,!0,c),c.dispatch=o,[i,o]},useMemoCache:pm,useCacheRefresh:function(){return zn().memoizedState=gD.bind(null,Fe)},useEffectEvent:function(i){var o=zn(),c={impl:i};return o.memoizedState=c,function(){if((ot&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},km={readContext:xn,use:vh,useCallback:Dx,useContext:xn,useEffect:ym,useImperativeHandle:Nx,useInsertionEffect:Tx,useLayoutEffect:Mx,useMemo:Ox,useReducer:_h,useRef:kx,useState:function(){return _h(Pi)},useDebugValue:bm,useDeferredValue:function(i,o){var c=Ht();return Lx(c,ht.memoizedState,i,o)},useTransition:function(){var i=_h(Pi)[0],o=Ht().memoizedState;return[typeof i=="boolean"?i:Zl(i),o]},useSyncExternalStore:cx,useId:Px,useHostTransitionStatus:wm,useFormState:Sx,useActionState:Sx,useOptimistic:function(i,o){var c=Ht();return mx(c,ht,i,o)},useMemoCache:pm,useCacheRefresh:Ix};km.useEffectEvent=Rx;var Wx={readContext:xn,use:vh,useCallback:Dx,useContext:xn,useEffect:ym,useImperativeHandle:Nx,useInsertionEffect:Tx,useLayoutEffect:Mx,useMemo:Ox,useReducer:gm,useRef:kx,useState:function(){return gm(Pi)},useDebugValue:bm,useDeferredValue:function(i,o){var c=Ht();return ht===null?xm(c,i,o):Lx(c,ht.memoizedState,i,o)},useTransition:function(){var i=gm(Pi)[0],o=Ht().memoizedState;return[typeof i=="boolean"?i:Zl(i),o]},useSyncExternalStore:cx,useId:Px,useHostTransitionStatus:wm,useFormState:Cx,useActionState:Cx,useOptimistic:function(i,o){var c=Ht();return ht!==null?mx(c,ht,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:pm,useCacheRefresh:Ix};Wx.useEffectEvent=Rx;function Em(i,o,c,f){o=i.memoizedState,c=c(f,o),c=c==null?o:m({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Rm={enqueueSetState:function(i,o,c){i=i._reactInternals;var f=pr(),v=vs(f);v.payload=o,c!=null&&(v.callback=c),o=_s(i,v,f),o!==null&&(tr(o,i,f),Kl(o,i,f))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var f=pr(),v=vs(f);v.tag=1,v.payload=o,c!=null&&(v.callback=c),o=_s(i,v,f),o!==null&&(tr(o,i,f),Kl(o,i,f))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=pr(),f=vs(c);f.tag=2,o!=null&&(f.callback=o),o=_s(i,f,c),o!==null&&(tr(o,i,c),Kl(o,i,c))}};function qx(i,o,c,f,v,b,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,b,E):o.prototype&&o.prototype.isPureReactComponent?!Il(c,f)||!Il(v,b):!0}function Vx(i,o,c,f){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,f),o.state!==i&&Rm.enqueueReplaceState(o,o.state,null)}function bo(i,o){var c=o;if("ref"in o){c={};for(var f in o)f!=="ref"&&(c[f]=o[f])}if(i=i.defaultProps){c===o&&(c=m({},c));for(var v in i)c[v]===void 0&&(c[v]=i[v])}return c}function Kx(i){Ju(i)}function Gx(i){console.error(i)}function Yx(i){Ju(i)}function Sh(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function Xx(i,o,c){try{var f=i.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Tm(i,o,c){return c=vs(c),c.tag=3,c.payload={element:null},c.callback=function(){Sh(i,o)},c}function Zx(i){return i=vs(i),i.tag=3,i}function Qx(i,o,c,f){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var b=f.value;i.payload=function(){return v(b)},i.callback=function(){Xx(o,c,f)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){Xx(o,c,f),typeof v!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var N=f.stack;this.componentDidCatch(f.value,{componentStack:N!==null?N:""})})}function _D(i,o,c,f,v){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=c.alternate,o!==null&&_a(o,c,v,!0),c=ur.current,c!==null){switch(c.tag){case 31:case 13:return Or===null?Lh():c.alternate===null&&Dt===0&&(Dt=3),c.flags&=-257,c.flags|=65536,c.lanes=v,f===ch?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([f]):o.add(f),Jm(i,f,v)),!1;case 22:return c.flags|=65536,f===ch?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([f])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([f]):c.add(f)),Jm(i,f,v)),!1}throw Error(r(435,c.tag))}return Jm(i,f,v),Lh(),!1}if(tt)return o=ur.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=v,f!==Kp&&(i=Error(r(422),{cause:f}),Ul(Mr(i,c)))):(f!==Kp&&(o=Error(r(423),{cause:f}),Ul(Mr(o,c))),i=i.current.alternate,i.flags|=65536,v&=-v,i.lanes|=v,f=Mr(f,c),v=Tm(i.stateNode,f,v),im(i,v),Dt!==4&&(Dt=2)),!1;var b=Error(r(520),{cause:f});if(b=Mr(b,c),ac===null?ac=[b]:ac.push(b),Dt!==4&&(Dt=2),o===null)return!0;f=Mr(f,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=v&-v,c.lanes|=i,i=Tm(c.stateNode,f,i),im(c,i),!1;case 1:if(o=c.type,b=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Cs===null||!Cs.has(b))))return c.flags|=65536,v&=-v,c.lanes|=v,v=Zx(v),Qx(v,i,c,f),im(c,v),!1}c=c.return}while(c!==null);return!1}var Mm=Error(r(461)),Vt=!1;function Sn(i,o,c,f){o.child=i===null?nx(o,null,c,f):_o(o,i.child,c,f)}function Jx(i,o,c,f,v){c=c.render;var b=o.ref;if("ref"in f){var E={};for(var N in f)N!=="ref"&&(E[N]=f[N])}else E=f;return po(o),f=um(i,o,c,E,b,v),N=hm(),i!==null&&!Vt?(dm(i,o,v),Ii(i,o,v)):(tt&&N&&qp(o),o.flags|=1,Sn(i,o,f,v),o.child)}function e1(i,o,c,f,v){if(i===null){var b=c.type;return typeof b=="function"&&!Up(b)&&b.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=b,t1(i,o,b,f,v)):(i=rh(c.type,null,f,o,o.mode,v),i.ref=o.ref,i.return=o,o.child=i)}if(b=i.child,!Bm(i,v)){var E=b.memoizedProps;if(c=c.compare,c=c!==null?c:Il,c(E,f)&&i.ref===o.ref)return Ii(i,o,v)}return o.flags|=1,i=Oi(b,f),i.ref=o.ref,i.return=o,o.child=i}function t1(i,o,c,f,v){if(i!==null){var b=i.memoizedProps;if(Il(b,f)&&i.ref===o.ref)if(Vt=!1,o.pendingProps=f=b,Bm(i,v))(i.flags&131072)!==0&&(Vt=!0);else return o.lanes=i.lanes,Ii(i,o,v)}return Am(i,o,c,f,v)}function n1(i,o,c,f){var v=f.children,b=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((o.flags&128)!==0){if(b=b!==null?b.baseLanes|c:c,i!==null){for(f=o.child=i.child,v=0;f!==null;)v=v|f.lanes|f.childLanes,f=f.sibling;f=v&~b}else f=0,o.child=null;return r1(i,o,b,c,f)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&ah(o,b!==null?b.cachePool:null),b!==null?sx(o,b):om(),ox(o);else return f=o.lanes=536870912,r1(i,o,b!==null?b.baseLanes|c:c,c,f)}else b!==null?(ah(o,b.cachePool),sx(o,b),bs(),o.memoizedState=null):(i!==null&&ah(o,null),om(),bs());return Sn(i,o,v,c),o.child}function ec(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function r1(i,o,c,f,v){var b=em();return b=b===null?null:{parent:Wt._currentValue,pool:b},o.memoizedState={baseLanes:c,cachePool:b},i!==null&&ah(o,null),om(),ox(o),i!==null&&_a(i,o,f,!0),o.childLanes=v,null}function wh(i,o){return o=kh({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function i1(i,o,c){return _o(o,i.child,null,c),i=wh(o,o.pendingProps),i.flags|=2,hr(o),o.memoizedState=null,i}function yD(i,o,c){var f=o.pendingProps,v=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(tt){if(f.mode==="hidden")return i=wh(o,f),o.lanes=536870912,ec(null,i);if(lm(o),(i=St)?(i=gS(i,Dr),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:ds!==null?{id:ai,overflow:li}:null,retryLane:536870912,hydrationErrors:null},c=F0(i),c.return=o,o.child=c,bn=o,St=null)):i=null,i===null)throw ps(o);return o.lanes=536870912,null}return wh(o,f)}var b=i.memoizedState;if(b!==null){var E=b.dehydrated;if(lm(o),v)if(o.flags&256)o.flags&=-257,o=i1(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(Vt||_a(i,o,c,!1),v=(c&i.childLanes)!==0,Vt||v){if(f=vt,f!==null&&(E=Cr(f,c),E!==0&&E!==b.retryLane))throw b.retryLane=E,co(i,E),tr(f,i,E),Mm;Lh(),o=i1(i,o,c)}else i=b.treeContext,St=Lr(E.nextSibling),bn=o,tt=!0,fs=null,Dr=!1,i!==null&&W0(o,i),o=wh(o,f),o.flags|=4096;return o}return i=Oi(i.child,{mode:f.mode,children:f.children}),i.ref=o.ref,o.child=i,i.return=o,i}function Ch(i,o){var c=o.ref;if(c===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(o.flags|=4194816)}}function Am(i,o,c,f,v){return po(o),c=um(i,o,c,f,void 0,v),f=hm(),i!==null&&!Vt?(dm(i,o,v),Ii(i,o,v)):(tt&&f&&qp(o),o.flags|=1,Sn(i,o,c,v),o.child)}function s1(i,o,c,f,v,b){return po(o),o.updateQueue=null,c=lx(o,f,c,v),ax(i),f=hm(),i!==null&&!Vt?(dm(i,o,b),Ii(i,o,b)):(tt&&f&&qp(o),o.flags|=1,Sn(i,o,c,b),o.child)}function o1(i,o,c,f,v){if(po(o),o.stateNode===null){var b=pa,E=c.contextType;typeof E=="object"&&E!==null&&(b=xn(E)),b=new c(f,b),o.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Rm,o.stateNode=b,b._reactInternals=o,b=o.stateNode,b.props=f,b.state=o.memoizedState,b.refs={},nm(o),E=c.contextType,b.context=typeof E=="object"&&E!==null?xn(E):pa,b.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Em(o,c,E,f),b.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(E=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),E!==b.state&&Rm.enqueueReplaceState(b,b.state,null),Yl(o,f,b,v),Gl(),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(i===null){b=o.stateNode;var N=o.memoizedProps,q=bo(c,N);b.props=q;var ne=b.context,ae=c.contextType;E=pa,typeof ae=="object"&&ae!==null&&(E=xn(ae));var ce=c.getDerivedStateFromProps;ae=typeof ce=="function"||typeof b.getSnapshotBeforeUpdate=="function",N=o.pendingProps!==N,ae||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(N||ne!==E)&&Vx(o,b,f,E),gs=!1;var re=o.memoizedState;b.state=re,Yl(o,f,b,v),Gl(),ne=o.memoizedState,N||re!==ne||gs?(typeof ce=="function"&&(Em(o,c,ce,f),ne=o.memoizedState),(q=gs||qx(o,c,q,f,re,ne,E))?(ae||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(o.flags|=4194308)):(typeof b.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=ne),b.props=f,b.state=ne,b.context=E,f=q):(typeof b.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{b=o.stateNode,rm(i,o),E=o.memoizedProps,ae=bo(c,E),b.props=ae,ce=o.pendingProps,re=b.context,ne=c.contextType,q=pa,typeof ne=="object"&&ne!==null&&(q=xn(ne)),N=c.getDerivedStateFromProps,(ne=typeof N=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(E!==ce||re!==q)&&Vx(o,b,f,q),gs=!1,re=o.memoizedState,b.state=re,Yl(o,f,b,v),Gl();var se=o.memoizedState;E!==ce||re!==se||gs||i!==null&&i.dependencies!==null&&sh(i.dependencies)?(typeof N=="function"&&(Em(o,c,N,f),se=o.memoizedState),(ae=gs||qx(o,c,ae,f,re,se,q)||i!==null&&i.dependencies!==null&&sh(i.dependencies))?(ne||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(f,se,q),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(f,se,q)),typeof b.componentDidUpdate=="function"&&(o.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof b.componentDidUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=se),b.props=f,b.state=se,b.context=q,f=ae):(typeof b.componentDidUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=1024),f=!1)}return b=f,Ch(i,o),f=(o.flags&128)!==0,b||f?(b=o.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:b.render(),o.flags|=1,i!==null&&f?(o.child=_o(o,i.child,null,v),o.child=_o(o,null,c,v)):Sn(i,o,c,v),o.memoizedState=b.state,i=o.child):i=Ii(i,o,v),i}function a1(i,o,c,f){return ho(),o.flags|=256,Sn(i,o,c,f),o.child}var Nm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dm(i){return{baseLanes:i,cachePool:X0()}}function Om(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=fr),i}function l1(i,o,c){var f=o.pendingProps,v=!1,b=(o.flags&128)!==0,E;if((E=b)||(E=i!==null&&i.memoizedState===null?!1:(It.current&2)!==0),E&&(v=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,i===null){if(tt){if(v?ys(o):bs(),(i=St)?(i=gS(i,Dr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:ds!==null?{id:ai,overflow:li}:null,retryLane:536870912,hydrationErrors:null},c=F0(i),c.return=o,o.child=c,bn=o,St=null)):i=null,i===null)throw ps(o);return mg(i)?o.lanes=32:o.lanes=536870912,null}var N=f.children;return f=f.fallback,v?(bs(),v=o.mode,N=kh({mode:"hidden",children:N},v),f=uo(f,v,c,null),N.return=o,f.return=o,N.sibling=f,o.child=N,f=o.child,f.memoizedState=Dm(c),f.childLanes=Om(i,E,c),o.memoizedState=Nm,ec(null,f)):(ys(o),Lm(o,N))}var q=i.memoizedState;if(q!==null&&(N=q.dehydrated,N!==null)){if(b)o.flags&256?(ys(o),o.flags&=-257,o=zm(i,o,c)):o.memoizedState!==null?(bs(),o.child=i.child,o.flags|=128,o=null):(bs(),N=f.fallback,v=o.mode,f=kh({mode:"visible",children:f.children},v),N=uo(N,v,c,null),N.flags|=2,f.return=o,N.return=o,f.sibling=N,o.child=f,_o(o,i.child,null,c),f=o.child,f.memoizedState=Dm(c),f.childLanes=Om(i,E,c),o.memoizedState=Nm,o=ec(null,f));else if(ys(o),mg(N)){if(E=N.nextSibling&&N.nextSibling.dataset,E)var ne=E.dgst;E=ne,f=Error(r(419)),f.stack="",f.digest=E,Ul({value:f,source:null,stack:null}),o=zm(i,o,c)}else if(Vt||_a(i,o,c,!1),E=(c&i.childLanes)!==0,Vt||E){if(E=vt,E!==null&&(f=Cr(E,c),f!==0&&f!==q.retryLane))throw q.retryLane=f,co(i,f),tr(E,i,f),Mm;pg(N)||Lh(),o=zm(i,o,c)}else pg(N)?(o.flags|=192,o.child=i.child,o=null):(i=q.treeContext,St=Lr(N.nextSibling),bn=o,tt=!0,fs=null,Dr=!1,i!==null&&W0(o,i),o=Lm(o,f.children),o.flags|=4096);return o}return v?(bs(),N=f.fallback,v=o.mode,q=i.child,ne=q.sibling,f=Oi(q,{mode:"hidden",children:f.children}),f.subtreeFlags=q.subtreeFlags&65011712,ne!==null?N=Oi(ne,N):(N=uo(N,v,c,null),N.flags|=2),N.return=o,f.return=o,f.sibling=N,o.child=f,ec(null,f),f=o.child,N=i.child.memoizedState,N===null?N=Dm(c):(v=N.cachePool,v!==null?(q=Wt._currentValue,v=v.parent!==q?{parent:q,pool:q}:v):v=X0(),N={baseLanes:N.baseLanes|c,cachePool:v}),f.memoizedState=N,f.childLanes=Om(i,E,c),o.memoizedState=Nm,ec(i.child,f)):(ys(o),c=i.child,i=c.sibling,c=Oi(c,{mode:"visible",children:f.children}),c.return=o,c.sibling=null,i!==null&&(E=o.deletions,E===null?(o.deletions=[i],o.flags|=16):E.push(i)),o.child=c,o.memoizedState=null,c)}function Lm(i,o){return o=kh({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function kh(i,o){return i=cr(22,i,null,o),i.lanes=0,i}function zm(i,o,c){return _o(o,i.child,null,c),i=Lm(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function c1(i,o,c){i.lanes|=o;var f=i.alternate;f!==null&&(f.lanes|=o),Xp(i.return,o,c)}function jm(i,o,c,f,v,b){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:v,treeForkCount:b}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=f,E.tail=c,E.tailMode=v,E.treeForkCount=b)}function u1(i,o,c){var f=o.pendingProps,v=f.revealOrder,b=f.tail;f=f.children;var E=It.current,N=(E&2)!==0;if(N?(E=E&1|2,o.flags|=128):E&=1,D(It,E),Sn(i,o,f,c),f=tt?Fl:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&c1(i,c,o);else if(i.tag===19)c1(i,c,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(v){case"forwards":for(c=o.child,v=null;c!==null;)i=c.alternate,i!==null&&fh(i)===null&&(v=c),c=c.sibling;c=v,c===null?(v=o.child,o.child=null):(v=c.sibling,c.sibling=null),jm(o,!1,v,c,b,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=o.child,o.child=null;v!==null;){if(i=v.alternate,i!==null&&fh(i)===null){o.child=v;break}i=v.sibling,v.sibling=c,c=v,v=i}jm(o,!0,c,null,b,f);break;case"together":jm(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function Ii(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),ws|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(_a(i,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,c=Oi(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Oi(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function Bm(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&sh(i)))}function bD(i,o,c){switch(o.tag){case 3:Te(o,o.stateNode.containerInfo),ms(o,Wt,i.memoizedState.cache),ho();break;case 27:case 5:ke(o);break;case 4:Te(o,o.stateNode.containerInfo);break;case 10:ms(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,lm(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(ys(o),o.flags|=128,null):(c&o.child.childLanes)!==0?l1(i,o,c):(ys(o),i=Ii(i,o,c),i!==null?i.sibling:null);ys(o);break;case 19:var v=(i.flags&128)!==0;if(f=(c&o.childLanes)!==0,f||(_a(i,o,c,!1),f=(c&o.childLanes)!==0),v){if(f)return u1(i,o,c);o.flags|=128}if(v=o.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),D(It,It.current),f)break;return null;case 22:return o.lanes=0,n1(i,o,c,o.pendingProps);case 24:ms(o,Wt,i.memoizedState.cache)}return Ii(i,o,c)}function h1(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)Vt=!0;else{if(!Bm(i,c)&&(o.flags&128)===0)return Vt=!1,bD(i,o,c);Vt=(i.flags&131072)!==0}else Vt=!1,tt&&(o.flags&1048576)!==0&&$0(o,Fl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var f=o.pendingProps;if(i=go(o.elementType),o.type=i,typeof i=="function")Up(i)?(f=bo(i,f),o.tag=1,o=o1(null,o,i,f,c)):(o.tag=0,o=Am(null,o,i,f,c));else{if(i!=null){var v=i.$$typeof;if(v===M){o.tag=11,o=Jx(null,o,i,f,c);break e}else if(v===z){o.tag=14,o=e1(null,o,i,f,c);break e}}throw o=V(i)||i,Error(r(306,o,""))}}return o;case 0:return Am(i,o,o.type,o.pendingProps,c);case 1:return f=o.type,v=bo(f,o.pendingProps),o1(i,o,f,v,c);case 3:e:{if(Te(o,o.stateNode.containerInfo),i===null)throw Error(r(387));f=o.pendingProps;var b=o.memoizedState;v=b.element,rm(i,o),Yl(o,f,null,c);var E=o.memoizedState;if(f=E.cache,ms(o,Wt,f),f!==b.cache&&Zp(o,[Wt],c,!0),Gl(),f=E.element,b.isDehydrated)if(b={element:f,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=b,o.memoizedState=b,o.flags&256){o=a1(i,o,f,c);break e}else if(f!==v){v=Mr(Error(r(424)),o),Ul(v),o=a1(i,o,f,c);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(St=Lr(i.firstChild),bn=o,tt=!0,fs=null,Dr=!0,c=nx(o,null,f,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(ho(),f===v){o=Ii(i,o,c);break e}Sn(i,o,f,c)}o=o.child}return o;case 26:return Ch(i,o),i===null?(c=SS(o.type,null,o.pendingProps,null))?o.memoizedState=c:tt||(c=o.type,i=o.pendingProps,f=Fh(ie.current).createElement(c),f[yn]=o,f[Yn]=i,wn(f,c,i),ln(f),o.stateNode=f):o.memoizedState=SS(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return ke(o),i===null&&tt&&(f=o.stateNode=yS(o.type,o.pendingProps,ie.current),bn=o,Dr=!0,v=St,Ts(o.type)?(gg=v,St=Lr(f.firstChild)):St=v),Sn(i,o,o.pendingProps.children,c),Ch(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&tt&&((v=f=St)&&(f=XD(f,o.type,o.pendingProps,Dr),f!==null?(o.stateNode=f,bn=o,St=Lr(f.firstChild),Dr=!1,v=!0):v=!1),v||ps(o)),ke(o),v=o.type,b=o.pendingProps,E=i!==null?i.memoizedProps:null,f=b.children,hg(v,b)?f=null:E!==null&&hg(v,E)&&(o.flags|=32),o.memoizedState!==null&&(v=um(i,o,hD,null,null,c),mc._currentValue=v),Ch(i,o),Sn(i,o,f,c),o.child;case 6:return i===null&&tt&&((i=c=St)&&(c=ZD(c,o.pendingProps,Dr),c!==null?(o.stateNode=c,bn=o,St=null,i=!0):i=!1),i||ps(o)),null;case 13:return l1(i,o,c);case 4:return Te(o,o.stateNode.containerInfo),f=o.pendingProps,i===null?o.child=_o(o,null,f,c):Sn(i,o,f,c),o.child;case 11:return Jx(i,o,o.type,o.pendingProps,c);case 7:return Sn(i,o,o.pendingProps,c),o.child;case 8:return Sn(i,o,o.pendingProps.children,c),o.child;case 12:return Sn(i,o,o.pendingProps.children,c),o.child;case 10:return f=o.pendingProps,ms(o,o.type,f.value),Sn(i,o,f.children,c),o.child;case 9:return v=o.type._context,f=o.pendingProps.children,po(o),v=xn(v),f=f(v),o.flags|=1,Sn(i,o,f,c),o.child;case 14:return e1(i,o,o.type,o.pendingProps,c);case 15:return t1(i,o,o.type,o.pendingProps,c);case 19:return u1(i,o,c);case 31:return yD(i,o,c);case 22:return n1(i,o,c,o.pendingProps);case 24:return po(o),f=xn(Wt),i===null?(v=em(),v===null&&(v=vt,b=Qp(),v.pooledCache=b,b.refCount++,b!==null&&(v.pooledCacheLanes|=c),v=b),o.memoizedState={parent:f,cache:v},nm(o),ms(o,Wt,v)):((i.lanes&c)!==0&&(rm(i,o),Yl(o,null,null,c),Gl()),v=i.memoizedState,b=o.memoizedState,v.parent!==f?(v={parent:f,cache:f},o.memoizedState=v,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=v),ms(o,Wt,f)):(f=b.cache,ms(o,Wt,f),f!==v.cache&&Zp(o,[Wt],c,!0))),Sn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Hi(i){i.flags|=4}function Pm(i,o,c,f,v){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(v&335544128)===v)if(i.stateNode.complete)i.flags|=8192;else if(P1())i.flags|=8192;else throw vo=ch,tm}else i.flags&=-16777217}function d1(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!RS(o))if(P1())i.flags|=8192;else throw vo=ch,tm}function Eh(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?Rn():536870912,i.lanes|=o,Aa|=o)}function tc(i,o){if(!tt)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function wt(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(o)for(var v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags&65011712,f|=v.flags&65011712,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags,f|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=f,i.childLanes=c,o}function xD(i,o,c){var f=o.pendingProps;switch(Vp(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(o),null;case 1:return wt(o),null;case 3:return c=o.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),ji(Wt),ve(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(va(o)?Hi(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Gp())),wt(o),null;case 26:var v=o.type,b=o.memoizedState;return i===null?(Hi(o),b!==null?(wt(o),d1(o,b)):(wt(o),Pm(o,v,null,f,c))):b?b!==i.memoizedState?(Hi(o),wt(o),d1(o,b)):(wt(o),o.flags&=-16777217):(i=i.memoizedProps,i!==f&&Hi(o),wt(o),Pm(o,v,i,f,c)),null;case 27:if(We(o),c=ie.current,v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Hi(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return wt(o),null}i=K.current,va(o)?q0(o):(i=yS(v,f,c),o.stateNode=i,Hi(o))}return wt(o),null;case 5:if(We(o),v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Hi(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return wt(o),null}if(b=K.current,va(o))q0(o);else{var E=Fh(ie.current);switch(b){case 1:b=E.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:b=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":b=E.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":b=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":b=E.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof f.is=="string"?E.createElement("select",{is:f.is}):E.createElement("select"),f.multiple?b.multiple=!0:f.size&&(b.size=f.size);break;default:b=typeof f.is=="string"?E.createElement(v,{is:f.is}):E.createElement(v)}}b[yn]=o,b[Yn]=f;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)b.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===o)break e;for(;E.sibling===null;){if(E.return===null||E.return===o)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}o.stateNode=b;e:switch(wn(b,v,f),v){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Hi(o)}}return wt(o),Pm(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==f&&Hi(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(r(166));if(i=ie.current,va(o)){if(i=o.stateNode,c=o.memoizedProps,f=null,v=bn,v!==null)switch(v.tag){case 27:case 5:f=v.memoizedProps}i[yn]=o,i=!!(i.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||lS(i.nodeValue,c)),i||ps(o,!0)}else i=Fh(i).createTextNode(f),i[yn]=o,o.stateNode=i}return wt(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(f=va(o),c!==null){if(i===null){if(!f)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[yn]=o}else ho(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;wt(o),i=!1}else c=Gp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(hr(o),o):(hr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return wt(o),null;case 13:if(f=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(v=va(o),f!==null&&f.dehydrated!==null){if(i===null){if(!v)throw Error(r(318));if(v=o.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[yn]=o}else ho(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;wt(o),v=!1}else v=Gp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=v),v=!0;if(!v)return o.flags&256?(hr(o),o):(hr(o),null)}return hr(o),(o.flags&128)!==0?(o.lanes=c,o):(c=f!==null,i=i!==null&&i.memoizedState!==null,c&&(f=o.child,v=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(v=f.alternate.memoizedState.cachePool.pool),b=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(b=f.memoizedState.cachePool.pool),b!==v&&(f.flags|=2048)),c!==i&&c&&(o.child.flags|=8192),Eh(o,o.updateQueue),wt(o),null);case 4:return ve(),i===null&&og(o.stateNode.containerInfo),wt(o),null;case 10:return ji(o.type),wt(o),null;case 19:if(Z(It),f=o.memoizedState,f===null)return wt(o),null;if(v=(o.flags&128)!==0,b=f.rendering,b===null)if(v)tc(f,!1);else{if(Dt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(b=fh(i),b!==null){for(o.flags|=128,tc(f,!1),i=b.updateQueue,o.updateQueue=i,Eh(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)H0(c,i),c=c.sibling;return D(It,It.current&1|2),tt&&Li(o,f.treeForkCount),o.child}i=i.sibling}f.tail!==null&&$t()>Nh&&(o.flags|=128,v=!0,tc(f,!1),o.lanes=4194304)}else{if(!v)if(i=fh(b),i!==null){if(o.flags|=128,v=!0,i=i.updateQueue,o.updateQueue=i,Eh(o,i),tc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!b.alternate&&!tt)return wt(o),null}else 2*$t()-f.renderingStartTime>Nh&&c!==536870912&&(o.flags|=128,v=!0,tc(f,!1),o.lanes=4194304);f.isBackwards?(b.sibling=o.child,o.child=b):(i=f.last,i!==null?i.sibling=b:o.child=b,f.last=b)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=$t(),i.sibling=null,c=It.current,D(It,v?c&1|2:c&1),tt&&Li(o,f.treeForkCount),i):(wt(o),null);case 22:case 23:return hr(o),am(),f=o.memoizedState!==null,i!==null?i.memoizedState!==null!==f&&(o.flags|=8192):f&&(o.flags|=8192),f?(c&536870912)!==0&&(o.flags&128)===0&&(wt(o),o.subtreeFlags&6&&(o.flags|=8192)):wt(o),c=o.updateQueue,c!==null&&Eh(o,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==c&&(o.flags|=2048),i!==null&&Z(mo),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),ji(Wt),wt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function SD(i,o){switch(Vp(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return ji(Wt),ve(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return We(o),null;case 31:if(o.memoizedState!==null){if(hr(o),o.alternate===null)throw Error(r(340));ho()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(hr(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));ho()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Z(It),null;case 4:return ve(),null;case 10:return ji(o.type),null;case 22:case 23:return hr(o),am(),i!==null&&Z(mo),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return ji(Wt),null;case 25:return null;default:return null}}function f1(i,o){switch(Vp(o),o.tag){case 3:ji(Wt),ve();break;case 26:case 27:case 5:We(o);break;case 4:ve();break;case 31:o.memoizedState!==null&&hr(o);break;case 13:hr(o);break;case 19:Z(It);break;case 10:ji(o.type);break;case 22:case 23:hr(o),am(),i!==null&&Z(mo);break;case 24:ji(Wt)}}function nc(i,o){try{var c=o.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var v=f.next;c=v;do{if((c.tag&i)===i){f=void 0;var b=c.create,E=c.inst;f=b(),E.destroy=f}c=c.next}while(c!==v)}}catch(N){ct(o,o.return,N)}}function xs(i,o,c){try{var f=o.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var b=v.next;f=b;do{if((f.tag&i)===i){var E=f.inst,N=E.destroy;if(N!==void 0){E.destroy=void 0,v=o;var q=c,ne=N;try{ne()}catch(ae){ct(v,q,ae)}}}f=f.next}while(f!==b)}}catch(ae){ct(o,o.return,ae)}}function p1(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{ix(o,c)}catch(f){ct(i,i.return,f)}}}function m1(i,o,c){c.props=bo(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(f){ct(i,o,f)}}function rc(i,o){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var f=i.stateNode;break;case 30:f=i.stateNode;break;default:f=i.stateNode}typeof c=="function"?i.refCleanup=c(f):c.current=f}}catch(v){ct(i,o,v)}}function ci(i,o){var c=i.ref,f=i.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(v){ct(i,o,v)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){ct(i,o,v)}else c.current=null}function g1(i){var o=i.type,c=i.memoizedProps,f=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&f.focus();break e;case"img":c.src?f.src=c.src:c.srcSet&&(f.srcset=c.srcSet)}}catch(v){ct(i,i.return,v)}}function Im(i,o,c){try{var f=i.stateNode;WD(f,i.type,c,o),f[Yn]=o}catch(v){ct(i,i.return,v)}}function v1(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ts(i.type)||i.tag===4}function Hm(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||v1(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Ts(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Fm(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(i),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ni));else if(f!==4&&(f===27&&Ts(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(Fm(i,o,c),i=i.sibling;i!==null;)Fm(i,o,c),i=i.sibling}function Rh(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(f!==4&&(f===27&&Ts(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Rh(i,o,c),i=i.sibling;i!==null;)Rh(i,o,c),i=i.sibling}function _1(i){var o=i.stateNode,c=i.memoizedProps;try{for(var f=i.type,v=o.attributes;v.length;)o.removeAttributeNode(v[0]);wn(o,f,c),o[yn]=i,o[Yn]=c}catch(b){ct(i,i.return,b)}}var Fi=!1,Kt=!1,Um=!1,y1=typeof WeakSet=="function"?WeakSet:Set,cn=null;function wD(i,o){if(i=i.containerInfo,cg=Gh,i=N0(i),zp(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var v=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var E=0,N=-1,q=-1,ne=0,ae=0,ce=i,re=null;t:for(;;){for(var se;ce!==c||v!==0&&ce.nodeType!==3||(N=E+v),ce!==b||f!==0&&ce.nodeType!==3||(q=E+f),ce.nodeType===3&&(E+=ce.nodeValue.length),(se=ce.firstChild)!==null;)re=ce,ce=se;for(;;){if(ce===i)break t;if(re===c&&++ne===v&&(N=E),re===b&&++ae===f&&(q=E),(se=ce.nextSibling)!==null)break;ce=re,re=ce.parentNode}ce=se}c=N===-1||q===-1?null:{start:N,end:q}}else c=null}c=c||{start:0,end:0}}else c=null;for(ug={focusedElem:i,selectionRange:c},Gh=!1,cn=o;cn!==null;)if(o=cn,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,cn=i;else for(;cn!==null;){switch(o=cn,b=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)v=i[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&b!==null){i=void 0,c=o,v=b.memoizedProps,b=b.memoizedState,f=c.stateNode;try{var we=bo(c.type,v);i=f.getSnapshotBeforeUpdate(we,b),f.__reactInternalSnapshotBeforeUpdate=i}catch(ze){ct(c,c.return,ze)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)fg(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":fg(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,cn=i;break}cn=o.return}}function b1(i,o,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:$i(i,c),f&4&&nc(5,c);break;case 1:if($i(i,c),f&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(E){ct(c,c.return,E)}else{var v=bo(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(v,o,i.__reactInternalSnapshotBeforeUpdate)}catch(E){ct(c,c.return,E)}}f&64&&p1(c),f&512&&rc(c,c.return);break;case 3:if($i(i,c),f&64&&(i=c.updateQueue,i!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{ix(i,o)}catch(E){ct(c,c.return,E)}}break;case 27:o===null&&f&4&&_1(c);case 26:case 5:$i(i,c),o===null&&f&4&&g1(c),f&512&&rc(c,c.return);break;case 12:$i(i,c);break;case 31:$i(i,c),f&4&&w1(i,c);break;case 13:$i(i,c),f&4&&C1(i,c),f&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=DD.bind(null,c),QD(i,c))));break;case 22:if(f=c.memoizedState!==null||Fi,!f){o=o!==null&&o.memoizedState!==null||Kt,v=Fi;var b=Kt;Fi=f,(Kt=o)&&!b?Wi(i,c,(c.subtreeFlags&8772)!==0):$i(i,c),Fi=v,Kt=b}break;case 30:break;default:$i(i,c)}}function x1(i){var o=i.alternate;o!==null&&(i.alternate=null,x1(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&_p(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var kt=null,Zn=!1;function Ui(i,o,c){for(c=c.child;c!==null;)S1(i,o,c),c=c.sibling}function S1(i,o,c){if(ye&&typeof ye.onCommitFiberUnmount=="function")try{ye.onCommitFiberUnmount(de,c)}catch{}switch(c.tag){case 26:Kt||ci(c,o),Ui(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Kt||ci(c,o);var f=kt,v=Zn;Ts(c.type)&&(kt=c.stateNode,Zn=!1),Ui(i,o,c),dc(c.stateNode),kt=f,Zn=v;break;case 5:Kt||ci(c,o);case 6:if(f=kt,v=Zn,kt=null,Ui(i,o,c),kt=f,Zn=v,kt!==null)if(Zn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(c.stateNode)}catch(b){ct(c,o,b)}else try{kt.removeChild(c.stateNode)}catch(b){ct(c,o,b)}break;case 18:kt!==null&&(Zn?(i=kt,pS(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),Pa(i)):pS(kt,c.stateNode));break;case 4:f=kt,v=Zn,kt=c.stateNode.containerInfo,Zn=!0,Ui(i,o,c),kt=f,Zn=v;break;case 0:case 11:case 14:case 15:xs(2,c,o),Kt||xs(4,c,o),Ui(i,o,c);break;case 1:Kt||(ci(c,o),f=c.stateNode,typeof f.componentWillUnmount=="function"&&m1(c,o,f)),Ui(i,o,c);break;case 21:Ui(i,o,c);break;case 22:Kt=(f=Kt)||c.memoizedState!==null,Ui(i,o,c),Kt=f;break;default:Ui(i,o,c)}}function w1(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Pa(i)}catch(c){ct(o,o.return,c)}}}function C1(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Pa(i)}catch(c){ct(o,o.return,c)}}function CD(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new y1),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new y1),o;default:throw Error(r(435,i.tag))}}function Th(i,o){var c=CD(i);o.forEach(function(f){if(!c.has(f)){c.add(f);var v=OD.bind(null,i,f);f.then(v,v)}})}function Qn(i,o){var c=o.deletions;if(c!==null)for(var f=0;f<c.length;f++){var v=c[f],b=i,E=o,N=E;e:for(;N!==null;){switch(N.tag){case 27:if(Ts(N.type)){kt=N.stateNode,Zn=!1;break e}break;case 5:kt=N.stateNode,Zn=!1;break e;case 3:case 4:kt=N.stateNode.containerInfo,Zn=!0;break e}N=N.return}if(kt===null)throw Error(r(160));S1(b,E,v),kt=null,Zn=!1,b=v.alternate,b!==null&&(b.return=null),v.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)k1(o,i),o=o.sibling}var Yr=null;function k1(i,o){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Qn(o,i),Jn(i),f&4&&(xs(3,i,i.return),nc(3,i),xs(5,i,i.return));break;case 1:Qn(o,i),Jn(i),f&512&&(Kt||c===null||ci(c,c.return)),f&64&&Fi&&(i=i.updateQueue,i!==null&&(f=i.callbacks,f!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?f:c.concat(f))));break;case 26:var v=Yr;if(Qn(o,i),Jn(i),f&512&&(Kt||c===null||ci(c,c.return)),f&4){var b=c!==null?c.memoizedState:null;if(f=i.memoizedState,c===null)if(f===null)if(i.stateNode===null){e:{f=i.type,c=i.memoizedProps,v=v.ownerDocument||v;t:switch(f){case"title":b=v.getElementsByTagName("title")[0],(!b||b[Al]||b[yn]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=v.createElement(f),v.head.insertBefore(b,v.querySelector("head > title"))),wn(b,f,c),b[yn]=i,ln(b),f=b;break e;case"link":var E=kS("link","href",v).get(f+(c.href||""));if(E){for(var N=0;N<E.length;N++)if(b=E[N],b.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&b.getAttribute("rel")===(c.rel==null?null:c.rel)&&b.getAttribute("title")===(c.title==null?null:c.title)&&b.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(N,1);break t}}b=v.createElement(f),wn(b,f,c),v.head.appendChild(b);break;case"meta":if(E=kS("meta","content",v).get(f+(c.content||""))){for(N=0;N<E.length;N++)if(b=E[N],b.getAttribute("content")===(c.content==null?null:""+c.content)&&b.getAttribute("name")===(c.name==null?null:c.name)&&b.getAttribute("property")===(c.property==null?null:c.property)&&b.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&b.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(N,1);break t}}b=v.createElement(f),wn(b,f,c),v.head.appendChild(b);break;default:throw Error(r(468,f))}b[yn]=i,ln(b),f=b}i.stateNode=f}else ES(v,i.type,i.stateNode);else i.stateNode=CS(v,f,i.memoizedProps);else b!==f?(b===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):b.count--,f===null?ES(v,i.type,i.stateNode):CS(v,f,i.memoizedProps)):f===null&&i.stateNode!==null&&Im(i,i.memoizedProps,c.memoizedProps)}break;case 27:Qn(o,i),Jn(i),f&512&&(Kt||c===null||ci(c,c.return)),c!==null&&f&4&&Im(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Qn(o,i),Jn(i),f&512&&(Kt||c===null||ci(c,c.return)),i.flags&32){v=i.stateNode;try{aa(v,"")}catch(we){ct(i,i.return,we)}}f&4&&i.stateNode!=null&&(v=i.memoizedProps,Im(i,v,c!==null?c.memoizedProps:v)),f&1024&&(Um=!0);break;case 6:if(Qn(o,i),Jn(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,c=i.stateNode;try{c.nodeValue=f}catch(we){ct(i,i.return,we)}}break;case 3:if(Wh=null,v=Yr,Yr=Uh(o.containerInfo),Qn(o,i),Yr=v,Jn(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{Pa(o.containerInfo)}catch(we){ct(i,i.return,we)}Um&&(Um=!1,E1(i));break;case 4:f=Yr,Yr=Uh(i.stateNode.containerInfo),Qn(o,i),Jn(i),Yr=f;break;case 12:Qn(o,i),Jn(i);break;case 31:Qn(o,i),Jn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Th(i,f)));break;case 13:Qn(o,i),Jn(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Ah=$t()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Th(i,f)));break;case 22:v=i.memoizedState!==null;var q=c!==null&&c.memoizedState!==null,ne=Fi,ae=Kt;if(Fi=ne||v,Kt=ae||q,Qn(o,i),Kt=ae,Fi=ne,Jn(i),f&8192)e:for(o=i.stateNode,o._visibility=v?o._visibility&-2:o._visibility|1,v&&(c===null||q||Fi||Kt||xo(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){q=c=o;try{if(b=q.stateNode,v)E=b.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{N=q.stateNode;var ce=q.memoizedProps.style,re=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;N.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(we){ct(q,q.return,we)}}}else if(o.tag===6){if(c===null){q=o;try{q.stateNode.nodeValue=v?"":q.memoizedProps}catch(we){ct(q,q.return,we)}}}else if(o.tag===18){if(c===null){q=o;try{var se=q.stateNode;v?mS(se,!0):mS(q.stateNode,!1)}catch(we){ct(q,q.return,we)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}f&4&&(f=i.updateQueue,f!==null&&(c=f.retryQueue,c!==null&&(f.retryQueue=null,Th(i,c))));break;case 19:Qn(o,i),Jn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Th(i,f)));break;case 30:break;case 21:break;default:Qn(o,i),Jn(i)}}function Jn(i){var o=i.flags;if(o&2){try{for(var c,f=i.return;f!==null;){if(v1(f)){c=f;break}f=f.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var v=c.stateNode,b=Hm(i);Rh(i,b,v);break;case 5:var E=c.stateNode;c.flags&32&&(aa(E,""),c.flags&=-33);var N=Hm(i);Rh(i,N,E);break;case 3:case 4:var q=c.stateNode.containerInfo,ne=Hm(i);Fm(i,ne,q);break;default:throw Error(r(161))}}catch(ae){ct(i,i.return,ae)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function E1(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;E1(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function $i(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)b1(i,o.alternate,o),o=o.sibling}function xo(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:xs(4,o,o.return),xo(o);break;case 1:ci(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&m1(o,o.return,c),xo(o);break;case 27:dc(o.stateNode);case 26:case 5:ci(o,o.return),xo(o);break;case 22:o.memoizedState===null&&xo(o);break;case 30:xo(o);break;default:xo(o)}i=i.sibling}}function Wi(i,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var f=o.alternate,v=i,b=o,E=b.flags;switch(b.tag){case 0:case 11:case 15:Wi(v,b,c),nc(4,b);break;case 1:if(Wi(v,b,c),f=b,v=f.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ne){ct(f,f.return,ne)}if(f=b,v=f.updateQueue,v!==null){var N=f.stateNode;try{var q=v.shared.hiddenCallbacks;if(q!==null)for(v.shared.hiddenCallbacks=null,v=0;v<q.length;v++)rx(q[v],N)}catch(ne){ct(f,f.return,ne)}}c&&E&64&&p1(b),rc(b,b.return);break;case 27:_1(b);case 26:case 5:Wi(v,b,c),c&&f===null&&E&4&&g1(b),rc(b,b.return);break;case 12:Wi(v,b,c);break;case 31:Wi(v,b,c),c&&E&4&&w1(v,b);break;case 13:Wi(v,b,c),c&&E&4&&C1(v,b);break;case 22:b.memoizedState===null&&Wi(v,b,c),rc(b,b.return);break;case 30:break;default:Wi(v,b,c)}o=o.sibling}}function $m(i,o){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&$l(c))}function Wm(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&$l(i))}function Xr(i,o,c,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)R1(i,o,c,f),o=o.sibling}function R1(i,o,c,f){var v=o.flags;switch(o.tag){case 0:case 11:case 15:Xr(i,o,c,f),v&2048&&nc(9,o);break;case 1:Xr(i,o,c,f);break;case 3:Xr(i,o,c,f),v&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&$l(i)));break;case 12:if(v&2048){Xr(i,o,c,f),i=o.stateNode;try{var b=o.memoizedProps,E=b.id,N=b.onPostCommit;typeof N=="function"&&N(E,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){ct(o,o.return,q)}}else Xr(i,o,c,f);break;case 31:Xr(i,o,c,f);break;case 13:Xr(i,o,c,f);break;case 23:break;case 22:b=o.stateNode,E=o.alternate,o.memoizedState!==null?b._visibility&2?Xr(i,o,c,f):ic(i,o):b._visibility&2?Xr(i,o,c,f):(b._visibility|=2,Ra(i,o,c,f,(o.subtreeFlags&10256)!==0||!1)),v&2048&&$m(E,o);break;case 24:Xr(i,o,c,f),v&2048&&Wm(o.alternate,o);break;default:Xr(i,o,c,f)}}function Ra(i,o,c,f,v){for(v=v&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var b=i,E=o,N=c,q=f,ne=E.flags;switch(E.tag){case 0:case 11:case 15:Ra(b,E,N,q,v),nc(8,E);break;case 23:break;case 22:var ae=E.stateNode;E.memoizedState!==null?ae._visibility&2?Ra(b,E,N,q,v):ic(b,E):(ae._visibility|=2,Ra(b,E,N,q,v)),v&&ne&2048&&$m(E.alternate,E);break;case 24:Ra(b,E,N,q,v),v&&ne&2048&&Wm(E.alternate,E);break;default:Ra(b,E,N,q,v)}o=o.sibling}}function ic(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=i,f=o,v=f.flags;switch(f.tag){case 22:ic(c,f),v&2048&&$m(f.alternate,f);break;case 24:ic(c,f),v&2048&&Wm(f.alternate,f);break;default:ic(c,f)}o=o.sibling}}var sc=8192;function Ta(i,o,c){if(i.subtreeFlags&sc)for(i=i.child;i!==null;)T1(i,o,c),i=i.sibling}function T1(i,o,c){switch(i.tag){case 26:Ta(i,o,c),i.flags&sc&&i.memoizedState!==null&&u3(c,Yr,i.memoizedState,i.memoizedProps);break;case 5:Ta(i,o,c);break;case 3:case 4:var f=Yr;Yr=Uh(i.stateNode.containerInfo),Ta(i,o,c),Yr=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=sc,sc=16777216,Ta(i,o,c),sc=f):Ta(i,o,c));break;default:Ta(i,o,c)}}function M1(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function oc(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];cn=f,N1(f,i)}M1(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)A1(i),i=i.sibling}function A1(i){switch(i.tag){case 0:case 11:case 15:oc(i),i.flags&2048&&xs(9,i,i.return);break;case 3:oc(i);break;case 12:oc(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Mh(i)):oc(i);break;default:oc(i)}}function Mh(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];cn=f,N1(f,i)}M1(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:xs(8,o,o.return),Mh(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Mh(o));break;default:Mh(o)}i=i.sibling}}function N1(i,o){for(;cn!==null;){var c=cn;switch(c.tag){case 0:case 11:case 15:xs(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var f=c.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:$l(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,cn=f;else e:for(c=i;cn!==null;){f=cn;var v=f.sibling,b=f.return;if(x1(f),f===c){cn=null;break e}if(v!==null){v.return=b,cn=v;break e}cn=b}}}var kD={getCacheForType:function(i){var o=xn(Wt),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return xn(Wt).controller.signal}},ED=typeof WeakMap=="function"?WeakMap:Map,ot=0,vt=null,Ge=null,Qe=0,lt=0,dr=null,Ss=!1,Ma=!1,qm=!1,qi=0,Dt=0,ws=0,So=0,Vm=0,fr=0,Aa=0,ac=null,er=null,Km=!1,Ah=0,D1=0,Nh=1/0,Dh=null,Cs=null,Jt=0,ks=null,Na=null,Vi=0,Gm=0,Ym=null,O1=null,lc=0,Xm=null;function pr(){return(ot&2)!==0&&Qe!==0?Qe&-Qe:j.T!==null?ng():Kr()}function L1(){if(fr===0)if((Qe&536870912)===0||tt){var i=ea;ea<<=1,(ea&3932160)===0&&(ea=262144),fr=i}else fr=536870912;return i=ur.current,i!==null&&(i.flags|=32),fr}function tr(i,o,c){(i===vt&&(lt===2||lt===9)||i.cancelPendingCommit!==null)&&(Da(i,0),Es(i,Qe,fr,!1)),wr(i,c),((ot&2)===0||i!==vt)&&(i===vt&&((ot&2)===0&&(So|=c),Dt===4&&Es(i,Qe,fr,!1)),ui(i))}function z1(i,o,c){if((ot&6)!==0)throw Error(r(327));var f=!c&&(o&127)===0&&(o&i.expiredLanes)===0||Vn(i,o),v=f?MD(i,o):Qm(i,o,!0),b=f;do{if(v===0){Ma&&!f&&Es(i,o,0,!1);break}else{if(c=i.current.alternate,b&&!RD(c)){v=Qm(i,o,!1),b=!1;continue}if(v===2){if(b=o,i.errorRecoveryDisabledLanes&b)var E=0;else E=i.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var N=i;v=ac;var q=N.current.memoizedState.isDehydrated;if(q&&(Da(N,E).flags|=256),E=Qm(N,E,!1),E!==2){if(qm&&!q){N.errorRecoveryDisabledLanes|=b,So|=b,v=4;break e}b=er,er=v,b!==null&&(er===null?er=b:er.push.apply(er,b))}v=E}if(b=!1,v!==2)continue}}if(v===1){Da(i,0),Es(i,o,0,!0);break}e:{switch(f=i,b=v,b){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Es(f,o,fr,!Ss);break e;case 2:er=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(v=Ah+300-$t(),10<v)){if(Es(f,o,fr,!Ss),an(f,0,!0)!==0)break e;Vi=o,f.timeoutHandle=dS(j1.bind(null,f,c,er,Dh,Km,o,fr,So,Aa,Ss,b,"Throttled",-0,0),v);break e}j1(f,c,er,Dh,Km,o,fr,So,Aa,Ss,b,null,-0,0)}}break}while(!0);ui(i)}function j1(i,o,c,f,v,b,E,N,q,ne,ae,ce,re,se){if(i.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:Ni},T1(o,b,ce);var we=(b&62914560)===b?Ah-$t():(b&4194048)===b?D1-$t():0;if(we=h3(ce,we),we!==null){Vi=b,i.cancelPendingCommit=we(W1.bind(null,i,o,b,c,f,v,E,N,q,ae,ce,null,re,se)),Es(i,b,E,!ne);return}}W1(i,o,b,c,f,v,E,N,q)}function RD(i){for(var o=i;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var f=0;f<c.length;f++){var v=c[f],b=v.getSnapshot;v=v.value;try{if(!lr(b(),v))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Es(i,o,c,f){o&=~Vm,o&=~So,i.suspendedLanes|=o,i.pingedLanes&=~o,f&&(i.warmLanes|=o),f=i.expirationTimes;for(var v=o;0<v;){var b=31-Ne(v),E=1<<b;f[b]=-1,v&=~E}c!==0&&Vr(i,c,o)}function Oh(){return(ot&6)===0?(cc(0),!1):!0}function Zm(){if(Ge!==null){if(lt===0)var i=Ge.return;else i=Ge,zi=fo=null,fm(i),Sa=null,ql=0,i=Ge;for(;i!==null;)f1(i.alternate,i),i=i.return;Ge=null}}function Da(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,KD(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Vi=0,Zm(),vt=i,Ge=c=Oi(i.current,null),Qe=o,lt=0,dr=null,Ss=!1,Ma=Vn(i,o),qm=!1,Aa=fr=Vm=So=ws=Dt=0,er=ac=null,Km=!1,(o&8)!==0&&(o|=o&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=o;0<f;){var v=31-Ne(f),b=1<<v;o|=i[v],f&=~b}return qi=o,eh(),c}function B1(i,o){Fe=null,j.H=Jl,o===xa||o===lh?(o=J0(),lt=3):o===tm?(o=J0(),lt=4):lt=o===Mm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,dr=o,Ge===null&&(Dt=1,Sh(i,Mr(o,i.current)))}function P1(){var i=ur.current;return i===null?!0:(Qe&4194048)===Qe?Or===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?i===Or:!1}function I1(){var i=j.H;return j.H=Jl,i===null?Jl:i}function H1(){var i=j.A;return j.A=kD,i}function Lh(){Dt=4,Ss||(Qe&4194048)!==Qe&&ur.current!==null||(Ma=!0),(ws&134217727)===0&&(So&134217727)===0||vt===null||Es(vt,Qe,fr,!1)}function Qm(i,o,c){var f=ot;ot|=2;var v=I1(),b=H1();(vt!==i||Qe!==o)&&(Dh=null,Da(i,o)),o=!1;var E=Dt;e:do try{if(lt!==0&&Ge!==null){var N=Ge,q=dr;switch(lt){case 8:Zm(),E=6;break e;case 3:case 2:case 9:case 6:ur.current===null&&(o=!0);var ne=lt;if(lt=0,dr=null,Oa(i,N,q,ne),c&&Ma){E=0;break e}break;default:ne=lt,lt=0,dr=null,Oa(i,N,q,ne)}}TD(),E=Dt;break}catch(ae){B1(i,ae)}while(!0);return o&&i.shellSuspendCounter++,zi=fo=null,ot=f,j.H=v,j.A=b,Ge===null&&(vt=null,Qe=0,eh()),E}function TD(){for(;Ge!==null;)F1(Ge)}function MD(i,o){var c=ot;ot|=2;var f=I1(),v=H1();vt!==i||Qe!==o?(Dh=null,Nh=$t()+500,Da(i,o)):Ma=Vn(i,o);e:do try{if(lt!==0&&Ge!==null){o=Ge;var b=dr;t:switch(lt){case 1:lt=0,dr=null,Oa(i,o,b,1);break;case 2:case 9:if(Z0(b)){lt=0,dr=null,U1(o);break}o=function(){lt!==2&<!==9||vt!==i||(lt=7),ui(i)},b.then(o,o);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:Z0(b)?(lt=0,dr=null,U1(o)):(lt=0,dr=null,Oa(i,o,b,7));break;case 5:var E=null;switch(Ge.tag){case 26:E=Ge.memoizedState;case 5:case 27:var N=Ge;if(E?RS(E):N.stateNode.complete){lt=0,dr=null;var q=N.sibling;if(q!==null)Ge=q;else{var ne=N.return;ne!==null?(Ge=ne,zh(ne)):Ge=null}break t}}lt=0,dr=null,Oa(i,o,b,5);break;case 6:lt=0,dr=null,Oa(i,o,b,6);break;case 8:Zm(),Dt=6;break e;default:throw Error(r(462))}}AD();break}catch(ae){B1(i,ae)}while(!0);return zi=fo=null,j.H=f,j.A=v,ot=c,Ge!==null?0:(vt=null,Qe=0,eh(),Dt)}function AD(){for(;Ge!==null&&!Sr();)F1(Ge)}function F1(i){var o=h1(i.alternate,i,qi);i.memoizedProps=i.pendingProps,o===null?zh(i):Ge=o}function U1(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=s1(c,o,o.pendingProps,o.type,void 0,Qe);break;case 11:o=s1(c,o,o.pendingProps,o.type.render,o.ref,Qe);break;case 5:fm(o);default:f1(c,o),o=Ge=H0(o,qi),o=h1(c,o,qi)}i.memoizedProps=i.pendingProps,o===null?zh(i):Ge=o}function Oa(i,o,c,f){zi=fo=null,fm(o),Sa=null,ql=0;var v=o.return;try{if(_D(i,v,o,c,Qe)){Dt=1,Sh(i,Mr(c,i.current)),Ge=null;return}}catch(b){if(v!==null)throw Ge=v,b;Dt=1,Sh(i,Mr(c,i.current)),Ge=null;return}o.flags&32768?(tt||f===1?i=!0:Ma||(Qe&536870912)!==0?i=!1:(Ss=i=!0,(f===2||f===9||f===3||f===6)&&(f=ur.current,f!==null&&f.tag===13&&(f.flags|=16384))),$1(o,i)):zh(o)}function zh(i){var o=i;do{if((o.flags&32768)!==0){$1(o,Ss);return}i=o.return;var c=xD(o.alternate,o,qi);if(c!==null){Ge=c;return}if(o=o.sibling,o!==null){Ge=o;return}Ge=o=i}while(o!==null);Dt===0&&(Dt=5)}function $1(i,o){do{var c=SD(i.alternate,i);if(c!==null){c.flags&=32767,Ge=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){Ge=i;return}Ge=i=c}while(i!==null);Dt=6,Ge=null}function W1(i,o,c,f,v,b,E,N,q){i.cancelPendingCommit=null;do jh();while(Jt!==0);if((ot&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(b=o.lanes|o.childLanes,b|=Hp,Qt(i,c,b,E,N,q),i===vt&&(Ge=vt=null,Qe=0),Na=o,ks=i,Vi=c,Gm=b,Ym=v,O1=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,LD(Ae,function(){return Y1(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=j.T,j.T=null,v=Y.p,Y.p=2,E=ot,ot|=4;try{wD(i,o,c)}finally{ot=E,Y.p=v,j.T=f}}Jt=1,q1(),V1(),K1()}}function q1(){if(Jt===1){Jt=0;var i=ks,o=Na,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=j.T,j.T=null;var f=Y.p;Y.p=2;var v=ot;ot|=4;try{k1(o,i);var b=ug,E=N0(i.containerInfo),N=b.focusedElem,q=b.selectionRange;if(E!==N&&N&&N.ownerDocument&&A0(N.ownerDocument.documentElement,N)){if(q!==null&&zp(N)){var ne=q.start,ae=q.end;if(ae===void 0&&(ae=ne),"selectionStart"in N)N.selectionStart=ne,N.selectionEnd=Math.min(ae,N.value.length);else{var ce=N.ownerDocument||document,re=ce&&ce.defaultView||window;if(re.getSelection){var se=re.getSelection(),we=N.textContent.length,ze=Math.min(q.start,we),ft=q.end===void 0?ze:Math.min(q.end,we);!se.extend&&ze>ft&&(E=ft,ft=ze,ze=E);var J=M0(N,ze),X=M0(N,ft);if(J&&X&&(se.rangeCount!==1||se.anchorNode!==J.node||se.anchorOffset!==J.offset||se.focusNode!==X.node||se.focusOffset!==X.offset)){var te=ce.createRange();te.setStart(J.node,J.offset),se.removeAllRanges(),ze>ft?(se.addRange(te),se.extend(X.node,X.offset)):(te.setEnd(X.node,X.offset),se.addRange(te))}}}}for(ce=[],se=N;se=se.parentNode;)se.nodeType===1&&ce.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ce.length;N++){var le=ce[N];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Gh=!!cg,ug=cg=null}finally{ot=v,Y.p=f,j.T=c}}i.current=o,Jt=2}}function V1(){if(Jt===2){Jt=0;var i=ks,o=Na,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=j.T,j.T=null;var f=Y.p;Y.p=2;var v=ot;ot|=4;try{b1(i,o.alternate,o)}finally{ot=v,Y.p=f,j.T=c}}Jt=3}}function K1(){if(Jt===4||Jt===3){Jt=0,cs();var i=ks,o=Na,c=Vi,f=O1;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Jt=5:(Jt=0,Na=ks=null,G1(i,i.pendingLanes));var v=i.pendingLanes;if(v===0&&(Cs=null),Mi(c),o=o.stateNode,ye&&typeof ye.onCommitFiberRoot=="function")try{ye.onCommitFiberRoot(de,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=j.T,v=Y.p,Y.p=2,j.T=null;try{for(var b=i.onRecoverableError,E=0;E<f.length;E++){var N=f[E];b(N.value,{componentStack:N.stack})}}finally{j.T=o,Y.p=v}}(Vi&3)!==0&&jh(),ui(i),v=i.pendingLanes,(c&261930)!==0&&(v&42)!==0?i===Xm?lc++:(lc=0,Xm=i):lc=0,cc(0)}}function G1(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,$l(o)))}function jh(){return q1(),V1(),K1(),Y1()}function Y1(){if(Jt!==5)return!1;var i=ks,o=Gm;Gm=0;var c=Mi(Vi),f=j.T,v=Y.p;try{Y.p=32>c?32:c,j.T=null,c=Ym,Ym=null;var b=ks,E=Vi;if(Jt=0,Na=ks=null,Vi=0,(ot&6)!==0)throw Error(r(331));var N=ot;if(ot|=4,A1(b.current),R1(b,b.current,E,c),ot=N,cc(0,!1),ye&&typeof ye.onPostCommitFiberRoot=="function")try{ye.onPostCommitFiberRoot(de,b)}catch{}return!0}finally{Y.p=v,j.T=f,G1(i,o)}}function X1(i,o,c){o=Mr(c,o),o=Tm(i.stateNode,o,2),i=_s(i,o,2),i!==null&&(wr(i,2),ui(i))}function ct(i,o,c){if(i.tag===3)X1(i,i,c);else for(;o!==null;){if(o.tag===3){X1(o,i,c);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Cs===null||!Cs.has(f))){i=Mr(c,i),c=Zx(2),f=_s(o,c,2),f!==null&&(Qx(c,f,o,i),wr(f,2),ui(f));break}}o=o.return}}function Jm(i,o,c){var f=i.pingCache;if(f===null){f=i.pingCache=new ED;var v=new Set;f.set(o,v)}else v=f.get(o),v===void 0&&(v=new Set,f.set(o,v));v.has(c)||(qm=!0,v.add(c),i=ND.bind(null,i,o,c),o.then(i,i))}function ND(i,o,c){var f=i.pingCache;f!==null&&f.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,vt===i&&(Qe&c)===c&&(Dt===4||Dt===3&&(Qe&62914560)===Qe&&300>$t()-Ah?(ot&2)===0&&Da(i,0):Vm|=c,Aa===Qe&&(Aa=0)),ui(i)}function Z1(i,o){o===0&&(o=Rn()),i=co(i,o),i!==null&&(wr(i,o),ui(i))}function DD(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),Z1(i,c)}function OD(i,o){var c=0;switch(i.tag){case 31:case 13:var f=i.stateNode,v=i.memoizedState;v!==null&&(c=v.retryLane);break;case 19:f=i.stateNode;break;case 22:f=i.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(o),Z1(i,c)}function LD(i,o){return jt(i,o)}var Bh=null,La=null,eg=!1,Ph=!1,tg=!1,Rs=0;function ui(i){i!==La&&i.next===null&&(La===null?Bh=La=i:La=La.next=i),Ph=!0,eg||(eg=!0,jD())}function cc(i,o){if(!tg&&Ph){tg=!0;do for(var c=!1,f=Bh;f!==null;){if(i!==0){var v=f.pendingLanes;if(v===0)var b=0;else{var E=f.suspendedLanes,N=f.pingedLanes;b=(1<<31-Ne(42|i)+1)-1,b&=v&~(E&~N),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(c=!0,tS(f,b))}else b=Qe,b=an(f,f===vt?b:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(b&3)===0||Vn(f,b)||(c=!0,tS(f,b));f=f.next}while(c);tg=!1}}function zD(){Q1()}function Q1(){Ph=eg=!1;var i=0;Rs!==0&&VD()&&(i=Rs);for(var o=$t(),c=null,f=Bh;f!==null;){var v=f.next,b=J1(f,o);b===0?(f.next=null,c===null?Bh=v:c.next=v,v===null&&(La=c)):(c=f,(i!==0||(b&3)!==0)&&(Ph=!0)),f=v}Jt!==0&&Jt!==5||cc(i),Rs!==0&&(Rs=0)}function J1(i,o){for(var c=i.suspendedLanes,f=i.pingedLanes,v=i.expirationTimes,b=i.pendingLanes&-62914561;0<b;){var E=31-Ne(b),N=1<<E,q=v[E];q===-1?((N&c)===0||(N&f)!==0)&&(v[E]=Kn(N,o)):q<=o&&(i.expiredLanes|=N),b&=~N}if(o=vt,c=Qe,c=an(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,c===0||i===o&&(lt===2||lt===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&qn(f),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||Vn(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(f!==null&&qn(f),Mi(c)){case 2:case 8:c=pe;break;case 32:c=Ae;break;case 268435456:c=Ze;break;default:c=Ae}return f=eS.bind(null,i),c=jt(c,f),i.callbackPriority=o,i.callbackNode=c,o}return f!==null&&f!==null&&qn(f),i.callbackPriority=2,i.callbackNode=null,2}function eS(i,o){if(Jt!==0&&Jt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(jh()&&i.callbackNode!==c)return null;var f=Qe;return f=an(i,i===vt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(z1(i,f,o),J1(i,$t()),i.callbackNode!=null&&i.callbackNode===c?eS.bind(null,i):null)}function tS(i,o){if(jh())return null;z1(i,o,!0)}function jD(){GD(function(){(ot&6)!==0?jt(oe,zD):Q1()})}function ng(){if(Rs===0){var i=ya;i===0&&(i=Jo,Jo<<=1,(Jo&261888)===0&&(Jo=256)),Rs=i}return Rs}function nS(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Vu(""+i)}function rS(i,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,i.id&&c.setAttribute("form",i.id),o.parentNode.insertBefore(c,o),i=new FormData(i),c.parentNode.removeChild(c),i}function BD(i,o,c,f,v){if(o==="submit"&&c&&c.stateNode===v){var b=nS((v[Yn]||null).action),E=f.submitter;E&&(o=(o=E[Yn]||null)?nS(o.formAction):E.getAttribute("formAction"),o!==null&&(b=o,E=null));var N=new Xu("action","action",null,f,v);i.push({event:N,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Rs!==0){var q=E?rS(v,E):new FormData(v);Sm(c,{pending:!0,data:q,method:v.method,action:b},null,q)}}else typeof b=="function"&&(N.preventDefault(),q=E?rS(v,E):new FormData(v),Sm(c,{pending:!0,data:q,method:v.method,action:b},b,q))},currentTarget:v}]})}}for(var rg=0;rg<Ip.length;rg++){var ig=Ip[rg],PD=ig.toLowerCase(),ID=ig[0].toUpperCase()+ig.slice(1);Gr(PD,"on"+ID)}Gr(L0,"onAnimationEnd"),Gr(z0,"onAnimationIteration"),Gr(j0,"onAnimationStart"),Gr("dblclick","onDoubleClick"),Gr("focusin","onFocus"),Gr("focusout","onBlur"),Gr(tD,"onTransitionRun"),Gr(nD,"onTransitionStart"),Gr(rD,"onTransitionCancel"),Gr(B0,"onTransitionEnd"),sa("onMouseEnter",["mouseout","mouseover"]),sa("onMouseLeave",["mouseout","mouseover"]),sa("onPointerEnter",["pointerout","pointerover"]),sa("onPointerLeave",["pointerout","pointerover"]),so("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),so("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),so("onBeforeInput",["compositionend","keypress","textInput","paste"]),so("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),so("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),so("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uc="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(" "),HD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uc));function iS(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],v=f.event;f=f.listeners;e:{var b=void 0;if(o)for(var E=f.length-1;0<=E;E--){var N=f[E],q=N.instance,ne=N.currentTarget;if(N=N.listener,q!==b&&v.isPropagationStopped())break e;b=N,v.currentTarget=ne;try{b(v)}catch(ae){Ju(ae)}v.currentTarget=null,b=q}else for(E=0;E<f.length;E++){if(N=f[E],q=N.instance,ne=N.currentTarget,N=N.listener,q!==b&&v.isPropagationStopped())break e;b=N,v.currentTarget=ne;try{b(v)}catch(ae){Ju(ae)}v.currentTarget=null,b=q}}}}function Ye(i,o){var c=o[vp];c===void 0&&(c=o[vp]=new Set);var f=i+"__bubble";c.has(f)||(sS(o,i,2,!1),c.add(f))}function sg(i,o,c){var f=0;o&&(f|=4),sS(c,i,f,o)}var Ih="_reactListening"+Math.random().toString(36).slice(2);function og(i){if(!i[Ih]){i[Ih]=!0,Qb.forEach(function(c){c!=="selectionchange"&&(HD.has(c)||sg(c,!1,i),sg(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Ih]||(o[Ih]=!0,sg("selectionchange",!1,o))}}function sS(i,o,c,f){switch(LS(o)){case 2:var v=p3;break;case 8:v=m3;break;default:v=xg}c=v.bind(null,o,c,i),v=void 0,!Ep||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(v=!0),f?v!==void 0?i.addEventListener(o,c,{capture:!0,passive:v}):i.addEventListener(o,c,!0):v!==void 0?i.addEventListener(o,c,{passive:v}):i.addEventListener(o,c,!1)}function ag(i,o,c,f,v){var b=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var N=f.stateNode.containerInfo;if(N===v)break;if(E===4)for(E=f.return;E!==null;){var q=E.tag;if((q===3||q===4)&&E.stateNode.containerInfo===v)return;E=E.return}for(;N!==null;){if(E=na(N),E===null)return;if(q=E.tag,q===5||q===6||q===26||q===27){f=b=E;continue e}N=N.parentNode}}f=f.return}u0(function(){var ne=b,ae=Cp(c),ce=[];e:{var re=P0.get(i);if(re!==void 0){var se=Xu,we=i;switch(i){case"keypress":if(Gu(c)===0)break e;case"keydown":case"keyup":se=ON;break;case"focusin":we="focus",se=Ap;break;case"focusout":we="blur",se=Ap;break;case"beforeblur":case"afterblur":se=Ap;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=f0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=xN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=jN;break;case L0:case z0:case j0:se=CN;break;case B0:se=PN;break;case"scroll":case"scrollend":se=yN;break;case"wheel":se=HN;break;case"copy":case"cut":case"paste":se=EN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=m0;break;case"toggle":case"beforetoggle":se=UN}var ze=(o&4)!==0,ft=!ze&&(i==="scroll"||i==="scrollend"),J=ze?re!==null?re+"Capture":null:re;ze=[];for(var X=ne,te;X!==null;){var le=X;if(te=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||te===null||J===null||(le=Dl(X,J),le!=null&&ze.push(hc(X,le,te))),ft)break;X=X.return}0<ze.length&&(re=new se(re,we,null,c,ae),ce.push({event:re,listeners:ze}))}}if((o&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",se=i==="mouseout"||i==="pointerout",re&&c!==wp&&(we=c.relatedTarget||c.fromElement)&&(na(we)||we[ta]))break e;if((se||re)&&(re=ae.window===ae?ae:(re=ae.ownerDocument)?re.defaultView||re.parentWindow:window,se?(we=c.relatedTarget||c.toElement,se=ne,we=we?na(we):null,we!==null&&(ft=a(we),ze=we.tag,we!==ft||ze!==5&&ze!==27&&ze!==6)&&(we=null)):(se=null,we=ne),se!==we)){if(ze=f0,le="onMouseLeave",J="onMouseEnter",X="mouse",(i==="pointerout"||i==="pointerover")&&(ze=m0,le="onPointerLeave",J="onPointerEnter",X="pointer"),ft=se==null?re:Nl(se),te=we==null?re:Nl(we),re=new ze(le,X+"leave",se,c,ae),re.target=ft,re.relatedTarget=te,le=null,na(ae)===ne&&(ze=new ze(J,X+"enter",we,c,ae),ze.target=te,ze.relatedTarget=ft,le=ze),ft=le,se&&we)t:{for(ze=FD,J=se,X=we,te=0,le=J;le;le=ze(le))te++;le=0;for(var De=X;De;De=ze(De))le++;for(;0<te-le;)J=ze(J),te--;for(;0<le-te;)X=ze(X),le--;for(;te--;){if(J===X||X!==null&&J===X.alternate){ze=J;break t}J=ze(J),X=ze(X)}ze=null}else ze=null;se!==null&&oS(ce,re,se,ze,!1),we!==null&&ft!==null&&oS(ce,ft,we,ze,!0)}}e:{if(re=ne?Nl(ne):window,se=re.nodeName&&re.nodeName.toLowerCase(),se==="select"||se==="input"&&re.type==="file")var it=w0;else if(x0(re))if(C0)it=QN;else{it=XN;var Re=YN}else se=re.nodeName,!se||se.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ne&&Sp(ne.elementType)&&(it=w0):it=ZN;if(it&&(it=it(i,ne))){S0(ce,it,c,ae);break e}Re&&Re(i,re,ne),i==="focusout"&&ne&&re.type==="number"&&ne.memoizedProps.value!=null&&xp(re,"number",re.value)}switch(Re=ne?Nl(ne):window,i){case"focusin":(x0(Re)||Re.contentEditable==="true")&&(ha=Re,jp=ne,Hl=null);break;case"focusout":Hl=jp=ha=null;break;case"mousedown":Bp=!0;break;case"contextmenu":case"mouseup":case"dragend":Bp=!1,D0(ce,c,ae);break;case"selectionchange":if(eD)break;case"keydown":case"keyup":D0(ce,c,ae)}var Ue;if(Dp)e:{switch(i){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else ua?y0(i,c)&&(Je="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Je="onCompositionStart");Je&&(g0&&c.locale!=="ko"&&(ua||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&ua&&(Ue=h0()):(hs=ae,Rp="value"in hs?hs.value:hs.textContent,ua=!0)),Re=Hh(ne,Je),0<Re.length&&(Je=new p0(Je,i,null,c,ae),ce.push({event:Je,listeners:Re}),Ue?Je.data=Ue:(Ue=b0(c),Ue!==null&&(Je.data=Ue)))),(Ue=WN?qN(i,c):VN(i,c))&&(Je=Hh(ne,"onBeforeInput"),0<Je.length&&(Re=new p0("onBeforeInput","beforeinput",null,c,ae),ce.push({event:Re,listeners:Je}),Re.data=Ue)),BD(ce,i,ne,c,ae)}iS(ce,o)})}function hc(i,o,c){return{instance:i,listener:o,currentTarget:c}}function Hh(i,o){for(var c=o+"Capture",f=[];i!==null;){var v=i,b=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||b===null||(v=Dl(i,c),v!=null&&f.unshift(hc(i,v,b)),v=Dl(i,o),v!=null&&f.push(hc(i,v,b))),i.tag===3)return f;i=i.return}return[]}function FD(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function oS(i,o,c,f,v){for(var b=o._reactName,E=[];c!==null&&c!==f;){var N=c,q=N.alternate,ne=N.stateNode;if(N=N.tag,q!==null&&q===f)break;N!==5&&N!==26&&N!==27||ne===null||(q=ne,v?(ne=Dl(c,b),ne!=null&&E.unshift(hc(c,ne,q))):v||(ne=Dl(c,b),ne!=null&&E.push(hc(c,ne,q)))),c=c.return}E.length!==0&&i.push({event:o,listeners:E})}var UD=/\r\n?/g,$D=/\u0000|\uFFFD/g;function aS(i){return(typeof i=="string"?i:""+i).replace(UD,`
|
|
49
|
+
`).replace($D,"")}function lS(i,o){return o=aS(o),aS(i)===o}function dt(i,o,c,f,v,b){switch(c){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||aa(i,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&aa(i,""+f);break;case"className":Wu(i,"class",f);break;case"tabIndex":Wu(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Wu(i,c,f);break;case"style":l0(i,f,b);break;case"data":if(o!=="object"){Wu(i,"data",f);break}case"src":case"href":if(f===""&&(o!=="a"||c!=="href")){i.removeAttribute(c);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=Vu(""+f),i.setAttribute(c,f);break;case"action":case"formAction":if(typeof f=="function"){i.setAttribute(c,"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 b=="function"&&(c==="formAction"?(o!=="input"&&dt(i,o,"name",v.name,v,null),dt(i,o,"formEncType",v.formEncType,v,null),dt(i,o,"formMethod",v.formMethod,v,null),dt(i,o,"formTarget",v.formTarget,v,null)):(dt(i,o,"encType",v.encType,v,null),dt(i,o,"method",v.method,v,null),dt(i,o,"target",v.target,v,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=Vu(""+f),i.setAttribute(c,f);break;case"onClick":f!=null&&(i.onclick=Ni);break;case"onScroll":f!=null&&Ye("scroll",i);break;case"onScrollEnd":f!=null&&Ye("scrollend",i);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":i.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){i.removeAttribute("xlink:href");break}c=Vu(""+f),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""+f):i.removeAttribute(c);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":f&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":f===!0?i.setAttribute(c,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,f):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?i.setAttribute(c,f):i.removeAttribute(c);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?i.removeAttribute(c):i.setAttribute(c,f);break;case"popover":Ye("beforetoggle",i),Ye("toggle",i),$u(i,"popover",f);break;case"xlinkActuate":Ai(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Ai(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Ai(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Ai(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Ai(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Ai(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Ai(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Ai(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Ai(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":$u(i,"is",f);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=vN.get(c)||c,$u(i,c,f))}}function lg(i,o,c,f,v,b){switch(c){case"style":l0(i,f,b);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof f=="string"?aa(i,f):(typeof f=="number"||typeof f=="bigint")&&aa(i,""+f);break;case"onScroll":f!=null&&Ye("scroll",i);break;case"onScrollEnd":f!=null&&Ye("scrollend",i);break;case"onClick":f!=null&&(i.onclick=Ni);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jb.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),o=c.slice(2,v?c.length-7:void 0),b=i[Yn]||null,b=b!=null?b[c]:null,typeof b=="function"&&i.removeEventListener(o,b,v),typeof f=="function")){typeof b!="function"&&b!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(o,f,v);break e}c in i?i[c]=f:f===!0?i.setAttribute(c,""):$u(i,c,f)}}}function wn(i,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",i),Ye("load",i);var f=!1,v=!1,b;for(b in c)if(c.hasOwnProperty(b)){var E=c[b];if(E!=null)switch(b){case"src":f=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:dt(i,o,b,E,c,null)}}v&&dt(i,o,"srcSet",c.srcSet,c,null),f&&dt(i,o,"src",c.src,c,null);return;case"input":Ye("invalid",i);var N=b=E=v=null,q=null,ne=null;for(f in c)if(c.hasOwnProperty(f)){var ae=c[f];if(ae!=null)switch(f){case"name":v=ae;break;case"type":E=ae;break;case"checked":q=ae;break;case"defaultChecked":ne=ae;break;case"value":b=ae;break;case"defaultValue":N=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,o));break;default:dt(i,o,f,ae,c,null)}}i0(i,b,N,q,ne,E,v,!1);return;case"select":Ye("invalid",i),f=E=b=null;for(v in c)if(c.hasOwnProperty(v)&&(N=c[v],N!=null))switch(v){case"value":b=N;break;case"defaultValue":E=N;break;case"multiple":f=N;default:dt(i,o,v,N,c,null)}o=b,c=E,i.multiple=!!f,o!=null?oa(i,!!f,o,!1):c!=null&&oa(i,!!f,c,!0);return;case"textarea":Ye("invalid",i),b=v=f=null;for(E in c)if(c.hasOwnProperty(E)&&(N=c[E],N!=null))switch(E){case"value":f=N;break;case"defaultValue":v=N;break;case"children":b=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:dt(i,o,E,N,c,null)}o0(i,f,v,b);return;case"option":for(q in c)if(c.hasOwnProperty(q)&&(f=c[q],f!=null))switch(q){case"selected":i.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:dt(i,o,q,f,c,null)}return;case"dialog":Ye("beforetoggle",i),Ye("toggle",i),Ye("cancel",i),Ye("close",i);break;case"iframe":case"object":Ye("load",i);break;case"video":case"audio":for(f=0;f<uc.length;f++)Ye(uc[f],i);break;case"image":Ye("error",i),Ye("load",i);break;case"details":Ye("toggle",i);break;case"embed":case"source":case"link":Ye("error",i),Ye("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in c)if(c.hasOwnProperty(ne)&&(f=c[ne],f!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:dt(i,o,ne,f,c,null)}return;default:if(Sp(o)){for(ae in c)c.hasOwnProperty(ae)&&(f=c[ae],f!==void 0&&lg(i,o,ae,f,c,void 0));return}}for(N in c)c.hasOwnProperty(N)&&(f=c[N],f!=null&&dt(i,o,N,f,c,null))}function WD(i,o,c,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,b=null,E=null,N=null,q=null,ne=null,ae=null;for(se in c){var ce=c[se];if(c.hasOwnProperty(se)&&ce!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":q=ce;default:f.hasOwnProperty(se)||dt(i,o,se,null,f,ce)}}for(var re in f){var se=f[re];if(ce=c[re],f.hasOwnProperty(re)&&(se!=null||ce!=null))switch(re){case"type":b=se;break;case"name":v=se;break;case"checked":ne=se;break;case"defaultChecked":ae=se;break;case"value":E=se;break;case"defaultValue":N=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,o));break;default:se!==ce&&dt(i,o,re,se,f,ce)}}bp(i,E,N,q,ne,ae,b,v);return;case"select":se=E=N=re=null;for(b in c)if(q=c[b],c.hasOwnProperty(b)&&q!=null)switch(b){case"value":break;case"multiple":se=q;default:f.hasOwnProperty(b)||dt(i,o,b,null,f,q)}for(v in f)if(b=f[v],q=c[v],f.hasOwnProperty(v)&&(b!=null||q!=null))switch(v){case"value":re=b;break;case"defaultValue":N=b;break;case"multiple":E=b;default:b!==q&&dt(i,o,v,b,f,q)}o=N,c=E,f=se,re!=null?oa(i,!!c,re,!1):!!f!=!!c&&(o!=null?oa(i,!!c,o,!0):oa(i,!!c,c?[]:"",!1));return;case"textarea":se=re=null;for(N in c)if(v=c[N],c.hasOwnProperty(N)&&v!=null&&!f.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:dt(i,o,N,null,f,v)}for(E in f)if(v=f[E],b=c[E],f.hasOwnProperty(E)&&(v!=null||b!=null))switch(E){case"value":re=v;break;case"defaultValue":se=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==b&&dt(i,o,E,v,f,b)}s0(i,re,se);return;case"option":for(var we in c)if(re=c[we],c.hasOwnProperty(we)&&re!=null&&!f.hasOwnProperty(we))switch(we){case"selected":i.selected=!1;break;default:dt(i,o,we,null,f,re)}for(q in f)if(re=f[q],se=c[q],f.hasOwnProperty(q)&&re!==se&&(re!=null||se!=null))switch(q){case"selected":i.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:dt(i,o,q,re,f,se)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ze in c)re=c[ze],c.hasOwnProperty(ze)&&re!=null&&!f.hasOwnProperty(ze)&&dt(i,o,ze,null,f,re);for(ne in f)if(re=f[ne],se=c[ne],f.hasOwnProperty(ne)&&re!==se&&(re!=null||se!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,o));break;default:dt(i,o,ne,re,f,se)}return;default:if(Sp(o)){for(var ft in c)re=c[ft],c.hasOwnProperty(ft)&&re!==void 0&&!f.hasOwnProperty(ft)&&lg(i,o,ft,void 0,f,re);for(ae in f)re=f[ae],se=c[ae],!f.hasOwnProperty(ae)||re===se||re===void 0&&se===void 0||lg(i,o,ae,re,f,se);return}}for(var J in c)re=c[J],c.hasOwnProperty(J)&&re!=null&&!f.hasOwnProperty(J)&&dt(i,o,J,null,f,re);for(ce in f)re=f[ce],se=c[ce],!f.hasOwnProperty(ce)||re===se||re==null&&se==null||dt(i,o,ce,re,f,se)}function cS(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function qD(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var v=c[f],b=v.transferSize,E=v.initiatorType,N=v.duration;if(b&&N&&cS(E)){for(E=0,N=v.responseEnd,f+=1;f<c.length;f++){var q=c[f],ne=q.startTime;if(ne>N)break;var ae=q.transferSize,ce=q.initiatorType;ae&&cS(ce)&&(q=q.responseEnd,E+=ae*(q<N?1:(N-ne)/(q-ne)))}if(--f,o+=8*(b+E)/(v.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var cg=null,ug=null;function Fh(i){return i.nodeType===9?i:i.ownerDocument}function uS(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hS(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function hg(i,o){return i==="textarea"||i==="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 dg=null;function VD(){var i=window.event;return i&&i.type==="popstate"?i===dg?!1:(dg=i,!0):(dg=null,!1)}var dS=typeof setTimeout=="function"?setTimeout:void 0,KD=typeof clearTimeout=="function"?clearTimeout:void 0,fS=typeof Promise=="function"?Promise:void 0,GD=typeof queueMicrotask=="function"?queueMicrotask:typeof fS<"u"?function(i){return fS.resolve(null).then(i).catch(YD)}:dS;function YD(i){setTimeout(function(){throw i})}function Ts(i){return i==="head"}function pS(i,o){var c=o,f=0;do{var v=c.nextSibling;if(i.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(f===0){i.removeChild(v),Pa(o);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")dc(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,dc(c);for(var b=c.firstChild;b;){var E=b.nextSibling,N=b.nodeName;b[Al]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&b.rel.toLowerCase()==="stylesheet"||c.removeChild(b),b=E}}else c==="body"&&dc(i.ownerDocument.body);c=v}while(c);Pa(o)}function mS(i,o){var c=i;i=0;do{var f=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),f&&f.nodeType===8)if(c=f.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=f}while(c)}function fg(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":fg(c),_p(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function XD(i,o,c,f){for(;i.nodeType===1;){var v=c;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){if(!i[Al])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(b=i.getAttribute("rel"),b==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(b!==v.rel||i.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||i.getAttribute("title")!==(v.title==null?null:v.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(b=i.getAttribute("src"),(b!==(v.src==null?null:v.src)||i.getAttribute("type")!==(v.type==null?null:v.type)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&b&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var b=v.name==null?null:""+v.name;if(v.type==="hidden"&&i.getAttribute("name")===b)return i}else return i;if(i=Lr(i.nextSibling),i===null)break}return null}function ZD(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=Lr(i.nextSibling),i===null))return null;return i}function gS(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Lr(i.nextSibling),i===null))return null;return i}function pg(i){return i.data==="$?"||i.data==="$~"}function mg(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function QD(i,o){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||c.readyState!=="loading")o();else{var f=function(){o(),c.removeEventListener("DOMContentLoaded",f)};c.addEventListener("DOMContentLoaded",f),i._reactRetry=f}}function Lr(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var gg=null;function vS(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return Lr(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function _S(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return i;o--}else c!=="/$"&&c!=="/&"||o++}i=i.previousSibling}return null}function yS(i,o,c){switch(o=Fh(c),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function dc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);_p(i)}var zr=new Map,bS=new Set;function Uh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ki=Y.d;Y.d={f:JD,r:e3,D:t3,C:n3,L:r3,m:i3,X:o3,S:s3,M:a3};function JD(){var i=Ki.f(),o=Oh();return i||o}function e3(i){var o=ra(i);o!==null&&o.tag===5&&o.type==="form"?Bx(o):Ki.r(i)}var za=typeof document>"u"?null:document;function xS(i,o,c){var f=za;if(f&&typeof o=="string"&&o){var v=Rr(o);v='link[rel="'+i+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),bS.has(v)||(bS.add(v),i={rel:i,crossOrigin:c,href:o},f.querySelector(v)===null&&(o=f.createElement("link"),wn(o,"link",i),ln(o),f.head.appendChild(o)))}}function t3(i){Ki.D(i),xS("dns-prefetch",i,null)}function n3(i,o){Ki.C(i,o),xS("preconnect",i,o)}function r3(i,o,c){Ki.L(i,o,c);var f=za;if(f&&i&&o){var v='link[rel="preload"][as="'+Rr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+Rr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+Rr(c.imageSizes)+'"]')):v+='[href="'+Rr(i)+'"]';var b=v;switch(o){case"style":b=ja(i);break;case"script":b=Ba(i)}zr.has(b)||(i=m({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),zr.set(b,i),f.querySelector(v)!==null||o==="style"&&f.querySelector(fc(b))||o==="script"&&f.querySelector(pc(b))||(o=f.createElement("link"),wn(o,"link",i),ln(o),f.head.appendChild(o)))}}function i3(i,o){Ki.m(i,o);var c=za;if(c&&i){var f=o&&typeof o.as=="string"?o.as:"script",v='link[rel="modulepreload"][as="'+Rr(f)+'"][href="'+Rr(i)+'"]',b=v;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Ba(i)}if(!zr.has(b)&&(i=m({rel:"modulepreload",href:i},o),zr.set(b,i),c.querySelector(v)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(pc(b)))return}f=c.createElement("link"),wn(f,"link",i),ln(f),c.head.appendChild(f)}}}function s3(i,o,c){Ki.S(i,o,c);var f=za;if(f&&i){var v=ia(f).hoistableStyles,b=ja(i);o=o||"default";var E=v.get(b);if(!E){var N={loading:0,preload:null};if(E=f.querySelector(fc(b)))N.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},c),(c=zr.get(b))&&vg(i,c);var q=E=f.createElement("link");ln(q),wn(q,"link",i),q._p=new Promise(function(ne,ae){q.onload=ne,q.onerror=ae}),q.addEventListener("load",function(){N.loading|=1}),q.addEventListener("error",function(){N.loading|=2}),N.loading|=4,$h(E,o,f)}E={type:"stylesheet",instance:E,count:1,state:N},v.set(b,E)}}}function o3(i,o){Ki.X(i,o);var c=za;if(c&&i){var f=ia(c).hoistableScripts,v=Ba(i),b=f.get(v);b||(b=c.querySelector(pc(v)),b||(i=m({src:i,async:!0},o),(o=zr.get(v))&&_g(i,o),b=c.createElement("script"),ln(b),wn(b,"link",i),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(v,b))}}function a3(i,o){Ki.M(i,o);var c=za;if(c&&i){var f=ia(c).hoistableScripts,v=Ba(i),b=f.get(v);b||(b=c.querySelector(pc(v)),b||(i=m({src:i,async:!0,type:"module"},o),(o=zr.get(v))&&_g(i,o),b=c.createElement("script"),ln(b),wn(b,"link",i),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(v,b))}}function SS(i,o,c,f){var v=(v=ie.current)?Uh(v):null;if(!v)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=ja(c.href),c=ia(v).hoistableStyles,f=c.get(o),f||(f={type:"style",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=ja(c.href);var b=ia(v).hoistableStyles,E=b.get(i);if(E||(v=v.ownerDocument||v,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(i,E),(b=v.querySelector(fc(i)))&&!b._p&&(E.instance=b,E.state.loading=5),zr.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},zr.set(i,c),b||l3(v,i,c,E.state))),o&&f===null)throw Error(r(528,""));return E}if(o&&f!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Ba(c),c=ia(v).hoistableScripts,f=c.get(o),f||(f={type:"script",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ja(i){return'href="'+Rr(i)+'"'}function fc(i){return'link[rel="stylesheet"]['+i+"]"}function wS(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function l3(i,o,c,f){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?f.loading=1:(o=i.createElement("link"),f.preload=o,o.addEventListener("load",function(){return f.loading|=1}),o.addEventListener("error",function(){return f.loading|=2}),wn(o,"link",c),ln(o),i.head.appendChild(o))}function Ba(i){return'[src="'+Rr(i)+'"]'}function pc(i){return"script[async]"+i}function CS(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var f=i.querySelector('style[data-href~="'+Rr(c.href)+'"]');if(f)return o.instance=f,ln(f),f;var v=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),ln(f),wn(f,"style",v),$h(f,c.precedence,i),o.instance=f;case"stylesheet":v=ja(c.href);var b=i.querySelector(fc(v));if(b)return o.state.loading|=4,o.instance=b,ln(b),b;f=wS(c),(v=zr.get(v))&&vg(f,v),b=(i.ownerDocument||i).createElement("link"),ln(b);var E=b;return E._p=new Promise(function(N,q){E.onload=N,E.onerror=q}),wn(b,"link",f),o.state.loading|=4,$h(b,c.precedence,i),o.instance=b;case"script":return b=Ba(c.src),(v=i.querySelector(pc(b)))?(o.instance=v,ln(v),v):(f=c,(v=zr.get(b))&&(f=m({},c),_g(f,v)),i=i.ownerDocument||i,v=i.createElement("script"),ln(v),wn(v,"link",f),i.head.appendChild(v),o.instance=v);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(f=o.instance,o.state.loading|=4,$h(f,c.precedence,i));return o.instance}function $h(i,o,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=f.length?f[f.length-1]:null,b=v,E=0;E<f.length;E++){var N=f[E];if(N.dataset.precedence===o)b=N;else if(b!==v)break}b?b.parentNode.insertBefore(i,b.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(i,o.firstChild))}function vg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function _g(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Wh=null;function kS(i,o,c){if(Wh===null){var f=new Map,v=Wh=new Map;v.set(c,f)}else v=Wh,f=v.get(c),f||(f=new Map,v.set(c,f));if(f.has(i))return f;for(f.set(i,null),c=c.getElementsByTagName(i),v=0;v<c.length;v++){var b=c[v];if(!(b[Al]||b[yn]||i==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var E=b.getAttribute(o)||"";E=i+E;var N=f.get(E);N?N.push(b):f.set(E,[b])}}return f}function ES(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function c3(i,o,c){if(c===1||o.itemProp!=null)return!1;switch(i){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 i=o.disabled,typeof o.precedence=="string"&&i==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 RS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function u3(i,o,c,f){if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=ja(f.href),b=o.querySelector(fc(v));if(b){o=b._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=qh.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=b,ln(b);return}b=o.ownerDocument||o,f=wS(f),(v=zr.get(v))&&vg(f,v),b=b.createElement("link"),ln(b);var E=b;E._p=new Promise(function(N,q){E.onload=N,E.onerror=q}),wn(b,"link",f),c.instance=b}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=qh.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var yg=0;function h3(i,o){return i.stylesheets&&i.count===0&&Kh(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var f=setTimeout(function(){if(i.stylesheets&&Kh(i,i.stylesheets),i.unsuspend){var b=i.unsuspend;i.unsuspend=null,b()}},6e4+o);0<i.imgBytes&&yg===0&&(yg=62500*qD());var v=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Kh(i,i.stylesheets),i.unsuspend)){var b=i.unsuspend;i.unsuspend=null,b()}},(i.imgBytes>yg?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(v)}}:null}function qh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Vh=null;function Kh(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Vh=new Map,o.forEach(d3,i),Vh=null,qh.call(i))}function d3(i,o){if(!(o.state.loading&4)){var c=Vh.get(i);if(c)var f=c.get(null);else{c=new Map,Vh.set(i,c);for(var v=i.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<v.length;b++){var E=v[b];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),f=E)}f&&c.set(null,f)}v=o.instance,E=v.getAttribute("data-precedence"),b=c.get(E)||f,b===f&&c.set(null,v),c.set(E,v),this.count++,f=qh.bind(this),v.addEventListener("load",f),v.addEventListener("error",f),b?b.parentNode.insertBefore(v,b.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(v,i.firstChild)),o.state.loading|=4}}var mc={$$typeof:R,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function f3(i,o,c,f,v,b,E,N,q){this.tag=1,this.containerInfo=i,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=Gn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gn(0),this.hiddenUpdates=Gn(null),this.identifierPrefix=f,this.onUncaughtError=v,this.onCaughtError=b,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function TS(i,o,c,f,v,b,E,N,q,ne,ae,ce){return i=new f3(i,o,c,E,q,ne,ae,ce,N),o=1,b===!0&&(o|=24),b=cr(3,null,null,o),i.current=b,b.stateNode=i,o=Qp(),o.refCount++,i.pooledCache=o,o.refCount++,b.memoizedState={element:f,isDehydrated:c,cache:o},nm(b),i}function MS(i){return i?(i=pa,i):pa}function AS(i,o,c,f,v,b){v=MS(v),f.context===null?f.context=v:f.pendingContext=v,f=vs(o),f.payload={element:c},b=b===void 0?null:b,b!==null&&(f.callback=b),c=_s(i,f,o),c!==null&&(tr(c,i,o),Kl(c,i,o))}function NS(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function bg(i,o){NS(i,o),(i=i.alternate)&&NS(i,o)}function DS(i){if(i.tag===13||i.tag===31){var o=co(i,67108864);o!==null&&tr(o,i,67108864),bg(i,67108864)}}function OS(i){if(i.tag===13||i.tag===31){var o=pr();o=Ti(o);var c=co(i,o);c!==null&&tr(c,i,o),bg(i,o)}}var Gh=!0;function p3(i,o,c,f){var v=j.T;j.T=null;var b=Y.p;try{Y.p=2,xg(i,o,c,f)}finally{Y.p=b,j.T=v}}function m3(i,o,c,f){var v=j.T;j.T=null;var b=Y.p;try{Y.p=8,xg(i,o,c,f)}finally{Y.p=b,j.T=v}}function xg(i,o,c,f){if(Gh){var v=Sg(f);if(v===null)ag(i,o,f,Yh,c),zS(i,f);else if(v3(v,i,o,c,f))f.stopPropagation();else if(zS(i,f),o&4&&-1<g3.indexOf(i)){for(;v!==null;){var b=ra(v);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var E=Pt(b.pendingLanes);if(E!==0){var N=b;for(N.pendingLanes|=2,N.entangledLanes|=2;E;){var q=1<<31-Ne(E);N.entanglements[1]|=q,E&=~q}ui(b),(ot&6)===0&&(Nh=$t()+500,cc(0))}}break;case 31:case 13:N=co(b,2),N!==null&&tr(N,b,2),Oh(),bg(b,2)}if(b=Sg(f),b===null&&ag(i,o,f,Yh,c),b===v)break;v=b}v!==null&&f.stopPropagation()}else ag(i,o,f,null,c)}}function Sg(i){return i=Cp(i),wg(i)}var Yh=null;function wg(i){if(Yh=null,i=na(i),i!==null){var o=a(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=l(o),i!==null)return i;i=null}else if(c===31){if(i=u(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Yh=i,null}function LS(i){switch(i){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(io()){case oe:return 2;case pe:return 8;case Ae:case Pe:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var Cg=!1,Ms=null,As=null,Ns=null,gc=new Map,vc=new Map,Ds=[],g3="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 zS(i,o){switch(i){case"focusin":case"focusout":Ms=null;break;case"dragenter":case"dragleave":As=null;break;case"mouseover":case"mouseout":Ns=null;break;case"pointerover":case"pointerout":gc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":vc.delete(o.pointerId)}}function _c(i,o,c,f,v,b){return i===null||i.nativeEvent!==b?(i={blockedOn:o,domEventName:c,eventSystemFlags:f,nativeEvent:b,targetContainers:[v]},o!==null&&(o=ra(o),o!==null&&DS(o)),i):(i.eventSystemFlags|=f,o=i.targetContainers,v!==null&&o.indexOf(v)===-1&&o.push(v),i)}function v3(i,o,c,f,v){switch(o){case"focusin":return Ms=_c(Ms,i,o,c,f,v),!0;case"dragenter":return As=_c(As,i,o,c,f,v),!0;case"mouseover":return Ns=_c(Ns,i,o,c,f,v),!0;case"pointerover":var b=v.pointerId;return gc.set(b,_c(gc.get(b)||null,i,o,c,f,v)),!0;case"gotpointercapture":return b=v.pointerId,vc.set(b,_c(vc.get(b)||null,i,o,c,f,v)),!0}return!1}function jS(i){var o=na(i.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){i.blockedOn=o,us(i.priority,function(){OS(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,us(i.priority,function(){OS(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Xh(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=Sg(i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);wp=f,c.target.dispatchEvent(f),wp=null}else return o=ra(c),o!==null&&DS(o),i.blockedOn=c,!1;o.shift()}return!0}function BS(i,o,c){Xh(i)&&c.delete(o)}function _3(){Cg=!1,Ms!==null&&Xh(Ms)&&(Ms=null),As!==null&&Xh(As)&&(As=null),Ns!==null&&Xh(Ns)&&(Ns=null),gc.forEach(BS),vc.forEach(BS)}function Zh(i,o){i.blockedOn===o&&(i.blockedOn=null,Cg||(Cg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_3)))}var Qh=null;function PS(i){Qh!==i&&(Qh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Qh===i&&(Qh=null);for(var o=0;o<i.length;o+=3){var c=i[o],f=i[o+1],v=i[o+2];if(typeof f!="function"){if(wg(f||c)===null)continue;break}var b=ra(c);b!==null&&(i.splice(o,3),o-=3,Sm(b,{pending:!0,data:v,method:c.method,action:f},f,v))}}))}function Pa(i){function o(q){return Zh(q,i)}Ms!==null&&Zh(Ms,i),As!==null&&Zh(As,i),Ns!==null&&Zh(Ns,i),gc.forEach(o),vc.forEach(o);for(var c=0;c<Ds.length;c++){var f=Ds[c];f.blockedOn===i&&(f.blockedOn=null)}for(;0<Ds.length&&(c=Ds[0],c.blockedOn===null);)jS(c),c.blockedOn===null&&Ds.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var v=c[f],b=c[f+1],E=v[Yn]||null;if(typeof b=="function")E||PS(c);else if(E){var N=null;if(b&&b.hasAttribute("formAction")){if(v=b,E=b[Yn]||null)N=E.formAction;else if(wg(v)!==null)continue}else N=E.action;typeof N=="function"?c[f+1]=N:(c.splice(f,3),f-=3),PS(c)}}}function IS(){function i(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(E){return v=E})},focusReset:"manual",scroll:"manual"})}function o(){v!==null&&(v(),v=null),f||setTimeout(c,20)}function c(){if(!f&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,v=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){f=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),v!==null&&(v(),v=null)}}}function kg(i){this._internalRoot=i}Jh.prototype.render=kg.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,f=pr();AS(c,f,i,o,null,null)},Jh.prototype.unmount=kg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;AS(i.current,2,null,i,null,null),Oh(),o[ta]=null}};function Jh(i){this._internalRoot=i}Jh.prototype.unstable_scheduleHydration=function(i){if(i){var o=Kr();i={blockedOn:null,target:i,priority:o};for(var c=0;c<Ds.length&&o!==0&&o<Ds[c].priority;c++);Ds.splice(c,0,i),c===0&&jS(i)}};var HS=t.version;if(HS!=="19.2.1")throw Error(r(527,HS,"19.2.1"));Y.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(o),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var y3={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ed=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ed.isDisabled&&ed.supportsFiber)try{de=ed.inject(y3),ye=ed}catch{}}return xc.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,f="",v=Kx,b=Gx,E=Yx;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(b=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=TS(i,1,!1,null,null,c,f,null,v,b,E,IS),i[ta]=o.current,og(i),new kg(o)},xc.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var f=!1,v="",b=Kx,E=Gx,N=Yx,q=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(N=c.onRecoverableError),c.formState!==void 0&&(q=c.formState)),o=TS(i,1,!0,o,c??null,f,v,q,b,E,N,IS),o.context=MS(null),c=o.current,f=pr(),f=Ti(f),v=vs(f),v.callback=null,_s(c,v,f),c=f,o.current.lanes=c,wr(o,c),ui(o),i[ta]=o.current,og(i),new Jh(o)},xc.version="19.2.1",xc}var ew;function N3(){if(ew)return Tg.exports;ew=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Tg.exports=A3(),Tg.exports}var D3=N3();/**
|
|
50
|
+
* react-router v7.13.1
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var tw="popstate";function nw(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function O3(e={}){function t(r,s){var h;let a=(h=s.state)==null?void 0:h.masked,{pathname:l,search:u,hash:d}=a||r.location;return Pv("",{pathname:l,search:u,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:ru(s)}return z3(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ti(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function L3(){return Math.random().toString(36).substring(2,10)}function rw(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Pv(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?pl(t):t,state:n,key:t&&t.key||r||L3(),unstable_mask:s}}function ru({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function pl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function z3(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:a=!1}=r,l=s.history,u="POP",d=null,h=p();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function p(){return(l.state||{idx:null}).idx}function m(){u="POP";let C=p(),k=C==null?null:C-h;h=C,d&&d({action:u,location:w.location,delta:k})}function _(C,k){u="PUSH";let T=nw(C)?C:Pv(w.location,C,k);h=p()+1;let R=rw(T,h),M=w.createHref(T.unstable_mask||T);try{l.pushState(R,"",M)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;s.location.assign(M)}a&&d&&d({action:u,location:w.location,delta:1})}function y(C,k){u="REPLACE";let T=nw(C)?C:Pv(w.location,C,k);h=p();let R=rw(T,h),M=w.createHref(T.unstable_mask||T);l.replaceState(R,"",M),a&&d&&d({action:u,location:w.location,delta:0})}function S(C){return j3(C)}let w={get action(){return u},get location(){return e(s,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(tw,m),d=C,()=>{s.removeEventListener(tw,m),d=null}},createHref(C){return t(s,C)},createURL:S,encodeLocation(C){let k=S(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:_,replace:y,go(C){return l.go(C)}};return w}function j3(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Et(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ru(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Wk(e,t,n="/"){return B3(e,t,n,!1)}function B3(e,t,n,r){let s=typeof t=="string"?pl(t):t,a=Ji(s.pathname||"/",n);if(a==null)return null;let l=qk(e);P3(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let h=Y3(a);u=K3(l[d],h,r)}return u}function qk(e,t=[],n=[],r="",s=!1){let a=(l,u,d=s,h)=>{let p={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&d)return;Et(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let m=bi([r,p.relativePath]),_=n.concat(p);l.children&&l.children.length>0&&(Et(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),qk(l.children,t,_,m,d)),!(l.path==null&&!l.index)&&t.push({path:m,score:q3(m,l.index),routesMeta:_})};return e.forEach((l,u)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))a(l,u);else for(let h of Vk(l.path))a(l,u,!0,h)}),t}function Vk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let l=Vk(r.join("/")),u=[];return u.push(...l.map(d=>d===""?a:[a,d].join("/"))),s&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function P3(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:V3(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var I3=/^:[\w-]+$/,H3=3,F3=2,U3=1,$3=10,W3=-2,iw=e=>e==="*";function q3(e,t){let n=e.split("/"),r=n.length;return n.some(iw)&&(r+=W3),t&&(r+=F3),n.filter(s=>!iw(s)).reduce((s,a)=>s+(I3.test(a)?H3:a===""?U3:$3),r)}function V3(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function K3(e,t,n=!1){let{routesMeta:r}=e,s={},a="/",l=[];for(let u=0;u<r.length;++u){let d=r[u],h=u===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",m=Qd({path:d.relativePath,caseSensitive:d.caseSensitive,end:h},p),_=d.route;if(!m&&h&&n&&!r[r.length-1].route.index&&(m=Qd({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!m)return null;Object.assign(s,m.params),l.push({params:s,pathname:bi([a,m.pathname]),pathnameBase:J3(bi([a,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(a=bi([a,m.pathnameBase]))}return l}function Qd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=G3(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],l=a.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((h,{paramName:p,isOptional:m},_)=>{if(p==="*"){let S=u[_]||"";l=a.slice(0,a.length-S.length).replace(/(.)\/+$/,"$1")}const y=u[_];return m&&!y?h[p]=void 0:h[p]=(y||"").replace(/%2F/g,"/"),h},{}),pathname:a,pathnameBase:l,pattern:e}}function G3(e,t=!1,n=!0){ti(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d,h,p)=>{if(r.push({paramName:u,isOptional:d!=null}),d){let m=p.charAt(h+l.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function Y3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ti(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ji(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var X3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Z3(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?pl(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=sw(n.substring(1),"/"):a=sw(n,t)):a=t,{pathname:a,search:e4(r),hash:t4(s)}}function sw(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Dg(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Q3(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function uy(e){let t=Q3(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Of(e,t,n,r=!1){let s;typeof e=="string"?s=pl(e):(s={...e},Et(!s.pathname||!s.pathname.includes("?"),Dg("?","pathname","search",s)),Et(!s.pathname||!s.pathname.includes("#"),Dg("#","pathname","hash",s)),Et(!s.search||!s.search.includes("#"),Dg("#","search","hash",s)));let a=e===""||s.pathname==="",l=a?"/":s.pathname,u;if(l==null)u=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let _=l.split("/");for(;_[0]==="..";)_.shift(),m-=1;s.pathname=_.join("/")}u=m>=0?t[m]:"/"}let d=Z3(s,u),h=l&&l!=="/"&&l.endsWith("/"),p=(a||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||p)&&(d.pathname+="/"),d}var bi=e=>e.join("/").replace(/\/\/+/g,"/"),J3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),e4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,t4=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,n4=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function r4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function i4(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Kk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gk(e,t){let n=e;if(typeof n!="string"||!X3.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(Kk)try{let a=new URL(window.location.href),l=n.startsWith("//")?new URL(a.protocol+n):new URL(n),u=Ji(l.pathname,t);l.origin===a.origin&&u!=null?n=u+l.search+l.hash:s=!0}catch{ti(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Yk=["POST","PUT","PATCH","DELETE"];new Set(Yk);var s4=["GET",...Yk];new Set(s4);var ml=x.createContext(null);ml.displayName="DataRouter";var Lf=x.createContext(null);Lf.displayName="DataRouterState";var o4=x.createContext(!1),Xk=x.createContext({isTransitioning:!1});Xk.displayName="ViewTransition";var a4=x.createContext(new Map);a4.displayName="Fetchers";var l4=x.createContext(null);l4.displayName="Await";var xr=x.createContext(null);xr.displayName="Navigation";var bu=x.createContext(null);bu.displayName="Location";var Wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});Wr.displayName="Route";var hy=x.createContext(null);hy.displayName="RouteError";var Zk="REACT_ROUTER_ERROR",c4="REDIRECT",u4="ROUTE_ERROR_RESPONSE";function h4(e){if(e.startsWith(`${Zk}:${c4}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function d4(e){if(e.startsWith(`${Zk}:${u4}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new n4(t.status,t.statusText,t.data)}catch{}}function f4(e,{relative:t}={}){Et(gl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(xr),{hash:s,pathname:a,search:l}=Su(e,{relative:t}),u=a;return n!=="/"&&(u=a==="/"?n:bi([n,a])),r.createHref({pathname:u,search:l,hash:s})}function gl(){return x.useContext(bu)!=null}function si(){return Et(gl(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(bu).location}var Qk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jk(e){x.useContext(xr).static||x.useLayoutEffect(e)}function xu(){let{isDataRoute:e}=x.useContext(Wr);return e?R4():p4()}function p4(){Et(gl(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(ml),{basename:t,navigator:n}=x.useContext(xr),{matches:r}=x.useContext(Wr),{pathname:s}=si(),a=JSON.stringify(uy(r)),l=x.useRef(!1);return Jk(()=>{l.current=!0}),x.useCallback((d,h={})=>{if(ti(l.current,Qk),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Of(d,JSON.parse(a),s,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:bi([t,p.pathname])),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,a,s,e])}var eE=x.createContext(null);function dy(){return x.useContext(eE)}function m4(e){let t=x.useContext(Wr).outlet;return x.useMemo(()=>t&&x.createElement(eE.Provider,{value:e},t),[t,e])}function tE(){let{matches:e}=x.useContext(Wr),t=e[e.length-1];return t?t.params:{}}function Su(e,{relative:t}={}){let{matches:n}=x.useContext(Wr),{pathname:r}=si(),s=JSON.stringify(uy(n));return x.useMemo(()=>Of(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function g4(e,t){return nE(e,t)}function nE(e,t,n){var C;Et(gl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=x.useContext(xr),{matches:s}=x.useContext(Wr),a=s[s.length-1],l=a?a.params:{},u=a?a.pathname:"/",d=a?a.pathnameBase:"/",h=a&&a.route;{let k=h&&h.path||"";iE(u,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=si(),m;if(t){let k=typeof t=="string"?pl(t):t;Et(d==="/"||((C=k.pathname)==null?void 0:C.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${k.pathname}" was given in the \`location\` prop.`),m=k}else m=p;let _=m.pathname||"/",y=_;if(d!=="/"){let k=d.replace(/^\//,"").split("/");y="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let S=Wk(e,{pathname:y});ti(h||S!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),ti(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=x4(S&&S.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:bi([d,r.encodeLocation?r.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?d:bi([d,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&w?x.createElement(bu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},w):w}function v4(){let e=E4(),t=r4(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:a},"ErrorBoundary")," or"," ",x.createElement("code",{style:a},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:s},n):null,l)}var _4=x.createElement(v4,null),rE=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=d4(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(Wr.Provider,{value:this.props.routeContext},x.createElement(hy.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(y4,{error:e},t):t}};rE.contextType=o4;var Og=new WeakMap;function y4({children:e,error:t}){let{basename:n}=x.useContext(xr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=h4(t.digest);if(r){let s=Og.get(t);if(s)throw s;let a=Gk(r.location,n);if(Kk&&!Og.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw Og.set(t,l),l}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function b4({routeContext:e,match:t,children:n}){let r=x.useContext(ml);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Wr.Provider,{value:e},n)}function x4(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,a=r==null?void 0:r.errors;if(a!=null){let p=s.findIndex(m=>m.route.id&&(a==null?void 0:a[m.route.id])!==void 0);Et(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,p+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let p=0;p<s.length;p++){let m=s[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=p),m.route.id){let{loaderData:_,errors:y}=r,S=m.route.loader&&!_.hasOwnProperty(m.route.id)&&(!y||y[m.route.id]===void 0);if(m.route.lazy||S){n.isStatic&&(l=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let d=n==null?void 0:n.onError,h=r&&d?(p,m)=>{var _,y;d(p,{location:r.location,params:((y=(_=r.matches)==null?void 0:_[0])==null?void 0:y.params)??{},unstable_pattern:i4(r.matches),errorInfo:m})}:void 0;return s.reduceRight((p,m,_)=>{let y,S=!1,w=null,C=null;r&&(y=a&&m.route.id?a[m.route.id]:void 0,w=m.route.errorElement||_4,l&&(u<0&&_===0?(iE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):u===_&&(S=!0,C=m.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,_+1)),T=()=>{let R;return y?R=w:S?R=C:m.route.Component?R=x.createElement(m.route.Component,null):m.route.element?R=m.route.element:R=p,x.createElement(b4,{match:m,routeContext:{outlet:p,matches:k,isDataRoute:r!=null},children:R})};return r&&(m.route.ErrorBoundary||m.route.errorElement||_===0)?x.createElement(rE,{location:r.location,revalidation:r.revalidation,component:w,error:y,children:T(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:h}):T()},null)}function fy(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function S4(e){let t=x.useContext(ml);return Et(t,fy(e)),t}function w4(e){let t=x.useContext(Lf);return Et(t,fy(e)),t}function C4(e){let t=x.useContext(Wr);return Et(t,fy(e)),t}function py(e){let t=C4(e),n=t.matches[t.matches.length-1];return Et(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function k4(){return py("useRouteId")}function E4(){var r;let e=x.useContext(hy),t=w4("useRouteError"),n=py("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function R4(){let{router:e}=S4("useNavigate"),t=py("useNavigate"),n=x.useRef(!1);return Jk(()=>{n.current=!0}),x.useCallback(async(s,a={})=>{ti(n.current,Qk),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...a}))},[e,t])}var ow={};function iE(e,t,n){!t&&!ow[e]&&(ow[e]=!0,ti(!1,n))}x.memo(T4);function T4({routes:e,future:t,state:n,isStatic:r,onError:s}){return nE(e,void 0,{state:n,isStatic:r,onError:s})}function M4({to:e,replace:t,state:n,relative:r}){Et(gl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=x.useContext(xr);ti(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=x.useContext(Wr),{pathname:l}=si(),u=xu(),d=Of(e,uy(a),l,r==="path"),h=JSON.stringify(d);return x.useEffect(()=>{u(JSON.parse(h),{replace:t,state:n,relative:r})},[u,h,r,t,n]),null}function A4(e){return m4(e.context)}function Ka(e){Et(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function N4({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:a=!1,unstable_useTransitions:l}){Et(!gl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:u,navigator:s,static:a,unstable_useTransitions:l,future:{}}),[u,s,a,l]);typeof n=="string"&&(n=pl(n));let{pathname:h="/",search:p="",hash:m="",state:_=null,key:y="default",unstable_mask:S}=n,w=x.useMemo(()=>{let C=Ji(h,u);return C==null?null:{location:{pathname:C,search:p,hash:m,state:_,key:y,unstable_mask:S},navigationType:r}},[u,h,p,m,_,y,r,S]);return ti(w!=null,`<Router basename="${u}"> is not able to match the URL "${h}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(xr.Provider,{value:d},x.createElement(bu.Provider,{children:t,value:w}))}function D4({children:e,location:t}){return g4(Iv(e),t)}function Iv(e,t=[]){let n=[];return x.Children.forEach(e,(r,s)=>{if(!x.isValidElement(r))return;let a=[...t,s];if(r.type===x.Fragment){n.push.apply(n,Iv(r.props.children,a));return}Et(r.type===Ka,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Et(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Iv(r.props.children,a)),n.push(l)}),n}var Dd="get",Od="application/x-www-form-urlencoded";function zf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function O4(e){return zf(e)&&e.tagName.toLowerCase()==="button"}function L4(e){return zf(e)&&e.tagName.toLowerCase()==="form"}function z4(e){return zf(e)&&e.tagName.toLowerCase()==="input"}function j4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function B4(e,t){return e.button===0&&(!t||t==="_self")&&!j4(e)}var td=null;function P4(){if(td===null)try{new FormData(document.createElement("form"),0),td=!1}catch{td=!0}return td}var I4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Lg(e){return e!=null&&!I4.has(e)?(ti(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Od}"`),null):e}function H4(e,t){let n,r,s,a,l;if(L4(e)){let u=e.getAttribute("action");r=u?Ji(u,t):null,n=e.getAttribute("method")||Dd,s=Lg(e.getAttribute("enctype"))||Od,a=new FormData(e)}else if(O4(e)||z4(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||u.getAttribute("action");if(r=d?Ji(d,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Dd,s=Lg(e.getAttribute("formenctype"))||Lg(u.getAttribute("enctype"))||Od,a=new FormData(u,e),!P4()){let{name:h,type:p,value:m}=e;if(p==="image"){let _=h?`${h}.`:"";a.append(`${_}x`,"0"),a.append(`${_}y`,"0")}else h&&a.append(h,m)}}else{if(zf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Dd,r=null,s=Od,l=e}return a&&s==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function my(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function F4(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&Ji(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function U4(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function $4(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function W4(e,t,n){let r=await Promise.all(e.map(async s=>{let a=t.routes[s.route.id];if(a){let l=await U4(a,n);return l.links?l.links():[]}return[]}));return G4(r.flat(1).filter($4).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function aw(e,t,n,r,s,a){let l=(d,h)=>n[h]?d.route.id!==n[h].route.id:!0,u=(d,h)=>{var p;return n[h].pathname!==d.pathname||((p=n[h].route.path)==null?void 0:p.endsWith("*"))&&n[h].params["*"]!==d.params["*"]};return a==="assets"?t.filter((d,h)=>l(d,h)||u(d,h)):a==="data"?t.filter((d,h)=>{var m;let p=r.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(l(d,h)||u(d,h))return!0;if(d.route.shouldRevalidate){let _=d.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function q4(e,t,{includeHydrateFallback:n}={}){return V4(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let a=[s.module];return s.clientActionModule&&(a=a.concat(s.clientActionModule)),s.clientLoaderModule&&(a=a.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(a=a.concat(s.hydrateFallbackModule)),s.imports&&(a=a.concat(s.imports)),a}).flat(1))}function V4(e){return[...new Set(e)]}function K4(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function G4(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let a=JSON.stringify(K4(s));return n.has(a)||(n.add(a),r.push({key:a,link:s})),r},[])}function sE(){let e=x.useContext(ml);return my(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Y4(){let e=x.useContext(Lf);return my(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var gy=x.createContext(void 0);gy.displayName="FrameworkContext";function oE(){let e=x.useContext(gy);return my(e,"You must render this element inside a <HydratedRouter> element"),e}function X4(e,t){let n=x.useContext(gy),[r,s]=x.useState(!1),[a,l]=x.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:h,onMouseLeave:p,onTouchStart:m}=t,_=x.useRef(null);x.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let w=k=>{k.forEach(T=>{l(T.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return _.current&&C.observe(_.current),()=>{C.disconnect()}}},[e]),x.useEffect(()=>{if(r){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[r]);let y=()=>{s(!0)},S=()=>{s(!1),l(!1)};return n?e!=="intent"?[a,_,{}]:[a,_,{onFocus:Sc(u,y),onBlur:Sc(d,S),onMouseEnter:Sc(h,y),onMouseLeave:Sc(p,S),onTouchStart:Sc(m,y)}]:[!1,_,{}]}function Sc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Z4({page:e,...t}){let{router:n}=sE(),r=x.useMemo(()=>Wk(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(J4,{page:e,matches:r,...t}):null}function Q4(e){let{manifest:t,routeModules:n}=oE(),[r,s]=x.useState([]);return x.useEffect(()=>{let a=!1;return W4(e,t,n).then(l=>{a||s(l)}),()=>{a=!0}},[e,t,n]),r}function J4({page:e,matches:t,...n}){let r=si(),{future:s,manifest:a,routeModules:l}=oE(),{basename:u}=sE(),{loaderData:d,matches:h}=Y4(),p=x.useMemo(()=>aw(e,t,h,a,r,"data"),[e,t,h,a,r]),m=x.useMemo(()=>aw(e,t,h,a,r,"assets"),[e,t,h,a,r]),_=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(T=>{var M;let R=a.routes[T.route.id];!R||!R.hasLoader||(!p.some(L=>L.route.id===T.route.id)&&T.route.id in d&&((M=l[T.route.id])!=null&&M.shouldRevalidate)||R.hasClientLoader?C=!0:w.add(T.route.id))}),w.size===0)return[];let k=F4(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return C&&w.size>0&&k.searchParams.set("_routes",t.filter(T=>w.has(T.route.id)).map(T=>T.route.id).join(",")),[k.pathname+k.search]},[u,s.unstable_trailingSlashAwareDataRequests,d,r,a,p,t,e,l]),y=x.useMemo(()=>q4(m,a),[m,a]),S=Q4(m);return x.createElement(x.Fragment,null,_.map(w=>x.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),y.map(w=>x.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:C})=>x.createElement("link",{key:w,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function eO(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var tO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{tO&&(window.__reactRouterVersion="7.13.1")}catch{}function nO({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=x.useRef();s.current==null&&(s.current=O3({window:r,v5Compat:!0}));let a=s.current,[l,u]=x.useState({action:a.action,location:a.location}),d=x.useCallback(h=>{n===!1?u(h):x.startTransition(()=>u(h))},[n]);return x.useLayoutEffect(()=>a.listen(d),[a,d]),x.createElement(N4,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:a,unstable_useTransitions:n})}var aE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lE=x.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:a,replace:l,unstable_mask:u,state:d,target:h,to:p,preventScrollReset:m,viewTransition:_,unstable_defaultShouldRevalidate:y,...S},w){let{basename:C,navigator:k,unstable_useTransitions:T}=x.useContext(xr),R=typeof p=="string"&&aE.test(p),M=Gk(p,C);p=M.to;let L=f4(p,{relative:s}),O=si(),z=null;if(u){let F=Of(u,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);C!=="/"&&(F.pathname=F.pathname==="/"?C:bi([C,F.pathname])),z=k.createHref(F)}let[H,G,B]=X4(r,S),$=oO(p,{replace:l,unstable_mask:u,state:d,target:h,preventScrollReset:m,relative:s,viewTransition:_,unstable_defaultShouldRevalidate:y,unstable_useTransitions:T});function I(F){t&&t(F),F.defaultPrevented||$(F)}let U=!(M.isExternal||a),V=x.createElement("a",{...S,...B,href:(U?z:void 0)||M.absoluteURL||L,onClick:U?I:t,ref:eO(w,G),target:h,"data-discover":!R&&n==="render"?"true":void 0});return H&&!R?x.createElement(x.Fragment,null,V,x.createElement(Z4,{page:L})):V});lE.displayName="Link";var rO=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:a,to:l,viewTransition:u,children:d,...h},p){let m=Su(l,{relative:h.relative}),_=si(),y=x.useContext(Lf),{navigator:S,basename:w}=x.useContext(xr),C=y!=null&&hO(m)&&u===!0,k=S.encodeLocation?S.encodeLocation(m).pathname:m.pathname,T=_.pathname,R=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(T=T.toLowerCase(),R=R?R.toLowerCase():null,k=k.toLowerCase()),R&&w&&(R=Ji(R,w)||R);const M=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let L=T===k||!s&&T.startsWith(k)&&T.charAt(M)==="/",O=R!=null&&(R===k||!s&&R.startsWith(k)&&R.charAt(k.length)==="/"),z={isActive:L,isPending:O,isTransitioning:C},H=L?t:void 0,G;typeof r=="function"?G=r(z):G=[r,L?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let B=typeof a=="function"?a(z):a;return x.createElement(lE,{...h,"aria-current":H,className:G,ref:p,style:B,to:l,viewTransition:u},typeof d=="function"?d(z):d)});rO.displayName="NavLink";var iO=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:a,method:l=Dd,action:u,onSubmit:d,relative:h,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:_,...y},S)=>{let{unstable_useTransitions:w}=x.useContext(xr),C=cO(),k=uO(u,{relative:h}),T=l.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&aE.test(u),M=L=>{if(d&&d(L),L.defaultPrevented)return;L.preventDefault();let O=L.nativeEvent.submitter,z=(O==null?void 0:O.getAttribute("formmethod"))||l,H=()=>C(O||L.currentTarget,{fetcherKey:t,method:z,navigate:n,replace:s,state:a,relative:h,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:_});w&&n!==!1?x.startTransition(()=>H()):H()};return x.createElement("form",{ref:S,method:T,action:k,onSubmit:r?d:M,...y,"data-discover":!R&&e==="render"?"true":void 0})});iO.displayName="Form";function sO(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cE(e){let t=x.useContext(ml);return Et(t,sO(e)),t}function oO(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let p=xu(),m=si(),_=Su(e,{relative:l});return x.useCallback(y=>{if(B4(y,t)){y.preventDefault();let S=n!==void 0?n:ru(m)===ru(_),w=()=>p(e,{replace:S,unstable_mask:r,state:s,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:d});h?x.startTransition(()=>w()):w()}},[m,p,_,n,r,s,t,e,a,l,u,d,h])}var aO=0,lO=()=>`__${String(++aO)}__`;function cO(){let{router:e}=cE("useSubmit"),{basename:t}=x.useContext(xr),n=k4(),r=e.fetch,s=e.navigate;return x.useCallback(async(a,l={})=>{let{action:u,method:d,encType:h,formData:p,body:m}=H4(a,t);if(l.navigate===!1){let _=l.fetcherKey||lO();await r(_,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:m,formMethod:l.method||d,formEncType:l.encType||h,flushSync:l.flushSync})}else await s(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:m,formMethod:l.method||d,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,s,t,n])}function uO(e,{relative:t}={}){let{basename:n}=x.useContext(xr),r=x.useContext(Wr);Et(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),a={...Su(e||".",{relative:t})},l=si();if(e==null){a.search=l.search;let u=new URLSearchParams(a.search),d=u.getAll("index");if(d.some(p=>p==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let p=u.toString();a.search=p?`?${p}`:""}}return(!e||e===".")&&s.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:bi([n,a.pathname])),ru(a)}function hO(e,{relative:t}={}){let n=x.useContext(Xk);Et(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=cE("useViewTransitionState"),s=Su(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ji(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Ji(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Qd(s.pathname,l)!=null||Qd(s.pathname,a)!=null}var qs=$k();const dO=Df(qs);function uE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=uE(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function hE(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=uE(e))&&(r&&(r+=" "),r+=t);return r}const lw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cw=hE,fO=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return cw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(h=>{const p=n==null?void 0:n[h],m=a==null?void 0:a[h];if(p===null)return null;const _=lw(p)||lw(m);return s[h][_]}),u=n&&Object.entries(n).reduce((h,p)=>{let[m,_]=p;return _===void 0||(h[m]=_),h},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:m,className:_,...y}=p;return Object.entries(y).every(S=>{let[w,C]=S;return Array.isArray(C)?C.includes({...a,...u}[w]):{...a,...u}[w]===C})?[...h,m,_]:h},[]);return cw(e,l,d,n==null?void 0:n.class,n==null?void 0:n.className)},pO=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},mO=(e,t)=>({classGroupId:e,validator:t}),dE=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Jd="-",uw=[],gO="arbitrary..",vO=e=>{const t=yO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return _O(l);const u=l.split(Jd),d=u[0]===""&&u.length>1?1:0;return fE(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],h=n[l];return d?h?pO(h,d):d:h||uw}return n[l]||uw}}},fE=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const h=fE(e,t+1,a);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(Jd):e.slice(t).join(Jd),d=l.length;for(let h=0;h<d;h++){const p=l[h];if(p.validator(u))return p.classGroupId}},_O=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?gO+r:void 0})(),yO=e=>{const{theme:t,classGroups:n}=e;return bO(n,t)},bO=(e,t)=>{const n=dE();for(const r in e){const s=e[r];vy(s,n,r,t)}return n},vy=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];xO(l,t,n,r)}},xO=(e,t,n,r)=>{if(typeof e=="string"){SO(e,t,n);return}if(typeof e=="function"){wO(e,t,n,r);return}CO(e,t,n,r)},SO=(e,t,n)=>{const r=e===""?t:pE(t,e);r.classGroupId=n},wO=(e,t,n,r)=>{if(kO(e)){vy(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mO(n,e))},CO=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[u,d]=s[l];vy(d,pE(t,u),n,r)}},pE=(e,t)=>{let n=e;const r=t.split(Jd),s=r.length;for(let a=0;a<s;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=dE(),n.nextPart.set(l,u)),n=u}return n},kO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,EO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return s(a,l),l},set(a,l){a in n?n[a]=l:s(a,l)}}},Hv="!",hw=":",RO=[],dw=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),TO=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let l=0,u=0,d=0,h;const p=s.length;for(let w=0;w<p;w++){const C=s[w];if(l===0&&u===0){if(C===hw){a.push(s.slice(d,w)),d=w+1;continue}if(C==="/"){h=w;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const m=a.length===0?s:s.slice(d);let _=m,y=!1;m.endsWith(Hv)?(_=m.slice(0,-1),y=!0):m.startsWith(Hv)&&(_=m.slice(1),y=!0);const S=h&&h>d?h-d:void 0;return dw(a,y,_,S)};if(t){const s=t+hw,a=r;r=l=>l.startsWith(s)?a(l.slice(s.length)):dw(RO,!1,l,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},MO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const l=n[a],u=l[0]==="[",d=t.has(l);u||d?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},AO=e=>({cache:EO(e.cacheSize),parseClassName:TO(e),sortModifiers:MO(e),...vO(e)}),NO=/\s+/,DO=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,l=[],u=e.trim().split(NO);let d="";for(let h=u.length-1;h>=0;h-=1){const p=u[h],{isExternal:m,modifiers:_,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:w}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let C=!!w,k=r(C?S.substring(0,w):S);if(!k){if(!C){d=p+(d.length>0?" "+d:d);continue}if(k=r(S),!k){d=p+(d.length>0?" "+d:d);continue}C=!1}const T=_.length===0?"":_.length===1?_[0]:a(_).join(":"),R=y?T+Hv:T,M=R+k;if(l.indexOf(M)>-1)continue;l.push(M);const L=s(k,C);for(let O=0;O<L.length;++O){const z=L[O];l.push(R+z)}d=p+(d.length>0?" "+d:d)}return d},OO=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=mE(n))&&(s&&(s+=" "),s+=r);return s},mE=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=mE(e[r]))&&(n&&(n+=" "),n+=t);return n},LO=(e,...t)=>{let n,r,s,a;const l=d=>{const h=t.reduce((p,m)=>m(p),e());return n=AO(h),r=n.cache.get,s=n.cache.set,a=u,u(d)},u=d=>{const h=r(d);if(h)return h;const p=DO(d,n);return s(d,p),p};return a=l,(...d)=>a(OO(...d))},zO=[],tn=e=>{const t=n=>n[e]||zO;return t.isThemeGetter=!0,t},gE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,BO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PO=/\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$/,IO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,HO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ls=e=>jO.test(e),Ve=e=>!!e&&!Number.isNaN(Number(e)),zs=e=>!!e&&Number.isInteger(Number(e)),zg=e=>e.endsWith("%")&&Ve(e.slice(0,-1)),Gi=e=>BO.test(e),_E=()=>!0,UO=e=>PO.test(e)&&!IO.test(e),_y=()=>!1,$O=e=>HO.test(e),WO=e=>FO.test(e),qO=e=>!Ce(e)&&!Ee(e),VO=e=>Js(e,xE,_y),Ce=e=>gE.test(e),wo=e=>Js(e,SE,UO),fw=e=>Js(e,eL,Ve),KO=e=>Js(e,CE,_E),GO=e=>Js(e,wE,_y),pw=e=>Js(e,yE,_y),YO=e=>Js(e,bE,WO),nd=e=>Js(e,kE,$O),Ee=e=>vE.test(e),wc=e=>Vo(e,SE),XO=e=>Vo(e,wE),mw=e=>Vo(e,yE),ZO=e=>Vo(e,xE),QO=e=>Vo(e,bE),rd=e=>Vo(e,kE,!0),JO=e=>Vo(e,CE,!0),Js=(e,t,n)=>{const r=gE.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Vo=(e,t,n=!1)=>{const r=vE.exec(e);return r?r[1]?t(r[1]):n:!1},yE=e=>e==="position"||e==="percentage",bE=e=>e==="image"||e==="url",xE=e=>e==="length"||e==="size"||e==="bg-size",SE=e=>e==="length",eL=e=>e==="number",wE=e=>e==="family-name",CE=e=>e==="number"||e==="weight",kE=e=>e==="shadow",tL=()=>{const e=tn("color"),t=tn("font"),n=tn("text"),r=tn("font-weight"),s=tn("tracking"),a=tn("leading"),l=tn("breakpoint"),u=tn("container"),d=tn("spacing"),h=tn("radius"),p=tn("shadow"),m=tn("inset-shadow"),_=tn("text-shadow"),y=tn("drop-shadow"),S=tn("blur"),w=tn("perspective"),C=tn("aspect"),k=tn("ease"),T=tn("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...M(),Ee,Ce],O=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],H=()=>[Ee,Ce,d],G=()=>[Ls,"full","auto",...H()],B=()=>[zs,"none","subgrid",Ee,Ce],$=()=>["auto",{span:["full",zs,Ee,Ce]},zs,Ee,Ce],I=()=>[zs,"auto",Ee,Ce],U=()=>["auto","min","max","fr",Ee,Ce],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...H()],Y=()=>[Ls,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],W=()=>[Ls,"screen","full","dvw","lvw","svw","min","max","fit",...H()],Q=()=>[Ls,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],A=()=>[e,Ee,Ce],P=()=>[...M(),mw,pw,{position:[Ee,Ce]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",ZO,VO,{size:[Ee,Ce]}],K=()=>[zg,wc,wo],ee=()=>["","none","full",h,Ee,Ce],ie=()=>["",Ve,wc,wo],ge=()=>["solid","dashed","dotted","double"],Te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[Ve,zg,mw,pw],ke=()=>["","none",S,Ee,Ce],We=()=>["none",Ve,Ee,Ce],fe=()=>["none",Ve,Ee,Ce],_e=()=>[Ve,Ee,Ce],He=()=>[Ls,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gi],breakpoint:[Gi],color:[_E],container:[Gi],"drop-shadow":[Gi],ease:["in","out","in-out"],font:[qO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gi],shadow:[Gi],spacing:["px",Ve],text:[Gi],"text-shadow":[Gi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ls,Ce,Ee,C]}],container:["container"],columns:[{columns:[Ve,Ce,Ee,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:L()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{"inset-s":G(),start:G()}],end:[{"inset-e":G(),end:G()}],"inset-bs":[{"inset-bs":G()}],"inset-be":[{"inset-be":G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[zs,"auto",Ee,Ce]}],basis:[{basis:[Ls,"full","auto",u,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,Ls,"auto","initial","none",Ce]}],grow:[{grow:["",Ve,Ee,Ce]}],shrink:[{shrink:["",Ve,Ee,Ce]}],order:[{order:[zs,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pbs:[{pbs:H()}],pbe:[{pbe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[u,"screen",...Y()]}],"min-w":[{"min-w":[u,"screen","none",...Y()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,wc,wo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,JO,KO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zg,Ce]}],"font-family":[{font:[XO,GO,t]}],"font-features":[{"font-features":[Ce]}],"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:[s,Ee,Ce]}],"line-clamp":[{"line-clamp":[Ve,"none",Ee,fw]}],leading:[{leading:[a,...H()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",Ee,wo]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Ve,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],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",Ee,Ce]}],"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:Z()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},zs,Ee,Ce],radial:["",Ee,Ce],conic:[zs,Ee,Ce]},QO,YO]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,Ee,Ce]}],"outline-w":[{outline:["",Ve,wc,wo]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",p,rd,nd]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",m,rd,nd]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Ve,wo]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",_,rd,nd]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Ve,Ee,Ce]}],"mix-blend":[{"mix-blend":[...Te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Te()}],"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":[Ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[Ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:ke()}],brightness:[{brightness:[Ve,Ee,Ce]}],contrast:[{contrast:[Ve,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",y,rd,nd]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Ve,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Ve,Ee,Ce]}],invert:[{invert:["",Ve,Ee,Ce]}],saturate:[{saturate:[Ve,Ee,Ce]}],sepia:[{sepia:["",Ve,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":ke()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ve,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",k,Ee,Ce]}],delay:[{delay:[Ve,Ee,Ce]}],animate:[{animate:["none",T,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ee,Ce]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:We()}],"rotate-x":[{"rotate-x":We()}],"rotate-y":[{"rotate-y":We()}],"rotate-z":[{"rotate-z":We()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:He()}],"translate-x":[{"translate-x":He()}],"translate-y":[{"translate-y":He()}],"translate-z":[{"translate-z":He()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",Ee,Ce]}],"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":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mbs":[{"scroll-mbs":H()}],"scroll-mbe":[{"scroll-mbe":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pbs":[{"scroll-pbs":H()}],"scroll-pbe":[{"scroll-pbe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",Ee,Ce]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Ve,wc,wo,fw]}],stroke:[{stroke:["none",...A()]}],"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"]}},nL=LO(tL);function xe(...e){return nL(hE(e))}function gw(e){return e.startsWith("chatId:")?e.slice(7):e}const yy=fO("touch-manipulation inline-flex items-center justify-center whitespace-nowrap cursor-pointer rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none",{variants:{variant:{default:"bg-primary text-primary-foreground disabled:bg-primary/50 disabled:text-primary-foreground/90 hover:bg-primary/90",juicy:"bg-logo text-primary-foreground disabled:text-primary-foreground/50 hover:bg-logo/90",destructive:"bg-destructive/80 dark:text-white",outline:"border disabled:bg-transparent disabled:text-foreground/50 border-inpu disabled:border-input/90 bg-card hover:bg-muted hover:text-accent-foreground",secondary:"bg-transparent border border-border text-secondary-foreground hover:text-secondary-foreground/60 disabled:text-secondary-foreground/50",ghost:"hover:bg-accent dark:hover:bg-card hover:text-accent-foreground text-muted-foreground disabled:text-muted-foreground/50 border border-border/0 hover:border-border",link:"text-primary disabled:text-primary/50 underline-offset-4 hover:underline",none:""},size:{default:"h-10 px-4 rounded-full py-2",sm:"h-9 rounded-full px-3",lg:"h-11 rounded-full px-8",icon:"h-10 w-10 rounded-lg","icon-sm":"h-5.5 w-5.5 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),nt=x.forwardRef(({className:e,variant:t,size:n,...r},s)=>g.jsx("button",{className:xe(yy({variant:t,size:n,className:e})),ref:s,...r}));nt.displayName="Button";function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function vw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function by(...e){return t=>{let n=!1;const r=e.map(s=>{const a=vw(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():vw(e[s],null)}}}}function Ut(...e){return x.useCallback(by(...e),e)}function rL(e,t){const n=x.createContext(t),r=a=>{const{children:l,...u}=a,d=x.useMemo(()=>u,Object.values(u));return g.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function s(a){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function eo(e,t=[]){let n=[];function r(a,l){const u=x.createContext(l),d=n.length;n=[...n,l];const h=m=>{var k;const{scope:_,children:y,...S}=m,w=((k=_==null?void 0:_[e])==null?void 0:k[d])||u,C=x.useMemo(()=>S,Object.values(S));return g.jsx(w.Provider,{value:C,children:y})};h.displayName=a+"Provider";function p(m,_){var w;const y=((w=_==null?void 0:_[e])==null?void 0:w[d])||u,S=x.useContext(y);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[h,p]}const s=()=>{const a=n.map(l=>x.createContext(l));return function(u){const d=(u==null?void 0:u[e])||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return s.scopeName=e,[r,iL(s,...t)]}function iL(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const l=r.reduce((u,{useScope:d,scopeName:h})=>{const m=d(a)[`__scope${h}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ys=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},sL=Uk[" useId ".trim().toString()]||(()=>{}),oL=0;function el(e){const[t,n]=x.useState(sL());return Ys(()=>{n(r=>r??String(oL++))},[e]),t?`radix-${t}`:""}var aL=Uk[" useInsertionEffect ".trim().toString()]||Ys;function jf({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,l]=lL({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:s;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"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.`),p.current=u},[u,r])}const h=x.useCallback(p=>{var m;if(u){const _=cL(p)?p(e):p;_!==e&&((m=l.current)==null||m.call(l,_))}else a(p)},[u,e,a,l]);return[d,h]}function lL({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),s=x.useRef(n),a=x.useRef(t);return aL(()=>{a.current=t},[t]),x.useEffect(()=>{var l;s.current!==n&&((l=a.current)==null||l.call(a,n),s.current=n)},[n,s]),[n,r,a]}function cL(e){return typeof e=="function"}function al(e){const t=uL(e),n=x.forwardRef((r,s)=>{const{children:a,...l}=r,u=x.Children.toArray(a),d=u.find(dL);if(d){const h=d.props.children,p=u.map(m=>m===d?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:m);return g.jsx(t,{...l,ref:s,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return g.jsx(t,{...l,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function uL(e){const t=x.forwardRef((n,r)=>{const{children:s,...a}=n;if(x.isValidElement(s)){const l=pL(s),u=fL(a,s.props);return s.type!==x.Fragment&&(u.ref=r?by(r,l):l),x.cloneElement(s,u)}return x.Children.count(s)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EE=Symbol("radix.slottable");function hL(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=EE,t}function dL(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EE}function fL(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...u)=>{const d=a(...u);return s(...u),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function pL(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tt=mL.reduce((e,t)=>{const n=al(`Primitive.${t}`),r=x.forwardRef((s,a)=>{const{asChild:l,...u}=s,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function RE(e,t){e&&qs.flushSync(()=>e.dispatchEvent(t))}function wi(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function gL(e,t=globalThis==null?void 0:globalThis.document){const n=wi(e);x.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var vL="DismissableLayer",Fv="dismissableLayer.update",_L="dismissableLayer.pointerDownOutside",yL="dismissableLayer.focusOutside",_w,TE=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wu=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...d}=e,h=x.useContext(TE),[p,m]=x.useState(null),_=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=x.useState({}),S=Ut(t,z=>m(z)),w=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),T=p?w.indexOf(p):-1,R=h.layersWithOutsidePointerEventsDisabled.size>0,M=T>=k,L=SL(z=>{const H=z.target,G=[...h.branches].some(B=>B.contains(H));!M||G||(s==null||s(z),l==null||l(z),z.defaultPrevented||u==null||u())},_),O=wL(z=>{const H=z.target;[...h.branches].some(B=>B.contains(H))||(a==null||a(z),l==null||l(z),z.defaultPrevented||u==null||u())},_);return gL(z=>{T===h.layers.size-1&&(r==null||r(z),!z.defaultPrevented&&u&&(z.preventDefault(),u()))},_),x.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(_w=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),yw(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=_w)}},[p,_,n,h]),x.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),yw())},[p,h]),x.useEffect(()=>{const z=()=>y({});return document.addEventListener(Fv,z),()=>document.removeEventListener(Fv,z)},[]),g.jsx(Tt.div,{...d,ref:S,style:{pointerEvents:R?M?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,O.onFocusCapture),onBlurCapture:je(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,L.onPointerDownCapture)})});wu.displayName=vL;var bL="DismissableLayerBranch",xL=x.forwardRef((e,t)=>{const n=x.useContext(TE),r=x.useRef(null),s=Ut(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),g.jsx(Tt.div,{...e,ref:s})});xL.displayName=bL;function SL(e,t=globalThis==null?void 0:globalThis.document){const n=wi(e),r=x.useRef(!1),s=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){ME(_L,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function wL(e,t=globalThis==null?void 0:globalThis.document){const n=wi(e),r=x.useRef(!1);return x.useEffect(()=>{const s=a=>{a.target&&!r.current&&ME(yL,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yw(){const e=new CustomEvent(Fv);document.dispatchEvent(e)}function ME(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?RE(s,a):s.dispatchEvent(a)}var jg="focusScope.autoFocusOnMount",Bg="focusScope.autoFocusOnUnmount",bw={bubbles:!1,cancelable:!0},CL="FocusScope",Bf=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[u,d]=x.useState(null),h=wi(s),p=wi(a),m=x.useRef(null),_=Ut(t,w=>d(w)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(R){if(y.paused||!u)return;const M=R.target;u.contains(M)?m.current=M:Hs(m.current,{select:!0})},C=function(R){if(y.paused||!u)return;const M=R.relatedTarget;M!==null&&(u.contains(M)||Hs(m.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const L of R)L.removedNodes.length>0&&Hs(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const T=new MutationObserver(k);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),T.disconnect()}}},[r,u,y.paused]),x.useEffect(()=>{if(u){Sw.add(y);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(jg,bw);u.addEventListener(jg,h),u.dispatchEvent(k),k.defaultPrevented||(kL(AL(AE(u)),{select:!0}),document.activeElement===w&&Hs(u))}return()=>{u.removeEventListener(jg,h),setTimeout(()=>{const k=new CustomEvent(Bg,bw);u.addEventListener(Bg,p),u.dispatchEvent(k),k.defaultPrevented||Hs(w??document.body,{select:!0}),u.removeEventListener(Bg,p),Sw.remove(y)},0)}}},[u,h,p,y]);const S=x.useCallback(w=>{if(!n&&!r||y.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(C&&k){const T=w.currentTarget,[R,M]=EL(T);R&&M?!w.shiftKey&&k===M?(w.preventDefault(),n&&Hs(R,{select:!0})):w.shiftKey&&k===R&&(w.preventDefault(),n&&Hs(M,{select:!0})):k===T&&w.preventDefault()}},[n,r,y.paused]);return g.jsx(Tt.div,{tabIndex:-1,...l,ref:_,onKeyDown:S})});Bf.displayName=CL;function kL(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Hs(r,{select:t}),document.activeElement!==n)return}function EL(e){const t=AE(e),n=xw(t,e),r=xw(t.reverse(),e);return[n,r]}function AE(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xw(e,t){for(const n of e)if(!RL(n,{upTo:t}))return n}function RL(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TL(e){return e instanceof HTMLInputElement&&"select"in e}function Hs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TL(e)&&t&&e.select()}}var Sw=ML();function ML(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ww(e,t),e.unshift(t)},remove(t){var n;e=ww(e,t),(n=e[0])==null||n.resume()}}}function ww(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function AL(e){return e.filter(t=>t.tagName!=="A")}var NL="Portal",Cu=x.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,a]=x.useState(!1);Ys(()=>a(!0),[]);const l=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?dO.createPortal(g.jsx(Tt.div,{...r,ref:t}),l):null});Cu.displayName=NL;function DL(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var qr=e=>{const{present:t,children:n}=e,r=OL(t),s=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=Ut(r.ref,LL(s));return typeof n=="function"||r.isPresent?x.cloneElement(s,{ref:a}):null};qr.displayName="Presence";function OL(e){const[t,n]=x.useState(),r=x.useRef(null),s=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[u,d]=DL(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=id(r.current);a.current=u==="mounted"?h:"none"},[u]),Ys(()=>{const h=r.current,p=s.current;if(p!==e){const _=a.current,y=id(h);e?d("MOUNT"):y==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(p&&_!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),Ys(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,m=y=>{const w=id(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(d("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},_=y=>{y.target===t&&(a.current=id(r.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function id(e){return(e==null?void 0:e.animationName)||"none"}function LL(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Pg=0;function xy(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cw()),document.body.insertAdjacentElement("beforeend",e[1]??Cw()),Pg++,()=>{Pg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Pg--}},[])}function Cw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gi=function(){return gi=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},gi.apply(this,arguments)};function NE(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function zL(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ld="right-scroll-bar-position",zd="width-before-scroll-bar",jL="with-scroll-bars-hidden",BL="--removed-body-scroll-bar-size";function Ig(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function PL(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var IL=typeof window<"u"?x.useLayoutEffect:x.useEffect,kw=new WeakMap;function HL(e,t){var n=PL(null,function(r){return e.forEach(function(s){return Ig(s,r)})});return IL(function(){var r=kw.get(n);if(r){var s=new Set(r),a=new Set(e),l=n.current;s.forEach(function(u){a.has(u)||Ig(u,null)}),a.forEach(function(u){s.has(u)||Ig(u,l)})}kw.set(n,e)},[e]),n}function FL(e){return e}function UL(e,t){t===void 0&&(t=FL);var n=[],r=!1,s={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]:e},useMedium:function(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(a),l=n}var d=function(){var p=l;l=[],p.forEach(a)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return s}function $L(e){e===void 0&&(e={});var t=UL(null);return t.options=gi({async:!0,ssr:!1},e),t}var DE=function(e){var t=e.sideCar,n=NE(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,gi({},n))};DE.isSideCarExport=!0;function WL(e,t){return e.useMedium(t),DE}var OE=$L(),Hg=function(){},Pf=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Hg,onWheelCapture:Hg,onTouchMoveCapture:Hg}),s=r[0],a=r[1],l=e.forwardProps,u=e.children,d=e.className,h=e.removeScrollBar,p=e.enabled,m=e.shards,_=e.sideCar,y=e.noRelative,S=e.noIsolation,w=e.inert,C=e.allowPinchZoom,k=e.as,T=k===void 0?"div":k,R=e.gapMode,M=NE(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=_,O=HL([n,t]),z=gi(gi({},M),s);return x.createElement(x.Fragment,null,p&&x.createElement(L,{sideCar:OE,removeScrollBar:h,shards:m,noRelative:y,noIsolation:S,inert:w,setCallbacks:a,allowPinchZoom:!!C,lockRef:n,gapMode:R}),l?x.cloneElement(x.Children.only(u),gi(gi({},z),{ref:O})):x.createElement(T,gi({},z,{className:d,ref:O}),u))});Pf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pf.classNames={fullWidth:zd,zeroRight:Ld};var qL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=qL();return t&&e.setAttribute("nonce",t),e}function KL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function GL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var YL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=VL())&&(KL(t,n),GL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},XL=function(){var e=YL();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},LE=function(){var e=XL(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},ZL={left:0,top:0,right:0,gap:0},Fg=function(e){return parseInt(e||"",10)||0},QL=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Fg(n),Fg(r),Fg(s)]},JL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ZL;var t=QL(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ez=LE(),tl="data-scroll-locked",tz=function(e,t,n,r){var s=e.left,a=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
+
.`.concat(jL,` {
|
|
62
|
+
overflow: hidden `).concat(r,`;
|
|
63
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
64
|
+
}
|
|
65
|
+
body[`).concat(tl,`] {
|
|
66
|
+
overflow: hidden `).concat(r,`;
|
|
67
|
+
overscroll-behavior: contain;
|
|
68
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
69
|
+
padding-left: `.concat(s,`px;
|
|
70
|
+
padding-top: `).concat(a,`px;
|
|
71
|
+
padding-right: `).concat(l,`px;
|
|
72
|
+
margin-left:0;
|
|
73
|
+
margin-top:0;
|
|
74
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
75
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.`).concat(Ld,` {
|
|
79
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(zd,` {
|
|
83
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.`).concat(Ld," .").concat(Ld,` {
|
|
87
|
+
right: 0 `).concat(r,`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.`).concat(zd," .").concat(zd,` {
|
|
91
|
+
margin-right: 0 `).concat(r,`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
body[`).concat(tl,`] {
|
|
95
|
+
`).concat(BL,": ").concat(u,`px;
|
|
96
|
+
}
|
|
97
|
+
`)},Ew=function(){var e=parseInt(document.body.getAttribute(tl)||"0",10);return isFinite(e)?e:0},nz=function(){x.useEffect(function(){return document.body.setAttribute(tl,(Ew()+1).toString()),function(){var e=Ew()-1;e<=0?document.body.removeAttribute(tl):document.body.setAttribute(tl,e.toString())}},[])},rz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;nz();var a=x.useMemo(function(){return JL(s)},[s]);return x.createElement(ez,{styles:tz(a,!t,s,n?"":"!important")})},Uv=!1;if(typeof window<"u")try{var sd=Object.defineProperty({},"passive",{get:function(){return Uv=!0,!0}});window.addEventListener("test",sd,sd),window.removeEventListener("test",sd,sd)}catch{Uv=!1}var Ia=Uv?{passive:!1}:!1,iz=function(e){return e.tagName==="TEXTAREA"},zE=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!iz(e)&&n[t]==="visible")},sz=function(e){return zE(e,"overflowY")},oz=function(e){return zE(e,"overflowX")},Rw=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=jE(e,r);if(s){var a=BE(e,r),l=a[1],u=a[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},az=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},lz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},jE=function(e,t){return e==="v"?sz(t):oz(t)},BE=function(e,t){return e==="v"?az(t):lz(t)},cz=function(e,t){return e==="h"&&t==="rtl"?-1:1},uz=function(e,t,n,r,s){var a=cz(e,window.getComputedStyle(t).direction),l=a*r,u=n.target,d=t.contains(u),h=!1,p=l>0,m=0,_=0;do{if(!u)break;var y=BE(e,u),S=y[0],w=y[1],C=y[2],k=w-C-a*S;(S||k)&&jE(e,u)&&(m+=k,_+=S);var T=u.parentNode;u=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(_)<1)&&(h=!0),h},od=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tw=function(e){return[e.deltaX,e.deltaY]},Mw=function(e){return e&&"current"in e?e.current:e},hz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dz=function(e){return`
|
|
98
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
99
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
100
|
+
`)},fz=0,Ha=[];function pz(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),s=x.useState(fz++)[0],a=x.useState(LE)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=zL([e.lockRef.current],(e.shards||[]).map(Mw),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var k=od(w),T=n.current,R="deltaX"in w?w.deltaX:T[0]-k[0],M="deltaY"in w?w.deltaY:T[1]-k[1],L,O=w.target,z=Math.abs(R)>Math.abs(M)?"h":"v";if("touches"in w&&z==="h"&&O.type==="range")return!1;var H=window.getSelection(),G=H&&H.anchorNode,B=G?G===O||G.contains(O):!1;if(B)return!1;var $=Rw(z,O);if(!$)return!0;if($?L=z:(L=z==="v"?"h":"v",$=Rw(z,O)),!$)return!1;if(!r.current&&"changedTouches"in w&&(R||M)&&(r.current=L),!L)return!0;var I=r.current||L;return uz(I,C,w,I==="h"?R:M)},[]),d=x.useCallback(function(w){var C=w;if(!(!Ha.length||Ha[Ha.length-1]!==a)){var k="deltaY"in C?Tw(C):od(C),T=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&hz(L.delta,k)})[0];if(T&&T.should){C.cancelable&&C.preventDefault();return}if(!T){var R=(l.current.shards||[]).map(Mw).filter(Boolean).filter(function(L){return L.contains(C.target)}),M=R.length>0?u(C,R[0]):!l.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),h=x.useCallback(function(w,C,k,T){var R={name:w,delta:C,target:k,should:T,shadowParent:mz(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(M){return M!==R})},1)},[]),p=x.useCallback(function(w){n.current=od(w),r.current=void 0},[]),m=x.useCallback(function(w){h(w.type,Tw(w),w.target,u(w,e.lockRef.current))},[]),_=x.useCallback(function(w){h(w.type,od(w),w.target,u(w,e.lockRef.current))},[]);x.useEffect(function(){return Ha.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:_}),document.addEventListener("wheel",d,Ia),document.addEventListener("touchmove",d,Ia),document.addEventListener("touchstart",p,Ia),function(){Ha=Ha.filter(function(w){return w!==a}),document.removeEventListener("wheel",d,Ia),document.removeEventListener("touchmove",d,Ia),document.removeEventListener("touchstart",p,Ia)}},[]);var y=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(a,{styles:dz(s)}):null,y?x.createElement(rz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gz=WL(OE,pz);var If=x.forwardRef(function(e,t){return x.createElement(Pf,gi({},e,{ref:t,sideCar:gz}))});If.classNames=Pf.classNames;var vz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fa=new WeakMap,ad=new WeakMap,ld={},Ug=0,PE=function(e){return e&&(e.host||PE(e.parentNode))},_z=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=PE(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},yz=function(e,t,n,r){var s=_z(t,Array.isArray(e)?e:[e]);ld[n]||(ld[n]=new WeakMap);var a=ld[n],l=[],u=new Set,d=new Set(s),h=function(m){!m||u.has(m)||(u.add(m),h(m.parentNode))};s.forEach(h);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(_){if(u.has(_))p(_);else try{var y=_.getAttribute(r),S=y!==null&&y!=="false",w=(Fa.get(_)||0)+1,C=(a.get(_)||0)+1;Fa.set(_,w),a.set(_,C),l.push(_),w===1&&S&&ad.set(_,!0),C===1&&_.setAttribute(n,"true"),S||_.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",_,k)}})};return p(t),u.clear(),Ug++,function(){l.forEach(function(m){var _=Fa.get(m)-1,y=a.get(m)-1;Fa.set(m,_),a.set(m,y),_||(ad.has(m)||m.removeAttribute(r),ad.delete(m)),y||m.removeAttribute(n)}),Ug--,Ug||(Fa=new WeakMap,Fa=new WeakMap,ad=new WeakMap,ld={})}},Sy=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=vz(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),yz(r,s,n,"aria-hidden")):function(){return null}},Hf="Dialog",[IE]=eo(Hf),[bz,oi]=IE(Hf),HE=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,u=x.useRef(null),d=x.useRef(null),[h,p]=jf({prop:r,defaultProp:s??!1,onChange:a,caller:Hf});return g.jsx(bz,{scope:t,triggerRef:u,contentRef:d,contentId:el(),titleId:el(),descriptionId:el(),open:h,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};HE.displayName=Hf;var FE="DialogTrigger",xz=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(FE,n),a=Ut(t,s.triggerRef);return g.jsx(Tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ky(s.open),...r,ref:a,onClick:je(e.onClick,s.onOpenToggle)})});xz.displayName=FE;var wy="DialogPortal",[Sz,UE]=IE(wy,{forceMount:void 0}),$E=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=oi(wy,t);return g.jsx(Sz,{scope:t,forceMount:n,children:x.Children.map(r,l=>g.jsx(qr,{present:n||a.open,children:g.jsx(Cu,{asChild:!0,container:s,children:l})}))})};$E.displayName=wy;var ef="DialogOverlay",WE=x.forwardRef((e,t)=>{const n=UE(ef,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=oi(ef,e.__scopeDialog);return a.modal?g.jsx(qr,{present:r||a.open,children:g.jsx(Cz,{...s,ref:t})}):null});WE.displayName=ef;var wz=al("DialogOverlay.RemoveScroll"),Cz=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(ef,n);return g.jsx(If,{as:wz,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(Tt.div,{"data-state":ky(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Bo="DialogContent",qE=x.forwardRef((e,t)=>{const n=UE(Bo,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=oi(Bo,e.__scopeDialog);return g.jsx(qr,{present:r||a.open,children:a.modal?g.jsx(kz,{...s,ref:t}):g.jsx(Ez,{...s,ref:t})})});qE.displayName=Bo;var kz=x.forwardRef((e,t)=>{const n=oi(Bo,e.__scopeDialog),r=x.useRef(null),s=Ut(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return Sy(a)},[]),g.jsx(VE,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:je(e.onFocusOutside,a=>a.preventDefault())})}),Ez=x.forwardRef((e,t)=>{const n=oi(Bo,e.__scopeDialog),r=x.useRef(!1),s=x.useRef(!1);return g.jsx(VE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),VE=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,u=oi(Bo,n),d=x.useRef(null),h=Ut(t,d);return xy(),g.jsxs(g.Fragment,{children:[g.jsx(Bf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:g.jsx(wu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":ky(u.open),...l,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(Rz,{titleId:u.titleId}),g.jsx(Mz,{contentRef:d,descriptionId:u.descriptionId})]})]})}),Cy="DialogTitle",KE=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(Cy,n);return g.jsx(Tt.h2,{id:s.titleId,...r,ref:t})});KE.displayName=Cy;var GE="DialogDescription",YE=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(GE,n);return g.jsx(Tt.p,{id:s.descriptionId,...r,ref:t})});YE.displayName=GE;var XE="DialogClose",ZE=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(XE,n);return g.jsx(Tt.button,{type:"button",...r,ref:t,onClick:je(e.onClick,()=>s.onOpenChange(!1))})});ZE.displayName=XE;function ky(e){return e?"open":"closed"}var QE="DialogTitleWarning",[hQ,JE]=rL(QE,{contentName:Bo,titleName:Cy,docsSlug:"dialog"}),Rz=({titleId:e})=>{const t=JE(QE),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
101
|
+
|
|
102
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
103
|
+
|
|
104
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Tz="DialogDescriptionWarning",Mz=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${JE(Tz).contentName}}.`;return x.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Az=HE,Nz=$E,eR=WE,tR=qE,Dz=KE,Oz=YE,Lz=ZE;/**
|
|
105
|
+
* @license lucide-react v0.562.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const zz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jz=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Aw=e=>{const t=jz(e);return t.charAt(0).toUpperCase()+t.slice(1)},nR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Bz=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
110
|
+
* @license lucide-react v0.562.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/var Pz={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"};/**
|
|
115
|
+
* @license lucide-react v0.562.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const Iz=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...u},d)=>x.createElement("svg",{ref:d,...Pz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:nR("lucide",s),...!a&&!Bz(u)&&{"aria-hidden":"true"},...u},[...l.map(([h,p])=>x.createElement(h,p)),...Array.isArray(a)?a:[a]]));/**
|
|
120
|
+
* @license lucide-react v0.562.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const Me=(e,t)=>{const n=x.forwardRef(({className:r,...s},a)=>x.createElement(Iz,{ref:a,iconNode:t,className:nR(`lucide-${zz(Aw(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Aw(e),n};/**
|
|
125
|
+
* @license lucide-react v0.562.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const Hz=[["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"}]],Fz=Me("archive",Hz);/**
|
|
130
|
+
* @license lucide-react v0.562.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const Uz=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],$z=Me("arrow-down-to-line",Uz);/**
|
|
135
|
+
* @license lucide-react v0.562.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const Wz=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],qz=Me("arrow-down",Wz);/**
|
|
140
|
+
* @license lucide-react v0.562.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const Vz=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],Kz=Me("arrow-left-right",Vz);/**
|
|
145
|
+
* @license lucide-react v0.562.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const Gz=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Yz=Me("arrow-up",Gz);/**
|
|
150
|
+
* @license lucide-react v0.562.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const Xz=[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]],Zz=Me("asterisk",Xz);/**
|
|
155
|
+
* @license lucide-react v0.562.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const Qz=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]],Jz=Me("book-text",Qz);/**
|
|
160
|
+
* @license lucide-react v0.562.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const ej=[["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"}]],Nw=Me("brain",ej);/**
|
|
165
|
+
* @license lucide-react v0.562.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const tj=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],nj=Me("check-check",tj);/**
|
|
170
|
+
* @license lucide-react v0.562.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const rj=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],ij=Me("check-line",rj);/**
|
|
175
|
+
* @license lucide-react v0.562.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const sj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Po=Me("check",sj);/**
|
|
180
|
+
* @license lucide-react v0.562.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const oj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],aj=Me("chevron-down",oj);/**
|
|
185
|
+
* @license lucide-react v0.562.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const lj=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],cj=Me("chevron-left",lj);/**
|
|
190
|
+
* @license lucide-react v0.562.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const uj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],es=Me("chevron-right",uj);/**
|
|
195
|
+
* @license lucide-react v0.562.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const hj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],dj=Me("circle-slash",hj);/**
|
|
200
|
+
* @license lucide-react v0.562.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const fj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pj=Me("circle",fj);/**
|
|
205
|
+
* @license lucide-react v0.562.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const mj=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Dw=Me("code-xml",mj);/**
|
|
210
|
+
* @license lucide-react v0.562.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const gj=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],rR=Me("code",gj);/**
|
|
215
|
+
* @license lucide-react v0.562.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const vj=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],_j=Me("command",vj);/**
|
|
220
|
+
* @license lucide-react v0.562.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const yj=[["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"}]],Ff=Me("copy",yj);/**
|
|
225
|
+
* @license lucide-react v0.562.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const bj=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],xj=Me("corner-down-left",bj);/**
|
|
230
|
+
* @license lucide-react v0.562.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const Sj=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],wj=Me("eraser",Sj);/**
|
|
235
|
+
* @license lucide-react v0.562.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const Cj=[["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"}]],kj=Me("file-pen",Cj);/**
|
|
240
|
+
* @license lucide-react v0.562.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const Ej=[["path",{d:"M11.35 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.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],Rj=Me("file-plus-corner",Ej);/**
|
|
245
|
+
* @license lucide-react v0.562.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const Tj=[["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"}]],Mj=Me("file",Tj);/**
|
|
250
|
+
* @license lucide-react v0.562.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const Aj=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5",key:"14wa3c"}],["path",{d:"M12 7.5V9",key:"1oy5b0"}],["path",{d:"M7.5 12H9",key:"eltsq1"}],["path",{d:"M16.5 12H15",key:"vk5kw4"}],["path",{d:"M12 16.5V15",key:"k7eayi"}],["path",{d:"m8 8 1.88 1.88",key:"nxy4qf"}],["path",{d:"M14.12 9.88 16 8",key:"1lst6k"}],["path",{d:"m8 16 1.88-1.88",key:"h2eex1"}],["path",{d:"M14.12 14.12 16 16",key:"uqkrx3"}]],Gc=Me("flower",Aj);/**
|
|
255
|
+
* @license lucide-react v0.562.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const Nj=[["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"}]],iR=Me("folder-open",Nj);/**
|
|
260
|
+
* @license lucide-react v0.562.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const Dj=[["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"}]],Oj=Me("folder",Dj);/**
|
|
265
|
+
* @license lucide-react v0.562.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const Lj=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],cd=Me("gauge",Lj);/**
|
|
270
|
+
* @license lucide-react v0.562.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const zj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],jj=Me("info",zj);/**
|
|
275
|
+
* @license lucide-react v0.562.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const Bj=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Pj=Me("list-checks",Bj);/**
|
|
280
|
+
* @license lucide-react v0.562.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const Ij=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],tf=Me("list-todo",Ij);/**
|
|
285
|
+
* @license lucide-react v0.562.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/const Hj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],is=Me("loader-circle",Hj);/**
|
|
290
|
+
* @license lucide-react v0.562.0 - ISC
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the ISC license.
|
|
293
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
+
*/const Fj=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],Ow=Me("lock-open",Fj);/**
|
|
295
|
+
* @license lucide-react v0.562.0 - ISC
|
|
296
|
+
*
|
|
297
|
+
* This source code is licensed under the ISC license.
|
|
298
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
+
*/const Uj=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],Lw=Me("map",Uj);/**
|
|
300
|
+
* @license lucide-react v0.562.0 - ISC
|
|
301
|
+
*
|
|
302
|
+
* This source code is licensed under the ISC license.
|
|
303
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
+
*/const $j=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],sR=Me("menu",$j);/**
|
|
305
|
+
* @license lucide-react v0.562.0 - ISC
|
|
306
|
+
*
|
|
307
|
+
* This source code is licensed under the ISC license.
|
|
308
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
+
*/const Wj=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],oR=Me("message-circle-question-mark",Wj);/**
|
|
310
|
+
* @license lucide-react v0.562.0 - ISC
|
|
311
|
+
*
|
|
312
|
+
* This source code is licensed under the ISC license.
|
|
313
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
+
*/const qj=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],aR=Me("minimize",qj);/**
|
|
315
|
+
* @license lucide-react v0.562.0 - ISC
|
|
316
|
+
*
|
|
317
|
+
* This source code is licensed under the ISC license.
|
|
318
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
+
*/const Vj=[["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"}]],Ey=Me("monitor",Vj);/**
|
|
320
|
+
* @license lucide-react v0.562.0 - ISC
|
|
321
|
+
*
|
|
322
|
+
* This source code is licensed under the ISC license.
|
|
323
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
+
*/const Kj=[["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"}]],Gj=Me("moon",Kj);/**
|
|
325
|
+
* @license lucide-react v0.562.0 - ISC
|
|
326
|
+
*
|
|
327
|
+
* This source code is licensed under the ISC license.
|
|
328
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
+
*/const Yj=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],$v=Me("panel-left",Yj);/**
|
|
330
|
+
* @license lucide-react v0.562.0 - ISC
|
|
331
|
+
*
|
|
332
|
+
* This source code is licensed under the ISC license.
|
|
333
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
+
*/const Xj=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Zj=Me("panel-right",Xj);/**
|
|
335
|
+
* @license lucide-react v0.562.0 - ISC
|
|
336
|
+
*
|
|
337
|
+
* This source code is licensed under the ISC license.
|
|
338
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
+
*/const Qj=[["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"}]],lR=Me("pencil",Qj);/**
|
|
340
|
+
* @license lucide-react v0.562.0 - ISC
|
|
341
|
+
*
|
|
342
|
+
* This source code is licensed under the ISC license.
|
|
343
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
+
*/const Jj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ry=Me("plus",Jj);/**
|
|
345
|
+
* @license lucide-react v0.562.0 - ISC
|
|
346
|
+
*
|
|
347
|
+
* This source code is licensed under the ISC license.
|
|
348
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
+
*/const e6=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$g=Me("search",e6);/**
|
|
350
|
+
* @license lucide-react v0.562.0 - ISC
|
|
351
|
+
*
|
|
352
|
+
* This source code is licensed under the ISC license.
|
|
353
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
+
*/const t6=[["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"}]],n6=Me("send",t6);/**
|
|
355
|
+
* @license lucide-react v0.562.0 - ISC
|
|
356
|
+
*
|
|
357
|
+
* This source code is licensed under the ISC license.
|
|
358
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
+
*/const r6=[["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"}]],i6=Me("settings",r6);/**
|
|
360
|
+
* @license lucide-react v0.562.0 - ISC
|
|
361
|
+
*
|
|
362
|
+
* This source code is licensed under the ISC license.
|
|
363
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
+
*/const s6=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],o6=Me("settings-2",s6);/**
|
|
365
|
+
* @license lucide-react v0.562.0 - ISC
|
|
366
|
+
*
|
|
367
|
+
* This source code is licensed under the ISC license.
|
|
368
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
+
*/const a6=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],l6=Me("slash",a6);/**
|
|
370
|
+
* @license lucide-react v0.562.0 - ISC
|
|
371
|
+
*
|
|
372
|
+
* This source code is licensed under the ISC license.
|
|
373
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
+
*/const c6=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],iu=Me("sparkles",c6);/**
|
|
375
|
+
* @license lucide-react v0.562.0 - ISC
|
|
376
|
+
*
|
|
377
|
+
* This source code is licensed under the ISC license.
|
|
378
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
+
*/const u6=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Ty=Me("square-pen",u6);/**
|
|
380
|
+
* @license lucide-react v0.562.0 - ISC
|
|
381
|
+
*
|
|
382
|
+
* This source code is licensed under the ISC license.
|
|
383
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
+
*/const h6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],d6=Me("square-x",h6);/**
|
|
385
|
+
* @license lucide-react v0.562.0 - ISC
|
|
386
|
+
*
|
|
387
|
+
* This source code is licensed under the ISC license.
|
|
388
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
+
*/const f6=[["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"}]],p6=Me("sun",f6);/**
|
|
390
|
+
* @license lucide-react v0.562.0 - ISC
|
|
391
|
+
*
|
|
392
|
+
* This source code is licensed under the ISC license.
|
|
393
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
+
*/const m6=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],My=Me("terminal",m6);/**
|
|
395
|
+
* @license lucide-react v0.562.0 - ISC
|
|
396
|
+
*
|
|
397
|
+
* This source code is licensed under the ISC license.
|
|
398
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
+
*/const g6=[["rect",{width:"18",height:"12",x:"3",y:"8",rx:"1",key:"158fvp"}],["path",{d:"M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3",key:"s0042v"}],["path",{d:"M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3",key:"9wmeh2"}]],v6=Me("toy-brick",g6);/**
|
|
400
|
+
* @license lucide-react v0.562.0 - ISC
|
|
401
|
+
*
|
|
402
|
+
* This source code is licensed under the ISC license.
|
|
403
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
+
*/const _6=[["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"}]],y6=Me("trash-2",_6);/**
|
|
405
|
+
* @license lucide-react v0.562.0 - ISC
|
|
406
|
+
*
|
|
407
|
+
* This source code is licensed under the ISC license.
|
|
408
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
+
*/const b6=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Ay=Me("user-round",b6);/**
|
|
410
|
+
* @license lucide-react v0.562.0 - ISC
|
|
411
|
+
*
|
|
412
|
+
* This source code is licensed under the ISC license.
|
|
413
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
+
*/const x6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vl=Me("x",x6);/**
|
|
415
|
+
* @license lucide-react v0.562.0 - ISC
|
|
416
|
+
*
|
|
417
|
+
* This source code is licensed under the ISC license.
|
|
418
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
+
*/const S6=[["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"}]],nf=Me("zap",S6),su="data-focus-fallback-ignore",cR="data-allow-focus-retain",rf="kanna:restore-chat-input-focus",Ny="data-chat-input",sf="data-chat-selection-zone";function Lo(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function uR(e){var n;const t=e;return t!=null&&t.matches?t.matches("input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']), textarea, select")||t.isContentEditable||((n=t.getAttribute)==null?void 0:n.call(t,"role"))==="textbox"?!0:Lo(e,cR):!1}function w6(e){const t=e;return t!=null&&t.matches?uR(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:Lo(e,cR):!1}function zw(e){return!!e.querySelector(`[${su}][data-state='open']`)}function C6(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function k6(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${Ny}]`)).filter(l=>!l.disabled);if(n.length===0)return!1;const r=n.indexOf(e),s=r>=0?(r+1)%n.length:0,a=n[s];return a?(a.focus({preventScroll:!0}),!0):!1}function jw(e){const{activeElement:t,fallback:n,hasActiveOverlay:r}=e;if(!n||n.disabled||r||t===n)return"none";if(e.trigger==="escape")return e.defaultPrevented||Lo(t,Ny)||e.canCancel?"none":"escape-focus";const{pointerStartTarget:s,pointerEndTarget:a,root:l,hasActiveSelection:u}=e,d=a??s;return!l||!d||!l.contains(d)||Lo(d,su)||Lo(t,su)||u&&(Lo(s,sf)||Lo(d,sf))||uR(t)?"none":t&&t===d?"restore":w6(t)?"none":"restore"}const hR=Az,E6=Nz,dR=x.forwardRef(({className:e,...t},n)=>g.jsx(eR,{ref:n,className:xe("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));dR.displayName=eR.displayName;const R6={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},Dy=x.forwardRef(({className:e,children:t,size:n="md",...r},s)=>g.jsxs(E6,{children:[g.jsx(dR,{}),g.jsxs(tR,{ref:s,[su]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),window.dispatchEvent(new Event(rf)),(l=r.onCloseAutoFocus)==null||l.call(r,a)},className:xe("fixed left-1/2 top-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-background shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","max-h-[85vh] flex flex-col",R6[n],e),...r,children:[t,g.jsxs(Lz,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[g.jsx(vl,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Dy.displayName=tR.displayName;function fR({className:e,...t}){return g.jsx(Dz,{className:xe("text-lg font-medium leading-none tracking-tight",e),...t})}function T6({className:e,...t}){return g.jsx(Oz,{className:xe("text-sm text-muted-foreground",e),...t})}function pR({className:e,...t}){return g.jsx("div",{className:xe("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function mR({className:e,...t}){return g.jsx("div",{className:xe("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",e),...t})}const gR=x.createContext(null);function M6({children:e}){const[t,n]=x.useState(null),[r,s]=x.useState(""),a=x.useRef(null);x.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(s(t.options.initialValue??""),setTimeout(()=>{var p,m;(p=a.current)==null||p.focus(),(m=a.current)==null||m.select()},0))},[t]);const l=x.useCallback(()=>{n(null),s("")},[]),u=x.useCallback(p=>new Promise(m=>{n({kind:"confirm",options:p,resolve:m})}),[]),d=x.useCallback(p=>new Promise(m=>{n({kind:"prompt",options:p,resolve:m})}),[]),h=x.useMemo(()=>({confirm:u,prompt:d}),[u,d]);return g.jsxs(gR.Provider,{value:h,children:[e,g.jsx(hR,{open:t!==null,onOpenChange:p=>{p||!t||(t.kind==="confirm"?t.resolve(!1):t.resolve(null),l())},children:g.jsx(Dy,{size:"sm",children:t?g.jsxs(g.Fragment,{children:[g.jsxs(pR,{className:"space-y-4",children:[g.jsx(fR,{children:t.options.title}),t.options.description?g.jsx(T6,{children:t.options.description}):null,t.kind==="prompt"?g.jsx("input",{ref:a,type:"text",value:r,onChange:p=>s(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),t.resolve(r.trim()||null),l())},className:"w-full px-3 py-2 text-sm border border-border rounded-md bg-background outline-none",placeholder:t.options.placeholder}):null]}),g.jsxs(mR,{children:[g.jsx(nt,{variant:"ghost",size:"sm",onClick:()=>{t.kind==="confirm"?t.resolve(!1):t.resolve(null),l()},children:t.options.cancelLabel??"Cancel"}),g.jsx(nt,{variant:t.kind==="confirm"?t.options.confirmVariant??"default":"secondary",size:"sm",onClick:()=>{t.kind==="confirm"?t.resolve(!0):t.resolve(r.trim()||null),l()},disabled:t.kind==="prompt"&&!r.trim(),children:t.options.confirmLabel??"Confirm"})]})]}):null})})]})}function A6(){const e=x.useContext(gR);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const N6=["top","right","bottom","left"],Xs=Math.min,_r=Math.max,of=Math.round,ud=Math.floor,xi=e=>({x:e,y:e}),D6={left:"right",right:"left",bottom:"top",top:"bottom"};function Wv(e,t,n){return _r(e,Xs(t,n))}function ts(e,t){return typeof e=="function"?e(t):e}function ns(e){return e.split("-")[0]}function _l(e){return e.split("-")[1]}function Oy(e){return e==="x"?"y":"x"}function Ly(e){return e==="y"?"height":"width"}function vi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zy(e){return Oy(vi(e))}function O6(e,t,n){n===void 0&&(n=!1);const r=_l(e),s=zy(e),a=Ly(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=af(l)),[l,af(l)]}function L6(e){const t=af(e);return[qv(e),t,qv(t)]}function qv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Bw=["left","right"],Pw=["right","left"],z6=["top","bottom"],j6=["bottom","top"];function B6(e,t,n){switch(e){case"top":case"bottom":return n?t?Pw:Bw:t?Bw:Pw;case"left":case"right":return t?z6:j6;default:return[]}}function P6(e,t,n,r){const s=_l(e);let a=B6(ns(e),n==="start",r);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(qv)))),a}function af(e){const t=ns(e);return D6[t]+e.slice(t.length)}function I6(e){return{top:0,right:0,bottom:0,left:0,...e}}function vR(e){return typeof e!="number"?I6(e):{top:e,right:e,bottom:e,left:e}}function lf(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Iw(e,t,n){let{reference:r,floating:s}=e;const a=vi(t),l=zy(t),u=Ly(l),d=ns(t),h=a==="y",p=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,_=r[u]/2-s[u]/2;let y;switch(d){case"top":y={x:p,y:r.y-s.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-s.width,y:m};break;default:y={x:r.x,y:r.y}}switch(_l(t)){case"start":y[l]-=_*(n&&h?-1:1);break;case"end":y[l]+=_*(n&&h?-1:1);break}return y}async function H6(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:l,elements:u,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:_=!1,padding:y=0}=ts(t,e),S=vR(y),C=u[_?m==="floating"?"reference":"floating":m],k=lf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:h,rootBoundary:p,strategy:d})),T=m==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),M=await(a.isElement==null?void 0:a.isElement(R))?await(a.getScale==null?void 0:a.getScale(R))||{x:1,y:1}:{x:1,y:1},L=lf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:T,offsetParent:R,strategy:d}):T);return{top:(k.top-L.top+S.top)/M.y,bottom:(L.bottom-k.bottom+S.bottom)/M.y,left:(k.left-L.left+S.left)/M.x,right:(L.right-k.right+S.right)/M.x}}const F6=50,U6=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:H6},d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=Iw(h,r,d),_=r,y=0;const S={};for(let w=0;w<a.length;w++){const C=a[w];if(!C)continue;const{name:k,fn:T}=C,{x:R,y:M,data:L,reset:O}=await T({x:p,y:m,initialPlacement:r,placement:_,strategy:s,middlewareData:S,rects:h,platform:u,elements:{reference:e,floating:t}});p=R??p,m=M??m,S[k]={...S[k],...L},O&&y<F6&&(y++,typeof O=="object"&&(O.placement&&(_=O.placement),O.rects&&(h=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):O.rects),{x:p,y:m}=Iw(h,_,d)),w=-1)}return{x:p,y:m,placement:_,strategy:s,middlewareData:S}},$6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:l,elements:u,middlewareData:d}=t,{element:h,padding:p=0}=ts(e,t)||{};if(h==null)return{};const m=vR(p),_={x:n,y:r},y=zy(s),S=Ly(y),w=await l.getDimensions(h),C=y==="y",k=C?"top":"left",T=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=a.reference[S]+a.reference[y]-_[y]-a.floating[S],L=_[y]-a.reference[y],O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let z=O?O[R]:0;(!z||!await(l.isElement==null?void 0:l.isElement(O)))&&(z=u.floating[R]||a.floating[S]);const H=M/2-L/2,G=z/2-w[S]/2-1,B=Xs(m[k],G),$=Xs(m[T],G),I=B,U=z-w[S]-$,V=z/2-w[S]/2+H,F=Wv(I,V,U),j=!d.arrow&&_l(s)!=null&&V!==F&&a.reference[S]/2-(V<I?B:$)-w[S]/2<0,Y=j?V<I?V-I:V-U:0;return{[y]:_[y]+Y,data:{[y]:F,centerOffset:V-F-Y,...j&&{alignmentOffset:Y}},reset:j}}}),W6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:l,initialPlacement:u,platform:d,elements:h}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:_,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...C}=ts(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const k=ns(s),T=vi(u),R=ns(u)===u,M=await(d.isRTL==null?void 0:d.isRTL(h.floating)),L=_||(R||!w?[af(u)]:L6(u)),O=S!=="none";!_&&O&&L.push(...P6(u,w,S,M));const z=[u,...L],H=await d.detectOverflow(t,C),G=[];let B=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&G.push(H[k]),m){const V=O6(s,l,M);G.push(H[V[0]],H[V[1]])}if(B=[...B,{placement:s,overflows:G}],!G.every(V=>V<=0)){var $,I;const V=((($=a.flip)==null?void 0:$.index)||0)+1,F=z[V];if(F&&(!(m==="alignment"?T!==vi(F):!1)||B.every(W=>vi(W.placement)===T?W.overflows[0]>0:!0)))return{data:{index:V,overflows:B},reset:{placement:F}};let j=(I=B.filter(Y=>Y.overflows[0]<=0).sort((Y,W)=>Y.overflows[1]-W.overflows[1])[0])==null?void 0:I.placement;if(!j)switch(y){case"bestFit":{var U;const Y=(U=B.filter(W=>{if(O){const Q=vi(W.placement);return Q===T||Q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(Q=>Q>0).reduce((Q,A)=>Q+A,0)]).sort((W,Q)=>W[1]-Q[1])[0])==null?void 0:U[0];Y&&(j=Y);break}case"initialPlacement":j=u;break}if(s!==j)return{reset:{placement:j}}}return{}}}};function Hw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fw(e){return N6.some(t=>e[t]>=0)}const q6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...a}=ts(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),u=Hw(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Fw(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),u=Hw(l,n.floating);return{data:{escapedOffsets:u,escaped:Fw(u)}}}default:return{}}}}},_R=new Set(["left","top"]);async function V6(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=ns(n),u=_l(n),d=vi(n)==="y",h=_R.has(l)?-1:1,p=a&&d?-1:1,m=ts(t,e);let{mainAxis:_,crossAxis:y,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof S=="number"&&(y=u==="end"?S*-1:S),d?{x:y*p,y:_*h}:{x:_*h,y:y*p}}const K6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:l,middlewareData:u}=t,d=await V6(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:l}}}}},G6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:k=>{let{x:T,y:R}=k;return{x:T,y:R}}},...h}=ts(e,t),p={x:n,y:r},m=await a.detectOverflow(t,h),_=vi(ns(s)),y=Oy(_);let S=p[y],w=p[_];if(l){const k=y==="y"?"top":"left",T=y==="y"?"bottom":"right",R=S+m[k],M=S-m[T];S=Wv(R,S,M)}if(u){const k=_==="y"?"top":"left",T=_==="y"?"bottom":"right",R=w+m[k],M=w-m[T];w=Wv(R,w,M)}const C=d.fn({...t,[y]:S,[_]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:l,[_]:u}}}}}},Y6=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:h=!0}=ts(e,t),p={x:n,y:r},m=vi(s),_=Oy(m);let y=p[_],S=p[m];const w=ts(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const R=_==="y"?"height":"width",M=a.reference[_]-a.floating[R]+C.mainAxis,L=a.reference[_]+a.reference[R]-C.mainAxis;y<M?y=M:y>L&&(y=L)}if(h){var k,T;const R=_==="y"?"width":"height",M=_R.has(ns(s)),L=a.reference[m]-a.floating[R]+(M&&((k=l.offset)==null?void 0:k[m])||0)+(M?0:C.crossAxis),O=a.reference[m]+a.reference[R]+(M?0:((T=l.offset)==null?void 0:T[m])||0)-(M?C.crossAxis:0);S<L?S=L:S>O&&(S=O)}return{[_]:y,[m]:S}}}},X6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:l,elements:u}=t,{apply:d=()=>{},...h}=ts(e,t),p=await l.detectOverflow(t,h),m=ns(s),_=_l(s),y=vi(s)==="y",{width:S,height:w}=a.floating;let C,k;m==="top"||m==="bottom"?(C=m,k=_===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(k=m,C=_==="end"?"top":"bottom");const T=w-p.top-p.bottom,R=S-p.left-p.right,M=Xs(w-p[C],T),L=Xs(S-p[k],R),O=!t.middlewareData.shift;let z=M,H=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(H=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(z=T),O&&!_){const B=_r(p.left,0),$=_r(p.right,0),I=_r(p.top,0),U=_r(p.bottom,0);y?H=S-2*(B!==0||$!==0?B+$:_r(p.left,p.right)):z=w-2*(I!==0||U!==0?I+U:_r(p.top,p.bottom))}await d({...t,availableWidth:H,availableHeight:z});const G=await l.getDimensions(u.floating);return S!==G.width||w!==G.height?{reset:{rects:!0}}:{}}}};function Uf(){return typeof window<"u"}function yl(e){return yR(e)?(e.nodeName||"").toLowerCase():"#document"}function yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ei(e){var t;return(t=(yR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yR(e){return Uf()?e instanceof Node||e instanceof yr(e).Node:!1}function ni(e){return Uf()?e instanceof Element||e instanceof yr(e).Element:!1}function ss(e){return Uf()?e instanceof HTMLElement||e instanceof yr(e).HTMLElement:!1}function Uw(e){return!Uf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yr(e).ShadowRoot}function ku(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ri(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function Z6(e){return/^(table|td|th)$/.test(yl(e))}function $f(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Q6=/transform|translate|scale|rotate|perspective|filter/,J6=/paint|layout|strict|content/,Co=e=>!!e&&e!=="none";let Wg;function jy(e){const t=ni(e)?ri(e):e;return Co(t.transform)||Co(t.translate)||Co(t.scale)||Co(t.rotate)||Co(t.perspective)||!By()&&(Co(t.backdropFilter)||Co(t.filter))||Q6.test(t.willChange||"")||J6.test(t.contain||"")}function eB(e){let t=Zs(e);for(;ss(t)&&!ll(t);){if(jy(t))return t;if($f(t))return null;t=Zs(t)}return null}function By(){return Wg==null&&(Wg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Wg}function ll(e){return/^(html|body|#document)$/.test(yl(e))}function ri(e){return yr(e).getComputedStyle(e)}function Wf(e){return ni(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zs(e){if(yl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Uw(e)&&e.host||Ei(e);return Uw(t)?t.host:t}function bR(e){const t=Zs(e);return ll(t)?e.ownerDocument?e.ownerDocument.body:e.body:ss(t)&&ku(t)?t:bR(t)}function ou(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=bR(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),l=yr(s);if(a){const u=Vv(l);return t.concat(l,l.visualViewport||[],ku(s)?s:[],u&&n?ou(u):[])}else return t.concat(s,ou(s,[],n))}function Vv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xR(e){const t=ri(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=ss(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=of(n)!==a||of(r)!==l;return u&&(n=a,r=l),{width:n,height:r,$:u}}function Py(e){return ni(e)?e:e.contextElement}function nl(e){const t=Py(e);if(!ss(t))return xi(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=xR(t);let l=(a?of(n.width):n.width)/r,u=(a?of(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const tB=xi(0);function SR(e){const t=yr(e);return!By()||!t.visualViewport?tB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yr(e)?!1:t}function Io(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Py(e);let l=xi(1);t&&(r?ni(r)&&(l=nl(r)):l=nl(e));const u=nB(a,n,r)?SR(a):xi(0);let d=(s.left+u.x)/l.x,h=(s.top+u.y)/l.y,p=s.width/l.x,m=s.height/l.y;if(a){const _=yr(a),y=r&&ni(r)?yr(r):r;let S=_,w=Vv(S);for(;w&&r&&y!==S;){const C=nl(w),k=w.getBoundingClientRect(),T=ri(w),R=k.left+(w.clientLeft+parseFloat(T.paddingLeft))*C.x,M=k.top+(w.clientTop+parseFloat(T.paddingTop))*C.y;d*=C.x,h*=C.y,p*=C.x,m*=C.y,d+=R,h+=M,S=yr(w),w=Vv(S)}}return lf({width:p,height:m,x:d,y:h})}function qf(e,t){const n=Wf(e).scrollLeft;return t?t.left+n:Io(Ei(e)).left+n}function wR(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-qf(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function rB(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",l=Ei(r),u=t?$f(t.floating):!1;if(r===l||u&&a)return n;let d={scrollLeft:0,scrollTop:0},h=xi(1);const p=xi(0),m=ss(r);if((m||!m&&!a)&&((yl(r)!=="body"||ku(l))&&(d=Wf(r)),m)){const y=Io(r);h=nl(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const _=l&&!m&&!a?wR(l,d):xi(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+p.x+_.x,y:n.y*h.y-d.scrollTop*h.y+p.y+_.y}}function iB(e){return Array.from(e.getClientRects())}function sB(e){const t=Ei(e),n=Wf(e),r=e.ownerDocument.body,s=_r(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=_r(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+qf(e);const u=-n.scrollTop;return ri(r).direction==="rtl"&&(l+=_r(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:l,y:u}}const $w=25;function oB(e,t){const n=yr(e),r=Ei(e),s=n.visualViewport;let a=r.clientWidth,l=r.clientHeight,u=0,d=0;if(s){a=s.width,l=s.height;const p=By();(!p||p&&t==="fixed")&&(u=s.offsetLeft,d=s.offsetTop)}const h=qf(r);if(h<=0){const p=r.ownerDocument,m=p.body,_=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,S=Math.abs(r.clientWidth-m.clientWidth-y);S<=$w&&(a-=S)}else h<=$w&&(a+=h);return{width:a,height:l,x:u,y:d}}function aB(e,t){const n=Io(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=ss(e)?nl(e):xi(1),l=e.clientWidth*a.x,u=e.clientHeight*a.y,d=s*a.x,h=r*a.y;return{width:l,height:u,x:d,y:h}}function Ww(e,t,n){let r;if(t==="viewport")r=oB(e,n);else if(t==="document")r=sB(Ei(e));else if(ni(t))r=aB(t,n);else{const s=SR(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return lf(r)}function CR(e,t){const n=Zs(e);return n===t||!ni(n)||ll(n)?!1:ri(n).position==="fixed"||CR(n,t)}function lB(e,t){const n=t.get(e);if(n)return n;let r=ou(e,[],!1).filter(u=>ni(u)&&yl(u)!=="body"),s=null;const a=ri(e).position==="fixed";let l=a?Zs(e):e;for(;ni(l)&&!ll(l);){const u=ri(l),d=jy(l);!d&&u.position==="fixed"&&(s=null),(a?!d&&!s:!d&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||ku(l)&&!d&&CR(e,l))?r=r.filter(p=>p!==l):s=u,l=Zs(l)}return t.set(e,r),r}function cB(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?$f(t)?[]:lB(t,this._c):[].concat(n),r],u=Ww(t,l[0],s);let d=u.top,h=u.right,p=u.bottom,m=u.left;for(let _=1;_<l.length;_++){const y=Ww(t,l[_],s);d=_r(y.top,d),h=Xs(y.right,h),p=Xs(y.bottom,p),m=_r(y.left,m)}return{width:h-m,height:p-d,x:m,y:d}}function uB(e){const{width:t,height:n}=xR(e);return{width:t,height:n}}function hB(e,t,n){const r=ss(t),s=Ei(t),a=n==="fixed",l=Io(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=xi(0);function h(){d.x=qf(s)}if(r||!r&&!a)if((yl(t)!=="body"||ku(s))&&(u=Wf(t)),r){const y=Io(t,!0,a,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else s&&h();a&&!r&&s&&h();const p=s&&!r&&!a?wR(s,u):xi(0),m=l.left+u.scrollLeft-d.x-p.x,_=l.top+u.scrollTop-d.y-p.y;return{x:m,y:_,width:l.width,height:l.height}}function qg(e){return ri(e).position==="static"}function qw(e,t){if(!ss(e)||ri(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ei(e)===n&&(n=n.ownerDocument.body),n}function kR(e,t){const n=yr(e);if($f(e))return n;if(!ss(e)){let s=Zs(e);for(;s&&!ll(s);){if(ni(s)&&!qg(s))return s;s=Zs(s)}return n}let r=qw(e,t);for(;r&&Z6(r)&&qg(r);)r=qw(r,t);return r&&ll(r)&&qg(r)&&!jy(r)?n:r||eB(e)||n}const dB=async function(e){const t=this.getOffsetParent||kR,n=this.getDimensions,r=await n(e.floating);return{reference:hB(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fB(e){return ri(e).direction==="rtl"}const pB={convertOffsetParentRelativeRectToViewportRelativeRect:rB,getDocumentElement:Ei,getClippingRect:cB,getOffsetParent:kR,getElementRects:dB,getClientRects:iB,getDimensions:uB,getScale:nl,isElement:ni,isRTL:fB};function ER(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mB(e,t){let n=null,r;const s=Ei(e);function a(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),a();const h=e.getBoundingClientRect(),{left:p,top:m,width:_,height:y}=h;if(u||t(),!_||!y)return;const S=ud(m),w=ud(s.clientWidth-(p+_)),C=ud(s.clientHeight-(m+y)),k=ud(p),R={rootMargin:-S+"px "+-w+"px "+-C+"px "+-k+"px",threshold:_r(0,Xs(1,d))||1};let M=!0;function L(O){const z=O[0].intersectionRatio;if(z!==d){if(!M)return l();z?l(!1,z):r=setTimeout(()=>{l(!1,1e-7)},1e3)}z===1&&!ER(h,e.getBoundingClientRect())&&l(),M=!1}try{n=new IntersectionObserver(L,{...R,root:s.ownerDocument})}catch{n=new IntersectionObserver(L,R)}n.observe(e)}return l(!0),a}function gB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=Py(e),p=s||a?[...h?ou(h):[],...t?ou(t):[]]:[];p.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),a&&k.addEventListener("resize",n)});const m=h&&u?mB(h,n):null;let _=-1,y=null;l&&(y=new ResizeObserver(k=>{let[T]=k;T&&T.target===h&&y&&t&&(y.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var R;(R=y)==null||R.observe(t)})),n()}),h&&!d&&y.observe(h),t&&y.observe(t));let S,w=d?Io(e):null;d&&C();function C(){const k=Io(e);w&&!ER(w,k)&&n(),w=k,S=requestAnimationFrame(C)}return n(),()=>{var k;p.forEach(T=>{s&&T.removeEventListener("scroll",n),a&&T.removeEventListener("resize",n)}),m==null||m(),(k=y)==null||k.disconnect(),y=null,d&&cancelAnimationFrame(S)}}const vB=K6,_B=G6,yB=W6,bB=X6,xB=q6,Vw=$6,SB=Y6,wB=(e,t,n)=>{const r=new Map,s={platform:pB,...n},a={...s.platform,_c:r};return U6(e,t,{...s,platform:a})};var CB=typeof document<"u",kB=function(){},jd=CB?x.useLayoutEffect:kB;function cf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cf(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!cf(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function RR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kw(e,t){const n=RR(e);return Math.round(t*n)/n}function Vg(e){const t=x.useRef(e);return jd(()=>{t.current=e}),t}function EB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:d,open:h}=e,[p,m]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,y]=x.useState(r);cf(_,r)||y(r);const[S,w]=x.useState(null),[C,k]=x.useState(null),T=x.useCallback(W=>{W!==O.current&&(O.current=W,w(W))},[]),R=x.useCallback(W=>{W!==z.current&&(z.current=W,k(W))},[]),M=a||S,L=l||C,O=x.useRef(null),z=x.useRef(null),H=x.useRef(p),G=d!=null,B=Vg(d),$=Vg(s),I=Vg(h),U=x.useCallback(()=>{if(!O.current||!z.current)return;const W={placement:t,strategy:n,middleware:_};$.current&&(W.platform=$.current),wB(O.current,z.current,W).then(Q=>{const A={...Q,isPositioned:I.current!==!1};V.current&&!cf(H.current,A)&&(H.current=A,qs.flushSync(()=>{m(A)}))})},[_,t,n,$,I]);jd(()=>{h===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,m(W=>({...W,isPositioned:!1})))},[h]);const V=x.useRef(!1);jd(()=>(V.current=!0,()=>{V.current=!1}),[]),jd(()=>{if(M&&(O.current=M),L&&(z.current=L),M&&L){if(B.current)return B.current(M,L,U);U()}},[M,L,U,B,G]);const F=x.useMemo(()=>({reference:O,floating:z,setReference:T,setFloating:R}),[T,R]),j=x.useMemo(()=>({reference:M,floating:L}),[M,L]),Y=x.useMemo(()=>{const W={position:n,left:0,top:0};if(!j.floating)return W;const Q=Kw(j.floating,p.x),A=Kw(j.floating,p.y);return u?{...W,transform:"translate("+Q+"px, "+A+"px)",...RR(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:A}},[n,u,j.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:U,refs:F,elements:j,floatingStyles:Y}),[p,U,F,j,Y])}const RB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Vw({element:r.current,padding:s}).fn(n):{}:r?Vw({element:r,padding:s}).fn(n):{}}}},TB=(e,t)=>{const n=vB(e);return{name:n.name,fn:n.fn,options:[e,t]}},MB=(e,t)=>{const n=_B(e);return{name:n.name,fn:n.fn,options:[e,t]}},AB=(e,t)=>({fn:SB(e).fn,options:[e,t]}),NB=(e,t)=>{const n=yB(e);return{name:n.name,fn:n.fn,options:[e,t]}},DB=(e,t)=>{const n=bB(e);return{name:n.name,fn:n.fn,options:[e,t]}},OB=(e,t)=>{const n=xB(e);return{name:n.name,fn:n.fn,options:[e,t]}},LB=(e,t)=>{const n=RB(e);return{name:n.name,fn:n.fn,options:[e,t]}};var zB="Arrow",TR=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return g.jsx(Tt.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});TR.displayName=zB;var jB=TR;function BB(e){const[t,n]=x.useState(void 0);return Ys(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,u;if("borderBoxSize"in a){const d=a.borderBoxSize,h=Array.isArray(d)?d[0]:d;l=h.inlineSize,u=h.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Iy="Popper",[MR,bl]=eo(Iy),[PB,AR]=MR(Iy),NR=e=>{const{__scopePopper:t,children:n}=e,[r,s]=x.useState(null);return g.jsx(PB,{scope:t,anchor:r,onAnchorChange:s,children:n})};NR.displayName=Iy;var DR="PopperAnchor",OR=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=AR(DR,n),l=x.useRef(null),u=Ut(t,l),d=x.useRef(null);return x.useEffect(()=>{const h=d.current;d.current=(r==null?void 0:r.current)||l.current,h!==d.current&&a.onAnchorChange(d.current)}),r?null:g.jsx(Tt.div,{...s,ref:u})});OR.displayName=DR;var Hy="PopperContent",[IB,HB]=MR(Hy),LR=x.forwardRef((e,t)=>{var ge,Te,ve,ke,We,fe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:y="optimized",onPlaced:S,...w}=e,C=AR(Hy,n),[k,T]=x.useState(null),R=Ut(t,_e=>T(_e)),[M,L]=x.useState(null),O=BB(M),z=(O==null?void 0:O.width)??0,H=(O==null?void 0:O.height)??0,G=r+(a!=="center"?"-"+a:""),B=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},$=Array.isArray(h)?h:[h],I=$.length>0,U={padding:B,boundary:$.filter(UB),altBoundary:I},{refs:V,floatingStyles:F,placement:j,isPositioned:Y,middlewareData:W}=EB({strategy:"fixed",placement:G,whileElementsMounted:(..._e)=>gB(..._e,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[TB({mainAxis:s+H,alignmentAxis:l}),d&&MB({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?AB():void 0,...U}),d&&NB({...U}),DB({...U,apply:({elements:_e,rects:He,availableWidth:he,availableHeight:et})=>{const{width:gt,height:Wn}=He.reference,Zt=_e.floating.style;Zt.setProperty("--radix-popper-available-width",`${he}px`),Zt.setProperty("--radix-popper-available-height",`${et}px`),Zt.setProperty("--radix-popper-anchor-width",`${gt}px`),Zt.setProperty("--radix-popper-anchor-height",`${Wn}px`)}}),M&&LB({element:M,padding:u}),$B({arrowWidth:z,arrowHeight:H}),_&&OB({strategy:"referenceHidden",...U})]}),[Q,A]=BR(j),P=wi(S);Ys(()=>{Y&&(P==null||P())},[Y,P]);const Z=(ge=W.arrow)==null?void 0:ge.x,D=(Te=W.arrow)==null?void 0:Te.y,K=((ve=W.arrow)==null?void 0:ve.centerOffset)!==0,[ee,ie]=x.useState();return Ys(()=>{k&&ie(window.getComputedStyle(k).zIndex)},[k]),g.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:Y?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(ke=W.transformOrigin)==null?void 0:ke.x,(We=W.transformOrigin)==null?void 0:We.y].join(" "),...((fe=W.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(IB,{scope:n,placedSide:Q,onArrowChange:L,arrowX:Z,arrowY:D,shouldHideArrow:K,children:g.jsx(Tt.div,{"data-side":Q,"data-align":A,...w,ref:R,style:{...w.style,animation:Y?void 0:"none"}})})})});LR.displayName=Hy;var zR="PopperArrow",FB={top:"bottom",right:"left",bottom:"top",left:"right"},jR=x.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=HB(zR,r),l=FB[a.placedSide];return g.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:g.jsx(jB,{...s,ref:n,style:{...s.style,display:"block"}})})});jR.displayName=zR;function UB(e){return e!==null}var $B=e=>({name:"transformOrigin",options:e,fn(t){var C,k,T;const{placement:n,rects:r,middlewareData:s}=t,l=((C=s.arrow)==null?void 0:C.centerOffset)!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[h,p]=BR(n),m={start:"0%",center:"50%",end:"100%"}[p],_=(((k=s.arrow)==null?void 0:k.x)??0)+u/2,y=(((T=s.arrow)==null?void 0:T.y)??0)+d/2;let S="",w="";return h==="bottom"?(S=l?m:`${_}px`,w=`${-d}px`):h==="top"?(S=l?m:`${_}px`,w=`${r.floating.height+d}px`):h==="right"?(S=`${-d}px`,w=l?m:`${y}px`):h==="left"&&(S=`${r.floating.width+d}px`,w=l?m:`${y}px`),{data:{x:S,y:w}}}});function BR(e){const[t,n="center"]=e.split("-");return[t,n]}var Fy=NR,Vf=OR,Uy=LR,$y=jR,WB=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"}),qB="VisuallyHidden",PR=x.forwardRef((e,t)=>g.jsx(Tt.span,{...e,ref:t,style:{...WB,...e.style}}));PR.displayName=qB;var VB=PR,[Kf]=eo("Tooltip",[bl]),Gf=bl(),IR="TooltipProvider",KB=700,Kv="tooltip.open",[GB,Wy]=Kf(IR),HR=e=>{const{__scopeTooltip:t,delayDuration:n=KB,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,l=x.useRef(!0),u=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),g.jsx(GB,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:x.useCallback(h=>{u.current=h},[]),disableHoverableContent:s,children:a})};HR.displayName=IR;var au="Tooltip",[YB,Eu]=Kf(au),FR=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:l,delayDuration:u}=e,d=Wy(au,e.__scopeTooltip),h=Gf(t),[p,m]=x.useState(null),_=el(),y=x.useRef(0),S=l??d.disableHoverableContent,w=u??d.delayDuration,C=x.useRef(!1),[k,T]=jf({prop:r,defaultProp:s??!1,onChange:z=>{z?(d.onOpen(),document.dispatchEvent(new CustomEvent(Kv))):d.onClose(),a==null||a(z)},caller:au}),R=x.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),M=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,T(!0)},[T]),L=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),O=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,T(!0),y.current=0},w)},[w,T]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),g.jsx(Fy,{...h,children:g.jsx(YB,{scope:t,contentId:_,open:k,stateAttribute:R,trigger:p,onTriggerChange:m,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?O():M()},[d.isOpenDelayedRef,O,M]),onTriggerLeave:x.useCallback(()=>{S?L():(window.clearTimeout(y.current),y.current=0)},[L,S]),onOpen:M,onClose:L,disableHoverableContent:S,children:n})})};FR.displayName=au;var Gv="TooltipTrigger",UR=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Eu(Gv,n),a=Wy(Gv,n),l=Gf(n),u=x.useRef(null),d=Ut(t,u,s.onTriggerChange),h=x.useRef(!1),p=x.useRef(!1),m=x.useCallback(()=>h.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),g.jsx(Vf,{asChild:!0,...l,children:g.jsx(Tt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:je(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:je(e.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:je(e.onFocus,()=>{h.current||s.onOpen()}),onBlur:je(e.onBlur,s.onClose),onClick:je(e.onClick,s.onClose)})})});UR.displayName=Gv;var qy="TooltipPortal",[XB,ZB]=Kf(qy,{forceMount:void 0}),$R=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=Eu(qy,t);return g.jsx(XB,{scope:t,forceMount:n,children:g.jsx(qr,{present:n||a.open,children:g.jsx(Cu,{asChild:!0,container:s,children:r})})})};$R.displayName=qy;var cl="TooltipContent",WR=x.forwardRef((e,t)=>{const n=ZB(cl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,l=Eu(cl,e.__scopeTooltip);return g.jsx(qr,{present:r||l.open,children:l.disableHoverableContent?g.jsx(qR,{side:s,...a,ref:t}):g.jsx(QB,{side:s,...a,ref:t})})}),QB=x.forwardRef((e,t)=>{const n=Eu(cl,e.__scopeTooltip),r=Wy(cl,e.__scopeTooltip),s=x.useRef(null),a=Ut(t,s),[l,u]=x.useState(null),{trigger:d,onClose:h}=n,p=s.current,{onPointerInTransitChange:m}=r,_=x.useCallback(()=>{u(null),m(!1)},[m]),y=x.useCallback((S,w)=>{const C=S.currentTarget,k={x:S.clientX,y:S.clientY},T=rP(k,C.getBoundingClientRect()),R=iP(k,T),M=sP(w.getBoundingClientRect()),L=aP([...R,...M]);u(L),m(!0)},[m]);return x.useEffect(()=>()=>_(),[_]),x.useEffect(()=>{if(d&&p){const S=C=>y(C,p),w=C=>y(C,d);return d.addEventListener("pointerleave",S),p.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",w)}}},[d,p,y,_]),x.useEffect(()=>{if(l){const S=w=>{const C=w.target,k={x:w.clientX,y:w.clientY},T=(d==null?void 0:d.contains(C))||(p==null?void 0:p.contains(C)),R=!oP(k,l);T?_():R&&(_(),h())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[d,p,l,h,_]),g.jsx(qR,{...e,ref:a})}),[JB,eP]=Kf(au,{isInside:!1}),tP=hL("TooltipContent"),qR=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=e,d=Eu(cl,n),h=Gf(n),{onClose:p}=d;return x.useEffect(()=>(document.addEventListener(Kv,p),()=>document.removeEventListener(Kv,p)),[p]),x.useEffect(()=>{if(d.trigger){const m=_=>{const y=_.target;y!=null&&y.contains(d.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,p]),g.jsx(wu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:g.jsxs(Uy,{"data-state":d.stateAttribute,...h,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(tP,{children:r}),g.jsx(JB,{scope:n,isInside:!0,children:g.jsx(VB,{id:d.contentId,role:"tooltip",children:s||r})})]})})});WR.displayName=cl;var VR="TooltipArrow",nP=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Gf(n);return eP(VR,n).isInside?null:g.jsx($y,{...s,...r,ref:t})});nP.displayName=VR;function rP(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function iP(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function sP(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function oP(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],d=t[l],h=u.x,p=u.y,m=d.x,_=d.y;p>r!=_>r&&n<(m-h)*(r-p)/(_-p)+h&&(s=!s)}return s}function aP(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),lP(t)}function lP(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],l=t[t.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],l=n[n.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var cP=HR,KR=FR,GR=UR,YR=$R,Vy=WR;const uP="z-50 overflow-hidden rounded-md border border-border bg-card px-2.5 py-1.5 text-[11px] font-medium tracking-[0.14em] text-card-foreground uppercase shadow-sm animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",Gw="font-mono",hP=cP,uf=KR,hf=GR,lu=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(YR,{children:g.jsx(Vy,{ref:r,sideOffset:t,className:xe("z-50 overflow-hidden rounded-md bg-card text-card-foreground border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",e),...n})}));lu.displayName=Vy.displayName;const Ic=KR,Hc=GR;function Yw(e){return e.toUpperCase()}const Ya=x.forwardRef(({className:e,sideOffset:t=4,children:n,shortcut:r,...s},a)=>{const l=r===void 0?null:Array.isArray(r)?r:[r];return g.jsx(YR,{children:g.jsx(Vy,{ref:a,sideOffset:t,className:xe(uP,e),...s,children:l?g.jsx("span",{className:Gw,children:l.map((u,d)=>g.jsxs(x.Fragment,{children:[d>0?g.jsx("span",{className:"px-1.5 text-muted-foreground",children:"/"}):null,g.jsx("span",{children:Yw(u)})]},`${u}-${d}`))}):g.jsx("span",{className:Gw,children:typeof n=="string"?Yw(n):n})})})});Ya.displayName="HotkeyTooltipContent";const dP="0.11.0",fP={version:dP},Pn="Kanna",Xw="kanna",pP=".kanna",mP=".kanna-dev",gP="KANNA_RUNTIME_PROFILE",XR=`kanna/${fP.version}`,vP="[kanna]",_P=`~/${Pn}`;function Yf(){var t;return(t=globalThis.process)==null?void 0:t.env}function yP(e=Yf()){var t;return((t=e==null?void 0:e[gP])==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function bP(e=Yf()){return yP(e)==="dev"?mP:pP}function xP(e=Yf()){return`~/${bP(e)}`}function SP(e=Yf()){return`${xP(e)}/keybindings.json`}function hd(e){return e?`${Xw} ${e}`:Xw}const Xf=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...s})=>g.jsx("span",{style:{"--shiny-width":`${Math.min(n,100)}px`},className:xe("mx-auto max-w-md text-foreground/50",r?["animate-shiny-text [background-size:var(--shiny-width)_100%] bg-clip-text [background-position:0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]","bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80"]:["text-neutral"],t),...s,children:e});function Yv(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const wP=[/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(['"])([\s\S]*)\1$/,/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(.+)$/,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(.+)$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(.+)$/i];function CP(e){const t=e.trim();for(const n of wP){const r=t.match(n);if(!r)continue;const s=(r[2]??r[1]??"").trim();if(s)return s}return t}function ZR(e){return e.split("/").pop()||e}function kP(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,s=60*r,a=24*s,l=7*a;return n<r?"now":n<s?`${Math.floor(n/r)}m`:n<a?`${Math.floor(n/s)}h`:n<l?`${Math.floor(n/a)}d`:`${Math.floor(n/l)}w`}const EP=new Set(["starting","running"]);function RP({chat:e,activeChatId:t,nowMs:n,onSelectChat:r,onDeleteChat:s}){const a=kP(e.lastMessageAt,n);return g.jsxs("div",{"data-chat-id":gw(e.chatId),className:xe("group flex items-center gap-2 pl-2.5 pr-0.5 py-0.5 rounded-lg cursor-pointer border-border/0 hover:border-border hover:bg-muted/20 active:scale-[0.985] border transition-all",t===gw(e.chatId)?"bg-muted hover:bg-muted border-border":"border-border/0 dark:hover:border-slate-400/10 "),onClick:()=>r(e.chatId),children:[EP.has(e.status)?g.jsx(is,{className:"size-3.5 flex-shrink-0 animate-spin text-muted-foreground"}):e.status==="waiting_for_user"?g.jsx("div",{className:"relative ",children:g.jsxs("div",{className:" rounded-full z-0 size-3.5 flex items-center justify-center ",children:[g.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-blue-400/80 animate-ping"}),g.jsx("div",{className:" rounded-full z-0 size-2.5 bg-blue-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):null,g.jsx("span",{className:"text-sm truncate flex-1 translate-y-[-0.5px]",children:e.status!=="idle"&&e.status!=="waiting_for_user"?g.jsx(Xf,{animate:e.status==="running",shimmerWidth:Math.max(20,e.title.length*3),children:e.title}):e.title}),g.jsxs("div",{className:"relative h-7 w-7 mr-[2px] shrink-0",children:[a?g.jsx("span",{className:"hidden md:flex absolute inset-0 items-center justify-end pr-1 text-[11px] text-muted-foreground opacity-50 transition-opacity group-hover:opacity-0",children:a}):null,g.jsx(nt,{variant:"ghost",size:"icon",className:xe("absolute inset-0 h-7 w-7 opacity-100 cursor-pointer rounded-sm hover:!bg-transparent !border-0",a?"md:opacity-0 md:group-hover:opacity-100":"opacity-100 md:opacity-0 md:group-hover:opacity-100"),onClick:l=>{l.stopPropagation(),s(e.chatId)},title:"Delete chat",children:g.jsx(Fz,{className:"size-3.5"})})]})]},e._id)}function TP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Zf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ky(e){return"nodeType"in e}function sr(e){var t,n;return e?xl(e)?e:Ky(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Gy(e){const{Document:t}=sr(e);return e instanceof t}function Ru(e){return xl(e)?!1:e instanceof sr(e).HTMLElement}function QR(e){return e instanceof sr(e).SVGElement}function Sl(e){return e?xl(e)?e.document:Ky(e)?Gy(e)?e:Ru(e)||QR(e)?e.ownerDocument:document:document:document}const Ci=Zf?x.useLayoutEffect:x.useEffect;function Yy(e){const t=x.useRef(e);return Ci(()=>{t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function MP(){const e=x.useRef(null),t=x.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function cu(e,t){t===void 0&&(t=[e]);const n=x.useRef(e);return Ci(()=>{n.current!==e&&(n.current=e)},t),n}function Tu(e,t){const n=x.useRef();return x.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function df(e){const t=Yy(e),n=x.useRef(null),r=x.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Xv(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}let Kg={};function Mu(e,t){return x.useMemo(()=>{if(t)return t;const n=Kg[e]==null?0:Kg[e]+1;return Kg[e]=n,e+"-"+n},[e,t])}function JR(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((a,l)=>{const u=Object.entries(l);for(const[d,h]of u){const p=a[d];p!=null&&(a[d]=p+e*h)}return a},{...t})}}const rl=JR(1),ff=JR(-1);function AP(e){return"clientX"in e&&"clientY"in e}function Xy(e){if(!e)return!1;const{KeyboardEvent:t}=sr(e.target);return t&&e instanceof t}function NP(e){if(!e)return!1;const{TouchEvent:t}=sr(e.target);return t&&e instanceof t}function Zv(e){if(NP(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return AP(e)?{x:e.clientX,y:e.clientY}:null}const uu=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[uu.Translate.toString(e),uu.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Zw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function DP(e){return e.matches(Zw)?e:e.querySelector(Zw)}const OP={display:"none"};function LP(e){let{id:t,value:n}=e;return bt.createElement("div",{id:t,style:OP},n)}function zP(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return bt.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function jP(){const[e,t]=x.useState("");return{announce:x.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const eT=x.createContext(null);function BP(e){const t=x.useContext(eT);x.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function PP(){const[e]=x.useState(()=>new Set),t=x.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[x.useCallback(r=>{let{type:s,event:a}=r;e.forEach(l=>{var u;return(u=l[s])==null?void 0:u.call(l,a)})},[e]),t]}const IP={draggable:`
|
|
420
|
+
To pick up a draggable item, press the space bar.
|
|
421
|
+
While dragging, use the arrow keys to move the item.
|
|
422
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
423
|
+
`},HP={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function FP(e){let{announcements:t=HP,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=IP}=e;const{announce:a,announcement:l}=jP(),u=Mu("DndLiveRegion"),[d,h]=x.useState(!1);if(x.useEffect(()=>{h(!0)},[]),BP(x.useMemo(()=>({onDragStart(m){let{active:_}=m;a(t.onDragStart({active:_}))},onDragMove(m){let{active:_,over:y}=m;t.onDragMove&&a(t.onDragMove({active:_,over:y}))},onDragOver(m){let{active:_,over:y}=m;a(t.onDragOver({active:_,over:y}))},onDragEnd(m){let{active:_,over:y}=m;a(t.onDragEnd({active:_,over:y}))},onDragCancel(m){let{active:_,over:y}=m;a(t.onDragCancel({active:_,over:y}))}}),[a,t])),!d)return null;const p=bt.createElement(bt.Fragment,null,bt.createElement(LP,{id:r,value:s.draggable}),bt.createElement(zP,{id:u,announcement:l}));return n?qs.createPortal(p,n):p}var sn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(sn||(sn={}));function pf(){}function Qw(e,t){return x.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function UP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ii=Object.freeze({x:0,y:0});function $P(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function WP(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function qP(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function VP(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Jw(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const KP=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=Jw(t,t.left,t.top),a=[];for(const l of r){const{id:u}=l,d=n.get(u);if(d){const h=$P(Jw(d),s);a.push({id:u,data:{droppableContainer:l,value:h}})}}return a.sort(WP)};function GP(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=s-r,u=a-n;if(r<s&&n<a){const d=t.width*t.height,h=e.width*e.height,p=l*u,m=p/(d+h-p);return Number(m.toFixed(4))}return 0}const YP=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const a of r){const{id:l}=a,u=n.get(l);if(u){const d=GP(u,t);d>0&&s.push({id:l,data:{droppableContainer:a,value:d}})}}return s.sort(qP)};function XP(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function tT(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ii}function ZP(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return s.reduce((l,u)=>({...l,top:l.top+e*u.y,bottom:l.bottom+e*u.y,left:l.left+e*u.x,right:l.right+e*u.x}),{...n})}}const QP=ZP(1);function JP(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function e8(e,t,n){const r=JP(t);if(!r)return e;const{scaleX:s,scaleY:a,x:l,y:u}=r,d=e.left-l-(1-s)*parseFloat(n),h=e.top-u-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),p=s?e.width/s:e.width,m=a?e.height/a:e.height;return{width:p,height:m,top:h,right:d+p,bottom:h+m,left:d}}const t8={ignoreTransform:!1};function wl(e,t){t===void 0&&(t=t8);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:p}=sr(e).getComputedStyle(e);h&&(n=e8(n,h,p))}const{top:r,left:s,width:a,height:l,bottom:u,right:d}=n;return{top:r,left:s,width:a,height:l,bottom:u,right:d}}function eC(e){return wl(e,{ignoreTransform:!0})}function n8(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function r8(e,t){return t===void 0&&(t=sr(e).getComputedStyle(e)),t.position==="fixed"}function i8(e,t){t===void 0&&(t=sr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const a=t[s];return typeof a=="string"?n.test(a):!1})}function Zy(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Gy(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Ru(s)||QR(s)||n.includes(s))return n;const a=sr(e).getComputedStyle(s);return s!==e&&i8(s,a)&&n.push(s),r8(s,a)?n:r(s.parentNode)}return e?r(e):n}function nT(e){const[t]=Zy(e,1);return t??null}function Gg(e){return!Zf||!e?null:xl(e)?e:Ky(e)?Gy(e)||e===Sl(e).scrollingElement?window:Ru(e)?e:null:null}function rT(e){return xl(e)?e.scrollX:e.scrollLeft}function iT(e){return xl(e)?e.scrollY:e.scrollTop}function Qv(e){return{x:rT(e),y:iT(e)}}var hn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(hn||(hn={}));function sT(e){return!Zf||!e?!1:e===document.scrollingElement}function oT(e){const t={x:0,y:0},n=sT(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:a,isBottom:l,isRight:u,maxScroll:r,minScroll:t}}const s8={x:.2,y:.2};function o8(e,t,n,r,s){let{top:a,left:l,right:u,bottom:d}=n;r===void 0&&(r=10),s===void 0&&(s=s8);const{isTop:h,isBottom:p,isLeft:m,isRight:_}=oT(e),y={x:0,y:0},S={x:0,y:0},w={height:t.height*s.y,width:t.width*s.x};return!h&&a<=t.top+w.height?(y.y=hn.Backward,S.y=r*Math.abs((t.top+w.height-a)/w.height)):!p&&d>=t.bottom-w.height&&(y.y=hn.Forward,S.y=r*Math.abs((t.bottom-w.height-d)/w.height)),!_&&u>=t.right-w.width?(y.x=hn.Forward,S.x=r*Math.abs((t.right-w.width-u)/w.width)):!m&&l<=t.left+w.width&&(y.x=hn.Backward,S.x=r*Math.abs((t.left+w.width-l)/w.width)),{direction:y,speed:S}}function a8(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function aT(e){return e.reduce((t,n)=>rl(t,Qv(n)),ii)}function l8(e){return e.reduce((t,n)=>t+rT(n),0)}function c8(e){return e.reduce((t,n)=>t+iT(n),0)}function u8(e,t){if(t===void 0&&(t=wl),!e)return;const{top:n,left:r,bottom:s,right:a}=t(e);nT(e)&&(s<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const h8=[["x",["left","right"],l8],["y",["top","bottom"],c8]];class Qy{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Zy(n),s=aT(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,u]of h8)for(const d of l)Object.defineProperty(this,d,{get:()=>{const h=u(r),p=s[a]-h;return this.rect[d]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Yc{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function d8(e){const{EventTarget:t}=sr(e);return e instanceof t?e:Sl(e)}function Yg(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ir;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ir||(Ir={}));function tC(e){e.preventDefault()}function f8(e){e.stopPropagation()}var at;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(at||(at={}));const lT={start:[at.Space,at.Enter],cancel:[at.Esc],end:[at.Space,at.Enter,at.Tab]},p8=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case at.Right:return{...n,x:n.x+25};case at.Left:return{...n,x:n.x-25};case at.Down:return{...n,y:n.y+25};case at.Up:return{...n,y:n.y-25}}};class Jy{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Yc(Sl(n)),this.windowListeners=new Yc(sr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ir.Resize,this.handleCancel),this.windowListeners.add(Ir.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ir.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&u8(r),n(ii)}handleKeyDown(t){if(Xy(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:a=lT,coordinateGetter:l=p8,scrollBehavior:u="smooth"}=s,{code:d}=t;if(a.end.includes(d)){this.handleEnd(t);return}if(a.cancel.includes(d)){this.handleCancel(t);return}const{collisionRect:h}=r.current,p=h?{x:h.left,y:h.top}:ii;this.referenceCoordinates||(this.referenceCoordinates=p);const m=l(t,{active:n,context:r.current,currentCoordinates:p});if(m){const _=ff(m,p),y={x:0,y:0},{scrollableAncestors:S}=r.current;for(const w of S){const C=t.code,{isTop:k,isRight:T,isLeft:R,isBottom:M,maxScroll:L,minScroll:O}=oT(w),z=a8(w),H={x:Math.min(C===at.Right?z.right-z.width/2:z.right,Math.max(C===at.Right?z.left:z.left+z.width/2,m.x)),y:Math.min(C===at.Down?z.bottom-z.height/2:z.bottom,Math.max(C===at.Down?z.top:z.top+z.height/2,m.y))},G=C===at.Right&&!T||C===at.Left&&!R,B=C===at.Down&&!M||C===at.Up&&!k;if(G&&H.x!==m.x){const $=w.scrollLeft+_.x,I=C===at.Right&&$<=L.x||C===at.Left&&$>=O.x;if(I&&!_.y){w.scrollTo({left:$,behavior:u});return}I?y.x=w.scrollLeft-$:y.x=C===at.Right?w.scrollLeft-L.x:w.scrollLeft-O.x,y.x&&w.scrollBy({left:-y.x,behavior:u});break}else if(B&&H.y!==m.y){const $=w.scrollTop+_.y,I=C===at.Down&&$<=L.y||C===at.Up&&$>=O.y;if(I&&!_.x){w.scrollTo({top:$,behavior:u});return}I?y.y=w.scrollTop-$:y.y=C===at.Down?w.scrollTop-L.y:w.scrollTop-O.y,y.y&&w.scrollBy({top:-y.y,behavior:u});break}}this.handleMove(t,rl(ff(m,this.referenceCoordinates),y))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Jy.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=lT,onActivation:s}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const u=a.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function nC(e){return!!(e&&"distance"in e)}function rC(e){return!!(e&&"delay"in e)}class eb{constructor(t,n,r){var s;r===void 0&&(r=d8(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:l}=a;this.props=t,this.events=n,this.document=Sl(l),this.documentListeners=new Yc(this.document),this.listeners=new Yc(r),this.windowListeners=new Yc(sr(l)),this.initialCoordinates=(s=Zv(a))!=null?s:ii,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ir.Resize,this.handleCancel),this.windowListeners.add(Ir.DragStart,tC),this.windowListeners.add(Ir.VisibilityChange,this.handleCancel),this.windowListeners.add(Ir.ContextMenu,tC),this.documentListeners.add(Ir.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(rC(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(nC(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ir.Click,f8,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ir.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:a}=this,{onMove:l,options:{activationConstraint:u}}=a;if(!s)return;const d=(n=Zv(t))!=null?n:ii,h=ff(s,d);if(!r&&u){if(nC(u)){if(u.tolerance!=null&&Yg(h,u.tolerance))return this.handleCancel();if(Yg(h,u.distance))return this.handleStart()}if(rC(u)&&Yg(h,u.tolerance))return this.handleCancel();this.handlePending(u,h);return}t.cancelable&&t.preventDefault(),l(d)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===at.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const m8={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tb extends eb{constructor(t){const{event:n}=t,r=Sl(n.target);super(t,m8,r)}}tb.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const g8={move:{name:"mousemove"},end:{name:"mouseup"}};var Jv;(function(e){e[e.RightClick=2]="RightClick"})(Jv||(Jv={}));class v8 extends eb{constructor(t){super(t,g8,Sl(t.event.target))}}v8.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Jv.RightClick?!1:(r==null||r({event:n}),!0)}}];const Xg={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _8 extends eb{constructor(t){super(t,Xg)}static setup(){return window.addEventListener(Xg.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Xg.move.name,t)};function t(){}}}_8.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var Xc;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Xc||(Xc={}));var mf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(mf||(mf={}));function y8(e){let{acceleration:t,activator:n=Xc.Pointer,canScroll:r,draggingRect:s,enabled:a,interval:l=5,order:u=mf.TreeOrder,pointerCoordinates:d,scrollableAncestors:h,scrollableAncestorRects:p,delta:m,threshold:_}=e;const y=x8({delta:m,disabled:!a}),[S,w]=MP(),C=x.useRef({x:0,y:0}),k=x.useRef({x:0,y:0}),T=x.useMemo(()=>{switch(n){case Xc.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Xc.DraggableRect:return s}},[n,s,d]),R=x.useRef(null),M=x.useCallback(()=>{const O=R.current;if(!O)return;const z=C.current.x*k.current.x,H=C.current.y*k.current.y;O.scrollBy(z,H)},[]),L=x.useMemo(()=>u===mf.TreeOrder?[...h].reverse():h,[u,h]);x.useEffect(()=>{if(!a||!h.length||!T){w();return}for(const O of L){if((r==null?void 0:r(O))===!1)continue;const z=h.indexOf(O),H=p[z];if(!H)continue;const{direction:G,speed:B}=o8(O,H,T,t,_);for(const $ of["x","y"])y[$][G[$]]||(B[$]=0,G[$]=0);if(B.x>0||B.y>0){w(),R.current=O,S(M,l),C.current=B,k.current=G;return}}C.current={x:0,y:0},k.current={x:0,y:0},w()},[t,M,r,w,a,l,JSON.stringify(T),JSON.stringify(y),S,h,L,p,JSON.stringify(_)])}const b8={x:{[hn.Backward]:!1,[hn.Forward]:!1},y:{[hn.Backward]:!1,[hn.Forward]:!1}};function x8(e){let{delta:t,disabled:n}=e;const r=Xv(t);return Tu(s=>{if(n||!r||!s)return b8;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[hn.Backward]:s.x[hn.Backward]||a.x===-1,[hn.Forward]:s.x[hn.Forward]||a.x===1},y:{[hn.Backward]:s.y[hn.Backward]||a.y===-1,[hn.Forward]:s.y[hn.Forward]||a.y===1}}},[n,t,r])}function S8(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Tu(s=>{var a;return t==null?null:(a=r??s)!=null?a:null},[r,t])}function w8(e,t){return x.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,a=s.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...a]},[]),[e,t])}var hu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hu||(hu={}));var e_;(function(e){e.Optimized="optimized"})(e_||(e_={}));const iC=new Map;function C8(e,t){let{dragging:n,dependencies:r,config:s}=t;const[a,l]=x.useState(null),{frequency:u,measure:d,strategy:h}=s,p=x.useRef(e),m=C(),_=cu(m),y=x.useCallback(function(k){k===void 0&&(k=[]),!_.current&&l(T=>T===null?k:T.concat(k.filter(R=>!T.includes(R))))},[_]),S=x.useRef(null),w=Tu(k=>{if(m&&!n)return iC;if(!k||k===iC||p.current!==e||a!=null){const T=new Map;for(let R of e){if(!R)continue;if(a&&a.length>0&&!a.includes(R.id)&&R.rect.current){T.set(R.id,R.rect.current);continue}const M=R.node.current,L=M?new Qy(d(M),M):null;R.rect.current=L,L&&T.set(R.id,L)}return T}return k},[e,a,n,m,d]);return x.useEffect(()=>{p.current=e},[e]),x.useEffect(()=>{m||y()},[n,m]),x.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),x.useEffect(()=>{m||typeof u!="number"||S.current!==null||(S.current=setTimeout(()=>{y(),S.current=null},u))},[u,m,y,...r]),{droppableRects:w,measureDroppableContainers:y,measuringScheduled:a!=null};function C(){switch(h){case hu.Always:return!1;case hu.BeforeDragging:return n;default:return!n}}}function cT(e,t){return Tu(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function k8(e,t){return cT(e,t)}function E8(e){let{callback:t,disabled:n}=e;const r=Yy(t),s=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return x.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Qf(e){let{callback:t,disabled:n}=e;const r=Yy(t),s=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return x.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function R8(e){return new Qy(wl(e),e)}function sC(e,t,n){t===void 0&&(t=R8);const[r,s]=x.useState(null);function a(){s(d=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=d??n)!=null?h:null}const p=t(e);return JSON.stringify(d)===JSON.stringify(p)?d:p})}const l=E8({callback(d){if(e)for(const h of d){const{type:p,target:m}=h;if(p==="childList"&&m instanceof HTMLElement&&m.contains(e)){a();break}}}}),u=Qf({callback:a});return Ci(()=>{a(),e?(u==null||u.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),l==null||l.disconnect())},[e]),r}function T8(e){const t=cT(e);return tT(e,t)}const oC=[];function M8(e){const t=x.useRef(e),n=Tu(r=>e?r&&r!==oC&&e&&t.current&&e.parentNode===t.current.parentNode?r:Zy(e):oC,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function A8(e){const[t,n]=x.useState(null),r=x.useRef(e),s=x.useCallback(a=>{const l=Gg(a.target);l&&n(u=>u?(u.set(l,Qv(l)),new Map(u)):null)},[]);return x.useEffect(()=>{const a=r.current;if(e!==a){l(a);const u=e.map(d=>{const h=Gg(d);return h?(h.addEventListener("scroll",s,{passive:!0}),[h,Qv(h)]):null}).filter(d=>d!=null);n(u.length?new Map(u):null),r.current=e}return()=>{l(e),l(a)};function l(u){u.forEach(d=>{const h=Gg(d);h==null||h.removeEventListener("scroll",s)})}},[s,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>rl(a,l),ii):aT(e):ii,[e,t])}function aC(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const r=e!==ii;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ff(e,n.current):ii}function N8(e){x.useEffect(()=>{if(!Zf)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function D8(e,t){return x.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:a}=r;return n[s]=l=>{a(l,t)},n},{}),[e,t])}function uT(e){return x.useMemo(()=>e?n8(e):null,[e])}const lC=[];function O8(e,t){t===void 0&&(t=wl);const[n]=e,r=uT(n?sr(n):null),[s,a]=x.useState(lC);function l(){a(()=>e.length?e.map(d=>sT(d)?r:new Qy(t(d),d)):lC)}const u=Qf({callback:l});return Ci(()=>{u==null||u.disconnect(),l(),e.forEach(d=>u==null?void 0:u.observe(d))},[e]),s}function L8(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ru(t)?t:e}function z8(e){let{measure:t}=e;const[n,r]=x.useState(null),s=x.useCallback(h=>{for(const{target:p}of h)if(Ru(p)){r(m=>{const _=t(p);return m?{...m,width:_.width,height:_.height}:_});break}},[t]),a=Qf({callback:s}),l=x.useCallback(h=>{const p=L8(h);a==null||a.disconnect(),p&&(a==null||a.observe(p)),r(p?t(p):null)},[t,a]),[u,d]=df(l);return x.useMemo(()=>({nodeRef:u,rect:n,setRef:d}),[n,u,d])}const j8=[{sensor:tb,options:{}},{sensor:Jy,options:{}}],B8={current:{}},Bd={draggable:{measure:eC},droppable:{measure:eC,strategy:hu.WhileDragging,frequency:e_.Optimized},dragOverlay:{measure:wl}};class Zc extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const P8={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Zc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:pf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Bd,measureDroppableContainers:pf,windowRect:null,measuringScheduled:!1},I8={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:pf,draggableNodes:new Map,over:null,measureDroppableContainers:pf},Jf=x.createContext(I8),hT=x.createContext(P8);function H8(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Zc}}}function F8(e,t){switch(t.type){case sn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case sn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case sn.DragEnd:case sn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case sn.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Zc(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case sn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new Zc(e.droppable.containers);return l.set(n,{...a,disabled:s}),{...e,droppable:{...e.droppable,containers:l}}}case sn.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new Zc(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function U8(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=x.useContext(Jf),a=Xv(r),l=Xv(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!r&&a&&l!=null){if(!Xy(a)||document.activeElement===a.target)return;const u=s.get(l);if(!u)return;const{activatorNode:d,node:h}=u;if(!d.current&&!h.current)return;requestAnimationFrame(()=>{for(const p of[d.current,h.current]){if(!p)continue;const m=DP(p);if(m){m.focus();break}}})}},[r,t,s,l,a]),null}function $8(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,a)=>a({transform:s,...r}),n):n}function W8(e){return x.useMemo(()=>({draggable:{...Bd.draggable,...e==null?void 0:e.draggable},droppable:{...Bd.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Bd.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function q8(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const a=x.useRef(!1),{x:l,y:u}=typeof s=="boolean"?{x:s,y:s}:s;Ci(()=>{if(!l&&!u||!t){a.current=!1;return}if(a.current||!r)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const p=n(h),m=tT(p,r);if(l||(m.x=0),u||(m.y=0),a.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const _=nT(h);_&&_.scrollBy({top:m.y,left:m.x})}},[t,l,u,r,n])}const dT=x.createContext({...ii,scaleX:1,scaleY:1});var Fs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Fs||(Fs={}));const V8=x.memo(function(t){var n,r,s,a;let{id:l,accessibility:u,autoScroll:d=!0,children:h,sensors:p=j8,collisionDetection:m=YP,measuring:_,modifiers:y,...S}=t;const w=x.useReducer(F8,void 0,H8),[C,k]=w,[T,R]=PP(),[M,L]=x.useState(Fs.Uninitialized),O=M===Fs.Initialized,{draggable:{active:z,nodes:H,translate:G},droppable:{containers:B}}=C,$=z!=null?H.get(z):null,I=x.useRef({initial:null,translated:null}),U=x.useMemo(()=>{var Bt;return z!=null?{id:z,data:(Bt=$==null?void 0:$.data)!=null?Bt:B8,rect:I}:null},[z,$]),V=x.useRef(null),[F,j]=x.useState(null),[Y,W]=x.useState(null),Q=cu(S,Object.values(S)),A=Mu("DndDescribedBy",l),P=x.useMemo(()=>B.getEnabled(),[B]),Z=W8(_),{droppableRects:D,measureDroppableContainers:K,measuringScheduled:ee}=C8(P,{dragging:O,dependencies:[G.x,G.y],config:Z.droppable}),ie=S8(H,z),ge=x.useMemo(()=>Y?Zv(Y):null,[Y]),Te=ea(),ve=k8(ie,Z.draggable.measure);q8({activeNode:z!=null?H.get(z):null,config:Te.layoutShiftCompensation,initialRect:ve,measure:Z.draggable.measure});const ke=sC(ie,Z.draggable.measure,ve),We=sC(ie?ie.parentElement:null),fe=x.useRef({activatorEvent:null,active:null,activeNode:ie,collisionRect:null,collisions:null,droppableRects:D,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_e=B.getNodeFor((n=fe.current.over)==null?void 0:n.id),He=z8({measure:Z.dragOverlay.measure}),he=(r=He.nodeRef.current)!=null?r:ie,et=O?(s=He.rect)!=null?s:ke:null,gt=!!(He.nodeRef.current&&He.rect),Wn=T8(gt?null:ke),Zt=uT(he?sr(he):null),jt=M8(O?_e??ie:null),qn=O8(jt),Sr=$8(y,{transform:{x:G.x-Wn.x,y:G.y-Wn.y,scaleX:1,scaleY:1},activatorEvent:Y,active:U,activeNodeRect:ke,containerNodeRect:We,draggingNodeRect:et,over:fe.current.over,overlayNodeRect:He.rect,scrollableAncestors:jt,scrollableAncestorRects:qn,windowRect:Zt}),cs=ge?rl(ge,G):null,$t=A8(jt),io=aC($t),oe=aC($t,[ke]),pe=rl(Sr,io),Ae=et?QP(et,Sr):null,Pe=U&&Ae?m({active:U,collisionRect:Ae,droppableRects:D,droppableContainers:P,pointerCoordinates:cs}):null,Ze=VP(Pe,"id"),[xt,On]=x.useState(null),de=gt?Sr:rl(Sr,oe),ye=XP(de,(a=xt==null?void 0:xt.rect)!=null?a:null,ke),Oe=x.useRef(null),Ne=x.useCallback((Bt,Pt)=>{let{sensor:an,options:Vn}=Pt;if(V.current==null)return;const Kn=H.get(V.current);if(!Kn)return;const Rn=Bt.nativeEvent,Gn=new an({active:V.current,activeNode:Kn,event:Rn,options:Vn,context:fe,onAbort(Qt){if(!H.get(Qt))return;const{onDragAbort:ar}=Q.current,Cr={id:Qt};ar==null||ar(Cr),T({type:"onDragAbort",event:Cr})},onPending(Qt,Vr,ar,Cr){if(!H.get(Qt))return;const{onDragPending:Mi}=Q.current,Kr={id:Qt,constraint:Vr,initialCoordinates:ar,offset:Cr};Mi==null||Mi(Kr),T({type:"onDragPending",event:Kr})},onStart(Qt){const Vr=V.current;if(Vr==null)return;const ar=H.get(Vr);if(!ar)return;const{onDragStart:Cr}=Q.current,Ti={activatorEvent:Rn,active:{id:Vr,data:ar.data,rect:I}};qs.unstable_batchedUpdates(()=>{Cr==null||Cr(Ti),L(Fs.Initializing),k({type:sn.DragStart,initialCoordinates:Qt,active:Vr}),T({type:"onDragStart",event:Ti}),j(Oe.current),W(Rn)})},onMove(Qt){k({type:sn.DragMove,coordinates:Qt})},onEnd:wr(sn.DragEnd),onCancel:wr(sn.DragCancel)});Oe.current=Gn;function wr(Qt){return async function(){const{active:ar,collisions:Cr,over:Ti,scrollAdjustedTranslate:Mi}=fe.current;let Kr=null;if(ar&&Mi){const{cancelDrop:us}=Q.current;Kr={activatorEvent:Rn,active:ar,collisions:Cr,delta:Mi,over:Ti},Qt===sn.DragEnd&&typeof us=="function"&&await Promise.resolve(us(Kr))&&(Qt=sn.DragCancel)}V.current=null,qs.unstable_batchedUpdates(()=>{k({type:Qt}),L(Fs.Uninitialized),On(null),j(null),W(null),Oe.current=null;const us=Qt===sn.DragEnd?"onDragEnd":"onDragCancel";if(Kr){const kr=Q.current[us];kr==null||kr(Kr),T({type:us,event:Kr})}})}}},[H]),ut=x.useCallback((Bt,Pt)=>(an,Vn)=>{const Kn=an.nativeEvent,Rn=H.get(Vn);if(V.current!==null||!Rn||Kn.dndKit||Kn.defaultPrevented)return;const Gn={active:Rn};Bt(an,Pt.options,Gn)===!0&&(Kn.dndKit={capturedBy:Pt.sensor},V.current=Vn,Ne(an,Pt))},[H,Ne]),Ln=w8(p,ut);N8(p),Ci(()=>{ke&&M===Fs.Initializing&&L(Fs.Initialized)},[ke,M]),x.useEffect(()=>{const{onDragMove:Bt}=Q.current,{active:Pt,activatorEvent:an,collisions:Vn,over:Kn}=fe.current;if(!Pt||!an)return;const Rn={active:Pt,activatorEvent:an,collisions:Vn,delta:{x:pe.x,y:pe.y},over:Kn};qs.unstable_batchedUpdates(()=>{Bt==null||Bt(Rn),T({type:"onDragMove",event:Rn})})},[pe.x,pe.y]),x.useEffect(()=>{const{active:Bt,activatorEvent:Pt,collisions:an,droppableContainers:Vn,scrollAdjustedTranslate:Kn}=fe.current;if(!Bt||V.current==null||!Pt||!Kn)return;const{onDragOver:Rn}=Q.current,Gn=Vn.get(Ze),wr=Gn&&Gn.rect.current?{id:Gn.id,rect:Gn.rect.current,data:Gn.data,disabled:Gn.disabled}:null,Qt={active:Bt,activatorEvent:Pt,collisions:an,delta:{x:Kn.x,y:Kn.y},over:wr};qs.unstable_batchedUpdates(()=>{On(wr),Rn==null||Rn(Qt),T({type:"onDragOver",event:Qt})})},[Ze]),Ci(()=>{fe.current={activatorEvent:Y,active:U,activeNode:ie,collisionRect:Ae,collisions:Pe,droppableRects:D,draggableNodes:H,draggingNode:he,draggingNodeRect:et,droppableContainers:B,over:xt,scrollableAncestors:jt,scrollAdjustedTranslate:pe},I.current={initial:et,translated:Ae}},[U,ie,Pe,Ae,H,he,et,D,B,xt,jt,pe]),y8({...Te,delta:G,draggingRect:Ae,pointerCoordinates:cs,scrollableAncestors:jt,scrollableAncestorRects:qn});const gp=x.useMemo(()=>({active:U,activeNode:ie,activeNodeRect:ke,activatorEvent:Y,collisions:Pe,containerNodeRect:We,dragOverlay:He,draggableNodes:H,droppableContainers:B,droppableRects:D,over:xt,measureDroppableContainers:K,scrollableAncestors:jt,scrollableAncestorRects:qn,measuringConfiguration:Z,measuringScheduled:ee,windowRect:Zt}),[U,ie,ke,Y,Pe,We,He,H,B,D,xt,K,jt,qn,Z,ee,Zt]),Jo=x.useMemo(()=>({activatorEvent:Y,activators:Ln,active:U,activeNodeRect:ke,ariaDescribedById:{draggable:A},dispatch:k,draggableNodes:H,over:xt,measureDroppableContainers:K}),[Y,Ln,U,ke,k,A,H,xt,K]);return bt.createElement(eT.Provider,{value:R},bt.createElement(Jf.Provider,{value:Jo},bt.createElement(hT.Provider,{value:gp},bt.createElement(dT.Provider,{value:ye},h)),bt.createElement(U8,{disabled:(u==null?void 0:u.restoreFocus)===!1})),bt.createElement(FP,{...u,hiddenTextDescribedById:A}));function ea(){const Bt=(F==null?void 0:F.autoScrollEnabled)===!1,Pt=typeof d=="object"?d.enabled===!1:d===!1,an=O&&!Bt&&!Pt;return typeof d=="object"?{...d,enabled:an}:{enabled:an}}}),K8=x.createContext(null),cC="button",G8="Draggable";function Y8(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const a=Mu(G8),{activators:l,activatorEvent:u,active:d,activeNodeRect:h,ariaDescribedById:p,draggableNodes:m,over:_}=x.useContext(Jf),{role:y=cC,roleDescription:S="draggable",tabIndex:w=0}=s??{},C=(d==null?void 0:d.id)===t,k=x.useContext(C?dT:K8),[T,R]=df(),[M,L]=df(),O=D8(l,t),z=cu(n);Ci(()=>(m.set(t,{id:t,key:a,node:T,activatorNode:M,data:z}),()=>{const G=m.get(t);G&&G.key===a&&m.delete(t)}),[m,t]);const H=x.useMemo(()=>({role:y,tabIndex:w,"aria-disabled":r,"aria-pressed":C&&y===cC?!0:void 0,"aria-roledescription":S,"aria-describedby":p.draggable}),[r,y,w,C,S,p.draggable]);return{active:d,activatorEvent:u,activeNodeRect:h,attributes:H,isDragging:C,listeners:r?void 0:O,node:T,over:_,setNodeRef:R,setActivatorNodeRef:L,transform:k}}function X8(){return x.useContext(hT)}const Z8="Droppable",Q8={timeout:25};function J8(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const a=Mu(Z8),{active:l,dispatch:u,over:d,measureDroppableContainers:h}=x.useContext(Jf),p=x.useRef({disabled:n}),m=x.useRef(!1),_=x.useRef(null),y=x.useRef(null),{disabled:S,updateMeasurementsFor:w,timeout:C}={...Q8,...s},k=cu(w??r),T=x.useCallback(()=>{if(!m.current){m.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{h(Array.isArray(k.current)?k.current:[k.current]),y.current=null},C)},[C]),R=Qf({callback:T,disabled:S||!l}),M=x.useCallback((H,G)=>{R&&(G&&(R.unobserve(G),m.current=!1),H&&R.observe(H))},[R]),[L,O]=df(M),z=cu(t);return x.useEffect(()=>{!R||!L.current||(R.disconnect(),m.current=!1,R.observe(L.current))},[L,R]),x.useEffect(()=>(u({type:sn.RegisterDroppable,element:{id:r,key:a,disabled:n,node:L,rect:_,data:z}}),()=>u({type:sn.UnregisterDroppable,key:a,id:r})),[r]),x.useEffect(()=>{n!==p.current.disabled&&(u({type:sn.SetDroppableDisabled,id:r,key:a,disabled:n}),p.current.disabled=n)},[r,a,n,u]),{active:l,rect:_,isOver:(d==null?void 0:d.id)===r,node:L,over:d,setNodeRef:O}}function nb(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function eI(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function dd(e){return e!==null&&e>=0}function tI(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function nI(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const fT=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=nb(t,r,n),l=t[s],u=a[s];return!u||!l?null:{x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height}},fd={scaleX:1,scaleY:1},rI=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:l}=e;const u=(t=a[n])!=null?t:r;if(!u)return null;if(s===n){const h=a[l];return h?{x:0,y:n<l?h.top+h.height-(u.top+u.height):h.top-u.top,...fd}:null}const d=iI(a,s,n);return s>n&&s<=l?{x:0,y:-u.height-d,...fd}:s<n&&s>=l?{x:0,y:u.height+d,...fd}:{x:0,y:0,...fd}};function iI(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const pT="Sortable",mT=bt.createContext({activeIndex:-1,containerId:pT,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:fT,disabled:{draggable:!1,droppable:!1}});function sI(e){let{children:t,id:n,items:r,strategy:s=fT,disabled:a=!1}=e;const{active:l,dragOverlay:u,droppableRects:d,over:h,measureDroppableContainers:p}=X8(),m=Mu(pT,n),_=u.rect!==null,y=x.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),S=l!=null,w=l?y.indexOf(l.id):-1,C=h?y.indexOf(h.id):-1,k=x.useRef(y),T=!tI(y,k.current),R=C!==-1&&w===-1||T,M=nI(a);Ci(()=>{T&&S&&p(y)},[T,y,S,p]),x.useEffect(()=>{k.current=y},[y]);const L=x.useMemo(()=>({activeIndex:w,containerId:m,disabled:M,disableTransforms:R,items:y,overIndex:C,useDragOverlay:_,sortedRects:eI(y,d),strategy:s}),[w,m,M.draggable,M.droppable,R,y,C,d,_,s]);return bt.createElement(mT.Provider,{value:L},t)}const oI=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return nb(n,r,s).indexOf(t)},aI=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:l,previousItems:u,previousContainerId:d,transition:h}=e;return!h||!r||u!==a&&s===l?!1:n?!0:l!==s&&t===d},lI={duration:200,easing:"ease"},gT="transform",cI=uu.Transition.toString({property:gT,duration:0,easing:"linear"}),uI={roleDescription:"sortable"};function hI(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,l]=x.useState(null),u=x.useRef(n);return Ci(()=>{if(!t&&n!==u.current&&r.current){const d=s.current;if(d){const h=wl(r.current,{ignoreTransform:!0}),p={x:d.left-h.left,y:d.top-h.top,scaleX:d.width/h.width,scaleY:d.height/h.height};(p.x||p.y)&&l(p)}}n!==u.current&&(u.current=n)},[t,n,r,s]),x.useEffect(()=>{a&&l(null)},[a]),a}function dI(e){let{animateLayoutChanges:t=aI,attributes:n,disabled:r,data:s,getNewIndex:a=oI,id:l,strategy:u,resizeObserverConfig:d,transition:h=lI}=e;const{items:p,containerId:m,activeIndex:_,disabled:y,disableTransforms:S,sortedRects:w,overIndex:C,useDragOverlay:k,strategy:T}=x.useContext(mT),R=fI(r,y),M=p.indexOf(l),L=x.useMemo(()=>({sortable:{containerId:m,index:M,items:p},...s}),[m,s,M,p]),O=x.useMemo(()=>p.slice(p.indexOf(l)),[p,l]),{rect:z,node:H,isOver:G,setNodeRef:B}=J8({id:l,data:L,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...d}}),{active:$,activatorEvent:I,activeNodeRect:U,attributes:V,setNodeRef:F,listeners:j,isDragging:Y,over:W,setActivatorNodeRef:Q,transform:A}=Y8({id:l,data:L,attributes:{...uI,...n},disabled:R.draggable}),P=TP(B,F),Z=!!$,D=Z&&!S&&dd(_)&&dd(C),K=!k&&Y,ee=K&&D?A:null,ge=D?ee??(u??T)({rects:w,activeNodeRect:U,activeIndex:_,overIndex:C,index:M}):null,Te=dd(_)&&dd(C)?a({id:l,items:p,activeIndex:_,overIndex:C}):M,ve=$==null?void 0:$.id,ke=x.useRef({activeId:ve,items:p,newIndex:Te,containerId:m}),We=p!==ke.current.items,fe=t({active:$,containerId:m,isDragging:Y,isSorting:Z,id:l,index:M,items:p,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:h,wasDragging:ke.current.activeId!=null}),_e=hI({disabled:!fe,index:M,node:H,rect:z});return x.useEffect(()=>{Z&&ke.current.newIndex!==Te&&(ke.current.newIndex=Te),m!==ke.current.containerId&&(ke.current.containerId=m),p!==ke.current.items&&(ke.current.items=p)},[Z,Te,m,p]),x.useEffect(()=>{if(ve===ke.current.activeId)return;if(ve!=null&&ke.current.activeId==null){ke.current.activeId=ve;return}const he=setTimeout(()=>{ke.current.activeId=ve},50);return()=>clearTimeout(he)},[ve]),{active:$,activeIndex:_,attributes:V,data:L,rect:z,index:M,newIndex:Te,items:p,isOver:G,isSorting:Z,isDragging:Y,listeners:j,node:H,overIndex:C,over:W,setNodeRef:P,setActivatorNodeRef:Q,setDroppableNodeRef:B,setDraggableNodeRef:F,transform:_e??ge,transition:He()};function He(){if(_e||We&&ke.current.newIndex===M)return cI;if(!(K&&!Xy(I)||!h)&&(Z||fe))return uu.Transition.toString({...h,property:gT})}}function fI(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}at.Down,at.Right,at.Up,at.Left;function vT(e){const t=e+"CollectionProvider",[n,r]=eo(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:C,children:k}=w,T=bt.useRef(null),R=bt.useRef(new Map).current;return g.jsx(s,{scope:C,itemMap:R,collectionRef:T,children:k})};l.displayName=t;const u=e+"CollectionSlot",d=al(u),h=bt.forwardRef((w,C)=>{const{scope:k,children:T}=w,R=a(u,k),M=Ut(C,R.collectionRef);return g.jsx(d,{ref:M,children:T})});h.displayName=u;const p=e+"CollectionItemSlot",m="data-radix-collection-item",_=al(p),y=bt.forwardRef((w,C)=>{const{scope:k,children:T,...R}=w,M=bt.useRef(null),L=Ut(C,M),O=a(p,k);return bt.useEffect(()=>(O.itemMap.set(M,{ref:M,...R}),()=>void O.itemMap.delete(M))),g.jsx(_,{[m]:"",ref:L,children:T})});y.displayName=p;function S(w){const C=a(e+"CollectionConsumer",w);return bt.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const R=Array.from(T.querySelectorAll(`[${m}]`));return Array.from(C.itemMap.values()).sort((O,z)=>R.indexOf(O.ref.current)-R.indexOf(z.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:h,ItemSlot:y},S,r]}var pI=x.createContext(void 0);function _T(e){const t=x.useContext(pI);return e||t||"ltr"}var Zg="rovingFocusGroup.onEntryFocus",mI={bubbles:!1,cancelable:!0},Au="RovingFocusGroup",[t_,yT,gI]=vT(Au),[vI,bT]=eo(Au,[gI]),[_I,yI]=vI(Au),xT=x.forwardRef((e,t)=>g.jsx(t_.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(t_.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(bI,{...e,ref:t})})}));xT.displayName=Au;var bI=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...m}=e,_=x.useRef(null),y=Ut(t,_),S=_T(a),[w,C]=jf({prop:l,defaultProp:u??null,onChange:d,caller:Au}),[k,T]=x.useState(!1),R=wi(h),M=yT(n),L=x.useRef(!1),[O,z]=x.useState(0);return x.useEffect(()=>{const H=_.current;if(H)return H.addEventListener(Zg,R),()=>H.removeEventListener(Zg,R)},[R]),g.jsx(_I,{scope:n,orientation:r,dir:S,loop:s,currentTabStopId:w,onItemFocus:x.useCallback(H=>C(H),[C]),onItemShiftTab:x.useCallback(()=>T(!0),[]),onFocusableItemAdd:x.useCallback(()=>z(H=>H+1),[]),onFocusableItemRemove:x.useCallback(()=>z(H=>H-1),[]),children:g.jsx(Tt.div,{tabIndex:k||O===0?-1:0,"data-orientation":r,...m,ref:y,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{L.current=!0}),onFocus:je(e.onFocus,H=>{const G=!L.current;if(H.target===H.currentTarget&&G&&!k){const B=new CustomEvent(Zg,mI);if(H.currentTarget.dispatchEvent(B),!B.defaultPrevented){const $=M().filter(j=>j.focusable),I=$.find(j=>j.active),U=$.find(j=>j.id===w),F=[I,U,...$].filter(Boolean).map(j=>j.ref.current);CT(F,p)}}L.current=!1}),onBlur:je(e.onBlur,()=>T(!1))})})}),ST="RovingFocusGroupItem",wT=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...u}=e,d=el(),h=a||d,p=yI(ST,n),m=p.currentTabStopId===h,_=yT(n),{onFocusableItemAdd:y,onFocusableItemRemove:S,currentTabStopId:w}=p;return x.useEffect(()=>{if(r)return y(),()=>S()},[r,y,S]),g.jsx(t_.ItemSlot,{scope:n,id:h,focusable:r,active:s,children:g.jsx(Tt.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:je(e.onMouseDown,C=>{r?p.onItemFocus(h):C.preventDefault()}),onFocus:je(e.onFocus,()=>p.onItemFocus(h)),onKeyDown:je(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=wI(C,p.orientation,p.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=_().filter(M=>M.focusable).map(M=>M.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const M=R.indexOf(C.currentTarget);R=p.loop?CI(R,M+1):R.slice(M+1)}setTimeout(()=>CT(R))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:w!=null}):l})})});wT.displayName=ST;var xI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function SI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function wI(e,t,n){const r=SI(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xI[r]}function CT(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function CI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kI=xT,EI=wT,n_=["Enter"," "],RI=["ArrowDown","PageUp","Home"],kT=["ArrowUp","PageDown","End"],TI=[...RI,...kT],MI={ltr:[...n_,"ArrowRight"],rtl:[...n_,"ArrowLeft"]},AI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Nu="Menu",[du,NI,DI]=vT(Nu),[Ko,ET]=eo(Nu,[DI,bl,bT]),ep=bl(),RT=bT(),[OI,Go]=Ko(Nu),[LI,Du]=Ko(Nu),TT=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:l=!0}=e,u=ep(t),[d,h]=x.useState(null),p=x.useRef(!1),m=wi(a),_=_T(s);return x.useEffect(()=>{const y=()=>{p.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>p.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),g.jsx(Fy,{...u,children:g.jsx(OI,{scope:t,open:n,onOpenChange:m,content:d,onContentChange:h,children:g.jsx(LI,{scope:t,onClose:x.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:_,modal:l,children:r})})})};TT.displayName=Nu;var zI="MenuAnchor",rb=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ep(n);return g.jsx(Vf,{...s,...r,ref:t})});rb.displayName=zI;var ib="MenuPortal",[jI,MT]=Ko(ib,{forceMount:void 0}),AT=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,a=Go(ib,t);return g.jsx(jI,{scope:t,forceMount:n,children:g.jsx(qr,{present:n||a.open,children:g.jsx(Cu,{asChild:!0,container:s,children:r})})})};AT.displayName=ib;var Ur="MenuContent",[BI,sb]=Ko(Ur),NT=x.forwardRef((e,t)=>{const n=MT(Ur,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=Go(Ur,e.__scopeMenu),l=Du(Ur,e.__scopeMenu);return g.jsx(du.Provider,{scope:e.__scopeMenu,children:g.jsx(qr,{present:r||a.open,children:g.jsx(du.Slot,{scope:e.__scopeMenu,children:l.modal?g.jsx(PI,{...s,ref:t}):g.jsx(II,{...s,ref:t})})})})}),PI=x.forwardRef((e,t)=>{const n=Go(Ur,e.__scopeMenu),r=x.useRef(null),s=Ut(t,r);return x.useEffect(()=>{const a=r.current;if(a)return Sy(a)},[]),g.jsx(ob,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:je(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),II=x.forwardRef((e,t)=>{const n=Go(Ur,e.__scopeMenu);return g.jsx(ob,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),HI=al("MenuContent.ScrollLock"),ob=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:_,onDismiss:y,disableOutsideScroll:S,...w}=e,C=Go(Ur,n),k=Du(Ur,n),T=ep(n),R=RT(n),M=NI(n),[L,O]=x.useState(null),z=x.useRef(null),H=Ut(t,z,C.onContentChange),G=x.useRef(0),B=x.useRef(""),$=x.useRef(0),I=x.useRef(null),U=x.useRef("right"),V=x.useRef(0),F=S?If:x.Fragment,j=S?{as:HI,allowPinchZoom:!0}:void 0,Y=Q=>{var ge,Te;const A=B.current+Q,P=M().filter(ve=>!ve.disabled),Z=document.activeElement,D=(ge=P.find(ve=>ve.ref.current===Z))==null?void 0:ge.textValue,K=P.map(ve=>ve.textValue),ee=QI(K,A,D),ie=(Te=P.find(ve=>ve.textValue===ee))==null?void 0:Te.ref.current;(function ve(ke){B.current=ke,window.clearTimeout(G.current),ke!==""&&(G.current=window.setTimeout(()=>ve(""),1e3))})(A),ie&&setTimeout(()=>ie.focus())};x.useEffect(()=>()=>window.clearTimeout(G.current),[]),xy();const W=x.useCallback(Q=>{var P,Z;return U.current===((P=I.current)==null?void 0:P.side)&&e9(Q,(Z=I.current)==null?void 0:Z.area)},[]);return g.jsx(BI,{scope:n,searchRef:B,onItemEnter:x.useCallback(Q=>{W(Q)&&Q.preventDefault()},[W]),onItemLeave:x.useCallback(Q=>{var A;W(Q)||((A=z.current)==null||A.focus(),O(null))},[W]),onTriggerLeave:x.useCallback(Q=>{W(Q)&&Q.preventDefault()},[W]),pointerGraceTimerRef:$,onPointerGraceIntentChange:x.useCallback(Q=>{I.current=Q},[]),children:g.jsx(F,{...j,children:g.jsx(Bf,{asChild:!0,trapped:s,onMountAutoFocus:je(a,Q=>{var A;Q.preventDefault(),(A=z.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:g.jsx(wu,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:_,onDismiss:y,children:g.jsx(kI,{asChild:!0,...R,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:L,onCurrentTabStopIdChange:O,onEntryFocus:je(d,Q=>{k.isUsingKeyboardRef.current||Q.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(Uy,{role:"menu","aria-orientation":"vertical","data-state":KT(C.open),"data-radix-menu-content":"",dir:k.dir,...T,...w,ref:H,style:{outline:"none",...w.style},onKeyDown:je(w.onKeyDown,Q=>{const P=Q.target.closest("[data-radix-menu-content]")===Q.currentTarget,Z=Q.ctrlKey||Q.altKey||Q.metaKey,D=Q.key.length===1;P&&(Q.key==="Tab"&&Q.preventDefault(),!Z&&D&&Y(Q.key));const K=z.current;if(Q.target!==K||!TI.includes(Q.key))return;Q.preventDefault();const ie=M().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);kT.includes(Q.key)&&ie.reverse(),XI(ie)}),onBlur:je(e.onBlur,Q=>{Q.currentTarget.contains(Q.target)||(window.clearTimeout(G.current),B.current="")}),onPointerMove:je(e.onPointerMove,fu(Q=>{const A=Q.target,P=V.current!==Q.clientX;if(Q.currentTarget.contains(A)&&P){const Z=Q.clientX>V.current?"right":"left";U.current=Z,V.current=Q.clientX}}))})})})})})})});NT.displayName=Ur;var FI="MenuGroup",ab=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(Tt.div,{role:"group",...r,ref:t})});ab.displayName=FI;var UI="MenuLabel",DT=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(Tt.div,{...r,ref:t})});DT.displayName=UI;var gf="MenuItem",uC="menu.itemSelect",tp=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=x.useRef(null),l=Du(gf,e.__scopeMenu),u=sb(gf,e.__scopeMenu),d=Ut(t,a),h=x.useRef(!1),p=()=>{const m=a.current;if(!n&&m){const _=new CustomEvent(uC,{bubbles:!0,cancelable:!0});m.addEventListener(uC,y=>r==null?void 0:r(y),{once:!0}),RE(m,_),_.defaultPrevented?h.current=!1:l.onClose()}};return g.jsx(OT,{...s,ref:d,disabled:n,onClick:je(e.onClick,p),onPointerDown:m=>{var _;(_=e.onPointerDown)==null||_.call(e,m),h.current=!0},onPointerUp:je(e.onPointerUp,m=>{var _;h.current||(_=m.currentTarget)==null||_.click()}),onKeyDown:je(e.onKeyDown,m=>{const _=u.searchRef.current!=="";n||_&&m.key===" "||n_.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});tp.displayName=gf;var OT=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,l=sb(gf,n),u=RT(n),d=x.useRef(null),h=Ut(t,d),[p,m]=x.useState(!1),[_,y]=x.useState("");return x.useEffect(()=>{const S=d.current;S&&y((S.textContent??"").trim())},[a.children]),g.jsx(du.ItemSlot,{scope:n,disabled:r,textValue:s??_,children:g.jsx(EI,{asChild:!0,...u,focusable:!r,children:g.jsx(Tt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:h,onPointerMove:je(e.onPointerMove,fu(S=>{r?l.onItemLeave(S):(l.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(e.onPointerLeave,fu(S=>l.onItemLeave(S))),onFocus:je(e.onFocus,()=>m(!0)),onBlur:je(e.onBlur,()=>m(!1))})})})}),$I="MenuCheckboxItem",LT=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return g.jsx(IT,{scope:e.__scopeMenu,checked:n,children:g.jsx(tp,{role:"menuitemcheckbox","aria-checked":vf(n)?"mixed":n,...s,ref:t,"data-state":cb(n),onSelect:je(s.onSelect,()=>r==null?void 0:r(vf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});LT.displayName=$I;var zT="MenuRadioGroup",[WI,qI]=Ko(zT,{value:void 0,onValueChange:()=>{}}),jT=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=wi(r);return g.jsx(WI,{scope:e.__scopeMenu,value:n,onValueChange:a,children:g.jsx(ab,{...s,ref:t})})});jT.displayName=zT;var BT="MenuRadioItem",PT=x.forwardRef((e,t)=>{const{value:n,...r}=e,s=qI(BT,e.__scopeMenu),a=n===s.value;return g.jsx(IT,{scope:e.__scopeMenu,checked:a,children:g.jsx(tp,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":cb(a),onSelect:je(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});PT.displayName=BT;var lb="MenuItemIndicator",[IT,VI]=Ko(lb,{checked:!1}),HT=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=VI(lb,n);return g.jsx(qr,{present:r||vf(a.checked)||a.checked===!0,children:g.jsx(Tt.span,{...s,ref:t,"data-state":cb(a.checked)})})});HT.displayName=lb;var KI="MenuSeparator",FT=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(Tt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});FT.displayName=KI;var GI="MenuArrow",UT=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ep(n);return g.jsx($y,{...s,...r,ref:t})});UT.displayName=GI;var YI="MenuSub",[dQ,$T]=Ko(YI),Fc="MenuSubTrigger",WT=x.forwardRef((e,t)=>{const n=Go(Fc,e.__scopeMenu),r=Du(Fc,e.__scopeMenu),s=$T(Fc,e.__scopeMenu),a=sb(Fc,e.__scopeMenu),l=x.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=a,h={__scopeMenu:e.__scopeMenu},p=x.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return x.useEffect(()=>p,[p]),x.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),g.jsx(rb,{asChild:!0,...h,children:g.jsx(OT,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":KT(n.open),...e,ref:by(t,s.onTriggerChange),onClick:m=>{var _;(_=e.onClick)==null||_.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:je(e.onPointerMove,fu(m=>{a.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:je(e.onPointerLeave,fu(m=>{var y,S;p();const _=(y=n.content)==null?void 0:y.getBoundingClientRect();if(_){const w=(S=n.content)==null?void 0:S.dataset.side,C=w==="right",k=C?-5:5,T=_[C?"left":"right"],R=_[C?"right":"left"];a.onPointerGraceIntentChange({area:[{x:m.clientX+k,y:m.clientY},{x:T,y:_.top},{x:R,y:_.top},{x:R,y:_.bottom},{x:T,y:_.bottom}],side:w}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(m),m.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:je(e.onKeyDown,m=>{var y;const _=a.searchRef.current!=="";e.disabled||_&&m.key===" "||MI[r.dir].includes(m.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),m.preventDefault())})})})});WT.displayName=Fc;var qT="MenuSubContent",VT=x.forwardRef((e,t)=>{const n=MT(Ur,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=Go(Ur,e.__scopeMenu),l=Du(Ur,e.__scopeMenu),u=$T(qT,e.__scopeMenu),d=x.useRef(null),h=Ut(t,d);return g.jsx(du.Provider,{scope:e.__scopeMenu,children:g.jsx(qr,{present:r||a.open,children:g.jsx(du.Slot,{scope:e.__scopeMenu,children:g.jsx(ob,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var m;l.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:je(e.onFocusOutside,p=>{p.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:je(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:je(e.onKeyDown,p=>{var y;const m=p.currentTarget.contains(p.target),_=AI[l.dir].includes(p.key);m&&_&&(a.onOpenChange(!1),(y=u.trigger)==null||y.focus(),p.preventDefault())})})})})})});VT.displayName=qT;function KT(e){return e?"open":"closed"}function vf(e){return e==="indeterminate"}function cb(e){return vf(e)?"indeterminate":e?"checked":"unchecked"}function XI(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ZI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function QI(e,t,n){const s=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=ZI(e,Math.max(a,0));s.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function JI(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],d=t[l],h=u.x,p=u.y,m=d.x,_=d.y;p>r!=_>r&&n<(m-h)*(r-p)/(_-p)+h&&(s=!s)}return s}function e9(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return JI(n,t)}function fu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var t9=TT,n9=rb,r9=AT,i9=NT,s9=ab,o9=DT,a9=tp,l9=LT,c9=jT,u9=PT,h9=HT,d9=FT,f9=UT,p9=WT,m9=VT,ub="ContextMenu",[g9]=eo(ub,[ET]),Fn=ET(),[v9,GT]=g9(ub),YT=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:a=!0}=e,[l,u]=x.useState(!1),d=Fn(t),h=wi(r),p=x.useCallback(m=>{u(m),h(m)},[h]);return g.jsx(v9,{scope:t,open:l,onOpenChange:p,modal:a,children:g.jsx(t9,{...d,dir:s,open:l,onOpenChange:p,modal:a,children:n})})};YT.displayName=ub;var XT="ContextMenuTrigger",ZT=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,a=GT(XT,n),l=Fn(n),u=x.useRef({x:0,y:0}),d=x.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),h=x.useRef(0),p=x.useCallback(()=>window.clearTimeout(h.current),[]),m=_=>{u.current={x:_.clientX,y:_.clientY},a.onOpenChange(!0)};return x.useEffect(()=>p,[p]),x.useEffect(()=>void(r&&p()),[r,p]),g.jsxs(g.Fragment,{children:[g.jsx(n9,{...l,virtualRef:d}),g.jsx(Tt.span,{"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:je(e.onContextMenu,_=>{p(),m(_),_.preventDefault()}),onPointerDown:r?e.onPointerDown:je(e.onPointerDown,pd(_=>{p(),h.current=window.setTimeout(()=>m(_),700)})),onPointerMove:r?e.onPointerMove:je(e.onPointerMove,pd(p)),onPointerCancel:r?e.onPointerCancel:je(e.onPointerCancel,pd(p)),onPointerUp:r?e.onPointerUp:je(e.onPointerUp,pd(p))})]})});ZT.displayName=XT;var _9="ContextMenuPortal",QT=e=>{const{__scopeContextMenu:t,...n}=e,r=Fn(t);return g.jsx(r9,{...r,...n})};QT.displayName=_9;var JT="ContextMenuContent",eM=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=GT(JT,n),a=Fn(n),l=x.useRef(!1);return g.jsx(i9,{...a,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{var d;(d=e.onCloseAutoFocus)==null||d.call(e,u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{var d;(d=e.onInteractOutside)==null||d.call(e,u),!u.defaultPrevented&&!s.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eM.displayName=JT;var y9="ContextMenuGroup",b9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(s9,{...s,...r,ref:t})});b9.displayName=y9;var x9="ContextMenuLabel",S9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(o9,{...s,...r,ref:t})});S9.displayName=x9;var w9="ContextMenuItem",tM=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(a9,{...s,...r,ref:t})});tM.displayName=w9;var C9="ContextMenuCheckboxItem",k9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(l9,{...s,...r,ref:t})});k9.displayName=C9;var E9="ContextMenuRadioGroup",R9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(c9,{...s,...r,ref:t})});R9.displayName=E9;var T9="ContextMenuRadioItem",M9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(u9,{...s,...r,ref:t})});M9.displayName=T9;var A9="ContextMenuItemIndicator",N9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(h9,{...s,...r,ref:t})});N9.displayName=A9;var D9="ContextMenuSeparator",O9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(d9,{...s,...r,ref:t})});O9.displayName=D9;var L9="ContextMenuArrow",z9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(f9,{...s,...r,ref:t})});z9.displayName=L9;var j9="ContextMenuSubTrigger",B9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(p9,{...s,...r,ref:t})});B9.displayName=j9;var P9="ContextMenuSubContent",I9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Fn(n);return g.jsx(m9,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});I9.displayName=P9;function pd(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var H9=YT,F9=ZT,U9=QT,nM=eM,rM=tM;const $9=H9,W9=F9,iM=x.forwardRef(({className:e,...t},n)=>g.jsx(U9,{children:g.jsx(nM,{ref:n,className:xe("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...t})}));iM.displayName=nM.displayName;const sM=x.forwardRef(({className:e,...t},n)=>g.jsx(rM,{ref:n,className:xe("relative flex cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));sM.displayName=rM.displayName;function q9({onRemove:e,children:t}){return g.jsxs($9,{children:[g.jsx(W9,{asChild:!0,children:t}),g.jsx(iM,{children:g.jsxs(sM,{onSelect:n=>{n.stopPropagation(),e()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[g.jsx(y6,{className:"h-4 w-4"}),g.jsx("span",{className:"text-xs font-medium",children:"Remove"})]})})]})}function V9({group:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:a,chatsPerProject:l,onNewLocalChat:u,onRemoveProject:d,isConnected:h,startingLocalPath:p}){const{groupKey:m,localPath:_,chats:y}=e,S=n.has(m),w=S?y:y.slice(0,l),C=y.length>l,{attributes:k,listeners:T,setNodeRef:R,setActivatorNodeRef:M,transform:L,transition:O,isDragging:z}=dI({id:m}),H={transform:uu.Translate.toString(L),transition:O},G=g.jsxs("div",{ref:M,className:xe("sticky top-0 bg-background dark:bg-card z-10 relative p-[10px] flex items-center justify-between","cursor-grab active:cursor-grabbing",z&&"cursor-grabbing"),onClick:()=>r(m),...T,children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"relative size-3.5 shrink-0 cursor-pointer",children:t.has(m)?g.jsx(es,{className:"translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-all duration-200"}):g.jsxs(g.Fragment,{children:[g.jsx(iR,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 text-slate-400 dark:text-slate-500 transition-all duration-200 group-hover/section:opacity-0"}),g.jsx(es,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 rotate-90 text-slate-400 opacity-0 transition-all duration-200 group-hover/section:opacity-100"})]})}),g.jsxs(uf,{children:[g.jsx(hf,{asChild:!0,children:g.jsx("span",{className:"truncate max-w-[150px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:ZR(_)})}),g.jsx(lu,{side:"right",sideOffset:4,children:_})]})]}),u&&g.jsxs(uf,{children:[g.jsx(hf,{asChild:!0,children:g.jsx(nt,{variant:"ghost",size:"icon",className:xe("h-5.5 w-5.5 absolute right-2 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100",(!h||p===_)&&"opacity-50 cursor-not-allowed"),disabled:!h||p===_,onClick:B=>{B.stopPropagation(),u(_)},children:p===_?g.jsx(is,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):g.jsx(Ty,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),g.jsx(lu,{side:"right",sideOffset:4,children:h?"New chat":`Start ${Pn} to connect`})]})]});return g.jsxs("div",{ref:R,style:H,className:xe("group/section",z&&"opacity-50 shadow-lg z-50 relative"),...k,children:[d?g.jsx(q9,{onRemove:()=>d(m),children:G}):G,!t.has(m)&&(w.length>0||C)&&g.jsxs("div",{className:"space-y-[2px] mb-2 ",children:[w.map(a),C&&g.jsx("button",{onClick:()=>s(m),className:"pl-2.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:S?"Show less":`Show more (${y.length-l})`})]})]})}function K9({projectGroups:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:a,chatsPerProject:l,onNewLocalChat:u,onRemoveProject:d,onReorderGroups:h,isConnected:p,startingLocalPath:m}){const _=UP(Qw(tb,{activationConstraint:{distance:8}}),Qw(Jy)),y=x.useMemo(()=>e.map(k=>k.groupKey),[e]),S=x.useRef(null);function w(k){const T=k.active.id;t.has(T)?S.current=null:(S.current=T,r(T))}function C(k){const{active:T,over:R}=k;if(R&&T.id!==R.id&&h){const M=y.indexOf(T.id),L=y.indexOf(R.id);if(M!==-1&&L!==-1){const O=nb(y,M,L);h(O)}}if(S.current){const M=S.current;S.current=null,requestAnimationFrame(()=>r(M))}}return g.jsx(V8,{sensors:_,collisionDetection:KP,onDragStart:w,onDragEnd:C,children:g.jsx(sI,{items:y,strategy:rI,children:e.map(k=>g.jsx(V9,{group:k,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:a,chatsPerProject:l,onNewLocalChat:u,onRemoveProject:d,isConnected:p,startingLocalPath:m},k.groupKey))})})}const hC=e=>{let t;const n=new Set,r=(h,p)=>{const m=typeof h=="function"?h(t):h;if(!Object.is(m,t)){const _=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,_))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(r,s,u);return u},G9=(e=>e?hC(e):hC),Y9=e=>e;function X9(e,t=Y9){const n=bt.useSyncExternalStore(e.subscribe,bt.useCallback(()=>t(e.getState()),[e,t]),bt.useCallback(()=>t(e.getInitialState()),[e,t]));return bt.useDebugValue(n),n}const Z9=e=>{const t=G9(e),n=r=>X9(t,r);return Object.assign(n,t),n},Cl=(e=>Z9);function Q9(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const l=d=>d===null?null:JSON.parse(d,void 0),u=(a=n.getItem(s))!=null?a:null;return u instanceof Promise?u.then(l):l(u)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const r_=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return r_(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return r_(r)(n)}}}},J9=(e,t)=>(n,r,s)=>{let a={storage:Q9(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},l=!1,u=0;const d=new Set,h=new Set;let p=a.storage;if(!p)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...C)},r,s);const m=()=>{const C=a.partialize({...r()});return p.setItem(a.name,{state:C,version:a.version})},_=s.setState;s.setState=(C,k)=>(_(C,k),m());const y=e((...C)=>(n(...C),m()),r,s);s.getInitialState=()=>y;let S;const w=()=>{var C,k;if(!p)return;const T=++u;l=!1,d.forEach(M=>{var L;return M((L=r())!=null?L:y)});const R=((k=a.onRehydrateStorage)==null?void 0:k.call(a,(C=r())!=null?C:y))||void 0;return r_(p.getItem.bind(p))(a.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==a.version){if(a.migrate){const L=a.migrate(M.state,M.version);return L instanceof Promise?L.then(O=>[!0,O]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var L;if(T!==u)return;const[O,z]=M;if(S=a.merge(z,(L=r())!=null?L:y),n(S,!0),O)return m()}).then(()=>{T===u&&(R==null||R(S,void 0),S=r(),l=!0,h.forEach(M=>M(S)))}).catch(M=>{T===u&&(R==null||R(void 0,M))})};return s.persist={setOptions:C=>{a={...a,...C},C.storage&&(p=C.storage)},clearStorage:()=>{p==null||p.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>w(),hasHydrated:()=>l,onHydrate:C=>(d.add(C),()=>{d.delete(C)}),onFinishHydration:C=>(h.add(C),()=>{h.delete(C)})},a.skipHydration||w(),S||y},kl=J9,dC=Cl()(kl(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"}));function e7({data:e,activeChatId:t,connectionStatus:n,ready:r,open:s,collapsed:a,showMobileOpenButton:l,onOpen:u,onClose:d,onCollapse:h,onExpand:p,onCreateChat:m,onDeleteChat:_,onRemoveProject:y}){const S=si(),w=xu(),C=x.useRef(null),[k,T]=x.useState(new Set),[R,M]=x.useState(new Set),[L,O]=x.useState(()=>Date.now()),z=10,H=dC(K=>K.order),G=dC(K=>K.setOrder),B=x.useMemo(()=>{if(H.length===0)return e.projectGroups;const K=new Map(e.projectGroups.map(ge=>[ge.groupKey,ge])),ee=H.filter(ge=>K.has(ge)).map(ge=>K.get(ge)),ie=new Set(H);for(const ge of e.projectGroups)ie.has(ge.groupKey)||ee.push(ge);return ee},[e.projectGroups,H]),$=x.useCallback(K=>G(K),[G]),I=x.useMemo(()=>new Map(e.projectGroups.map(K=>[K.localPath,K.groupKey])),[e.projectGroups]),U=x.useMemo(()=>e.projectGroups.reduce((K,ee)=>K+ee.chats.length,0),[e.projectGroups]),V=x.useCallback(K=>{T(ee=>{const ie=new Set(ee);return ie.has(K)?ie.delete(K):ie.add(K),ie})},[]),F=x.useCallback(K=>{M(ee=>{const ie=new Set(ee);return ie.has(K)?ie.delete(K):ie.add(K),ie})},[]),j=x.useCallback(K=>g.jsx(RP,{chat:K,activeChatId:t,nowMs:L,onSelectChat:ee=>w(`/chat/${ee}`),onDeleteChat:()=>_(K)},K._id),[t,w,L,_]);x.useEffect(()=>{const K=window.setInterval(()=>{O(Date.now())},3e4);return()=>window.clearInterval(K)},[]),x.useEffect(()=>{!t||!C.current||requestAnimationFrame(()=>{const K=C.current,ee=K==null?void 0:K.querySelector(`[data-chat-id="${t}"]`);if(!ee||!K)return;const ie=ee.getBoundingClientRect(),ge=K.getBoundingClientRect();if(ie.top<ge.top+38){const Te=ie.top-ge.top+K.scrollTop;K.scrollTo({top:Te-38,behavior:"smooth"})}else if(ie.bottom>ge.bottom){const Te=ie.top+ie.height/2-ge.top+K.scrollTop,ve=K.clientHeight/2;K.scrollTo({top:Te-ve,behavior:"smooth"})}})},[t,U]);const Y=U>0,W=S.pathname==="/",Q=S.pathname.startsWith("/settings"),A=W||Q,P=n==="connecting"||!r,Z=P?"Connecting":n==="connected"?"Connected":"Disconnected",D=n==="connected"?"bg-emerald-500":"bg-amber-500";return g.jsxs(g.Fragment,{children:[!s&&l&&g.jsx(nt,{variant:"ghost",size:"icon",className:"fixed top-3 left-3 z-50 md:hidden",onClick:u,children:g.jsx(sR,{className:"h-5 w-5"})}),a&&A&&g.jsx("div",{className:"hidden md:flex fixed left-0 top-0 h-full z-40 items-start pt-4 pl-5 border-l border-border/0",children:g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(Gc,{className:"size-6 text-logo"}),g.jsx(nt,{variant:"ghost",size:"icon",onClick:p,title:"Expand sidebar",children:g.jsx($v,{className:"h-5 w-5"})})]})}),g.jsxs("div",{"data-sidebar":"open",className:xe("fixed inset-0 z-50 bg-background dark:bg-card flex flex-col h-[100dvh] select-none","md:relative md:inset-auto md:w-[275px] md:mr-0 md:h-[calc(100dvh-16px)] md:my-2 md:ml-2 md:border md:border-border md:rounded-2xl",s?"flex":"hidden md:flex",a&&"md:hidden"),children:[g.jsxs("div",{className:" pl-3 pr-[7px] h-[64px] max-h-[64px] md:h-[55px] md:max-h-[55px] border-b flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("button",{type:"button",onClick:h,title:"Collapse sidebar",className:"hidden md:flex group/sidebar-collapse relative items-center justify-center h-5 w-5 sm:h-6 sm:w-6",children:[g.jsx(Gc,{className:"absolute inset-0.5 h-4 w-4 sm:h-5 sm:w-5 text-logo transition-all duration-200 ease-out opacity-100 scale-100 group-hover/sidebar-collapse:opacity-0 group-hover/sidebar-collapse:scale-0"}),g.jsx($v,{className:"absolute inset-0 h-4 w-4 sm:h-6 sm:w-6 text-slate-500 dark:text-slate-400 transition-all duration-200 ease-out opacity-0 scale-0 group-hover/sidebar-collapse:opacity-100 group-hover/sidebar-collapse:scale-80 hover:opacity-50"})]}),g.jsx(Gc,{className:"h-5 w-5 sm:h-6 sm:w-6 text-logo md:hidden"}),g.jsx("span",{className:"font-logo text-base uppercase sm:text-md text-slate-600 dark:text-slate-100",children:Pn})]}),g.jsxs("div",{className:"flex items-center",children:[g.jsx(nt,{variant:"ghost",size:"icon",onClick:()=>{w("/"),d()},title:"New project",children:g.jsx(Ry,{className:"size-4"})}),g.jsx(nt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:d,children:g.jsx(vl,{className:"h-5 w-5"})})]})]}),g.jsx("div",{ref:C,className:"flex-1 min-h-0 overflow-y-auto scrollbar-hide",style:{WebkitOverflowScrolling:"touch"},children:g.jsxs("div",{className:"p-[7px]",children:[!Y&&P?g.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(K=>g.jsxs("div",{className:"space-y-2 animate-pulse",children:[g.jsx("div",{className:"h-4 w-28 rounded bg-muted"}),g.jsx("div",{className:"space-y-1",children:[0,1,2].map(ee=>g.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",children:[g.jsx("div",{className:"h-3.5 w-3.5 rounded-full bg-muted"}),g.jsx("div",{className:xe("h-3.5 rounded bg-muted",ee===0?"w-32":ee===1?"w-40":"w-28")})]},ee))})]},K))}):null,!Y&&!P&&e.projectGroups.length===0?g.jsx("p",{className:"text-sm text-slate-400 p-2 mt-6 text-center",children:"No conversations yet"}):null,g.jsx(K9,{projectGroups:B,onReorderGroups:$,collapsedSections:k,expandedGroups:R,onToggleSection:V,onToggleExpandedGroup:F,renderChatRow:j,chatsPerProject:z,onNewLocalChat:K=>{const ee=I.get(K);ee&&m(ee)},onRemoveProject:y,isConnected:n==="connected"})]})}),g.jsx("div",{className:"border-t border-border p-2",children:g.jsx("button",{type:"button",onClick:()=>{w("/settings/general"),d()},className:xe("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",Q?"bg-muted border-border":"border-border/0 hover:bg-muted hover:border-border active:bg-muted/80"),children:g.jsxs("div",{className:"flex items- justify-between gap-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(i6,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm",children:"Settings"})]}),g.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[g.jsx("span",{children:Z}),P?g.jsx(is,{className:"h-2 w-2 animate-spin"}):g.jsx("span",{className:xe("h-2 w-2 rounded-full",D)})]})]})})})]}),s?g.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 md:hidden",onClick:d}):null]})}const hb=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],oM=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],aM={reasoningEffort:"high"},i_={reasoningEffort:"high",fastMode:!1};function fC(e){return hb.some(t=>t.id===e)}function pC(e){return oM.some(t=>t.id===e)}const t7=[{id:"claude",label:"Claude",defaultModel:"opus",defaultEffort:"high",supportsPlanMode:!0,models:[{id:"opus",label:"Opus",supportsEffort:!0},{id:"sonnet",label:"Sonnet",supportsEffort:!0},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...hb]},{id:"codex",label:"Codex",defaultModel:"gpt-5.4",supportsPlanMode:!0,models:[{id:"gpt-5.4",label:"GPT-5.4",supportsEffort:!1},{id:"gpt-5.3-codex",label:"GPT-5.3 Codex",supportsEffort:!1},{id:"gpt-5.3-codex-spark",label:"GPT-5.3 Codex Spark",supportsEffort:!1}],efforts:[]}],$s={toggleEmbeddedTerminal:["cmd+j","ctrl+`"],toggleRightSidebar:["cmd+b","ctrl+b"],openInFinder:["cmd+alt+f","ctrl+alt+f"],openInEditor:["cmd+shift+o","ctrl+shift+o"],addSplitTerminal:["cmd+/","ctrl+/"]};var np="Popover",[lM]=eo(np,[bl]),Ou=bl(),[n7,to]=lM(np),cM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,u=Ou(t),d=x.useRef(null),[h,p]=x.useState(!1),[m,_]=jf({prop:r,defaultProp:s??!1,onChange:a,caller:np});return g.jsx(Fy,{...u,children:g.jsx(n7,{scope:t,contentId:el(),triggerRef:d,open:m,onOpenChange:_,onOpenToggle:x.useCallback(()=>_(y=>!y),[_]),hasCustomAnchor:h,onCustomAnchorAdd:x.useCallback(()=>p(!0),[]),onCustomAnchorRemove:x.useCallback(()=>p(!1),[]),modal:l,children:n})})};cM.displayName=np;var uM="PopoverAnchor",r7=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=to(uM,n),a=Ou(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=s;return x.useEffect(()=>(l(),()=>u()),[l,u]),g.jsx(Vf,{...a,...r,ref:t})});r7.displayName=uM;var hM="PopoverTrigger",dM=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=to(hM,n),a=Ou(n),l=Ut(t,s.triggerRef),u=g.jsx(Tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":vM(s.open),...r,ref:l,onClick:je(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:g.jsx(Vf,{asChild:!0,...a,children:u})});dM.displayName=hM;var db="PopoverPortal",[i7,s7]=lM(db,{forceMount:void 0}),fM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=to(db,t);return g.jsx(i7,{scope:t,forceMount:n,children:g.jsx(qr,{present:n||a.open,children:g.jsx(Cu,{asChild:!0,container:s,children:r})})})};fM.displayName=db;var ul="PopoverContent",pM=x.forwardRef((e,t)=>{const n=s7(ul,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=to(ul,e.__scopePopover);return g.jsx(qr,{present:r||a.open,children:a.modal?g.jsx(a7,{...s,ref:t}):g.jsx(l7,{...s,ref:t})})});pM.displayName=ul;var o7=al("PopoverContent.RemoveScroll"),a7=x.forwardRef((e,t)=>{const n=to(ul,e.__scopePopover),r=x.useRef(null),s=Ut(t,r),a=x.useRef(!1);return x.useEffect(()=>{const l=r.current;if(l)return Sy(l)},[]),g.jsx(If,{as:o7,allowPinchZoom:!0,children:g.jsx(mM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),a.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,h=u.button===2||d;a.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:je(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),l7=x.forwardRef((e,t)=>{const n=to(ul,e.__scopePopover),r=x.useRef(!1),s=x.useRef(!1);return g.jsx(mM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),mM=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,...m}=e,_=to(ul,n),y=Ou(n);return xy(),g.jsx(Bf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:g.jsx(wu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>_.onOpenChange(!1),children:g.jsx(Uy,{"data-state":vM(_.open),role:"dialog",id:_.contentId,...y,...m,ref:t,style:{...m.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)"}})})})}),gM="PopoverClose",c7=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=to(gM,n);return g.jsx(Tt.button,{type:"button",...r,ref:t,onClick:je(e.onClick,()=>s.onOpenChange(!1))})});c7.displayName=gM;var u7="PopoverArrow",h7=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Ou(n);return g.jsx($y,{...s,...r,ref:t})});h7.displayName=u7;function vM(e){return e?"open":"closed"}var d7=cM,f7=dM,p7=fM,_M=pM;const m7=d7,g7=f7,yM=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>g.jsx(p7,{children:g.jsx(_M,{ref:s,align:t,sideOffset:n,[su]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),window.dispatchEvent(new Event(rf)),(l=r.onCloseAutoFocus)==null||l.call(r,a)},className:xe("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",e),...r})}));yM.displayName=_M.displayName;const bM=x.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:xe("flex w-full rounded-lg border border-border bg-background px-2.5 py-2 text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));bM.displayName="Textarea";function v7(){const[e,t]=x.useState(()=>{if(typeof window>"u")return!1;const n=navigator.standalone===!0,r=window.matchMedia("(display-mode: standalone)").matches;return n||r});return x.useEffect(()=>{const n=window.matchMedia("(display-mode: standalone)"),r=s=>{t(s.matches||navigator.standalone===!0)};return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const _7=Cl()(kl((e,t)=>({drafts:{},setDraft:(n,r)=>e(s=>{if(!r){const{[n]:a,...l}=s.drafts;return{drafts:l}}return{drafts:{...s.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:s,...a}=r.drafts;return{drafts:a}}),getDraft:n=>t().drafts[n]??""}),{name:"chat-input-drafts"}));function y7(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function b7(e){var n;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:(e==null?void 0:e.model)??"opus",modelOptions:{reasoningEffort:fC(t)?t:fC(e==null?void 0:e.effort)?e.effort:aM.reasoningEffort}}}function x7(e){var n,r;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:y7(e==null?void 0:e.model),modelOptions:{reasoningEffort:pC(t)?t:pC(e==null?void 0:e.effort)?e.effort:i_.reasoningEffort,fastMode:typeof((r=e==null?void 0:e.modelOptions)==null?void 0:r.fastMode)=="boolean"?e.modelOptions.fastMode:i_.fastMode}}}const xM=Cl()(kl(e=>({provider:"claude",planMode:!1,preferences:{claude:{model:"opus",modelOptions:{...aM}},codex:{model:"gpt-5.4",modelOptions:{...i_}}},setProvider:t=>e({provider:t}),setModel:(t,n)=>e(r=>({preferences:{...r.preferences,[t]:{...r.preferences[t],model:n,modelOptions:t==="claude"&&n!=="opus"&&r.preferences.claude.modelOptions.reasoningEffort==="max"?{reasoningEffort:"high"}:r.preferences[t].modelOptions}}})),setModelOptions:(t,n)=>e(r=>({preferences:{...r.preferences,[t]:{...r.preferences[t],modelOptions:{...r.preferences[t].modelOptions,...n}}}})),setPlanMode:t=>e({planMode:t})}),{name:"chat-preferences",version:2,migrate:e=>{var n,r;const t=e;return{provider:(t==null?void 0:t.provider)??"claude",planMode:(t==null?void 0:t.planMode)??!1,preferences:{claude:b7((n=t==null?void 0:t.preferences)==null?void 0:n.claude),codex:x7((r=t==null?void 0:t.preferences)==null?void 0:r.codex)}}}}));function ko({onClick:e,selected:t,icon:n,label:r,description:s,disabled:a}){return g.jsxs("button",{onClick:e,disabled:a,className:xe("w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity",t?"bg-muted border-border":"hover:opacity-60",a&&"opacity-40 cursor-not-allowed"),children:[n,g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:r}),s?g.jsx("div",{className:"text-xs text-muted-foreground",children:s}):null]})]})}function Cc({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[s,a]=x.useState(!1);return n?g.jsx("button",{disabled:!0,className:xe("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default",t),children:e}):g.jsxs(m7,{open:s,onOpenChange:a,children:[g.jsx(g7,{asChild:!0,children:g.jsx("button",{className:xe("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0","hover:bg-muted/50",t),children:e})}),g.jsx(yM,{align:"center",className:"w-64 p-1",children:g.jsx("div",{className:"space-y-1",children:typeof r=="function"?r(()=>a(!1)):r})})]})}function S7({className:e,...t}){return g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:xe("shrink-0",e),...t,children:g.jsx("path",{d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})})}function w7({className:e,...t}){return g.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:xe("shrink-0",e),...t,children:g.jsx("path",{d:"M60.8734 57.2556V42.3124c0-1.2586.4722-2.2029 1.5728-2.8314l30.0443-17.3023c4.0899-2.3593 8.9662-3.4599 13.9988-3.4599 18.8759 0 30.8307 14.6289 30.8307 30.2006 0 1.1007 0 2.3593-.158 3.6178l-31.1446-18.2467c-1.8872-1.1006-3.7754-1.1006-5.6629 0L60.8734 57.2556Zm70.1542 58.2005V79.7487c0-2.2028-.9446-3.7756-2.8318-4.8763l-39.481-22.9651 12.8982-7.3934c1.1007-.6285 2.0453-.6285 3.1458 0l30.0441 17.3024c8.6523 5.0341 14.4708 15.7296 14.4708 26.1107 0 11.9539-7.0769 22.965-18.2461 27.527ZM51.593 83.9964l-12.8982-7.5497c-1.1007-.6285-1.5728-1.5728-1.5728-2.8314V39.0105c0-16.8303 12.8982-29.5722 30.3585-29.5722 6.607 0 12.7403 2.2029 17.9324 6.1349l-30.987 17.9324c-1.8871 1.1007-2.8314 2.6735-2.8314 4.8764v45.6159ZM79.3562 100.0403 60.8733 89.6592V67.6383l18.4829-10.3811 18.4812 10.3811v22.0209l-18.4812 10.3811Zm11.8757 47.8188c-6.607 0-12.7403-2.2031-17.9324-6.1344l30.9866-17.9333c1.8872-1.1005 2.8318-2.6728 2.8318-4.8759v-45.616l13.0564 7.5498c1.1005.6285 1.5723 1.5728 1.5723 2.8314v34.6051c0 16.8297-13.0564 29.5723-30.5147 29.5723ZM53.9522 112.7822 23.9079 95.4798c-8.652-5.0343-14.471-15.7296-14.471-26.1107 0-12.1119 7.2356-22.9652 18.403-27.5272v35.8634c0 2.2028.9443 3.7756 2.8314 4.8763l39.3248 22.8068-12.8982 7.3938c-1.1007.6287-2.045.6287-3.1456 0ZM52.2229 138.5791c-17.7745 0-30.8306-13.3713-30.8306-29.8871 0-1.2585.1578-2.5169.3143-3.7754l30.987 17.9323c1.8871 1.1005 3.7757 1.1005 5.6628 0l39.4811-22.807v14.9435c0 1.2585-.4721 2.2021-1.5728 2.8308l-30.0443 17.3025c-4.0898 2.359-8.9662 3.4605-13.9989 3.4605h.0014ZM91.2319 157.296c19.0327 0 34.9188-13.5272 38.5383-31.4594 17.6164-4.562 28.9425-21.0779 28.9425-37.908 0-11.0112-4.719-21.7066-13.2133-29.4143.7867-3.3035 1.2595-6.607 1.2595-9.909 0-22.4929-18.2471-39.3247-39.3251-39.3247-4.2461 0-8.3363.6285-12.4262 2.045-7.0792-6.9213-16.8318-11.3254-27.5271-11.3254-19.0331 0-34.9191 13.5268-38.5384 31.4591C11.3255 36.0212 0 52.5373 0 69.3675c0 11.0112 4.7184 21.7065 13.2125 29.4142-.7865 3.3035-1.2586 6.6067-1.2586 9.9092 0 22.4923 18.2466 39.3241 39.3248 39.3241 4.2462 0 8.3362-.6277 12.426-2.0441 7.0776 6.921 16.8302 11.3251 27.5271 11.3251Z"})})}const mC={claude:S7,codex:w7},gC={opus:Nw,sonnet:iu,haiku:nf,"gpt-5.4":Nw,"gpt-5.3-codex":iu,"gpt-5.3-codex-spark":nf},C7=x.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:s,chatId:a,activeProvider:l,availableProviders:u},d){var Z,D;const{getDraft:h,setDraft:p,clearDraft:m}=_7(),{provider:_,preferences:y,planMode:S,setProvider:w,setModel:C,setModelOptions:k,setPlanMode:T}=xM(),[R,M]=x.useState(()=>a?h(a):""),L=x.useRef(null),O=v7(),z=l??_,H=u.find(K=>K.id===z)??u[0],G=y[z],B=l!==null,$=(H==null?void 0:H.supportsPlanMode)??!1,I=z==="claude"?y.claude.modelOptions.reasoningEffort:y.codex.modelOptions.reasoningEffort,U=y.codex.modelOptions.fastMode,V=z==="claude"?hb:oM,F=x.useCallback(()=>{const K=L.current;K&&(K.style.height="auto",K.style.height=`${K.scrollHeight}px`)},[]),j=x.useCallback(K=>{if(L.current=K,!!d){if(typeof d=="function"){d(K);return}d.current=K}},[d]);x.useEffect(()=>{F()},[R,F]),x.useEffect(()=>(window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)),[F]),x.useEffect(()=>{var K;(K=L.current)==null||K.focus()},[a]);function Y(K){if(z==="claude"){k("claude",{reasoningEffort:K});return}k("codex",{reasoningEffort:K})}async function W(){if(!R.trim())return;const K=R;M(""),a&&m(a),L.current&&(L.current.style.height="auto");try{await t(K,{provider:z,model:G.model,modelOptions:z==="claude"?{claude:{...y.claude.modelOptions}}:{codex:{...y.codex.modelOptions}},planMode:$?S:!1})}catch(ee){console.error("[ChatInput] Submit failed:",ee),M(K),a&&p(a,K)}}function Q(K){if(K.key==="Tab"&&!K.shiftKey){K.preventDefault(),k6(L.current,document);return}if(K.key==="Tab"&&K.shiftKey&&$){K.preventDefault(),T(!S);return}if(K.key==="Escape"&&s){K.preventDefault(),n==null||n();return}const ee="ontouchstart"in window||navigator.maxTouchPoints>0;K.key==="Enter"&&!K.shiftKey&&!s&&!ee&&(K.preventDefault(),W())}const A=mC[z],P=gC[G.model]??iu;return g.jsxs("div",{className:xe("p-3 pt-0 md:pb-2",O&&"px-5 pb-5"),children:[g.jsxs("div",{className:"flex items-end gap-2 max-w-[840px] mx-auto border dark:bg-card/40 backdrop-blur-lg border-border rounded-[29px] pr-1.5",children:[g.jsx(bM,{ref:j,placeholder:"Build something...",value:R,autoFocus:!0,[Ny]:"",rows:1,onChange:K=>{M(K.target.value),a&&p(a,K.target.value),F()},onKeyDown:Q,disabled:r,className:"flex-1 text-base p-3 md:p-4 pl-4.5 md:pl-6 resize-none max-h-[200px] outline-none bg-transparent border-0 shadow-none"}),g.jsx(nt,{type:"button",onPointerDown:K=>{K.preventDefault(),s?n==null||n():!r&&R.trim()&&W()},disabled:!s&&(r||!R.trim()),size:"icon",className:"flex-shrink-0 bg-slate-600 text-white dark:bg-white dark:text-slate-900 rounded-full cursor-pointer h-10 w-10 md:h-11 md:w-11 mb-1 -mr-0.5 md:mr-0 md:mb-1.5 touch-manipulation disabled:bg-white/60 disabled:text-slate-700",children:s?g.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):g.jsx(Yz,{className:"h-5 w-5 md:h-6 md:w-6"})})]}),g.jsxs("div",{className:"flex justify-center items-center gap-0.5 max-w-[840px] mx-auto mt-2 animate-fade-in",children:[g.jsx(Cc,{disabled:B,trigger:g.jsxs(g.Fragment,{children:[g.jsx(A,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:(H==null?void 0:H.label)??z})]}),children:K=>u.map(ee=>{const ie=mC[ee.id];return g.jsx(ko,{onClick:()=>{w(ee.id),K()},selected:z===ee.id,icon:g.jsx(ie,{className:"h-4 w-4 text-muted-foreground"}),label:ee.label},ee.id)})}),g.jsx(Cc,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(P,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:((Z=H.models.find(K=>K.id===G.model))==null?void 0:Z.label)??G.model})]}),children:K=>H.models.map(ee=>{const ie=gC[ee.id]??iu;return g.jsx(ko,{onClick:()=>{C(z,ee.id),K()},selected:G.model===ee.id,icon:g.jsx(ie,{className:"h-4 w-4 text-muted-foreground"}),label:ee.label},ee.id)})}),g.jsx(Cc,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(cd,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:((D=V.find(K=>K.id===I))==null?void 0:D.label)??I})]}),children:K=>V.map(ee=>g.jsx(ko,{onClick:()=>{Y(ee.id),K()},selected:I===ee.id,icon:g.jsx(cd,{className:"h-4 w-4 text-muted-foreground"}),label:ee.label,disabled:z==="claude"&&ee.id==="max"&&G.model!=="opus"},ee.id))}),z==="codex"?g.jsx(Cc,{trigger:g.jsxs(g.Fragment,{children:[U?g.jsx(nf,{className:"h-3.5 w-3.5"}):g.jsx(cd,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:U?"Fast Mode":"Standard"})]}),triggerClassName:U?"text-emerald-500 dark:text-emerald-400":void 0,children:K=>g.jsxs(g.Fragment,{children:[g.jsx(ko,{onClick:()=>{k("codex",{fastMode:!1}),K()},selected:!U,icon:g.jsx(cd,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"}),g.jsx(ko,{onClick:()=>{k("codex",{fastMode:!0}),K()},selected:U,icon:g.jsx(nf,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,$?g.jsx(Cc,{trigger:g.jsxs(g.Fragment,{children:[S?g.jsx(tf,{className:"h-3.5 w-3.5"}):g.jsx(Ow,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:S?"Plan Mode":"Full Access"})]}),triggerClassName:S?"text-blue-400 dark:text-blue-300":void 0,children:K=>g.jsxs(g.Fragment,{children:[g.jsx(ko,{onClick:()=>{T(!1),K()},selected:!S,icon:g.jsx(Ow,{className:"h-4 w-4 text-muted-foreground"}),label:"Full Access",description:"Execution without approval"}),g.jsx(ko,{onClick:()=>{T(!0),K()},selected:S,icon:g.jsx(tf,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan Mode",description:"Review a plan before execution"})]})}):null]})]})}),k7=x.memo(C7),SM=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:xe("bg-card text-card-foreground",e),...t}));SM.displayName="Card";const wM=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:xe("flex flex-col space-y-1.5 p-2",e),...t}));wM.displayName="CardHeader";const E7=x.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:xe("text-2xl font-semibold leading-none tracking-tight",e),...t}));E7.displayName="CardTitle";const R7=x.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));R7.displayName="CardDescription";const CM=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:xe("p-6 pt-0",e),...t}));CM.displayName="CardContent";const T7=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:xe("flex items-center p-6 pt-0",e),...t}));T7.displayName="CardFooter";function M7({sidebarCollapsed:e,onOpenSidebar:t,onExpandSidebar:n,onNewChat:r,localPath:s,embeddedTerminalVisible:a=!1,onToggleEmbeddedTerminal:l,rightSidebarVisible:u=!1,onToggleRightSidebar:d,onOpenExternal:h,editorLabel:p="Editor",finderShortcut:m,editorShortcut:_,terminalShortcut:y,rightSidebarShortcut:S}){return g.jsx(wM,{className:xe("absolute top-0 md:top-2 left-0 right-0 z-10 px-2.5 pr-4 border-border/0 md:pb-0 flex items-center justify-center",e?"md:px-2.5 md:pr-4":"md:px-4 md:pr-4","backdrop-blur-lg md:backdrop-blur-none bg-gradient-to-b from-background md:from-transparent border-b border-x-0 md:border-x border-border md:border-none"),children:g.jsxs("div",{className:"relative flex items-center gap-2 w-full",children:[g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 border-l border-border/0",children:[g.jsx(nt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:t,children:g.jsx(sR,{className:"h-5 w-5"})}),e&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex items-center justify-center w-[40px] h-[40px]",children:g.jsx(Gc,{className:"h-4 w-4 sm:h-5 sm:w-5 text-logo ml-1 hidden md:block"})}),g.jsx(nt,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:n,title:"Expand sidebar",children:g.jsx($v,{className:"h-5 w-5"})})]}),g.jsx(nt,{variant:"ghost",size:"icon",onClick:r,title:"Compose",children:g.jsx(Ty,{className:"h-5 w-5"})})]}),g.jsx("div",{className:"flex-1 min-w-0"}),g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s&&(h||l)&&g.jsxs(g.Fragment,{children:[h?g.jsxs(Ic,{children:[g.jsx(Hc,{asChild:!0,children:g.jsx(nt,{variant:"ghost",size:"icon",onClick:()=>h("open_finder"),title:"Open in Finder",className:"border border-border/0",children:g.jsx(iR,{className:"h-4.5 w-4.5"})})}),g.jsx(Ya,{side:"bottom",shortcut:m})]}):null,l?g.jsxs(Ic,{children:[g.jsx(Hc,{asChild:!0,children:g.jsx(nt,{variant:"ghost",size:"icon",onClick:l,className:xe("border border-border/0",a&&"text-white"),children:g.jsx(My,{className:"h-4.5 w-4.5"})})}),g.jsx(Ya,{side:"bottom",shortcut:y})]}):null,h?g.jsxs(Ic,{children:[g.jsx(Hc,{asChild:!0,children:g.jsx(nt,{variant:"ghost",size:"icon",onClick:()=>h("open_editor"),title:`Open in ${p}`,className:"border border-border/0",children:g.jsx(rR,{className:"h-4.5 w-4.5"})})}),g.jsx(Ya,{side:"bottom",shortcut:_})]}):null]}),d?g.jsxs(Ic,{children:[g.jsx(Hc,{asChild:!0,children:g.jsx(nt,{variant:"ghost",size:"icon",onClick:d,className:xe("border border-border/0",u&&"text-white"),children:g.jsx(Zj,{className:"h-4.5 w-4.5"})})}),g.jsx(Ya,{side:"bottom",shortcut:S})]}):null]})]})})}function A7({onClose:e}){return g.jsx("div",{className:"h-full min-h-0 border-l border-border bg-background md:min-w-[300px]",children:g.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[g.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[g.jsx("div",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:"Diffs"}),g.jsx("button",{type:"button","aria-label":"Close right sidebar",onClick:e,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:g.jsx(vl,{className:"h-4 w-4"})})]}),g.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center",children:g.jsx("p",{className:"text-sm text-muted-foreground",children:"diffs coming soon"})})]})})}function N7(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function D7(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function O7(e){return e/100*window.innerHeight}function L7(e){return e/100*window.innerWidth}function z7(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function Uc({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,a]=z7(n);switch(a){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=D7(t,s);break}case"em":{r=N7(t,s);break}case"vh":{r=O7(s);break}case"vw":{r=L7(s);break}}return r}function ir(e){return parseFloat(e.toFixed(3))}function hl({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,s)=>(r+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,r),0)}function s_(e){const{panels:t}=e,n=hl({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:s,panelConstraints:a}=r;let l=0;if(a.collapsedSize!==void 0){const p=Uc({groupSize:n,panelElement:s,styleProp:a.collapsedSize});l=ir(p/n*100)}let u;if(a.defaultSize!==void 0){const p=Uc({groupSize:n,panelElement:s,styleProp:a.defaultSize});u=ir(p/n*100)}let d=0;if(a.minSize!==void 0){const p=Uc({groupSize:n,panelElement:s,styleProp:a.minSize});d=ir(p/n*100)}let h=100;if(a.maxSize!==void 0){const p=Uc({groupSize:n,panelElement:s,styleProp:a.maxSize});h=ir(p/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:l,collapsible:a.collapsible===!0,defaultSize:u,disabled:a.disabled,minSize:d,maxSize:h,panelId:r.id}})}function mt(e,t="Assertion error"){if(!e)throw Error(t)}function o_(e,t){return Array.from(t).sort(e==="horizontal"?j7:B7)}function j7(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function B7(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function kM(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function EM(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function P7({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,a=Number.MAX_VALUE;for(const l of t){const{x:u,y:d}=EM(r,l),h=e==="horizontal"?u:d;h<a&&(a=h,s=l)}return mt(s,"No rect found"),s}let md;function I7(){return md===void 0&&(typeof matchMedia=="function"?md=!!matchMedia("(pointer:coarse)").matches:md=!1),md}function RM(e){const{element:t,orientation:n,panels:r,separators:s}=e,a=o_(n,Array.from(t.children).filter(kM).map(S=>({element:S}))).map(({element:S})=>S),l=[];let u=!1,d=!1,h=-1,p=-1,m=0,_,y=[];{let S=-1;for(const w of a)w.hasAttribute("data-panel")&&(S++,w.ariaDisabled===null&&(m++,h===-1&&(h=S),p=S))}if(m>1){let S=-1;for(const w of a)if(w.hasAttribute("data-panel")){S++;const C=r.find(k=>k.element===w);if(C){if(_){const k=_.element.getBoundingClientRect(),T=w.getBoundingClientRect();let R;if(d){const M=n==="horizontal"?new DOMRect(k.right,k.top,0,k.height):new DOMRect(k.left,k.bottom,k.width,0),L=n==="horizontal"?new DOMRect(T.left,T.top,0,T.height):new DOMRect(T.left,T.top,T.width,0);switch(y.length){case 0:{R=[M,L];break}case 1:{const O=y[0],z=P7({orientation:n,rects:[k,T],targetRect:O.element.getBoundingClientRect()});R=[O,z===k?L:M];break}default:{R=y;break}}}else y.length?R=y:R=[n==="horizontal"?new DOMRect(k.right,T.top,T.left-k.right,T.height):new DOMRect(T.left,k.bottom,T.width,T.top-k.bottom)];for(const M of R){let L="width"in M?M:M.element.getBoundingClientRect();const O=I7()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<O){const H=O-L.width;L=new DOMRect(L.x-H/2,L.y,L.width+H,L.height)}if(L.height<O){const H=O-L.height;L=new DOMRect(L.x,L.y-H/2,L.width,L.height+H)}const z=S<=h||S>p;!u&&!z&&l.push({group:e,groupSize:hl({group:e}),panels:[_,C],separator:"width"in M?void 0:M,rect:L}),u=!1}}d=!1,_=C,y=[]}}else if(w.hasAttribute("data-separator")){w.ariaDisabled!==null&&(u=!0);const C=s.find(k=>k.element===w);C?y.push(C):(_=void 0,y=[])}else d=!0}return l}var Ws,Pk;let TM=(Pk=class{constructor(){$S(this,Ws,{})}addListener(t,n){const r=yc(this,Ws)[t];return r===void 0?yc(this,Ws)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=yc(this,Ws)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,a=null;const l=Array.from(r);for(let u=0;u<l.length;u++){const d=l[u];try{d.call(null,n)}catch(h){a===null&&(s=!0,a=h)}}if(s)throw a}}removeAllListeners(){WS(this,Ws,{})}removeListener(t,n){const r=yc(this,Ws)[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},Ws=new WeakMap,Pk),_i=new Map;const MM=new TM;function H7(e){_i=new Map(_i),_i.delete(e)}function vC(e,t){for(const[n]of _i)if(n.id===e)return n}function Ks(e,t){for(const[n,r]of _i)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Yo(){return _i}function fb(e,t){return MM.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function rs(e,t){const n=_i.get(e);_i=new Map(_i),_i.set(e,t),MM.emit("groupChange",{group:e,prev:n,next:t})}function F7(e,t,n){let r,s={x:1/0,y:1/0};for(const a of t){const l=EM(n,a.rect);switch(e){case"horizontal":{l.x<=s.x&&(r=a,s=l);break}case"vertical":{l.y<=s.y&&(r=a,s=l);break}}}return r?{distance:s,hitRegion:r}:void 0}function U7(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function $7(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:bC(e),b:bC(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();mt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:yC(_C(n.a)),b:yC(_C(n.b))};if(s.a===s.b){const a=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let u=a.length;for(;u--;){const d=a[u];if(d===l.a)return 1;if(d===l.b)return-1}}return Math.sign(s.a-s.b)}const W7=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function q7(e){const t=getComputedStyle(AM(e)??e).display;return t==="flex"||t==="inline-flex"}function V7(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||q7(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||W7.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function _C(e){let t=e.length;for(;t--;){const n=e[t];if(mt(n,"Missing node"),V7(n))return n}return null}function yC(e){return e&&Number(getComputedStyle(e).zIndex)||0}function bC(e){const t=[];for(;e;)t.push(e),e=AM(e);return t}function AM(e){const{parentNode:t}=e;return U7(t)?t.host:t}function K7(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function G7({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!kM(n)||n.contains(e)||e.contains(n))return!0;if($7(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(K7(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function pb(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const a=RM(s),l=F7(s.orientation,a,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&G7({groupElement:s.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function Y7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function In(e,t,n=0){return Math.abs(ir(e)-ir(t))<=n}function mi(e,t){return In(e,t)?0:e>t?1:-1}function Xa({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:a,disabled:l,maxSize:u=100,minSize:d=0}=t;if(l&&!e)return n;if(mi(r,d)<0)if(a){const h=(s+d)/2;mi(r,h)<0?r=s:r=d}else r=d;return r=Math.min(u,r),r=ir(r),r}function pu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:a}){if(In(e,0))return t;const l=a==="imperative-api",u=Object.values(t),d=Object.values(s),h=[...u],[p,m]=r;mt(p!=null,"Invalid first pivot index"),mt(m!=null,"Invalid second pivot index");let _=0;switch(a){case"keyboard":{{const w=e<0?m:p,C=n[w];mt(C,`Panel constraints not found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const M=u[w];if(mt(M!=null,`Previous layout not found for panel index ${w}`),In(M,k)){const L=R-M;mi(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const w=e<0?p:m,C=n[w];mt(C,`No panel constraints found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const M=u[w];if(mt(M!=null,`Previous layout not found for panel index ${w}`),In(M,R)){const L=M-k;mi(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const w=e<0?m:p,C=n[w];mt(C,`Panel constraints not found for index ${w}`);const k=u[w],{collapsible:T,collapsedSize:R,minSize:M}=C;if(T&&mi(k,M)<0)if(e>0){const L=M-R,O=L/2,z=k+e;mi(z,M)<0&&(e=mi(e,O)<=0?0:L)}else{const L=M-R,O=100-L/2,z=k-e;mi(z,M)<0&&(e=mi(100+e,O)>0?0:-L)}break}}{const w=e<0?1:-1;let C=e<0?m:p,k=0;for(;;){const R=u[C];mt(R!=null,`Previous layout not found for panel index ${C}`);const M=Xa({overrideDisabledPanels:l,panelConstraints:n[C],prevSize:R,size:100})-R;if(k+=M,C+=w,C<0||C>=n.length)break}const T=Math.min(Math.abs(e),Math.abs(k));e=e<0?0-T:T}{let w=e<0?p:m;for(;w>=0&&w<n.length;){const C=Math.abs(e)-Math.abs(_),k=u[w];mt(k!=null,`Previous layout not found for panel index ${w}`);const T=k-C,R=Xa({overrideDisabledPanels:l,panelConstraints:n[w],prevSize:k,size:T});if(!In(k,R)&&(_+=k-R,h[w]=R,_.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?w--:w++}}if(Y7(d,h))return s;{const w=e<0?m:p,C=u[w];mt(C!=null,`Previous layout not found for panel index ${w}`);const k=C+_,T=Xa({overrideDisabledPanels:l,panelConstraints:n[w],prevSize:C,size:k});if(h[w]=T,!In(T,k)){let R=k-T,M=e<0?m:p;for(;M>=0&&M<n.length;){const L=h[M];mt(L!=null,`Previous layout not found for panel index ${M}`);const O=L+R,z=Xa({overrideDisabledPanels:l,panelConstraints:n[M],prevSize:L,size:O});if(In(L,z)||(R-=z-L,h[M]=z),In(R,0))break;e>0?M--:M++}}}const y=Object.values(h).reduce((w,C)=>C+w,0);if(!In(y,100,.1))return s;const S=Object.keys(s);return h.reduce((w,C,k)=>(w[S[k]]=C,w),{})}function Ho(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||mi(e[n],t[n])!==0)return!1;return!0}function Fo({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((u,d)=>u+d,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!In(s,100)&&r.length>0)for(let u=0;u<t.length;u++){const d=r[u];mt(d!=null,`No layout data found for index ${u}`);const h=100/s*d;r[u]=h}let a=0;for(let u=0;u<t.length;u++){const d=n[u];mt(d!=null,`No layout data found for index ${u}`);const h=r[u];mt(h!=null,`No layout data found for index ${u}`);const p=Xa({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:d,size:h});h!=p&&(a+=h-p,r[u]=p)}if(!In(a,0))for(let u=0;u<t.length;u++){const d=r[u];mt(d!=null,`No layout data found for index ${u}`);const h=d+a,p=Xa({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:d,size:h});if(d!==p&&(a-=p-d,r[u]=p,In(a,0)))break}const l=Object.keys(e);return r.reduce((u,d,h)=>(u[l[h]]=d,u),{})}function NM({groupId:e,panelId:t}){const n=()=>{const u=Yo();for(const[d,{defaultLayoutDeferred:h,derivedPanelConstraints:p,layout:m,groupSize:_,separatorToPanels:y}]of u)if(d.id===e)return{defaultLayoutDeferred:h,derivedPanelConstraints:p,group:d,groupSize:_,layout:m,separatorToPanels:y};throw Error(`Group ${e} not found`)},r=()=>{const u=n().derivedPanelConstraints.find(d=>d.panelId===t);if(u!==void 0)return u;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const u=n().group.panels.find(d=>d.id===t);if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const u=n().layout[t];if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},l=u=>{const d=a();if(u===d)return;const{defaultLayoutDeferred:h,derivedPanelConstraints:p,group:m,groupSize:_,layout:y,separatorToPanels:S}=n(),w=m.panels.findIndex(R=>R.id===t),C=w===m.panels.length-1,k=pu({delta:C?d-u:u-d,initialLayout:y,panelConstraints:p,pivotIndices:C?[w-1,w]:[w,w+1],prevLayout:y,trigger:"imperative-api"}),T=Fo({layout:k,panelConstraints:p});Ho(y,T)||rs(m,{defaultLayoutDeferred:h,derivedPanelConstraints:p,groupSize:_,layout:T,separatorToPanels:S})};return{collapse:()=>{const{collapsible:u,collapsedSize:d}=r(),{mutableValues:h}=s(),p=a();u&&p!==d&&(h.expandToSize=p,l(d))},expand:()=>{const{collapsible:u,collapsedSize:d,minSize:h}=r(),{mutableValues:p}=s(),m=a();if(u&&m===d){let _=p.expandToSize??h;_===0&&(_=1),l(_)}},getSize:()=>{const{group:u}=n(),d=a(),{element:h}=s(),p=u.orientation==="horizontal"?h.offsetWidth:h.offsetHeight;return{asPercentage:d,inPixels:p}},isCollapsed:()=>{const{collapsible:u,collapsedSize:d}=r(),h=a();return u&&In(d,h)},resize:u=>{const{group:d}=n(),{element:h}=s(),p=hl({group:d}),m=Uc({groupSize:p,panelElement:h,styleProp:u}),_=ir(m/p*100);l(_)}}}function xC(e){if(e.defaultPrevented)return;const t=Yo();pb(e,t).forEach(n=>{if(n.separator){const r=n.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(r){const s=r.panelConstraints.defaultSize,a=NM({groupId:n.group.id,panelId:r.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function Pd(e){const t=Yo();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function DM({groupId:e}){const t=()=>{const n=Yo();for(const[r,s]of n)if(r.id===e)return{group:r,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:s,group:a,groupSize:l,layout:u,separatorToPanels:d}=t(),h=Fo({layout:n,panelConstraints:s});return r?u:(Ho(u,h)||rs(a,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:l,layout:h,separatorToPanels:d}),h)}}}function Eo(e,t){const n=Pd(e),r=Ks(n.id,!0),s=n.separators.find(p=>p.element===e);mt(s,"Matching separator not found");const a=r.separatorToPanels.get(s);mt(a,"Matching panels not found");const l=a.map(p=>n.panels.indexOf(p)),u=DM({groupId:n.id}).getLayout(),d=pu({delta:t,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:l,prevLayout:u,trigger:"keyboard"}),h=Fo({layout:d,panelConstraints:r.derivedPanelConstraints});Ho(u,h)||rs(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:h,separatorToPanels:r.separatorToPanels})}function SC(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Pd(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Eo(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Eo(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Eo(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Eo(t,-5);break}case"End":{e.preventDefault(),Eo(t,100);break}case"Enter":{e.preventDefault();const r=Pd(t),s=Ks(r.id,!0),{derivedPanelConstraints:a,layout:l,separatorToPanels:u}=s,d=r.separators.find(_=>_.element===t);mt(d,"Matching separator not found");const h=u.get(d);mt(h,"Matching panels not found");const p=h[0],m=a.find(_=>_.panelId===p.id);if(mt(m,"Panel metadata not found"),m.collapsible){const _=l[p.id],y=m.collapsedSize===_?r.mutableState.expandedPanelSizes[p.id]??m.minSize:m.collapsedSize;Eo(t,y-_)}break}case"F6":{e.preventDefault();const r=Pd(t).separators.map(l=>l.element),s=Array.from(r).findIndex(l=>l===e.currentTarget);mt(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Eo(t,-100);break}}}let il={cursorFlags:0,state:"inactive"};const mb=new TM;function Uo(){return il}function X7(e){return mb.addListener("change",e)}function Z7(e){const t=il,n={...il};n.cursorFlags=e,il=n,mb.emit("change",{prev:t,next:n})}function sl(e){const t=il;il=e,mb.emit("change",{prev:t,next:e})}function wC(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Yo(),n=pb(e,t),r=new Map;let s=!1;n.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const l=t.get(a.group);l&&r.set(a.group,l.layout)}),sl({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const Q7=e=>e,Qg=()=>{},OM=1,LM=2,zM=4,jM=8,CC=3,kC=12;let gd;function EC(){return gd===void 0&&(gd=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(gd=!0)),gd}function J7({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&EC()){const a=(e&OM)!==0,l=(e&LM)!==0,u=(e&zM)!==0,d=(e&jM)!==0;if(a)return u?"se-resize":d?"ne-resize":"e-resize";if(l)return u?"sw-resize":d?"nw-resize":"w-resize";if(u)return"s-resize";if(d)return"n-resize"}break}}return EC()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const RC=new WeakMap;function gb(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=RC.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=Uo();switch(r.state){case"active":case"hover":{const s=J7({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(l=>l.group),state:r.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}RC.set(e,{prevStyle:t,styleSheet:n})}function BM({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:l}){let u=0;n.forEach(h=>{const{group:p,groupSize:m}=h,{orientation:_,panels:y}=p,{disableCursor:S}=p.mutableState;let w=0;a?_==="horizontal"?w=(t.clientX-a.x)/m*100:w=(t.clientY-a.y)/m*100:_==="horizontal"?w=t.clientX<0?-100:100:w=t.clientY<0?-100:100;const C=r.get(p),k=s.get(p);if(!C||!k)return;const{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:M,layout:L,separatorToPanels:O}=k;if(R&&L&&O){const z=pu({delta:w,initialLayout:C,panelConstraints:R,pivotIndices:h.panels.map(H=>y.indexOf(H)),prevLayout:L,trigger:"mouse-or-touch"});if(Ho(z,L)){if(w!==0&&!S)switch(_){case"horizontal":{u|=w<0?OM:LM;break}case"vertical":{u|=w<0?zM:jM;break}}}else rs(h.group,{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:M,layout:z,separatorToPanels:O})}});let d=0;t.movementX===0?d|=l&CC:d|=u&CC,t.movementY===0?d|=l&kC:d|=u&kC,Z7(d),gb(e)}function TC(e){const t=Yo(),n=Uo();switch(n.state){case"active":BM({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function MC(e){if(e.defaultPrevented)return;const t=Uo(),n=Yo();switch(t.state){case"active":{if(e.buttons===0){sl({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=Ks(r.group.id,!0);rs(r.group,s)});return}BM({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=pb(e,n);r.length===0?t.state!=="inactive"&&sl({cursorFlags:0,state:"inactive"}):sl({cursorFlags:0,hitRegions:r,state:"hover"}),gb(e.currentTarget);break}}}function AC(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Uo().state){case"hover":sl({cursorFlags:0,state:"inactive"})}}function NC(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Uo();switch(t.state){case"active":sl({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(gb(e.currentTarget),t.hitRegions.forEach(n=>{const r=Ks(n.group.id,!0);rs(n.group,r)}),e.preventDefault())}}function DC(e){let t=0,n=0;const r={};for(const a of e)if(a.defaultSize!==void 0){t++;const l=ir(a.defaultSize);n+=l,r[a.panelId]=l}else r[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=ir((100-n)/s);for(const l of e)l.defaultSize===void 0&&(r[l.panelId]=a)}return r}function eH(e,t,n){if(!n[0])return;const r=e.panels.find(d=>d.element===t);if(!r||!r.onResize)return;const s=hl({group:e}),a=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,l=r.mutableValues.prevSize,u={asPercentage:ir(a/s*100),inPixels:a};r.mutableValues.prevSize=u,r.onResize(u,r.id,l)}function tH(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function nH({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,a=0,l=!1;const u=new Map,d=[];for(const m of e.panels){const _=r[m.id]??0;switch(m.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{l=!0;const y=_/100*n,S=ir(y/t*100);u.set(m.id,S),s+=S;break}case"preserve-relative-size":default:{d.push(m.id),a+=_;break}}}if(!l||d.length===0)return r;const h=100-s,p={...r};if(u.forEach((m,_)=>{p[_]=m}),a>0)for(const m of d){const _=r[m]??0;p[m]=ir(_/a*h)}else{const m=ir(h/d.length);for(const _ of d)p[_]=m}return p}function rH(e,t){const n=e.map(s=>s.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!r.includes(s))return!1;return!0}const Ua=new Map;function iH(e){let t=!0;mt(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,a=new n(S=>{for(const w of S){const{borderBoxSize:C,target:k}=w;if(k===e.element){if(t){const T=hl({group:e});if(T===0)return;const R=Ks(e.id);if(!R)return;const M=s_(e),L=R.defaultLayoutDeferred?DC(M):R.layout,O=nH({group:e,nextGroupSize:T,prevGroupSize:R.groupSize,prevLayout:L}),z=Fo({layout:O,panelConstraints:M});if(!R.defaultLayoutDeferred&&Ho(R.layout,z)&&tH(R.derivedPanelConstraints,M)&&R.groupSize===T)return;rs(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:M,groupSize:T,layout:z,separatorToPanels:R.separatorToPanels})}}else eH(e,k,C)}});a.observe(e.element),e.panels.forEach(S=>{mt(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&a.observe(S.element)});const l=hl({group:e}),u=s_(e),d=e.panels.map(({id:S})=>S).join(",");let h=e.mutableState.defaultLayout;h&&(rH(e.panels,h)||(h=void 0));const p=e.mutableState.layouts[d]??h??DC(u),m=Fo({layout:p,panelConstraints:u}),_=e.element.ownerDocument;Ua.set(_,(Ua.get(_)??0)+1);const y=new Map;return RM(e).forEach(S=>{S.separator&&y.set(S.separator,S.panels)}),rs(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:u,groupSize:l,layout:m,separatorToPanels:y}),e.separators.forEach(S=>{mt(!s.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),s.add(S.id),S.element.addEventListener("keydown",SC)}),Ua.get(_)===1&&(_.addEventListener("dblclick",xC,!0),_.addEventListener("pointerdown",wC,!0),_.addEventListener("pointerleave",TC),_.addEventListener("pointermove",MC),_.addEventListener("pointerout",AC),_.addEventListener("pointerup",NC,!0)),function(){t=!1,Ua.set(_,Math.max(0,(Ua.get(_)??0)-1)),H7(e),e.separators.forEach(S=>{S.element.removeEventListener("keydown",SC)}),Ua.get(_)||(_.removeEventListener("dblclick",xC,!0),_.removeEventListener("pointerdown",wC,!0),_.removeEventListener("pointerleave",TC),_.removeEventListener("pointermove",MC),_.removeEventListener("pointerout",AC),_.removeEventListener("pointerup",NC,!0)),a.disconnect()}}function sH(){const[e,t]=x.useState({}),n=x.useCallback(()=>t({}),[]);return[e,n]}function vb(e){const t=x.useId();return`${e??t}`}const Xo=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Qc(e){const t=x.useRef(e);return Xo(()=>{t.current=e},[e]),x.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function _b(...e){return Qc(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function yb(e){const t=x.useRef({...e});return Xo(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const PM=x.createContext(null);function oH(e,t){const n=x.useRef({getLayout:()=>({}),setLayout:Q7});x.useImperativeHandle(t,()=>n.current,[]),Xo(()=>{Object.assign(n.current,DM({groupId:e}))})}function IM({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:a,groupRef:l,id:u,onLayoutChange:d,onLayoutChanged:h,orientation:p="horizontal",resizeTargetMinimumSize:m={coarse:20,fine:10},style:_,...y}){const S=x.useRef({onLayoutChange:{},onLayoutChanged:{}}),w=Qc($=>{Ho(S.current.onLayoutChange,$)||(S.current.onLayoutChange=$,d==null||d($))}),C=Qc($=>{Ho(S.current.onLayoutChanged,$)||(S.current.onLayoutChanged=$,h==null||h($))}),k=vb(u),T=x.useRef(null),[R,M]=sH(),L=x.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:m,separators:[]}),O=_b(T,a);oH(k,l);const z=Qc(($,I)=>{const U=Uo(),V=vC($),F=Ks($);if(F){let j=!1;switch(U.state){case"active":{j=U.hitRegions.some(Y=>Y.group===V);break}}return{flexGrow:F.layout[I]??1,pointerEvents:j?"none":void 0}}return{flexGrow:(n==null?void 0:n[I])??1}}),H=yb({defaultLayout:n,disableCursor:r}),G=x.useMemo(()=>({get disableCursor(){return!!H.disableCursor},getPanelStyles:z,id:k,orientation:p,registerPanel:$=>{const I=L.current;return I.panels=o_(p,[...I.panels,$]),M(),()=>{I.panels=I.panels.filter(U=>U!==$),M()}},registerSeparator:$=>{const I=L.current;return I.separators=o_(p,[...I.separators,$]),M(),()=>{I.separators=I.separators.filter(U=>U!==$),M()}},togglePanelDisabled:($,I)=>{const U=L.current.panels.find(j=>j.id===$);U&&(U.panelConstraints.disabled=I);const V=vC(k),F=Ks(k);V&&F&&rs(V,{...F,derivedPanelConstraints:s_(V)})},toggleSeparatorDisabled:($,I)=>{const U=L.current.separators.find(V=>V.id===$);U&&(U.disabled=I)}}),[z,k,M,p,H]),B=x.useRef(null);return Xo(()=>{const $=T.current;if($===null)return;const I=L.current;let U;if(H.defaultLayout!==void 0&&Object.keys(H.defaultLayout).length===I.panels.length){U={};for(const A of I.panels){const P=H.defaultLayout[A.id];P!==void 0&&(U[A.id]=P)}}const V={disabled:!!s,element:$,id:k,mutableState:{defaultLayout:U,disableCursor:!!H.disableCursor,expandedPanelSizes:L.current.lastExpandedPanelSizes,layouts:L.current.layouts},orientation:p,panels:I.panels,resizeTargetMinimumSize:I.resizeTargetMinimumSize,separators:I.separators};B.current=V;const F=iH(V),{defaultLayoutDeferred:j,derivedPanelConstraints:Y,layout:W}=Ks(V.id,!0);!j&&Y.length>0&&(w(W),C(W));const Q=fb(k,A=>{const{defaultLayoutDeferred:P,derivedPanelConstraints:Z,layout:D}=A.next;if(P||Z.length===0)return;const K=V.panels.map(({id:ie})=>ie).join(",");V.mutableState.layouts[K]=D,Z.forEach(ie=>{if(ie.collapsible){const{layout:ge}=A.prev??{};if(ge){const Te=In(ie.collapsedSize,D[ie.panelId]),ve=In(ie.collapsedSize,ge[ie.panelId]);Te&&!ve&&(V.mutableState.expandedPanelSizes[ie.panelId]=ge[ie.panelId])}}});const ee=Uo().state!=="active";w(D),ee&&C(D)});return()=>{B.current=null,F(),Q()}},[s,k,C,w,p,R,H]),x.useEffect(()=>{const $=B.current;$&&($.mutableState.defaultLayout=n,$.mutableState.disableCursor=!!r)}),g.jsx(PM.Provider,{value:G,children:g.jsx("div",{...y,className:t,"data-group":!0,"data-testid":k,id:k,ref:O,style:{height:"100%",width:"100%",overflow:"hidden",..._,display:"flex",flexDirection:p==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:p==="horizontal"?"pan-y":"pan-x"},children:e})})}IM.displayName="Group";function bb(){const e=x.useContext(PM);return mt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function aH(e,t){const{id:n}=bb(),r=x.useRef({collapse:Qg,expand:Qg,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Qg});x.useImperativeHandle(t,()=>r.current,[]),Xo(()=>{Object.assign(r.current,NM({groupId:n,panelId:e}))})}function HM({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:a,elementRef:l,groupResizeBehavior:u="preserve-relative-size",id:d,maxSize:h="100%",minSize:p="0%",onResize:m,panelRef:_,style:y,...S}){const w=!!d,C=vb(d),k=yb({disabled:a}),T=x.useRef(null),R=_b(T,l),{getPanelStyles:M,id:L,orientation:O,registerPanel:z,togglePanelDisabled:H}=bb(),G=m!==null,B=Qc((I,U,V)=>{m==null||m(I,d,V)});Xo(()=>{const I=T.current;if(I!==null){const U={element:I,id:C,idIsStable:w,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:G?B:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:s,disabled:k.disabled,maxSize:h,minSize:p}};return z(U)}},[u,n,r,s,G,C,w,h,p,B,z,k]),x.useEffect(()=>{H(C,!!a)},[a,C,H]),aH(C,_);const $=x.useSyncExternalStore(I=>fb(L,I),()=>JSON.stringify(M(L,C)),()=>JSON.stringify(M(L,C)));return g.jsx("div",{...S,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":C,id:C,ref:R,style:{...lH,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse($)},children:g.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:O==="horizontal"?"pan-y":"pan-x"},children:e})})}HM.displayName="Panel";const lH={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function cH({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,a;const l=e[n],u=t.find(d=>d.panelId===n);if(u){const d=u.maxSize,h=u.collapsible?u.collapsedSize:u.minSize,p=[r,r+1];a=Fo({layout:pu({delta:h-l,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n],s=Fo({layout:pu({delta:d-l,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:a,valueNow:l}}function FM({children:e,className:t,disabled:n,elementRef:r,id:s,style:a,...l}){const u=vb(s),d=yb({disabled:n}),[h,p]=x.useState({}),[m,_]=x.useState("inactive"),y=x.useRef(null),S=_b(y,r),{disableCursor:w,id:C,orientation:k,registerSeparator:T,toggleSeparatorDisabled:R}=bb(),M=k==="horizontal"?"vertical":"horizontal";Xo(()=>{const O=y.current;if(O!==null){const z={disabled:d.disabled,element:O,id:u},H=T(z),G=X7($=>{_($.next.state!=="inactive"&&$.next.hitRegions.some(I=>I.separator===z)?$.next.state:"inactive")}),B=fb(C,$=>{const{derivedPanelConstraints:I,layout:U,separatorToPanels:V}=$.next,F=V.get(z);if(F){const j=F[0],Y=F.indexOf(j);p(cH({layout:U,panelConstraints:I,panelId:j.id,panelIndex:Y}))}});return()=>{G(),B(),H()}}},[C,u,T,d]),x.useEffect(()=>{R(u,!!n)},[n,u,R]);let L;return n&&!w&&(L="not-allowed"),g.jsx("div",{...l,"aria-controls":h.valueControls,"aria-disabled":n||void 0,"aria-orientation":M,"aria-valuemax":h.valueMax,"aria-valuemin":h.valueMin,"aria-valuenow":h.valueNow,children:e,className:t,"data-separator":n?"disabled":m,"data-testid":u,id:u,ref:S,role:"separator",style:{flexBasis:"auto",cursor:L,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}FM.displayName="Separator";const Id=({className:e,...t})=>g.jsx(IM,{className:xe("flex h-full w-full",e),...t}),Ao=e=>g.jsx(HM,{...e}),Hd=({withHandle:e,orientation:t,disabled:n,className:r,...s})=>g.jsx(FM,{disabled:n,className:xe("relative flex items-center justify-center bg-transparent focus-visible:outline-none",t==="vertical"?"h-2 w-full -my-1 cursor-row-resize before:absolute before:inset-x-0 before:top-1/2 before:h-0.5 before:-translate-y-1/2 before:bg-border":"h-full w-2 -mx-1 cursor-col-resize before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-border",r),...s,children:g.jsx("span",{className:"sr-only",children:t==="vertical"?"Resize rows":"Resize columns"})});/**
|
|
424
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
425
|
+
* @license MIT
|
|
426
|
+
*
|
|
427
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
428
|
+
* @license MIT
|
|
429
|
+
*
|
|
430
|
+
* Originally forked from (with the author's permission):
|
|
431
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
432
|
+
* http://bellard.org/jslinux/
|
|
433
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
434
|
+
*/var dn=0,fn=0,pn=0,Ot=0,An;(e=>{function t(s,a,l,u){return u!==void 0?`#${Ro(s)}${Ro(a)}${Ro(l)}${Ro(u)}`:`#${Ro(s)}${Ro(a)}${Ro(l)}`}e.toCss=t;function n(s,a,l,u=255){return(s<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,a,l,u){return{css:e.toCss(s,a,l,u),rgba:e.toRgba(s,a,l,u)}}e.toColor=r})(An||(An={}));var uH;(e=>{function t(d,h){if(Ot=(h.rgba&255)/255,Ot===1)return{css:h.css,rgba:h.rgba};let p=h.rgba>>24&255,m=h.rgba>>16&255,_=h.rgba>>8&255,y=d.rgba>>24&255,S=d.rgba>>16&255,w=d.rgba>>8&255;dn=y+Math.round((p-y)*Ot),fn=S+Math.round((m-S)*Ot),pn=w+Math.round((_-w)*Ot);let C=An.toCss(dn,fn,pn),k=An.toRgba(dn,fn,pn);return{css:C,rgba:k}}e.blend=t;function n(d){return(d.rgba&255)===255}e.isOpaque=n;function r(d,h,p){let m=Fd.ensureContrastRatio(d.rgba,h.rgba,p);if(m)return An.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=r;function s(d){let h=(d.rgba|255)>>>0;return[dn,fn,pn]=Fd.toChannels(h),{css:An.toCss(dn,fn,pn),rgba:h}}e.opaque=s;function a(d,h){return Ot=Math.round(h*255),[dn,fn,pn]=Fd.toChannels(d.rgba),{css:An.toCss(dn,fn,pn,Ot),rgba:An.toRgba(dn,fn,pn,Ot)}}e.opacity=a;function l(d,h){return Ot=d.rgba&255,a(d,Ot*h/255)}e.multiplyOpacity=l;function u(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}e.toColorRGB=u})(uH||(uH={}));var Cn;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return dn=parseInt(s.slice(1,2).repeat(2),16),fn=parseInt(s.slice(2,3).repeat(2),16),pn=parseInt(s.slice(3,4).repeat(2),16),An.toColor(dn,fn,pn);case 5:return dn=parseInt(s.slice(1,2).repeat(2),16),fn=parseInt(s.slice(2,3).repeat(2),16),pn=parseInt(s.slice(3,4).repeat(2),16),Ot=parseInt(s.slice(4,5).repeat(2),16),An.toColor(dn,fn,pn,Ot);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return dn=parseInt(a[1]),fn=parseInt(a[2]),pn=parseInt(a[3]),Ot=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),An.toColor(dn,fn,pn,Ot);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[dn,fn,pn,Ot]=t.getImageData(0,0,1,1).data,Ot!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:An.toRgba(dn,fn,pn,Ot),css:s}}e.toColor=r})(Cn||(Cn={}));var jn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,a){let l=r/255,u=s/255,d=a/255,h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),m=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return h*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(jn||(jn={}));var Fd;(e=>{function t(l,u){if(Ot=(u&255)/255,Ot===1)return u;let d=u>>24&255,h=u>>16&255,p=u>>8&255,m=l>>24&255,_=l>>16&255,y=l>>8&255;return dn=m+Math.round((d-m)*Ot),fn=_+Math.round((h-_)*Ot),pn=y+Math.round((p-y)*Ot),An.toRgba(dn,fn,pn)}e.blend=t;function n(l,u,d){let h=jn.relativeLuminance(l>>8),p=jn.relativeLuminance(u>>8);if(Yi(h,p)<d){if(p<h){let y=r(l,u,d),S=Yi(h,jn.relativeLuminance(y>>8));if(S<d){let w=s(l,u,d),C=Yi(h,jn.relativeLuminance(w>>8));return S>C?y:w}return y}let m=s(l,u,d),_=Yi(h,jn.relativeLuminance(m>>8));if(_<d){let y=r(l,u,d),S=Yi(h,jn.relativeLuminance(y>>8));return _>S?m:y}return m}}e.ensureContrastRatio=n;function r(l,u,d){let h=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=Yi(jn.relativeLuminance2(_,y,S),jn.relativeLuminance2(h,p,m));for(;w<d&&(_>0||y>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=Yi(jn.relativeLuminance2(_,y,S),jn.relativeLuminance2(h,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,d){let h=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=Yi(jn.relativeLuminance2(_,y,S),jn.relativeLuminance2(h,p,m));for(;w<d&&(_<255||y<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=Yi(jn.relativeLuminance2(_,y,S),jn.relativeLuminance2(h,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(Fd||(Fd={}));function Ro(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Yi(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var hH=Object.freeze((()=>{let e=[Cn.toColor("#2e3436"),Cn.toColor("#cc0000"),Cn.toColor("#4e9a06"),Cn.toColor("#c4a000"),Cn.toColor("#3465a4"),Cn.toColor("#75507b"),Cn.toColor("#06989a"),Cn.toColor("#d3d7cf"),Cn.toColor("#555753"),Cn.toColor("#ef2929"),Cn.toColor("#8ae234"),Cn.toColor("#fce94f"),Cn.toColor("#729fcf"),Cn.toColor("#ad7fa8"),Cn.toColor("#34e2e2"),Cn.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],a=t[n%6];e.push({css:An.toCss(r,s,a),rgba:An.toRgba(r,s,a)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:An.toCss(r,r,r),rgba:An.toRgba(r,r,r)})}return e})());function OC(e,t,n){return Math.max(t,Math.min(e,n))}function dH(e){switch(e){case"&":return"&";case"<":return"<"}return e}var UM=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),a=r,l=t.start.y,u=t.end.y,d=t.start.x,h=t.end.x;this._beforeSerialize(u-l,l,u);for(let p=l;p<=u;p++){let m=this._buffer.getLine(p);if(m){let _=p===t.start.y?d:0,y=p===t.end.y?h:m.length;for(let S=_;S<y;S++){let w=m.getCell(S,a===r?s:r);if(!w){console.warn(`Can't get cell at row=${p}, col=${S}`);continue}this._nextCell(w,a,p,S),a=w}}this._rowEnd(p,p===u)}return this._afterSerialize(),this._serializeString(n)}_nextCell(t,n,r,s){}_rowEnd(t,n){}_beforeSerialize(t,n,r){}_afterSerialize(){}_serializeString(t){return""}};function $M(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function Zi(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function WM(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var fH=class extends UM{constructor(t,n){super(t),this._terminal=n,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,n,r){this._allRows=new Array(t),this._lastContentCursorRow=n,this._lastCursorRow=n,this._firstRow=n}_rowEnd(t,n){var s;this._nullCellCount>0&&!Zi(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!n){t-this._firstRow>=this._terminal.rows&&((s=this._buffer.getLine(this._cursorStyleRow))==null||s.getCell(this._cursorStyleCol,this._backgroundCell));let a=this._buffer.getLine(t),l=this._buffer.getLine(t+1);if(!l.isWrapped)r=`\r
|
|
435
|
+
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{r="";let u=a.getCell(a.length-1,this._thisRowLastChar),d=a.getCell(a.length-2,this._thisRowLastSecondChar),h=l.getCell(0,this._nextRowFirstChar),p=h.getWidth()>1,m=!1;(h.getChars()&&p?this._nullCellCount<=1:this._nullCellCount<=0)&&((u.getChars()||u.getWidth()===0)&&Zi(u,h)&&(m=!0),p&&(d.getChars()||d.getWidth()===0)&&Zi(u,h)&&Zi(d,h)&&(m=!0)),m||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${a.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${a.length-this._nullCellCount}D`,r+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=r,this._currentRow="",this._nullCellCount=0}_diffStyle(t,n){let r=[],s=!$M(t,n),a=!Zi(t,n),l=!WM(t,n);if(s||a||l)if(t.isAttributeDefault())n.isAttributeDefault()||r.push(0);else{if(s){let u=t.getFgColor();t.isFgRGB()?r.push(38,2,u>>>16&255,u>>>8&255,u&255):t.isFgPalette()?u>=16?r.push(38,5,u):r.push(u&8?90+(u&7):30+(u&7)):r.push(39)}if(a){let u=t.getBgColor();t.isBgRGB()?r.push(48,2,u>>>16&255,u>>>8&255,u&255):t.isBgPalette()?u>=16?r.push(48,5,u):r.push(u&8?100+(u&7):40+(u&7)):r.push(49)}l&&(t.isInverse()!==n.isInverse()&&r.push(t.isInverse()?7:27),t.isBold()!==n.isBold()&&r.push(t.isBold()?1:22),t.isUnderline()!==n.isUnderline()&&r.push(t.isUnderline()?4:24),t.isOverline()!==n.isOverline()&&r.push(t.isOverline()?53:55),t.isBlink()!==n.isBlink()&&r.push(t.isBlink()?5:25),t.isInvisible()!==n.isInvisible()&&r.push(t.isInvisible()?8:28),t.isItalic()!==n.isItalic()&&r.push(t.isItalic()?3:23),t.isDim()!==n.isDim()&&r.push(t.isDim()?2:22),t.isStrikethrough()!==n.isStrikethrough()&&r.push(t.isStrikethrough()?9:29))}return r}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let a=t.getChars()==="",l=this._diffStyle(t,this._cursorStyle);if(a?!Zi(this._cursorStyle,t):l.length>0){this._nullCellCount>0&&(Zi(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s,this._currentRow+=`\x1B[${l.join(";")}m`;let u=this._buffer.getLine(r);u!==void 0&&(u.getCell(s,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=s)}a?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(Zi(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s+t.getWidth())}_serializeString(t){let n=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(n=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let r="";for(let l=0;l<n;l++)r+=this._allRows[l],l+1<n&&(r+=this._allRowSeparators[l]);if(!t){let l=this._buffer.baseY+this._buffer.cursorY,u=this._buffer.cursorX,d=l!==this._lastCursorRow||u!==this._lastCursorCol,h=p=>{p>0?r+=`\x1B[${p}C`:p<0&&(r+=`\x1B[${-p}D`)};d&&((p=>{p>0?r+=`\x1B[${p}B`:p<0&&(r+=`\x1B[${-p}A`)})(l-this._lastCursorRow),h(u-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,a=this._diffStyle(s,this._cursorStyle);return a.length>0&&(r+=`\x1B[${a.join(";")}m`),r}},pH=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let s=n.length,a=r===void 0?s:OC(r+t.rows,0,s);return this._serializeBufferByRange(t,n,{start:s-a,end:s-1},!1)}_serializeBufferByRange(t,n,r,s){return new fH(n,t).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:t.cols,y:typeof r.end=="number"?r.end:r.end.line}},s)}_serializeBufferAsHTML(t,n){var d;let r=t.buffer.active,s=new mH(r,t,n),a=n.onlySelection??!1,l=n.range;if(l)return s.serialize({start:{x:l.startCol,y:(l.startLine,l.startLine)},end:{x:t.cols,y:(l.endLine,l.endLine)}});if(!a){let h=r.length,p=n.scrollback,m=p===void 0?h:OC(p+t.rows,0,h);return s.serialize({start:{x:0,y:h-m},end:{x:t.cols,y:h-1}})}let u=(d=this._terminal)==null?void 0:d.getSelectionPosition();return u!==void 0?s.serialize({start:{x:u.start.x,y:u.start.y},end:{x:u.end.x,y:u.end.y}}):""}_serializeModes(t){let n="",r=t.modes;if(r.applicationCursorKeysMode&&(n+="\x1B[?1h"),r.applicationKeypadMode&&(n+="\x1B[?66h"),r.bracketedPasteMode&&(n+="\x1B[?2004h"),r.insertMode&&(n+="\x1B[4h"),r.originMode&&(n+="\x1B[?6h"),r.reverseWraparoundMode&&(n+="\x1B[?45h"),r.sendFocusMode&&(n+="\x1B[?1004h"),r.wraparoundMode===!1&&(n+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":n+="\x1B[?9h";break;case"vt200":n+="\x1B[?1000h";break;case"drag":n+="\x1B[?1002h";break;case"any":n+="\x1B[?1003h";break}return n}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let n=t!=null&&t.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t==null?void 0:t.scrollback);if(!(t!=null&&t.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);n+=`\x1B[?1049h\x1B[H${r}`}return t!=null&&t.excludeModes||(n+=this._serializeModes(this._terminal)),n}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},mH=class extends UM{constructor(t,n,r){super(t),this._terminal=n,this._options=r,this._currentRow="",this._htmlContent="",n._core._themeService?this._ansiColors=n._core._themeService.colors.ansi:this._ansiColors=hH}_padStart(t,n,r){return n=n>>0,r=r??" ",t.length>n?t:(n-=t.length,n>r.length&&(r+=r.repeat(n/r.length)),r.slice(0,n)+t)}_beforeSerialize(t,n,r){var u,d;this._htmlContent+="<html><body><!--StartFragment--><pre>";let s="#000000",a="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((u=this._terminal.options.theme)==null?void 0:u.foreground)??"#ffffff",a=((d=this._terminal.options.theme)==null?void 0:d.background)??"#000000");let l=[];l.push("color: "+s+";"),l.push("background-color: "+a+";"),l.push("font-family: "+this._terminal.options.fontFamily+";"),l.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+l.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,n){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,n){let r=n?t.getFgColor():t.getBgColor();if(n?t.isFgRGB():t.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(s=>this._padStart(s.toString(16),2,"0")).join("");if(n?t.isFgPalette():t.isBgPalette())return this._ansiColors[r].css}_diffStyle(t,n){let r=[],s=!$M(t,n),a=!Zi(t,n),l=!WM(t,n);if(s||a||l){let u=this._getHexColor(t,!0);u&&r.push("color: "+u+";");let d=this._getHexColor(t,!1);return d&&r.push("background-color: "+d+";"),t.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&r.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?r.push("text-decoration: overline underline;"):t.isUnderline()?r.push("text-decoration: underline;"):t.isOverline()&&r.push("text-decoration: overline;"),t.isBlink()&&r.push("text-decoration: blink;"),t.isInvisible()&&r.push("visibility: hidden;"),t.isItalic()&&r.push("font-style: italic;"),t.isDim()&&r.push("opacity: 0.5;"),t.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let a=t.getChars()==="",l=this._diffStyle(t,n);l&&(this._currentRow+=l.length===0?"</span><span>":"</span><span style='"+l.join(" ")+"'>"),a?this._currentRow+=" ":this._currentRow+=dH(t.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
436
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
437
|
+
* @license MIT
|
|
438
|
+
*
|
|
439
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
440
|
+
* @license MIT
|
|
441
|
+
*
|
|
442
|
+
* Originally forked from (with the author's permission):
|
|
443
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
444
|
+
* http://bellard.org/jslinux/
|
|
445
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
446
|
+
*/var gH=class{constructor(t,n,r,s={}){this._terminal=t,this._regex=n,this._handler=r,this._options=s}provideLinks(t,n){let r=_H.computeLink(t,this._regex,this._terminal,this._handler);n(this._addCallbacks(r))}_addCallbacks(t){return t.map(n=>(n.leave=this._options.leave,n.hover=(r,s)=>{if(this._options.hover){let{range:a}=n;this._options.hover(r,s,a)}},n))}};function vH(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var _H=class Ud{static computeLink(t,n,r,s){let a=new RegExp(n.source,(n.flags||"")+"g"),[l,u]=Ud._getWindowedLineStrings(t-1,r),d=l.join(""),h,p=[];for(;h=a.exec(d);){let m=h[0];if(!vH(m))continue;let[_,y]=Ud._mapStrIdx(r,u,0,h.index),[S,w]=Ud._mapStrIdx(r,_,y,m.length);if(_===-1||y===-1||S===-1||w===-1)continue;let C={start:{x:y+1,y:_+1},end:{x:w,y:S+1}};p.push({range:C,text:m,activate:s})}return p}static _getWindowedLineStrings(t,n){let r,s=t,a=t,l=0,u="",d=[];if(r=n.buffer.active.getLine(t)){let h=r.translateToString(!0);if(r.isWrapped&&h[0]!==" "){for(l=0;(r=n.buffer.active.getLine(--s))&&l<2048&&(u=r.translateToString(!0),l+=u.length,d.push(u),!(!r.isWrapped||u.indexOf(" ")!==-1)););d.reverse()}for(d.push(h),l=0;(r=n.buffer.active.getLine(++a))&&r.isWrapped&&l<2048&&(u=r.translateToString(!0),l+=u.length,d.push(u),u.indexOf(" ")===-1););}return[d,s]}static _mapStrIdx(t,n,r,s){let a=t.buffer.active,l=a.getNullCell(),u=r;for(;s;){let d=a.getLine(n);if(!d)return[-1,-1];for(let h=u;h<d.length;++h){d.getCell(h,l);let p=l.getChars();if(l.getWidth()&&(s-=p.length||1,h===d.length-1&&p==="")){let m=a.getLine(n+1);m&&m.isWrapped&&(m.getCell(0,l),l.getWidth()===2&&(s+=1))}if(s<0)return[n,h]}n++,u=0}return[n,u]}},yH=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function bH(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var xH=class{constructor(t=bH,n={}){this._handler=t,this._options=n}activate(t){this._terminal=t;let n=this._options,r=n.urlRegex||yH;this._linkProvider=this._terminal.registerLinkProvider(new gH(this._terminal,r,this._handler,n))}dispose(){var t;(t=this._linkProvider)==null||t.dispose()}};/**
|
|
447
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
448
|
+
* @license MIT
|
|
449
|
+
*
|
|
450
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
451
|
+
* @license MIT
|
|
452
|
+
*
|
|
453
|
+
* Originally forked from (with the author's permission):
|
|
454
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
455
|
+
* http://bellard.org/jslinux/
|
|
456
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
457
|
+
*/var qM=Object.defineProperty,SH=Object.getOwnPropertyDescriptor,wH=(e,t)=>{for(var n in t)qM(e,n,{get:t[n],enumerable:!0})},zt=(e,t,n,r)=>{for(var s=r>1?void 0:r?SH(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(s=(r?l(t,n,s):l(s))||s);return r&&s&&qM(t,n,s),s},Se=(e,t)=>(n,r)=>t(n,r,e),LC="Terminal input",a_={get:()=>LC,set:e=>LC=e},zC="Too much output to announce, navigate to rows manually to read",l_={get:()=>zC,set:e=>zC=e};function CH(e){return e.replace(/\r?\n/g,"\r")}function kH(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function EH(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function RH(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");VM(s,t,n,r)}}function VM(e,t,n,r){e=CH(e),e=kH(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function KM(e,t,n){let r=n.getBoundingClientRect(),s=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${a}px`,t.style.zIndex="1000",t.focus()}function jC(e,t,n,r,s){KM(e,t,n),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Us(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function rp(e,t=0,n=e.length){let r="";for(let s=t;s<n;++s){let a=e[s];a>65535?(a-=65536,r+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):r+=String.fromCharCode(a)}return r}var TH=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s=0;if(this._interim){let a=e.charCodeAt(s++);56320<=a&&a<=57343?t[r++]=(this._interim-55296)*1024+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0}for(let a=s;a<n;++a){let l=e.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=n)return this._interim=l,r;let u=e.charCodeAt(a);56320<=u&&u<=57343?t[r++]=(l-55296)*1024+u-56320+65536:(t[r++]=l,t[r++]=u);continue}l!==65279&&(t[r++]=l)}return r}},MH=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s,a,l,u,d=0,h=0;if(this.interim[0]){let _=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let S=0,w;for(;(w=this.interim[++S]&63)&&S<4;)y<<=6,y|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-S;for(;h<k;){if(h>=n)return 0;if(w=e[h++],(w&192)!==128){h--,_=!0;break}else this.interim[S++]=w,y<<=6,y|=w&63}_||(C===2?y<128?h--:t[r++]=y:C===3?y<2048||y>=55296&&y<=57343||y===65279||(t[r++]=y):y<65536||y>1114111||(t[r++]=y)),this.interim.fill(0)}let p=n-4,m=h;for(;m<n;){for(;m<p&&!((s=e[m])&128)&&!((a=e[m+1])&128)&&!((l=e[m+2])&128)&&!((u=e[m+3])&128);)t[r++]=s,t[r++]=a,t[r++]=l,t[r++]=u,m+=4;if(s=e[m++],s<128)t[r++]=s;else if((s&224)===192){if(m>=n)return this.interim[0]=s,r;if(a=e[m++],(a&192)!==128){m--;continue}if(d=(s&31)<<6|a&63,d<128){m--;continue}t[r++]=d}else if((s&240)===224){if(m>=n)return this.interim[0]=s,r;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=a,r;if(l=e[m++],(l&192)!==128){m--;continue}if(d=(s&15)<<12|(a&63)<<6|l&63,d<2048||d>=55296&&d<=57343||d===65279)continue;t[r++]=d}else if((s&248)===240){if(m>=n)return this.interim[0]=s,r;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=a,r;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=a,this.interim[2]=l,r;if(u=e[m++],(u&192)!==128){m--;continue}if(d=(s&7)<<18|(a&63)<<12|(l&63)<<6|u&63,d<65536||d>1114111)continue;t[r++]=d}}return r}},GM="",Vs=" ",Lu=class YM{constructor(){this.fg=0,this.bg=0,this.extended=new _f}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new YM;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},_f=class XM{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new XM(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},$r=class ZM extends Lu{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new _f,this.combinedData=""}static fromCharData(t){let n=new ZM;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Us(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let s=t[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(r-55296)*1024+s-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},BC="di$target",c_="di$dependencies",Jg=new Map;function AH(e){return e[c_]||[]}function _n(e){if(Jg.has(e))return Jg.get(e);let t=function(n,r,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");NH(t,n,s)};return t._id=e,Jg.set(e,t),t}function NH(e,t,n){t[BC]===t?t[c_].push({id:e,index:n}):(t[c_]=[{id:e,index:n}],t[BC]=t)}var Un=_n("BufferService"),QM=_n("CoreMouseService"),Zo=_n("CoreService"),DH=_n("CharsetService"),xb=_n("InstantiationService"),JM=_n("LogService"),$n=_n("OptionsService"),e5=_n("OscLinkService"),OH=_n("UnicodeService"),zu=_n("DecorationService"),u_=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var p;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],s=this._optionsService.rawOptions.linkHandler,a=new $r,l=n.getTrimmedLength(),u=-1,d=-1,h=!1;for(let m=0;m<l;m++)if(!(d===-1&&!n.hasContent(m))){if(n.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId)if(d===-1){d=m,u=a.extended.urlId;continue}else h=a.extended.urlId!==u;else d!==-1&&(h=!0);if(h||d!==-1&&m===l-1){let _=(p=this._oscLinkService.getLinkData(u))==null?void 0:p.uri;if(_){let y={start:{x:d+1,y:e},end:{x:m+(!h&&m===l-1?1:0),y:e}},S=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let w=new URL(_);["http:","https:"].includes(w.protocol)||(S=!0)}catch{S=!0}S||r.push({text:_,range:y,activate:(w,C)=>s?s.activate(w,C,y):LH(w,C),hover:(w,C)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,w,C,y)},leave:(w,C)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,w,C,y)}})}h=!1,a.hasExtendedAttrs()&&a.extended.urlId?(d=m,u=a.extended.urlId):(d=-1,u=-1)}}t(r)}};u_=zt([Se(0,Un),Se(1,$n),Se(2,e5)],u_);function LH(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
458
|
+
|
|
459
|
+
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var ip=_n("CharSizeService"),os=_n("CoreBrowserService"),Sb=_n("MouseService"),as=_n("RenderService"),zH=_n("SelectionService"),t5=_n("CharacterJoinerService"),El=_n("ThemeService"),n5=_n("LinkProviderService"),jH=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?PC.isErrorNoTelemetry(e)?new PC(e.message+`
|
|
460
|
+
|
|
461
|
+
`+e.stack):new Error(e.message+`
|
|
462
|
+
|
|
463
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},BH=new jH;function $d(e){PH(e)||BH.onUnexpectedError(e)}var h_="Canceled";function PH(e){return e instanceof IH?!0:e instanceof Error&&e.name===h_&&e.message===h_}var IH=class extends Error{constructor(){super(h_),this.name=this.message}};function HH(e){return new Error(`Illegal argument: ${e}`)}var PC=class d_ extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof d_)return t;let n=new d_;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},f_=class r5 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,r5.prototype)}};function mr(e,t=0){return e[e.length-(1+t)]}var FH;(e=>{function t(a){return a<0}e.isLessThan=t;function n(a){return a<=0}e.isLessThanOrEqual=n;function r(a){return a>0}e.isGreaterThan=r;function s(a){return a===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(FH||(FH={}));function UH(e,t){let n=this,r=!1,s;return function(){return r||(r=!0,t||(s=e.apply(n,arguments))),s}}var i5;(e=>{function t(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*s(M){yield M}e.single=s;function a(M){return t(M)?M:s(M)}e.wrap=a;function l(M){return M||n}e.from=l;function*u(M){for(let L=M.length-1;L>=0;L--)yield M[L]}e.reverse=u;function d(M){return!M||M[Symbol.iterator]().next().done===!0}e.isEmpty=d;function h(M){return M[Symbol.iterator]().next().value}e.first=h;function p(M,L){let O=0;for(let z of M)if(L(z,O++))return!0;return!1}e.some=p;function m(M,L){for(let O of M)if(L(O))return O}e.find=m;function*_(M,L){for(let O of M)L(O)&&(yield O)}e.filter=_;function*y(M,L){let O=0;for(let z of M)yield L(z,O++)}e.map=y;function*S(M,L){let O=0;for(let z of M)yield*L(z,O++)}e.flatMap=S;function*w(...M){for(let L of M)yield*L}e.concat=w;function C(M,L,O){let z=O;for(let H of M)z=L(z,H);return z}e.reduce=C;function*k(M,L,O=M.length){for(L<0&&(L+=M.length),O<0?O+=M.length:O>M.length&&(O=M.length);L<O;L++)yield M[L]}e.slice=k;function T(M,L=Number.POSITIVE_INFINITY){let O=[];if(L===0)return[O,M];let z=M[Symbol.iterator]();for(let H=0;H<L;H++){let G=z.next();if(G.done)return[O,e.empty()];O.push(G.value)}return[O,{[Symbol.iterator](){return z}}]}e.consume=T;async function R(M){let L=[];for await(let O of M)L.push(O);return Promise.resolve(L)}e.asyncToArray=R})(i5||(i5={}));function $o(e){if(i5.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function $H(...e){return Rt(()=>$o(e))}function Rt(e){return{dispose:UH(()=>{e()})}}var s5=class o5{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{$o(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?o5.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};s5.DISABLE_DISPOSED_WARNING=!1;var Gs=s5,Ke=class{constructor(){this._store=new Gs,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ke.None=Object.freeze({dispose(){}});var dl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Qi=typeof window=="object"?window:globalThis,p_=class m_{constructor(t){this.element=t,this.next=m_.Undefined,this.prev=m_.Undefined}};p_.Undefined=new p_(void 0);var Mt=p_,IC=class{constructor(){this._first=Mt.Undefined,this._last=Mt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Mt.Undefined}clear(){let e=this._first;for(;e!==Mt.Undefined;){let t=e.next;e.prev=Mt.Undefined,e.next=Mt.Undefined,e=t}this._first=Mt.Undefined,this._last=Mt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Mt(e);if(this._first===Mt.Undefined)this._first=n,this._last=n;else if(t){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==Mt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Mt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Mt.Undefined&&e.next!==Mt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Mt.Undefined&&e.next===Mt.Undefined?(this._first=Mt.Undefined,this._last=Mt.Undefined):e.next===Mt.Undefined?(this._last=this._last.prev,this._last.next=Mt.Undefined):e.prev===Mt.Undefined&&(this._first=this._first.next,this._first.prev=Mt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Mt.Undefined;)yield e.element,e=e.next}},WH=globalThis.performance&&typeof globalThis.performance.now=="function",qH=class a5{static create(t){return new a5(t)}constructor(t){this._now=WH&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},En;(e=>{e.None=()=>Ke.None;function t(I,U){return m(I,()=>{},0,void 0,!0,void 0,U)}e.defer=t;function n(I){return(U,V=null,F)=>{let j=!1,Y;return Y=I(W=>{if(!j)return Y?Y.dispose():j=!0,U.call(V,W)},null,F),j&&Y.dispose(),Y}}e.once=n;function r(I,U,V){return h((F,j=null,Y)=>I(W=>F.call(j,U(W)),null,Y),V)}e.map=r;function s(I,U,V){return h((F,j=null,Y)=>I(W=>{U(W),F.call(j,W)},null,Y),V)}e.forEach=s;function a(I,U,V){return h((F,j=null,Y)=>I(W=>U(W)&&F.call(j,W),null,Y),V)}e.filter=a;function l(I){return I}e.signal=l;function u(...I){return(U,V=null,F)=>{let j=$H(...I.map(Y=>Y(W=>U.call(V,W))));return p(j,F)}}e.any=u;function d(I,U,V,F){let j=V;return r(I,Y=>(j=U(j,Y),j),F)}e.reduce=d;function h(I,U){let V,F={onWillAddFirstListener(){V=I(j.fire,j)},onDidRemoveLastListener(){V==null||V.dispose()}},j=new be(F);return U==null||U.add(j),j.event}function p(I,U){return U instanceof Array?U.push(I):U&&U.add(I),I}function m(I,U,V=100,F=!1,j=!1,Y,W){let Q,A,P,Z=0,D,K={leakWarningThreshold:Y,onWillAddFirstListener(){Q=I(ie=>{Z++,A=U(A,ie),F&&!P&&(ee.fire(A),A=void 0),D=()=>{let ge=A;A=void 0,P=void 0,(!F||Z>1)&&ee.fire(ge),Z=0},typeof V=="number"?(clearTimeout(P),P=setTimeout(D,V)):P===void 0&&(P=0,queueMicrotask(D))})},onWillRemoveListener(){j&&Z>0&&(D==null||D())},onDidRemoveLastListener(){D=void 0,Q.dispose()}},ee=new be(K);return W==null||W.add(ee),ee.event}e.debounce=m;function _(I,U=0,V){return e.debounce(I,(F,j)=>F?(F.push(j),F):[j],U,void 0,!0,void 0,V)}e.accumulate=_;function y(I,U=(F,j)=>F===j,V){let F=!0,j;return a(I,Y=>{let W=F||!U(Y,j);return F=!1,j=Y,W},V)}e.latch=y;function S(I,U,V){return[e.filter(I,U,V),e.filter(I,F=>!U(F),V)]}e.split=S;function w(I,U=!1,V=[],F){let j=V.slice(),Y=I(A=>{j?j.push(A):Q.fire(A)});F&&F.add(Y);let W=()=>{j==null||j.forEach(A=>Q.fire(A)),j=null},Q=new be({onWillAddFirstListener(){Y||(Y=I(A=>Q.fire(A)),F&&F.add(Y))},onDidAddFirstListener(){j&&(U?setTimeout(W):W())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return F&&F.add(Q),Q.event}e.buffer=w;function C(I,U){return(V,F,j)=>{let Y=U(new T);return I(function(W){let Q=Y.evaluate(W);Q!==k&&V.call(F,Q)},void 0,j)}}e.chain=C;let k=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(V=>(U(V),V)),this}filter(U){return this.steps.push(V=>U(V)?V:k),this}reduce(U,V){let F=V;return this.steps.push(j=>(F=U(F,j),F)),this}latch(U=(V,F)=>V===F){let V=!0,F;return this.steps.push(j=>{let Y=V||!U(j,F);return V=!1,F=j,Y?j:k}),this}evaluate(U){for(let V of this.steps)if(U=V(U),U===k)break;return U}}function R(I,U,V=F=>F){let F=(...Q)=>W.fire(V(...Q)),j=()=>I.on(U,F),Y=()=>I.removeListener(U,F),W=new be({onWillAddFirstListener:j,onDidRemoveLastListener:Y});return W.event}e.fromNodeEventEmitter=R;function M(I,U,V=F=>F){let F=(...Q)=>W.fire(V(...Q)),j=()=>I.addEventListener(U,F),Y=()=>I.removeEventListener(U,F),W=new be({onWillAddFirstListener:j,onDidRemoveLastListener:Y});return W.event}e.fromDOMEventEmitter=M;function L(I){return new Promise(U=>n(I)(U))}e.toPromise=L;function O(I){let U=new be;return I.then(V=>{U.fire(V)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}e.fromPromise=O;function z(I,U){return I(V=>U.fire(V))}e.forward=z;function H(I,U,V){return U(V),I(F=>U(F))}e.runAndSubscribe=H;class G{constructor(U,V){this._observable=U,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:()=>{U.addObserver(this)},onDidRemoveLastListener:()=>{U.removeObserver(this)}};this.emitter=new be(F),V&&V.add(this.emitter)}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,V){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(I,U){return new G(I,U).emitter.event}e.fromObservable=B;function $(I){return(U,V,F)=>{let j=0,Y=!1,W={beginUpdate(){j++},endUpdate(){j--,j===0&&(I.reportChanges(),Y&&(Y=!1,U.call(V)))},handlePossibleChange(){},handleChange(){Y=!0}};I.addObserver(W),I.reportChanges();let Q={dispose(){I.removeObserver(W)}};return F instanceof Gs?F.add(Q):Array.isArray(F)&&F.push(Q),Q}}e.fromObservableLight=$})(En||(En={}));var g_=class v_{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${v_._idPool++}`,v_.all.add(this)}start(t){this._stopWatch=new qH,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};g_.all=new Set,g_._idPool=0;var VH=g_,KH=-1,l5=class c5{constructor(t,n,r=(c5._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[a,l]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${l}):`;console.warn(u),console.warn(a);let d=new XH(u,a);this._errorHandler(d)}return()=>{let a=this._stacks.get(t.value)||0;this._stacks.set(t.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,s]of this._stacks)(!t||n<s)&&(t=[r,s],n=s);return t}};l5._idPool=1;var GH=l5,YH=class u5{constructor(t){this.value=t}static create(){let t=new Error;return new u5(t.stack??"")}print(){console.warn(this.value.split(`
|
|
464
|
+
`).slice(2).join(`
|
|
465
|
+
`))}},XH=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},ZH=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},QH=0,ev=class{constructor(e){this.value=e,this.id=QH++}},JH=2,eF,be=class{constructor(e){var t,n,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new GH((e==null?void 0:e.onListenerError)??$d,((n=this._options)==null?void 0:n.leakWarningThreshold)??KH):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new VH(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var l,u,d,h,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let _=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new ZH(`${m}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(((l=this._options)==null?void 0:l.onListenerError)||$d)(y),Ke.None}if(this._disposed)return Ke.None;t&&(e=e.bind(t));let r=new ev(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=YH.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof ev?(this._deliveryQueue??(this._deliveryQueue=new tF),this._listeners=[this._listeners,r]):this._listeners.push(r):((d=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||d.call(u,this),this._listeners=r,(p=(h=this._options)==null?void 0:h.onDidAddFirstListener)==null||p.call(h,this)),this._size++;let a=Rt(()=>{s==null||s(),this._removeListener(r)});return n instanceof Gs?n.add(a):Array.isArray(n)&&n.push(a),a}),this._event}_removeListener(e){var s,a,l,u;if((a=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||a.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||u.call(l,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*JH<=t.length){let d=0;for(let h=0;h<t.length;h++)t[h]?t[d++]=t[h]:r&&(this._deliveryQueue.end--,d<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=d}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||$d;if(!n){e.value(t);return}try{e.value(t)}catch(s){n(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r,s;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof ev)this._deliver(this._listeners,e);else{let a=this._deliveryQueue;a.enqueue(this,e,this._listeners.length),this._deliverQueue(a)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},tF=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},__=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new be,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new be,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};__.INSTANCE=new __;var wb=__;function nF(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}wb.INSTANCE.onDidChangeZoomLevel;function rF(e){return wb.INSTANCE.getZoomFactor(e)}wb.INSTANCE.onDidChangeFullscreen;var Rl=typeof navigator=="object"?navigator.userAgent:"",y_=Rl.indexOf("Firefox")>=0,iF=Rl.indexOf("AppleWebKit")>=0,Cb=Rl.indexOf("Chrome")>=0,sF=!Cb&&Rl.indexOf("Safari")>=0;Rl.indexOf("Electron/")>=0;Rl.indexOf("Android")>=0;var tv=!1;if(typeof Qi.matchMedia=="function"){let e=Qi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Qi.matchMedia("(display-mode: fullscreen)");tv=e.matches,nF(Qi,e,({matches:n})=>{tv&&t.matches||(tv=n)})}var Za="en",b_=!1,x_=!1,Wd=!1,h5=!1,vd,qd=Za,HC=Za,oF,Jr,jo=globalThis,kn,Ik;typeof jo.vscode<"u"&&typeof jo.vscode.process<"u"?kn=jo.vscode.process:typeof process<"u"&&typeof((Ik=process==null?void 0:process.versions)==null?void 0:Ik.node)=="string"&&(kn=process);var Hk,aF=typeof((Hk=kn==null?void 0:kn.versions)==null?void 0:Hk.electron)=="string",lF=aF&&(kn==null?void 0:kn.type)==="renderer",Fk;if(typeof kn=="object"){b_=kn.platform==="win32",x_=kn.platform==="darwin",Wd=kn.platform==="linux",Wd&&kn.env.SNAP&&kn.env.SNAP_REVISION,kn.env.CI||kn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,vd=Za,qd=Za;let e=kn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);vd=t.userLocale,HC=t.osLocale,qd=t.resolvedLanguage||Za,oF=(Fk=t.languagePack)==null?void 0:Fk.translationsConfigFile}catch{}h5=!0}else typeof navigator=="object"&&!lF?(Jr=navigator.userAgent,b_=Jr.indexOf("Windows")>=0,x_=Jr.indexOf("Macintosh")>=0,(Jr.indexOf("Macintosh")>=0||Jr.indexOf("iPad")>=0||Jr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Wd=Jr.indexOf("Linux")>=0,(Jr==null?void 0:Jr.indexOf("Mobi"))>=0,qd=globalThis._VSCODE_NLS_LANGUAGE||Za,vd=navigator.language.toLowerCase(),HC=vd):console.error("Unable to resolve platform.");var d5=b_,Si=x_,cF=Wd,FC=h5,ki=Jr,js=qd,uF;(e=>{function t(){return js}e.value=t;function n(){return js.length===2?js==="en":js.length>=3?js[0]==="e"&&js[1]==="n"&&js[2]==="-":!1}e.isDefaultVariant=n;function r(){return js==="en"}e.isDefault=r})(uF||(uF={}));var hF=typeof jo.postMessage=="function"&&!jo.importScripts;(()=>{if(hF){let e=[];jo.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=e.length;r<s;r++){let a=e[r];if(a.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),a.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),jo.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var dF=!!(ki&&ki.indexOf("Chrome")>=0);ki&&ki.indexOf("Firefox")>=0;!dF&&ki&&ki.indexOf("Safari")>=0;ki&&ki.indexOf("Edg/")>=0;ki&&ki.indexOf("Android")>=0;var $a=typeof navigator=="object"?navigator:{};FC||document.queryCommandSupported&&document.queryCommandSupported("copy")||$a&&$a.clipboard&&$a.clipboard.writeText,FC||$a&&$a.clipboard&&$a.clipboard.readText;var kb=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},nv=new kb,UC=new kb,$C=new kb,fF=new Array(230),f5;(e=>{function t(u){return nv.keyCodeToStr(u)}e.toString=t;function n(u){return nv.strToKeyCode(u)}e.fromString=n;function r(u){return UC.keyCodeToStr(u)}e.toUserSettingsUS=r;function s(u){return $C.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function a(u){return UC.strToKeyCode(u)||$C.strToKeyCode(u)}e.fromUserSettings=a;function l(u){if(u>=98&&u<=113)return null;switch(u){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return nv.keyCodeToStr(u)}e.toElectronAccelerator=l})(f5||(f5={}));var pF=class p5{constructor(t,n,r,s,a){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=a}equals(t){return t instanceof p5&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",r=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${t}${n}${r}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new mF([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},mF=class{constructor(e){if(e.length===0)throw HH("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function gF(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return f5.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(y_)switch(t){case 59:return 85;case 60:if(cF)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Si)return 57;break}else if(iF&&(Si&&t===93||!Si&&t===92))return 57;return fF[t]||0}var vF=Si?256:2048,_F=512,yF=1024,bF=Si?2048:256,WC=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(n=t.getModifierState)==null?void 0:n.call(t,"AltGraph"),this.keyCode=gF(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=vF),this.altKey&&(t|=_F),this.shiftKey&&(t|=yF),this.metaKey&&(t|=bF),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new pF(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},qC=new WeakMap;function xF(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var SF=class{static getSameOriginWindowChain(e){let t=qC.get(e);if(!t){t=[],qC.set(e,t);let n=e,r;do r=xF(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,s=this.getSameOriginWindowChain(e);for(let a of s){let l=a.window.deref();if(n+=(l==null?void 0:l.scrollY)??0,r+=(l==null?void 0:l.scrollX)??0,l===t||!a.iframeElement)break;let u=a.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},_d=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=SF.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},VC=class{constructor(e,t=0,n=0){var s;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(Cb){let a=navigator.userAgent.match(/Chrome\/(\d+)/);r=(a?parseInt(a[1]):123)<=122}if(e){let a=e,l=e,u=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof a.wheelDeltaY<"u")r?this.deltaY=a.wheelDeltaY/(120*u):this.deltaY=a.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let d=e;d.deltaMode===d.DOM_DELTA_LINE?y_&&!Si?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")sF&&d5?this.deltaX=-(a.wheelDeltaX/120):r?this.deltaX=a.wheelDeltaX/(120*u):this.deltaX=a.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let d=e;d.deltaMode===d.DOM_DELTA_LINE?y_&&!Si?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},m5=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),wF;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof CF?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:En.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:m5})})(wF||(wF={}));var CF=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?m5:(this._emitter||(this._emitter=new be),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Eb=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new f_("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new f_("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},kF=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new f_("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=Rt(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},EF;(e=>{async function t(r){let s,a=await Promise.all(r.map(l=>l.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return a}e.settled=t;function n(r){return new Promise(async(s,a)=>{try{await r(s,a)}catch(l){a(l)}})}e.withAsyncBody=n})(EF||(EF={}));var KC=class Br{static fromArray(t){return new Br(n=>{n.emitMany(t)})}static fromPromise(t){return new Br(async n=>{n.emitMany(await t)})}static fromPromises(t){return new Br(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new Br(async n=>{await Promise.all(t.map(async r=>{for await(let s of r)n.emitOne(s)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new be,queueMicrotask(async()=>{let r={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(t(r)),this.resolve()}catch(s){this.reject(s)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await En.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(t,n){return new Br(async r=>{for await(let s of t)r.emitOne(n(s))})}map(t){return Br.map(this,t)}static filter(t,n){return new Br(async r=>{for await(let s of t)n(s)&&r.emitOne(s)})}filter(t){return Br.filter(this,t)}static coalesce(t){return Br.filter(t,n=>!!n)}coalesce(){return Br.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return Br.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};KC.EMPTY=KC.fromArray([]);var{getWindow:yi,getWindowId:RF,onDidRegisterWindow:TF}=(function(){let e=new Map,t={window:Qi,disposables:new Gs};e.set(Qi.vscodeWindowId,t);let n=new be,r=new be,s=new be;function a(l,u){return(typeof l=="number"?e.get(l):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:r.event,registerWindow(l){if(e.has(l.vscodeWindowId))return Ke.None;let u=new Gs,d={window:l,disposables:u.add(new Gs)};return e.set(l.vscodeWindowId,d),u.add(Rt(()=>{e.delete(l.vscodeWindowId),r.fire(l)})),u.add(Be(l,un.BEFORE_UNLOAD,()=>{s.fire(l)})),n.fire(d),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:a,getWindow(l){var h;let u=l;if((h=u==null?void 0:u.ownerDocument)!=null&&h.defaultView)return u.ownerDocument.defaultView.window;let d=l;return d!=null&&d.view?d.view.window:Qi},getDocument(l){return yi(l).document}}})(),MF=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Be(e,t,n,r){return new MF(e,t,n,r)}var GC=function(e,t,n,r){return Be(e,t,n,r)},Rb,AF=class extends kF{constructor(e){super(),this.defaultTarget=e&&yi(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},YC=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){$d(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,s=a=>{n.set(a,!1);let l=e.get(a)??[];for(t.set(a,l),e.set(a,[]),r.set(a,!0);l.length>0;)l.sort(YC.sort),l.shift().execute();r.set(a,!1)};Rb=(a,l,u=0)=>{let d=RF(a),h=new YC(l,u),p=e.get(d);return p||(p=[],e.set(d,p)),p.push(h),n.get(d)||(n.set(d,!0),a.requestAnimationFrame(()=>s(d))),h}})();function NF(e){let t=e.getBoundingClientRect(),n=yi(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var un={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},DF=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=nr(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=nr(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=nr(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=nr(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=nr(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=nr(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=nr(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=nr(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=nr(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=nr(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=nr(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=nr(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=nr(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=nr(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function nr(e){return typeof e=="number"?`${e}px`:e}function Jc(e){return new DF(e)}var g5=class{constructor(){this._hooks=new Gs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=s;let a=e;try{e.setPointerCapture(t),this._hooks.add(Rt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=yi(e)}this._hooks.add(Be(a,un.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Be(a,un.POINTER_UP,l=>this.stopMonitoring(!0)))}};function OF(e,t,n){let r=null,s=null;if(typeof n.value=="function"?(r="value",s=n.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",s=n.get),!s)throw new Error("not supported");let a=`$memoize$${t}`;n[r]=function(...l){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,l)}),this[a]}}var fi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(fi||(fi={}));var $c=class Mn extends Ke{constructor(){super(),this.dispatched=!1,this.targets=new IC,this.ignoreTargets=new IC,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(En.runAndSubscribe(TF,({window:t,disposables:n})=>{n.add(Be(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(Be(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(Be(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:Qi,disposables:this._store}))}static addTarget(t){if(!Mn.isTouchDevice())return Ke.None;Mn.INSTANCE||(Mn.INSTANCE=new Mn);let n=Mn.INSTANCE.targets.push(t);return Rt(n)}static ignoreTarget(t){if(!Mn.isTouchDevice())return Ke.None;Mn.INSTANCE||(Mn.INSTANCE=new Mn);let n=Mn.INSTANCE.ignoreTargets.push(t);return Rt(n)}static isTouchDevice(){return"ontouchstart"in Qi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,s=t.targetTouches.length;r<s;r++){let a=t.targetTouches.item(r);this.activeTouches[a.identifier]={id:a.identifier,initialTarget:a.target,initialTimeStamp:n,initialPageX:a.pageX,initialPageY:a.pageY,rollingTimestamps:[n],rollingPageX:[a.pageX],rollingPageY:[a.pageY]};let l=this.newGestureEvent(fi.Start,a.target);l.pageX=a.pageX,l.pageY=a.pageY,this.dispatchEvent(l)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),s=Object.keys(this.activeTouches).length;for(let a=0,l=n.changedTouches.length;a<l;a++){let u=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let d=this.activeTouches[u.identifier],h=Date.now()-d.initialTimeStamp;if(h<Mn.HOLD_DELAY&&Math.abs(d.initialPageX-mr(d.rollingPageX))<30&&Math.abs(d.initialPageY-mr(d.rollingPageY))<30){let p=this.newGestureEvent(fi.Tap,d.initialTarget);p.pageX=mr(d.rollingPageX),p.pageY=mr(d.rollingPageY),this.dispatchEvent(p)}else if(h>=Mn.HOLD_DELAY&&Math.abs(d.initialPageX-mr(d.rollingPageX))<30&&Math.abs(d.initialPageY-mr(d.rollingPageY))<30){let p=this.newGestureEvent(fi.Contextmenu,d.initialTarget);p.pageX=mr(d.rollingPageX),p.pageY=mr(d.rollingPageY),this.dispatchEvent(p)}else if(s===1){let p=mr(d.rollingPageX),m=mr(d.rollingPageY),_=mr(d.rollingTimestamps)-d.rollingTimestamps[0],y=p-d.rollingPageX[0],S=m-d.rollingPageY[0],w=[...this.targets].filter(C=>d.initialTarget instanceof Node&&C.contains(d.initialTarget));this.inertia(t,w,r,Math.abs(y)/_,y>0?1:-1,p,Math.abs(S)/_,S>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(fi.End,d.initialTarget)),delete this.activeTouches[u.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(t){if(t.type===fi.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>Mn.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===fi.Change||t.type===fi.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let s=0,a=t.initialTarget;for(;a&&a!==r;)s++,a=a.parentElement;n.push([s,r])}n.sort((r,s)=>r[0]-s[0]);for(let[r,s]of n)s.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,s,a,l,u,d,h){this.handle=Rb(t,()=>{let p=Date.now(),m=p-r,_=0,y=0,S=!0;s+=Mn.SCROLL_FRICTION*m,u+=Mn.SCROLL_FRICTION*m,s>0&&(S=!1,_=a*s*m),u>0&&(S=!1,y=d*u*m);let w=this.newGestureEvent(fi.Change);w.translationX=_,w.translationY=y,n.forEach(C=>C.dispatchEvent(w)),S||this.inertia(t,n,p,s,a,l+_,u,d,h+y)})}onTouchMove(t){let n=Date.now();for(let r=0,s=t.changedTouches.length;r<s;r++){let a=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("end of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],u=this.newGestureEvent(fi.Change,l.initialTarget);u.translationX=a.pageX-mr(l.rollingPageX),u.translationY=a.pageY-mr(l.rollingPageY),u.pageX=a.pageX,u.pageY=a.pageY,this.dispatchEvent(u),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(a.pageX),l.rollingPageY.push(a.pageY),l.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};$c.SCROLL_FRICTION=-.005,$c.HOLD_DELAY=700,$c.CLEAR_TAP_COUNT_TIME=400,zt([OF],$c,"isTouchDevice",1);var LF=$c,Tb=class extends Ke{onclick(e,t){this._register(Be(e,un.CLICK,n=>t(new _d(yi(e),n))))}onmousedown(e,t){this._register(Be(e,un.MOUSE_DOWN,n=>t(new _d(yi(e),n))))}onmouseover(e,t){this._register(Be(e,un.MOUSE_OVER,n=>t(new _d(yi(e),n))))}onmouseleave(e,t){this._register(Be(e,un.MOUSE_LEAVE,n=>t(new _d(yi(e),n))))}onkeydown(e,t){this._register(Be(e,un.KEY_DOWN,n=>t(new WC(n))))}onkeyup(e,t){this._register(Be(e,un.KEY_UP,n=>t(new WC(n))))}oninput(e,t){this._register(Be(e,un.INPUT,t))}onblur(e,t){this._register(Be(e,un.BLUR,t))}onfocus(e,t){this._register(Be(e,un.FOCUS,t))}onchange(e,t){this._register(Be(e,un.CHANGE,t))}ignoreGesture(e){return LF.ignoreTarget(e)}},XC=11,zF=class extends Tb{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=XC+"px",this.domNode.style.height=XC+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new g5),this._register(GC(this.bgDomNode,un.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(GC(this.domNode,un.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new AF),this._pointerdownScheduleRepeatTimer=this._register(new Eb)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,yi(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},jF=class S_{constructor(t,n,r,s,a,l,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,a=a|0,l=l|0,u=u|0),this.rawScrollLeft=s,this.rawScrollTop=u,n<0&&(n=0),s+n>r&&(s=r-n),s<0&&(s=0),a<0&&(a=0),u+a>l&&(u=l-a),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=a,this.scrollHeight=l,this.scrollTop=u}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new S_(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new S_(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let r=this.width!==t.width,s=this.scrollWidth!==t.scrollWidth,a=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,d=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:s,scrollLeftChanged:a,heightChanged:l,scrollHeightChanged:u,scrollTopChanged:d}}},BF=class extends Ke{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new jF(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var r;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new QC(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=QC.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},ZC=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function rv(e,t){let n=t-e;return function(r){return e+n*HF(r)}}function PF(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var QC=class w_{constructor(t,n,r,s){this.from=t,this.to=n,this.duration=s,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,r){if(Math.abs(t-n)>2.5*r){let s,a;return t<n?(s=t+.75*r,a=n-.75*r):(s=t-.75*r,a=n+.75*r),PF(rv(t,s),rv(a,n),.33)}return rv(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let r=this.scrollLeft(n),s=this.scrollTop(n);return new ZC(r,s,!1)}return new ZC(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return w_.start(t,n,r)}static start(t,n,r){r=r+10;let s=Date.now()-10;return new w_(t,n,s,r)}};function IF(e){return Math.pow(e,3)}function HF(e){return 1-IF(1-e)}var FF=class extends Ke{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Eb)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},UF=140,v5=class extends Tb{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new FF(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new g5),this._shouldRender=!0,this.domNode=Jc(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Be(this.domNode.domNode,un.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new zF(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Jc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Be(this.slider.domNode,un.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);n<=s&&s<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let s=NF(this.domNode.domNode);t=e.pageX-s.left,n=e.pageY-s.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let a=this._sliderOrthogonalPointerPosition(s),l=Math.abs(a-n);if(d5&&l>UF){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let u=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(u))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},_5=class C_{constructor(t,n,r,s,a,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=a,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new C_(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,r,s,a){let l=Math.max(0,r-t),u=Math.max(0,l-2*n),d=s>0&&s>r;if(!d)return{computedAvailableSize:Math.round(l),computedIsNeeded:d,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(r*u/s))),p=(u-h)/(s-r),m=a*p;return{computedAvailableSize:Math.round(l),computedIsNeeded:d,computedSliderSize:Math.round(h),computedSliderRatio:p,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=C_._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},$F=class extends v5{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new _5(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,s.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},WF=class extends v5{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new _5(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},qF=500,JC=50,VF=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},k_=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,r=1,s=this._rear;do{let a=s===this._front?t:Math.pow(2,-r);if(t-=a,n+=this._memory[s].score*a,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(Cb){let n=yi(t.browserEvent),r=rF(n);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,r){let s=null,a=new VF(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=a,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=a),a.score=this._computeScore(a,s)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),n){let s=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.abs(n.deltaX),u=Math.abs(n.deltaY),d=Math.max(Math.min(s,l),1),h=Math.max(Math.min(a,u),1),p=Math.max(s,l),m=Math.max(a,u);p%d===0&&m%h===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};k_.INSTANCE=new k_;var KF=k_,GF=class extends Tb{constructor(e,t,n){super(),this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new be),this.onWillScroll=this._onWillScroll.event,this._options=XF(t),this._scrollable=n,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let r={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new WF(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new $F(this._scrollable,this._options,r)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Jc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Jc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Jc(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new Eb),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=$o(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Si&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new VC(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=$o(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new VC(n))};this._mouseWheelToDispose.push(Be(this._listenOnDomNode,un.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=KF.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);let u=!Si&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!l&&(l=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let d=this._scrollable.getFutureScrollPosition(),h={};if(a){let p=JC*a,m=d.scrollTop-(p<0?Math.floor(p):Math.ceil(p));this._verticalScrollbar.writeScrollPosition(h,m)}if(l){let p=JC*l,m=d.scrollLeft-(p<0?Math.floor(p):Math.ceil(p));this._horizontalScrollbar.writeScrollPosition(h,m)}h=this._scrollable.validateScrollPosition(h),(d.scrollLeft!==h.scrollLeft||d.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",s=t?" top":"",a=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${s}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),qF)}},YF=class extends GF{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function XF(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Si&&(t.className+=" mac"),t}var E_=class extends Ke{constructor(e,t,n,r,s,a,l,u){super(),this._bufferService=n,this._optionsService=l,this._renderService=u,this._onRequestScrollLines=this._register(new be),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let d=this._register(new BF({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>Rb(r.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{d.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new YF(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},d)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(En.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Rt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Rt(()=>this._styleElement.remove())),this._register(En.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${a.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${a.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${a.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
466
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};E_=zt([Se(2,Un),Se(3,os),Se(4,QM),Se(5,El),Se(6,$n),Se(7,as)],E_);var R_=class extends Ke{constructor(e,t,n,r,s){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(a=>this._removeDecoration(a))),this._register(Rt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};R_=zt([Se(1,Un),Se(2,os),Se(3,zu),Se(4,as)],R_);var ZF=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},hi={full:0,left:0,center:0,right:0},Bs={full:0,left:0,center:0,right:0},kc={full:0,left:0,center:0,right:0},yf=class extends Ke{constructor(e,t,n,r,s,a,l,u){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=a,this._themeService=l,this._coreBrowserService=u,this._colorZoneStore=new ZF,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(h=this._viewportElement.parentElement)==null||h.insertBefore(this._canvas,this._viewportElement),this._register(Rt(()=>{var p;return(p=this._canvas)==null?void 0:p.remove()}));let d=this._canvas.getContext("2d");if(d)this._ctx=d;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Bs.full=this._canvas.width,Bs.left=e,Bs.center=t,Bs.right=e,this._refreshDrawHeightConstants(),kc.full=1,kc.left=1,kc.center=1+Bs.left,kc.right=1+Bs.left+Bs.center}_refreshDrawHeightConstants(){hi.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);hi.left=t,hi.center=t,hi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hi.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(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(kc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-hi[e.position||"full"]/2),Bs[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+hi[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};yf=zt([Se(2,Un),Se(3,zu),Se(4,as),Se(5,$n),Se(6,El),Se(7,os)],yf);var ue;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
467
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(ue||(ue={}));var Vd;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Vd||(Vd={}));var y5;(e=>e.ST=`${ue.ESC}\\`)(y5||(y5={}));var T_=class{constructor(e,t,n,r,s,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ue.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let a=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};T_=zt([Se(2,Un),Se(3,$n),Se(4,Zo),Se(5,as)],T_);var mn=0,gn=0,vn=0,Lt=0,e2={css:"#00000000",rgba:0},Xt;(e=>{function t(s,a,l,u){return u!==void 0?`#${To(s)}${To(a)}${To(l)}${To(u)}`:`#${To(s)}${To(a)}${To(l)}`}e.toCss=t;function n(s,a,l,u=255){return(s<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,a,l,u){return{css:e.toCss(s,a,l,u),rgba:e.toRgba(s,a,l,u)}}e.toColor=r})(Xt||(Xt={}));var Ct;(e=>{function t(d,h){if(Lt=(h.rgba&255)/255,Lt===1)return{css:h.css,rgba:h.rgba};let p=h.rgba>>24&255,m=h.rgba>>16&255,_=h.rgba>>8&255,y=d.rgba>>24&255,S=d.rgba>>16&255,w=d.rgba>>8&255;mn=y+Math.round((p-y)*Lt),gn=S+Math.round((m-S)*Lt),vn=w+Math.round((_-w)*Lt);let C=Xt.toCss(mn,gn,vn),k=Xt.toRgba(mn,gn,vn);return{css:C,rgba:k}}e.blend=t;function n(d){return(d.rgba&255)===255}e.isOpaque=n;function r(d,h,p){let m=Kd.ensureContrastRatio(d.rgba,h.rgba,p);if(m)return Xt.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=r;function s(d){let h=(d.rgba|255)>>>0;return[mn,gn,vn]=Kd.toChannels(h),{css:Xt.toCss(mn,gn,vn),rgba:h}}e.opaque=s;function a(d,h){return Lt=Math.round(h*255),[mn,gn,vn]=Kd.toChannels(d.rgba),{css:Xt.toCss(mn,gn,vn,Lt),rgba:Xt.toRgba(mn,gn,vn,Lt)}}e.opacity=a;function l(d,h){return Lt=d.rgba&255,a(d,Lt*h/255)}e.multiplyOpacity=l;function u(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}e.toColorRGB=u})(Ct||(Ct={}));var At;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return mn=parseInt(s.slice(1,2).repeat(2),16),gn=parseInt(s.slice(2,3).repeat(2),16),vn=parseInt(s.slice(3,4).repeat(2),16),Xt.toColor(mn,gn,vn);case 5:return mn=parseInt(s.slice(1,2).repeat(2),16),gn=parseInt(s.slice(2,3).repeat(2),16),vn=parseInt(s.slice(3,4).repeat(2),16),Lt=parseInt(s.slice(4,5).repeat(2),16),Xt.toColor(mn,gn,vn,Lt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return mn=parseInt(a[1]),gn=parseInt(a[2]),vn=parseInt(a[3]),Lt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Xt.toColor(mn,gn,vn,Lt);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[mn,gn,vn,Lt]=t.getImageData(0,0,1,1).data,Lt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Xt.toRgba(mn,gn,vn,Lt),css:s}}e.toColor=r})(At||(At={}));var Bn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,a){let l=r/255,u=s/255,d=a/255,h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),m=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return h*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(Bn||(Bn={}));var Kd;(e=>{function t(l,u){if(Lt=(u&255)/255,Lt===1)return u;let d=u>>24&255,h=u>>16&255,p=u>>8&255,m=l>>24&255,_=l>>16&255,y=l>>8&255;return mn=m+Math.round((d-m)*Lt),gn=_+Math.round((h-_)*Lt),vn=y+Math.round((p-y)*Lt),Xt.toRgba(mn,gn,vn)}e.blend=t;function n(l,u,d){let h=Bn.relativeLuminance(l>>8),p=Bn.relativeLuminance(u>>8);if(Xi(h,p)<d){if(p<h){let y=r(l,u,d),S=Xi(h,Bn.relativeLuminance(y>>8));if(S<d){let w=s(l,u,d),C=Xi(h,Bn.relativeLuminance(w>>8));return S>C?y:w}return y}let m=s(l,u,d),_=Xi(h,Bn.relativeLuminance(m>>8));if(_<d){let y=r(l,u,d),S=Xi(h,Bn.relativeLuminance(y>>8));return _>S?m:y}return m}}e.ensureContrastRatio=n;function r(l,u,d){let h=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=Xi(Bn.relativeLuminance2(_,y,S),Bn.relativeLuminance2(h,p,m));for(;w<d&&(_>0||y>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=Xi(Bn.relativeLuminance2(_,y,S),Bn.relativeLuminance2(h,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,d){let h=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=Xi(Bn.relativeLuminance2(_,y,S),Bn.relativeLuminance2(h,p,m));for(;w<d&&(_<255||y<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=Xi(Bn.relativeLuminance2(_,y,S),Bn.relativeLuminance2(h,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(Kd||(Kd={}));function To(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Xi(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var QF=class extends Lu{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},bf=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new $r}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),s=0,a=0,l=0,u=t.getFg(0),d=t.getBg(0);for(let h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==u||this._workCell.bg!==d){if(h-s>1){let p=this._getJoinedRanges(r,l,a,t,s);for(let m=0;m<p.length;m++)n.push(p[m])}s=h,l=a,u=this._workCell.fg,d=this._workCell.bg}a+=this._workCell.getChars().length||Vs.length}if(this._bufferService.cols-s>1){let h=this._getJoinedRanges(r,l,a,t,s);for(let p=0;p<h.length;p++)n.push(h[p])}return n}_getJoinedRanges(e,t,n,r,s){let a=e.substring(t,n),l=[];try{l=this._characterJoiners[0].handler(a)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let d=this._characterJoiners[u].handler(a);for(let h=0;h<d.length;h++)bf._mergeRanges(l,d[h])}catch(d){console.error(d)}return this._stringRangesToCellRanges(l,r,s),l}_stringRangesToCellRanges(e,t,n){let r=0,s=!1,a=0,l=e[r];if(l){for(let u=n;u<this._bufferService.cols;u++){let d=t.getWidth(u),h=t.getString(u).length||Vs.length;if(d!==0){if(!s&&l[0]<=a&&(l[0]=u,s=!0),l[1]<=a){if(l[1]=u,l=e[++r],!l)break;l[0]<=a?(l[0]=u,s=!0):s=!1}a+=h}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];if(n){if(t[1]<=s[0])return e[r-1][1]=t[1],e;if(t[1]<=s[1])return e[r-1][1]=Math.max(t[1],s[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=s[0])return e.splice(r,0,t),e;if(t[1]<=s[1])return s[0]=Math.min(t[0],s[0]),e;t[0]<s[1]&&(s[0]=Math.min(t[0],s[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};bf=zt([Se(0,Un)],bf);function JF(e){return 57508<=e&&e<=57558}function eU(e){return 9472<=e&&e<=9631}function tU(e){return JF(e)||eU(e)}function nU(){return{css:{canvas:yd(),cell:yd()},device:{canvas:yd(),cell:yd(),char:{width:0,height:0,left:0,top:0}}}}function yd(){return{width:0,height:0}}var M_=class{constructor(e,t,n,r,s,a,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=a,this._themeService=l,this._workCell=new $r,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,s,a,l,u,d,h,p){let m=[],_=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,S=e.getNoBgTrimmedLength();n&&S<a+1&&(S=a+1);let w,C=0,k="",T=0,R=0,M=0,L=0,O=!1,z=0,H=!1,G=0,B=0,$=[],I=h!==-1&&p!==-1;for(let U=0;U<S;U++){e.loadCell(U,this._workCell);let V=this._workCell.getWidth();if(V===0)continue;let F=!1,j=U>=B,Y=U,W=this._workCell;if(_.length>0&&U===_[0][0]&&j){let _e=_.shift(),He=this._isCellInSelection(_e[0],t);for(T=_e[0]+1;T<_e[1];T++)j&&(j=He===this._isCellInSelection(T,t));j&&(j=!n||a<_e[0]||a>=_e[1]),j?(F=!0,W=new QF(this._workCell,e.translateToString(!0,_e[0],_e[1]),_e[1]-_e[0]),Y=_e[1]-1,V=W.getWidth()):B=_e[1]}let Q=this._isCellInSelection(U,t),A=n&&U===a,P=I&&U>=h&&U<=p,Z=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,_e=>{Z=!0});let D=W.getChars()||Vs;if(D===" "&&(W.isUnderline()||W.isOverline())&&(D=" "),G=V*u-d.get(D,W.isBold(),W.isItalic()),!w)w=this._document.createElement("span");else if(C&&(Q&&H||!Q&&!H&&W.bg===R)&&(Q&&H&&y.selectionForeground||W.fg===M)&&W.extended.ext===L&&P===O&&G===z&&!A&&!F&&!Z&&j){W.isInvisible()?k+=Vs:k+=D,C++;continue}else C&&(w.textContent=k),w=this._document.createElement("span"),C=0,k="";if(R=W.bg,M=W.fg,L=W.extended.ext,O=P,z=G,H=Q,F&&a>=U&&a<=Y&&(a=U),!this._coreService.isCursorHidden&&A&&this._coreService.isCursorInitialized){if($.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&$.push("xterm-cursor-blink"),$.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":$.push("xterm-cursor-outline");break;case"block":$.push("xterm-cursor-block");break;case"bar":$.push("xterm-cursor-bar");break;case"underline":$.push("xterm-cursor-underline");break}}if(W.isBold()&&$.push("xterm-bold"),W.isItalic()&&$.push("xterm-italic"),W.isDim()&&$.push("xterm-dim"),W.isInvisible()?k=Vs:k=W.getChars()||Vs,W.isUnderline()&&($.push(`xterm-underline-${W.extended.underlineStyle}`),k===" "&&(k=" "),!W.isUnderlineColorDefault()))if(W.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${Lu.toColorRGB(W.getUnderlineColor()).join(",")})`;else{let _e=W.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&W.isBold()&&_e<8&&(_e+=8),w.style.textDecorationColor=y.ansi[_e].css}W.isOverline()&&($.push("xterm-overline"),k===" "&&(k=" ")),W.isStrikethrough()&&$.push("xterm-strikethrough"),P&&(w.style.textDecoration="underline");let K=W.getFgColor(),ee=W.getFgColorMode(),ie=W.getBgColor(),ge=W.getBgColorMode(),Te=!!W.isInverse();if(Te){let _e=K;K=ie,ie=_e;let He=ee;ee=ge,ge=He}let ve,ke,We=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,_e=>{_e.options.layer!=="top"&&We||(_e.backgroundColorRGB&&(ge=50331648,ie=_e.backgroundColorRGB.rgba>>8&16777215,ve=_e.backgroundColorRGB),_e.foregroundColorRGB&&(ee=50331648,K=_e.foregroundColorRGB.rgba>>8&16777215,ke=_e.foregroundColorRGB),We=_e.options.layer==="top")}),!We&&Q&&(ve=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,ie=ve.rgba>>8&16777215,ge=50331648,We=!0,y.selectionForeground&&(ee=50331648,K=y.selectionForeground.rgba>>8&16777215,ke=y.selectionForeground)),We&&$.push("xterm-decoration-top");let fe;switch(ge){case 16777216:case 33554432:fe=y.ansi[ie],$.push(`xterm-bg-${ie}`);break;case 50331648:fe=Xt.toColor(ie>>16,ie>>8&255,ie&255),this._addStyle(w,`background-color:#${t2((ie>>>0).toString(16),"0",6)}`);break;case 0:default:Te?(fe=y.foreground,$.push("xterm-bg-257")):fe=y.background}switch(ve||W.isDim()&&(ve=Ct.multiplyOpacity(fe,.5)),ee){case 16777216:case 33554432:W.isBold()&&K<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(K+=8),this._applyMinimumContrast(w,fe,y.ansi[K],W,ve,void 0)||$.push(`xterm-fg-${K}`);break;case 50331648:let _e=Xt.toColor(K>>16&255,K>>8&255,K&255);this._applyMinimumContrast(w,fe,_e,W,ve,ke)||this._addStyle(w,`color:#${t2(K.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(w,fe,y.foreground,W,ve,ke)||Te&&$.push("xterm-fg-257")}$.length&&(w.className=$.join(" "),$.length=0),!A&&!F&&!Z&&j?C++:w.textContent=k,G!==this.defaultSpacing&&(w.style.letterSpacing=`${G}px`),m.push(w),U=Y}return w&&C&&(w.textContent=k),m}_applyMinimumContrast(e,t,n,r,s,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||tU(r.getCode()))return!1;let l=this._getContrastCache(r),u;if(!s&&!a&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=Ct.ensureContrastRatio(s||t,a||n,d),l.setColor((s||t).rgba,(a||n).rgba,u??null)}return u?(this._addStyle(e,`color:${u.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};M_=zt([Se(1,t5),Se(2,$n),Se(3,os),Se(4,Zo),Se(5,zu),Se(6,El)],M_);function t2(e,t,n){for(;e.length<n;)e=t+e;return e}var rU=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold",a.style.fontStyle="italic",this._measureElements=[n,r,s,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(a),t.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(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let l=this._measure(e,0);return l>0&&(this._flat[r]=l),l}let s=e;t&&(s+="B"),n&&(s+="I");let a=this._holey.get(s);if(a===void 0){let l=0;t&&(l|=1),n&&(l|=2),a=this._measure(e,l),a>0&&this._holey.set(s,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},iU=class{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(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let s=e.buffers.active.ydisp,a=t[1]-s,l=n[1]-s,u=Math.max(a,0),d=Math.min(l,e.rows-1);if(u>=e.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=l,this.viewportCappedStartRow=u,this.viewportCappedEndRow=d,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function sU(){return new iU}var iv="xterm-dom-renderer-owner-",jr="xterm-rows",bd="xterm-fg-",n2="xterm-bg-",Ec="xterm-focus",xd="xterm-selection",oU=1,A_=class extends Ke{constructor(e,t,n,r,s,a,l,u,d,h,p,m,_,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=a,this._linkifier2=l,this._charSizeService=d,this._optionsService=h,this._bufferService=p,this._coreService=m,this._coreBrowserService=_,this._themeService=y,this._terminalClass=oU++,this._rowElements=[],this._selectionRenderModel=sU(),this.onRequestRedraw=this._register(new be).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(jr),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(xd),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=nU(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(S=>this._injectCss(S))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(M_,document),this._element.classList.add(iv+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(S=>this._handleLinkHover(S))),this._register(this._linkifier2.onHideLinkUnderline(S=>this._handleLinkLeave(S))),this._register(Rt(()=>{this._element.classList.remove(iv+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new rU(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${jr} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${jr} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${jr} .xterm-dim { color: ${Ct.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${jr}.${Ec} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${jr}.${Ec} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${jr}.${Ec} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${jr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${jr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${jr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${jr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${jr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${xd} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${xd} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${xd} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,l]of e.ansi.entries())t+=`${this._terminalSelector} .${bd}${a} { color: ${l.css}; }${this._terminalSelector} .${bd}${a}.xterm-dim { color: ${Ct.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${n2}${a} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${bd}257 { color: ${Ct.opaque(e.background).css}; }${this._terminalSelector} .${bd}257.xterm-dim { color: ${Ct.multiplyOpacity(Ct.opaque(e.background),.5).css}; }${this._terminalSelector} .${n2}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let n=this._rowElements.length;n<=t;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(Ec),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Ec),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let d=e[0]>t[0];u.appendChild(this._createSelectionElement(a,d?t[0]:e[0],d?e[0]:t[0],l-a+1))}else{let d=r===a?e[0]:0,h=a===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,d,h));let p=l-a-1;if(u.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,p)),a!==l){let m=s===l?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,0,m))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let s=this._document.createElement("div"),a=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-t);return a+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-a),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${a}px`,s.style.width=`${l}px`,s}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,s=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let d=e;d<=t;d++){let h=d+n.ydisp,p=this._rowElements[d],m=n.lines.get(h);if(!p||!m)break;p.replaceChildren(...this._rowFactory.createRow(m,h,h===r,l,u,s,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${iv}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,s,a){n<0&&(e=0),r<0&&(t=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),r=Math.max(Math.min(r,l),0),s=Math.min(s,this._bufferService.cols);let u=this._bufferService.buffer,d=u.ybase+u.y,h=Math.min(u.x,s-1),p=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=r;++y){let S=y+u.ydisp,w=this._rowElements[y],C=u.lines.get(S);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,S,S===d,m,_,h,p,this.dimensions.css.cell.width,this._widthCache,a?y===n?e:0:-1,a?(y===r?t:s)-1:-1))}}};A_=zt([Se(7,xb),Se(8,ip),Se(9,$n),Se(10,Un),Se(11,Zo),Se(12,os),Se(13,El)],A_);var N_=class extends Ke{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new be),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new lU(this._optionsService))}catch{this._measureStrategy=this._register(new aU(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};N_=zt([Se(2,$n)],N_);var b5=class extends Ke{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},aU=class extends b5{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},lU=class extends b5{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},cU=class extends Ke{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new uU(this._window)),this._onDprChange=this._register(new be),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new be),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(En.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Be(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Be(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},uU=class extends Ke{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new dl),this._onDprChange=this._register(new be),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Rt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Be(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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)}},hU=class extends Ke{constructor(){super(),this.linkProviders=[],this._register(Rt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Mb(e,t,n){let r=n.getBoundingClientRect(),s=e.getComputedStyle(n),a=parseInt(s.getPropertyValue("padding-left")),l=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-r.left-a,t.clientY-r.top-l]}function dU(e,t,n,r,s,a,l,u,d){if(!a)return;let h=Mb(e,t,n);if(h)return h[0]=Math.ceil((h[0]+(d?l/2:0))/l),h[1]=Math.ceil(h[1]/u),h[0]=Math.min(Math.max(h[0],1),r+(d?1:0)),h[1]=Math.min(Math.max(h[1],1),s),h}var D_=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,s){return dU(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,t){let n=Mb(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};D_=zt([Se(0,as),Se(1,ip)],D_);var fU=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},x5={};wH(x5,{getSafariVersion:()=>mU,isChromeOS:()=>k5,isFirefox:()=>S5,isIpad:()=>gU,isIphone:()=>vU,isLegacyEdge:()=>pU,isLinux:()=>Ab,isMac:()=>xf,isNode:()=>sp,isSafari:()=>w5,isWindows:()=>C5});var sp=typeof process<"u"&&"title"in process,ju=sp?"node":navigator.userAgent,Bu=sp?"node":navigator.platform,S5=ju.includes("Firefox"),pU=ju.includes("Edge"),w5=/^((?!chrome|android).)*safari/i.test(ju);function mU(){if(!w5)return 0;let e=ju.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var xf=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Bu),gU=Bu==="iPad",vU=Bu==="iPhone",C5=["Windows","Win16","Win32","WinCE"].includes(Bu),Ab=Bu.indexOf("Linux")>=0,k5=/\bCrOS\b/.test(ju),E5=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),s=e.timeRemaining(),n*1.5>s){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=s}this.clear()}},_U=class extends E5{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},yU=class extends E5{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Sf=!sp&&"requestIdleCallback"in window?yU:_U,bU=class{constructor(){this._queue=new Sf}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},O_=class extends Ke{constructor(e,t,n,r,s,a,l,u,d){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new dl),this._pausedResizeTask=new bU,this._observerDisposable=this._register(new dl),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 be),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new be),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new be),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new be),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new fU((h,p)=>this._renderRows(h,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new xU(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Rt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>{var h;return(h=this._renderer.value)==null?void 0:h.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(d.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=Rt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};O_=zt([Se(2,$n),Se(3,ip),Se(4,Zo),Se(5,zu),Se(6,Un),Se(7,os),Se(8,El)],O_);var xU=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function SU(e,t,n,r){let s=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return kU(s,a,e,t,n,r)+op(a,t,n,r)+EU(s,a,e,t,n,r);let l;if(a===t)return l=s>e?"D":"C",gu(Math.abs(s-e),mu(l,r));l=a>t?"D":"C";let u=Math.abs(a-t),d=CU(a>t?e:s,n)+(u-1)*n.cols+1+wU(a>t?s:e);return gu(d,mu(l,r))}function wU(e,t){return e-1}function CU(e,t){return t.cols-e}function kU(e,t,n,r,s,a){return op(t,r,s,a).length===0?"":gu(T5(e,t,e,t-Wo(t,s),!1,s).length,mu("D",a))}function op(e,t,n,r){let s=e-Wo(e,n),a=t-Wo(t,n),l=Math.abs(s-a)-RU(e,t,n);return gu(l,mu(R5(e,t),r))}function EU(e,t,n,r,s,a){let l;op(t,r,s,a).length>0?l=r-Wo(r,s):l=t;let u=r,d=TU(e,t,n,r,s,a);return gu(T5(e,l,n,u,d==="C",s).length,mu(d,a))}function RU(e,t,n){var l;let r=0,s=e-Wo(e,n),a=t-Wo(t,n);for(let u=0;u<Math.abs(s-a);u++){let d=R5(e,t)==="A"?-1:1;(l=n.buffer.lines.get(s+d*u))!=null&&l.isWrapped&&r++}return r}function Wo(e,t){let n=0,r=t.buffer.lines.get(e),s=r==null?void 0:r.isWrapped;for(;s&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),s=r==null?void 0:r.isWrapped;return n}function TU(e,t,n,r,s,a){let l;return op(n,r,s,a).length>0?l=r-Wo(r,s):l=t,e<n&&l<=r||e>=n&&l<r?"C":"D"}function R5(e,t){return e>t?"A":"B"}function T5(e,t,n,r,s,a){let l=e,u=t,d="";for(;(l!==n||u!==r)&&u>=0&&u<a.buffer.lines.length;)l+=s?1:-1,s&&l>a.cols-1?(d+=a.buffer.translateBufferLineToString(u,!1,e,l),l=0,e=0,u++):!s&&l<0&&(d+=a.buffer.translateBufferLineToString(u,!1,0,e+1),l=a.cols-1,e=l,u--);return d+a.buffer.translateBufferLineToString(u,!1,e,l)}function mu(e,t){let n=t?"O":"[";return ue.ESC+n+e}function gu(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var MU=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function r2(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var sv=50,AU=15,NU=50,DU=500,OU=" ",LU=new RegExp(OU,"g"),L_=class extends Ke{constructor(e,t,n,r,s,a,l,u,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=a,this._optionsService=l,this._renderService=u,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new $r,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new be),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new be),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new be),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new be),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new MU(this._bufferService),this._activeSelectionMode=0,this._register(Rt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let s=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let u=n.translateBufferLineToString(l,!0,s,a);r.push(u)}}else{let s=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],s));for(let a=e[1]+1;a<=t[1]-1;a++){let l=n.lines.get(a),u=n.translateBufferLineToString(a,!0);l!=null&&l.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let a=n.lines.get(t[1]),l=n.translateBufferLineToString(t[1],!0,0,t[0]);a&&a.isWrapped?r[r.length-1]+=l:r.push(l)}}return r.map(s=>s.replace(LU," ")).join(C5?`\r
|
|
468
|
+
`:`
|
|
469
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Ab&&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){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var s,a;let n=(a=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:a.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=r2(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Mb(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-sv),sv),t/=sv,t/Math.abs(t)+Math.round(t*(AU-1)))}shouldForceSelection(e){return xf?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(),NU)}_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;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(xf&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let r=n.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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});let 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){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<DU&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=SU(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let s=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:s>1&&t!==r&&(n+=s-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,a=s.lines.get(e[1]);if(!a)return;let l=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(a,e[0]),d=u,h=e[0]-u,p=0,m=0,_=0,y=0;if(l.charAt(u)===" "){for(;u>0&&l.charAt(u-1)===" ";)u--;for(;d<l.length&&l.charAt(d+1)===" ";)d++}else{let C=e[0],k=e[0];a.getWidth(C)===0&&(p++,C--),a.getWidth(k)===2&&(m++,k++);let T=a.getString(k).length;for(T>1&&(y+=T-1,d+=T-1);C>0&&u>0&&!this._isCharWordSeparator(a.loadCell(C-1,this._workCell));){a.loadCell(C-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,C--):R>1&&(_+=R-1,u-=R-1),u--,C--}for(;k<a.length&&d+1<l.length&&!this._isCharWordSeparator(a.loadCell(k+1,this._workCell));){a.loadCell(k+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,k++):R>1&&(y+=R-1,d+=R-1),d++,k++}}d++;let S=u+h-p+_,w=Math.min(this._bufferService.cols,d-u+p+m-_-y);if(!(!t&&l.slice(u,d).trim()==="")){if(n&&S===0&&a.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&a.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let T=this._bufferService.cols-k.start;S-=T,w+=T}}}if(r&&S+w===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let C=s.lines.get(e[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(w+=k.length)}}return{start:S,length:w}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=r2(n,this._bufferService.cols)}};L_=zt([Se(3,Un),Se(4,Zo),Se(5,Sb),Se(6,$n),Se(7,as),Se(8,os)],L_);var i2=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},s2=class{constructor(){this._color=new i2,this._css=new i2}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},nn=Object.freeze((()=>{let e=[At.toColor("#2e3436"),At.toColor("#cc0000"),At.toColor("#4e9a06"),At.toColor("#c4a000"),At.toColor("#3465a4"),At.toColor("#75507b"),At.toColor("#06989a"),At.toColor("#d3d7cf"),At.toColor("#555753"),At.toColor("#ef2929"),At.toColor("#8ae234"),At.toColor("#fce94f"),At.toColor("#729fcf"),At.toColor("#ad7fa8"),At.toColor("#34e2e2"),At.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],a=t[n%6];e.push({css:Xt.toCss(r,s,a),rgba:Xt.toRgba(r,s,a)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Xt.toCss(r,r,r),rgba:Xt.toRgba(r,r,r)})}return e})()),No=At.toColor("#ffffff"),Wc=At.toColor("#000000"),o2=At.toColor("#ffffff"),a2=Wc,Rc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},zU=No,z_=class extends Ke{constructor(e){super(),this._optionsService=e,this._contrastCache=new s2,this._halfContrastCache=new s2,this._onChangeColors=this._register(new be),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:No,background:Wc,cursor:o2,cursorAccent:a2,selectionForeground:void 0,selectionBackgroundTransparent:Rc,selectionBackgroundOpaque:Ct.blend(Wc,Rc),selectionInactiveBackgroundTransparent:Rc,selectionInactiveBackgroundOpaque:Ct.blend(Wc,Rc),scrollbarSliderBackground:Ct.opacity(No,.2),scrollbarSliderHoverBackground:Ct.opacity(No,.4),scrollbarSliderActiveBackground:Ct.opacity(No,.5),overviewRulerBorder:No,ansi:nn.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=pt(e.foreground,No),t.background=pt(e.background,Wc),t.cursor=Ct.blend(t.background,pt(e.cursor,o2)),t.cursorAccent=Ct.blend(t.background,pt(e.cursorAccent,a2)),t.selectionBackgroundTransparent=pt(e.selectionBackground,Rc),t.selectionBackgroundOpaque=Ct.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=pt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Ct.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?pt(e.selectionForeground,e2):void 0,t.selectionForeground===e2&&(t.selectionForeground=void 0),Ct.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Ct.opacity(t.selectionBackgroundTransparent,.3)),Ct.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Ct.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=pt(e.scrollbarSliderBackground,Ct.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=pt(e.scrollbarSliderHoverBackground,Ct.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=pt(e.scrollbarSliderActiveBackground,Ct.opacity(t.foreground,.5)),t.overviewRulerBorder=pt(e.overviewRulerBorder,zU),t.ansi=nn.slice(),t.ansi[0]=pt(e.black,nn[0]),t.ansi[1]=pt(e.red,nn[1]),t.ansi[2]=pt(e.green,nn[2]),t.ansi[3]=pt(e.yellow,nn[3]),t.ansi[4]=pt(e.blue,nn[4]),t.ansi[5]=pt(e.magenta,nn[5]),t.ansi[6]=pt(e.cyan,nn[6]),t.ansi[7]=pt(e.white,nn[7]),t.ansi[8]=pt(e.brightBlack,nn[8]),t.ansi[9]=pt(e.brightRed,nn[9]),t.ansi[10]=pt(e.brightGreen,nn[10]),t.ansi[11]=pt(e.brightYellow,nn[11]),t.ansi[12]=pt(e.brightBlue,nn[12]),t.ansi[13]=pt(e.brightMagenta,nn[13]),t.ansi[14]=pt(e.brightCyan,nn[14]),t.ansi[15]=pt(e.brightWhite,nn[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=pt(e.extendedAnsi[r],nn[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};z_=zt([Se(0,$n)],z_);function pt(e,t){if(e!==void 0)try{return At.toColor(e)}catch{}return t}var jU=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},BU=class{constructor(){this._services=new jU,this._services.set(xb,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=AH(e).sort((a,l)=>a.index-l.index),r=[];for(let a of n){let l=this._services.get(a.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id._id}.`);r.push(l)}let s=n.length>0?n[0].index:t.length;if(t.length!==s)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},PU={trace:0,debug:1,info:2,warn:3,error:4,off:5},IU="xterm.js: ",j_=class extends Ke{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=PU[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":IU)+t,...n)}trace(e,...t){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,t)}};j_=zt([Se(0,$n)],j_);var l2=class extends Ke{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new be),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new be),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new be),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,t,...n){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+n.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<n.length;r++)this._array[this._getCyclicIndex(e+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let r=this._length+n.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let s=t-1;s>=0;s--)this.set(e+s+n,this.get(e+s));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},qe=3,Yt=Object.freeze(new Lu),Sd=0,ov=2,qc=class M5{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*qe);let s=n||$r.fromCharData([0,GM,1,0]);for(let a=0;a<t;++a)this.setCell(a,s);this.length=t}get(t){let n=this._data[t*qe+0],r=n&2097151;return[this._data[t*qe+1],n&2097152?this._combined[t]:r?Us(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*qe+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*qe+0]=t|2097152|n[2]<<22):this._data[t*qe+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*qe+0]>>22}hasWidth(t){return this._data[t*qe+0]&12582912}getFg(t){return this._data[t*qe+1]}getBg(t){return this._data[t*qe+2]}hasContent(t){return this._data[t*qe+0]&4194303}getCodePoint(t){let n=this._data[t*qe+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*qe+0]&2097152}getString(t){let n=this._data[t*qe+0];return n&2097152?this._combined[t]:n&2097151?Us(n&2097151):""}isProtected(t){return this._data[t*qe+2]&536870912}loadCell(t,n){return Sd=t*qe,n.content=this._data[Sd+0],n.fg=this._data[Sd+1],n.bg=this._data[Sd+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*qe+0]=n.content,this._data[t*qe+1]=n.fg,this._data[t*qe+2]=n.bg}setCellFromCodepoint(t,n,r,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*qe+0]=n|r<<22,this._data[t*qe+1]=s.fg,this._data[t*qe+2]=s.bg}addCodepointToCell(t,n,r){let s=this._data[t*qe+0];s&2097152?this._combined[t]+=Us(n):s&2097151?(this._combined[t]=Us(s&2097151)+Us(n),s&=-2097152,s|=2097152):s=n|1<<22,r&&(s&=-12582913,s|=r<<22),this._data[t*qe+0]=s}insertCells(t,n,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length-t){let s=new $r;for(let a=this.length-t-n-1;a>=0;--a)this.setCell(t+n+a,this.loadCell(t+a,s));for(let a=0;a<n;++a)this.setCell(t+a,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,n,r){if(t%=this.length,n<this.length-t){let s=new $r;for(let a=0;a<this.length-t-n;++a)this.setCell(t+a,this.loadCell(t+n+a,s));for(let a=this.length-n;a<this.length;++a)this.setCell(a,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,n,r,s=!1){if(s){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.setCell(t++,r)}resize(t,n){if(t===this.length)return this._data.length*4*ov<this._data.buffer.byteLength;let r=t*qe;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let s=new Uint32Array(r);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,r);let s=Object.keys(this._combined);for(let l=0;l<s.length;l++){let u=parseInt(s[l],10);u>=t&&delete this._combined[u]}let a=Object.keys(this._extendedAttrs);for(let l=0;l<a.length;l++){let u=parseInt(a[l],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*ov<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*ov<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new M5(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*qe+0]&4194303)return t+(this._data[t*qe+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*qe+0]&4194303||this._data[t*qe+2]&50331648)return t+(this._data[t*qe+0]>>22);return 0}copyCellsFrom(t,n,r,s,a){let l=t._data;if(a)for(let d=s-1;d>=0;d--){for(let h=0;h<qe;h++)this._data[(r+d)*qe+h]=l[(n+d)*qe+h];l[(n+d)*qe+2]&268435456&&(this._extendedAttrs[r+d]=t._extendedAttrs[n+d])}else for(let d=0;d<s;d++){for(let h=0;h<qe;h++)this._data[(r+d)*qe+h]=l[(n+d)*qe+h];l[(n+d)*qe+2]&268435456&&(this._extendedAttrs[r+d]=t._extendedAttrs[n+d])}let u=Object.keys(t._combined);for(let d=0;d<u.length;d++){let h=parseInt(u[d],10);h>=n&&(this._combined[h-n+r]=t._combined[h])}}translateToString(t,n,r,s){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),s&&(s.length=0);let a="";for(;n<r;){let l=this._data[n*qe+0],u=l&2097151,d=l&2097152?this._combined[n]:u?Us(u):Vs;if(a+=d,s)for(let h=0;h<d.length;++h)s.push(n);n+=l>>22||1}return s&&s.push(n),a}};function HU(e,t,n,r,s,a){let l=[];for(let u=0;u<e.length-1;u++){let d=u,h=e.get(++d);if(!h.isWrapped)continue;let p=[e.get(u)];for(;d<e.length&&h.isWrapped;)p.push(h),h=e.get(++d);if(!a&&r>=u&&r<d){u+=p.length-1;continue}let m=0,_=vu(p,m,t),y=1,S=0;for(;y<p.length;){let C=vu(p,y,t),k=C-S,T=n-_,R=Math.min(k,T);p[m].copyCellsFrom(p[y],S,_,R,!1),_+=R,_===n&&(m++,_=0),S+=R,S===C&&(y++,S=0),_===0&&m!==0&&p[m-1].getWidth(n-1)===2&&(p[m].copyCellsFrom(p[m-1],n-1,_++,1,!1),p[m-1].setCell(n-1,s))}p[m].replaceCells(_,n,s);let w=0;for(let C=p.length-1;C>0&&(C>m||p[C].getTrimmedLength()===0);C--)w++;w>0&&(l.push(u+p.length-w),l.push(w)),u+=p.length-1}return l}function FU(e,t){let n=[],r=0,s=t[r],a=0;for(let l=0;l<e.length;l++)if(s===l){let u=t[++r];e.onDeleteEmitter.fire({index:l-a,amount:u}),l+=u-1,a+=u,s=t[++r]}else n.push(l);return{layout:n,countRemoved:a}}function UU(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let r=0;r<n.length;r++)e.set(r,n[r]);e.length=t.length}function $U(e,t,n){let r=[],s=e.map((d,h)=>vu(e,h,t)).reduce((d,h)=>d+h),a=0,l=0,u=0;for(;u<s;){if(s-u<n){r.push(s-u);break}a+=n;let d=vu(e,l,t);a>d&&(a-=d,l++);let h=e[l].getWidth(a-1)===2;h&&a--;let p=h?n-1:n;r.push(p),u+=p}return r}function vu(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,s=e[t+1].getWidth(0)===2;return r&&s?n-1:n}var A5=class N5{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=N5._nextId++,this._onDispose=this.register(new be),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),$o(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};A5._nextId=1;var WU=A5,on={},Do=on.B;on[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:"≥","{":"π","|":"≠","}":"£","~":"·"};on.A={"#":"£"};on.B=void 0;on[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};on.C=on[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};on.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};on.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};on.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};on.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};on.E=on[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};on.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};on.H=on[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};on["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var c2=4294967295,u2=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Yt.clone(),this.savedCharset=Do,this.markers=[],this._nullCell=$r.fromCharData([0,GM,1,0]),this._whitespaceCell=$r.fromCharData([0,Vs,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Sf,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l2(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new _f),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new _f),this._whitespaceCell}getBlankLine(e,t){return new qc(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>c2?c2:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Yt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l2(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Yt),r=0,s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)r+=+this.lines.get(l).resize(e,n);let a=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new qc(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new qc(e,n)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let l=this.lines.length-s;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=HU(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Yt),n);if(r.length>0){let s=FU(this.lines,r);UU(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(Yt),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new qc(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(Yt),s=[],a=0;for(let l=this.lines.length-1;l>=0;l--){let u=this.lines.get(l);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let d=[u];for(;u.isWrapped&&l>0;)u=this.lines.get(--l),d.unshift(u);if(!n){let R=this.ybase+this.y;if(R>=l&&R<l+d.length)continue}let h=d[d.length-1].getTrimmedLength(),p=$U(d,this._cols,e),m=p.length-d.length,_;this.ybase===0&&this.y!==this.lines.length-1?_=Math.max(0,this.y-this.lines.maxLength+m):_=Math.max(0,this.lines.length-this.lines.maxLength+m);let y=[];for(let R=0;R<m;R++){let M=this.getBlankLine(Yt,!0);y.push(M)}y.length>0&&(s.push({start:l+d.length+a,newLines:y}),a+=y.length),d.push(...y);let S=p.length-1,w=p[S];w===0&&(S--,w=p[S]);let C=d.length-m-1,k=h;for(;C>=0;){let R=Math.min(k,w);if(d[S]===void 0)break;if(d[S].copyCellsFrom(d[C],k-R,w-R,R,!0),w-=R,w===0&&(S--,w=p[S]),k-=R,k===0){C--;let M=Math.max(C,0);k=vu(d,M,this._cols)}}for(let R=0;R<d.length;R++)p[R]<e&&d[R].setCell(p[R],r);let T=m-_;for(;T-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+t-1)}if(s.length>0){let l=[],u=[];for(let w=0;w<this.lines.length;w++)u.push(this.lines.get(w));let d=this.lines.length,h=d-1,p=0,m=s[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let _=0;for(let w=Math.min(this.lines.maxLength-1,d+a-1);w>=0;w--)if(m&&m.start>h+_){for(let C=m.newLines.length-1;C>=0;C--)this.lines.set(w--,m.newLines[C]);w++,l.push({index:h+1,amount:m.newLines.length}),_+=m.newLines.length,m=s[++p]}else this.lines.set(w,u[h--]);let y=0;for(let w=l.length-1;w>=0;w--)l[w].index+=y,this.lines.onInsertEmitter.fire(l[w]),y+=l[w].amount;let S=Math.max(0,d+a-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}translateBufferLineToString(e,t,n=0,r){let s=this.lines.get(e);return s?s.translateToString(t,n,r):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new WU(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},qU=class extends Ke{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new be),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 u2(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u2(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},D5=2,O5=1,B_=class extends Ke{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new be),this.onResize=this._onResize.event,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,D5),this.rows=Math.max(e.rawOptions.rows||0,O5),this.buffers=this._register(new qU(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let s=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let l=n.lines.isFull;a===n.lines.length-1?l?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),l?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let l=a-s+1;n.lines.shiftElements(s+1,l-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};B_=zt([Se(0,$n)],B_);var Wa={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:xf,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},VU=["normal","bold","100","200","300","400","500","600","700","800","900"],KU=class extends Ke{constructor(e){super(),this._onOptionChange=this._register(new be),this.onOptionChange=this._onOptionChange.event;let t={...Wa};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Rt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in Wa))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in Wa))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Wa[e]),!GU(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Wa[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=VU.includes(t)?t:Wa[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function GU(e){return e==="block"||e==="underline"||e==="bar"}function Vc(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&Vc(e[r],t-1);return n}var h2=Object.freeze({insertMode:!1}),d2=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),P_=class extends Ke{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new be),this.onData=this._onData.event,this._onUserInput=this._register(new be),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new be),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new be),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Vc(h2),this.decPrivateModes=Vc(d2)}reset(){this.modes=Vc(h2),this.decPrivateModes=Vc(d2)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};P_=zt([Se(0,Un),Se(1,JM),Se(2,$n)],P_);var f2={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function av(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var lv=String.fromCharCode,p2={DEFAULT:e=>{let t=[av(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${lv(t[0])}${lv(t[1])}${lv(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${av(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${av(e,!0)};${e.x};${e.y}${t}`}},I_=class extends Ke{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new be),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(f2))this.addProtocol(r,f2[r]);for(let r of Object.keys(p2))this.addEncoding(r,p2[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=r+0,Math.abs(e.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};I_=zt([Se(0,Un),Se(1,Zo),Se(2,$n)],I_);var cv=[[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]],YU=[[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]],rn;function XU(e,t){let n=0,r=t.length-1,s;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(s=n+r>>1,e>t[s][1])n=s+1;else if(e<t[s][0])r=s-1;else return!0;return!1}var ZU=class{constructor(){if(this.version="6",!rn){rn=new Uint8Array(65536),rn.fill(1),rn[0]=0,rn.fill(0,1,32),rn.fill(0,127,160),rn.fill(2,4352,4448),rn[9001]=2,rn[9002]=2,rn.fill(2,11904,42192),rn[12351]=1,rn.fill(2,44032,55204),rn.fill(2,63744,64256),rn.fill(2,65040,65050),rn.fill(2,65072,65136),rn.fill(2,65280,65377),rn.fill(2,65504,65511);for(let e=0;e<cv.length;++e)rn.fill(0,cv[e][0],cv[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?rn[e]:XU(e,YU)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let s=zo.extractWidth(t);s===0?r=!1:s>n&&(n=s)}return zo.createPropertyValue(0,n,r)}},zo=class Gd{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new be,this.onChange=this._onChange.event;let t=new ZU;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,s=t.length;for(let a=0;a<s;++a){let l=t.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=s)return n+this.wcwidth(l);let h=t.charCodeAt(a);56320<=h&&h<=57343?l=(l-55296)*1024+h-56320+65536:n+=this.wcwidth(h)}let u=this.charProperties(l,r),d=Gd.extractWidth(u);Gd.extractShouldJoin(u)&&(d-=Gd.extractWidth(r)),n+=d,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},QU=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function m2(e){var r;let t=(r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:r.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var Tc=2147483647,JU=256,L5=class H_{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>JU)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new H_;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let s=t[r];if(Array.isArray(s))for(let a=0;a<s.length;++a)n.addSubParam(s[a]);else n.addParam(s)}return n}clone(){let t=new H_(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,s))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Tc?Tc:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Tc?Tc:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-n>0?this._subParams.subarray(n,r):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&(t[n]=this._subParams.slice(r,s))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,s=r[n-1];r[n-1]=~s?Math.min(s*10+t,Tc):t}},Mc=[],e$=class{constructor(){this._state=0,this._active=Mc,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Mc}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Mc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Mc,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",rp(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Mc,this._id=-1,this._state=0}}},gr=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=rp(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},Ac=[],t$=class{constructor(){this._handlers=Object.create(null),this._active=Ac,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Ac}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Ac,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Ac,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",rp(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Ac,this._ident=0}},Kc=new L5;Kc.addParam(0);var g2=class{constructor(e){this._handler=e,this._data="",this._params=Kc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Kc,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=rp(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=Kc,this._data="",this._hitLimit=!1,n));return this._params=Kc,this._data="",this._hitLimit=!1,t}},n$=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let s=0;s<e.length;s++)this.table[t<<8|e[s]]=n<<4|r}},Hr=160,r$=(function(){let e=new n$(4095),t=Array.apply(null,Array(256)).map((u,d)=>d),n=(u,d)=>t.slice(u,d),r=n(32,127),s=n(0,24);s.push(25),s.push.apply(s,n(28,32));let a=n(0,14),l;e.setDefault(1,0),e.addMany(r,0,2,0);for(l in a)e.addMany([24,26,153,154],l,3,0),e.addMany(n(128,144),l,3,0),e.addMany(n(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Hr,0,2,0),e.add(Hr,8,5,8),e.add(Hr,6,0,6),e.add(Hr,11,0,11),e.add(Hr,13,13,13),e})(),i$=class extends Ke{constructor(e=r$){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new L5,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Rt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new e$),this._dcsParser=this._register(new t$),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let s=0;s<e.intermediates.length;++s){let a=e.intermediates.charCodeAt(s);if(32>a||a>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=a}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,n,r,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(e,t,n){let r=0,s=0,a=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,d=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&d>-1){for(;d>=0&&(l=u[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._parseStack.handlerPos=d,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&d>-1){for(;d>=0&&(l=u[d](),l!==!0);d--)if(l instanceof Promise)return this._parseStack.handlerPos=d,l}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],l=this._oscParser.end(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=a;u<t;++u){switch(r=e[u],s=this._transitions.table[this.currentState<<8|(r<160?r:Hr)],s>>4){case 2:for(let _=u+1;;++_){if(_>=t||(r=e[_])<32||r>126&&r<Hr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Hr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Hr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Hr){this._printHandler(e,u,_),u=_-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|r],h=d?d.length-1:-1;for(;h>=0&&(l=d[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._preserveStack(3,d,h,s,u),l;h<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++u<t&&(r=e[u])>47&&r<60);u--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let p=this._escHandlers[this._collect<<8|r],m=p?p.length-1:-1;for(;m>=0&&(l=p[m](),l!==!0);m--)if(l instanceof Promise)return this._preserveStack(4,p,m,s,u),l;m<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let _=u+1;;++_)if(_>=t||(r=e[_])===24||r===26||r===27||r>127&&r<Hr){this._dcsParser.put(e,u,_),u=_-1;break}break;case 14:if(l=this._dcsParser.unhook(r!==24&&r!==26),l)return this._preserveStack(6,[],0,s,u),l;r===27&&(s|=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 _=u+1;;_++)if(_>=t||(r=e[_])<32||r>127&&r<Hr){this._oscParser.put(e,u,_),u=_-1;break}break;case 6:if(l=this._oscParser.end(r!==24&&r!==26),l)return this._preserveStack(5,[],0,s,u),l;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},s$=/^([\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})$/,o$=/^[\da-f]+$/;function v2(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=s$.exec(t);if(n){let r=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/r*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/r*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),o$.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let s=0;s<3;++s){let a=parseInt(t.slice(n*s,n*s+n),16);r[s]=n===1?a<<4:n===2?a:n===3?a>>4:a>>8}return r}}function uv(e,t){let n=e.toString(16),r=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function a$(e,t=16){let[n,r,s]=e;return`rgb:${uv(n,t)}/${uv(r,t)}/${uv(s,t)}`}var l$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ps=131072,_2=10;function y2(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var b2=5e3,x2=0,c$=class extends Ke{constructor(e,t,n,r,s,a,l,u,d=new i$){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=s,this._oscLinkService=a,this._coreMouseService=l,this._unicodeService=u,this._parser=d,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new TH,this._utf8Decoder=new MH,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Yt.clone(),this._eraseAttrDataInternal=Yt.clone(),this._onRequestBell=this._register(new be),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new be),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new be),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new be),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new be),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new be),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new be),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new be),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new be),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new be),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new be),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new be),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 F_(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:p.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,p,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:p,data:m})}),this._parser.setDcsHandlerFallback((h,p,m)=>{p==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:p,payload:m})}),this._parser.setPrintHandler((h,p,m)=>this.print(h,p,m)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(ue.BEL,()=>this.bell()),this._parser.setExecuteHandler(ue.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ue.BS,()=>this.backspace()),this._parser.setExecuteHandler(ue.HT,()=>this.tab()),this._parser.setExecuteHandler(ue.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ue.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Vd.IND,()=>this.index()),this._parser.setExecuteHandler(Vd.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Vd.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new gr(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new gr(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new gr(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new gr(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new gr(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new gr(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new gr(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new gr(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new gr(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new gr(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new gr(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new gr(h=>this.restoreCursorColor(h))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let h in on)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g2((h,p)=>this.requestStatusString(h,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),b2))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${b2} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,s=this._activeBuffer.y,a=0,l=this._parseStack.paused;if(l){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Ps&&(a=this._parseStack.position+Ps)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Ps&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ps))),l||this._dirtyRowTracker.clearRange(),e.length>Ps)for(let h=a;h<e.length;h+=Ps){let p=h+Ps<e.length?h+Ps:e.length,m=typeof e=="string"?this._stringDecoder.decode(e.substring(h,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(h,p),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,m))return this._preserveStack(r,s,m,h),this._logSlowResolvingAsync(n),n}else if(!l){let h=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,h))return this._preserveStack(r,s,h,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let u=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),d=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);d<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(d,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,t,n){let r,s,a=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,d=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,p=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let _=this._parser.precedingJoinState;for(let y=t;y<n;++y){if(r=e[y],r<127&&a){let k=a[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let S=this._unicodeService.charProperties(r,_);s=zo.extractWidth(S);let w=zo.extractShouldJoin(S),C=w?zo.extractWidth(_):0;if(_=S,l&&this._onA11yChar.fire(Us(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(d){let k=m,T=this._activeBuffer.x-C;for(this._activeBuffer.x=C,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),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&m instanceof qc&&m.copyCellsFrom(k,T,0,C,!1);T<u;)k.setCellFromCodepoint(T++,0,1,p)}else if(this._activeBuffer.x=u-1,s===2)continue}if(w&&this._activeBuffer.x){let k=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-k,r,s);for(let T=s-C;--T>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(h&&(m.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(p)),m.getWidth(u-1)===2&&m.setCellFromCodepoint(u-1,0,1,p)),m.setCellFromCodepoint(this._activeBuffer.x++,r,s,p),s>0)for(;--s;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=_,this._activeBuffer.x<u&&n-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>y2(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new g2(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new gr(t))}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 e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,s=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&r.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(Yt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=zo.extractWidth(t),s=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),l=new Uint32Array(a.length*n),u=0;for(let h=0;h<a.length;){let p=a.codePointAt(h)||0;l[u++]=p,h+=p>65535?2:1}let d=u;for(let h=1;h<n;++h)l.copyWithin(d,0,u),d+=u;return this.print(l,0,d),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ue.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ue.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ue.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ue.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ue.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Do),this._charsetService.setgCharset(1,Do),this._charsetService.setgCharset(2,Do),this._charsetService.setgCharset(3,Do);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:a}=this._coreMouseService,l=this._coreService,{buffers:u,cols:d}=this._bufferService,{active:h,alt:p}=u,m=this._optionsService.rawOptions,_=(w,C)=>(l.triggerDataEvent(`${ue.ESC}[${t?"":"?"}${w};${C}$y`),!0),y=w=>w?1:2,S=e.params[0];return t?S===2?_(S,4):S===4?_(S,y(l.modes.insertMode)):S===12?_(S,3):S===20?_(S,y(m.convertEol)):_(S,0):S===1?_(S,y(r.applicationCursorKeys)):S===3?_(S,m.windowOptions.setWinLines?d===80?2:d===132?1:0:0):S===6?_(S,y(r.origin)):S===7?_(S,y(r.wraparound)):S===8?_(S,3):S===9?_(S,y(s==="X10")):S===12?_(S,y(m.cursorBlink)):S===25?_(S,y(!l.isCursorHidden)):S===45?_(S,y(r.reverseWraparound)):S===66?_(S,y(r.applicationKeypad)):S===67?_(S,4):S===1e3?_(S,y(s==="VT200")):S===1002?_(S,y(s==="DRAG")):S===1003?_(S,y(s==="ANY")):S===1004?_(S,y(r.sendFocus)):S===1005?_(S,4):S===1006?_(S,y(a==="SGR")):S===1015?_(S,4):S===1016?_(S,y(a==="SGR_PIXELS")):S===1048?_(S,1):S===47||S===1047||S===1049?_(S,y(h===p)):S===2004?_(S,y(r.bracketedPasteMode)):S===2026?_(S,y(r.synchronizedOutput)):_(S,0)}_updateAttrColor(e,t,n,r,s){return t===2?(e|=50331648,e&=-16777216,e|=Lu.fromColorRGB([n,r,s])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],s=0,a=0;do{if(r[a+s]=e.params[t+a],e.hasSubParams(t+a)){let l=e.getSubParams(t+a),u=0;do r[1]===5&&(s=1),r[a+u+1+s]=l[u];while(++u<l.length&&u+a+1+s<r.length);break}if(r[1]===5&&a+s>=2||r[1]===2&&a+s>=5)break;r[1]&&(s=1)}while(++a+t<e.length&&a+s<r.length);for(let l=2;l<r.length;++l)r[l]===-1&&(r[l]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Yt.fg,e.bg=Yt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let s=0;s<t;s++)n=e.params[s],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777216|n-90|8):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777216|n-100|8):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=Yt.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=Yt.bg&16777215):n===38||n===48||n===58?s+=this._extractColor(e,s,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=Yt.fg&16777215,r.bg&=-67108864,r.bg|=Yt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ue.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ue.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ue.ESC}[?${t};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Yt.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!y2(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ue.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>_2&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>_2&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let r=n.shift(),s=n.shift();if(/^\d+$/.exec(r)){let a=parseInt(r);if(S2(a))if(s==="?")t.push({type:0,index:a});else{let l=v2(s);l&&t.push({type:1,index:a,color:l})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),r,s=n.findIndex(a=>a.startsWith("id="));return s!==-1&&(r=n[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let r=0;r<n.length&&!(t>=this._specialColors.length);++r,++t)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let s=v2(n[r]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let r=0;r<n.length;++r)if(/^\d+$/.exec(n[r])){let s=parseInt(n[r]);S2(s)&&t.push({type:2,index:s})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Do),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(l$[e[0]],on[e[1]]||Do),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=Yt.clone(),this._eraseAttrDataInternal=Yt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new $r;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=l=>(this._coreService.triggerDataEvent(`${ue.ESC}${l}${ue.ESC}\\`),!0),r=this._bufferService.buffer,s=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},F_=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(x2=e,e=t,t=x2),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};F_=zt([Se(0,Un)],F_);function S2(e){return 0<=e&&e<256}var u$=5e7,w2=12,h$=50,d$=class extends Ke{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new be),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>u$)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],s=this._action(r,t);if(s){let l=u=>performance.now()-n>=w2?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(l);return}let a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=w2)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>h$&&(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()}},U_=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let u=t.addMarker(t.ybase+t.y),d={data:e,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(d,u)),this._dataByLinkId.set(d.id,d),d.id}let n=e,r=this._getEntryIdKey(n),s=this._entriesWithId.get(r);if(s)return this.addLineToLink(s.id,t.ybase+t.y),s.id;let a=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(l,a)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};U_=zt([Se(0,Un)],U_);var C2=!1,f$=class extends Ke{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new dl),this._onBinary=this._register(new be),this.onBinary=this._onBinary.event,this._onData=this._register(new be),this.onData=this._onData.event,this._onLineFeed=this._register(new be),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new be),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new be),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new be),this._instantiationService=new BU,this.optionsService=this._register(new KU(e)),this._instantiationService.setService($n,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(B_)),this._instantiationService.setService(Un,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(j_)),this._instantiationService.setService(JM,this._logService),this.coreService=this._register(this._instantiationService.createInstance(P_)),this._instantiationService.setService(Zo,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(I_)),this._instantiationService.setService(QM,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(zo)),this._instantiationService.setService(OH,this.unicodeService),this._charsetService=this._instantiationService.createInstance(QU),this._instantiationService.setService(DH,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(U_),this._instantiationService.setService(e5,this._oscLinkService),this._inputHandler=this._register(new c$(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(En.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(En.forward(this._bufferService.onResize,this._onResize)),this._register(En.forward(this.coreService.onData,this._onData)),this._register(En.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new d$((t,n)=>this._inputHandler.parse(t,n))),this._register(En.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new be),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!C2&&(this._logService.warn("writeSync is unreliable and will be removed soon."),C2=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,D5),t=Math.max(t,O5),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(m2.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(m2(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Rt(()=>{for(let t of e)t.dispose()})}}},p$={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function m$(e,t,n,r){var l;let s={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?s.key=ue.ESC+"OA":s.key=ue.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=ue.ESC+"OD":s.key=ue.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=ue.ESC+"OC":s.key=ue.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=ue.ESC+"OB":s.key=ue.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":ue.DEL,e.altKey&&(s.key=ue.ESC+s.key);break;case 9:if(e.shiftKey){s.key=ue.ESC+"[Z";break}s.key=ue.HT,s.cancel=!0;break;case 13:s.key=e.altKey?ue.ESC+ue.CR:ue.CR,s.cancel=!0;break;case 27:s.key=ue.ESC,e.altKey&&(s.key=ue.ESC+ue.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;a?s.key=ue.ESC+"[1;"+(a+1)+"D":t?s.key=ue.ESC+"OD":s.key=ue.ESC+"[D";break;case 39:if(e.metaKey)break;a?s.key=ue.ESC+"[1;"+(a+1)+"C":t?s.key=ue.ESC+"OC":s.key=ue.ESC+"[C";break;case 38:if(e.metaKey)break;a?s.key=ue.ESC+"[1;"+(a+1)+"A":t?s.key=ue.ESC+"OA":s.key=ue.ESC+"[A";break;case 40:if(e.metaKey)break;a?s.key=ue.ESC+"[1;"+(a+1)+"B":t?s.key=ue.ESC+"OB":s.key=ue.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=ue.ESC+"[2~");break;case 46:a?s.key=ue.ESC+"[3;"+(a+1)+"~":s.key=ue.ESC+"[3~";break;case 36:a?s.key=ue.ESC+"[1;"+(a+1)+"H":t?s.key=ue.ESC+"OH":s.key=ue.ESC+"[H";break;case 35:a?s.key=ue.ESC+"[1;"+(a+1)+"F":t?s.key=ue.ESC+"OF":s.key=ue.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=ue.ESC+"[5;"+(a+1)+"~":s.key=ue.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=ue.ESC+"[6;"+(a+1)+"~":s.key=ue.ESC+"[6~";break;case 112:a?s.key=ue.ESC+"[1;"+(a+1)+"P":s.key=ue.ESC+"OP";break;case 113:a?s.key=ue.ESC+"[1;"+(a+1)+"Q":s.key=ue.ESC+"OQ";break;case 114:a?s.key=ue.ESC+"[1;"+(a+1)+"R":s.key=ue.ESC+"OR";break;case 115:a?s.key=ue.ESC+"[1;"+(a+1)+"S":s.key=ue.ESC+"OS";break;case 116:a?s.key=ue.ESC+"[15;"+(a+1)+"~":s.key=ue.ESC+"[15~";break;case 117:a?s.key=ue.ESC+"[17;"+(a+1)+"~":s.key=ue.ESC+"[17~";break;case 118:a?s.key=ue.ESC+"[18;"+(a+1)+"~":s.key=ue.ESC+"[18~";break;case 119:a?s.key=ue.ESC+"[19;"+(a+1)+"~":s.key=ue.ESC+"[19~";break;case 120:a?s.key=ue.ESC+"[20;"+(a+1)+"~":s.key=ue.ESC+"[20~";break;case 121:a?s.key=ue.ESC+"[21;"+(a+1)+"~":s.key=ue.ESC+"[21~";break;case 122:a?s.key=ue.ESC+"[23;"+(a+1)+"~":s.key=ue.ESC+"[23~";break;case 123:a?s.key=ue.ESC+"[24;"+(a+1)+"~":s.key=ue.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?s.key=ue.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=ue.DEL:e.keyCode===219?s.key=ue.ESC:e.keyCode===220?s.key=ue.FS:e.keyCode===221&&(s.key=ue.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(l=p$[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(u)s.key=ue.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let d=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(d);e.shiftKey&&(h=h.toUpperCase()),s.key=ue.ESC+h}else if(e.keyCode===32)s.key=ue.ESC+(e.ctrlKey?ue.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let d=e.code.slice(3,4);e.shiftKey||(d=d.toLowerCase()),s.key=ue.ESC+d,s.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?s.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(s.key=ue.US),e.key==="@"&&(s.key=ue.NUL));break}return s}var Ft=0,g$=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Sf,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Sf,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((s,a)=>this._getKey(s)-this._getKey(a)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<r.length;s++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[s]=e[t],t++):r[s]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Ft=this._search(t),Ft===-1)||this._getKey(this._array[Ft])!==t)return!1;do if(this._array[Ft]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Ft),!0;while(++Ft<this._array.length&&this._getKey(this._array[Ft])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,a)=>s-a),t=0,n=new Array(this._array.length-e.length),r=0;for(let s=0;s<this._array.length;s++)e[t]===s?t++:n[r++]=this._array[s];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ft=this._search(e),!(Ft<0||Ft>=this._array.length)&&this._getKey(this._array[Ft])===e))do yield this._array[Ft];while(++Ft<this._array.length&&this._getKey(this._array[Ft])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ft=this._search(e),!(Ft<0||Ft>=this._array.length)&&this._getKey(this._array[Ft])===e))do t(this._array[Ft]);while(++Ft<this._array.length&&this._getKey(this._array[Ft])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,s=this._getKey(this._array[r]);if(s>e)n=r-1;else if(s<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},hv=0,k2=0,v$=class extends Ke{constructor(){super(),this._decorations=new g$(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new be),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new be),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Rt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new _$(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,s=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,s=r+(a.options.width??1),e>=r&&e<s&&(!n||(a.options.layer??"bottom")===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,s=>{hv=s.options.x??0,k2=hv+(s.options.width??1),e>=hv&&e<k2&&(!n||(s.options.layer??"bottom")===n)&&r(s)})}},_$=class extends Gs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new be),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new be),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=At.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=At.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},y$=1e3,b$=class{constructor(e,t=y$){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=r-this._lastRefreshMs,a=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},a)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},E2=20,wf=class extends Ke{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let a=0;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);if(this._topBoundaryFocusListener=a=>this._handleBoundaryFocus(a,0),this._bottomBoundaryFocusListener=a=>this._handleBoundaryFocus(a,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new b$(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(a=>this._handleResize(a.rows))),this._register(this._terminal.onRender(a=>this._refreshRows(a.start,a.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(a=>this._handleChar(a))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
470
|
+
`))),this._register(this._terminal.onA11yTab(a=>this._handleTab(a))),this._register(this._terminal.onKey(a=>this._handleKey(a.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Be(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Rt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<E2+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
471
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===E2+1&&(this._liveRegion.textContent+=l_.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let s=e;s<=t;s++){let a=n.lines.get(n.ydisp+s),l=[],u=(a==null?void 0:a.translateToString(!0,void 0,void 0,l))||"",d=(n.ydisp+s+1).toString(),h=this._rowElements[s];h&&(u.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=u,this._rowColumns.set(h,l)),h.setAttribute("aria-posinset",d),h.setAttribute("aria-setsize",r),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],s=n.getAttribute("aria-posinset"),a=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===a||e.relatedTarget!==r)return;let l,u;if(t===0?(l=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(l=this._rowElements.shift(),u=n,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let d=this._createAccessibilityTreeNode();this._rowElements.unshift(d),this._rowContainer.insertAdjacentElement("afterbegin",d)}else{let d=this._createAccessibilityTreeNode();this._rowElements.push(d),this._rowContainer.appendChild(d)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var u;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:((u=r.textContent)==null?void 0:u.length)??0}),!this._rowContainer.contains(n.node))return;let s=({node:d,offset:h})=>{let p=d instanceof Text?d.parentNode:d,m=parseInt(p==null?void 0:p.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(p);if(!_)return console.warn("columns is null. Race condition?"),null;let y=h<_.length?_[h]:_.slice(-1)[0]+1;return y>=this._terminal.cols&&(++m,y=0),{row:m,column:y}},a=s(t),l=s(n);if(!(!a||!l)){if(a.row>l.row||a.row===l.row&&a.column>=l.column)throw new Error("invalid range");this._terminal.select(a.column,a.row,(l.row-a.row)*this._terminal.cols-a.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var s,a;e.style.transform="";let t=e.getBoundingClientRect().width,n=(a=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:a[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};wf=zt([Se(1,xb),Se(2,os),Se(3,as)],wf);var $_=class extends Ke{constructor(e,t,n,r,s){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new be),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new be),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Rt(()=>{var a;$o(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(a=this._activeProviderReplies)==null||a.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Be(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Be(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Be(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Be(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let r=0;r<n.length;r++){let s=n[r];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var r,s;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(a=>{a==null||a.forEach(l=>{l.link.dispose&&l.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[a,l]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(a)&&(n=this._checkLinkProviderResult(a,e,n)):l.provideLinks(e.y,u=>{var h,p;if(this._isMouseOut)return;let d=u==null?void 0:u.map(m=>({link:m}));(h=this._activeProviderReplies)==null||h.set(a,d),n=this._checkLinkProviderResult(a,e,n),((p=this._activeProviderReplies)==null?void 0:p.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let s=t.get(r);if(s)for(let a=0;a<s.length;a++){let l=s[a],u=l.link.range.start.y<e?0:l.link.range.start.x,d=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let h=u;h<=d;h++){if(n.has(h)){s.splice(a--,1);break}n.add(h)}}}}_checkLinkProviderResult(e,t,n){var a;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),s=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(s=!0);if(!s&&r){let l=r.find(u=>this._linkAtPosition(u.link,t));l&&(n=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let l=0;l<this._activeProviderReplies.size;l++){let u=(a=this._activeProviderReplies.get(l))==null?void 0:a.find(d=>this._linkAtPosition(d.link,t));if(u){n=!0,this._handleNewLink(u);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&x$(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,$o(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.pointerCursor},set:n=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.underline},set:n=>{var r,s,a;(r=this._currentLink)!=null&&r.state&&((a=(s=this._currentLink)==null?void 0:s.state)==null?void 0:a.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let r=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(r,s),this._lastMouseEvent)){let a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,s=t.y*this._bufferService.cols+t.x;return n<=s&&s<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,s){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:s}}};$_=zt([Se(1,Sb),Se(2,as),Se(3,Un),Se(4,n5)],$_);function x$(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var S$=class extends f${constructor(e={}){super(e),this._linkifier=this._register(new dl),this.browser=x5,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new dl),this._onCursorMove=this._register(new be),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new be),this.onKey=this._onKey.event,this._onRender=this._register(new be),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new be),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new be),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new be),this.onBell=this._onBell.event,this._onFocus=this._register(new be),this._onBlur=this._register(new be),this._onA11yCharEmitter=this._register(new be),this._onA11yTabEmitter=this._register(new be),this._onWillOpen=this._register(new be),this._setup(),this._decorationService=this._instantiationService.createInstance(v$),this._instantiationService.setService(zu,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(hU),this._instantiationService.setService(n5,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(u_)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(En.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(En.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(En.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(En.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Rt(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,r="";switch(t.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+t.index}switch(t.type){case 0:let s=Ct.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ue.ESC}]${r};${a$(s)}${y5.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(a=>a.ansi[t.index]=Xt.toColor(...t.color));else{let a=n;this._themeService.modifyColors(l=>l[a]=Xt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(wf,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ue.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ue.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,s=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*s,l=this.buffer.y*this._renderService.dimensions.css.cell.height,u=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=l+"px",this.textarea.style.width=a+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Be(this.element,"copy",t=>{this.hasSelection()&&EH(t,this._selectionService)}));let e=t=>RH(t,this.textarea,this.coreService,this.optionsService);this._register(Be(this.textarea,"paste",e)),this._register(Be(this.element,"paste",e)),S5?this._register(Be(this.element,"mousedown",t=>{t.button===2&&jC(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Be(this.element,"contextmenu",t=>{jC(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Ab&&this._register(Be(this.element,"auxclick",t=>{t.button===1&&KM(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Be(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Be(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Be(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Be(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Be(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Be(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Be(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var s;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((s=this.element)==null?void 0:s.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Be(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",a_.get()),k5||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(cU,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(os,this._coreBrowserService),this._register(Be(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Be(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(N_,this._document,this._helperContainer),this._instantiationService.setService(ip,this._charSizeService),this._themeService=this._instantiationService.createInstance(z_),this._instantiationService.setService(El,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(bf),this._instantiationService.setService(t5,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(O_,this.rows,this.screenElement)),this._instantiationService.setService(as,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(T_,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D_),this._instantiationService.setService(Sb,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance($_,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(E_,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(L_,this.element,this.screenElement,r)),this._instantiationService.setService(zH,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(En.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var a;this._selectionService.refresh(),(a=this._viewport)==null||a.queueSync()})),this._register(this._instantiationService.createInstance(R_,this.screenElement)),this._register(Be(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),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(wf,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(yf,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(yf,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(A_,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(a){var h,p,m,_,y;let l=e._mouseService.getMouseReportCoords(a,e.screenElement);if(!l)return!1;let u,d;switch(a.overrideType||a.type){case"mousemove":d=32,a.buttons===void 0?(u=3,a.button!==void 0&&(u=a.button<3?a.button:3)):u=a.buttons&1?0:a.buttons&4?1:a.buttons&2?2:3;break;case"mouseup":d=0,u=a.button<3?a.button:3;break;case"mousedown":d=1,u=a.button<3?a.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(a)===!1)return!1;let S=a.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(a,(_=(m=(p=(h=e._renderService)==null?void 0:h.dimensions)==null?void 0:p.device)==null?void 0:m.cell)==null?void 0:_.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;d=S<0?0:1,u=4;break;default:return!1}return d===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:u,action:d,ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:a=>(n(a),a.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(a)),wheel:a=>(n(a),this.cancel(a,!0)),mousedrag:a=>{a.buttons&&n(a)},mousemove:a=>{a.buttons||n(a)}};this._register(this.coreMouseService.onProtocolChange(a=>{a?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(a)),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()),a&8?r.mousemove||(t.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),a&16?r.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),a&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),a&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Be(t,"mousedown",a=>{if(a.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(a)))return n(a),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(a)})),this._register(Be(t,"wheel",a=>{var l,u,d,h,p;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(a)===!1)return!1;if(!this.buffer.hasScrollback){if(a.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(a,(h=(d=(u=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:u.device)==null?void 0:d.cell)==null?void 0:h.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return this.cancel(a,!0);let m=ue.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(a.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(a,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){VM(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}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 e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=m$(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===ue.ETX||n.key===ue.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(w$(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var n;(n=this._charSizeService)==null||n.measure()}clear(){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Yt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(ue.ESC+"[I"):this.coreService.triggerDataEvent(ue.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ue.ESC}[4;${n};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ue.ESC}[6;${s};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function w$(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var C$=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},k$=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new $r)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},R2=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new k$(t)}getNullCell(){return new $r}},E$=class extends Ke{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new be),this.onBufferChange=this._onBufferChange.event,this._normal=new R2(this._core.buffers.normal,"normal"),this._alternate=new R2(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)}},R$=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,r)=>t(n,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},T$=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},M$=["cols","rows"],di=0,A$=class extends Ke{constructor(e){super(),this._core=this._register(new S$(e)),this._addonManager=this._register(new C$),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],n=(r,s)=>{this._checkReadonlyOptions(r),this._core.options[r]=s};for(let r in this._core.options){let s={get:t.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,s)}}_checkReadonlyOptions(e){if(M$.includes(e))throw new Error(`Option "${e}" 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 R$(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new T$(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 E$(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
472
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return a_.get()},set promptLabel(e){a_.set(e)},get tooMuchOutput(){return l_.get()},set tooMuchOutput(e){l_.set(e)}}}_verifyIntegers(...e){for(di of e)if(di===1/0||isNaN(di)||di%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(di of e)if(di&&(di===1/0||isNaN(di)||di%1!==0||di<0))throw new Error("This API only accepts positive integers")}};const z5="lever-theme",j5=x.createContext(void 0),N$=e=>e==="light"||e==="dark"||e==="system",B5=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",T2=e=>{if(typeof document>"u")return;const t=e==="system"?B5():e;document.documentElement.classList.toggle("dark",t==="dark")},D$=()=>{if(typeof window>"u")return"system";const e=window.localStorage.getItem(z5);return N$(e)?e:"system"};function O$({children:e}){const[t,n]=x.useState(D$);x.useEffect(()=>{T2(t),typeof window<"u"&&window.localStorage.setItem(z5,t)},[t]),x.useEffect(()=>{if(t!=="system")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>T2("system");return s.addEventListener?(s.addEventListener("change",a),()=>s.removeEventListener("change",a)):(s.addListener(a),()=>s.removeListener(a))},[t]);const r=x.useMemo(()=>{const s=t==="system"?B5():t;return{theme:t,resolvedTheme:s,setTheme:n}},[t]);return g.jsx(j5.Provider,{value:r,children:e})}function P5(){const e=x.useContext(j5);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const L$={foreground:"#0f172a",background:"transparent",cursor:"#000000",cursorAccent:"#ffffff",selectionBackground:"rgba(221,228,236,0.55)",selectionInactiveBackground:"rgba(221,228,236,0.38)",black:"#0f172a",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#94a3b8",brightBlack:"#475569",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#e2e8f0"},z$={foreground:"#f8fafc",background:"transparent",cursor:"#ffffff",cursorAccent:"#000000",selectionBackground:"rgba(248,250,252,0.28)",selectionInactiveBackground:"rgba(248,250,252,0.18)",black:"#0f172a",red:"#f87171",green:"#4ade80",yellow:"#facc15",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#cbd5e1",brightBlack:"#64748b",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#f8fafc"};function I5(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function H5(e,t){var S,w,C,k,T;const n=e.element,r=(k=(C=(w=(S=e._core)==null?void 0:S._renderService)==null?void 0:w.dimensions)==null?void 0:C.css)==null?void 0:k.cell,s=(r==null?void 0:r.width)??0,a=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(s)||!Number.isFinite(a)||s<=0||a<=0)return null;const l=t.getBoundingClientRect(),u=window.getComputedStyle(t),d=window.getComputedStyle(n),h=e.options.scrollback===0?0:((T=e.options.overviewRuler)==null?void 0:T.width)??14,p=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight)+parseFloat(d.paddingLeft)+parseFloat(d.paddingRight),m=parseFloat(u.paddingTop)+parseFloat(u.paddingBottom)+parseFloat(d.paddingTop)+parseFloat(d.paddingBottom),_=Math.max(0,l.width-p-h-1),y=Math.max(0,l.height-m);return{cols:Math.max(2,Math.floor(_/s)),rows:Math.max(1,Math.floor(y/a))}}function wd(e){e.refresh(0,Math.max(0,e.rows-1))}function Cd(e,t,n,r,s){const a=H5(e,t)??I5(e);return n.current&&n.current.cols===a.cols&&n.current.rows===a.rows||(e.resize(a.cols,a.rows),n.current=a,r&&s(a.cols,a.rows)),a}function j$({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:s,clearVersion:a=0,focusRequestVersion:l=0,onPathChange:u}){const{resolvedTheme:d}=P5(),h=x.useRef(null),p=x.useRef(null),m=x.useRef(null),_=x.useRef(!1),y=x.useRef(0),S=x.useRef(null),w=x.useRef(null),[C,k]=x.useState(null),[T,R]=x.useState(null),M=d==="dark"?z$:L$,L=(z,H)=>{n.command({type:"terminal.resize",terminalId:t,cols:z,rows:H}).catch(()=>{})},O=()=>{const z=()=>{const H=p.current,G=h.current;!H||!G||!_.current||Cd(H,G,w,!0,L)};requestAnimationFrame(()=>{z(),setTimeout(z,0)})};return x.useEffect(()=>{const z=new A$({scrollback:r,cursorBlink:!0,cursorStyle:"bar",cursorWidth:1,lineHeight:1.1,convertEol:!1,allowTransparency:!0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,theme:M}),H=new pH;z.loadAddon(H),z.loadAddon(new xH),p.current=z;const G=h.current;G&&(z.open(G),m.current&&z.write(m.current),Cd(z,G,w,!1,()=>{}),wd(z),O());const B=z.onData(U=>{n.command({type:"terminal.input",terminalId:t,data:U}).catch(V=>{R(V instanceof Error?V.message:String(V))})}),$=z.onResize(({cols:U,rows:V})=>{if(!_.current)return;const F={cols:U,rows:V};w.current&&w.current.cols===U&&w.current.rows===V||(w.current=F,L(U,V))}),I=new ResizeObserver(()=>{const U=p.current,V=h.current;!U||!V||Cd(U,V,w,_.current,(F,j)=>{n.command({type:"terminal.resize",terminalId:t,cols:F,rows:j}).catch(()=>{})})});return G&&I.observe(G),()=>{I.disconnect(),$.dispose(),B.dispose(),m.current=H.serialize(),z.dispose(),p.current=null}},[r,n,t,M]),x.useEffect(()=>{const z=p.current;z&&(z.options.scrollback=r)},[r]),x.useEffect(()=>{const z=p.current;z&&(z.options.theme=M,wd(z))},[M]),x.useEffect(()=>{if(l===0)return;const z=p.current;z&&requestAnimationFrame(()=>{z.focus()})},[l]),x.useEffect(()=>{if(a===0)return;const z=p.current;z&&(_.current=!1,y.current+=1,S.current=null,m.current=null,k(null),R(null),z.reset(),wd(z),n.command({type:"terminal.close",terminalId:t}).catch(H=>{R(H instanceof Error?H.message:String(H))}))},[a,n,t]),x.useEffect(()=>{u==null||u((C==null?void 0:C.cwd)??null)},[C==null?void 0:C.cwd,u]),x.useEffect(()=>{const z=B=>{const $=p.current;if(!$)return;const I=JSON.stringify({cwd:B.cwd,shell:B.shell,cols:B.cols,rows:B.rows,scrollback:B.scrollback,status:B.status,exitCode:B.exitCode,serializedState:B.serializedState});if(S.current===I){k({cwd:B.cwd,shell:B.shell,status:B.status,exitCode:B.exitCode}),m.current=B.serializedState||null;return}S.current=I,k({cwd:B.cwd,shell:B.shell,status:B.status,exitCode:B.exitCode}),m.current=B.serializedState||null,$.options.scrollback=B.scrollback,$.reset(),B.serializedState&&$.write(B.serializedState),wd($)},H=()=>{const B=p.current,$=h.current;if(!B||!$)return;const I=H5(B,$)??I5(B);B.resize(I.cols,I.rows),w.current=I,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:I.cols,rows:I.rows,scrollback:r}).then(U=>{_.current=!0,R(null),U&&z(U),O()}).catch(U=>{R(U instanceof Error?U.message:String(U))})},G=()=>{const B=++y.current,$=()=>{if(y.current!==B)return;const I=p.current,U=h.current;if(!I||!U)return;Cd(I,U,w,!1,()=>{});const V=U.getBoundingClientRect();if(V.width<=0||V.height<=0){requestAnimationFrame($);return}H()};requestAnimationFrame(()=>{requestAnimationFrame($)})};return G(),n.subscribeTerminal(t,{onSnapshot:B=>{if(!B){_.current=!1,S.current=null,s==="connected"&&G();return}_.current=!0,R(null),z(B),O()},onEvent:B=>{const $=p.current;if($){if(B.type==="terminal.output"){$.write(B.data);return}B.type==="terminal.exit"&&k(I=>({cwd:(I==null?void 0:I.cwd)??"",shell:(I==null?void 0:I.shell)??"",status:"exited",exitCode:B.exitCode}))}}})},[s,e,r,n,t]),g.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden pb-4",children:[g.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden px-3 py-1",children:g.jsx("div",{ref:h,className:"kanna-terminal min-h-0 min-w-0 flex-1 overflow-hidden w-full"})}),T?g.jsxs("div",{className:"px-3 py-1 text-xs text-destructive",children:["Terminal error: ",T]}):null]})}const B$=24;function F5(e){return e+B$}function P$(e,t){return Math.max(1,e)*F5(t)}function M2({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:s,minColumnWidth:a,focusRequestVersion:l=0,splitTerminalShortcut:u,onAddTerminal:d,onRemoveTerminal:h,onTerminalLayout:p}){const m=x.useRef(null),_=x.useRef({}),y=x.useRef([]),[S,w]=x.useState(0),[C,k]=x.useState({}),[T,R]=x.useState({});x.useLayoutEffect(()=>{const G=m.current;if(!G)return;const B=()=>{w(G.getBoundingClientRect().width)},$=new ResizeObserver(B);return $.observe(G),B(),()=>$.disconnect()},[]);const M=t.terminals.length,L=F5(a),O=P$(M,a),z=Math.max(S,O),H=x.useMemo(()=>t.terminals.map(G=>G.id).join(":"),[t.terminals]);return x.useLayoutEffect(()=>{const G=y.current,B=t.terminals.map(U=>U.id),$=B.find(U=>!G.includes(U));if(y.current=B,!$||G.length===0)return;const I=_.current[$];I&&I.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t.terminals]),g.jsx("div",{className:"flex h-full min-h-0 flex-col",children:g.jsx("div",{ref:m,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:g.jsx("div",{className:"h-full min-h-0",style:{width:z||"100%"},children:g.jsx(Id,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:G=>p(e,t.terminals.map(B=>G[B.id]??B.size)),children:t.terminals.map((G,B)=>g.jsxs(x.Fragment,{children:[g.jsx(Ao,{id:G.id,defaultSize:`${G.size}%`,minSize:`${L}px`,className:"min-h-0 overflow-hidden",style:{minWidth:L},children:g.jsxs("div",{ref:$=>{_.current[G.id]=$},className:"flex h-full min-h-0 min-w-0 flex-col border-r border-border bg-transparent last:border-r-0",style:{minWidth:L},children:[g.jsxs("div",{className:"flex items-center gap-2 px-3 pr-2 pt-2 pb-1",children:[g.jsx("div",{className:"min-w-0 flex-1 text-left",children:g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("div",{className:"shrink-0 text-sm font-medium",children:"Terminal"}),g.jsx("div",{className:"min-w-0 truncate text-xs text-muted-foreground",children:C[G.id]??""})]})}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(nt,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>R($=>({...$,[G.id]:($[G.id]??0)+1})),children:g.jsx(wj,{className:"size-3.5"})}),g.jsxs(Ic,{children:[g.jsx(Hc,{asChild:!0,children:g.jsx(nt,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>d(e,G.id),children:g.jsx(Ry,{className:"size-3.5"})})}),g.jsx(Ya,{side:"bottom",shortcut:u})]}),g.jsx(nt,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>h(e,G.id),children:g.jsx(vl,{className:"size-3.5"})})]})]}),g.jsx(j$,{projectId:e,terminalId:G.id,socket:n,scrollback:s,connectionStatus:r,clearVersion:T[G.id]??0,focusRequestVersion:B===0?l:0,onPathChange:$=>k(I=>I[G.id]===$?I:{...I,[G.id]:$})})]})}),B<t.terminals.length-1?g.jsx(Hd,{withHandle:!0,orientation:"horizontal"}):null]},G.id))},H)})})})}function A2(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function I$(e){var r;if(!e)return null;const t=e.trim();if(!t||/^(https?:|mailto:|ftp:|file:)/i.test(t)||!t.startsWith("/"))return null;const n=/^(?<path>\/.+?)#L(?<line>\d+)(?:C(?<column>\d+))?$/.exec(t);return(r=n==null?void 0:n.groups)!=null&&r.path?{path:n.groups.path,line:A2(n.groups.line),column:A2(n.groups.column)}:{path:t}}function dv(e,t){if(!e)return"";if(t){const n=t.endsWith("/")?t:`${t}/`;if(e.startsWith(n))return e.slice(n.length);if(e===t)return""}return e.replace(/^\/home\/user\/workspace\//,"")}const Nb=()=>{},U5=x.createContext(Nb);function H$({children:e,onOpenLocalLink:t}){return g.jsx(U5.Provider,{value:t??Nb,children:e})}const W_={Task:tf,TaskOutput:tf,Bash:My,Glob:$g,Grep:$g,ExitPlanMode:Lw,Read:Mj,Edit:kj,Write:Rj,NotebookEdit:lR,WebFetch:$z,TodoWrite:ij,WebSearch:$g,KillShell:d6,AskUserQuestion:oR,Skill:iu,EnterPlanMode:Lw},$5=v6;function W5(e){return W_[e]?W_[e]:$5}function no({children:e,className:t}){return g.jsx("div",{className:xe("flex gap-3 justify-start items-center",t),children:e})}function F$({children:e,className:t}){return g.jsx("div",{className:xe("flex items-center gap-1.5 text-xs",t),children:e})}function Qs({children:e,className:t}){return g.jsx("span",{className:xe("font-medium text-foreground/80",t),children:e})}function U$({children:e}){return g.jsx("span",{className:"text-muted-foreground",children:e})}function ap({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,s]=x.useState(n);return g.jsxs("div",{className:"flex flex-col w-full",children:[g.jsxs("button",{onClick:()=>s(!r),className:`group/expandable-row cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${r?"":"hover:opacity-60 transition-opacity"}`,children:[g.jsx("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:e}),g.jsx(es,{className:`h-4.5 w-4.5 text-muted-icon translate-y-[0.5px] transition-all duration-200 opacity-0 group-hover/expandable-row:opacity-100 ${r?"rotate-90 opacity-100":""}`})]}),r&&t]})}function N2({label:e,children:t,copyText:n}){const[r,s]=x.useState(!1),a=n??Cf(t),l=x.useCallback(async()=>{await navigator.clipboard.writeText(a),s(!0),setTimeout(()=>s(!1),2e3)},[a]);return g.jsxs("div",{children:[g.jsx("span",{className:"font-medium text-muted-foreground",children:e}),g.jsxs("div",{className:"relative group/codeblock",children:[g.jsx("pre",{className:"my-1 text-xs font-mono whitespace-no-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto w-full",children:t}),g.jsx(nt,{variant:"ghost",size:"icon",className:xe("absolute top-[4px] right-[4px] z-10 h-6.5 w-6.5 rounded-sm text-muted-foreground opacity-0 group-hover/codeblock:opacity-100 transition-opacity",!r&&"hover:text-foreground",r&&"hover:!bg-transparent hover:!border-transparent"),onClick:l,children:r?g.jsx(Po,{className:"h-3.5 w-3.5 text-green-400"}):g.jsx(Ff,{className:"h-4 w-4"})})]})]})}function q5({children:e,icon:t,className:n}){return g.jsxs("span",{className:xe("inline-flex items-center gap-1 px-2 py-1 bg-muted border border-border rounded-full",n),children:[t&&g.jsx(t,{className:"h-3 w-3 text-muted-foreground"}),e]})}function lp({children:e,className:t}){return g.jsxs("div",{className:xe("grid grid-cols-[auto_1fr] gap-2 min-w-0",t),children:[g.jsx("div",{className:" min-w-5 flex flex-col relative items-center justify-center",children:g.jsx("div",{className:"min-h-full w-[1px] bg-muted-foreground/20"})}),g.jsx("div",{className:"-ml-[1px] min-w-0 overflow-hidden",children:e})]})}function Cf(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(Cf).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return Cf(t.children)}return""}function D2(e,t){return x.isValidElement(e)?x.cloneElement(e,{className:xe(e.props.className,t)}):e}const Db={h1:({children:e})=>g.jsx("h1",{className:"text-[20px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h2:({children:e})=>g.jsx("h2",{className:"text-[18px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h3:({children:e})=>g.jsx("h3",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h4:({children:e})=>g.jsx("h4",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h5:({children:e})=>g.jsx("h5",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h6:({children:e})=>g.jsx("h6",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),pre:({children:e,...t})=>{const[n,r]=x.useState(!1),s=Cf(e),a=async()=>{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)};return g.jsxs("div",{className:"relative overflow-x-auto max-w-full min-w-0 no-code-highlight group/pre",children:[g.jsx("pre",{className:"min-w-0 rounded-xl py-2.5 px-3.5 [.no-pre-highlight_&]:bg-background",...t,children:e}),g.jsx(nt,{variant:"ghost",size:"icon",className:xe("absolute top-[35px] -translate-y-[50%] -translate-x-[1px] rounded-md right-1.5 h-8 w-8 text-muted-foreground opacity-0 group-hover/pre:opacity-100 transition-opacity",!n&&"hover:text-foreground",n&&"hover:!bg-transparent hover:!border-transparent"),onClick:a,children:n?g.jsx(Po,{className:"h-4 w-4 text-green-400"}):g.jsx(Ff,{className:"h-4 w-4"})})]})},code:({children:e,className:t,...n})=>t?g.jsx("code",{className:"block text-xs whitespace-pre",...n,children:e}):g.jsx("code",{className:"break-all px-1 bg-border/60 dark:[.no-pre-highlight_&]:bg-background dark:[.text-pretty_&]:bg-neutral [.no-code-highlight_&]:!bg-transparent py-0.5 rounded text-sm whitespace-wrap",...n,children:e}),table:({children:e,...t})=>g.jsx("div",{className:"border border-border rounded-xl overflow-x-auto",children:g.jsx("table",{className:"table-auto min-w-full divide-y divide-border bg-background",...t,children:e})}),tbody:({children:e,...t})=>g.jsx("tbody",{className:"divide-y divide-border",...t,children:e}),th:({children:e,...t})=>g.jsx("th",{className:"text-left text-xs uppercase text-muted-foreground tracking-wider p-2 pl-0 first:pl-3 bg-muted dark:bg-card [&_*]:font-semibold",...t,children:e}),td:({children:e,...t})=>g.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal ",...t,children:e}),p:({children:e,...t})=>g.jsx("p",{className:"break-words mt-5 mb-3 first:mt-0 last:mb-0",...t,children:e}),blockquote:({children:e,...t})=>(()=>{const n=x.Children.toArray(e),r=n[0];r!==void 0&&(n[0]=D2(r,"mt-0"));const s=n.length-1,a=n[s];return a!==void 0&&(n[s]=D2(a,"mb-0")),g.jsx("blockquote",{className:"my-2 mt-5 mb-3 first:mt-0 last:mb-0 border-l-2 border-border/80 pl-2 text-muted-foreground",...t,children:n})})(),a:({children:e,...t})=>g.jsx("a",{className:"transition-all underline decoration-2 text-orange-500 decoration-orange-500/50 hover:text-orange-500/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40 ",target:"_blank",rel:"noopener noreferrer",...t,children:e})};function cp(e){return{...Db,a:({children:t,href:n,onClick:r,...s})=>{const a=x.useContext(U5),l=I$(n);return g.jsx("a",{className:"transition-all underline decoration-2 text-orange-500 decoration-orange-500/50 hover:text-orange-500/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40 ",href:n,target:l?void 0:"_blank",rel:l?void 0:"noopener noreferrer",onClick:u=>{r==null||r(u),!(u.defaultPrevented||!l||a===Nb)&&(u.preventDefault(),a(l))},...s,children:t})}}}({...Db});const $$={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function W$({status:e}){const t=(e?$$[e]:void 0)||"Processing...",n=e==="failed";return g.jsx(no,{className:"ml-[1px]",children:g.jsxs(F$,{children:[n?g.jsx(vl,{className:"size-4.5 text-red-500"}):g.jsx(is,{className:"size-4.5 animate-spin text-muted-icon"}),g.jsx(Xf,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const V5=x.forwardRef(({className:e,children:t,...n},r)=>g.jsx("div",{ref:r,className:xe("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));V5.displayName="ScrollArea";const K5={toggleEmbeddedTerminal:"Toggle Embedded Terminal",toggleRightSidebar:"Toggle Right Sidebar",openInFinder:"Open In Finder",openInEditor:"Open In Editor",addSplitTerminal:"Add Split Terminal"};function fv(e){return(e??[]).join(", ")}function Nc(e){return e.split(",").map(t=>t.trim()).map(t=>t.toLowerCase()).filter(Boolean)}const q$=new Map([["cmd","meta"],["meta","meta"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["option","alt"],["shift","shift"]]);function V$(e,t){const n=K$(e);return n?t.key.toLowerCase()===n.key&&t.ctrlKey===n.ctrl&&t.metaKey===n.meta&&t.altKey===n.alt&&t.shiftKey===n.shift:!1}function Dc(e,t,n){return((e==null?void 0:e.bindings[t])??$s[t]).some(s=>V$(s,n))}function G5(e){return{bindings:{toggleEmbeddedTerminal:(e==null?void 0:e.bindings.toggleEmbeddedTerminal)??$s.toggleEmbeddedTerminal,toggleRightSidebar:(e==null?void 0:e.bindings.toggleRightSidebar)??$s.toggleRightSidebar,openInFinder:(e==null?void 0:e.bindings.openInFinder)??$s.openInFinder,openInEditor:(e==null?void 0:e.bindings.openInEditor)??$s.openInEditor,addSplitTerminal:(e==null?void 0:e.bindings.addSplitTerminal)??$s.addSplitTerminal},warning:(e==null?void 0:e.warning)??null,filePathDisplay:(e==null?void 0:e.filePathDisplay)??""}}function K$(e){const t=e.split("+").map(r=>r.trim()).filter(Boolean);if(t.length===0)return null;const n={key:"",ctrl:!1,meta:!1,alt:!1,shift:!1};for(const r of t){const s=r.toLowerCase(),a=q$.get(s);if(a==="ctrl"){n.ctrl=!0;continue}if(a==="meta"){n.meta=!0;continue}if(a==="alt"){n.alt=!0;continue}if(a==="shift"){n.shift=!0;continue}if(n.key)return null;n.key=s}return n.key?n:null}const up=20,q_=50,Y5=30;function X5(e){return Number.isFinite(e)?Math.min(q_,Math.max(up,e)):Y5}function G$(){return{isVisible:!1,size:up}}function pv(e,t){return e[t]??G$()}function Y$(e){return!e||typeof e!="object"?{projects:{}}:{projects:Object.fromEntries(Object.entries(e.projects??{}).map(([r,s])=>[r,{isVisible:!1,size:X5(s.size??Y5)}]))}}const Yd=Cl()(kl(e=>({projects:{},toggleVisibility:t=>e(n=>({projects:{...n.projects,[t]:{...pv(n.projects,t),isVisible:!pv(n.projects,t).isVisible}}})),setSize:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...pv(r.projects,t),size:X5(n)}}})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"right-sidebar-layouts",version:2,migrate:Y$})),X$={isVisible:!1,size:up},Z5=[68,32];function Z$(){return{isVisible:!1,mainSizes:[...Z5],terminals:[],nextTerminalIndex:0}}function Q$(e,t){return e[t]??Z$()}function mv(e){if(e.length===0)return[];const t=e.reduce((n,r)=>n+Math.max(r,0),0);return!Number.isFinite(t)||t<=0?Array.from({length:e.length},()=>100/e.length):e.map(n=>Math.max(n,0)/t*100)}function J$(e){let t=e,n="";do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return`Terminal ${n}`}function eW(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function Oc(e,t,n){return{...e,[t]:n(Q$(e,t))}}const Oo=Cl()(kl(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:Oc(r.projects,t,s=>{var d,h;const a=eW(s.terminals),l={id:((h=(d=globalThis.crypto)==null?void 0:d.randomUUID)==null?void 0:h.call(d))??`terminal-${Date.now()}-${s.nextTerminalIndex}`,title:J$(s.nextTerminalIndex),size:100/(a.length+1)},u=n?Math.max(a.findIndex(p=>p.id===n)+1,0):a.length;return{...s,isVisible:!0,nextTerminalIndex:s.nextTerminalIndex+1,terminals:[...a.slice(0,u),l,...a.slice(u)]}})})),removeTerminal:(t,n)=>e(r=>({projects:Oc(r.projects,t,s=>{const a=s.terminals.filter(u=>u.id!==n);if(a.length===0)return{...s,isVisible:!1,terminals:[]};const l=mv(a.map(u=>u.size));return{...s,terminals:a.map((u,d)=>({...u,size:l[d]??100/a.length}))}})})),toggleVisibility:t=>e(n=>({projects:Oc(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const s=mv(n);return{projects:Oc(r.projects,t,a=>({...a,mainSizes:s}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:Oc(r.projects,t,s=>{if(n.length!==s.terminals.length)return s;const a=mv(n);return{...s,terminals:s.terminals.map((l,u)=>({...l,size:a[u]??l.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"terminal-layouts",version:1})),tW={isVisible:!1,mainSizes:[...Z5],terminals:[],nextTerminalIndex:0},kf=1e3,V_=500,K_=5e3,Ef=450,G_=250,Y_=900,X_="cursor";function Z_(e){switch(e){case"vscode":return"code {path}";case"windsurf":return"windsurf {path}";case"custom":return"cursor {path}";case"cursor":default:return"cursor {path}"}}function nW(e){switch(e){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function O2(e){return Number.isFinite(e)?Math.min(K_,Math.max(V_,Math.round(e))):kf}function L2(e){return Number.isFinite(e)?Math.min(Y_,Math.max(G_,Math.round(e))):Ef}function z2(e){switch(e){case"vscode":case"windsurf":case"custom":case"cursor":return e;default:return X_}}function gv(e,t){const n=e==null?void 0:e.trim();return n&&n.length>0?n:Z_(t)}const Pr=Cl()(kl(e=>({scrollbackLines:kf,minColumnWidth:Ef,editorPreset:X_,editorCommandTemplate:Z_(X_),setScrollbackLines:t=>e({scrollbackLines:O2(t)}),setMinColumnWidth:t=>e({minColumnWidth:L2(t)}),setEditorPreset:t=>e(n=>{const r=z2(t);return{editorPreset:r,editorCommandTemplate:r==="custom"?gv(n.editorCommandTemplate,r):Z_(r)}}),setEditorCommandTemplate:t=>e(n=>({editorCommandTemplate:gv(t,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:e=>{const t=e,n=z2(t==null?void 0:t.editorPreset);return{scrollbackLines:O2((t==null?void 0:t.scrollbackLines)??kf),minColumnWidth:L2((t==null?void 0:t.minColumnWidth)??Ef),editorPreset:n,editorCommandTemplate:gv(t==null?void 0:t.editorCommandTemplate,n)}}})),Qa=350,rW=[.4,0,.2,1],iW=8,j2=1e-6;function sW(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function oW(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function aW(e,t,n){const r=1-e;return 3*r*r*t+6*r*e*(n-t)+3*e*e*(1-n)}function lW(e,t,n){let r=e;for(let s=0;s<iW;s+=1){const a=sW(r,t,n)-e;if(Math.abs(a)<j2)return r;const l=aW(r,t,n);if(Math.abs(l)<j2)break;r-=a/l}return r}function cW(e){if(e<=0)return 0;if(e>=1)return 1;const[t,n,r,s]=rW,a=lW(e,t,r);return oW(a,n,s)}function Q5(e,t,n){const r=cW(n);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function uW({projectId:e,shouldRenderRightSidebarLayout:t,showRightSidebar:n,rightSidebarSize:r}){const s=x.useRef(null),a=x.useRef(null),l=x.useRef(null),u=x.useRef(null),d=x.useRef(null),h=x.useRef(!1),p=x.useRef(null),m=x.useRef(!1),_=x.useRef(!1);return x.useEffect(()=>()=>{u.current!==null&&window.cancelAnimationFrame(u.current),d.current!==null&&window.clearTimeout(d.current)},[]),x.useLayoutEffect(()=>{var z,H,G,B,$,I;if(!t){u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null),h.current=!1;return}const y=s.current;if(!y)return;u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null);const S=p.current,w=S!==null&&S!==e,C=n&&!_.current,k=!m.current,T=n?[100-r,r]:[100,0],R=w||k&&n,M=C||k?[100,0]:[y.getLayout().workspace??T[0],y.getLayout().rightSidebar??T[1]];if(p.current=e,m.current=t,_.current=n,R||Math.abs(M[0]-T[0])<.1&&Math.abs(M[1]-T[1])<.1){y.setLayout({workspace:T[0],rightSidebar:T[1]}),(z=a.current)==null||z.setAttribute("data-right-sidebar-open",n?"true":"false"),(H=l.current)==null||H.setAttribute("data-right-sidebar-open",n?"true":"false"),(G=l.current)==null||G.setAttribute("data-right-sidebar-animated","false");return}h.current=!0,(B=a.current)==null||B.setAttribute("data-right-sidebar-open",n?"true":"false"),($=l.current)==null||$.setAttribute("data-right-sidebar-open",n?"true":"false"),(I=l.current)==null||I.setAttribute("data-right-sidebar-animated","true"),y.setLayout({workspace:M[0],rightSidebar:M[1]});const L=performance.now(),O=U=>{const V=Math.min(1,(U-L)/Qa),F=Q5(M,T,V);if(y.setLayout({workspace:F[0],rightSidebar:F[1]}),V<1){u.current=window.requestAnimationFrame(O);return}y.setLayout({workspace:T[0],rightSidebar:T[1]}),u.current=null,d.current=window.setTimeout(()=>{h.current=!1,d.current=null},0)};u.current=window.requestAnimationFrame(O)},[e,r,t,n]),x.useEffect(()=>{t||(m.current=!1,_.current=!1)},[t]),{isAnimating:h,panelGroupRef:s,sidebarPanelRef:a,sidebarVisualRef:l}}function hW({previousProjectId:e,projectId:t,previousShouldRenderTerminalLayout:n,previousShowTerminalPane:r,showTerminalPane:s,terminalLayout:a,liveLayout:l}){const u=e!==null&&e!==t,d=s&&!r,h=!n,p=e===null&&t!==null,m=s?a.mainSizes:[100,0];return{currentLayout:d||h?[100,0]:l,shouldSkipAnimation:u||p&&h,targetLayout:m}}function dW({chatInputRef:e,projectId:t,shouldRenderTerminalLayout:n,showTerminalPane:r,terminalLayout:s}){const a=x.useRef(null),l=x.useRef(null),u=x.useRef(null),d=x.useRef(null),h=x.useRef(null),p=x.useRef(!1),m=x.useRef(null),_=x.useRef(!1),y=x.useRef(!1),S=x.useRef(!1),[w,C]=x.useState(0);return x.useEffect(()=>{var M;const k=m.current,T=k!==null&&k!==t,R=S.current;!T&&r&&!R&&C(L=>L+1),!T&&!r&&R&&((M=e.current)==null||M.focus({preventScroll:!0})),S.current=r,m.current=t},[e,t,r]),x.useEffect(()=>()=>{d.current!==null&&window.cancelAnimationFrame(d.current),h.current!==null&&window.clearTimeout(h.current)},[]),x.useLayoutEffect(()=>{var H,G,B,$,I,U;if(!n){d.current!==null&&(window.cancelAnimationFrame(d.current),d.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null),p.current=!1;return}const k=a.current;if(!k)return;d.current!==null&&(window.cancelAnimationFrame(d.current),d.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null);const T=m.current,{currentLayout:R,shouldSkipAnimation:M,targetLayout:L}=hW({previousProjectId:T,projectId:t,previousShouldRenderTerminalLayout:_.current,previousShowTerminalPane:y.current,showTerminalPane:r,terminalLayout:s,liveLayout:[k.getLayout().chat??s.mainSizes[0],k.getLayout().terminal??s.mainSizes[1]]});if(_.current=n,y.current=r,M||Math.abs(R[0]-L[0])<.1&&Math.abs(R[1]-L[1])<.1){k.setLayout({chat:L[0],terminal:L[1]}),(H=l.current)==null||H.setAttribute("data-terminal-open",r?"true":"false"),(G=u.current)==null||G.setAttribute("data-terminal-open",r?"true":"false"),(B=u.current)==null||B.setAttribute("data-terminal-animated","false");return}p.current=!0,($=l.current)==null||$.setAttribute("data-terminal-open",r?"true":"false"),(I=u.current)==null||I.setAttribute("data-terminal-open",r?"true":"false"),(U=u.current)==null||U.setAttribute("data-terminal-animated","true"),k.setLayout({chat:R[0],terminal:R[1]});const O=performance.now(),z=V=>{const F=Math.min(1,(V-O)/Qa),j=Q5(R,L,F);if(k.setLayout({chat:j[0],terminal:j[1]}),F<1){d.current=window.requestAnimationFrame(z);return}k.setLayout({chat:L[0],terminal:L[1]}),d.current=null,h.current=window.setTimeout(()=>{p.current=!1,h.current=null},0)};d.current=window.requestAnimationFrame(z)},[t,n,r,s.mainSizes]),x.useEffect(()=>{n||(_.current=!1,y.current=!1)},[n]),{isAnimating:p,mainPanelGroupRef:a,terminalFocusRequestVersion:w,terminalPanelRef:l,terminalVisualRef:u}}function fW(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const pW=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mW=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gW={};function B2(e,t){return(gW.jsx?mW:pW).test(e)}const vW=/[ \t\n\f\r]/g;function _W(e){return typeof e=="object"?e.type==="text"?P2(e.value):!1:P2(e)}function P2(e){return e.replace(vW,"")===""}class Pu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Pu.prototype.normal={};Pu.prototype.property={};Pu.prototype.space=void 0;function J5(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Pu(n,r,t)}function Q_(e){return e.toLowerCase()}class or{constructor(t,n){this.attribute=n,this.property=t}}or.prototype.attribute="";or.prototype.booleanish=!1;or.prototype.boolean=!1;or.prototype.commaOrSpaceSeparated=!1;or.prototype.commaSeparated=!1;or.prototype.defined=!1;or.prototype.mustUseProperty=!1;or.prototype.number=!1;or.prototype.overloadedBoolean=!1;or.prototype.property="";or.prototype.spaceSeparated=!1;or.prototype.space=void 0;let yW=0;const $e=Qo(),Gt=Qo(),J_=Qo(),me=Qo(),yt=Qo(),ol=Qo(),vr=Qo();function Qo(){return 2**++yW}const ey=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Gt,commaOrSpaceSeparated:vr,commaSeparated:ol,number:me,overloadedBoolean:J_,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),vv=Object.keys(ey);class Ob extends or{constructor(t,n,r,s){let a=-1;if(super(t,n),I2(this,"space",s),typeof r=="number")for(;++a<vv.length;){const l=vv[a];I2(this,vv[a],(r&ey[l])===ey[l])}}}Ob.prototype.defined=!0;function I2(e,t,n){n&&(e[t]=n)}function Tl(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new Ob(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Q_(r)]=r,n[Q_(a.attribute)]=r}return new Pu(t,n,e.space)}const eA=Tl({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:yt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:me,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:yt,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:Gt,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tA(e,t){return t in e?e[t]:t}function nA(e,t){return tA(e,t.toLowerCase())}const bW=Tl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ol,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:yt,autoFocus:$e,autoPlay:$e,blocking:yt,capture:null,charSet:null,checked:$e,cite:null,className:yt,cols:me,colSpan:null,content:null,contentEditable:Gt,controls:$e,controlsList:yt,coords:me|ol,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:J_,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:yt,height:me,hidden:J_,high:me,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:yt,itemRef:yt,itemScope:$e,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$e,optimum:me,pattern:null,ping:yt,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:yt,required:$e,reversed:$e,rows:me,rowSpan:me,sandbox:yt,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:$e,useMap:null,value:Gt,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$e,disableRemotePlayback:$e,prefix:null,property:null,results:me,security:null,unselectable:null},space:"html",transform:nA}),xW=Tl({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:vr,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:$e,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,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:ol,g2:ol,glyphName:ol,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:vr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,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:me,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:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vr,rev:vr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vr,requiredFeatures:vr,requiredFonts:vr,requiredFormats:vr,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:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:vr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vr,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tA}),rA=Tl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),iA=Tl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nA}),sA=Tl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),SW={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"},wW=/[A-Z]/g,H2=/-[a-z]/g,CW=/^data[-\w.:]+$/i;function kW(e,t){const n=Q_(t);let r=t,s=or;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&CW.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(H2,RW);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!H2.test(a)){let l=a.replace(wW,EW);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Ob}return new s(r,t)}function EW(e){return"-"+e.toLowerCase()}function RW(e){return e.charAt(1).toUpperCase()}const TW=J5([eA,bW,rA,iA,sA],"html"),Lb=J5([eA,xW,rA,iA,sA],"svg");function MW(e){return e.join(" ").trim()}var qa={},_v,F2;function AW(){if(F2)return _v;F2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
473
|
+
`,h="/",p="*",m="",_="comment",y="declaration";function S(C,k){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];k=k||{};var T=1,R=1;function M(V){var F=V.match(t);F&&(T+=F.length);var j=V.lastIndexOf(d);R=~j?V.length-j:R+V.length}function L(){var V={line:T,column:R};return function(F){return F.position=new O(V),G(),F}}function O(V){this.start=V,this.end={line:T,column:R},this.source=k.source}O.prototype.content=C;function z(V){var F=new Error(k.source+":"+T+":"+R+": "+V);if(F.reason=V,F.filename=k.source,F.line=T,F.column=R,F.source=C,!k.silent)throw F}function H(V){var F=V.exec(C);if(F){var j=F[0];return M(j),C=C.slice(j.length),F}}function G(){H(n)}function B(V){var F;for(V=V||[];F=$();)F!==!1&&V.push(F);return V}function $(){var V=L();if(!(h!=C.charAt(0)||p!=C.charAt(1))){for(var F=2;m!=C.charAt(F)&&(p!=C.charAt(F)||h!=C.charAt(F+1));)++F;if(F+=2,m===C.charAt(F-1))return z("End of comment missing");var j=C.slice(2,F-2);return R+=2,M(j),C=C.slice(F),R+=2,V({type:_,comment:j})}}function I(){var V=L(),F=H(r);if(F){if($(),!H(s))return z("property missing ':'");var j=H(a),Y=V({type:y,property:w(F[0].replace(e,m)),value:j?w(j[0].replace(e,m)):m});return H(l),Y}}function U(){var V=[];B(V);for(var F;F=I();)F!==!1&&(V.push(F),B(V));return V}return G(),U()}function w(C){return C?C.replace(u,m):m}return _v=S,_v}var U2;function NW(){if(U2)return qa;U2=1;var e=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0}),qa.default=n;const t=e(AW());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:p}=d;u?s(h,p,d):p&&(a=a||{},a[h]=p)}),a}return qa}var Lc={},$2;function DW(){if($2)return Lc;$2=1,Object.defineProperty(Lc,"__esModule",{value:!0}),Lc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},l=function(h,p){return p.toUpperCase()},u=function(h,p){return"".concat(p,"-")},d=function(h,p){return p===void 0&&(p={}),a(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(s,u):h=h.replace(r,u),h.replace(t,l))};return Lc.camelCase=d,Lc}var zc,W2;function OW(){if(W2)return zc;W2=1;var e=zc&&zc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(NW()),n=DW();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,d){u&&d&&(l[(0,n.camelCase)(u,a)]=d)}),l}return r.default=r,zc=r,zc}var LW=OW();const zW=Df(LW),oA=aA("end"),zb=aA("start");function aA(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};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 jW(e){const t=zb(e),n=oA(e);if(t&&n)return{start:t,end:n}}function eu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?q2(e.position):"start"in e||"end"in e?q2(e):"line"in e||"column"in e?ty(e):""}function ty(e){return V2(e&&e.line)+":"+V2(e&&e.column)}function q2(e){return ty(e&&e.start)+"-"+ty(e&&e.end)}function V2(e){return e&&typeof e=="number"?e:1}class Dn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(l=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=eu(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dn.prototype.file="";Dn.prototype.name="";Dn.prototype.reason="";Dn.prototype.message="";Dn.prototype.stack="";Dn.prototype.column=void 0;Dn.prototype.line=void 0;Dn.prototype.ancestors=void 0;Dn.prototype.cause=void 0;Dn.prototype.fatal=void 0;Dn.prototype.place=void 0;Dn.prototype.ruleId=void 0;Dn.prototype.source=void 0;const jb={}.hasOwnProperty,BW=new Map,PW=/[A-Z]/g,IW=new Set(["table","tbody","thead","tfoot","tr"]),HW=new Set(["td","th"]),lA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function FW(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=YW(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=GW(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Lb:TW,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=cA(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function cA(e,t,n){if(t.type==="element")return UW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $W(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return qW(e,t,n);if(t.type==="mdxjsEsm")return WW(e,t);if(t.type==="root")return VW(e,t,n);if(t.type==="text")return KW(e,t)}function UW(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Lb,e.schema=s),e.ancestors.push(t);const a=hA(e,t.tagName,!1),l=XW(e,t);let u=Pb(e,t);return IW.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!_W(d):!0})),uA(e,l,a,t),Bb(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function $W(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}_u(e,t.position)}function WW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_u(e,t.position)}function qW(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Lb,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:hA(e,t.name,!0),l=ZW(e,t),u=Pb(e,t);return uA(e,l,a,t),Bb(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function VW(e,t,n){const r={};return Bb(r,Pb(e,t)),e.create(t,e.Fragment,r,n)}function KW(e,t){return t.value}function uA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Bb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function GW(e,t,n){return r;function r(s,a,l,u){const h=Array.isArray(l.children)?n:t;return u?h(a,l,u):h(a,l)}}function YW(e,t){return n;function n(r,s,a,l){const u=Array.isArray(a.children),d=zb(r);return t(s,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function XW(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&jb.call(t.properties,s)){const a=QW(e,s,t.properties[s]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&HW.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ZW(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else _u(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else _u(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Pb(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:BW;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const h=s.get(d)||0;l=d+"-"+h,s.set(d,h+1)}}const u=cA(e,a,l);u!==void 0&&n.push(u)}return n}function QW(e,t,n){const r=kW(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?fW(n):MW(n)),r.property==="style"){let s=typeof n=="object"?n:JW(e,String(n));return e.stylePropertyNameCase==="css"&&(s=eq(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?SW[r.property]||r.property:r.attribute,n]}}function JW(e,t){try{return zW(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=lA+"#cannot-parse-style-attribute",s}}function hA(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const u=B2(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=B2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return jb.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);_u(e)}function _u(e,t){const n=new Dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=lA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function eq(e){const t={};let n;for(n in e)jb.call(e,n)&&(t[tq(n)]=e[n]);return t}function tq(e){let t=e.replace(PW,nq);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nq(e){return"-"+e.toLowerCase()}const yv={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"]},rq={};function Ib(e,t){const n=rq,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return dA(e,r,s)}function dA(e,t,n){if(iq(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return K2(e.children,t,n)}return Array.isArray(e)?K2(e,t,n):""}function K2(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=dA(e[s],t,n);return r.join("")}function iq(e){return!!(e&&typeof e=="object")}const G2=document.createElement("i");function Hb(e){const t="&"+e+";";G2.innerHTML=t;const n=G2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function br(e,t,n,r){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Fr(e,t){return e.length>0?(br(e,e.length,0,t),e):t}const Y2={}.hasOwnProperty;function fA(e){const t={};let n=-1;for(;++n<e.length;)sq(t,e[n]);return t}function sq(e,t){let n;for(n in t){const s=(Y2.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Y2.call(s,l)||(s[l]=[]);const u=a[l];oq(s[l],Array.isArray(u)?u:u?[u]:[])}}}function oq(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);br(e,0,0,r)}function pA(e,t){const n=Number.parseInt(e,t);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 ei(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Hn=ro(/[A-Za-z]/),Nn=ro(/[\dA-Za-z]/),aq=ro(/[#-'*+\--9=?A-Z^-~]/);function Rf(e){return e!==null&&(e<32||e===127)}const ny=ro(/\d/),lq=ro(/[\dA-Fa-f]/),cq=ro(/[!-/:-@[-`{-~]/);function Le(e){return e!==null&&e<-2}function _t(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const hp=ro(new RegExp("\\p{P}|\\p{S}","u")),qo=ro(/\s/);function ro(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ml(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Nn(e.charCodeAt(n+1))&&Nn(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function rt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Xe(d)?(e.enter(n),u(d)):t(d)}function u(d){return Xe(d)&&a++<s?(e.consume(d),u):(e.exit(n),t(d))}}const uq={tokenize:hq};function hq(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),rt(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Le(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const dq={tokenize:fq},X2={tokenize:pq};function fq(e){const t=this,n=[];let r=0,s,a,l;return u;function u(R){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,d,h)(R)}return h(R)}function d(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&T();const M=t.events.length;let L=M,O;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){O=t.events[L][1].end;break}k(r);let z=M;for(;z<t.events.length;)t.events[z][1].end={...O},z++;return br(t.events,L+1,0,t.events.slice(M)),t.events.length=z,h(R)}return u(R)}function h(R){if(r===n.length){if(!s)return _(R);if(s.currentConstruct&&s.currentConstruct.concrete)return S(R);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(X2,p,m)(R)}function p(R){return s&&T(),k(r),_(R)}function m(R){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,S(R)}function _(R){return t.containerState={},e.attempt(X2,y,S)(R)}function y(R){return r++,n.push([t.currentConstruct,t.containerState]),_(R)}function S(R){if(R===null){s&&T(),k(0),e.consume(R);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),w(R)}function w(R){if(R===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(R);return}return Le(R)?(e.consume(R),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(R),w)}function C(R,M){const L=t.sliceStream(R);if(M&&L.push(null),R.previous=a,a&&(a.next=R),a=R,s.defineSkip(R.start),s.write(L),t.parser.lazy[R.start.line]){let O=s.events.length;for(;O--;)if(s.events[O][1].start.offset<l&&(!s.events[O][1].end||s.events[O][1].end.offset>l))return;const z=t.events.length;let H=z,G,B;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(G){B=t.events[H][1].end;break}G=!0}for(k(r),O=z;O<t.events.length;)t.events[O][1].end={...B},O++;br(t.events,H+1,0,t.events.slice(z)),t.events.length=O}}function k(R){let M=n.length;for(;M-- >R;){const L=n[M];t.containerState=L[1],L[0].exit.call(t,e)}n.length=R}function T(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function pq(e,t,n){return rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fl(e){if(e===null||_t(e)||qo(e))return 1;if(hp(e))return 2}function dp(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const ry={name:"attention",resolveAll:mq,tokenize:gq};function mq(e,t){let n=-1,r,s,a,l,u,d,h,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},_={...e[n][1].start};Z2(m,-d),Z2(_,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Fr(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Fr(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=Fr(h,dp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Fr(h,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=Fr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,br(e,r-1,n-r+3,h),n=r+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function gq(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=fl(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const h=e.exit("attentionSequence"),p=fl(d),m=!p||p===2&&s||n.includes(d),_=!s||s===2&&p||n.includes(r);return h._open=!!(a===42?m:m&&(s||!_)),h._close=!!(a===42?_:_&&(p||!m)),t(d)}}function Z2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const vq={name:"autolink",tokenize:_q};function _q(e,t,n){let r=0;return s;function s(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(y){return Hn(y)?(e.consume(y),l):y===64?n(y):h(y)}function l(y){return y===43||y===45||y===46||Nn(y)?(r=1,u(y)):h(y)}function u(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||Nn(y))&&r++<32?(e.consume(y),u):(r=0,h(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Rf(y)?n(y):(e.consume(y),d)}function h(y){return y===64?(e.consume(y),p):aq(y)?(e.consume(y),h):n(y)}function p(y){return Nn(y)?m(y):n(y)}function m(y){return y===46?(e.consume(y),r=0,p):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):_(y)}function _(y){if((y===45||Nn(y))&&r++<63){const S=y===45?_:m;return e.consume(y),S}return n(y)}}const Iu={partial:!0,tokenize:yq};function yq(e,t,n){return r;function r(a){return Xe(a)?rt(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Le(a)?t(a):n(a)}}const mA={continuation:{tokenize:xq},exit:Sq,name:"blockQuote",tokenize:bq};function bq(e,t,n){const r=this;return s;function s(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Xe(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function xq(e,t,n){const r=this;return s;function s(l){return Xe(l)?rt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(mA,t,n)(l)}}function Sq(e){e.exit("blockQuote")}const gA={name:"characterEscape",tokenize:wq};function wq(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return cq(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const vA={name:"characterReference",tokenize:Cq};function Cq(e,t,n){const r=this;let s=0,a,l;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,l=Nn,p(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=lq,p):(e.enter("characterReferenceValue"),a=7,l=ny,p(m))}function p(m){if(m===59&&s){const _=e.exit("characterReferenceValue");return l===Nn&&!Hb(r.sliceSerialize(_))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&s++<a?(e.consume(m),p):n(m)}}const Q2={partial:!0,tokenize:Eq},J2={concrete:!0,name:"codeFenced",tokenize:kq};function kq(e,t,n){const r=this,s={partial:!0,tokenize:L};let a=0,l=0,u;return d;function d(O){return h(O)}function h(O){const z=r.events[r.events.length-1];return a=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,u=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===u?(l++,e.consume(O),p):l<3?n(O):(e.exit("codeFencedFenceSequence"),Xe(O)?rt(e,m,"whitespace")(O):m(O))}function m(O){return O===null||Le(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(Q2,w,M)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(O))}function _(O){return O===null||Le(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(O)):Xe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rt(e,y,"whitespace")(O)):O===96&&O===u?n(O):(e.consume(O),_)}function y(O){return O===null||Le(O)?m(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(O))}function S(O){return O===null||Le(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(O)):O===96&&O===u?n(O):(e.consume(O),S)}function w(O){return e.attempt(s,M,C)(O)}function C(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),k}function k(O){return a>0&&Xe(O)?rt(e,T,"linePrefix",a+1)(O):T(O)}function T(O){return O===null||Le(O)?e.check(Q2,w,M)(O):(e.enter("codeFlowValue"),R(O))}function R(O){return O===null||Le(O)?(e.exit("codeFlowValue"),T(O)):(e.consume(O),R)}function M(O){return e.exit("codeFenced"),t(O)}function L(O,z,H){let G=0;return B;function B(F){return O.enter("lineEnding"),O.consume(F),O.exit("lineEnding"),$}function $(F){return O.enter("codeFencedFence"),Xe(F)?rt(O,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):I(F)}function I(F){return F===u?(O.enter("codeFencedFenceSequence"),U(F)):H(F)}function U(F){return F===u?(G++,O.consume(F),U):G>=l?(O.exit("codeFencedFenceSequence"),Xe(F)?rt(O,V,"whitespace")(F):V(F)):H(F)}function V(F){return F===null||Le(F)?(O.exit("codeFencedFence"),z(F)):H(F)}}}function Eq(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const bv={name:"codeIndented",tokenize:Tq},Rq={partial:!0,tokenize:Mq};function Tq(e,t,n){const r=this;return s;function s(h){return e.enter("codeIndented"),rt(e,a,"linePrefix",5)(h)}function a(h){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):Le(h)?e.attempt(Rq,l,d)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||Le(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),u)}function d(h){return e.exit("codeIndented"),t(h)}}function Mq(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):Le(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):rt(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Le(l)?s(l):n(l)}}const Aq={name:"codeText",previous:Dq,resolve:Nq,tokenize:Oq};function Nq(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function Dq(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Oq(e,t,n){let r=0,s,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),s=0,p(m)):Le(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||Le(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),h)}function p(m){return m===96?(e.consume(m),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",h(m))}}class Lq{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&jc(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),jc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),jc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);jc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);jc(this.left,n.reverse())}}}function jc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _A(e){const t={};let n=-1,r,s,a,l,u,d,h;const p=new Lq(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,zq(p,n)),n=t[n],h=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},u=p.slice(s,n),u.unshift(r),p.splice(s,n-s+1,u))}}return br(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function zq(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],h={};let p,m,_=-1,y=n,S=0,w=0;const C=[w];for(;y;){for(;e.get(++s)[1]!==y;);a.push(s),y._tokenizer||(p=r.sliceStream(y),y.next||p.push(null),m&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=y,y=y.next}for(y=n;++_<u.length;)u[_][0]==="exit"&&u[_-1][0]==="enter"&&u[_][1].type===u[_-1][1].type&&u[_][1].start.line!==u[_][1].end.line&&(w=_+1,C.push(w),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):C.pop(),_=C.length;_--;){const k=u.slice(C[_],C[_+1]),T=a.pop();d.push([T,T+k.length-1]),e.splice(T,2,k)}for(d.reverse(),_=-1;++_<d.length;)h[S+d[_][0]]=S+d[_][1],S+=d[_][1]-d[_][0]-1;return h}const jq={resolve:Pq,tokenize:Iq},Bq={partial:!0,tokenize:Hq};function Pq(e){return _A(e),e}function Iq(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?a(u):Le(u)?e.check(Bq,l,a)(u):(e.consume(u),s)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function Hq(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),rt(e,a,"linePrefix")}function a(l){if(l===null||Le(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function yA(e,t,n,r,s,a,l,u,d){const h=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(k),e.exit(a),_):k===null||k===32||k===41||Rf(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),w(k))}function _(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===62?(e.exit("chunkString"),e.exit(u),_(k)):k===null||k===60||Le(k)?n(k):(e.consume(k),k===92?S:y)}function S(k){return k===60||k===62||k===92?(e.consume(k),y):y(k)}function w(k){return!p&&(k===null||k===41||_t(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(k)):p<h&&k===40?(e.consume(k),p++,w):k===41?(e.consume(k),p--,w):k===null||k===32||k===40||Rf(k)?n(k):(e.consume(k),k===92?C:w)}function C(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function bA(e,t,n,r,s,a){const l=this;let u=0,d;return h;function h(y){return e.enter(r),e.enter(s),e.consume(y),e.exit(s),e.enter(a),p}function p(y){return u>999||y===null||y===91||y===93&&!d||y===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(a),e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):Le(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===null||y===91||y===93||Le(y)||u++>999?(e.exit("chunkString"),p(y)):(e.consume(y),d||(d=!Xe(y)),y===92?_:m)}function _(y){return y===91||y===92||y===93?(e.consume(y),u++,m):m(y)}}function xA(e,t,n,r,s,a){let l;return u;function u(_){return _===34||_===39||_===40?(e.enter(r),e.enter(s),e.consume(_),e.exit(s),l=_===40?41:_,d):n(_)}function d(_){return _===l?(e.enter(s),e.consume(_),e.exit(s),e.exit(r),t):(e.enter(a),h(_))}function h(_){return _===l?(e.exit(a),d(l)):_===null?n(_):Le(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),rt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===l||_===null||Le(_)?(e.exit("chunkString"),h(_)):(e.consume(_),_===92?m:p)}function m(_){return _===l||_===92?(e.consume(_),p):p(_)}}function tu(e,t){let n;return r;function r(s){return Le(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Xe(s)?rt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const Fq={name:"definition",tokenize:$q},Uq={partial:!0,tokenize:Wq};function $q(e,t,n){const r=this;let s;return a;function a(y){return e.enter("definition"),l(y)}function l(y){return bA.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function u(y){return s=ei(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),d):n(y)}function d(y){return _t(y)?tu(e,h)(y):h(y)}function h(y){return yA(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function p(y){return e.attempt(Uq,m,m)(y)}function m(y){return Xe(y)?rt(e,_,"whitespace")(y):_(y)}function _(y){return y===null||Le(y)?(e.exit("definition"),r.parser.defined.push(s),t(y)):n(y)}}function Wq(e,t,n){return r;function r(u){return _t(u)?tu(e,s)(u):n(u)}function s(u){return xA(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Xe(u)?rt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Le(u)?t(u):n(u)}}const qq={name:"hardBreakEscape",tokenize:Vq};function Vq(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Le(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Kq={name:"headingAtx",resolve:Gq,tokenize:Yq};function Gq(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},br(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function Yq(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||_t(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Le(p)?(e.exit("atxHeading"),t(p)):Xe(p)?rt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),u(p))}function h(p){return p===null||p===35||_t(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),h)}}const Xq=["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"],ek=["pre","script","style","textarea"],Zq={concrete:!0,name:"htmlFlow",resolveTo:eV,tokenize:tV},Qq={partial:!0,tokenize:rV},Jq={partial:!0,tokenize:nV};function eV(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function tV(e,t,n){const r=this;let s,a,l,u,d;return h;function h(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),m}function m(D){return D===33?(e.consume(D),_):D===47?(e.consume(D),a=!0,w):D===63?(e.consume(D),s=3,r.interrupt?t:A):Hn(D)?(e.consume(D),l=String.fromCharCode(D),C):n(D)}function _(D){return D===45?(e.consume(D),s=2,y):D===91?(e.consume(D),s=5,u=0,S):Hn(D)?(e.consume(D),s=4,r.interrupt?t:A):n(D)}function y(D){return D===45?(e.consume(D),r.interrupt?t:A):n(D)}function S(D){const K="CDATA[";return D===K.charCodeAt(u++)?(e.consume(D),u===K.length?r.interrupt?t:I:S):n(D)}function w(D){return Hn(D)?(e.consume(D),l=String.fromCharCode(D),C):n(D)}function C(D){if(D===null||D===47||D===62||_t(D)){const K=D===47,ee=l.toLowerCase();return!K&&!a&&ek.includes(ee)?(s=1,r.interrupt?t(D):I(D)):Xq.includes(l.toLowerCase())?(s=6,K?(e.consume(D),k):r.interrupt?t(D):I(D)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?T(D):R(D))}return D===45||Nn(D)?(e.consume(D),l+=String.fromCharCode(D),C):n(D)}function k(D){return D===62?(e.consume(D),r.interrupt?t:I):n(D)}function T(D){return Xe(D)?(e.consume(D),T):B(D)}function R(D){return D===47?(e.consume(D),B):D===58||D===95||Hn(D)?(e.consume(D),M):Xe(D)?(e.consume(D),R):B(D)}function M(D){return D===45||D===46||D===58||D===95||Nn(D)?(e.consume(D),M):L(D)}function L(D){return D===61?(e.consume(D),O):Xe(D)?(e.consume(D),L):R(D)}function O(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),d=D,z):Xe(D)?(e.consume(D),O):H(D)}function z(D){return D===d?(e.consume(D),d=null,G):D===null||Le(D)?n(D):(e.consume(D),z)}function H(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||_t(D)?L(D):(e.consume(D),H)}function G(D){return D===47||D===62||Xe(D)?R(D):n(D)}function B(D){return D===62?(e.consume(D),$):n(D)}function $(D){return D===null||Le(D)?I(D):Xe(D)?(e.consume(D),$):n(D)}function I(D){return D===45&&s===2?(e.consume(D),j):D===60&&s===1?(e.consume(D),Y):D===62&&s===4?(e.consume(D),P):D===63&&s===3?(e.consume(D),A):D===93&&s===5?(e.consume(D),Q):Le(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Qq,Z,U)(D)):D===null||Le(D)?(e.exit("htmlFlowData"),U(D)):(e.consume(D),I)}function U(D){return e.check(Jq,V,Z)(D)}function V(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),F}function F(D){return D===null||Le(D)?U(D):(e.enter("htmlFlowData"),I(D))}function j(D){return D===45?(e.consume(D),A):I(D)}function Y(D){return D===47?(e.consume(D),l="",W):I(D)}function W(D){if(D===62){const K=l.toLowerCase();return ek.includes(K)?(e.consume(D),P):I(D)}return Hn(D)&&l.length<8?(e.consume(D),l+=String.fromCharCode(D),W):I(D)}function Q(D){return D===93?(e.consume(D),A):I(D)}function A(D){return D===62?(e.consume(D),P):D===45&&s===2?(e.consume(D),A):I(D)}function P(D){return D===null||Le(D)?(e.exit("htmlFlowData"),Z(D)):(e.consume(D),P)}function Z(D){return e.exit("htmlFlow"),t(D)}}function nV(e,t,n){const r=this;return s;function s(l){return Le(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function rV(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Iu,t,n)}}const iV={name:"htmlText",tokenize:sV};function sV(e,t,n){const r=this;let s,a,l;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),L):A===63?(e.consume(A),R):Hn(A)?(e.consume(A),H):n(A)}function h(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),a=0,S):Hn(A)?(e.consume(A),T):n(A)}function p(A){return A===45?(e.consume(A),y):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),_):Le(A)?(l=m,Y(A)):(e.consume(A),m)}function _(A){return A===45?(e.consume(A),y):m(A)}function y(A){return A===62?j(A):A===45?_(A):m(A)}function S(A){const P="CDATA[";return A===P.charCodeAt(a++)?(e.consume(A),a===P.length?w:S):n(A)}function w(A){return A===null?n(A):A===93?(e.consume(A),C):Le(A)?(l=w,Y(A)):(e.consume(A),w)}function C(A){return A===93?(e.consume(A),k):w(A)}function k(A){return A===62?j(A):A===93?(e.consume(A),k):w(A)}function T(A){return A===null||A===62?j(A):Le(A)?(l=T,Y(A)):(e.consume(A),T)}function R(A){return A===null?n(A):A===63?(e.consume(A),M):Le(A)?(l=R,Y(A)):(e.consume(A),R)}function M(A){return A===62?j(A):R(A)}function L(A){return Hn(A)?(e.consume(A),O):n(A)}function O(A){return A===45||Nn(A)?(e.consume(A),O):z(A)}function z(A){return Le(A)?(l=z,Y(A)):Xe(A)?(e.consume(A),z):j(A)}function H(A){return A===45||Nn(A)?(e.consume(A),H):A===47||A===62||_t(A)?G(A):n(A)}function G(A){return A===47?(e.consume(A),j):A===58||A===95||Hn(A)?(e.consume(A),B):Le(A)?(l=G,Y(A)):Xe(A)?(e.consume(A),G):j(A)}function B(A){return A===45||A===46||A===58||A===95||Nn(A)?(e.consume(A),B):$(A)}function $(A){return A===61?(e.consume(A),I):Le(A)?(l=$,Y(A)):Xe(A)?(e.consume(A),$):G(A)}function I(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,U):Le(A)?(l=I,Y(A)):Xe(A)?(e.consume(A),I):(e.consume(A),V)}function U(A){return A===s?(e.consume(A),s=void 0,F):A===null?n(A):Le(A)?(l=U,Y(A)):(e.consume(A),U)}function V(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||_t(A)?G(A):(e.consume(A),V)}function F(A){return A===47||A===62||_t(A)?G(A):n(A)}function j(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function Y(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),W}function W(A){return Xe(A)?rt(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Q(A)}function Q(A){return e.enter("htmlTextData"),l(A)}}const Fb={name:"labelEnd",resolveAll:cV,resolveTo:uV,tokenize:hV},oV={tokenize:dV},aV={tokenize:fV},lV={tokenize:pV};function cV(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&br(e,0,e.length,n),e}function uV(e,t){let n=e.length,r=0,s,a,l,u;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",h,t]],u=Fr(u,e.slice(a+1,a+r+3)),u=Fr(u,[["enter",p,t]]),u=Fr(u,dp(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=Fr(u,[["exit",p,t],e[l-2],e[l-1],["exit",h,t]]),u=Fr(u,e.slice(l+1)),u=Fr(u,[["exit",d,t]]),br(e,a,e.length,u),e}function hV(e,t,n){const r=this;let s=r.events.length,a,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return u;function u(_){return a?a._inactive?m(_):(l=r.parser.defined.includes(ei(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),d):n(_)}function d(_){return _===40?e.attempt(oV,p,l?p:m)(_):_===91?e.attempt(aV,p,l?h:m)(_):l?p(_):m(_)}function h(_){return e.attempt(lV,p,m)(_)}function p(_){return t(_)}function m(_){return a._balanced=!0,n(_)}}function dV(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return _t(m)?tu(e,a)(m):a(m)}function a(m){return m===41?p(m):yA(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return _t(m)?tu(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?xA(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function h(m){return _t(m)?tu(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function fV(e,t,n){const r=this;return s;function s(u){return bA.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(ei(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function pV(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const mV={name:"labelStartImage",resolveAll:Fb.resolveAll,tokenize:gV};function gV(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const vV={name:"labelStartLink",resolveAll:Fb.resolveAll,tokenize:_V};function _V(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const xv={name:"lineEnding",tokenize:yV};function yV(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),rt(e,t,"linePrefix")}}const Xd={name:"thematicBreak",tokenize:bV};function bV(e,t,n){let r=0,s;return a;function a(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,u(h)}function u(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||Le(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),Xe(h)?rt(e,u,"whitespace")(h):u(h))}}const rr={continuation:{tokenize:CV},exit:EV,name:"list",tokenize:wV},xV={partial:!0,tokenize:RV},SV={partial:!0,tokenize:kV};function wV(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(y){const S=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:ny(y)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Xd,n,h)(y):h(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return ny(y)&&++l<10?(e.consume(y),d):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),h(y)):n(y)}function h(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Iu,r.interrupt?n:p,e.attempt(xV,_,m))}function p(y){return r.containerState.initialBlankLine=!0,a++,_(y)}function m(y){return Xe(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),_):n(y)}function _(y){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function CV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Iu,s,a);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,rt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Xe(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(SV,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,rt(e,e.attempt(rr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function kV(e,t,n){const r=this;return rt(e,s,"listItemIndent",r.containerState.size+1);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function EV(e){e.exit(this.containerState.type)}function RV(e,t,n){const r=this;return rt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!Xe(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const tk={name:"setextUnderline",resolveTo:TV,tokenize:MV};function TV(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function MV(e,t,n){const r=this;let s;return a;function a(h){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),u(h)}function u(h){return h===s?(e.consume(h),u):(e.exit("setextHeadingLineSequence"),Xe(h)?rt(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Le(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const AV={tokenize:NV};function NV(e){const t=this,n=e.attempt(Iu,r,e.attempt(this.parser.constructs.flowInitial,s,rt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(jq,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const DV={resolveAll:wA()},OV=SA("string"),LV=SA("text");function SA(e){return{resolveAll:wA(e==="text"?zV:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,u);return l;function l(p){return h(p)?a(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return h(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function h(p){if(p===null)return!0;const m=s[p];let _=-1;if(m)for(;++_<m.length;){const y=m[_];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function wA(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function zV(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,l=-1,u=0,d;for(;a--;){const h=s[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(h===-2)d=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const h={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const jV={42:rr,43:rr,45:rr,48:rr,49:rr,50:rr,51:rr,52:rr,53:rr,54:rr,55:rr,56:rr,57:rr,62:mA},BV={91:Fq},PV={[-2]:bv,[-1]:bv,32:bv},IV={35:Kq,42:Xd,45:[tk,Xd],60:Zq,61:tk,95:Xd,96:J2,126:J2},HV={38:vA,92:gA},FV={[-5]:xv,[-4]:xv,[-3]:xv,33:mV,38:vA,42:ry,60:[vq,iV],91:vV,92:[qq,gA],93:Fb,95:ry,96:Aq},UV={null:[ry,DV]},$V={null:[42,95]},WV={null:[]},qV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:$V,contentInitial:BV,disable:WV,document:jV,flow:IV,flowInitial:PV,insideSpan:UV,string:HV,text:FV},Symbol.toStringTag,{value:"Module"}));function VV(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let l=[],u=[];const d={attempt:z(L),check:z(O),consume:T,enter:R,exit:M,interrupt:z(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:_,sliceStream:y,write:m};let p=t.tokenize.call(h,d);return t.resolveAll&&a.push(t),h;function m($){return l=Fr(l,$),C(),l[l.length-1]!==null?[]:(H(t,0),h.events=dp(a,h.events,h),h.events)}function _($,I){return GV(y($),I)}function y($){return KV(l,$)}function S(){const{_bufferIndex:$,_index:I,line:U,column:V,offset:F}=r;return{_bufferIndex:$,_index:I,line:U,column:V,offset:F}}function w($){s[$.line]=$.column,B()}function C(){let $;for(;r._index<l.length;){const I=l[r._index];if(typeof I=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<I.length;)k(I.charCodeAt(r._bufferIndex));else k(I)}}function k($){p=p($)}function T($){Le($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,B()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=$}function R($,I){const U=I||{};return U.type=$,U.start=S(),h.events.push(["enter",U,h]),u.push(U),U}function M($){const I=u.pop();return I.end=S(),h.events.push(["exit",I,h]),I}function L($,I){H($,I.from)}function O($,I){I.restore()}function z($,I){return U;function U(V,F,j){let Y,W,Q,A;return Array.isArray(V)?Z(V):"tokenize"in V?Z([V]):P(V);function P(ie){return ge;function ge(Te){const ve=Te!==null&&ie[Te],ke=Te!==null&&ie.null,We=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return Z(We)(Te)}}function Z(ie){return Y=ie,W=0,ie.length===0?j:D(ie[W])}function D(ie){return ge;function ge(Te){return A=G(),Q=ie,ie.partial||(h.currentConstruct=ie),ie.name&&h.parser.constructs.disable.null.includes(ie.name)?ee():ie.tokenize.call(I?Object.assign(Object.create(h),I):h,d,K,ee)(Te)}}function K(ie){return $(Q,A),F}function ee(ie){return A.restore(),++W<Y.length?D(Y[W]):j}}}function H($,I){$.resolveAll&&!a.includes($)&&a.push($),$.resolve&&br(h.events,I,h.events.length-I,$.resolve(h.events.slice(I),h)),$.resolveTo&&(h.events=$.resolveTo(h.events,h))}function G(){const $=S(),I=h.previous,U=h.currentConstruct,V=h.events.length,F=Array.from(u);return{from:V,restore:j};function j(){r=$,h.previous=I,h.currentConstruct=U,h.events.length=V,u=F,B()}}function B(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function KV(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,a)];else{if(l=e.slice(n,s),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function GV(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
474
|
+
`;break}case-3:{l=`\r
|
|
475
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,r.push(l)}return r.join("")}function YV(e){const r={constructs:fA([qV,...(e||{}).extensions||[]]),content:s(uq),defined:[],document:s(dq),flow:s(AV),lazy:{},string:s(OV),text:s(LV)};return r;function s(a){return l;function l(u){return VV(r,a,u)}}}function XV(e){for(;!_A(e););return e}const nk=/[\0\t\n\r]/g;function ZV(){let e=1,t="",n=!0,r;return s;function s(a,l,u){const d=[];let h,p,m,_,y;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(nk.lastIndex=m,h=nk.exec(a),_=h&&h.index!==void 0?h.index:a.length,y=a.charCodeAt(_),!h){t=a.slice(m);break}if(y===10&&m===_&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<_&&(d.push(a.slice(m,_)),e+=_-m),y){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=_+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const QV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JV(e){return e.replace(QV,eK)}function eK(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return pA(n.slice(a?2:1),a?16:10)}return Hb(n)||e}const CA={}.hasOwnProperty;function tK(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),nK(n)(XV(YV(n).document().write(ZV()(e,t,!0))))}function nK(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Zt),autolinkProtocol:G,autolinkEmail:G,atxHeading:a(he),blockQuote:a(ke),characterEscape:G,characterReference:G,codeFenced:a(We),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(We,l),codeText:a(fe,l),codeTextData:G,data:G,codeFlowValue:G,definition:a(_e),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(He),hardBreakEscape:a(et),hardBreakTrailing:a(et),htmlFlow:a(gt,l),htmlFlowData:G,htmlText:a(gt,l),htmlTextData:G,image:a(Wn),label:l,link:a(Zt),listItem:a(qn),listItemValue:_,listOrdered:a(jt,m),listUnordered:a(jt),paragraph:a(Sr),reference:D,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(he),strong:a(cs),thematicBreak:a(io)},exit:{atxHeading:d(),atxHeadingSequence:L,autolink:d(),autolinkEmail:ve,autolinkProtocol:Te,blockQuote:d(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:ie,characterReference:ge,codeFenced:d(C),codeFencedFence:w,codeFencedFenceInfo:y,codeFencedFenceMeta:S,codeFlowValue:B,codeIndented:d(k),codeText:d(F),codeTextData:B,data:B,definition:d(),definitionDestinationString:M,definitionLabelString:T,definitionTitleString:R,emphasis:d(),hardBreakEscape:d(I),hardBreakTrailing:d(I),htmlFlow:d(U),htmlFlowData:B,htmlText:d(V),htmlTextData:B,image:d(Y),label:Q,labelText:W,lineEnding:$,link:d(j),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:K,resourceDestinationString:A,resourceTitleString:P,resource:Z,setextHeading:d(H),setextHeadingLineSequence:z,setextHeadingText:O,strong:d(),thematicBreak:d()}};kA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(oe){let pe={type:"root",children:[]};const Ae={stack:[pe],tokenStack:[],config:t,enter:u,exit:h,buffer:l,resume:p,data:n},Pe=[];let Ze=-1;for(;++Ze<oe.length;)if(oe[Ze][1].type==="listOrdered"||oe[Ze][1].type==="listUnordered")if(oe[Ze][0]==="enter")Pe.push(Ze);else{const xt=Pe.pop();Ze=s(oe,xt,Ze)}for(Ze=-1;++Ze<oe.length;){const xt=t[oe[Ze][0]];CA.call(xt,oe[Ze][1].type)&&xt[oe[Ze][1].type].call(Object.assign({sliceSerialize:oe[Ze][2].sliceSerialize},Ae),oe[Ze][1])}if(Ae.tokenStack.length>0){const xt=Ae.tokenStack[Ae.tokenStack.length-1];(xt[1]||rk).call(Ae,void 0,xt[0])}for(pe.position={start:Is(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Is(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Ze=-1;++Ze<t.transforms.length;)pe=t.transforms[Ze](pe)||pe;return pe}function s(oe,pe,Ae){let Pe=pe-1,Ze=-1,xt=!1,On,de,ye,Oe;for(;++Pe<=Ae;){const Ne=oe[Pe];switch(Ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ne[0]==="enter"?Ze++:Ze--,Oe=void 0;break}case"lineEndingBlank":{Ne[0]==="enter"&&(On&&!Oe&&!Ze&&!ye&&(ye=Pe),Oe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Oe=void 0}if(!Ze&&Ne[0]==="enter"&&Ne[1].type==="listItemPrefix"||Ze===-1&&Ne[0]==="exit"&&(Ne[1].type==="listUnordered"||Ne[1].type==="listOrdered")){if(On){let ut=Pe;for(de=void 0;ut--;){const Ln=oe[ut];if(Ln[1].type==="lineEnding"||Ln[1].type==="lineEndingBlank"){if(Ln[0]==="exit")continue;de&&(oe[de][1].type="lineEndingBlank",xt=!0),Ln[1].type="lineEnding",de=ut}else if(!(Ln[1].type==="linePrefix"||Ln[1].type==="blockQuotePrefix"||Ln[1].type==="blockQuotePrefixWhitespace"||Ln[1].type==="blockQuoteMarker"||Ln[1].type==="listItemIndent"))break}ye&&(!de||ye<de)&&(On._spread=!0),On.end=Object.assign({},de?oe[de][1].start:Ne[1].end),oe.splice(de||Pe,0,["exit",On,Ne[2]]),Pe++,Ae++}if(Ne[1].type==="listItemPrefix"){const ut={type:"listItem",_spread:!1,start:Object.assign({},Ne[1].start),end:void 0};On=ut,oe.splice(Pe,0,["enter",ut,Ne[2]]),Pe++,Ae++,ye=void 0,Oe=!0}}}return oe[pe][1]._spread=xt,Ae}function a(oe,pe){return Ae;function Ae(Pe){u.call(this,oe(Pe),Pe),pe&&pe.call(this,Pe)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(oe,pe,Ae){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([pe,Ae||void 0]),oe.position={start:Is(pe.start),end:void 0}}function d(oe){return pe;function pe(Ae){oe&&oe.call(this,Ae),h.call(this,Ae)}}function h(oe,pe){const Ae=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==oe.type&&(pe?pe.call(this,oe,Pe[0]):(Pe[1]||rk).call(this,oe,Pe[0]));else throw new Error("Cannot close `"+oe.type+"` ("+eu({start:oe.start,end:oe.end})+"): it’s not open");Ae.position.end=Is(oe.end)}function p(){return Ib(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function _(oe){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function y(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=oe}function S(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=oe}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe.replace(/(\r?\n|\r)$/g,"")}function T(oe){const pe=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=pe,Ae.identifier=ei(this.sliceSerialize(oe)).toLowerCase()}function R(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.title=oe}function M(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.url=oe}function L(oe){const pe=this.stack[this.stack.length-1];if(!pe.depth){const Ae=this.sliceSerialize(oe).length;pe.depth=Ae}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function z(oe){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function G(oe){const Ae=this.stack[this.stack.length-1].children;let Pe=Ae[Ae.length-1];(!Pe||Pe.type!=="text")&&(Pe=$t(),Pe.position={start:Is(oe.start),end:void 0},Ae.push(Pe)),this.stack.push(Pe)}function B(oe){const pe=this.stack.pop();pe.value+=this.sliceSerialize(oe),pe.position.end=Is(oe.end)}function $(oe){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=pe.children[pe.children.length-1];Ae.position.end=Is(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(G.call(this,oe),B.call(this,oe))}function I(){this.data.atHardBreak=!0}function U(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe}function V(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe}function F(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe}function j(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=pe,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Y(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=pe,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function W(oe){const pe=this.sliceSerialize(oe),Ae=this.stack[this.stack.length-2];Ae.label=JV(pe),Ae.identifier=ei(pe).toLowerCase()}function Q(){const oe=this.stack[this.stack.length-1],pe=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Pe=oe.children;Ae.children=Pe}else Ae.alt=pe}function A(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.url=oe}function P(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.title=oe}function Z(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function K(oe){const pe=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=pe,Ae.identifier=ei(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function ee(oe){this.data.characterReferenceType=oe.type}function ie(oe){const pe=this.sliceSerialize(oe),Ae=this.data.characterReferenceType;let Pe;Ae?(Pe=pA(pe,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=Hb(pe);const Ze=this.stack[this.stack.length-1];Ze.value+=Pe}function ge(oe){const pe=this.stack.pop();pe.position.end=Is(oe.end)}function Te(oe){B.call(this,oe);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(oe)}function ve(oe){B.call(this,oe);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(oe)}function ke(){return{type:"blockquote",children:[]}}function We(){return{type:"code",lang:null,meta:null,value:""}}function fe(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function He(){return{type:"emphasis",children:[]}}function he(){return{type:"heading",depth:0,children:[]}}function et(){return{type:"break"}}function gt(){return{type:"html",value:""}}function Wn(){return{type:"image",title:null,url:"",alt:null}}function Zt(){return{type:"link",title:null,url:"",children:[]}}function jt(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function qn(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function Sr(){return{type:"paragraph",children:[]}}function cs(){return{type:"strong",children:[]}}function $t(){return{type:"text",value:""}}function io(){return{type:"thematicBreak"}}}function Is(e){return{line:e.line,column:e.column,offset:e.offset}}function kA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?kA(e,r):rK(e,r)}}function rK(e,t){let n;for(n in t)if(CA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function rk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+eu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+eu({start:t.start,end:t.end})+") is still open")}function iK(e){const t=this;t.parser=n;function n(r){return tK(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function sK(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function oK(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
476
|
+
`}]}function aK(e,t){const n=t.value?t.value+`
|
|
477
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function lK(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cK(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uK(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Ml(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function hK(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dK(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function EA(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function fK(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return EA(e,t);const s={src:Ml(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function pK(e,t){const n={src:Ml(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function mK(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function gK(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return EA(e,t);const s={href:Ml(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function vK(e,t){const n={href:Ml(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _K(e,t,n){const r=e.all(t),s=n?yK(n):RA(t),a={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(s||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
478
|
+
`}),p.type==="element"&&p.tagName==="p"&&!s?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
479
|
+
`});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function yK(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=RA(n[r])}return t}function RA(e){const t=e.spread;return t??e.children.length>1}function bK(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function xK(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SK(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function wK(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CK(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=zb(t.children[1]),d=oA(t.children[t.children.length-1]);u&&d&&(l.position={start:u,end:d}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function kK(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let d=-1;const h=[];for(;++d<u;){const m=t.children[d],_={},y=l?l[d]:void 0;y&&(_.align=y);let S={type:"element",tagName:a,properties:_,children:[]};m&&(S.children=e.all(m),e.patch(m,S),S=e.applyData(m,S)),h.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function EK(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ik=9,sk=32;function RK(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(ok(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(ok(t.slice(s),s>0,!1)),a.join("")}function ok(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===ik||a===sk;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===ik||a===sk;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function TK(e,t){const n={type:"text",value:RK(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function MK(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const AK={blockquote:sK,break:oK,code:aK,delete:lK,emphasis:cK,footnoteReference:uK,heading:hK,html:dK,imageReference:fK,image:pK,inlineCode:mK,linkReference:gK,link:vK,listItem:_K,list:bK,paragraph:xK,root:SK,strong:wK,table:CK,tableCell:EK,tableRow:kK,text:TK,thematicBreak:MK,toml:kd,yaml:kd,definition:kd,footnoteDefinition:kd};function kd(){}const TA=-1,fp=0,nu=1,Tf=2,Ub=3,$b=4,Wb=5,qb=6,MA=7,AA=8,ak=typeof self=="object"?self:globalThis,NK=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case fp:case TA:return n(l,s);case nu:{const u=n([],s);for(const d of l)u.push(r(d));return u}case Tf:{const u=n({},s);for(const[d,h]of l)u[r(d)]=r(h);return u}case Ub:return n(new Date(l),s);case $b:{const{source:u,flags:d}=l;return n(new RegExp(u,d),s)}case Wb:{const u=n(new Map,s);for(const[d,h]of l)u.set(r(d),r(h));return u}case qb:{const u=n(new Set,s);for(const d of l)u.add(r(d));return u}case MA:{const{name:u,message:d}=l;return n(new ak[u](d),s)}case AA:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new ak[a](l),s)};return r},lk=e=>NK(new Map,e)(0),Va="",{toString:DK}={},{keys:OK}=Object,Bc=e=>{const t=typeof e;if(t!=="object"||!e)return[fp,t];const n=DK.call(e).slice(8,-1);switch(n){case"Array":return[nu,Va];case"Object":return[Tf,Va];case"Date":return[Ub,Va];case"RegExp":return[$b,Va];case"Map":return[Wb,Va];case"Set":return[qb,Va];case"DataView":return[nu,n]}return n.includes("Array")?[nu,n]:n.includes("Error")?[MA,n]:[Tf,n]},Ed=([e,t])=>e===fp&&(t==="function"||t==="symbol"),LK=(e,t,n,r)=>{const s=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=Bc(l);switch(u){case fp:{let p=l;switch(d){case"bigint":u=AA,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return s([TA],l)}return s([u,p],l)}case nu:{if(d){let _=l;return d==="DataView"?_=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(_=new Uint8Array(l)),s([d,[..._]],l)}const p=[],m=s([u,p],l);for(const _ of l)p.push(a(_));return m}case Tf:{if(d)switch(d){case"BigInt":return s([d,l.toString()],l);case"Boolean":case"Number":case"String":return s([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=s([u,p],l);for(const _ of OK(l))(e||!Ed(Bc(l[_])))&&p.push([a(_),a(l[_])]);return m}case Ub:return s([u,l.toISOString()],l);case $b:{const{source:p,flags:m}=l;return s([u,{source:p,flags:m}],l)}case Wb:{const p=[],m=s([u,p],l);for(const[_,y]of l)(e||!(Ed(Bc(_))||Ed(Bc(y))))&&p.push([a(_),a(y)]);return m}case qb:{const p=[],m=s([u,p],l);for(const _ of l)(e||!Ed(Bc(_)))&&p.push(a(_));return m}}const{message:h}=l;return s([u,{name:d,message:h}],l)};return a},ck=(e,{json:t,lossy:n}={})=>{const r=[];return LK(!(t||n),!!t,new Map,r)(e),r},Mf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?lk(ck(e,t)):structuredClone(e):(e,t)=>lk(ck(e,t));function zK(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function jK(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function BK(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||zK,r=e.options.footnoteBackLabel||jK,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const p=e.all(h),m=String(h.identifier).toUpperCase(),_=Ml(m.toLowerCase());let y=0;const S=[],w=e.footnoteCounts.get(m);for(;w!==void 0&&++y<=w;){S.length>0&&S.push({type:"text",value:" "});let T=typeof n=="string"?n:n(d,y);typeof T=="string"&&(T={type:"text",value:T}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,y),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const T=C.children[C.children.length-1];T&&T.type==="text"?T.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...S)}else p.push(...S);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(p,!0)};e.patch(h,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Mf(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
480
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
481
|
+
`}]}}const pp=(function(e){if(e==null)return FK;if(typeof e=="function")return mp(e);if(typeof e=="object")return Array.isArray(e)?PK(e):IK(e);if(typeof e=="string")return HK(e);throw new Error("Expected function, string, or object as test")});function PK(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=pp(e[n]);return mp(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function IK(e){const t=e;return mp(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function HK(e){return mp(t);function t(n){return n&&n.type===e}}function mp(e){return t;function t(n,r,s){return!!(UK(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function FK(){return!0}function UK(e){return e!==null&&typeof e=="object"&&"type"in e}const NA=[],$K=!0,iy=!1,WK="skip";function DA(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=pp(s),l=r?-1:1;u(e,void 0,[])();function u(d,h,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const y=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(d.type+(y?"<"+y+">":""))+")"})}return _;function _(){let y=NA,S,w,C;if((!t||a(d,h,p[p.length-1]||void 0))&&(y=qK(n(d,p)),y[0]===iy))return y;if("children"in d&&d.children){const k=d;if(k.children&&y[0]!==WK)for(w=(r?k.children.length:-1)+l,C=p.concat(k);w>-1&&w<k.children.length;){const T=k.children[w];if(S=u(T,w,C)(),S[0]===iy)return S;w=typeof S[1]=="number"?S[1]:w+l}}return y}}}function qK(e){return Array.isArray(e)?e:typeof e=="number"?[$K,e]:e==null?NA:[e]}function Vb(e,t,n,r){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=r),DA(e,a,u,s);function u(d,h){const p=h[h.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const sy={}.hasOwnProperty,VK={};function KK(e,t){const n=t||VK,r=new Map,s=new Map,a=new Map,l={...AK,...n.handlers},u={all:h,applyData:YK,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:GK,wrap:ZK};return Vb(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:s,_=String(p.identifier).toUpperCase();m.has(_)||m.set(_,p)}}),u;function d(p,m){const _=p.type,y=u.handlers[_];if(sy.call(u.handlers,_)&&y)return y(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(_)){if("children"in p){const{children:w,...C}=p,k=Mf(C);return k.children=u.all(p),k}return Mf(p)}return(u.options.unknownHandler||XK)(u,p,m)}function h(p){const m=[];if("children"in p){const _=p.children;let y=-1;for(;++y<_.length;){const S=u.one(_[y],p);if(S){if(y&&_[y-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=uk(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=uk(w.value))}Array.isArray(S)?m.push(...S):m.push(S)}}}return m}}function GK(e,t){e.position&&(t.position=jW(e))}function YK(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Mf(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function XK(e,t){const n=t.data||{},r="value"in t&&!(sy.call(n,"hProperties")||sy.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ZK(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
482
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
483
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
484
|
+
`}),n}function uk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function hk(e,t){const n=KK(e,t),r=n.one(e,void 0),s=BK(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
|
|
485
|
+
`},s),a}function QK(e,t){return e&&"run"in e?async function(n,r){const s=hk(n,{file:r,...t});await e.run(s,r)}:function(n,r){return hk(n,{file:r,...e||t})}}function dk(e){if(e)throw e}var Sv,fk;function JK(){if(fk)return Sv;fk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var p=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!m)return!1;var _;for(_ in h);return typeof _>"u"||e.call(h,_)},l=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},u=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(r)return r(h,p).value}else return;return h[p]};return Sv=function d(){var h,p,m,_,y,S,w=arguments[0],C=1,k=arguments.length,T=!1;for(typeof w=="boolean"&&(T=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<k;++C)if(h=arguments[C],h!=null)for(p in h)m=u(w,p),_=u(h,p),w!==_&&(T&&_&&(a(_)||(y=s(_)))?(y?(y=!1,S=m&&s(m)?m:[]):S=m&&a(m)?m:{},l(w,{name:p,newValue:d(T,S,_)})):typeof _<"u"&&l(w,{name:p,newValue:_}));return w},Sv}var eG=JK();const wv=Df(eG);function oy(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function tG(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(d,...h){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<s.length;)(h[m]===null||h[m]===void 0)&&(h[m]=s[m]);s=h,p?nG(p,u)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function nG(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(s);try{d=e.apply(this,l)}catch(h){const p=h;if(u&&n)throw p;return s(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(l,...u){n||(n=!0,t(l,...u))}function a(l){s(null,l)}}const pi={basename:rG,dirname:iG,extname:sG,join:oG,sep:"/"};function rG(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hu(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function iG(e){if(Hu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function sG(e){Hu(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function oG(...e){let t=-1,n;for(;++t<e.length;)Hu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":aG(n)}function aG(e){Hu(e);const t=e.codePointAt(0)===47;let n=lG(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function lG(e,t){let n="",r=0,s=-1,a=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function Hu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cG={cwd:uG};function uG(){return"/"}function ay(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function hG(e){if(typeof e=="string")e=new URL(e);else if(!ay(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return dG(e)}function dG(e){if(e.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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Cv=["history","path","basename","stem","extname","dirname"];class OA{constructor(t){let n;t?ay(t)?n={path:t}:typeof t=="string"||fG(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":cG.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Cv.length;){const a=Cv[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)Cv.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?pi.basename(this.path):void 0}set basename(t){Ev(t,"basename"),kv(t,"basename"),this.path=pi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?pi.dirname(this.path):void 0}set dirname(t){pk(this.basename,"dirname"),this.path=pi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?pi.extname(this.path):void 0}set extname(t){if(kv(t,"extname"),pk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ay(t)&&(t=hG(t)),Ev(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?pi.basename(this.path,this.extname):void 0}set stem(t){Ev(t,"stem"),kv(t,"stem"),this.path=pi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Dn(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function kv(e,t){if(e&&e.includes(pi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+pi.sep+"`")}function Ev(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function pk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function fG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pG=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),mG={}.hasOwnProperty;class Kb extends pG{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=tG()}copy(){const t=new Kb;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(wv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Mv("data",this.frozen),this.namespace[t]=n,this):mG.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Mv("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Rd(t),r=this.parser||this.Parser;return Rv("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Rv("process",this.parser||this.Parser),Tv("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const u=Rd(t),d=r.parse(u);r.run(d,u,function(p,m,_){if(p||!m||!_)return h(p);const y=m,S=r.stringify(y,_);_G(S)?_.value=S:_.result=S,h(p,_)});function h(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Rv("processSync",this.parser||this.Parser),Tv("processSync",this.compiler||this.Compiler),this.process(t,s),gk("processSync","process",n),r;function s(a,l){n=!0,dk(a),r=l}}run(t,n,r){mk(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,u){const d=Rd(n);s.run(t,d,h);function h(p,m,_){const y=m||t;p?u(p):l?l(y):r(void 0,y,_)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),gk("runSync","run",r),s;function a(l,u){dk(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=Rd(n),s=this.compiler||this.Compiler;return Tv("stringify",s),mk(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Mv("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...m]=h;d(p,m)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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");u(h.plugins),h.settings&&(s.settings=wv(!0,s.settings,h.settings))}function u(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const m=h[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,p){let m=-1,_=-1;for(;++m<r.length;)if(r[m][0]===h){_=m;break}if(_===-1)r.push([h,...p]);else if(p.length>0){let[y,...S]=p;const w=r[_][1];oy(w)&&oy(y)&&(y=wv(!0,w,y)),r[_]=[h,y,...S]}}}}const gG=new Kb().freeze();function Rv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Tv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Mv(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function mk(e){if(!oy(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function gk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rd(e){return vG(e)?e:new OA(e)}function vG(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _G(e){return typeof e=="string"||yG(e)}function yG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bG="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vk=[],_k={allowDangerousHtml:!0},xG=/^(https?|ircs?|mailto|xmpp)$/i,SG=[{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 Fu(e){const t=wG(e),n=CG(e);return kG(t.runSync(t.parse(n),n),e)}function wG(e){const t=e.rehypePlugins||vk,n=e.remarkPlugins||vk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._k}:_k;return gG().use(iK).use(n).use(QK,r).use(t)}function CG(e){const t=e.children||"",n=new OA;return typeof t=="string"&&(n.value=t),n}function kG(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||EG;for(const p of SG)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+bG+p.id,void 0);return Vb(e,h),FW(e,{Fragment:g.Fragment,components:s,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function h(p,m,_){if(p.type==="raw"&&_&&typeof m=="number")return l?_.children.splice(m,1):_.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let y;for(y in yv)if(Object.hasOwn(yv,y)&&Object.hasOwn(p.properties,y)){const S=p.properties[y],w=yv[y];(w===null||w.includes(p.tagName))&&(p.properties[y]=d(String(S||""),y,p))}}if(p.type==="element"){let y=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!y&&r&&typeof m=="number"&&(y=!r(p,m,_)),y&&_&&typeof m=="number")return u&&p.children?_.children.splice(m,1,...p.children):_.children.splice(m,1),m}}}function EG(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||xG.test(e.slice(0,t))?e:""}function yk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function RG(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function TG(e,t,n){const s=pp((n||{}).ignore||[]),a=MG(t);let l=-1;for(;++l<a.length;)DA(e,"text",u);function u(h,p){let m=-1,_;for(;++m<p.length;){const y=p[m],S=_?_.children:void 0;if(s(y,S?S.indexOf(y):void 0,_))return;_=y}if(_)return d(h,p)}function d(h,p){const m=p[p.length-1],_=a[l][0],y=a[l][1];let S=0;const C=m.children.indexOf(h);let k=!1,T=[];_.lastIndex=0;let R=_.exec(h.value);for(;R;){const M=R.index,L={index:R.index,input:R.input,stack:[...p,h]};let O=y(...R,L);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?_.lastIndex=M+1:(S!==M&&T.push({type:"text",value:h.value.slice(S,M)}),Array.isArray(O)?T.push(...O):O&&T.push(O),S=M+R[0].length,k=!0),!_.global)break;R=_.exec(h.value)}return k?(S<h.value.length&&T.push({type:"text",value:h.value.slice(S)}),m.children.splice(C,1,...T)):T=[h],C+T.length}}function MG(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([AG(s[0]),NG(s[1])])}return t}function AG(e){return typeof e=="string"?new RegExp(RG(e),"g"):e}function NG(e){return typeof e=="function"?e:function(){return e}}const Av="phrasing",Nv=["autolink","link","image","label"];function DG(){return{transforms:[IG],enter:{literalAutolink:LG,literalAutolinkEmail:Dv,literalAutolinkHttp:Dv,literalAutolinkWww:Dv},exit:{literalAutolink:PG,literalAutolinkEmail:BG,literalAutolinkHttp:zG,literalAutolinkWww:jG}}}function OG(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Av,notInConstruct:Nv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Av,notInConstruct:Nv},{character:":",before:"[ps]",after:"\\/",inConstruct:Av,notInConstruct:Nv}]}}function LG(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Dv(e){this.config.enter.autolinkProtocol.call(this,e)}function zG(e){this.config.exit.autolinkProtocol.call(this,e)}function jG(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function BG(e){this.config.exit.autolinkEmail.call(this,e)}function PG(e){this.exit(e)}function IG(e){TG(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,HG],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),FG]],{ignore:["link","linkReference"]})}function HG(e,t,n,r,s){let a="";if(!LA(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!UG(n)))return!1;const l=$G(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function FG(e,t,n,r){return!LA(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function UG(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function $G(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=yk(e,"(");let a=yk(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function LA(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||qo(n)||hp(n))&&(!t||n!==47)}zA.peek=QG;function WG(){this.buffer()}function qG(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function VG(){this.buffer()}function KG(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function GG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ei(this.sliceSerialize(e)).toLowerCase(),n.label=t}function YG(e){this.exit(e)}function XG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ei(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZG(e){this.exit(e)}function QG(){return"["}function zA(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),l(),a+=s.move("]"),a}function JG(){return{enter:{gfmFootnoteCallString:WG,gfmFootnoteCall:qG,gfmFootnoteDefinitionLabelString:VG,gfmFootnoteDefinition:KG},exit:{gfmFootnoteCallString:GG,gfmFootnoteCall:YG,gfmFootnoteDefinitionLabelString:XG,gfmFootnoteDefinition:ZG}}}function eY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:zA},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const u=a.createTracker(l);let d=u.move("[^");const h=a.enter("footnoteDefinition"),p=a.enter("label");return d+=u.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),d+=u.move((t?`
|
|
486
|
+
`:" ")+a.indentLines(a.containerFlow(r,u.current()),t?jA:tY))),h(),d}}function tY(e,t,n){return t===0?e:jA(e,t,n)}function jA(e,t,n){return(n?"":" ")+e}const nY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];BA.peek=aY;function rY(){return{canContainEols:["delete"],enter:{strikethrough:sY},exit:{strikethrough:oY}}}function iY(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nY}],handlers:{delete:BA}}}function sY(e){this.enter({type:"delete",children:[]},e)}function oY(e){this.exit(e)}function BA(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function aY(){return"~"}function lY(e){return e.length}function cY(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||lY,a=[],l=[],u=[],d=[];let h=0,p=-1;for(;++p<e.length;){const w=[],C=[];let k=-1;for(e[p].length>h&&(h=e[p].length);++k<e[p].length;){const T=uY(e[p][k]);if(n.alignDelimiters!==!1){const R=s(T);C[k]=R,(d[k]===void 0||R>d[k])&&(d[k]=R)}w.push(T)}l[p]=w,u[p]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<h;)a[m]=bk(r[m]);else{const w=bk(r);for(;++m<h;)a[m]=w}m=-1;const _=[],y=[];for(;++m<h;){const w=a[m];let C="",k="";w===99?(C=":",k=":"):w===108?C=":":w===114&&(k=":");let T=n.alignDelimiters===!1?1:Math.max(1,d[m]-C.length-k.length);const R=C+"-".repeat(T)+k;n.alignDelimiters!==!1&&(T=C.length+T+k.length,T>d[m]&&(d[m]=T),y[m]=T),_[m]=R}l.splice(1,0,_),u.splice(1,0,y),p=-1;const S=[];for(;++p<l.length;){const w=l[p],C=u[p];m=-1;const k=[];for(;++m<h;){const T=w[m]||"";let R="",M="";if(n.alignDelimiters!==!1){const L=d[m]-(C[m]||0),O=a[m];O===114?R=" ".repeat(L):O===99?L%2?(R=" ".repeat(L/2+.5),M=" ".repeat(L/2-.5)):(R=" ".repeat(L/2),M=R):M=" ".repeat(L)}n.delimiterStart!==!1&&!m&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||m)&&k.push(" "),n.alignDelimiters!==!1&&k.push(R),k.push(T),n.alignDelimiters!==!1&&k.push(M),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||m!==h-1)&&k.push("|")}S.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return S.join(`
|
|
487
|
+
`)}function uY(e){return e==null?"":String(e)}function bk(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function hY(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),dY);return s(),l}function dY(e,t,n){return">"+(n?"":" ")+e}function fY(e,t){return xk(e,t.inConstruct,!0)&&!xk(e,t.notInConstruct,!1)}function xk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Sk(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
488
|
+
`&&fY(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
489
|
+
`}function pY(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>l&&(l=a):a=1,s=r+t.length,r=n.indexOf(t,s);return l}function mY(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function gY(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function vY(e,t,n,r){const s=gY(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(mY(e,n)){const m=n.enter("codeIndented"),_=n.indentLines(a,_Y);return m(),_}const u=n.createTracker(r),d=s.repeat(Math.max(pY(a,s)+1,3)),h=n.enter("codeFenced");let p=u.move(d);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:`
|
|
490
|
+
`,encode:["`"],...u.current()})),m()}return p+=u.move(`
|
|
491
|
+
`),a&&(p+=u.move(a+`
|
|
492
|
+
`)),p+=u.move(d),h(),p}function _Y(e,t,n){return(n?"":" ")+e}function Gb(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function yY(e,t,n,r){const s=Gb(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
493
|
+
`,...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),l(),h}function bY(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function yu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Af(e,t,n){const r=fl(e),s=fl(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}PA.peek=xY;function PA(e,t,n,r){const s=bY(n),a=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),p=Af(r.before.charCodeAt(r.before.length-1),h,s);p.inside&&(d=yu(h)+d.slice(1));const m=d.charCodeAt(d.length-1),_=Af(r.after.charCodeAt(0),m,s);_.inside&&(d=d.slice(0,-1)+yu(m));const y=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},u+d+y}function xY(e,t,n){return n.options.emphasis||"*"}function SY(e,t){let n=!1;return Vb(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,iy}),!!((!e.depth||e.depth<3)&&Ib(e)&&(t.options.setext||n))}function wY(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(SY(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),_=n.containerPhrasing(e,{...a.current(),before:`
|
|
494
|
+
`,after:`
|
|
495
|
+
`});return m(),p(),_+`
|
|
496
|
+
`+(s===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(`
|
|
497
|
+
`))+1))}const l="#".repeat(s),u=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
498
|
+
`,...a.current()});return/^[\t ]/.test(h)&&(h=yu(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),u(),h}IA.peek=CY;function IA(e){return e.value||""}function CY(){return"<"}HA.peek=kY;function HA(e,t,n,r){const s=Gb(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),h+=d.move(")"),l(),h}function kY(){return"!"}FA.peek=EY;function FA(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");const h=n.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=p,a(),s==="full"||!h||h!==m?d+=u.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function EY(){return"!"}UA.peek=RY;function UA(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],u=n.compilePattern(l);let d;if(l.atBreak)for(;d=u.exec(r);){let h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return s+r+s}function RY(){return"`"}function $A(e,t){const n=Ib(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}WA.peek=TY;function WA(e,t,n,r){const s=Gb(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,d;if($A(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),u(),n.stack=p,m}u=n.enter("link"),d=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(d=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),h+=l.move(" "+s),h+=l.move(n.safe(e.title,{before:h,after:s,...l.current()})),h+=l.move(s),d()),h+=l.move(")"),u(),h}function TY(e,t,n){return $A(e,n)?"<":"["}qA.peek=MY;function qA(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=p,a(),s==="full"||!h||h!==m?d+=u.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function MY(){return"["}function Yb(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function AY(e){const t=Yb(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function NY(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function VA(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function DY(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?NY(n):Yb(n);const u=e.ordered?l==="."?")":".":AY(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.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&&(d=!0),VA(n)===l&&p){let m=-1;for(;++m<e.children.length;){const _=e.children[m];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=u),n.bulletCurrent=l;const h=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),h}function OY(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function LY(e,t,n,r){const s=OY(n);let a=n.bulletCurrent||Yb(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(l-a.length)),u.shift(l);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,u.current()),p);return d(),h;function p(m,_,y){return _?(y?"":" ".repeat(l))+m:(y?a:a+" ".repeat(l-a.length))+m}}function zY(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const jY=pp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function BY(e,t,n,r){return(e.children.some(function(l){return jY(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function PY(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}KA.peek=IY;function KA(e,t,n,r){const s=PY(n),a=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),p=Af(r.before.charCodeAt(r.before.length-1),h,s);p.inside&&(d=yu(h)+d.slice(1));const m=d.charCodeAt(d.length-1),_=Af(r.after.charCodeAt(0),m,s);_.inside&&(d=d.slice(0,-1)+yu(m));const y=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},u+d+y}function IY(e,t,n){return n.options.strong||"*"}function HY(e,t,n,r){return n.safe(e.value,r)}function FY(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function UY(e,t,n){const r=(VA(n)+(n.options.ruleSpaces?" ":"")).repeat(FY(n));return n.options.ruleSpaces?r.slice(0,-1):r}const GA={blockquote:hY,break:Sk,code:vY,definition:yY,emphasis:PA,hardBreak:Sk,heading:wY,html:IA,image:HA,imageReference:FA,inlineCode:UA,link:WA,linkReference:qA,list:DY,listItem:LY,paragraph:zY,root:BY,strong:KA,text:HY,thematicBreak:UY};function $Y(){return{enter:{table:WY,tableData:wk,tableHeader:wk,tableRow:VY},exit:{codeText:KY,table:qY,tableData:Ov,tableHeader:Ov,tableRow:Ov}}}function WY(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function qY(e){this.exit(e),this.data.inTable=void 0}function VY(e){this.enter({type:"tableRow",children:[]},e)}function Ov(e){this.exit(e)}function wk(e){this.enter({type:"tableCell",children:[]},e)}function KY(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,GY));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function GY(e,t){return t==="|"?t:e}function YY(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
499
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:l,tableCell:d,tableRow:u}};function l(y,S,w,C){return h(p(y,w,C),y.align)}function u(y,S,w,C){const k=m(y,w,C),T=h([k]);return T.slice(0,T.indexOf(`
|
|
500
|
+
`))}function d(y,S,w,C){const k=w.enter("tableCell"),T=w.enter("phrasing"),R=w.containerPhrasing(y,{...C,before:a,after:a});return T(),k(),R}function h(y,S){return cY(y,{align:S,alignDelimiters:r,padding:n,stringLength:s})}function p(y,S,w){const C=y.children;let k=-1;const T=[],R=S.enter("table");for(;++k<C.length;)T[k]=m(C[k],S,w);return R(),T}function m(y,S,w){const C=y.children;let k=-1;const T=[],R=S.enter("tableRow");for(;++k<C.length;)T[k]=d(C[k],y,S,w);return R(),T}function _(y,S,w){let C=GA.inlineCode(y,S,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function XY(){return{exit:{taskListCheckValueChecked:Ck,taskListCheckValueUnchecked:Ck,paragraph:QY}}}function ZY(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:JY}}}function Ck(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function QY(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,l;for(;++a<s.length;){const u=s[a];if(u.type==="paragraph"){l=u;break}}l===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(e)}function JY(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(l);let d=GA.listItem(e,t,n,{...r,...u.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(p){return p+l}}function eX(){return[DG(),JG(),rY(),$Y(),XY()]}function tX(e){return{extensions:[OG(),eY(e),iY(),YY(e),ZY()]}}const nX={tokenize:lX,partial:!0},YA={tokenize:cX,partial:!0},XA={tokenize:uX,partial:!0},ZA={tokenize:hX,partial:!0},rX={tokenize:dX,partial:!0},QA={name:"wwwAutolink",tokenize:oX,previous:eN},JA={name:"protocolAutolink",tokenize:aX,previous:tN},ls={name:"emailAutolink",tokenize:sX,previous:nN},Ri={};function iX(){return{text:Ri}}let Mo=48;for(;Mo<123;)Ri[Mo]=ls,Mo++,Mo===58?Mo=65:Mo===91&&(Mo=97);Ri[43]=ls;Ri[45]=ls;Ri[46]=ls;Ri[95]=ls;Ri[72]=[ls,JA];Ri[104]=[ls,JA];Ri[87]=[ls,QA];Ri[119]=[ls,QA];function sX(e,t,n){const r=this;let s,a;return l;function l(m){return!ly(m)||!nN.call(r,r.previous)||Xb(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(m))}function u(m){return ly(m)?(e.consume(m),u):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(rX,p,h)(m):m===45||m===95||Nn(m)?(a=!0,e.consume(m),d):p(m)}function h(m){return e.consume(m),s=!0,d}function p(m){return a&&s&&Hn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function oX(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!eN.call(r,r.previous)||Xb(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(nX,e.attempt(YA,e.attempt(XA,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function aX(e,t,n){const r=this;let s="",a=!1;return l;function l(m){return(m===72||m===104)&&tN.call(r,r.previous)&&!Xb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),u):n(m)}function u(m){if(Hn(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),u;if(m===58){const _=s.toLowerCase();if(_==="http"||_==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?h:(a=!0,d)):n(m)}function h(m){return m===null||Rf(m)||_t(m)||qo(m)||hp(m)?n(m):e.attempt(YA,e.attempt(XA,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function lX(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function cX(e,t,n){let r,s,a;return l;function l(h){return h===46||h===95?e.check(ZA,d,u)(h):h===null||_t(h)||qo(h)||h!==45&&hp(h)?d(h):(a=!0,e.consume(h),l)}function u(h){return h===95?r=!0:(s=r,r=void 0),e.consume(h),l}function d(h){return s||r||!a?n(h):t(h)}}function uX(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(ZA,t,a)(l):l===null||_t(l)||qo(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function hX(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),a):u===93?(e.consume(u),s):u===60||u===null||_t(u)||qo(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||_t(u)||qo(u)?t(u):r(u)}function a(u){return Hn(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):Hn(u)?(e.consume(u),l):n(u)}}function dX(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return Nn(a)?n(a):t(a)}}function eN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_t(e)}function tN(e){return!Hn(e)}function nN(e){return!(e===47||ly(e))}function ly(e){return e===43||e===45||e===46||e===95||Nn(e)}function Xb(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const fX={tokenize:xX,partial:!0};function pX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:_X,continuation:{tokenize:yX},exit:bX}},text:{91:{name:"gfmFootnoteCall",tokenize:vX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:mX,resolveTo:gX}}}}function mX(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!l||!l._balanced)return n(d);const h=ei(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function gX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function vX(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(a>999||m===93&&!l||m===null||m===91||_t(m))return n(m);if(m===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return s.includes(ei(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return _t(m)||(l=!0),a++,e.consume(m),m===92?p:h}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,h):h(m)}}function _X(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,u;return d;function d(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(S)}function p(S){if(l>999||S===93&&!u||S===null||S===91||_t(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=ei(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return _t(S)||(u=!0),l++,e.consume(S),S===92?m:p}function m(S){return S===91||S===92||S===93?(e.consume(S),l++,p):p(S)}function _(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(a)||s.push(a),rt(e,y,"gfmFootnoteDefinitionWhitespace")):n(S)}function y(S){return t(S)}}function yX(e,t,n){return e.check(Iu,t,e.attempt(fX,t,n))}function bX(e){e.exit("gfmFootnoteDefinition")}function xX(e,t,n){const r=this;return rt(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function SX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,u){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let h=d;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[d][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[d][1].start)},_=[["enter",p,u],["enter",l[h][1],u],["exit",l[h][1],u],["enter",m,u]],y=u.parser.constructs.insideSpan.null;y&&br(_,_.length,0,dp(y,l.slice(h+1,d),u)),br(_,_.length,0,[["exit",m,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",p,u]]),br(l,h-1,d-h+3,_),d=h+_.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,u,d){const h=this.previous,p=this.events;let m=0;return _;function _(S){return h===126&&p[p.length-1][1].type!=="characterEscape"?d(S):(l.enter("strikethroughSequenceTemporary"),y(S))}function y(S){const w=fl(h);if(S===126)return m>1?d(S):(l.consume(S),m++,y);if(m<2&&!n)return d(S);const C=l.exit("strikethroughSequenceTemporary"),k=fl(S);return C._open=!k||k===2&&!!w,C._close=!w||w===2&&!!k,u(S)}}}class wX{constructor(){this.map=[]}add(t,n,r){CX(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function CX(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function kX(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function EX(){return{flow:{null:{name:"table",tokenize:RX,resolveAll:TX}}}}function RX(e,t,n){const r=this;let s=0,a=0,l;return u;function u(B){let $=r.events.length-1;for(;$>-1;){const V=r.events[$][1].type;if(V==="lineEnding"||V==="linePrefix")$--;else break}const I=$>-1?r.events[$][1].type:null,U=I==="tableHead"||I==="tableRow"?O:d;return U===O&&r.parser.lazy[r.now().line]?n(B):U(B)}function d(B){return e.enter("tableHead"),e.enter("tableRow"),h(B)}function h(B){return B===124||(l=!0,a+=1),p(B)}function p(B){return B===null?n(B):Le(B)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),y):n(B):Xe(B)?rt(e,p,"whitespace")(B):(a+=1,l&&(l=!1,s+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(B)))}function m(B){return B===null||B===124||_t(B)?(e.exit("data"),p(B)):(e.consume(B),B===92?_:m)}function _(B){return B===92||B===124?(e.consume(B),m):m(B)}function y(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),l=!1,Xe(B)?rt(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?C(B):B===124?(l=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),w):L(B)}function w(B){return Xe(B)?rt(e,C,"whitespace")(B):C(B)}function C(B){return B===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),k):B===45?(a+=1,k(B)):B===null||Le(B)?M(B):L(B)}function k(B){return B===45?(e.enter("tableDelimiterFiller"),T(B)):L(B)}function T(B){return B===45?(e.consume(B),T):B===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(B))}function R(B){return Xe(B)?rt(e,M,"whitespace")(B):M(B)}function M(B){return B===124?S(B):B===null||Le(B)?!l||s!==a?L(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):L(B)}function L(B){return n(B)}function O(B){return e.enter("tableRow"),z(B)}function z(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),z):B===null||Le(B)?(e.exit("tableRow"),t(B)):Xe(B)?rt(e,z,"whitespace")(B):(e.enter("data"),H(B))}function H(B){return B===null||B===124||_t(B)?(e.exit("data"),z(B)):(e.consume(B),B===92?G:H)}function G(B){return B===92||B===124?(e.consume(B),H):H(B)}}function TX(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,h,p,m;const _=new wX;for(;++n<e.length;){const y=e[n],S=y[1];y[0]==="enter"?S.type==="tableHead"?(u=!1,d!==0&&(kk(_,t,d,h,p),p=void 0,d=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",h,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,p={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",p,t]])),s=S.type==="tableDelimiterRow"?2:p?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=Td(_,t,a,s,void 0,m),a=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],m=Td(_,t,a,s,void 0,m)),a=l,l=[a[1],n,0,0])):S.type==="tableHead"?(u=!0,d=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],m=Td(_,t,a,s,n,m)):l[1]!==0&&(m=Td(_,t,l,s,n,m)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&kk(_,t,d,h,p),_.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=kX(t.events,n))}return e}function Td(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},Ga(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Ga(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const h=Ga(t.events,n[2]),p=Ga(t.events,n[3]),m={type:u,start:Object.assign({},h),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const _=t.events[n[2]],y=t.events[n[3]];if(_[1].end=Object.assign({},y[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,w=n[3]-n[2]-1;e.add(S,w,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(a.end=Object.assign({},Ga(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function kk(e,t,n,r,s){const a=[],l=Ga(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Ga(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const MX={name:"tasklistCheck",tokenize:NX};function AX(){return{text:{91:MX}}}function NX(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return _t(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(d)}function u(d){return Le(d)?t(d):Xe(d)?e.check({tokenize:DX},t,n)(d):n(d)}}function DX(e,t,n){return rt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function OX(e){return fA([iX(),pX(),SX(e),EX(),AX()])}const LX={};function Uu(e){const t=this,n=e||LX,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(OX(n)),a.push(eX()),l.push(tX(n))}function zX({content:e}){return g.jsx("div",{className:"flex gap-2 justify-end",children:g.jsx("div",{className:"max-w-[85%] sm:max-w-[80%] rounded-[20px] py-1.5 px-3.5 bg-muted text-primary border border-border prose prose-sm prose-invert [&_p]:whitespace-pre-line",children:g.jsx(Fu,{remarkPlugins:[Uu],components:cp(),children:e})})})}function jX({json:e}){return g.jsx("div",{className:"flex gap-3 justify-start",children:g.jsx("div",{className:"flex-1 max-w-[90%]",children:g.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words bg-muted rounded-lg p-3 overflow-auto max-h-96",children:e})})})}function rN({title:e,count:t,children:n,badge:r}){const[s,a]=x.useState(!1);return t===0?null:g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[g.jsx(es,{className:xe("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",s&&"rotate-90")}),g.jsx("span",{className:"text-muted-foreground font-medium",children:e}),g.jsx("span",{className:"text-muted-foreground/60",children:t}),r]}),s&&g.jsx("div",{className:"ml-5",children:n})]})}function Lv({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:g.jsx(rN,{title:e,count:t.length,children:g.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>g.jsx(q5,{icon:r?r(s):n,children:s},s))})})}function BX(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function iN({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return g.jsx("span",{className:xe("inline-block h-2 w-2 rounded-full shrink-0",t)})}function PX(e){switch(e){case"connected":return"Connected";case"failed":return"Failed";case"needs-auth":return"Needs auth";case"pending":return"Connecting...";case"disabled":return"Disabled";default:return e}}function Ek({server:e}){const[t,n]=x.useState(!1),r=e.status==="connected";return g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("button",{onClick:()=>r&&e.tools.length>0&&n(!t),className:xe("flex items-center gap-1.5",r&&e.tools.length>0&&"cursor-pointer hover:opacity-60 transition-opacity"),children:[r&&e.tools.length>0&&g.jsx(es,{className:xe("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),g.jsx(iN,{status:e.status}),g.jsx("span",{className:"text-muted-foreground font-medium",children:Yv(e.name)}),r?g.jsxs("span",{className:"text-muted-foreground/50",children:[e.tools.length," tools"]}):g.jsx("span",{className:"text-muted-foreground/50",children:PX(e.status)})]}),!r&&e.error&&g.jsx("span",{className:"text-destructive ml-5",children:e.error}),t&&e.tools.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5 ml-5",children:e.tools.map(s=>g.jsx(q5,{icon:W5(`mcp__${e.name}__${s}`),children:s},s))})]})}function IX({servers:e}){if(e.length===0)return null;const t=e.filter(s=>s.status==="connected"),n=e.filter(s=>s.status!=="connected"),r=n.length>0?g.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[g.jsx(iN,{status:"failed"}),g.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return g.jsx(rN,{title:"MCP Servers",count:e.length,badge:r,children:g.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(s=>g.jsx(Ek,{server:s},s.name)),n.map(s=>g.jsx(Ek,{server:s},s.name))]})})}function HX({rawJson:e}){const[t,n]=x.useState(!1);return g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[g.jsx(es,{className:xe("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),g.jsx("span",{className:"text-muted-foreground font-medium",children:"Raw Message"})]}),t&&g.jsx("pre",{className:"ml-5 text-xs whitespace-pre-wrap break-all border border-border rounded-md p-3 overflow-x-auto max-h-96 overflow-y-auto",children:e})]})}function FX({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=x.useMemo(()=>{const s=new Map,a=[];for(const u of e.tools){const d=BX(u);if(d){const h=s.get(d.server)||[];h.push(d.tool),s.set(d.server,h)}else a.push(u)}const l=e.mcpServers.map(u=>({name:u.name,status:u.status,error:u.error,tools:s.get(u.name)||[]}));return{coreTools:a,mcpServersWithTools:l}},[e.tools,e.mcpServers]);return g.jsx(no,{children:g.jsxs(ap,{expandedContent:g.jsx(lp,{className:"my-4 text-xs",children:g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(U$,{children:e.model}),g.jsx(Lv,{title:"Tools",items:n,getIcon:s=>W_[s]??$5}),g.jsx(Lv,{title:"Agents",items:e.agents,icon:Ay}),g.jsx(Lv,{title:"Commands",items:e.slashCommands,icon:l6}),g.jsx(IX,{servers:r}),t&&g.jsx(HX,{rawJson:t})]})}),children:[g.jsx(Zz,{className:"h-5 w-5 text-logo"}),g.jsx(Qs,{children:"Session Started"})]})})}function UX({message:e}){return g.jsx(no,{className:"hidden",children:g.jsxs(ap,{expandedContent:g.jsx(lp,{className:"my-4 text-xs",children:g.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto",children:JSON.stringify(e.accountInfo,null,2)})}),children:[g.jsx("div",{className:"size-5 flex justify-center items-center ",children:g.jsx(Ay,{className:"h-4 w-4 text-muted-foreground"})}),g.jsx(Qs,{children:"Account"})]})})}function $X({message:e}){return g.jsx("div",{className:"text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-full space-y-4",children:g.jsx(Fu,{remarkPlugins:[Uu],components:cp(),children:e.text})})}function WX({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:s}){const a=r&&t>0;return g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[g.jsxs("div",{className:"relative",children:[g.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border text-foreground flex flex-row items-center gap-2",children:[a?g.jsx("button",{onClick:r,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:g.jsx(cj,{className:"h-4 w-4 -ml-0.5",strokeWidth:3})}):n>1?g.jsxs("span",{className:"font-bold text-muted-foreground whitespace-nowrap",children:[t+1," of ",n]}):null,e]}),n>1&&g.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-border",children:g.jsx("div",{className:"h-full bg-muted-foreground/40 transition-all duration-300",style:{width:`${t/n*100}%`}})})]}),s]})}function Rk({label:e,description:t}){return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-foreground text-sm",children:e}),t&&g.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]})}function sN({selected:e,multiSelect:t,onClick:n}){return g.jsx("button",{type:"button",onClick:n,className:xe("flex-shrink-0 w-5 h-5 border-1 flex items-center justify-center",t?"rounded":"rounded-full",e?"border-slate-500/0 bg-foreground":"border-muted-foreground/50 bg-background",n&&e&&"cursor-pointer"),children:e&&g.jsx(Po,{strokeWidth:3,className:"translate-y-[0.5px] h-3 w-3 text-white dark:text-background"})})}function qX({option:e,selected:t,multiSelect:n,onClick:r,isLast:s}){const a="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",l=s?"":"border-b border-border";return r?g.jsx("button",{onClick:r,className:xe(a,l,"transition-all cursor-pointer"),children:g.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g.jsx("div",{className:"flex-1 min-w-0",children:g.jsx(Rk,{label:e.label,description:e.description})}),g.jsx(sN,{selected:t,multiSelect:n})]})}):g.jsx("div",{className:xe(a,l),children:g.jsx(Rk,{label:e.label,description:e.description})})}function VX(e){return e==null?void 0:e.answers}function Zr(e){return e.id||e.question}function KX({message:e,onSubmit:t,isLatest:n}){var j,Y;const r=e.input.questions,s=!!e.result,a=VX(e.result),l=((j=e.result)==null?void 0:j.discarded)===!0,[u,d]=x.useState(0),[h,p]=x.useState({}),[m,_]=x.useState({}),[y,S]=x.useState(a??null),[w,C]=x.useState(s),k=(W,Q)=>{var K;const A=(K=m[W])==null?void 0:K.trim(),P=h[W]||"",Z=Q||r.find(ee=>Zr(ee)===W);if(Z!=null&&Z.multiSelect)return[P,A].filter(Boolean).flatMap(ee=>ee.split(", ").filter(Boolean));const D=A||P;return D?[D]:[]},T=W=>{const Q=h[Zr(W)]||"";return W.multiSelect?Q.split(", ").filter(Boolean):[Q]},R=(W,Q)=>{const A=Zr(W);if(W.multiSelect){const P=h[A]?h[A].split(", ").filter(Boolean):[],Z=P.includes(Q)?P.filter(D=>D!==Q):[...P,Q];p({...h,[A]:Z.join(", ")})}else p({...h,[A]:Q}),_({...m,[A]:""}),u<r.length-1&&setTimeout(()=>d(u+1),150)},M=(W,Q)=>{const A=Zr(W);_({...m,[A]:Q}),Q&&!W.multiSelect&&p({...h,[A]:""})},L=W=>{const Q=Zr(W);W.multiSelect&&m[Q]&&_({...m,[Q]:""})},O=r.every(W=>k(Zr(W),W).length>0),z=r[u],H=u===r.length-1,G=z&&k(Zr(z),z).length>0,B=()=>{u<r.length-1&&d(u+1)},$=()=>{u>0&&d(u-1)},I=()=>{if(!O)return;const W={};for(const Q of r){const A=Zr(Q);W[A]=k(A,Q)}S(W),C(!0),t(e.toolId,r,W)},U=W=>{if(W.key==="Enter"&&!(!z||!G)){if(W.preventDefault(),H){I();return}B()}};if(w||s){const W=a||y||{};return g.jsx("div",{className:"w-full",children:g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[g.jsxs("div",{className:"font-medium text-sm p-3 px-4 pr-5 bg-muted border-b border-border flex flex-row items-center justify-between",children:[g.jsxs("p",{children:["Question",r.length!==1?"s":""]}),g.jsx("p",{className:"",children:l?"Discarded":"Answers"})]}),r.map((Q,A)=>{const P=W[Zr(Q)]||W[Q.question]||[],Z=A===r.length-1;return g.jsxs("div",{className:xe("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!Z&&"border-b border-border"),children:[g.jsx("div",{className:"text-sm text-pretty",children:Q.question}),P.length>0&&g.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:P.join(", ")}),P.length===0&&g.jsx("div",{className:"text-sm font-medium text-right italic",children:l?"Discarded":"No Response"})]},Zr(Q))})]})})}if(!n)return g.jsx("div",{className:"w-full py-2",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(oR,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!z)return null;const V=T(z),F=m[Zr(z)]||"";return g.jsxs("div",{className:"w-full space-y-3",children:[g.jsxs(WX,{question:z.question,currentIndex:u,totalQuestions:r.length,onBack:u>0?$:void 0,children:[(Y=z.options)==null?void 0:Y.map(W=>g.jsx(qX,{option:W,selected:V.includes(W.label),multiSelect:z.multiSelect,onClick:()=>R(z,W.label)},W.label)),g.jsx("div",{className:"transition-all bg-background",children:g.jsxs("div",{className:"flex pr-5 items-center justify-between gap-3",children:[g.jsx("input",{type:"text",value:F,onChange:W=>M(z,W.target.value),onKeyDown:U,placeholder:"Other...",className:"flex-1 px-3 !py-1 pl-4 min-h-[55px] min-w-0 text-sm bg-transparent outline-none text-foreground placeholder:text-muted-foreground"}),g.jsx(sN,{selected:!!F,multiSelect:z.multiSelect,onClick:z.multiSelect&&F?()=>L(z):void 0})]})})]}),g.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!H&&G&&(z.multiSelect||!!F)&&g.jsx(nt,{size:"sm",onClick:B,children:"Next"}),H&&g.jsx(nt,{size:"sm",onClick:I,disabled:!O,className:xe(!O&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}function GX({message:e,onConfirm:t,isLatest:n}){const r=!!e.result,[s,a]=x.useState(!1),[l,u]=x.useState(!1),[d,h]=x.useState(!1),[p,m]=x.useState(""),_=x.useRef(null),y=e.input;x.useEffect(()=>{d&&_.current&&_.current.focus()},[d]);const S=async()=>{y!=null&&y.plan&&(await navigator.clipboard.writeText(y.plan),u(!0),setTimeout(()=>u(!1),2e3))},w=r?e.result:null,C=(w==null?void 0:w.discarded)===!0;return g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsxs("div",{className:"relative rounded-2xl border border-border overflow-hidden group/plan",children:[(y==null?void 0:y.plan)&&g.jsx(nt,{variant:"ghost",size:"icon",className:xe("absolute top-2 right-2 z-10 h-8 w-8 rounded-md text-muted-foreground opacity-0 group-hover/plan:opacity-100 transition-opacity",!l&&"hover:text-foreground",l&&"hover:!bg-transparent hover:!border-transparent"),onClick:S,children:l?g.jsx(Po,{className:"h-4 w-4 text-green-400"}):g.jsx(Ff,{className:"h-4 w-4"})}),g.jsxs("div",{className:xe("!pt-5 !pb-0 px-4 md:py-4.5 md:px-5.5 bg-muted dark:bg-card overflow-scroll no-pre-highlight transition-all",r&&!s?"max-h-[min(400px,40vh)] ":"",r?"hover:!pb-[32px]":""),children:[r&&g.jsxs(nt,{variant:"ghost",className:"absolute z-10 bottom-2 pr-2.5 !pl-3.5 h-[34px] inline-flex gap-1 text-sm left-[50%] -translate-x-[50%] text-muted-foreground backdrop-blur-sm hover:text-foreground opacity-0 group-hover/plan:opacity-100 transition-all rounded-full border border-border",onClick:()=>a(!s),children:[s?"Show Less":"Show More",g.jsx(aj,{className:`size-3.5 transition-transform ${s?"rotate-180":""}`})]}),y!=null&&y.plan?g.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[g.jsx(Fu,{remarkPlugins:[Uu],components:cp(),children:y.plan}),g.jsx("div",{className:"mt-5"})]}):g.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),r?g.jsx("div",{className:"flex justify-end mx-2",children:g.jsxs("span",{className:"pl-4 inline text-sm font-medium bg-background text-foreground/60 border border-border py-1.5 px-3 rounded-[20px] leading-relaxed max-w-[85%] sm:max-w-[80%]",children:[g.jsx("em",{children:C?"Discarded":w!=null&&w.clearContext?"Approved & Cleared Context":w!=null&&w.confirmed?"Approved":w!=null&&w.message?`Adjusted: "${w.message}"`:"Adjusted Plan"}),g.jsx(xj,{className:"inline h-4 w-4 ml-1.5 -mt-0.5"})]})}):n?g.jsxs("div",{className:"flex flex-col gap-3",children:[!d&&g.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2 mx-2",children:[g.jsxs(nt,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-background pr-4 md:order-last",children:[g.jsx(nj,{className:"h-4 w-4 mr-1.5"}),"Approve & Clear"]}),g.jsxs("div",{className:"flex items-stretch md:items-center gap-2 md:contents",children:[g.jsxs(nt,{size:"sm",variant:"outline",onClick:()=>h(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[g.jsx(lR,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),g.jsxs(nt,{size:"sm",variant:"outline",onClick:()=>t(e.toolId,!0),className:"rounded-full border-border flex-1 md:flex-initial",children:[g.jsx(Po,{className:"h-4 w-4 mr-1.5"}),"Approve"]})]})]}),d&&g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsx("textarea",{ref:_,value:p,onChange:k=>m(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&p.trim()&&(k.preventDefault(),t(e.toolId,!1,void 0,p.trim())),k.key==="Escape"&&(h(!1),m(""))},placeholder:"Describe what you'd like to change...",rows:3,className:"w-full rounded-2xl border border-border bg-muted dark:bg-card px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none"}),g.jsxs("div",{className:"flex items-center justify-end gap-2 mx-2",children:[g.jsx(nt,{size:"sm",variant:"ghost",onClick:()=>{h(!1),m("")},className:"rounded-full text-muted-foreground",children:"Cancel"}),g.jsxs(nt,{size:"sm",disabled:!p.trim(),onClick:()=>t(e.toolId,!1,void 0,p.trim()),className:"rounded-full bg-primary text-background disabled:opacity-50 disabled:pointer-events-none",children:[g.jsx(n6,{className:"h-4 w-4 mr-1.5"}),"Adjust Plan"]})]})]})]}):g.jsx("div",{className:"flex justify-end mx-2",children:g.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending (newer prompt active)"})})]})}const YX={completed:{Icon:Po,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:is,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:pj,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function XX({message:e}){const t=e.input.todos;return t.length?g.jsx("div",{className:"w-full",children:g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[g.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border flex items-center gap-2",children:[g.jsx(Pj,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),g.jsx("div",{children:t.map((n,r)=>{const s=r===t.length-1,{Icon:a,iconClass:l,textClass:u}=YX[n.status];return g.jsxs("div",{className:xe("flex items-center gap-3 px-4 py-2.5 bg-background",!s&&"border-b border-border"),children:[g.jsx(a,{className:xe("h-4 w-4 flex-shrink-0",l)}),g.jsx("span",{className:xe("text-sm",u),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function ZX(e){const t=e.split(`
|
|
501
|
+
`),n=/^\s*(\d+)→(.*)$/;return t.map(r=>{const s=r.match(n);return s?{lineNumber:parseInt(s[1],10),content:s[2]}:{lineNumber:null,content:r}})}function QX(e){return e.replace(/<[^>]+>/g,"")}function JX(e,t){const n=e.split(`
|
|
502
|
+
`),r=t.split(`
|
|
503
|
+
`),s=eZ(n,r),a=tZ(n,r,s);return nZ(a)}function eZ(e,t){const n=e.length,r=t.length,s=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=1;a<=n;a++)for(let l=1;l<=r;l++)s[a][l]=e[a-1]===t[l-1]?s[a-1][l-1]+1:Math.max(s[a-1][l],s[a][l-1]);return s}function tZ(e,t,n){const r=[];let s=e.length,a=t.length;for(;s>0||a>0;)s>0&&a>0&&e[s-1]===t[a-1]?(r.push({type:"context",text:e[s-1],oldIdx:s,newIdx:a}),s--,a--):a>0&&(s===0||n[s][a-1]>=n[s-1][a])?(r.push({type:"added",text:t[a-1],oldIdx:s,newIdx:a}),a--):(r.push({type:"removed",text:e[s-1],oldIdx:s,newIdx:a}),s--);return r.reverse()}function nZ(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function zv({content:e,isDiff:t=!1,oldString:n,newString:r}){const s=x.useMemo(()=>t&&n!==void 0&&r!==void 0?JX(n,r):[],[t,n,r]),a=x.useMemo(()=>t?[]:ZX(e),[e,t]),l=x.useMemo(()=>a.some(u=>u.lineNumber!==null),[a]);return t&&s.length>0?g.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:g.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:g.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:g.jsx("tbody",{children:s.map((u,d)=>{const h=u.type==="removed"?"bg-red-500/10 dark:bg-red-500/15":u.type==="added"?"bg-green-500/10 dark:bg-green-500/15":"",p=u.type==="removed"?"text-red-700 dark:text-red-400":u.type==="added"?"text-green-700 dark:text-green-400":"text-foreground";return g.jsxs("tr",{className:h,children:[g.jsx("td",{className:`px-2 py-0 select-none w-0 whitespace-nowrap ${u.type==="removed"?"text-red-500/50":u.type==="added"?"text-green-500/50":"text-muted-foreground/50"}`,children:u.type==="removed"?"-":u.type==="added"?"+":" "}),g.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${p}`,children:u.content.slice(1)})]},d)})})})})}):g.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:g.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:g.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:g.jsx("tbody",{children:a.map((u,d)=>g.jsxs("tr",{children:[l&&g.jsx("td",{className:"px-2 py-0 select-none w-0 whitespace-nowrap text-muted-foreground/50 text-right",children:u.lineNumber!==null?u.lineNumber:""}),g.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:QX(u.content)})]},d))})})})})}function oN({message:e,isLoading:t=!1,localPath:n}){var S;const r=e.result!==void 0,s=!r&&t,a=x.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill;if(e.toolKind==="glob")return`Search files ${e.input.pattern==="**/*"?"in all directories":`matching ${e.input.pattern}`}`;if(e.toolKind==="grep"){const w=e.input.pattern,C=e.input.outputMode;return C==="count"?`Count \`${w}\` occurrences`:C==="content"?`Find \`${w}\` in text`:`Find \`${w}\` in files`}return e.toolKind==="bash"?e.input.description||(e.input.command?CP(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?`Read ${dv(e.input.filePath,n)}`:e.toolKind==="write_file"?`Write ${dv(e.input.filePath,n)}`:e.toolKind==="edit_file"?`Edit ${dv(e.input.filePath,n)}`:e.toolKind==="mcp_generic"?`${Yv(e.input.tool)} from ${Yv(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[e.input,e.toolName,n]),l=x.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),u=x.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),d=e.toolKind==="bash",h=e.toolKind==="write_file",p=e.toolKind==="edit_file",m=e.toolKind==="read_file",_=x.useMemo(()=>{if(typeof e.result=="string")return e.result;if(!e.result)return"";if(typeof e.result=="object"&&e.result!==null&&"content"in e.result){const w=e.result.content;if(typeof w=="string")return w}return JSON.stringify(e.result,null,2)},[e.result]),y=x.useMemo(()=>{switch(e.toolKind){case"bash":return e.input.command;case"write_file":return e.input.content;default:return JSON.stringify(e.input,null,2)}},[e]);return g.jsx(no,{className:"w-full",children:g.jsxs(ap,{expandedContent:g.jsx(lp,{className:"my-4 text-sm",children:g.jsxs("div",{className:"flex flex-col gap-2",children:[p?g.jsx(zv,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):!m&&!h&&g.jsx(N2,{label:d?g.jsxs("span",{className:"flex items-center gap-2 w-full",children:[g.jsx("span",{children:"Command"}),!!e.input.timeoutMs&&g.jsxs("span",{className:"text-muted-foreground",children:["timeout: ",String(e.input.timeoutMs),"ms"]}),!!e.input.runInBackground&&g.jsx("span",{className:"text-muted-foreground",children:"background"})]}):h?"Contents":"Input",copyText:y,children:y}),r&&m&&!e.isError&&g.jsx(zv,{content:_}),h&&!e.isError&&g.jsx(zv,{content:e.input.content}),r&&!m&&!(h&&!e.isError)&&!(p&&!e.isError)&&g.jsx(N2,{label:e.isError?"Error":"Result",copyText:_,children:_})]})}),children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:(()=>{if(e.isError)return g.jsx(vl,{className:"size-4 text-destructive"});if(l)return g.jsx(Ay,{className:"size-4 text-muted-icon"});const w=W5(e.toolName);return g.jsx(w,{className:"size-4 text-muted-icon"})})()}),g.jsx(Qs,{className:"text-left transition-opacity duration-200 truncate",children:g.jsx(Xf,{animate:s,shimmerWidth:Math.max(20,(((S=u||a)==null?void 0:S.length)??33)*3),children:u||a})})]})})}function rZ({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),s=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return s>0?`${s}h${a>0?` ${a}m`:""}`:a>0?`${a}m${l>0?` ${l}s`:""}`:`${l}s`};return g.jsxs(no,{className:`px-0.5 text-xs tracking-wide ${e.durationMs>6e4?"":"hidden"}`,children:[g.jsx("div",{className:"w-full h-[1px] bg-border"}),g.jsxs(Qs,{className:"whitespace-nowrap text-[11px] tracking-widest text-muted-foreground/60 uppercase flex-shrink-0",children:["Worked for ",t(e.durationMs)]}),g.jsx("div",{className:"w-full h-[1px] bg-border"})]})}function iZ({message:e}){return g.jsx("div",{className:"flex items-center justify-end gap-2 text-sm text-muted-foreground my-3",children:g.jsxs("div",{className:"inline-flex gap-1.5 items-center justify-center whitespace-nowrap text-sm font-medium bg-background text-foreground/60 border border-border h-9 pl-1 pr-4 rounded-full",children:[g.jsx(dj,{className:"h-4 w-4 ml-1.5"}),g.jsx("em",{children:"Interrupted"})]})})}function Nf({size:e=4}){return g.jsxs("svg",{className:"flex-1",viewBox:`0 0 100 ${e}`,preserveAspectRatio:"none",style:{height:`${e}px`},children:[g.jsx("pattern",{id:"zigzag",width:e,height:e,patternUnits:"userSpaceOnUse",children:g.jsx("path",{d:`M0 ${e} L${e/2} 0 L${e} ${e}`,fill:"none",stroke:"currentColor",strokeWidth:"0.5",className:"text-muted-foreground/30",style:{stroke:"currentColor"}})}),g.jsx("rect",{width:"100%",height:e,fill:"url(#zigzag)",className:"text-muted-foreground/30"})]})}function sZ(){return g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Nf,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),g.jsx(Nf,{})]})}function oZ(){return g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Nf,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),g.jsx(Nf,{})]})}function aZ({message:e}){return g.jsx(no,{children:g.jsxs(ap,{expandedContent:g.jsx(lp,{className:"my-4 text-xs",children:g.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:g.jsx(Fu,{remarkPlugins:[Uu],components:cp(),children:e.summary})})}),children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(aR,{className:"h-4.5 w-4.5 text-muted-foreground"})}),g.jsx(Qs,{children:"Summarized"})]})})}const lZ={compacting:"Compacting..."};function cZ({message:e}){const t=lZ[e.status]||e.status;return g.jsxs(no,{className:"grid grid-cols-[auto_1fr] items-center gap-1.5 text-sm animate-pulse",children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(aR,{className:"h-4.5 w-4.5 text-muted-foreground"})}),g.jsx(Qs,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const uZ={read_file:{key:"read",singular:"read",plural:"reads"},edit_file:{key:"edit",singular:"edit",plural:"edits"},write_file:{key:"write",singular:"write",plural:"writes"},bash:{key:"bash",singular:"command",plural:"commands"},grep:{key:"grep",singular:"search",plural:"searches"},glob:{key:"glob",singular:"glob",plural:"globs"},subagent_task:{key:"task",singular:"agent",plural:"agents"},web_search:{key:"websearch",singular:"web search",plural:"web searches"},skill:{key:"skill",singular:"skill",plural:"skills"},todo_write:{key:"todo",singular:"todo update",plural:"todo updates"}},hZ={key:"other",singular:"tool call",plural:"tool calls"};function dZ(e){return uZ[e]??hZ}function fZ(e){const t=new Map,n=[];for(const r of e){const s=r.toolKind,a=dZ(s),l=t.get(a.key);l?l.count++:(t.set(a.key,{category:a,count:1}),n.push(a.key))}return n.map(r=>{const{category:s,count:a}=t.get(r);return`${a} ${a===1?s.singular:s.plural}`}).join(", ")}function pZ({messages:e,isLoading:t,localPath:n}){const[r,s]=x.useState(!1),a=x.useMemo(()=>fZ(e),[e]),u=e.some(d=>d.result===void 0)&&t;return g.jsx(no,{className:"w-full",children:g.jsxs("div",{className:"flex flex-col w-full",children:[g.jsx("button",{onClick:()=>s(!r),className:`group cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${!r&&!u?"hover:opacity-60 transition-opacity":""}`,children:g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(es,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),g.jsx(Qs,{className:"text-left",children:g.jsx(Xf,{animate:u,children:a})})]})}),r&&g.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(d=>g.jsx(oN,{message:d,isLoading:t,localPath:n},d.id)),e.length>5&&g.jsx("button",{onClick:()=>s(!1),className:"cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-xs hover:opacity-80 transition-opacity",children:g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(es,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),g.jsx(Qs,{className:"text-left",children:"Collapse"})]})})]})]})})}const mZ=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function Tk(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!mZ.has(t)}function gZ(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(Tk(r)){const s=[r],a=n;for(n+=1;n<e.length&&Tk(e[n]);)s.push(e[n]),n+=1;s.length>=2?t.push({type:"tool-group",messages:s,startIndex:a}):t.push({type:"single",message:r,index:a});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function vZ({messages:e,isLoading:t,localPath:n,latestToolIds:r,onOpenLocalLink:s,onAskUserQuestionSubmit:a,onExitPlanModeConfirm:l}){const u=x.useMemo(()=>gZ(e),[e]);function d(h,p){if(h.kind==="user_prompt")return g.jsx(zX,{content:h.content},h.id);switch(h.kind){case"unknown":return g.jsx(jX,{json:h.json},h.id);case"system_init":return e.findIndex(_=>_.kind==="system_init")===p?g.jsx(FX,{message:h,rawJson:h.debugRaw},h.id):null;case"account_info":return e.findIndex(_=>_.kind==="account_info")===p?g.jsx(UX,{message:h},h.id):null;case"assistant_text":return g.jsx($X,{message:h},h.id);case"tool":return h.toolKind==="ask_user_question"?g.jsx(KX,{message:h,onSubmit:a,isLatest:h.id===r.AskUserQuestion},h.id):h.toolKind==="exit_plan_mode"?g.jsx(GX,{message:h,onConfirm:l,isLatest:h.id===r.ExitPlanMode},h.id):h.toolKind==="todo_write"?h.id!==r.TodoWrite?null:g.jsx(XX,{message:h},h.id):g.jsx(oN,{message:h,isLoading:t,localPath:n},h.id);case"result":{const m=e[p+1],_=e[p-1];return(m==null?void 0:m.kind)==="context_cleared"||(_==null?void 0:_.kind)==="context_cleared"?null:g.jsx(rZ,{message:h},h.id)}case"interrupted":return g.jsx(iZ,{message:h},h.id);case"compact_boundary":return g.jsx(sZ,{},h.id);case"context_cleared":return g.jsx(oZ,{},h.id);case"compact_summary":return g.jsx(aZ,{message:h},h.id);case"status":return p===e.length-1?g.jsx(cZ,{message:h},h.id):null}}return g.jsx(H$,{onOpenLocalLink:s,children:u.map(h=>{if(h.type==="tool-group")return g.jsx("div",{className:"group relative",[sf]:"",children:g.jsx(pZ,{messages:h.messages,isLoading:t,localPath:n})},`group-${h.startIndex}`);const p=d(h.message,h.index);return p?g.jsx("div",{id:`msg-${h.message.id}`,className:"group relative",[sf]:"",children:p},h.message.id):null})})}function _Z({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){x.useEffect(()=>{if(!n)return;let s=0,a=null;const l=m=>{const _=m instanceof Element?m:null,y=e.current,S=t.current;if(jw({trigger:"pointer",activeElement:document.activeElement,pointerStartTarget:a,pointerEndTarget:_,root:y,fallback:S,hasActiveOverlay:zw(document),hasActiveSelection:C6(window.getSelection())})!=="restore"){a=null;return}S==null||S.focus({preventScroll:!0}),a=null},u=m=>{cancelAnimationFrame(s),a=m.target instanceof Element?m.target:null},d=m=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{l(m.target)})},h=()=>{a=null;const m=t.current;!m||m.disabled||m.focus({preventScroll:!0})},p=m=>{if(m.key!=="Escape")return;const _=t.current;jw({trigger:"escape",activeElement:document.activeElement,fallback:_,hasActiveOverlay:zw(document),canCancel:r,defaultPrevented:m.defaultPrevented})==="escape-focus"&&(m.preventDefault(),_==null||_.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",u,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("keydown",p,!0),window.addEventListener(rf,h),()=>{cancelAnimationFrame(s),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("keydown",p,!0),window.removeEventListener(rf,h)}},[r,n,t,e])}const Md="What are we building?",yZ=19,bZ=72,xZ=120;function SZ(){var ie,ge,Te,ve,ke,We;const e=dy(),t=x.useRef(null),n=x.useRef(null),r=x.useRef(null),[s,a]=x.useState(""),[l,u]=x.useState(!1),[d,h]=x.useState(0),p=((ie=e.runtime)==null?void 0:ie.projectId)??null,_=Oo(fe=>p?fe.projects[p]:void 0)??tW,S=Yd(fe=>p?fe.projects[p]:void 0)??X$,w=Oo(fe=>fe.addTerminal),C=Oo(fe=>fe.removeTerminal),k=Oo(fe=>fe.toggleVisibility),T=Oo(fe=>fe.setMainSizes),R=Oo(fe=>fe.setTerminalSizes),M=Yd(fe=>fe.toggleVisibility),L=Yd(fe=>fe.setSize),O=Pr(fe=>fe.scrollbackLines),z=Pr(fe=>fe.minColumnWidth),H=e.keybindings,G=x.useMemo(()=>G5(H),[H]),B=_.terminals.length>0,$=!!(p&&_.isVisible&&B),I=!!(p&&B),U=!!(p&&S.isVisible),V=!!p,{isAnimating:F,mainPanelGroupRef:j,terminalFocusRequestVersion:Y,terminalPanelRef:W,terminalVisualRef:Q}=dW({showTerminalPane:$,shouldRenderTerminalLayout:I,projectId:p,terminalLayout:_,chatInputRef:r}),{isAnimating:A,panelGroupRef:P,sidebarPanelRef:Z,sidebarVisualRef:D}=uW({projectId:p,shouldRenderRightSidebarLayout:V,showRightSidebar:U,rightSidebarSize:S.size});_Z({rootRef:n,fallbackRef:r,enabled:e.hasSelectedProject&&((ge=e.runtime)==null?void 0:ge.status)!=="waiting_for_user",canCancel:e.canCancel}),x.useEffect(()=>{if(e.messages.length!==0)return;a(""),u(!1);let fe=0;const _e=window.setInterval(()=>{fe+=1,a(Md.slice(0,fe)),fe>=Md.length&&(window.clearInterval(_e),u(!0))},yZ);return()=>window.clearInterval(_e)},[e.activeChatId,e.messages.length]),x.useEffect(()=>{function fe(_e){if(p){if(Dc(G,"toggleEmbeddedTerminal",_e)){if(_e.preventDefault(),B){k(p);return}w(p);return}if(Dc(G,"toggleRightSidebar",_e)){_e.preventDefault(),M(p);return}if(Dc(G,"openInFinder",_e)){_e.preventDefault(),e.handleOpenExternal("open_finder");return}if(Dc(G,"openInEditor",_e)){_e.preventDefault(),e.handleOpenExternal("open_editor");return}Dc(G,"addSplitTerminal",_e)&&(_e.preventDefault(),w(p))}}return window.addEventListener("keydown",fe),()=>window.removeEventListener("keydown",fe)},[w,B,p,G,M,k]),x.useEffect(()=>{if(e.messages.length===0)return;const fe=window.requestAnimationFrame(()=>{const _e=e.scrollRef.current;_e&&_e.scrollTo({top:_e.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(fe)},[e.messages.length,e.scrollRef]),x.useEffect(()=>{const fe=window.requestAnimationFrame(()=>{e.updateScrollState()}),_e=window.setTimeout(()=>{e.updateScrollState()},Qa);return()=>{window.cancelAnimationFrame(fe),window.clearTimeout(_e)}},[I,$,e.updateScrollState]),x.useEffect(()=>{function fe(){e.updateScrollState()}return window.addEventListener("resize",fe),()=>window.removeEventListener("resize",fe)},[e.updateScrollState]),x.useEffect(()=>{const fe=t.current;if(!fe||!I)return;const _e=()=>{const he=fe.getBoundingClientRect().height;if(he<=0)return;const et=he*(_.mainSizes[1]/100);et<=0||h(gt=>Math.abs(gt-et)<1?gt:et)},He=new ResizeObserver(_e);return He.observe(fe),_e(),()=>He.disconnect()},[p,I,_.mainSizes]);const K=fe=>Number.isFinite(fe)?Math.min(q_,Math.max(up,fe)):S.size,ee=g.jsxs(SM,{ref:n,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",children:[g.jsxs(CM,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[g.jsx(M7,{sidebarCollapsed:e.sidebarCollapsed,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,onNewChat:e.handleCompose,localPath:e.navbarLocalPath,embeddedTerminalVisible:$,onToggleEmbeddedTerminal:p?()=>{if(B){k(p);return}w(p)}:void 0,rightSidebarVisible:U,onToggleRightSidebar:p?()=>M(p):void 0,onOpenExternal:fe=>{e.handleOpenExternal(fe)},editorLabel:e.editorLabel,finderShortcut:G.bindings.openInFinder,editorShortcut:G.bindings.openInEditor,terminalShortcut:G.bindings.toggleEmbeddedTerminal,rightSidebarShortcut:G.bindings.toggleRightSidebar}),g.jsxs(V5,{ref:e.scrollRef,onScroll:e.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[e.messages.length===0?g.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"}):null,e.messages.length>0?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"animate-fade-in space-y-5 pt-[72px] max-w-[800px] mx-auto",children:[g.jsx(vZ,{messages:e.messages,isLoading:e.isProcessing,localPath:(Te=e.runtime)==null?void 0:Te.localPath,latestToolIds:e.latestToolIds,onOpenLocalLink:e.handleOpenLocalLink,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?g.jsx(W$,{status:(ve=e.runtime)==null?void 0:ve.status}):null,e.commandError?g.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3",children:e.commandError}):null]}),g.jsx("div",{style:{height:250},"aria-hidden":"true"})]}):null]}),e.messages.length===0?g.jsx("div",{className:"pointer-events-none absolute inset-x-4 animate-fade-in",style:{top:bZ,bottom:e.transcriptPaddingBottom},children:g.jsx("div",{className:"mx-auto flex h-full max-w-[800px] items-center justify-center",children:g.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground gap-4 opacity-70",children:[g.jsx(Gc,{strokeWidth:1.5,className:"size-8 text-muted-foreground kanna-empty-state-flower"}),g.jsx("div",{className:"text-base font-normal text-muted-foreground text-center max-w-xs flex items-center kanna-empty-state-text","aria-label":Md,children:g.jsxs("span",{className:"relative inline-grid place-items-start",children:[g.jsxs("span",{className:"invisible col-start-1 row-start-1 whitespace-pre flex items-center",children:[g.jsx("span",{children:Md}),g.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true"})]}),g.jsxs("span",{className:"col-start-1 row-start-1 whitespace-pre flex items-center",children:[g.jsx("span",{children:s}),g.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true",children:g.jsx("span",{className:"kanna-typewriter-cursor","data-typing-complete":l?"true":"false"})})]})]})})]})})},e.activeChatId??"new-chat"):null,g.jsx("div",{style:{bottom:xZ},className:xe("absolute left-1/2 -translate-x-1/2 z-10 transition-all",e.showScrollButton?"scale-100 duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]":"scale-60 duration-300 ease-out pointer-events-none blur-sm opacity-0"),children:g.jsx("button",{onClick:e.scrollToBottom,className:"flex items-center transition-colors gap-1.5 px-2 bg-white hover:bg-muted border border-border rounded-full aspect-square cursor-pointer text-sm text-primary hover:text-foreground dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-100 dark:border-slate-600",children:g.jsx(qz,{className:"h-5 w-5"})})})]}),g.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-20 pointer-events-none",children:g.jsx("div",{className:"bg-gradient-to-t from-background via-background pointer-events-auto",ref:e.inputRef,children:g.jsx(k7,{ref:r,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((ke=e.runtime)==null?void 0:ke.status)==="waiting_for_user",canCancel:e.canCancel,chatId:e.activeChatId,activeProvider:((We=e.runtime)==null?void 0:We.provider)??null,availableProviders:e.availableProviders},e.activeChatId??"new-chat")})})]});return g.jsx("div",{ref:t,className:"flex-1 flex flex-col min-w-0 relative",children:V&&p?g.jsxs(Id,{groupRef:P,orientation:"horizontal",className:"flex-1 min-h-0",onLayoutChange:fe=>{var He;if(!U||A.current)return;const _e=K(fe.rightSidebar);Math.abs(_e-fe.rightSidebar)<.1||(He=P.current)==null||He.setLayout({workspace:100-_e,rightSidebar:_e})},onLayoutChanged:fe=>{!U||A.current||L(p,K(fe.rightSidebar))},children:[g.jsx(Ao,{id:"workspace",defaultSize:`${100-S.size}%`,minSize:"50%",className:"min-h-0 min-w-0",children:I?g.jsxs(Id,{groupRef:j,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:fe=>{!$||F.current||T(p,[fe.chat,fe.terminal])},children:[g.jsx(Ao,{id:"chat",defaultSize:`${_.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:ee}),g.jsx(Hd,{withHandle:!0,orientation:"vertical",className:xe(!$&&"pointer-events-none opacity-0")}),g.jsx(Ao,{id:"terminal",defaultSize:`${_.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:W,children:g.jsx("div",{ref:Q,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":$?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${Qa}ms`},children:g.jsx("div",{style:d>0?{height:`${d}px`}:void 0,children:g.jsx(M2,{projectId:p,layout:_,onAddTerminal:w,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:O,minColumnWidth:z,splitTerminalShortcut:G.bindings.addSplitTerminal,focusRequestVersion:Y,onRemoveTerminal:(fe,_e)=>{e.socket.command({type:"terminal.close",terminalId:_e}).catch(()=>{}),C(fe,_e)},onTerminalLayout:R})})})})]},p):ee}),g.jsx(Hd,{withHandle:!0,orientation:"horizontal",disabled:!U,className:xe(!U&&"pointer-events-none opacity-0")}),g.jsx(Ao,{id:"rightSidebar",defaultSize:`${S.size}%`,maxSize:`${q_}%`,className:"min-h-0 min-w-0",elementRef:Z,children:g.jsx("div",{ref:D,className:"h-full min-h-0 overflow-hidden","data-right-sidebar-open":U?"true":"false","data-right-sidebar-animated":"false","data-right-sidebar-visual":!0,style:{"--terminal-toggle-duration":`${Qa}ms`},children:g.jsx(A7,{onClose:()=>M(p)})})})]},`${p}-right-sidebar`):I&&p?g.jsxs(Id,{groupRef:j,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:fe=>{!$||F.current||T(p,[fe.chat,fe.terminal])},children:[g.jsx(Ao,{id:"chat",defaultSize:`${_.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:ee}),g.jsx(Hd,{withHandle:!0,orientation:"vertical",className:xe(!$&&"pointer-events-none opacity-0")}),g.jsx(Ao,{id:"terminal",defaultSize:`${_.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:W,children:g.jsx("div",{ref:Q,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":$?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${Qa}ms`},children:g.jsx("div",{style:d>0?{height:`${d}px`}:void 0,children:g.jsx(M2,{projectId:p,layout:_,onAddTerminal:w,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:O,minColumnWidth:z,splitTerminalShortcut:G.bindings.addSplitTerminal,focusRequestVersion:Y,onRemoveTerminal:(fe,_e)=>{e.socket.command({type:"terminal.close",terminalId:_e}).catch(()=>{}),C(fe,_e)},onTerminalLayout:R})})})})]},p):ee})}function Mk({narrow:e=!1,title:t,subtitle:n,icon:r=Ey}){return g.jsxs("div",{className:xe("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[g.jsxs("div",{className:xe("flex items-center gap-1 mb-2",e&&"justify-center"),children:[g.jsx("div",{className:"p-2 pl-0 rounded-lg",children:g.jsx(r,{className:"h-6 w-6 text-muted-foreground"})}),g.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t})]}),n&&g.jsx("p",{className:xe("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const wZ={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function aN({value:e,onValueChange:t,options:n,size:r="md",className:s,optionClassName:a}){return g.jsx("div",{className:xe("inline-flex items-center rounded-full border border-border p-0.5 ",s),children:n.map(l=>{const u=l.value===e,d=l.icon,h=d?x.isValidElement(d)?d:(()=>{const m=d;return g.jsx(m,{className:r==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,p=g.jsxs("button",{type:"button",onClick:()=>t(l.value),disabled:l.disabled,"aria-pressed":u,className:xe("rounded-full border transition-colors",d?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",wZ[r],u?"bg-white dark:bg-muted text-slate-900 dark:text-slate-200 border-slate-300 dark:border-white/10 bg-slate-200 ":"border-transparent text-slate-800 hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",l.disabled&&"opacity-50 pointer-events-none",a),children:[h,g.jsx("span",{children:l.label})]},l.value);return l.tooltip?g.jsxs(uf,{children:[g.jsx(hf,{asChild:!0,children:p}),g.jsx(lu,{children:l.tooltip})]},l.value):p})})}function CZ(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function kZ({open:e,onOpenChange:t,onConfirm:n}){const[r,s]=x.useState("new"),[a,l]=x.useState(""),[u,d]=x.useState(""),h=x.useRef(null),p=x.useRef(null);x.useEffect(()=>{e&&(s("new"),l(""),d(""),setTimeout(()=>{var C;return(C=h.current)==null?void 0:C.focus()},0))},[e]),x.useEffect(()=>{e&&setTimeout(()=>{var C,k;r==="new"?(C=h.current)==null||C.focus():(k=p.current)==null||k.focus()},0)},[r,e]);const m=CZ(a),_=m?`${_P}/${m}`:"",y=u.trim(),S=r==="new"?!!m:!!y,w=()=>{if(S){if(r==="new")n({mode:"new",localPath:_,title:a.trim()});else{const C=y.split("/").pop()||y;n({mode:"existing",localPath:y,title:C})}t(!1)}};return g.jsx(hR,{open:e,onOpenChange:t,children:g.jsxs(Dy,{size:"sm",children:[g.jsxs(pR,{className:"space-y-4",children:[g.jsx(fR,{children:"Add Project"}),g.jsx(aN,{value:r,onValueChange:s,options:[{value:"new",label:"New Folder"},{value:"existing",label:"Existing Path"}],className:"w-full",optionClassName:"flex-1 justify-center"}),r==="new"?g.jsxs("div",{className:"space-y-2",children:[g.jsx("input",{ref:h,type:"text",value:a,onChange:C=>l(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},className:"w-full px-3 py-2 text-sm border border-border rounded-md bg-background outline-none",placeholder:"Project name"}),_&&g.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:_})]}):g.jsxs("div",{className:"space-y-2",children:[g.jsx("input",{ref:p,type:"text",value:u,onChange:C=>d(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},className:"w-full px-3 py-2 text-sm border border-border rounded-md bg-background outline-none",placeholder:"~/Projects/my-app"}),g.jsx("p",{className:"text-xs text-muted-foreground",children:"The folder will be created if it doesn't exist."})]})]}),g.jsxs(mR,{children:[g.jsx(nt,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),g.jsx(nt,{variant:"secondary",size:"sm",onClick:w,disabled:!S,children:"Create"})]})]})})}function EZ({text:e}){const[t,n]=x.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return g.jsx(nt,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void r(),children:t?g.jsx(Po,{className:"h-4 w-4 text-green-400"}):g.jsx(Ff,{className:"h-4 w-4"})})}function Ak({children:e}){return g.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center group bg-background border border-border text-foreground rounded-xl p-1.5 pl-3 font-mono text-sm",children:[g.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[g.jsx(es,{className:"inline h-4 w-4 opacity-40"}),g.jsx("code",{children:e})]}),g.jsx(EZ,{text:e})]})}function Ad({children:e}){return g.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function jv({children:e}){return g.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function Bv({icon:e,title:t,subtitle:n,iconClassName:r}){return g.jsxs("div",{className:"flex flex-col items-center gap-0",children:[g.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:g.jsx(e,{className:r||"h-8 w-8 text-muted-foreground"})}),g.jsx("span",{className:"text-sm font-medium",children:t}),g.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function Nk(){return g.jsx(Kz,{className:"h-4 w-4 text-muted-foreground"})}function Dk({number:e,title:t,children:n}){return g.jsx("div",{className:"flex gap-4",children:g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[g.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[e,"."]}),g.jsx("h3",{className:"font-medium text-foreground mb-2",children:t})]}),g.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:n})]})})}function RZ({localPath:e,loading:t,onClick:n}){return g.jsxs(uf,{children:[g.jsx(hf,{asChild:!0,children:g.jsxs("button",{className:xe("border border-border hover:border-primary/30 group rounded-lg bg-card px-4 py-3 flex items-center gap-3 w-full text-left hover:bg-muted/50 transition-colors",t&&"opacity-50 cursor-not-allowed"),disabled:t,onClick:n,children:[g.jsx(Oj,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),g.jsx("span",{className:"font-medium text-foreground truncate flex-1",children:ZR(e)}),t?g.jsx(is,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):g.jsx(Ty,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})}),g.jsx(lu,{children:g.jsx("p",{children:e})})]})}function TZ({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:s,onOpenProject:a,onCreateProject:l}){const[u,d]=x.useState(!1),h=x.useMemo(()=>(n==null?void 0:n.projects)??[],[n==null?void 0:n.projects]),p=e==="connecting"||!t,m=e==="connected"&&t;return g.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[m?g.jsxs(g.Fragment,{children:[g.jsx(Mk,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${Pn} is connected, choose a project below to get started.`}),g.jsxs("div",{className:"w-full px-6 mb-10",children:[g.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[g.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:"Projects"}),g.jsxs(nt,{variant:"default",size:"sm",onClick:()=>d(!0),children:[g.jsx(Ry,{className:"h-4 w-4 mr-1.5"}),"Add Project"]})]}),h.length>0?g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-4 3xl:grid-cols-5 gap-2",children:h.map(_=>g.jsx(RZ,{localPath:_.localPath,loading:r===_.localPath,onClick:()=>{a(_.localPath)}},_.localPath))}):g.jsx(Ad,{children:g.jsx("p",{className:"text-sm text-muted-foreground",children:"No local projects discovered yet. Open one with Claude or Codex, or create a new project here."})}),s?g.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3 mt-4",children:s}):null]})]}):g.jsxs(g.Fragment,{children:[g.jsx(Mk,{narrow:!0,icon:Dw,title:p?`Connecting ${Pn}`:`Connect ${Pn}`,subtitle:p?`${Pn} is starting up and loading your local projects.`:`Run ${Pn} directly on your machine with full access to your local files and agent project history.`}),g.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[g.jsx(jv,{children:"Status"}),g.jsx("div",{className:"mb-8",children:g.jsx(Ad,{children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(is,{className:"h-4 w-4 text-muted-foreground animate-spin"}),g.jsx("span",{className:"text-sm text-muted-foreground",children:p?`Connecting to your local ${Pn} server...`:g.jsxs(g.Fragment,{children:["Not connected. Run ",g.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:hd()})," from any terminal on this machine."]})})]})})}),p?null:g.jsxs("div",{className:"mb-10",children:[g.jsx(jv,{children:"How it works"}),g.jsx(Ad,{children:g.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[g.jsx(Bv,{icon:My,title:`${Pn} CLI`,subtitle:"On Your Machine"}),g.jsx(Nk,{}),g.jsx(Bv,{icon:Ey,title:`${Pn} Server`,subtitle:"Local WebSocket"}),g.jsx(Nk,{}),g.jsx(Bv,{icon:Dw,title:`${Pn} UI`,subtitle:"Project Chat"})]})})]}),p?null:g.jsxs("div",{className:"mb-10",children:[g.jsx(jv,{children:"Setup"}),g.jsx(Ad,{children:g.jsxs("div",{className:"space-y-4",children:[g.jsxs(Dk,{number:1,title:`Start ${Pn}`,children:[g.jsx("p",{children:"Run this command in your terminal:"}),g.jsx(Ak,{children:hd()})]}),g.jsxs(Dk,{number:2,title:"Open the local UI",children:[g.jsxs("p",{children:[Pn," serves the app locally and opens the Local Projects page in an app-style browser window."]}),g.jsx(Ak,{children:"http://localhost:3210/local"})]}),g.jsxs("div",{className:"mt-8",children:[g.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Notes"}),g.jsxs("div",{className:"space-y-3 text-sm",children:[g.jsxs("div",{className:"flex gap-4",children:[g.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:hd("").trim()}),g.jsx("span",{className:"text-muted-foreground",children:"Start in the current directory"})]}),g.jsxs("div",{className:"flex gap-4",children:[g.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:hd("--no-open")}),g.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),g.jsx(kZ,{open:u,onOpenChange:d,onConfirm:_=>{l(_)}}),g.jsx("div",{className:"py-4 text-center",children:g.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",XR.split("/")[1]]})})]})}function MZ(){const e=dy();return g.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:g.jsx(TZ,{connectionStatus:e.connectionStatus,ready:e.localProjectsReady,snapshot:e.localProjects,startingLocalPath:e.startingLocalPath,commandError:e.commandError,onOpenProject:e.handleOpenLocalProject,onCreateProject:e.handleCreateProject})})}const Zd=[{id:"general",label:"General",icon:o6,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"keybindings",label:"Keybindings",icon:_j,subtitle:"Edit global app shortcuts stored in the active keybindings file."},{id:"changelog",label:"Changelog",icon:Jz,subtitle:"Release notes pulled from the public GitHub releases feed."}];function Ok(e){return e&&Zd.some(t=>t.id===e)?e:null}const AZ=[{value:"light",label:"Light",icon:p6},{value:"dark",label:"Dark",icon:Gj},{value:"system",label:"System",icon:Ey}],NZ=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],DZ="https://api.github.com/repos/jakemor/kanna/releases",OZ=300*1e3;let Ja=null;const Lk=Object.keys(K5);function LZ(e){return`Edit global app shortcuts stored in ${e}.`}async function zk(e=fetch){const t=await e(DZ,{headers:{Accept:"application/vnd.github+json"}});if(!t.ok)throw new Error(`GitHub releases request failed with status ${t.status}`);return(await t.json()).filter(r=>!r.draft)}function zZ(){return Ja?Date.now()>=Ja.expiresAt?(Ja=null,null):Ja.releases:null}function jk(e){Ja={releases:e,expiresAt:Date.now()+OZ}}function jZ(e){if(!e)return"Unpublished";const t=new Date(e);return Number.isNaN(t.getTime())?"Unknown date":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(t)}function BZ({status:e,releases:t,error:n,onRetry:r}){return g.jsxs("div",{className:"space-y-4",children:[e==="loading"||e==="idle"?g.jsx("div",{className:"flex min-h-[180px] items-center justify-center rounded-2xl border border-border bg-card/40 px-6 py-8 text-sm text-muted-foreground",children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(is,{className:"h-4 w-4 animate-spin"}),g.jsx("span",{children:"Loading release notes…"})]})}):null,e==="error"?g.jsx("div",{className:"rounded-2xl border border-destructive/20 bg-destructive/5 px-6 py-5",children:g.jsxs("div",{className:"flex items-start justify-between gap-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:"Could not load changelog"}),g.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:n??"Unable to load changelog."})]}),g.jsx("button",{type:"button",onClick:r,className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted",children:"Retry"})]})}):null,e==="success"&&t.length===0?g.jsxs("div",{className:"rounded-2xl border border-border bg-card/30 px-6 py-8",children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:"No releases yet"}),g.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:"GitHub did not return any published releases for this repository."})]}):null,e==="success"&&t.length>0?t.map(s=>{var a,l;return g.jsxs("article",{className:"rounded-xl border border-border bg-card/30 pl-6 pr-4 py-4",children:[g.jsxs("div",{className:"flex flex-row items-center min-w-0 flex-1 gap-3 ",children:[g.jsxs("div",{className:"flex flex-row items-center min-w-0 flex-1 gap-3 ",children:[g.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:((a=s.name)==null?void 0:a.trim())||s.tag_name}),g.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[g.jsx("span",{children:jZ(s.published_at)}),s.prerelease?g.jsx("span",{className:"rounded-full border border-border px-2.5 py-1 uppercase tracking-wide",children:"Prerelease"}):null]})]}),g.jsxs("div",{className:"flex flex-row items-center justify-end min-w-0 flex-1 gap-3 ",children:[g.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground",children:g.jsx("span",{className:"rounded-full bg-muted px-2.5 py-1 font-mono text-foreground/80",children:s.tag_name})}),g.jsx("a",{href:s.html_url,target:"_blank",rel:"noopener noreferrer","aria-label":"View release on GitHub",className:xe(yy({variant:"ghost",size:"icon-sm"}),"h-8 w-8 shrink-0 rounded-md"),children:g.jsx(PZ,{className:"h-4 w-4"})})]})]}),(l=s.body)!=null&&l.trim()?g.jsx("div",{className:"prose prose-sm mt-5 max-w-none text-foreground dark:prose-invert",children:g.jsx(Fu,{remarkPlugins:[Uu],components:Db,children:s.body})}):g.jsx("div",{className:"mt-5 text-sm text-muted-foreground",children:"No release notes were provided."})]},s.id)}):null]})}function PZ({className:e}){return g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:g.jsx("path",{d:"M12 .5C5.649.5.5 5.649.5 12A11.5 11.5 0 0 0 8.36 22.04c.575.106.785-.25.785-.556 0-.274-.01-1-.015-1.962-3.181.691-3.853-1.532-3.853-1.532-.52-1.322-1.27-1.674-1.27-1.674-1.038-.71.08-.695.08-.695 1.148.08 1.752 1.178 1.752 1.178 1.02 1.748 2.676 1.243 3.328.95.103-.738.399-1.243.725-1.53-2.54-.289-5.211-1.27-5.211-5.65 0-1.248.446-2.27 1.177-3.07-.118-.288-.51-1.45.112-3.024 0 0 .96-.307 3.145 1.173A10.91 10.91 0 0 1 12 6.03c.973.004 1.954.132 2.87.387 2.182-1.48 3.14-1.173 3.14-1.173.625 1.573.233 2.736.115 3.024.734.8 1.175 1.822 1.175 3.07 0 4.39-2.676 5.358-5.224 5.642.41.353.776 1.05.776 2.117 0 1.528-.014 2.761-.014 3.136 0 .309.207.668.79.555A11.502 11.502 0 0 0 23.5 12C23.5 5.649 18.351.5 12 .5Z"})})}function Pc({title:e,description:t,children:n,bordered:r=!0,alignStart:s=!1}){return g.jsx("div",{className:r?"border-t border-border":void 0,children:g.jsxs("div",{className:`flex justify-between gap-8 py-5 ${s?"items-start":"items-center"}`,children:[g.jsxs("div",{className:"min-w-0 max-w-xl",children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:e}),g.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:t})]}),g.jsx("div",{className:"flex shrink-0 items-center justify-end",children:n})]})})}function IZ(){var _e,He;const e=xu(),{sectionId:t}=tE(),n=dy(),{theme:r,setTheme:s}=P5(),[a,l]=x.useState("idle"),[u,d]=x.useState([]),[h,p]=x.useState(null),m=Ok(t)??"general",_=n.connectionStatus==="connecting"||!n.localProjectsReady,y=((_e=n.localProjects)==null?void 0:_e.machine.displayName)??"Unavailable",S=((He=n.localProjects)==null?void 0:He.projects.length)??0,w=XR.split("/")[1]??"unknown",C=Pr(he=>he.scrollbackLines),k=Pr(he=>he.minColumnWidth),T=Pr(he=>he.editorPreset),R=Pr(he=>he.editorCommandTemplate),M=Pr(he=>he.setScrollbackLines),L=Pr(he=>he.setMinColumnWidth),O=Pr(he=>he.setEditorPreset),z=Pr(he=>he.setEditorCommandTemplate),H=n.keybindings,G=x.useMemo(()=>G5(H),[H]),B=G.filePathDisplay||SP(),[$,I]=x.useState(String(C)),[U,V]=x.useState(String(k)),[F,j]=x.useState(R),[Y,W]=x.useState({}),[Q,A]=x.useState(null);x.useEffect(()=>{I(String(C))},[C]),x.useEffect(()=>{V(String(k))},[k]),x.useEffect(()=>{j(R)},[R]),x.useEffect(()=>{W(Object.fromEntries(Lk.map(he=>[he,fv(G.bindings[he])])))},[G]),x.useEffect(()=>{t&&(Ok(t)||e("/settings/general",{replace:!0}))},[e,t]),x.useEffect(()=>{if(m!=="changelog"||_)return;const he=zZ();if(he){d(he),p(null),l("success");return}let et=!1;return l("loading"),p(null),zk().then(gt=>{et||(jk(gt),d(gt),l("success"))}).catch(gt=>{et||(p(gt instanceof Error?gt.message:"Unable to load changelog."),l("error"))}),()=>{et=!0}},[_,m]);function P(){const he=Number($);if(!Number.isFinite(he)){I(String(C));return}M(he)}function Z(){const he=Number(U);if(!Number.isFinite(he)){V(String(k));return}L(he)}function D(he,et){he.key==="Enter"&&(et(),he.currentTarget.blur())}function K(he,et){he.key==="Enter"&&(et(),he.currentTarget.blur())}function ee(){z(F)}async function ie(){try{A(null),await n.socket.command({type:"settings.writeKeybindings",bindings:Bk(Y)})}catch(he){A(he instanceof Error?he.message:"Unable to save keybindings.")}}async function ge(he){const et={...Y,[he]:fv($s[he])};W(et);try{A(null),await n.socket.command({type:"settings.writeKeybindings",bindings:Bk(et)})}catch(gt){A(gt instanceof Error?gt.message:"Unable to save keybindings.")}}function Te(){Ja=null,l("loading"),p(null),zk().then(he=>{jk(he),d(he),l("success")}).catch(he=>{p(he instanceof Error?he.message:"Unable to load changelog."),l("error")})}const ve=F.replaceAll("{path}","/Users/jake/Projects/kanna/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),ke=Zd.find(he=>he.id===m)??Zd[0],We=m==="keybindings"?LZ(B):ke.subtitle,fe=!_;return g.jsxs("div",{className:"relative flex h-full flex-1 min-w-0 bg-background",children:[g.jsxs("div",{className:"flex min-w-0 flex-1",children:[g.jsx("aside",{className:`hidden w-[200px] shrink-0 md:block ${fe?"pb-[89px]":""}`,children:g.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[g.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:"Settings"}),Zd.map(he=>g.jsx("button",{type:"button",onClick:()=>e(`/settings/${he.id}`),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${he.id===m?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:g.jsxs("div",{className:"flex items-center gap-2.5",children:[g.jsx(he.icon,{className:"h-4 w-4 shrink-0"}),g.jsx("span",{children:he.label})]})},he.label))]})}),g.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:g.jsxs("div",{className:"w-full px-6 pt-16 pb-32",children:[_?g.jsx("div",{className:"flex min-h-[240px] items-center justify-center rounded-2xl border border-border bg-card/40 px-4 py-6 text-sm text-muted-foreground",children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(is,{className:"h-4 w-4 animate-spin"}),g.jsx("span",{children:"Loading machine settings…"})]})}):g.jsxs("div",{className:"mx-auto max-w-4xl",children:[g.jsxs("div",{className:"pb-6",children:[g.jsxs("div",{className:"flex items-center justify-between gap-4",children:[g.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:ke.label}),m==="keybindings"?g.jsxs("button",{type:"button",onClick:()=>{n.handleOpenExternalPath("open_editor",B)},className:xe(yy({variant:"outline",size:"sm"}),"gap-2 rounded-lg"),children:[g.jsx(rR,{className:"h-4 w-4"}),g.jsxs("span",{children:["Open in ",n.editorLabel]})]}):null]}),g.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:We})]}),m==="general"?g.jsx(g.Fragment,{children:g.jsxs("div",{className:"border-b border-border",children:[g.jsx(Pc,{title:"Theme",description:"Choose between light, dark, or system appearance",bordered:!1,children:g.jsx(aN,{value:r,onValueChange:s,options:AZ,size:"sm"})}),g.jsx(Pc,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:g.jsx("select",{value:T,onChange:he=>O(he.target.value),className:"min-w-[180px] rounded-lg border border-border bg-background px-3 py-2 pr-12 text-sm text-foreground outline-none",children:NZ.map(he=>g.jsx("option",{value:he.value,children:he.label},he.value))})}),T==="custom"?g.jsx("div",{className:"border-t border-border",children:g.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[g.jsxs("div",{className:"min-w-0 max-w-xl",children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:"Command Template"}),g.jsxs("div",{className:"mt-1 text-[13px] text-muted-foreground",children:["Include ","{path}"," and optionally ","{line}"," and ","{column}"," in your command."]})]}),g.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[g.jsx("input",{type:"text",value:F,onChange:he=>j(he.target.value),onBlur:ee,onKeyDown:he=>K(he,ee),className:"w-full rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none"}),g.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview: ",g.jsx("span",{className:"font-mono",children:ve})]})]})]})}):null,g.jsx(Pc,{title:"Terminal Scrollback",description:"Lines retained for embedded terminal history",children:g.jsxs("div",{className:"flex min-w-0 flex-col items-end gap-2",children:[g.jsx("input",{type:"number",min:V_,max:K_,step:100,value:$,onChange:he=>I(he.target.value),onBlur:P,onKeyDown:he=>D(he,P),className:"hide-number-steppers w-28 rounded-lg border border-border bg-background px-3 py-2 text-right font-mono text-sm text-foreground outline-none"}),g.jsxs("div",{className:"text-right text-xs text-muted-foreground",children:[V_,"-",K_," lines",C===kf?" (default)":""]})]})}),g.jsx(Pc,{title:"Terminal Min Column Width",description:"Minimum width for each terminal pane",children:g.jsxs("div",{className:"flex min-w-0 flex-col items-end gap-2",children:[g.jsx("input",{type:"number",min:G_,max:Y_,step:10,value:U,onChange:he=>V(he.target.value),onBlur:Z,onKeyDown:he=>D(he,Z),className:"hide-number-steppers w-28 rounded-lg border border-border bg-background px-3 py-2 text-right font-mono text-sm text-foreground outline-none"}),g.jsxs("div",{className:"text-right text-xs text-muted-foreground",children:[G_,"-",Y_," px",k===Ef?" (default)":""]})]})})]})}):m==="keybindings"?g.jsxs("div",{className:"border-b border-border",children:[Q?g.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:Q}):null,G.warning?g.jsx("div",{className:"mb-4 rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:G.warning}):null,Lk.map((he,et)=>{const gt=fv($s[he]),Wn=Y[he]??"",Zt=Wn!==gt;return g.jsx(Pc,{title:K5[he],description:g.jsxs(g.Fragment,{children:[g.jsx("span",{children:"Comma-separated shortcuts."}),Zt?g.jsxs(g.Fragment,{children:[g.jsx("span",{children:" "}),g.jsxs("button",{type:"button",onClick:()=>{ge(he)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",gt]})]}):null]}),bordered:et!==0,alignStart:!0,children:g.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:g.jsx("input",{type:"text",value:Wn,onChange:jt=>{const qn=jt.target.value;W(Sr=>({...Sr,[he]:qn}))},onBlur:()=>{ie()},onKeyDown:jt=>K(jt,()=>{ie()}),className:"w-full rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none"})})},he)})]}):g.jsx(BZ,{status:a,releases:u,error:h,onRetry:Te})]}),n.commandError?g.jsxs("div",{className:"mx-auto mt-4 flex max-w-4xl items-start gap-3 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[g.jsx(jj,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),g.jsx("span",{children:n.commandError})]}):null]})})]}),fe?g.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:g.jsx("div",{className:"px-6 py-[14.25px]",children:g.jsxs("div",{className:"grid gap-3 text-xs text-muted-foreground sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Machine"}),g.jsx("div",{className:"text-foreground/80",children:y})]}),g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Connection"}),g.jsx("div",{className:"text-foreground/80",children:n.connectionStatus})]}),g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Projects Indexed"}),g.jsx("div",{className:"text-foreground/80",children:S})]}),g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"App Version"}),g.jsx("div",{className:"text-foreground/80",children:w})]})]})})}):null]})}function Bk(e){return{toggleEmbeddedTerminal:Nc(e.toggleEmbeddedTerminal??""),toggleRightSidebar:Nc(e.toggleRightSidebar??""),openInFinder:Nc(e.openInFinder??""),openInEditor:Nc(e.openInEditor??""),addSplitTerminal:Nc(e.addSplitTerminal??"")}}function Nd(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function HZ(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function FZ(e,t){const n=HZ(t);switch(e.toolKind){case"ask_user_question":{const s=Nd(n),a=Nd(s==null?void 0:s.answers)??(s||{});return{answers:Object.fromEntries(Object.entries(a).map(([l,u])=>Array.isArray(u)?[l,u.map(d=>String(d))]:u&&typeof u=="object"&&Array.isArray(u.answers)?[l,u.answers.map(d=>String(d))]:u==null||u===""?[l,[]]:[l,[String(u)]])),...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const s=Nd(n);return{confirmed:typeof(s==null?void 0:s.confirmed)=="boolean"?s.confirmed:void 0,clearContext:typeof(s==null?void 0:s.clearContext)=="boolean"?s.clearContext:void 0,message:typeof(s==null?void 0:s.message)=="string"?s.message:void 0,...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"read_file":if(typeof n=="string")return n;const r=Nd(n);return{content:typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(n,null,2)};default:return n}}function lN(e){return new Date(e).toISOString()}function Qr(e){return{id:e._id,messageId:e.messageId,timestamp:lN(e.createdAt),hidden:e.hidden}}function UZ(e){return{id:e._id,messageId:e.messageId,hidden:e.hidden,kind:"tool",toolKind:e.tool.toolKind,toolName:e.tool.toolName,toolId:e.tool.toolId,input:e.tool.input,timestamp:lN(e.createdAt)}}function $Z(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function WZ(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...Qr(r),kind:"user_prompt",content:r.content});break;case"system_init":n.push({...Qr(r),kind:"system_init",provider:r.provider,model:r.model,tools:r.tools,agents:r.agents,slashCommands:r.slashCommands,mcpServers:r.mcpServers,debugRaw:r.debugRaw});break;case"account_info":n.push({...Qr(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":n.push({...Qr(r),kind:"assistant_text",text:r.text});break;case"tool_call":{const s=UZ(r);t.set(r.tool.toolId,{hydrated:s,normalized:r.tool}),n.push(s);break}case"tool_result":{const s=t.get(r.toolId);if(s){const a=s.normalized.toolKind==="ask_user_question"||s.normalized.toolKind==="exit_plan_mode"?$Z(r)??r.content:r.content;s.hydrated.result=FZ(s.normalized,a),s.hydrated.rawResult=a,s.hydrated.isError=r.isError}break}case"result":n.push({...Qr(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...Qr(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...Qr(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...Qr(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...Qr(r),kind:"context_cleared"});break;case"interrupted":n.push({...Qr(r),kind:"interrupted"});break;default:n.push({...Qr(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const qZ=["AskUserQuestion","ExitPlanMode","TodoWrite"],VZ=new Set(["TodoWrite"]);function KZ(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t&&!s.result)return s.id}return null}function GZ(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t)return s.id}return null}function YZ(e){const t={};for(const n of qZ)t[n]=VZ.has(n)?GZ(e,n):KZ(e,n);return t}function XZ(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function ZZ(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const QZ=25e3,JZ=15e3,eQ=4e3;class tQ{constructor(t){en(this,"url");en(this,"ws",null);en(this,"started",!1);en(this,"reconnectTimer",null);en(this,"reconnectDelayMs",750);en(this,"subscriptions",new Map);en(this,"pending",new Map);en(this,"outboundQueue",[]);en(this,"statusListeners",new Set);en(this,"heartbeatTimer",null);en(this,"pingTimeoutTimer",null);en(this,"pingPromise",null);en(this,"lastOpenAt",0);en(this,"lastMessageAt",0);en(this,"reconnectImmediatelyOnClose",!1);en(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});en(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});en(this,"handleOnline",()=>{this.ensureHealthyConnection()});this.url=t}start(){this.started||(this.started=!0,window.addEventListener("focus",this.handleWindowFocus),window.addEventListener("online",this.handleOnline),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.connect())}dispose(){var t;this.started=!1,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat(),this.clearPingState(),window.removeEventListener("focus",this.handleWindowFocus),window.removeEventListener("online",this.handleOnline),document.removeEventListener("visibilitychange",this.handleVisibilityChange),(t=this.ws)==null||t.close(),this.ws=null;for(const n of this.pending.values())n.reject(new Error("Socket disposed"));this.pending.clear()}onStatus(t){return this.statusListeners.add(t),t(this.getStatus()),()=>{this.statusListeners.delete(t)}}subscribe(t,n,r){const s=crypto.randomUUID();return this.subscriptions.set(s,{topic:t,listener:n,eventListener:r}),this.enqueue({v:1,type:"subscribe",id:s,topic:t}),()=>{this.subscriptions.delete(s),this.enqueue({v:1,type:"unsubscribe",id:s})}}subscribeTerminal(t,n){const r=crypto.randomUUID(),s={type:"terminal",terminalId:t};return this.subscriptions.set(r,{topic:s,listener:n.onSnapshot,eventListener:n.onEvent}),this.enqueue({v:1,type:"subscribe",id:r,topic:s}),()=>{this.subscriptions.delete(r),this.enqueue({v:1,type:"unsubscribe",id:r})}}command(t){const n=crypto.randomUUID(),r={v:1,type:"command",id:n,command:t};return new Promise((s,a)=>{this.pending.set(n,{resolve:s,reject:a}),this.enqueue(r)})}ensureHealthyConnection(){return!this.ws||this.ws.readyState===WebSocket.CLOSED||this.ws.readyState===WebSocket.CLOSING?(this.reconnectNow(),Promise.resolve()):this.ws.readyState===WebSocket.CONNECTING||!this.isConnectionStale()?Promise.resolve():this.sendPing()}connect(){this.started&&(this.emitStatus("connecting"),this.ws=new WebSocket(this.url),this.ws.addEventListener("open",()=>{this.reconnectDelayMs=750,this.reconnectImmediatelyOnClose=!1,this.lastOpenAt=Date.now(),this.lastMessageAt=this.lastOpenAt,this.emitStatus("connected"),this.startHeartbeat();for(const[t,n]of this.subscriptions.entries())this.sendNow({v:1,type:"subscribe",id:t,topic:n.topic});for(;this.outboundQueue.length>0;){const t=this.outboundQueue.shift();t&&this.sendNow(t)}}),this.ws.addEventListener("message",t=>{var r;this.lastMessageAt=Date.now();let n;try{n=JSON.parse(String(t.data))}catch{return}if(n.type==="snapshot"){const s=this.subscriptions.get(n.id);s==null||s.listener(n.snapshot.data);return}if(n.type==="event"){const s=this.subscriptions.get(n.id);(r=s==null?void 0:s.eventListener)==null||r.call(s,n.event);return}if(n.type==="ack"){const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.resolve(n.result);return}if(n.type==="error"){if(!n.id){console.error(vP,n.message);return}const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.reject(new Error(n.message))}}),this.ws.addEventListener("close",()=>{if(!this.started)return;const t=this.reconnectImmediatelyOnClose;this.reconnectImmediatelyOnClose=!1,this.stopHeartbeat(),this.clearPingState(),this.emitStatus("disconnected");for(const n of this.pending.values())n.reject(new Error("Disconnected"));if(this.pending.clear(),t){this.connect();return}this.scheduleReconnect()}))}scheduleReconnect(){this.reconnectTimer===null&&(this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect(),this.reconnectDelayMs=Math.min(this.reconnectDelayMs*2,5e3)},this.reconnectDelayMs))}getStatus(){var t,n;return((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN?"connected":((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING?"connecting":"disconnected"}emitStatus(t){for(const n of this.statusListeners)n(t)}isConnectionStale(){const t=Math.max(this.lastMessageAt,this.lastOpenAt);return t>0&&Date.now()-t>=QZ}sendPing(){if(this.pingPromise)return this.pingPromise;const t=this.command({type:"system.ping"}).then(()=>{this.clearPingState()}).catch(n=>{throw this.clearPingState(),this.reconnectNow(),n});return this.pingTimeoutTimer=window.setTimeout(()=>{this.clearPingState(),this.reconnectNow()},eQ),this.pingPromise=t,t}reconnectNow(){if(this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),!this.ws||this.ws.readyState===WebSocket.CLOSED){this.connect();return}this.ws.readyState!==WebSocket.CONNECTING&&(this.reconnectImmediatelyOnClose=!0,this.ws.close())}startHeartbeat(){document.visibilityState==="visible"&&this.heartbeatTimer===null&&(this.heartbeatTimer=window.setInterval(()=>{var t;if(document.visibilityState!=="visible"){this.stopHeartbeat();return}((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN&&this.ensureHealthyConnection()},JZ))}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}clearPingState(){this.pingTimeoutTimer!==null&&(window.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=null),this.pingPromise=null}enqueue(t){var n;if(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.sendNow(t);return}this.outboundQueue.push(t)}sendNow(t){var n;(n=this.ws)==null||n.send(JSON.stringify(t))}}function nQ(e,t){var r;const n=e.find(s=>s.chats.some(a=>a.chatId===t));return n?((r=n.chats.find(s=>s.chatId!==t))==null?void 0:r.chatId)??null:null}function rQ(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function iQ(){const e=x.useRef(null);return e.current||(e.current=new tQ(rQ())),x.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function sQ(e){return e<120}const oQ=320;function aQ(e){var Ze,xt,On;const t=xu(),n=iQ(),r=A6(),[s,a]=x.useState({projectGroups:[]}),[l,u]=x.useState(null),[d,h]=x.useState(null),[p,m]=x.useState(null),[_,y]=x.useState("connecting"),[S,w]=x.useState(!1),[C,k]=x.useState(!1),[T,R]=x.useState(!1),[M,L]=x.useState(null),[O,z]=x.useState(!1),[H,G]=x.useState(!1),[B,$]=x.useState(148),[I,U]=x.useState(!0),[V,F]=x.useState(null),[j,Y]=x.useState(null),[W,Q]=x.useState(null),A=nW(Pr(de=>de.editorPreset)),P=x.useRef(null),Z=x.useRef(null);x.useEffect(()=>n.onStatus(y),[n]),x.useEffect(()=>n.subscribe({type:"sidebar"},de=>{a(de),w(!0),F(null)}),[n]),x.useEffect(()=>n.subscribe({type:"local-projects"},de=>{u(de),k(!0),F(null)}),[n]),x.useEffect(()=>n.subscribe({type:"keybindings"},de=>{m(de),F(null)}),[n]),x.useEffect(()=>{if(!e){h(null),R(!0);return}return R(!1),n.subscribe({type:"chat",chatId:e},de=>{h(de),R(!0),F(null)})},[e,n]),x.useEffect(()=>{if(M)return;const de=s.projectGroups[0];de&&L(de.groupKey)},[M,s.projectGroups]),x.useEffect(()=>{if(!e||!S||!T)return;if(s.projectGroups.some(ye=>ye.chats.some(Oe=>Oe.chatId===e))){W===e&&Q(null);return}W!==e&&t("/")},[e,T,t,W,s.projectGroups,S]),x.useEffect(()=>{d&&(L(d.runtime.projectId),W===d.runtime.chatId&&Q(null))},[d,W]),x.useLayoutEffect(()=>{const de=Z.current;if(!de)return;const ye=new ResizeObserver(()=>{$(de.getBoundingClientRect().height)});return ye.observe(de),$(de.getBoundingClientRect().height),()=>ye.disconnect()},[]);const D=x.useMemo(()=>WZ((d==null?void 0:d.messages)??[]),[d==null?void 0:d.messages]),K=x.useMemo(()=>YZ(D),[D]),ee=(d==null?void 0:d.runtime)??null,ie=(d==null?void 0:d.availableProviders)??t7,ge=ZZ(ee==null?void 0:ee.status),Te=XZ(ee==null?void 0:ee.status),ve=oQ,ke=!I&&D.length>0,We=((Ze=l==null?void 0:l.projects[0])==null?void 0:Ze.localPath)??null,fe=(ee==null?void 0:ee.localPath)??We??((xt=s.projectGroups[0])==null?void 0:xt.localPath),_e=!!(M??(ee==null?void 0:ee.projectId)??((On=s.projectGroups[0])==null?void 0:On.groupKey)??We);x.useEffect(()=>{const de=P.current;if(!de)return;const ye=de.scrollHeight-de.scrollTop-de.clientHeight;sQ(ye)&&de.scrollTo({top:de.scrollHeight,behavior:"smooth"})},[e,B,D.length,ee==null?void 0:ee.status]);function He(){const de=P.current;if(!de)return;const ye=de.scrollHeight-de.scrollTop-de.clientHeight;U(ye<24)}function he(){const de=P.current;de&&de.scrollTo({top:de.scrollHeight,behavior:"smooth"})}async function et(de){try{const ye=await n.command({type:"chat.create",projectId:de});L(de),Q(ye.chatId),t(`/chat/${ye.chatId}`),z(!1)}catch(ye){F(ye instanceof Error?ye.message:String(ye))}}async function gt(de){try{Y(de);const ye=await n.command({type:"project.open",localPath:de});L(ye.projectId);const Oe=await n.command({type:"chat.create",projectId:ye.projectId});Q(Oe.chatId),t(`/chat/${Oe.chatId}`),z(!1),F(null)}catch(ye){F(ye instanceof Error?ye.message:String(ye))}finally{Y(null)}}async function Wn(de){try{Y(de.localPath);const ye=await n.command(de.mode==="new"?{type:"project.create",localPath:de.localPath,title:de.title}:{type:"project.open",localPath:de.localPath});L(ye.projectId);const Oe=await n.command({type:"chat.create",projectId:ye.projectId});Q(Oe.chatId),t(`/chat/${Oe.chatId}`),z(!1),F(null)}catch(ye){F(ye instanceof Error?ye.message:String(ye))}finally{Y(null)}}async function Zt(de,ye){var Oe;try{let Ne=M??((Oe=s.projectGroups[0])==null?void 0:Oe.groupKey)??null;if(!e&&!Ne&&We&&(Ne=(await n.command({type:"project.open",localPath:We})).projectId,L(Ne)),!e&&!Ne)throw new Error("Open a project first");const ut=await n.command({type:"chat.send",chatId:e??void 0,projectId:e?void 0:Ne??void 0,provider:ye==null?void 0:ye.provider,content:de,model:ye==null?void 0:ye.model,modelOptions:ye==null?void 0:ye.modelOptions,planMode:ye==null?void 0:ye.planMode});!e&&ut.chatId&&(Q(ut.chatId),t(`/chat/${ut.chatId}`)),F(null)}catch(Ne){throw F(Ne instanceof Error?Ne.message:String(Ne)),Ne}}async function jt(){if(e)try{await n.command({type:"chat.cancel",chatId:e})}catch(de){F(de instanceof Error?de.message:String(de))}}async function qn(de){if(await r.confirm({title:"Delete Chat",description:`Delete "${de.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await n.command({type:"chat.delete",chatId:de.chatId}),de.chatId===e){const Oe=nQ(s.projectGroups,de.chatId);t(Oe?`/chat/${Oe}`:"/")}}catch(Oe){F(Oe instanceof Error?Oe.message:String(Oe))}}async function Sr(de){const ye=s.projectGroups.find(ut=>ut.groupKey===de);if(!ye)return;const Oe=ye.localPath.split("/").filter(Boolean).pop()??ye.localPath;if(await r.confirm({title:"Remove",description:`Remove "${Oe}" from the sidebar? Existing chats will be removed from ${Pn}.`,confirmLabel:"Remove",confirmVariant:"destructive"}))try{await n.command({type:"project.remove",projectId:de}),Oo.getState().clearProject(de),Yd.getState().clearProject(de),(ee==null?void 0:ee.projectId)===de&&t("/"),F(null)}catch(ut){F(ut instanceof Error?ut.message:String(ut))}}async function cs(de){var Oe,Ne;const ye=(ee==null?void 0:ee.localPath)??((Oe=l==null?void 0:l.projects[0])==null?void 0:Oe.localPath)??((Ne=s.projectGroups[0])==null?void 0:Ne.localPath);if(ye)try{await oe({action:de,localPath:ye})}catch(ut){F(ut instanceof Error?ut.message:String(ut))}}async function $t(de){try{await oe({action:"open_editor",localPath:de.path,line:de.line,column:de.column})}catch(ye){F(ye instanceof Error?ye.message:String(ye))}}async function io(de,ye){try{await oe({action:de,localPath:ye})}catch(Oe){F(Oe instanceof Error?Oe.message:String(Oe))}}async function oe(de){const ye=Pr.getState();F(null),await n.command({type:"system.openExternal",...de,editor:de.action==="open_editor"?{preset:ye.editorPreset,commandTemplate:ye.editorCommandTemplate}:void 0})}function pe(){var Oe,Ne;const de=M??((Oe=s.projectGroups[0])==null?void 0:Oe.groupKey);if(de){et(de);return}const ye=(Ne=l==null?void 0:l.projects[0])==null?void 0:Ne.localPath;if(ye){gt(ye);return}t("/")}async function Ae(de,ye,Oe){if(e)try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:de,result:{questions:ye,answers:Oe}})}catch(Ne){F(Ne instanceof Error?Ne.message:String(Ne))}}async function Pe(de,ye,Oe,Ne){if(e){ye&&xM.getState().setPlanMode(!1);try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:de,result:{confirmed:ye,...Oe?{clearContext:!0}:{},...Ne?{message:Ne}:{}}})}catch(ut){F(ut instanceof Error?ut.message:String(ut))}}}return{socket:n,activeChatId:e,sidebarData:s,localProjects:l,chatSnapshot:d,keybindings:p,connectionStatus:_,sidebarReady:S,localProjectsReady:C,commandError:V,startingLocalPath:j,sidebarOpen:O,sidebarCollapsed:H,scrollRef:P,inputRef:Z,messages:D,latestToolIds:K,runtime:ee,availableProviders:ie,isProcessing:ge,canCancel:Te,transcriptPaddingBottom:ve,showScrollButton:ke,navbarLocalPath:fe,editorLabel:A,hasSelectedProject:_e,openSidebar:()=>z(!0),closeSidebar:()=>z(!1),collapseSidebar:()=>G(!0),expandSidebar:()=>G(!1),updateScrollState:He,scrollToBottom:he,handleCreateChat:et,handleOpenLocalProject:gt,handleCreateProject:Wn,handleSend:Zt,handleCancel:jt,handleDeleteChat:qn,handleRemoveProject:Sr,handleOpenExternal:cs,handleOpenExternalPath:io,handleOpenLocalLink:$t,handleCompose:pe,handleAskUserQuestion:Ae,handleExitPlanMode:Pe}}function lQ(){const e=si(),t=tE(),n=aQ(t.chatId??null),r=e.pathname==="/"||e.pathname.startsWith("/settings");return g.jsxs("div",{className:"flex h-[100dvh] min-h-[100dvh] overflow-hidden",children:[g.jsx(e7,{data:n.sidebarData,activeChatId:n.activeChatId,connectionStatus:n.connectionStatus,ready:n.sidebarReady,open:n.sidebarOpen,collapsed:n.sidebarCollapsed,showMobileOpenButton:r,onOpen:n.openSidebar,onClose:n.closeSidebar,onCollapse:n.collapseSidebar,onExpand:n.expandSidebar,onCreateChat:s=>{n.handleCreateChat(s)},onDeleteChat:s=>{n.handleDeleteChat(s)},onRemoveProject:s=>{n.handleRemoveProject(s)}}),g.jsx(A4,{context:n})]})}function cQ(){return g.jsx(hP,{children:g.jsx(M6,{children:g.jsx(D4,{children:g.jsxs(Ka,{element:g.jsx(lQ,{}),children:[g.jsx(Ka,{path:"/",element:g.jsx(MZ,{})}),g.jsx(Ka,{path:"/settings",element:g.jsx(M4,{to:"/settings/general",replace:!0})}),g.jsx(Ka,{path:"/settings/:sectionId",element:g.jsx(IZ,{})}),g.jsx(Ka,{path:"/chat/:chatId",element:g.jsx(SZ,{})})]})})})})}const cN=document.getElementById("root");if(!cN)throw new Error("Missing #root");D3.createRoot(cN).render(g.jsx(x.StrictMode,{children:g.jsx(nO,{children:g.jsx(O$,{children:g.jsx(cQ,{})})})}));
|