kaizenai 0.2.1 → 0.3.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-BBs80KD-.js +623 -0
- package/dist/client/assets/index-CkCgyLNq.css +32 -0
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/src/server/agent.ts +58 -19
- package/src/server/cli-runtime.ts +210 -168
- package/src/server/cli-supervisor.ts +58 -42
- package/src/server/event-store.ts +119 -18
- package/src/server/events.ts +8 -0
- package/src/server/restart.ts +44 -18
- package/src/server/ws-router.ts +35 -10
- package/src/shared/protocol.ts +5 -1
- package/src/shared/types.ts +12 -0
- package/dist/client/assets/index-BI5hJ6Xa.js +0 -598
- package/dist/client/assets/index-BJ10I6WX.css +0 -32
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
var w4=Object.defineProperty;var HC=e=>{throw TypeError(e)};var S4=(e,t,n)=>t in e?w4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fn=(e,t,n)=>S4(e,typeof t!="symbol"?t+"":t,n),UC=(e,t,n)=>t.has(e)||HC("Cannot "+n);var Mu=(e,t,n)=>(UC(e,t,"read from private field"),n?n.call(e):t.get(e)),$C=(e,t,n)=>t.has(e)?HC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),WC=(e,t,n,r)=>(UC(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function C4(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 o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{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 o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nb={exports:{}},Au={};/**
|
|
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 VC;function k4(){if(VC)return Au;VC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,o){var l=null;if(o!==void 0&&(l=""+o),s.key!==void 0&&(l=""+s.key),"key"in s){o={};for(var u in s)u!=="key"&&(o[u]=s[u])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:o}}return Au.Fragment=t,Au.jsx=n,Au.jsxs=n,Au}var qC;function E4(){return qC||(qC=1,nb.exports=k4()),nb.exports}var f=E4(),rb={exports:{}},st={};/**
|
|
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 KC;function R4(){if(KC)return st;KC=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"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),v=Symbol.iterator;function y(P){return P===null||typeof P!="object"?null:(P=v&&P[v]||P["@@iterator"],typeof P=="function"?P:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(P,X,N){this.props=P,this.context=X,this.refs=C,this.updater=N||w}k.prototype.isReactComponent={},k.prototype.setState=function(P,X){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,X,"setState")},k.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function R(){}R.prototype=k.prototype;function E(P,X,N){this.props=P,this.context=X,this.refs=C,this.updater=N||w}var M=E.prototype=new R;M.constructor=E,S(M,k.prototype),M.isPureReactComponent=!0;var L=Array.isArray;function j(){}var D={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function G(P,X,N){var ne=N.ref;return{$$typeof:e,type:P,key:X,ref:ne!==void 0?ne:null,props:N}}function I(P,X){return G(P.type,X,P.props)}function q(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function B(P){var X={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(N){return X[N]})}var W=/\/+/g;function F(P,X){return typeof P=="object"&&P!==null&&P.key!=null?B(""+P.key):X.toString(36)}function V(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(j,j):(P.status="pending",P.then(function(X){P.status==="pending"&&(P.status="fulfilled",P.value=X)},function(X){P.status==="pending"&&(P.status="rejected",P.reason=X)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function O(P,X,N,ne,oe){var J=typeof P;(J==="undefined"||J==="boolean")&&(P=null);var te=!1;if(P===null)te=!0;else switch(J){case"bigint":case"string":case"number":te=!0;break;case"object":switch(P.$$typeof){case e:case t:te=!0;break;case g:return te=P._init,O(te(P._payload),X,N,ne,oe)}}if(te)return oe=oe(P),te=ne===""?"."+F(P,0):ne,L(oe)?(N="",te!=null&&(N=te.replace(W,"$&/")+"/"),O(oe,X,N,"",function(ge){return ge})):oe!=null&&(q(oe)&&(oe=I(oe,N+(oe.key==null||P&&P.key===oe.key?"":(""+oe.key).replace(W,"$&/")+"/")+te)),X.push(oe)),1;te=0;var ue=ne===""?".":ne+":";if(L(P))for(var he=0;he<P.length;he++)ne=P[he],J=ue+F(ne,he),te+=O(ne,X,N,J,oe);else if(he=y(P),typeof he=="function")for(P=he.call(P),he=0;!(ne=P.next()).done;)ne=ne.value,J=ue+F(ne,he++),te+=O(ne,X,N,J,oe);else if(J==="object"){if(typeof P.then=="function")return O(V(P),X,N,ne,oe);throw X=String(P),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return te}function $(P,X,N){if(P==null)return P;var ne=[],oe=0;return O(P,ne,"","",function(J){return X.call(N,J,oe++)}),ne}function U(P){if(P._status===-1){var X=P._result;X=X(),X.then(function(N){(P._status===0||P._status===-1)&&(P._status=1,P._result=N)},function(N){(P._status===0||P._status===-1)&&(P._status=2,P._result=N)}),P._status===-1&&(P._status=0,P._result=X)}if(P._status===1)return P._result.default;throw P._result}var Y=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=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(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},A={map:$,forEach:function(P,X,N){$(P,function(){X.apply(this,arguments)},N)},count:function(P){var X=0;return $(P,function(){X++}),X},toArray:function(P){return $(P,function(X){return X})||[]},only:function(P){if(!q(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return st.Activity=p,st.Children=A,st.Component=k,st.Fragment=n,st.Profiler=s,st.PureComponent=E,st.StrictMode=r,st.Suspense=h,st.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,st.__COMPILER_RUNTIME={__proto__:null,c:function(P){return D.H.useMemoCache(P)}},st.cache=function(P){return function(){return P.apply(null,arguments)}},st.cacheSignal=function(){return null},st.cloneElement=function(P,X,N){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var ne=S({},P.props),oe=P.key;if(X!=null)for(J in X.key!==void 0&&(oe=""+X.key),X)!H.call(X,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&X.ref===void 0||(ne[J]=X[J]);var J=arguments.length-2;if(J===1)ne.children=N;else if(1<J){for(var te=Array(J),ue=0;ue<J;ue++)te[ue]=arguments[ue+2];ne.children=te}return G(P.type,oe,ne)},st.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},st.createElement=function(P,X,N){var ne,oe={},J=null;if(X!=null)for(ne in X.key!==void 0&&(J=""+X.key),X)H.call(X,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(oe[ne]=X[ne]);var te=arguments.length-2;if(te===1)oe.children=N;else if(1<te){for(var ue=Array(te),he=0;he<te;he++)ue[he]=arguments[he+2];oe.children=ue}if(P&&P.defaultProps)for(ne in te=P.defaultProps,te)oe[ne]===void 0&&(oe[ne]=te[ne]);return G(P,J,oe)},st.createRef=function(){return{current:null}},st.forwardRef=function(P){return{$$typeof:u,render:P}},st.isValidElement=q,st.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:U}},st.memo=function(P,X){return{$$typeof:d,type:P,compare:X===void 0?null:X}},st.startTransition=function(P){var X=D.T,N={};D.T=N;try{var ne=P(),oe=D.S;oe!==null&&oe(N,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(j,Y)}catch(J){Y(J)}finally{X!==null&&N.types!==null&&(X.types=N.types),D.T=X}},st.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},st.use=function(P){return D.H.use(P)},st.useActionState=function(P,X,N){return D.H.useActionState(P,X,N)},st.useCallback=function(P,X){return D.H.useCallback(P,X)},st.useContext=function(P){return D.H.useContext(P)},st.useDebugValue=function(){},st.useDeferredValue=function(P,X){return D.H.useDeferredValue(P,X)},st.useEffect=function(P,X){return D.H.useEffect(P,X)},st.useEffectEvent=function(P){return D.H.useEffectEvent(P)},st.useId=function(){return D.H.useId()},st.useImperativeHandle=function(P,X,N){return D.H.useImperativeHandle(P,X,N)},st.useInsertionEffect=function(P,X){return D.H.useInsertionEffect(P,X)},st.useLayoutEffect=function(P,X){return D.H.useLayoutEffect(P,X)},st.useMemo=function(P,X){return D.H.useMemo(P,X)},st.useOptimistic=function(P,X){return D.H.useOptimistic(P,X)},st.useReducer=function(P,X,N){return D.H.useReducer(P,X,N)},st.useRef=function(P){return D.H.useRef(P)},st.useState=function(P){return D.H.useState(P)},st.useSyncExternalStore=function(P,X,N){return D.H.useSyncExternalStore(P,X,N)},st.useTransition=function(){return D.H.useTransition()},st.version="19.2.1",st}var GC;function hx(){return GC||(GC=1,rb.exports=R4()),rb.exports}var b=hx();const xe=np(b),aT=C4({__proto__:null,default:xe},[b]);var ib={exports:{}},Du={},sb={exports:{}},ob={};/**
|
|
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 YC;function T4(){return YC||(YC=1,function(e){function t(O,$){var U=O.length;O.push($);e:for(;0<U;){var Y=U-1>>>1,A=O[Y];if(0<s(A,$))O[Y]=$,O[U]=A,U=Y;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var $=O[0],U=O.pop();if(U!==$){O[0]=U;e:for(var Y=0,A=O.length,P=A>>>1;Y<P;){var X=2*(Y+1)-1,N=O[X],ne=X+1,oe=O[ne];if(0>s(N,U))ne<A&&0>s(oe,N)?(O[Y]=oe,O[ne]=U,Y=ne):(O[Y]=N,O[X]=U,Y=X);else if(ne<A&&0>s(oe,U))O[Y]=oe,O[ne]=U,Y=ne;else break e}}return $}function s(O,$){var U=O.sortIndex-$.sortIndex;return U!==0?U:O.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var h=[],d=[],g=1,p=null,v=3,y=!1,w=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function M(O){for(var $=n(d);$!==null;){if($.callback===null)r(d);else if($.startTime<=O)r(d),$.sortIndex=$.expirationTime,t(h,$);else break;$=n(d)}}function L(O){if(S=!1,M(O),!w)if(n(h)!==null)w=!0,j||(j=!0,B());else{var $=n(d);$!==null&&V(L,$.startTime-O)}}var j=!1,D=-1,H=5,G=-1;function I(){return C?!0:!(e.unstable_now()-G<H)}function q(){if(C=!1,j){var O=e.unstable_now();G=O;var $=!0;try{e:{w=!1,S&&(S=!1,R(D),D=-1),y=!0;var U=v;try{t:{for(M(O),p=n(h);p!==null&&!(p.expirationTime>O&&I());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,v=p.priorityLevel;var A=Y(p.expirationTime<=O);if(O=e.unstable_now(),typeof A=="function"){p.callback=A,M(O),$=!0;break t}p===n(h)&&r(h),M(O)}else r(h);p=n(h)}if(p!==null)$=!0;else{var P=n(d);P!==null&&V(L,P.startTime-O),$=!1}}break e}finally{p=null,v=U,y=!1}$=void 0}}finally{$?B():j=!1}}}var B;if(typeof E=="function")B=function(){E(q)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,F=W.port2;W.port1.onmessage=q,B=function(){F.postMessage(null)}}else B=function(){k(q,0)};function V(O,$){D=k(function(){O(e.unstable_now())},$)}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(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(O){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var U=v;v=$;try{return O()}finally{v=U}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,$){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var U=v;v=O;try{return $()}finally{v=U}},e.unstable_scheduleCallback=function(O,$,U){var Y=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?Y+U:Y):U=Y,O){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=U+A,O={id:g++,callback:$,priorityLevel:O,startTime:U,expirationTime:A,sortIndex:-1},U>Y?(O.sortIndex=U,t(d,O),n(h)===null&&O===n(d)&&(S?(R(D),D=-1):S=!0,V(L,U-Y))):(O.sortIndex=A,t(h,O),w||y||(w=!0,j||(j=!0,B()))),O},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(O){var $=v;return function(){var U=v;v=$;try{return O.apply(this,arguments)}finally{v=U}}}}(ob)),ob}var XC;function N4(){return XC||(XC=1,sb.exports=T4()),sb.exports}var ab={exports:{}},gr={};/**
|
|
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 ZC;function M4(){if(ZC)return gr;ZC=1;var e=hx();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(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 o(h,d,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:h,containerInfo:d,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return gr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,gr.createPortal=function(h,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(h,d,null,g)},gr.flushSync=function(h){var d=l.T,g=r.p;try{if(l.T=null,r.p=2,h)return h()}finally{l.T=d,r.p=g,r.d.f()}},gr.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(h,d))},gr.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},gr.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,p=u(g,d.crossOrigin),v=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:v,fetchPriority:y}):g==="script"&&r.d.X(h,{crossOrigin:p,integrity:v,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},gr.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=u(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(h)},gr.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,p=u(g,d.crossOrigin);r.d.L(h,g,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},gr.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=u(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},gr.requestFormReset=function(h){r.d.r(h)},gr.unstable_batchedUpdates=function(h,d){return h(d)},gr.useFormState=function(h,d,g){return l.H.useFormState(h,d,g)},gr.useFormStatus=function(){return l.H.useHostTransitionStatus()},gr.version="19.2.1",gr}var QC;function lT(){if(QC)return ab.exports;QC=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(),ab.exports=M4(),ab.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 JC;function A4(){if(JC)return Du;JC=1;var e=N4(),t=hx(),n=lT();function r(i){var a="https://react.dev/errors/"+i;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+a+" 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 o(i){var a=i,c=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(c=a.return),i=a.return;while(i)}return a.tag===3?c:null}function l(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function u(i){if(i.tag===31){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function h(i){if(o(i)!==i)throw Error(r(188))}function d(i){var a=i.alternate;if(!a){if(a=o(i),a===null)throw Error(r(188));return a!==i?null:i}for(var c=i,m=a;;){var _=c.return;if(_===null)break;var x=_.alternate;if(x===null){if(m=_.return,m!==null){c=m;continue}break}if(_.child===x.child){for(x=_.child;x;){if(x===c)return h(_),i;if(x===m)return h(_),a;x=x.sibling}throw Error(r(188))}if(c.return!==m.return)c=_,m=x;else{for(var T=!1,z=_.child;z;){if(z===c){T=!0,c=_,m=x;break}if(z===m){T=!0,m=_,c=x;break}z=z.sibling}if(!T){for(z=x.child;z;){if(z===c){T=!0,c=x,m=_;break}if(z===m){T=!0,m=x,c=_;break}z=z.sibling}if(!T)throw Error(r(189))}}if(c.alternate!==m)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:a}function g(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i;for(i=i.child;i!==null;){if(a=g(i),a!==null)return a;i=i.sibling}return null}var p=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),E=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function B(i){return i===null||typeof i!="object"?null:(i=q&&i[q]||i["@@iterator"],typeof i=="function"?i:null)}var W=Symbol.for("react.client.reference");function F(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===W?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case j:return"SuspenseList";case G:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case E:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case M:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case D:return a=i.displayName||null,a!==null?a:F(i.type)||"Memo";case H:a=i._payload,i=i._init;try{return F(i(a))}catch{}}return null}var V=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},Y=[],A=-1;function P(i){return{current:i}}function X(i){0>A||(i.current=Y[A],Y[A]=null,A--)}function N(i,a){A++,Y[A]=i.current,i.current=a}var ne=P(null),oe=P(null),J=P(null),te=P(null);function ue(i,a){switch(N(J,a),N(oe,i),N(ne,null),a.nodeType){case 9:case 11:i=(i=a.documentElement)&&(i=i.namespaceURI)?uC(i):0;break;default:if(i=a.tagName,a=a.namespaceURI)a=uC(a),i=dC(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}X(ne),N(ne,i)}function he(){X(ne),X(oe),X(J)}function ge(i){i.memoizedState!==null&&N(te,i);var a=ne.current,c=dC(a,i.type);a!==c&&(N(oe,i),N(ne,c))}function ke(i){oe.current===i&&(X(ne),X(oe)),te.current===i&&(X(te),Eu._currentValue=U)}var Ee,De;function Xe(i){if(Ee===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);Ee=a&&a[1]||"",De=-1<c.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Ee+i+De}var pt=!1;function at(i,a){if(!i||pt)return"";pt=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(a){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(de){var ce=de}Reflect.construct(i,[],_e)}else{try{_e.call()}catch(de){ce=de}i.call(_e.prototype)}}else{try{throw Error()}catch(de){ce=de}(_e=i())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(de){if(de&&ce&&typeof de.stack=="string")return[de.stack,ce.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=m.DetermineComponentFrameRoot(),T=x[0],z=x[1];if(T&&z){var Z=T.split(`
|
|
44
|
+
`),le=z.split(`
|
|
45
|
+
`);for(_=m=0;m<Z.length&&!Z[m].includes("DetermineComponentFrameRoot");)m++;for(;_<le.length&&!le[_].includes("DetermineComponentFrameRoot");)_++;if(m===Z.length||_===le.length)for(m=Z.length-1,_=le.length-1;1<=m&&0<=_&&Z[m]!==le[_];)_--;for(;1<=m&&0<=_;m--,_--)if(Z[m]!==le[_]){if(m!==1||_!==1)do if(m--,_--,0>_||Z[m]!==le[_]){var ve=`
|
|
46
|
+
`+Z[m].replace(" at new "," at ");return i.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",i.displayName)),ve}while(1<=m&&0<=_);break}}}finally{pt=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Xe(c):""}function fe(i,a){switch(i.tag){case 26:case 27:case 5:return Xe(i.type);case 16:return Xe("Lazy");case 13:return i.child!==a&&a!==null?Xe("Suspense Fallback"):Xe("Suspense");case 19:return Xe("SuspenseList");case 0:case 15:return at(i.type,!1);case 11:return at(i.type.render,!1);case 1:return at(i.type,!0);case 31:return Xe("Activity");default:return""}}function Ve(i){try{var a="",c=null;do a+=fe(i,c),c=i,i=i.return;while(i);return a}catch(m){return`
|
|
47
|
+
Error generating stack: `+m.message+`
|
|
48
|
+
`+m.stack}}var Ae=Object.prototype.hasOwnProperty,et=e.unstable_scheduleCallback,lt=e.unstable_cancelCallback,nt=e.unstable_shouldYield,Kt=e.unstable_requestPaint,Se=e.unstable_now,qe=e.unstable_getCurrentPriorityLevel,se=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,He=e.unstable_LowPriority,Oe=e.unstable_IdlePriority,xt=e.log,Bt=e.unstable_setDisableYieldValue,Le=null,Ke=null;function ft(i){if(typeof xt=="function"&&Bt(i),Ke&&typeof Ke.setStrictMode=="function")try{Ke.setStrictMode(Le,i)}catch{}}var we=Math.clz32?Math.clz32:_n,Rt=Math.log,Gt=Math.LN2;function _n(i){return i>>>=0,i===0?32:31-(Rt(i)/Gt|0)|0}var Kn=256,Sr=262144,Lt=4194304;function It(i){var a=i&42;if(a!==0)return a;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 Pe(i,a,c){var m=i.pendingLanes;if(m===0)return 0;var _=0,x=i.suspendedLanes,T=i.pingedLanes;i=i.warmLanes;var z=m&134217727;return z!==0?(m=z&~x,m!==0?_=It(m):(T&=z,T!==0?_=It(T):c||(c=z&~i,c!==0&&(_=It(c))))):(z=m&~x,z!==0?_=It(z):T!==0?_=It(T):c||(c=m&~i,c!==0&&(_=It(c)))),_===0?0:a!==0&&a!==_&&(a&x)===0&&(x=_&-_,c=a&-a,x>=c||x===32&&(c&4194048)!==0)?a:_}function ot(i,a){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&a)===0}function wt(i,a){switch(i){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 gt(){var i=Lt;return Lt<<=1,(Lt&62914560)===0&&(Lt=4194304),i}function At(i){for(var a=[],c=0;31>c;c++)a.push(i);return a}function ut(i,a){i.pendingLanes|=a,a!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function mt(i,a,c,m,_,x){var T=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 z=i.entanglements,Z=i.expirationTimes,le=i.hiddenUpdates;for(c=T&~c;0<c;){var ve=31-we(c),_e=1<<ve;z[ve]=0,Z[ve]=-1;var ce=le[ve];if(ce!==null)for(le[ve]=null,ve=0;ve<ce.length;ve++){var de=ce[ve];de!==null&&(de.lane&=-536870913)}c&=~_e}m!==0&&yn(i,m,0),x!==0&&_===0&&i.tag!==0&&(i.suspendedLanes|=x&~(T&~a))}function yn(i,a,c){i.pendingLanes|=a,i.suspendedLanes&=~a;var m=31-we(a);i.entangledLanes|=a,i.entanglements[m]=i.entanglements[m]|1073741824|c&261930}function Te(i,a){var c=i.entangledLanes|=a;for(i=i.entanglements;c;){var m=31-we(c),_=1<<m;_&a|i[m]&a&&(i[m]|=a),c&=~_}}function je(i,a){var c=a&-a;return c=(c&42)!==0?1:Tt(c),(c&(i.suspendedLanes|a))!==0?0:c}function Tt(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 it(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Yt(){var i=$.p;return i!==0?i:(i=window.event,i===void 0?32:OC(i.type))}function an(i,a){var c=$.p;try{return $.p=i,a()}finally{$.p=c}}var $t=Math.random().toString(36).slice(2),K="__reactFiber$"+$t,Ie="__reactProps$"+$t,mn="__reactContainer$"+$t,ui="__reactEvents$"+$t,ua="__reactListeners$"+$t,Xt="__reactHandles$"+$t,Gn="__reactResources$"+$t,Ss="__reactMarker$"+$t;function Hc(i){delete i[K],delete i[Ie],delete i[ui],delete i[ua],delete i[Xt]}function fo(i){var a=i[K];if(a)return a;for(var c=i.parentNode;c;){if(a=c[mn]||c[K]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(i=bC(i);i!==null;){if(c=i[K])return c;i=bC(i)}return a}i=c,c=i.parentNode}return null}function mo(i){if(i=i[K]||i[mn]){var a=i.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return i}return null}function da(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i.stateNode;throw Error(r(33))}function po(i){var a=i[Gn];return a||(a=i[Gn]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Mn(i){i[Ss]=!0}var ah=new Set,lh={};function Cs(i,a){go(i,a),go(i+"Capture",a)}function go(i,a){for(lh[i]=a,i=0;i<a.length;i++)ah.add(a[i])}var Xp=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]*$"),ch={},dl={};function Zp(i){return Ae.call(dl,i)?!0:Ae.call(ch,i)?!1:Xp.test(i)?dl[i]=!0:(ch[i]=!0,!1)}function hl(i,a,c){if(Zp(a))if(c===null)i.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(a);return;case"boolean":var m=a.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){i.removeAttribute(a);return}}i.setAttribute(a,""+c)}}function fl(i,a,c){if(c===null)i.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttribute(a,""+c)}}function di(i,a,c,m){if(m===null)i.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(a,c,""+m)}}function Cr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Uc(i){var a=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Q(i,a,c){var m=Object.getOwnPropertyDescriptor(i.constructor.prototype,a);if(!i.hasOwnProperty(a)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var _=m.get,x=m.set;return Object.defineProperty(i,a,{configurable:!0,get:function(){return _.call(this)},set:function(T){c=""+T,x.call(this,T)}}),Object.defineProperty(i,a,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(T){c=""+T},stopTracking:function(){i._valueTracker=null,delete i[a]}}}}function ie(i){if(!i._valueTracker){var a=Uc(i)?"checked":"value";i._valueTracker=Q(i,a,""+i[a])}}function Ce(i){if(!i)return!1;var a=i._valueTracker;if(!a)return!0;var c=a.getValue(),m="";return i&&(m=Uc(i)?i.checked?"true":"false":i.value),i=m,i!==c?(a.setValue(i),!0):!1}function Ue(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 Wt=/[\n"\\]/g;function jt(i){return i.replace(Wt,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Yn(i,a,c,m,_,x,T,z){i.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?i.type=T:i.removeAttribute("type"),a!=null?T==="number"?(a===0&&i.value===""||i.value!=a)&&(i.value=""+Cr(a)):i.value!==""+Cr(a)&&(i.value=""+Cr(a)):T!=="submit"&&T!=="reset"||i.removeAttribute("value"),a!=null?ml(i,T,Cr(a)):c!=null?ml(i,T,Cr(c)):m!=null&&i.removeAttribute("value"),_==null&&x!=null&&(i.defaultChecked=!!x),_!=null&&(i.checked=_&&typeof _!="function"&&typeof _!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?i.name=""+Cr(z):i.removeAttribute("name")}function Zi(i,a,c,m,_,x,T,z){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),a!=null||c!=null){if(!(x!=="submit"&&x!=="reset"||a!=null)){ie(i);return}c=c!=null?""+Cr(c):"",a=a!=null?""+Cr(a):c,z||a===i.value||(i.value=a),i.defaultValue=a}m=m??_,m=typeof m!="function"&&typeof m!="symbol"&&!!m,i.checked=z?i.checked:!!m,i.defaultChecked=!!m,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(i.name=T),ie(i)}function ml(i,a,c){a==="number"&&Ue(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function ks(i,a,c,m){if(i=i.options,a){a={};for(var _=0;_<c.length;_++)a["$"+c[_]]=!0;for(c=0;c<i.length;c++)_=a.hasOwnProperty("$"+i[c].value),i[c].selected!==_&&(i[c].selected=_),_&&m&&(i[c].defaultSelected=!0)}else{for(c=""+Cr(c),a=null,_=0;_<i.length;_++){if(i[_].value===c){i[_].selected=!0,m&&(i[_].defaultSelected=!0);return}a!==null||i[_].disabled||(a=i[_])}a!==null&&(a.selected=!0)}}function s1(i,a,c){if(a!=null&&(a=""+Cr(a),a!==i.value&&(i.value=a),c==null)){i.defaultValue!==a&&(i.defaultValue=a);return}i.defaultValue=c!=null?""+Cr(c):""}function o1(i,a,c,m){if(a==null){if(m!=null){if(c!=null)throw Error(r(92));if(V(m)){if(1<m.length)throw Error(r(93));m=m[0]}c=m}c==null&&(c=""),a=c}c=Cr(a),i.defaultValue=c,m=i.textContent,m===c&&m!==""&&m!==null&&(i.value=m),ie(i)}function pl(i,a){if(a){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=a;return}}i.textContent=a}var v3=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 a1(i,a,c){var m=a.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?i.setProperty(a,""):a==="float"?i.cssFloat="":i[a]="":m?i.setProperty(a,c):typeof c!="number"||c===0||v3.has(a)?a==="float"?i.cssFloat=c:i[a]=(""+c).trim():i[a]=c+"px"}function l1(i,a,c){if(a!=null&&typeof a!="object")throw Error(r(62));if(i=i.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||a!=null&&a.hasOwnProperty(m)||(m.indexOf("--")===0?i.setProperty(m,""):m==="float"?i.cssFloat="":i[m]="");for(var _ in a)m=a[_],a.hasOwnProperty(_)&&c[_]!==m&&a1(i,_,m)}else for(var x in a)a.hasOwnProperty(x)&&a1(i,x,a[x])}function Qp(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 b3=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"]]),_3=/^[\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 uh(i){return _3.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Es(){}var Jp=null;function eg(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var gl=null,vl=null;function c1(i){var a=mo(i);if(a&&(i=a.stateNode)){var c=i[Ie]||null;e:switch(i=a.stateNode,a.type){case"input":if(Yn(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),a=c.name,c.type==="radio"&&a!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+jt(""+a)+'"][type="radio"]'),a=0;a<c.length;a++){var m=c[a];if(m!==i&&m.form===i.form){var _=m[Ie]||null;if(!_)throw Error(r(90));Yn(m,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(a=0;a<c.length;a++)m=c[a],m.form===i.form&&Ce(m)}break e;case"textarea":s1(i,c.value,c.defaultValue);break e;case"select":a=c.value,a!=null&&ks(i,!!c.multiple,a,!1)}}}var tg=!1;function u1(i,a,c){if(tg)return i(a,c);tg=!0;try{var m=i(a);return m}finally{if(tg=!1,(gl!==null||vl!==null)&&(Zh(),gl&&(a=gl,i=vl,vl=gl=null,c1(a),i)))for(a=0;a<i.length;a++)c1(i[a])}}function $c(i,a){var c=i.stateNode;if(c===null)return null;var m=c[Ie]||null;if(m===null)return null;c=m[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(i=i.type,m=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!m;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,a,typeof c));return c}var Rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ng=!1;if(Rs)try{var Wc={};Object.defineProperty(Wc,"passive",{get:function(){ng=!0}}),window.addEventListener("test",Wc,Wc),window.removeEventListener("test",Wc,Wc)}catch{ng=!1}var vo=null,rg=null,dh=null;function d1(){if(dh)return dh;var i,a=rg,c=a.length,m,_="value"in vo?vo.value:vo.textContent,x=_.length;for(i=0;i<c&&a[i]===_[i];i++);var T=c-i;for(m=1;m<=T&&a[c-m]===_[x-m];m++);return dh=_.slice(i,1<m?1-m:void 0)}function hh(i){var a=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&a===13&&(i=13)):i=a,i===10&&(i=13),32<=i||i===13?i:0}function fh(){return!0}function h1(){return!1}function Or(i){function a(c,m,_,x,T){this._reactName=c,this._targetInst=_,this.type=m,this.nativeEvent=x,this.target=T,this.currentTarget=null;for(var z in i)i.hasOwnProperty(z)&&(c=i[z],this[z]=c?c(x):x[z]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?fh:h1,this.isPropagationStopped=h1,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=fh)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=fh)},persist:function(){},isPersistent:fh}),a}var ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mh=Or(ha),Vc=p({},ha,{view:0,detail:0}),y3=Or(Vc),ig,sg,qc,ph=p({},Vc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ag,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!==qc&&(qc&&i.type==="mousemove"?(ig=i.screenX-qc.screenX,sg=i.screenY-qc.screenY):sg=ig=0,qc=i),ig)},movementY:function(i){return"movementY"in i?i.movementY:sg}}),f1=Or(ph),x3=p({},ph,{dataTransfer:0}),w3=Or(x3),S3=p({},Vc,{relatedTarget:0}),og=Or(S3),C3=p({},ha,{animationName:0,elapsedTime:0,pseudoElement:0}),k3=Or(C3),E3=p({},ha,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),R3=Or(E3),T3=p({},ha,{data:0}),m1=Or(T3),N3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M3={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"},A3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D3(i){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(i):(i=A3[i])?!!a[i]:!1}function ag(){return D3}var j3=p({},Vc,{key:function(i){if(i.key){var a=N3[i.key]||i.key;if(a!=="Unidentified")return a}return i.type==="keypress"?(i=hh(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?M3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ag,charCode:function(i){return i.type==="keypress"?hh(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?hh(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),O3=Or(j3),L3=p({},ph,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),p1=Or(L3),z3=p({},Vc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ag}),P3=Or(z3),B3=p({},ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),I3=Or(B3),F3=p({},ph,{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}),H3=Or(F3),U3=p({},ha,{newState:0,oldState:0}),$3=Or(U3),W3=[9,13,27,32],lg=Rs&&"CompositionEvent"in window,Kc=null;Rs&&"documentMode"in document&&(Kc=document.documentMode);var V3=Rs&&"TextEvent"in window&&!Kc,g1=Rs&&(!lg||Kc&&8<Kc&&11>=Kc),v1=" ",b1=!1;function _1(i,a){switch(i){case"keyup":return W3.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function y1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var bl=!1;function q3(i,a){switch(i){case"compositionend":return y1(a);case"keypress":return a.which!==32?null:(b1=!0,v1);case"textInput":return i=a.data,i===v1&&b1?null:i;default:return null}}function K3(i,a){if(bl)return i==="compositionend"||!lg&&_1(i,a)?(i=d1(),dh=rg=vo=null,bl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return g1&&a.locale!=="ko"?null:a.data;default:return null}}var G3={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 x1(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a==="input"?!!G3[i.type]:a==="textarea"}function w1(i,a,c,m){gl?vl?vl.push(m):vl=[m]:gl=m,a=sf(a,"onChange"),0<a.length&&(c=new mh("onChange","change",null,c,m),i.push({event:c,listeners:a}))}var Gc=null,Yc=null;function Y3(i){iC(i,0)}function gh(i){var a=da(i);if(Ce(a))return i}function S1(i,a){if(i==="change")return a}var C1=!1;if(Rs){var cg;if(Rs){var ug="oninput"in document;if(!ug){var k1=document.createElement("div");k1.setAttribute("oninput","return;"),ug=typeof k1.oninput=="function"}cg=ug}else cg=!1;C1=cg&&(!document.documentMode||9<document.documentMode)}function E1(){Gc&&(Gc.detachEvent("onpropertychange",R1),Yc=Gc=null)}function R1(i){if(i.propertyName==="value"&&gh(Yc)){var a=[];w1(a,Yc,i,eg(i)),u1(Y3,a)}}function X3(i,a,c){i==="focusin"?(E1(),Gc=a,Yc=c,Gc.attachEvent("onpropertychange",R1)):i==="focusout"&&E1()}function Z3(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return gh(Yc)}function Q3(i,a){if(i==="click")return gh(a)}function J3(i,a){if(i==="input"||i==="change")return gh(a)}function eO(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var Kr=typeof Object.is=="function"?Object.is:eO;function Xc(i,a){if(Kr(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var c=Object.keys(i),m=Object.keys(a);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var _=c[m];if(!Ae.call(a,_)||!Kr(i[_],a[_]))return!1}return!0}function T1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function N1(i,a){var c=T1(i);i=0;for(var m;c;){if(c.nodeType===3){if(m=i+c.textContent.length,i<=a&&m>=a)return{node:c,offset:a-i};i=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=T1(c)}}function M1(i,a){return i&&a?i===a?!0:i&&i.nodeType===3?!1:a&&a.nodeType===3?M1(i,a.parentNode):"contains"in i?i.contains(a):i.compareDocumentPosition?!!(i.compareDocumentPosition(a)&16):!1:!1}function A1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var a=Ue(i.document);a instanceof i.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)i=a.contentWindow;else break;a=Ue(i.document)}return a}function dg(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a&&(a==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||a==="textarea"||i.contentEditable==="true")}var tO=Rs&&"documentMode"in document&&11>=document.documentMode,_l=null,hg=null,Zc=null,fg=!1;function D1(i,a,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;fg||_l==null||_l!==Ue(m)||(m=_l,"selectionStart"in m&&dg(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Zc&&Xc(Zc,m)||(Zc=m,m=sf(hg,"onSelect"),0<m.length&&(a=new mh("onSelect","select",null,a,c),i.push({event:a,listeners:m}),a.target=_l)))}function fa(i,a){var c={};return c[i.toLowerCase()]=a.toLowerCase(),c["Webkit"+i]="webkit"+a,c["Moz"+i]="moz"+a,c}var yl={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionrun:fa("Transition","TransitionRun"),transitionstart:fa("Transition","TransitionStart"),transitioncancel:fa("Transition","TransitionCancel"),transitionend:fa("Transition","TransitionEnd")},mg={},j1={};Rs&&(j1=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function ma(i){if(mg[i])return mg[i];if(!yl[i])return i;var a=yl[i],c;for(c in a)if(a.hasOwnProperty(c)&&c in j1)return mg[i]=a[c];return i}var O1=ma("animationend"),L1=ma("animationiteration"),z1=ma("animationstart"),nO=ma("transitionrun"),rO=ma("transitionstart"),iO=ma("transitioncancel"),P1=ma("transitionend"),B1=new Map,pg="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(" ");pg.push("scrollEnd");function zi(i,a){B1.set(i,a),Cs(a,[i])}var vh=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=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(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},hi=[],xl=0,gg=0;function bh(){for(var i=xl,a=gg=xl=0;a<i;){var c=hi[a];hi[a++]=null;var m=hi[a];hi[a++]=null;var _=hi[a];hi[a++]=null;var x=hi[a];if(hi[a++]=null,m!==null&&_!==null){var T=m.pending;T===null?_.next=_:(_.next=T.next,T.next=_),m.pending=_}x!==0&&I1(c,_,x)}}function _h(i,a,c,m){hi[xl++]=i,hi[xl++]=a,hi[xl++]=c,hi[xl++]=m,gg|=m,i.lanes|=m,i=i.alternate,i!==null&&(i.lanes|=m)}function vg(i,a,c,m){return _h(i,a,c,m),yh(i)}function pa(i,a){return _h(i,null,null,a),yh(i)}function I1(i,a,c){i.lanes|=c;var m=i.alternate;m!==null&&(m.lanes|=c);for(var _=!1,x=i.return;x!==null;)x.childLanes|=c,m=x.alternate,m!==null&&(m.childLanes|=c),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(_=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,_&&a!==null&&(_=31-we(c),i=x.hiddenUpdates,m=i[_],m===null?i[_]=[a]:m.push(a),a.lane=c|536870912),x):null}function yh(i){if(50<_u)throw _u=0,Ev=null,Error(r(185));for(var a=i.return;a!==null;)i=a,a=i.return;return i.tag===3?i.stateNode:null}var wl={};function sO(i,a,c,m){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=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(i,a,c,m){return new sO(i,a,c,m)}function bg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ts(i,a){var c=i.alternate;return c===null?(c=Gr(i.tag,a,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=a,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,a=i.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function F1(i,a){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=a,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,a=c.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),i}function xh(i,a,c,m,_,x){var T=0;if(m=i,typeof i=="function")bg(i)&&(T=1);else if(typeof i=="string")T=u4(i,c,ne.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case G:return i=Gr(31,c,a,_),i.elementType=G,i.lanes=x,i;case S:return ga(c.children,_,x,a);case C:T=8,_|=24;break;case k:return i=Gr(12,c,a,_|2),i.elementType=k,i.lanes=x,i;case L:return i=Gr(13,c,a,_),i.elementType=L,i.lanes=x,i;case j:return i=Gr(19,c,a,_),i.elementType=j,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case E:T=10;break e;case R:T=9;break e;case M:T=11;break e;case D:T=14;break e;case H:T=16,m=null;break e}T=29,c=Error(r(130,i===null?"null":typeof i,"")),m=null}return a=Gr(T,c,a,_),a.elementType=i,a.type=m,a.lanes=x,a}function ga(i,a,c,m){return i=Gr(7,i,m,a),i.lanes=c,i}function _g(i,a,c){return i=Gr(6,i,null,a),i.lanes=c,i}function H1(i){var a=Gr(18,null,null,0);return a.stateNode=i,a}function yg(i,a,c){return a=Gr(4,i.children!==null?i.children:[],i.key,a),a.lanes=c,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}var U1=new WeakMap;function fi(i,a){if(typeof i=="object"&&i!==null){var c=U1.get(i);return c!==void 0?c:(a={value:i,source:a,stack:Ve(a)},U1.set(i,a),a)}return{value:i,source:a,stack:Ve(a)}}var Sl=[],Cl=0,wh=null,Qc=0,mi=[],pi=0,bo=null,Qi=1,Ji="";function Ns(i,a){Sl[Cl++]=Qc,Sl[Cl++]=wh,wh=i,Qc=a}function $1(i,a,c){mi[pi++]=Qi,mi[pi++]=Ji,mi[pi++]=bo,bo=i;var m=Qi;i=Ji;var _=32-we(m)-1;m&=~(1<<_),c+=1;var x=32-we(a)+_;if(30<x){var T=_-_%5;x=(m&(1<<T)-1).toString(32),m>>=T,_-=T,Qi=1<<32-we(a)+_|c<<_|m,Ji=x+i}else Qi=1<<x|c<<_|m,Ji=i}function xg(i){i.return!==null&&(Ns(i,1),$1(i,1,0))}function wg(i){for(;i===wh;)wh=Sl[--Cl],Sl[Cl]=null,Qc=Sl[--Cl],Sl[Cl]=null;for(;i===bo;)bo=mi[--pi],mi[pi]=null,Ji=mi[--pi],mi[pi]=null,Qi=mi[--pi],mi[pi]=null}function W1(i,a){mi[pi++]=Qi,mi[pi++]=Ji,mi[pi++]=bo,Qi=a.id,Ji=a.overflow,bo=i}var lr=null,ln=null,Dt=!1,_o=null,gi=!1,Sg=Error(r(519));function yo(i){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Jc(fi(a,i)),Sg}function V1(i){var a=i.stateNode,c=i.type,m=i.memoizedProps;switch(a[K]=i,a[Ie]=m,c){case"dialog":Ct("cancel",a),Ct("close",a);break;case"iframe":case"object":case"embed":Ct("load",a);break;case"video":case"audio":for(c=0;c<xu.length;c++)Ct(xu[c],a);break;case"source":Ct("error",a);break;case"img":case"image":case"link":Ct("error",a),Ct("load",a);break;case"details":Ct("toggle",a);break;case"input":Ct("invalid",a),Zi(a,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Ct("invalid",a);break;case"textarea":Ct("invalid",a),o1(a,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||a.textContent===""+c||m.suppressHydrationWarning===!0||lC(a.textContent,c)?(m.popover!=null&&(Ct("beforetoggle",a),Ct("toggle",a)),m.onScroll!=null&&Ct("scroll",a),m.onScrollEnd!=null&&Ct("scrollend",a),m.onClick!=null&&(a.onclick=Es),a=!0):a=!1,a||yo(i,!0)}function q1(i){for(lr=i.return;lr;)switch(lr.tag){case 5:case 31:case 13:gi=!1;return;case 27:case 3:gi=!0;return;default:lr=lr.return}}function kl(i){if(i!==lr)return!1;if(!Dt)return q1(i),Dt=!0,!1;var a=i.tag,c;if((c=a!==3&&a!==27)&&((c=a===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||Hv(i.type,i.memoizedProps)),c=!c),c&&ln&&yo(i),q1(i),a===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ln=vC(i)}else if(a===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ln=vC(i)}else a===27?(a=ln,Oo(i.type)?(i=qv,qv=null,ln=i):ln=a):ln=lr?bi(i.stateNode.nextSibling):null;return!0}function va(){ln=lr=null,Dt=!1}function Cg(){var i=_o;return i!==null&&(Br===null?Br=i:Br.push.apply(Br,i),_o=null),i}function Jc(i){_o===null?_o=[i]:_o.push(i)}var kg=P(null),ba=null,Ms=null;function xo(i,a,c){N(kg,a._currentValue),a._currentValue=c}function As(i){i._currentValue=kg.current,X(kg)}function Eg(i,a,c){for(;i!==null;){var m=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),i===c)break;i=i.return}}function Rg(i,a,c,m){var _=i.child;for(_!==null&&(_.return=i);_!==null;){var x=_.dependencies;if(x!==null){var T=_.child;x=x.firstContext;e:for(;x!==null;){var z=x;x=_;for(var Z=0;Z<a.length;Z++)if(z.context===a[Z]){x.lanes|=c,z=x.alternate,z!==null&&(z.lanes|=c),Eg(x.return,c,i),m||(T=null);break e}x=z.next}}else if(_.tag===18){if(T=_.return,T===null)throw Error(r(341));T.lanes|=c,x=T.alternate,x!==null&&(x.lanes|=c),Eg(T,c,i),T=null}else T=_.child;if(T!==null)T.return=_;else for(T=_;T!==null;){if(T===i){T=null;break}if(_=T.sibling,_!==null){_.return=T.return,T=_;break}T=T.return}_=T}}function El(i,a,c,m){i=null;for(var _=a,x=!1;_!==null;){if(!x){if((_.flags&524288)!==0)x=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var T=_.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var z=_.type;Kr(_.pendingProps.value,T.value)||(i!==null?i.push(z):i=[z])}}else if(_===te.current){if(T=_.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(i!==null?i.push(Eu):i=[Eu])}_=_.return}i!==null&&Rg(a,i,c,m),a.flags|=262144}function Sh(i){for(i=i.firstContext;i!==null;){if(!Kr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function _a(i){ba=i,Ms=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function cr(i){return K1(ba,i)}function Ch(i,a){return ba===null&&_a(i),K1(i,a)}function K1(i,a){var c=a._currentValue;if(a={context:a,memoizedValue:c,next:null},Ms===null){if(i===null)throw Error(r(308));Ms=a,i.dependencies={lanes:0,firstContext:a},i.flags|=524288}else Ms=Ms.next=a;return c}var oO=typeof AbortController<"u"?AbortController:function(){var i=[],a=this.signal={aborted:!1,addEventListener:function(c,m){i.push(m)}};this.abort=function(){a.aborted=!0,i.forEach(function(c){return c()})}},aO=e.unstable_scheduleCallback,lO=e.unstable_NormalPriority,An={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tg(){return{controller:new oO,data:new Map,refCount:0}}function eu(i){i.refCount--,i.refCount===0&&aO(lO,function(){i.controller.abort()})}var tu=null,Ng=0,Rl=0,Tl=null;function cO(i,a){if(tu===null){var c=tu=[];Ng=0,Rl=Dv(),Tl={status:"pending",value:void 0,then:function(m){c.push(m)}}}return Ng++,a.then(G1,G1),a}function G1(){if(--Ng===0&&tu!==null){Tl!==null&&(Tl.status="fulfilled");var i=tu;tu=null,Rl=0,Tl=null;for(var a=0;a<i.length;a++)(0,i[a])()}}function uO(i,a){var c=[],m={status:"pending",value:null,reason:null,then:function(_){c.push(_)}};return i.then(function(){m.status="fulfilled",m.value=a;for(var _=0;_<c.length;_++)(0,c[_])(a)},function(_){for(m.status="rejected",m.reason=_,_=0;_<c.length;_++)(0,c[_])(void 0)}),m}var Y1=O.S;O.S=function(i,a){DS=Se(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&cO(i,a),Y1!==null&&Y1(i,a)};var ya=P(null);function Mg(){var i=ya.current;return i!==null?i:rn.pooledCache}function kh(i,a){a===null?N(ya,ya.current):N(ya,a.pool)}function X1(){var i=Mg();return i===null?null:{parent:An._currentValue,pool:i}}var Nl=Error(r(460)),Ag=Error(r(474)),Eh=Error(r(542)),Rh={then:function(){}};function Z1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Q1(i,a,c){switch(c=i[c],c===void 0?i.push(a):c!==a&&(a.then(Es,Es),a=c),a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,ew(i),i;default:if(typeof a.status=="string")a.then(Es,Es);else{if(i=rn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=a,i.status="pending",i.then(function(m){if(a.status==="pending"){var _=a;_.status="fulfilled",_.value=m}},function(m){if(a.status==="pending"){var _=a;_.status="rejected",_.reason=m}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,ew(i),i}throw wa=a,Nl}}function xa(i){try{var a=i._init;return a(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(wa=c,Nl):c}}var wa=null;function J1(){if(wa===null)throw Error(r(459));var i=wa;return wa=null,i}function ew(i){if(i===Nl||i===Eh)throw Error(r(483))}var Ml=null,nu=0;function Th(i){var a=nu;return nu+=1,Ml===null&&(Ml=[]),Q1(Ml,i,a)}function ru(i,a){a=a.props.ref,i.ref=a!==void 0?a:null}function Nh(i,a){throw a.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(a),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i)))}function tw(i){function a(re,ee){if(i){var ae=re.deletions;ae===null?(re.deletions=[ee],re.flags|=16):ae.push(ee)}}function c(re,ee){if(!i)return null;for(;ee!==null;)a(re,ee),ee=ee.sibling;return null}function m(re){for(var ee=new Map;re!==null;)re.key!==null?ee.set(re.key,re):ee.set(re.index,re),re=re.sibling;return ee}function _(re,ee){return re=Ts(re,ee),re.index=0,re.sibling=null,re}function x(re,ee,ae){return re.index=ae,i?(ae=re.alternate,ae!==null?(ae=ae.index,ae<ee?(re.flags|=67108866,ee):ae):(re.flags|=67108866,ee)):(re.flags|=1048576,ee)}function T(re){return i&&re.alternate===null&&(re.flags|=67108866),re}function z(re,ee,ae,be){return ee===null||ee.tag!==6?(ee=_g(ae,re.mode,be),ee.return=re,ee):(ee=_(ee,ae),ee.return=re,ee)}function Z(re,ee,ae,be){var Qe=ae.type;return Qe===S?ve(re,ee,ae.props.children,be,ae.key):ee!==null&&(ee.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===H&&xa(Qe)===ee.type)?(ee=_(ee,ae.props),ru(ee,ae),ee.return=re,ee):(ee=xh(ae.type,ae.key,ae.props,null,re.mode,be),ru(ee,ae),ee.return=re,ee)}function le(re,ee,ae,be){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ae.containerInfo||ee.stateNode.implementation!==ae.implementation?(ee=yg(ae,re.mode,be),ee.return=re,ee):(ee=_(ee,ae.children||[]),ee.return=re,ee)}function ve(re,ee,ae,be,Qe){return ee===null||ee.tag!==7?(ee=ga(ae,re.mode,be,Qe),ee.return=re,ee):(ee=_(ee,ae),ee.return=re,ee)}function _e(re,ee,ae){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=_g(""+ee,re.mode,ae),ee.return=re,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return ae=xh(ee.type,ee.key,ee.props,null,re.mode,ae),ru(ae,ee),ae.return=re,ae;case w:return ee=yg(ee,re.mode,ae),ee.return=re,ee;case H:return ee=xa(ee),_e(re,ee,ae)}if(V(ee)||B(ee))return ee=ga(ee,re.mode,ae,null),ee.return=re,ee;if(typeof ee.then=="function")return _e(re,Th(ee),ae);if(ee.$$typeof===E)return _e(re,Ch(re,ee),ae);Nh(re,ee)}return null}function ce(re,ee,ae,be){var Qe=ee!==null?ee.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Qe!==null?null:z(re,ee,""+ae,be);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case y:return ae.key===Qe?Z(re,ee,ae,be):null;case w:return ae.key===Qe?le(re,ee,ae,be):null;case H:return ae=xa(ae),ce(re,ee,ae,be)}if(V(ae)||B(ae))return Qe!==null?null:ve(re,ee,ae,be,null);if(typeof ae.then=="function")return ce(re,ee,Th(ae),be);if(ae.$$typeof===E)return ce(re,ee,Ch(re,ae),be);Nh(re,ae)}return null}function de(re,ee,ae,be,Qe){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return re=re.get(ae)||null,z(ee,re,""+be,Qe);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case y:return re=re.get(be.key===null?ae:be.key)||null,Z(ee,re,be,Qe);case w:return re=re.get(be.key===null?ae:be.key)||null,le(ee,re,be,Qe);case H:return be=xa(be),de(re,ee,ae,be,Qe)}if(V(be)||B(be))return re=re.get(ae)||null,ve(ee,re,be,Qe,null);if(typeof be.then=="function")return de(re,ee,ae,Th(be),Qe);if(be.$$typeof===E)return de(re,ee,ae,Ch(ee,be),Qe);Nh(ee,be)}return null}function $e(re,ee,ae,be){for(var Qe=null,zt=null,Ye=ee,dt=ee=0,Mt=null;Ye!==null&&dt<ae.length;dt++){Ye.index>dt?(Mt=Ye,Ye=null):Mt=Ye.sibling;var Pt=ce(re,Ye,ae[dt],be);if(Pt===null){Ye===null&&(Ye=Mt);break}i&&Ye&&Pt.alternate===null&&a(re,Ye),ee=x(Pt,ee,dt),zt===null?Qe=Pt:zt.sibling=Pt,zt=Pt,Ye=Mt}if(dt===ae.length)return c(re,Ye),Dt&&Ns(re,dt),Qe;if(Ye===null){for(;dt<ae.length;dt++)Ye=_e(re,ae[dt],be),Ye!==null&&(ee=x(Ye,ee,dt),zt===null?Qe=Ye:zt.sibling=Ye,zt=Ye);return Dt&&Ns(re,dt),Qe}for(Ye=m(Ye);dt<ae.length;dt++)Mt=de(Ye,re,dt,ae[dt],be),Mt!==null&&(i&&Mt.alternate!==null&&Ye.delete(Mt.key===null?dt:Mt.key),ee=x(Mt,ee,dt),zt===null?Qe=Mt:zt.sibling=Mt,zt=Mt);return i&&Ye.forEach(function(Io){return a(re,Io)}),Dt&&Ns(re,dt),Qe}function tt(re,ee,ae,be){if(ae==null)throw Error(r(151));for(var Qe=null,zt=null,Ye=ee,dt=ee=0,Mt=null,Pt=ae.next();Ye!==null&&!Pt.done;dt++,Pt=ae.next()){Ye.index>dt?(Mt=Ye,Ye=null):Mt=Ye.sibling;var Io=ce(re,Ye,Pt.value,be);if(Io===null){Ye===null&&(Ye=Mt);break}i&&Ye&&Io.alternate===null&&a(re,Ye),ee=x(Io,ee,dt),zt===null?Qe=Io:zt.sibling=Io,zt=Io,Ye=Mt}if(Pt.done)return c(re,Ye),Dt&&Ns(re,dt),Qe;if(Ye===null){for(;!Pt.done;dt++,Pt=ae.next())Pt=_e(re,Pt.value,be),Pt!==null&&(ee=x(Pt,ee,dt),zt===null?Qe=Pt:zt.sibling=Pt,zt=Pt);return Dt&&Ns(re,dt),Qe}for(Ye=m(Ye);!Pt.done;dt++,Pt=ae.next())Pt=de(Ye,re,dt,Pt.value,be),Pt!==null&&(i&&Pt.alternate!==null&&Ye.delete(Pt.key===null?dt:Pt.key),ee=x(Pt,ee,dt),zt===null?Qe=Pt:zt.sibling=Pt,zt=Pt);return i&&Ye.forEach(function(x4){return a(re,x4)}),Dt&&Ns(re,dt),Qe}function Jt(re,ee,ae,be){if(typeof ae=="object"&&ae!==null&&ae.type===S&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case y:e:{for(var Qe=ae.key;ee!==null;){if(ee.key===Qe){if(Qe=ae.type,Qe===S){if(ee.tag===7){c(re,ee.sibling),be=_(ee,ae.props.children),be.return=re,re=be;break e}}else if(ee.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===H&&xa(Qe)===ee.type){c(re,ee.sibling),be=_(ee,ae.props),ru(be,ae),be.return=re,re=be;break e}c(re,ee);break}else a(re,ee);ee=ee.sibling}ae.type===S?(be=ga(ae.props.children,re.mode,be,ae.key),be.return=re,re=be):(be=xh(ae.type,ae.key,ae.props,null,re.mode,be),ru(be,ae),be.return=re,re=be)}return T(re);case w:e:{for(Qe=ae.key;ee!==null;){if(ee.key===Qe)if(ee.tag===4&&ee.stateNode.containerInfo===ae.containerInfo&&ee.stateNode.implementation===ae.implementation){c(re,ee.sibling),be=_(ee,ae.children||[]),be.return=re,re=be;break e}else{c(re,ee);break}else a(re,ee);ee=ee.sibling}be=yg(ae,re.mode,be),be.return=re,re=be}return T(re);case H:return ae=xa(ae),Jt(re,ee,ae,be)}if(V(ae))return $e(re,ee,ae,be);if(B(ae)){if(Qe=B(ae),typeof Qe!="function")throw Error(r(150));return ae=Qe.call(ae),tt(re,ee,ae,be)}if(typeof ae.then=="function")return Jt(re,ee,Th(ae),be);if(ae.$$typeof===E)return Jt(re,ee,Ch(re,ae),be);Nh(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,ee!==null&&ee.tag===6?(c(re,ee.sibling),be=_(ee,ae),be.return=re,re=be):(c(re,ee),be=_g(ae,re.mode,be),be.return=re,re=be),T(re)):c(re,ee)}return function(re,ee,ae,be){try{nu=0;var Qe=Jt(re,ee,ae,be);return Ml=null,Qe}catch(Ye){if(Ye===Nl||Ye===Eh)throw Ye;var zt=Gr(29,Ye,null,re.mode);return zt.lanes=be,zt.return=re,zt}finally{}}}var Sa=tw(!0),nw=tw(!1),wo=!1;function Dg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jg(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function So(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Co(i,a,c){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(Ft&2)!==0){var _=m.pending;return _===null?a.next=a:(a.next=_.next,_.next=a),m.pending=a,a=yh(i),I1(i,null,c),a}return _h(i,m,a,c),yh(i)}function iu(i,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194048)!==0)){var m=a.lanes;m&=i.pendingLanes,c|=m,a.lanes=c,Te(i,c)}}function Og(i,a){var c=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var _=null,x=null;if(c=c.firstBaseUpdate,c!==null){do{var T={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};x===null?_=x=T:x=x.next=T,c=c.next}while(c!==null);x===null?_=x=a:x=x.next=a}else _=x=a;c={baseState:m.baseState,firstBaseUpdate:_,lastBaseUpdate:x,shared:m.shared,callbacks:m.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=a:i.next=a,c.lastBaseUpdate=a}var Lg=!1;function su(){if(Lg){var i=Tl;if(i!==null)throw i}}function ou(i,a,c,m){Lg=!1;var _=i.updateQueue;wo=!1;var x=_.firstBaseUpdate,T=_.lastBaseUpdate,z=_.shared.pending;if(z!==null){_.shared.pending=null;var Z=z,le=Z.next;Z.next=null,T===null?x=le:T.next=le,T=Z;var ve=i.alternate;ve!==null&&(ve=ve.updateQueue,z=ve.lastBaseUpdate,z!==T&&(z===null?ve.firstBaseUpdate=le:z.next=le,ve.lastBaseUpdate=Z))}if(x!==null){var _e=_.baseState;T=0,ve=le=Z=null,z=x;do{var ce=z.lane&-536870913,de=ce!==z.lane;if(de?(Nt&ce)===ce:(m&ce)===ce){ce!==0&&ce===Rl&&(Lg=!0),ve!==null&&(ve=ve.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var $e=i,tt=z;ce=a;var Jt=c;switch(tt.tag){case 1:if($e=tt.payload,typeof $e=="function"){_e=$e.call(Jt,_e,ce);break e}_e=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=tt.payload,ce=typeof $e=="function"?$e.call(Jt,_e,ce):$e,ce==null)break e;_e=p({},_e,ce);break e;case 2:wo=!0}}ce=z.callback,ce!==null&&(i.flags|=64,de&&(i.flags|=8192),de=_.callbacks,de===null?_.callbacks=[ce]:de.push(ce))}else de={lane:ce,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ve===null?(le=ve=de,Z=_e):ve=ve.next=de,T|=ce;if(z=z.next,z===null){if(z=_.shared.pending,z===null)break;de=z,z=de.next,de.next=null,_.lastBaseUpdate=de,_.shared.pending=null}}while(!0);ve===null&&(Z=_e),_.baseState=Z,_.firstBaseUpdate=le,_.lastBaseUpdate=ve,x===null&&(_.shared.lanes=0),No|=T,i.lanes=T,i.memoizedState=_e}}function rw(i,a){if(typeof i!="function")throw Error(r(191,i));i.call(a)}function iw(i,a){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)rw(c[i],a)}var Al=P(null),Mh=P(0);function sw(i,a){i=Fs,N(Mh,i),N(Al,a),Fs=i|a.baseLanes}function zg(){N(Mh,Fs),N(Al,Al.current)}function Pg(){Fs=Mh.current,X(Al),X(Mh)}var Yr=P(null),vi=null;function ko(i){var a=i.alternate;N(En,En.current&1),N(Yr,i),vi===null&&(a===null||Al.current!==null||a.memoizedState!==null)&&(vi=i)}function Bg(i){N(En,En.current),N(Yr,i),vi===null&&(vi=i)}function ow(i){i.tag===22?(N(En,En.current),N(Yr,i),vi===null&&(vi=i)):Eo()}function Eo(){N(En,En.current),N(Yr,Yr.current)}function Xr(i){X(Yr),vi===i&&(vi=null),X(En)}var En=P(0);function Ah(i){for(var a=i;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Wv(c)||Vv(c)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Ds=0,ct=null,Zt=null,Dn=null,Dh=!1,Dl=!1,Ca=!1,jh=0,au=0,jl=null,dO=0;function xn(){throw Error(r(321))}function Ig(i,a){if(a===null)return!1;for(var c=0;c<a.length&&c<i.length;c++)if(!Kr(i[c],a[c]))return!1;return!0}function Fg(i,a,c,m,_,x){return Ds=x,ct=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,O.H=i===null||i.memoizedState===null?$w:tv,Ca=!1,x=c(m,_),Ca=!1,Dl&&(x=lw(a,c,m,_)),aw(i),x}function aw(i){O.H=uu;var a=Zt!==null&&Zt.next!==null;if(Ds=0,Dn=Zt=ct=null,Dh=!1,au=0,jl=null,a)throw Error(r(300));i===null||jn||(i=i.dependencies,i!==null&&Sh(i)&&(jn=!0))}function lw(i,a,c,m){ct=i;var _=0;do{if(Dl&&(jl=null),au=0,Dl=!1,25<=_)throw Error(r(301));if(_+=1,Dn=Zt=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}O.H=Ww,x=a(c,m)}while(Dl);return x}function hO(){var i=O.H,a=i.useState()[0];return a=typeof a.then=="function"?lu(a):a,i=i.useState()[0],(Zt!==null?Zt.memoizedState:null)!==i&&(ct.flags|=1024),a}function Hg(){var i=jh!==0;return jh=0,i}function Ug(i,a,c){a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~c}function $g(i){if(Dh){for(i=i.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Dh=!1}Ds=0,Dn=Zt=ct=null,Dl=!1,au=jh=0,jl=null}function kr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dn===null?ct.memoizedState=Dn=i:Dn=Dn.next=i,Dn}function Rn(){if(Zt===null){var i=ct.alternate;i=i!==null?i.memoizedState:null}else i=Zt.next;var a=Dn===null?ct.memoizedState:Dn.next;if(a!==null)Dn=a,Zt=i;else{if(i===null)throw ct.alternate===null?Error(r(467)):Error(r(310));Zt=i,i={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},Dn===null?ct.memoizedState=Dn=i:Dn=Dn.next=i}return Dn}function Oh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lu(i){var a=au;return au+=1,jl===null&&(jl=[]),i=Q1(jl,i,a),a=ct,(Dn===null?a.memoizedState:Dn.next)===null&&(a=a.alternate,O.H=a===null||a.memoizedState===null?$w:tv),i}function Lh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return lu(i);if(i.$$typeof===E)return cr(i)}throw Error(r(438,String(i)))}function Wg(i){var a=null,c=ct.updateQueue;if(c!==null&&(a=c.memoCache),a==null){var m=ct.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(a={data:m.data.map(function(_){return _.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),c===null&&(c=Oh(),ct.updateQueue=c),c.memoCache=a,c=a.data[a.index],c===void 0)for(c=a.data[a.index]=Array(i),m=0;m<i;m++)c[m]=I;return a.index++,c}function js(i,a){return typeof a=="function"?a(i):a}function zh(i){var a=Rn();return Vg(a,Zt,i)}function Vg(i,a,c){var m=i.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var _=i.baseQueue,x=m.pending;if(x!==null){if(_!==null){var T=_.next;_.next=x.next,x.next=T}a.baseQueue=_=x,m.pending=null}if(x=i.baseState,_===null)i.memoizedState=x;else{a=_.next;var z=T=null,Z=null,le=a,ve=!1;do{var _e=le.lane&-536870913;if(_e!==le.lane?(Nt&_e)===_e:(Ds&_e)===_e){var ce=le.revertLane;if(ce===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),_e===Rl&&(ve=!0);else if((Ds&ce)===ce){le=le.next,ce===Rl&&(ve=!0);continue}else _e={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Z===null?(z=Z=_e,T=x):Z=Z.next=_e,ct.lanes|=ce,No|=ce;_e=le.action,Ca&&c(x,_e),x=le.hasEagerState?le.eagerState:c(x,_e)}else ce={lane:_e,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Z===null?(z=Z=ce,T=x):Z=Z.next=ce,ct.lanes|=_e,No|=_e;le=le.next}while(le!==null&&le!==a);if(Z===null?T=x:Z.next=z,!Kr(x,i.memoizedState)&&(jn=!0,ve&&(c=Tl,c!==null)))throw c;i.memoizedState=x,i.baseState=T,i.baseQueue=Z,m.lastRenderedState=x}return _===null&&(m.lanes=0),[i.memoizedState,m.dispatch]}function qg(i){var a=Rn(),c=a.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var m=c.dispatch,_=c.pending,x=a.memoizedState;if(_!==null){c.pending=null;var T=_=_.next;do x=i(x,T.action),T=T.next;while(T!==_);Kr(x,a.memoizedState)||(jn=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),c.lastRenderedState=x}return[x,m]}function cw(i,a,c){var m=ct,_=Rn(),x=Dt;if(x){if(c===void 0)throw Error(r(407));c=c()}else c=a();var T=!Kr((Zt||_).memoizedState,c);if(T&&(_.memoizedState=c,jn=!0),_=_.queue,Yg(hw.bind(null,m,_,i),[i]),_.getSnapshot!==a||T||Dn!==null&&Dn.memoizedState.tag&1){if(m.flags|=2048,Ol(9,{destroy:void 0},dw.bind(null,m,_,c,a),null),rn===null)throw Error(r(349));x||(Ds&127)!==0||uw(m,a,c)}return c}function uw(i,a,c){i.flags|=16384,i={getSnapshot:a,value:c},a=ct.updateQueue,a===null?(a=Oh(),ct.updateQueue=a,a.stores=[i]):(c=a.stores,c===null?a.stores=[i]:c.push(i))}function dw(i,a,c,m){a.value=c,a.getSnapshot=m,fw(a)&&mw(i)}function hw(i,a,c){return c(function(){fw(a)&&mw(i)})}function fw(i){var a=i.getSnapshot;i=i.value;try{var c=a();return!Kr(i,c)}catch{return!0}}function mw(i){var a=pa(i,2);a!==null&&Ir(a,i,2)}function Kg(i){var a=kr();if(typeof i=="function"){var c=i;if(i=c(),Ca){ft(!0);try{c()}finally{ft(!1)}}}return a.memoizedState=a.baseState=i,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:i},a}function pw(i,a,c,m){return i.baseState=c,Vg(i,Zt,typeof m=="function"?m:js)}function fO(i,a,c,m,_){if(Ih(i))throw Error(r(485));if(i=a.action,i!==null){var x={payload:_,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){x.listeners.push(T)}};O.T!==null?c(!0):x.isTransition=!1,m(x),c=a.pending,c===null?(x.next=a.pending=x,gw(a,x)):(x.next=c.next,a.pending=c.next=x)}}function gw(i,a){var c=a.action,m=a.payload,_=i.state;if(a.isTransition){var x=O.T,T={};O.T=T;try{var z=c(_,m),Z=O.S;Z!==null&&Z(T,z),vw(i,a,z)}catch(le){Gg(i,a,le)}finally{x!==null&&T.types!==null&&(x.types=T.types),O.T=x}}else try{x=c(_,m),vw(i,a,x)}catch(le){Gg(i,a,le)}}function vw(i,a,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){bw(i,a,m)},function(m){return Gg(i,a,m)}):bw(i,a,c)}function bw(i,a,c){a.status="fulfilled",a.value=c,_w(a),i.state=c,a=i.pending,a!==null&&(c=a.next,c===a?i.pending=null:(c=c.next,a.next=c,gw(i,c)))}function Gg(i,a,c){var m=i.pending;if(i.pending=null,m!==null){m=m.next;do a.status="rejected",a.reason=c,_w(a),a=a.next;while(a!==m)}i.action=null}function _w(i){i=i.listeners;for(var a=0;a<i.length;a++)(0,i[a])()}function yw(i,a){return a}function xw(i,a){if(Dt){var c=rn.formState;if(c!==null){e:{var m=ct;if(Dt){if(ln){t:{for(var _=ln,x=gi;_.nodeType!==8;){if(!x){_=null;break t}if(_=bi(_.nextSibling),_===null){_=null;break t}}x=_.data,_=x==="F!"||x==="F"?_:null}if(_){ln=bi(_.nextSibling),m=_.data==="F!";break e}}yo(m)}m=!1}m&&(a=c[0])}}return c=kr(),c.memoizedState=c.baseState=a,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yw,lastRenderedState:a},c.queue=m,c=Fw.bind(null,ct,m),m.dispatch=c,m=Kg(!1),x=ev.bind(null,ct,!1,m.queue),m=kr(),_={state:a,dispatch:null,action:i,pending:null},m.queue=_,c=fO.bind(null,ct,_,x,c),_.dispatch=c,m.memoizedState=i,[a,c,!1]}function ww(i){var a=Rn();return Sw(a,Zt,i)}function Sw(i,a,c){if(a=Vg(i,a,yw)[0],i=zh(js)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var m=lu(a)}catch(T){throw T===Nl?Eh:T}else m=a;a=Rn();var _=a.queue,x=_.dispatch;return c!==a.memoizedState&&(ct.flags|=2048,Ol(9,{destroy:void 0},mO.bind(null,_,c),null)),[m,x,i]}function mO(i,a){i.action=a}function Cw(i){var a=Rn(),c=Zt;if(c!==null)return Sw(a,c,i);Rn(),a=a.memoizedState,c=Rn();var m=c.queue.dispatch;return c.memoizedState=i,[a,m,!1]}function Ol(i,a,c,m){return i={tag:i,create:c,deps:m,inst:a,next:null},a=ct.updateQueue,a===null&&(a=Oh(),ct.updateQueue=a),c=a.lastEffect,c===null?a.lastEffect=i.next=i:(m=c.next,c.next=i,i.next=m,a.lastEffect=i),i}function kw(){return Rn().memoizedState}function Ph(i,a,c,m){var _=kr();ct.flags|=i,_.memoizedState=Ol(1|a,{destroy:void 0},c,m===void 0?null:m)}function Bh(i,a,c,m){var _=Rn();m=m===void 0?null:m;var x=_.memoizedState.inst;Zt!==null&&m!==null&&Ig(m,Zt.memoizedState.deps)?_.memoizedState=Ol(a,x,c,m):(ct.flags|=i,_.memoizedState=Ol(1|a,x,c,m))}function Ew(i,a){Ph(8390656,8,i,a)}function Yg(i,a){Bh(2048,8,i,a)}function pO(i){ct.flags|=4;var a=ct.updateQueue;if(a===null)a=Oh(),ct.updateQueue=a,a.events=[i];else{var c=a.events;c===null?a.events=[i]:c.push(i)}}function Rw(i){var a=Rn().memoizedState;return pO({ref:a,nextImpl:i}),function(){if((Ft&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Tw(i,a){return Bh(4,2,i,a)}function Nw(i,a){return Bh(4,4,i,a)}function Mw(i,a){if(typeof a=="function"){i=i();var c=a(i);return function(){typeof c=="function"?c():a(null)}}if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function Aw(i,a,c){c=c!=null?c.concat([i]):null,Bh(4,4,Mw.bind(null,a,i),c)}function Xg(){}function Dw(i,a){var c=Rn();a=a===void 0?null:a;var m=c.memoizedState;return a!==null&&Ig(a,m[1])?m[0]:(c.memoizedState=[i,a],i)}function jw(i,a){var c=Rn();a=a===void 0?null:a;var m=c.memoizedState;if(a!==null&&Ig(a,m[1]))return m[0];if(m=i(),Ca){ft(!0);try{i()}finally{ft(!1)}}return c.memoizedState=[m,a],m}function Zg(i,a,c){return c===void 0||(Ds&1073741824)!==0&&(Nt&261930)===0?i.memoizedState=a:(i.memoizedState=c,i=OS(),ct.lanes|=i,No|=i,c)}function Ow(i,a,c,m){return Kr(c,a)?c:Al.current!==null?(i=Zg(i,c,m),Kr(i,a)||(jn=!0),i):(Ds&42)===0||(Ds&1073741824)!==0&&(Nt&261930)===0?(jn=!0,i.memoizedState=c):(i=OS(),ct.lanes|=i,No|=i,a)}function Lw(i,a,c,m,_){var x=$.p;$.p=x!==0&&8>x?x:8;var T=O.T,z={};O.T=z,ev(i,!1,a,c);try{var Z=_(),le=O.S;if(le!==null&&le(z,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var ve=uO(Z,m);cu(i,a,ve,Jr(i))}else cu(i,a,m,Jr(i))}catch(_e){cu(i,a,{then:function(){},status:"rejected",reason:_e},Jr())}finally{$.p=x,T!==null&&z.types!==null&&(T.types=z.types),O.T=T}}function gO(){}function Qg(i,a,c,m){if(i.tag!==5)throw Error(r(476));var _=zw(i).queue;Lw(i,_,a,U,c===null?gO:function(){return Pw(i),c(m)})}function zw(i){var a=i.memoizedState;if(a!==null)return a;a={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:U},next:null};var c={};return a.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:c},next:null},i.memoizedState=a,i=i.alternate,i!==null&&(i.memoizedState=a),a}function Pw(i){var a=zw(i);a.next===null&&(a=i.alternate.memoizedState),cu(i,a.next.queue,{},Jr())}function Jg(){return cr(Eu)}function Bw(){return Rn().memoizedState}function Iw(){return Rn().memoizedState}function vO(i){for(var a=i.return;a!==null;){switch(a.tag){case 24:case 3:var c=Jr();i=So(c);var m=Co(a,i,c);m!==null&&(Ir(m,a,c),iu(m,a,c)),a={cache:Tg()},i.payload=a;return}a=a.return}}function bO(i,a,c){var m=Jr();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Ih(i)?Hw(a,c):(c=vg(i,a,c,m),c!==null&&(Ir(c,i,m),Uw(c,a,m)))}function Fw(i,a,c){var m=Jr();cu(i,a,c,m)}function cu(i,a,c,m){var _={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Ih(i))Hw(a,_);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var T=a.lastRenderedState,z=x(T,c);if(_.hasEagerState=!0,_.eagerState=z,Kr(z,T))return _h(i,a,_,0),rn===null&&bh(),!1}catch{}finally{}if(c=vg(i,a,_,m),c!==null)return Ir(c,i,m),Uw(c,a,m),!0}return!1}function ev(i,a,c,m){if(m={lane:2,revertLane:Dv(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Ih(i)){if(a)throw Error(r(479))}else a=vg(i,c,m,2),a!==null&&Ir(a,i,2)}function Ih(i){var a=i.alternate;return i===ct||a!==null&&a===ct}function Hw(i,a){Dl=Dh=!0;var c=i.pending;c===null?a.next=a:(a.next=c.next,c.next=a),i.pending=a}function Uw(i,a,c){if((c&4194048)!==0){var m=a.lanes;m&=i.pendingLanes,c|=m,a.lanes=c,Te(i,c)}}var uu={readContext:cr,use:Lh,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};uu.useEffectEvent=xn;var $w={readContext:cr,use:Lh,useCallback:function(i,a){return kr().memoizedState=[i,a===void 0?null:a],i},useContext:cr,useEffect:Ew,useImperativeHandle:function(i,a,c){c=c!=null?c.concat([i]):null,Ph(4194308,4,Mw.bind(null,a,i),c)},useLayoutEffect:function(i,a){return Ph(4194308,4,i,a)},useInsertionEffect:function(i,a){Ph(4,2,i,a)},useMemo:function(i,a){var c=kr();a=a===void 0?null:a;var m=i();if(Ca){ft(!0);try{i()}finally{ft(!1)}}return c.memoizedState=[m,a],m},useReducer:function(i,a,c){var m=kr();if(c!==void 0){var _=c(a);if(Ca){ft(!0);try{c(a)}finally{ft(!1)}}}else _=a;return m.memoizedState=m.baseState=_,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:_},m.queue=i,i=i.dispatch=bO.bind(null,ct,i),[m.memoizedState,i]},useRef:function(i){var a=kr();return i={current:i},a.memoizedState=i},useState:function(i){i=Kg(i);var a=i.queue,c=Fw.bind(null,ct,a);return a.dispatch=c,[i.memoizedState,c]},useDebugValue:Xg,useDeferredValue:function(i,a){var c=kr();return Zg(c,i,a)},useTransition:function(){var i=Kg(!1);return i=Lw.bind(null,ct,i.queue,!0,!1),kr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,a,c){var m=ct,_=kr();if(Dt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=a(),rn===null)throw Error(r(349));(Nt&127)!==0||uw(m,a,c)}_.memoizedState=c;var x={value:c,getSnapshot:a};return _.queue=x,Ew(hw.bind(null,m,x,i),[i]),m.flags|=2048,Ol(9,{destroy:void 0},dw.bind(null,m,x,c,a),null),c},useId:function(){var i=kr(),a=rn.identifierPrefix;if(Dt){var c=Ji,m=Qi;c=(m&~(1<<32-we(m)-1)).toString(32)+c,a="_"+a+"R_"+c,c=jh++,0<c&&(a+="H"+c.toString(32)),a+="_"}else c=dO++,a="_"+a+"r_"+c.toString(32)+"_";return i.memoizedState=a},useHostTransitionStatus:Jg,useFormState:xw,useActionState:xw,useOptimistic:function(i){var a=kr();a.memoizedState=a.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=c,a=ev.bind(null,ct,!0,c),c.dispatch=a,[i,a]},useMemoCache:Wg,useCacheRefresh:function(){return kr().memoizedState=vO.bind(null,ct)},useEffectEvent:function(i){var a=kr(),c={impl:i};return a.memoizedState=c,function(){if((Ft&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},tv={readContext:cr,use:Lh,useCallback:Dw,useContext:cr,useEffect:Yg,useImperativeHandle:Aw,useInsertionEffect:Tw,useLayoutEffect:Nw,useMemo:jw,useReducer:zh,useRef:kw,useState:function(){return zh(js)},useDebugValue:Xg,useDeferredValue:function(i,a){var c=Rn();return Ow(c,Zt.memoizedState,i,a)},useTransition:function(){var i=zh(js)[0],a=Rn().memoizedState;return[typeof i=="boolean"?i:lu(i),a]},useSyncExternalStore:cw,useId:Bw,useHostTransitionStatus:Jg,useFormState:ww,useActionState:ww,useOptimistic:function(i,a){var c=Rn();return pw(c,Zt,i,a)},useMemoCache:Wg,useCacheRefresh:Iw};tv.useEffectEvent=Rw;var Ww={readContext:cr,use:Lh,useCallback:Dw,useContext:cr,useEffect:Yg,useImperativeHandle:Aw,useInsertionEffect:Tw,useLayoutEffect:Nw,useMemo:jw,useReducer:qg,useRef:kw,useState:function(){return qg(js)},useDebugValue:Xg,useDeferredValue:function(i,a){var c=Rn();return Zt===null?Zg(c,i,a):Ow(c,Zt.memoizedState,i,a)},useTransition:function(){var i=qg(js)[0],a=Rn().memoizedState;return[typeof i=="boolean"?i:lu(i),a]},useSyncExternalStore:cw,useId:Bw,useHostTransitionStatus:Jg,useFormState:Cw,useActionState:Cw,useOptimistic:function(i,a){var c=Rn();return Zt!==null?pw(c,Zt,i,a):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:Wg,useCacheRefresh:Iw};Ww.useEffectEvent=Rw;function nv(i,a,c,m){a=i.memoizedState,c=c(m,a),c=c==null?a:p({},a,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var rv={enqueueSetState:function(i,a,c){i=i._reactInternals;var m=Jr(),_=So(m);_.payload=a,c!=null&&(_.callback=c),a=Co(i,_,m),a!==null&&(Ir(a,i,m),iu(a,i,m))},enqueueReplaceState:function(i,a,c){i=i._reactInternals;var m=Jr(),_=So(m);_.tag=1,_.payload=a,c!=null&&(_.callback=c),a=Co(i,_,m),a!==null&&(Ir(a,i,m),iu(a,i,m))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var c=Jr(),m=So(c);m.tag=2,a!=null&&(m.callback=a),a=Co(i,m,c),a!==null&&(Ir(a,i,c),iu(a,i,c))}};function Vw(i,a,c,m,_,x,T){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(m,x,T):a.prototype&&a.prototype.isPureReactComponent?!Xc(c,m)||!Xc(_,x):!0}function qw(i,a,c,m){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,m),a.state!==i&&rv.enqueueReplaceState(a,a.state,null)}function ka(i,a){var c=a;if("ref"in a){c={};for(var m in a)m!=="ref"&&(c[m]=a[m])}if(i=i.defaultProps){c===a&&(c=p({},c));for(var _ in i)c[_]===void 0&&(c[_]=i[_])}return c}function Kw(i){vh(i)}function Gw(i){console.error(i)}function Yw(i){vh(i)}function Fh(i,a){try{var c=i.onUncaughtError;c(a.value,{componentStack:a.stack})}catch(m){setTimeout(function(){throw m})}}function Xw(i,a,c){try{var m=i.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function iv(i,a,c){return c=So(c),c.tag=3,c.payload={element:null},c.callback=function(){Fh(i,a)},c}function Zw(i){return i=So(i),i.tag=3,i}function Qw(i,a,c,m){var _=c.type.getDerivedStateFromError;if(typeof _=="function"){var x=m.value;i.payload=function(){return _(x)},i.callback=function(){Xw(a,c,m)}}var T=c.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(i.callback=function(){Xw(a,c,m),typeof _!="function"&&(Mo===null?Mo=new Set([this]):Mo.add(this));var z=m.stack;this.componentDidCatch(m.value,{componentStack:z!==null?z:""})})}function _O(i,a,c,m,_){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(a=c.alternate,a!==null&&El(a,c,_,!0),c=Yr.current,c!==null){switch(c.tag){case 31:case 13:return vi===null?Qh():c.alternate===null&&wn===0&&(wn=3),c.flags&=-257,c.flags|=65536,c.lanes=_,m===Rh?c.flags|=16384:(a=c.updateQueue,a===null?c.updateQueue=new Set([m]):a.add(m),Nv(i,m,_)),!1;case 22:return c.flags|=65536,m===Rh?c.flags|=16384:(a=c.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=a):(c=a.retryQueue,c===null?a.retryQueue=new Set([m]):c.add(m)),Nv(i,m,_)),!1}throw Error(r(435,c.tag))}return Nv(i,m,_),Qh(),!1}if(Dt)return a=Yr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=_,m!==Sg&&(i=Error(r(422),{cause:m}),Jc(fi(i,c)))):(m!==Sg&&(a=Error(r(423),{cause:m}),Jc(fi(a,c))),i=i.current.alternate,i.flags|=65536,_&=-_,i.lanes|=_,m=fi(m,c),_=iv(i.stateNode,m,_),Og(i,_),wn!==4&&(wn=2)),!1;var x=Error(r(520),{cause:m});if(x=fi(x,c),bu===null?bu=[x]:bu.push(x),wn!==4&&(wn=2),a===null)return!0;m=fi(m,c),c=a;do{switch(c.tag){case 3:return c.flags|=65536,i=_&-_,c.lanes|=i,i=iv(c.stateNode,m,i),Og(c,i),!1;case 1:if(a=c.type,x=c.stateNode,(c.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Mo===null||!Mo.has(x))))return c.flags|=65536,_&=-_,c.lanes|=_,_=Zw(_),Qw(_,i,c,m),Og(c,_),!1}c=c.return}while(c!==null);return!1}var sv=Error(r(461)),jn=!1;function ur(i,a,c,m){a.child=i===null?nw(a,null,c,m):Sa(a,i.child,c,m)}function Jw(i,a,c,m,_){c=c.render;var x=a.ref;if("ref"in m){var T={};for(var z in m)z!=="ref"&&(T[z]=m[z])}else T=m;return _a(a),m=Fg(i,a,c,T,x,_),z=Hg(),i!==null&&!jn?(Ug(i,a,_),Os(i,a,_)):(Dt&&z&&xg(a),a.flags|=1,ur(i,a,m,_),a.child)}function eS(i,a,c,m,_){if(i===null){var x=c.type;return typeof x=="function"&&!bg(x)&&x.defaultProps===void 0&&c.compare===null?(a.tag=15,a.type=x,tS(i,a,x,m,_)):(i=xh(c.type,null,m,a,a.mode,_),i.ref=a.ref,i.return=a,a.child=i)}if(x=i.child,!fv(i,_)){var T=x.memoizedProps;if(c=c.compare,c=c!==null?c:Xc,c(T,m)&&i.ref===a.ref)return Os(i,a,_)}return a.flags|=1,i=Ts(x,m),i.ref=a.ref,i.return=a,a.child=i}function tS(i,a,c,m,_){if(i!==null){var x=i.memoizedProps;if(Xc(x,m)&&i.ref===a.ref)if(jn=!1,a.pendingProps=m=x,fv(i,_))(i.flags&131072)!==0&&(jn=!0);else return a.lanes=i.lanes,Os(i,a,_)}return ov(i,a,c,m,_)}function nS(i,a,c,m){var _=m.children,x=i!==null?i.memoizedState:null;if(i===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((a.flags&128)!==0){if(x=x!==null?x.baseLanes|c:c,i!==null){for(m=a.child=i.child,_=0;m!==null;)_=_|m.lanes|m.childLanes,m=m.sibling;m=_&~x}else m=0,a.child=null;return rS(i,a,x,c,m)}if((c&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},i!==null&&kh(a,x!==null?x.cachePool:null),x!==null?sw(a,x):zg(),ow(a);else return m=a.lanes=536870912,rS(i,a,x!==null?x.baseLanes|c:c,c,m)}else x!==null?(kh(a,x.cachePool),sw(a,x),Eo(),a.memoizedState=null):(i!==null&&kh(a,null),zg(),Eo());return ur(i,a,_,c),a.child}function du(i,a){return i!==null&&i.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function rS(i,a,c,m,_){var x=Mg();return x=x===null?null:{parent:An._currentValue,pool:x},a.memoizedState={baseLanes:c,cachePool:x},i!==null&&kh(a,null),zg(),ow(a),i!==null&&El(i,a,m,!0),a.childLanes=_,null}function Hh(i,a){return a=$h({mode:a.mode,children:a.children},i.mode),a.ref=i.ref,i.child=a,a.return=i,a}function iS(i,a,c){return Sa(a,i.child,null,c),i=Hh(a,a.pendingProps),i.flags|=2,Xr(a),a.memoizedState=null,i}function yO(i,a,c){var m=a.pendingProps,_=(a.flags&128)!==0;if(a.flags&=-129,i===null){if(Dt){if(m.mode==="hidden")return i=Hh(a,m),a.lanes=536870912,du(null,i);if(Bg(a),(i=ln)?(i=gC(i,gi),i=i!==null&&i.data==="&"?i:null,i!==null&&(a.memoizedState={dehydrated:i,treeContext:bo!==null?{id:Qi,overflow:Ji}:null,retryLane:536870912,hydrationErrors:null},c=H1(i),c.return=a,a.child=c,lr=a,ln=null)):i=null,i===null)throw yo(a);return a.lanes=536870912,null}return Hh(a,m)}var x=i.memoizedState;if(x!==null){var T=x.dehydrated;if(Bg(a),_)if(a.flags&256)a.flags&=-257,a=iS(i,a,c);else if(a.memoizedState!==null)a.child=i.child,a.flags|=128,a=null;else throw Error(r(558));else if(jn||El(i,a,c,!1),_=(c&i.childLanes)!==0,jn||_){if(m=rn,m!==null&&(T=je(m,c),T!==0&&T!==x.retryLane))throw x.retryLane=T,pa(i,T),Ir(m,i,T),sv;Qh(),a=iS(i,a,c)}else i=x.treeContext,ln=bi(T.nextSibling),lr=a,Dt=!0,_o=null,gi=!1,i!==null&&W1(a,i),a=Hh(a,m),a.flags|=4096;return a}return i=Ts(i.child,{mode:m.mode,children:m.children}),i.ref=a.ref,a.child=i,i.return=a,i}function Uh(i,a){var c=a.ref;if(c===null)i!==null&&i.ref!==null&&(a.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(a.flags|=4194816)}}function ov(i,a,c,m,_){return _a(a),c=Fg(i,a,c,m,void 0,_),m=Hg(),i!==null&&!jn?(Ug(i,a,_),Os(i,a,_)):(Dt&&m&&xg(a),a.flags|=1,ur(i,a,c,_),a.child)}function sS(i,a,c,m,_,x){return _a(a),a.updateQueue=null,c=lw(a,m,c,_),aw(i),m=Hg(),i!==null&&!jn?(Ug(i,a,x),Os(i,a,x)):(Dt&&m&&xg(a),a.flags|=1,ur(i,a,c,x),a.child)}function oS(i,a,c,m,_){if(_a(a),a.stateNode===null){var x=wl,T=c.contextType;typeof T=="object"&&T!==null&&(x=cr(T)),x=new c(m,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=rv,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=m,x.state=a.memoizedState,x.refs={},Dg(a),T=c.contextType,x.context=typeof T=="object"&&T!==null?cr(T):wl,x.state=a.memoizedState,T=c.getDerivedStateFromProps,typeof T=="function"&&(nv(a,c,T,m),x.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(T=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),T!==x.state&&rv.enqueueReplaceState(x,x.state,null),ou(a,m,x,_),su(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),m=!0}else if(i===null){x=a.stateNode;var z=a.memoizedProps,Z=ka(c,z);x.props=Z;var le=x.context,ve=c.contextType;T=wl,typeof ve=="object"&&ve!==null&&(T=cr(ve));var _e=c.getDerivedStateFromProps;ve=typeof _e=="function"||typeof x.getSnapshotBeforeUpdate=="function",z=a.pendingProps!==z,ve||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(z||le!==T)&&qw(a,x,m,T),wo=!1;var ce=a.memoizedState;x.state=ce,ou(a,m,x,_),su(),le=a.memoizedState,z||ce!==le||wo?(typeof _e=="function"&&(nv(a,c,_e,m),le=a.memoizedState),(Z=wo||Vw(a,c,Z,m,ce,le,T))?(ve||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(a.flags|=4194308)):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=le),x.props=m,x.state=le,x.context=T,m=Z):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{x=a.stateNode,jg(i,a),T=a.memoizedProps,ve=ka(c,T),x.props=ve,_e=a.pendingProps,ce=x.context,le=c.contextType,Z=wl,typeof le=="object"&&le!==null&&(Z=cr(le)),z=c.getDerivedStateFromProps,(le=typeof z=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T!==_e||ce!==Z)&&qw(a,x,m,Z),wo=!1,ce=a.memoizedState,x.state=ce,ou(a,m,x,_),su();var de=a.memoizedState;T!==_e||ce!==de||wo||i!==null&&i.dependencies!==null&&Sh(i.dependencies)?(typeof z=="function"&&(nv(a,c,z,m),de=a.memoizedState),(ve=wo||Vw(a,c,ve,m,ce,de,Z)||i!==null&&i.dependencies!==null&&Sh(i.dependencies))?(le||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(m,de,Z),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(m,de,Z)),typeof x.componentDidUpdate=="function"&&(a.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof x.componentDidUpdate!="function"||T===i.memoizedProps&&ce===i.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===i.memoizedProps&&ce===i.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=de),x.props=m,x.state=de,x.context=Z,m=ve):(typeof x.componentDidUpdate!="function"||T===i.memoizedProps&&ce===i.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===i.memoizedProps&&ce===i.memoizedState||(a.flags|=1024),m=!1)}return x=m,Uh(i,a),m=(a.flags&128)!==0,x||m?(x=a.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,i!==null&&m?(a.child=Sa(a,i.child,null,_),a.child=Sa(a,null,c,_)):ur(i,a,c,_),a.memoizedState=x.state,i=a.child):i=Os(i,a,_),i}function aS(i,a,c,m){return va(),a.flags|=256,ur(i,a,c,m),a.child}var av={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lv(i){return{baseLanes:i,cachePool:X1()}}function cv(i,a,c){return i=i!==null?i.childLanes&~c:0,a&&(i|=Qr),i}function lS(i,a,c){var m=a.pendingProps,_=!1,x=(a.flags&128)!==0,T;if((T=x)||(T=i!==null&&i.memoizedState===null?!1:(En.current&2)!==0),T&&(_=!0,a.flags&=-129),T=(a.flags&32)!==0,a.flags&=-33,i===null){if(Dt){if(_?ko(a):Eo(),(i=ln)?(i=gC(i,gi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(a.memoizedState={dehydrated:i,treeContext:bo!==null?{id:Qi,overflow:Ji}:null,retryLane:536870912,hydrationErrors:null},c=H1(i),c.return=a,a.child=c,lr=a,ln=null)):i=null,i===null)throw yo(a);return Vv(i)?a.lanes=32:a.lanes=536870912,null}var z=m.children;return m=m.fallback,_?(Eo(),_=a.mode,z=$h({mode:"hidden",children:z},_),m=ga(m,_,c,null),z.return=a,m.return=a,z.sibling=m,a.child=z,m=a.child,m.memoizedState=lv(c),m.childLanes=cv(i,T,c),a.memoizedState=av,du(null,m)):(ko(a),uv(a,z))}var Z=i.memoizedState;if(Z!==null&&(z=Z.dehydrated,z!==null)){if(x)a.flags&256?(ko(a),a.flags&=-257,a=dv(i,a,c)):a.memoizedState!==null?(Eo(),a.child=i.child,a.flags|=128,a=null):(Eo(),z=m.fallback,_=a.mode,m=$h({mode:"visible",children:m.children},_),z=ga(z,_,c,null),z.flags|=2,m.return=a,z.return=a,m.sibling=z,a.child=m,Sa(a,i.child,null,c),m=a.child,m.memoizedState=lv(c),m.childLanes=cv(i,T,c),a.memoizedState=av,a=du(null,m));else if(ko(a),Vv(z)){if(T=z.nextSibling&&z.nextSibling.dataset,T)var le=T.dgst;T=le,m=Error(r(419)),m.stack="",m.digest=T,Jc({value:m,source:null,stack:null}),a=dv(i,a,c)}else if(jn||El(i,a,c,!1),T=(c&i.childLanes)!==0,jn||T){if(T=rn,T!==null&&(m=je(T,c),m!==0&&m!==Z.retryLane))throw Z.retryLane=m,pa(i,m),Ir(T,i,m),sv;Wv(z)||Qh(),a=dv(i,a,c)}else Wv(z)?(a.flags|=192,a.child=i.child,a=null):(i=Z.treeContext,ln=bi(z.nextSibling),lr=a,Dt=!0,_o=null,gi=!1,i!==null&&W1(a,i),a=uv(a,m.children),a.flags|=4096);return a}return _?(Eo(),z=m.fallback,_=a.mode,Z=i.child,le=Z.sibling,m=Ts(Z,{mode:"hidden",children:m.children}),m.subtreeFlags=Z.subtreeFlags&65011712,le!==null?z=Ts(le,z):(z=ga(z,_,c,null),z.flags|=2),z.return=a,m.return=a,m.sibling=z,a.child=m,du(null,m),m=a.child,z=i.child.memoizedState,z===null?z=lv(c):(_=z.cachePool,_!==null?(Z=An._currentValue,_=_.parent!==Z?{parent:Z,pool:Z}:_):_=X1(),z={baseLanes:z.baseLanes|c,cachePool:_}),m.memoizedState=z,m.childLanes=cv(i,T,c),a.memoizedState=av,du(i.child,m)):(ko(a),c=i.child,i=c.sibling,c=Ts(c,{mode:"visible",children:m.children}),c.return=a,c.sibling=null,i!==null&&(T=a.deletions,T===null?(a.deletions=[i],a.flags|=16):T.push(i)),a.child=c,a.memoizedState=null,c)}function uv(i,a){return a=$h({mode:"visible",children:a},i.mode),a.return=i,i.child=a}function $h(i,a){return i=Gr(22,i,null,a),i.lanes=0,i}function dv(i,a,c){return Sa(a,i.child,null,c),i=uv(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function cS(i,a,c){i.lanes|=a;var m=i.alternate;m!==null&&(m.lanes|=a),Eg(i.return,a,c)}function hv(i,a,c,m,_,x){var T=i.memoizedState;T===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:_,treeForkCount:x}:(T.isBackwards=a,T.rendering=null,T.renderingStartTime=0,T.last=m,T.tail=c,T.tailMode=_,T.treeForkCount=x)}function uS(i,a,c){var m=a.pendingProps,_=m.revealOrder,x=m.tail;m=m.children;var T=En.current,z=(T&2)!==0;if(z?(T=T&1|2,a.flags|=128):T&=1,N(En,T),ur(i,a,m,c),m=Dt?Qc:0,!z&&i!==null&&(i.flags&128)!==0)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&cS(i,c,a);else if(i.tag===19)cS(i,c,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(_){case"forwards":for(c=a.child,_=null;c!==null;)i=c.alternate,i!==null&&Ah(i)===null&&(_=c),c=c.sibling;c=_,c===null?(_=a.child,a.child=null):(_=c.sibling,c.sibling=null),hv(a,!1,_,c,x,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,_=a.child,a.child=null;_!==null;){if(i=_.alternate,i!==null&&Ah(i)===null){a.child=_;break}i=_.sibling,_.sibling=c,c=_,_=i}hv(a,!0,c,null,x,m);break;case"together":hv(a,!1,null,null,void 0,m);break;default:a.memoizedState=null}return a.child}function Os(i,a,c){if(i!==null&&(a.dependencies=i.dependencies),No|=a.lanes,(c&a.childLanes)===0)if(i!==null){if(El(i,a,c,!1),(c&a.childLanes)===0)return null}else return null;if(i!==null&&a.child!==i.child)throw Error(r(153));if(a.child!==null){for(i=a.child,c=Ts(i,i.pendingProps),a.child=c,c.return=a;i.sibling!==null;)i=i.sibling,c=c.sibling=Ts(i,i.pendingProps),c.return=a;c.sibling=null}return a.child}function fv(i,a){return(i.lanes&a)!==0?!0:(i=i.dependencies,!!(i!==null&&Sh(i)))}function xO(i,a,c){switch(a.tag){case 3:ue(a,a.stateNode.containerInfo),xo(a,An,i.memoizedState.cache),va();break;case 27:case 5:ge(a);break;case 4:ue(a,a.stateNode.containerInfo);break;case 10:xo(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Bg(a),null;break;case 13:var m=a.memoizedState;if(m!==null)return m.dehydrated!==null?(ko(a),a.flags|=128,null):(c&a.child.childLanes)!==0?lS(i,a,c):(ko(a),i=Os(i,a,c),i!==null?i.sibling:null);ko(a);break;case 19:var _=(i.flags&128)!==0;if(m=(c&a.childLanes)!==0,m||(El(i,a,c,!1),m=(c&a.childLanes)!==0),_){if(m)return uS(i,a,c);a.flags|=128}if(_=a.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),N(En,En.current),m)break;return null;case 22:return a.lanes=0,nS(i,a,c,a.pendingProps);case 24:xo(a,An,i.memoizedState.cache)}return Os(i,a,c)}function dS(i,a,c){if(i!==null)if(i.memoizedProps!==a.pendingProps)jn=!0;else{if(!fv(i,c)&&(a.flags&128)===0)return jn=!1,xO(i,a,c);jn=(i.flags&131072)!==0}else jn=!1,Dt&&(a.flags&1048576)!==0&&$1(a,Qc,a.index);switch(a.lanes=0,a.tag){case 16:e:{var m=a.pendingProps;if(i=xa(a.elementType),a.type=i,typeof i=="function")bg(i)?(m=ka(i,m),a.tag=1,a=oS(null,a,i,m,c)):(a.tag=0,a=ov(null,a,i,m,c));else{if(i!=null){var _=i.$$typeof;if(_===M){a.tag=11,a=Jw(null,a,i,m,c);break e}else if(_===D){a.tag=14,a=eS(null,a,i,m,c);break e}}throw a=F(i)||i,Error(r(306,a,""))}}return a;case 0:return ov(i,a,a.type,a.pendingProps,c);case 1:return m=a.type,_=ka(m,a.pendingProps),oS(i,a,m,_,c);case 3:e:{if(ue(a,a.stateNode.containerInfo),i===null)throw Error(r(387));m=a.pendingProps;var x=a.memoizedState;_=x.element,jg(i,a),ou(a,m,null,c);var T=a.memoizedState;if(m=T.cache,xo(a,An,m),m!==x.cache&&Rg(a,[An],c,!0),su(),m=T.element,x.isDehydrated)if(x={element:m,isDehydrated:!1,cache:T.cache},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){a=aS(i,a,m,c);break e}else if(m!==_){_=fi(Error(r(424)),a),Jc(_),a=aS(i,a,m,c);break e}else{switch(i=a.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(ln=bi(i.firstChild),lr=a,Dt=!0,_o=null,gi=!0,c=nw(a,null,m,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(va(),m===_){a=Os(i,a,c);break e}ur(i,a,m,c)}a=a.child}return a;case 26:return Uh(i,a),i===null?(c=wC(a.type,null,a.pendingProps,null))?a.memoizedState=c:Dt||(c=a.type,i=a.pendingProps,m=of(J.current).createElement(c),m[K]=a,m[Ie]=i,dr(m,c,i),Mn(m),a.stateNode=m):a.memoizedState=wC(a.type,i.memoizedProps,a.pendingProps,i.memoizedState),null;case 27:return ge(a),i===null&&Dt&&(m=a.stateNode=_C(a.type,a.pendingProps,J.current),lr=a,gi=!0,_=ln,Oo(a.type)?(qv=_,ln=bi(m.firstChild)):ln=_),ur(i,a,a.pendingProps.children,c),Uh(i,a),i===null&&(a.flags|=4194304),a.child;case 5:return i===null&&Dt&&((_=m=ln)&&(m=ZO(m,a.type,a.pendingProps,gi),m!==null?(a.stateNode=m,lr=a,ln=bi(m.firstChild),gi=!1,_=!0):_=!1),_||yo(a)),ge(a),_=a.type,x=a.pendingProps,T=i!==null?i.memoizedProps:null,m=x.children,Hv(_,x)?m=null:T!==null&&Hv(_,T)&&(a.flags|=32),a.memoizedState!==null&&(_=Fg(i,a,hO,null,null,c),Eu._currentValue=_),Uh(i,a),ur(i,a,m,c),a.child;case 6:return i===null&&Dt&&((i=c=ln)&&(c=QO(c,a.pendingProps,gi),c!==null?(a.stateNode=c,lr=a,ln=null,i=!0):i=!1),i||yo(a)),null;case 13:return lS(i,a,c);case 4:return ue(a,a.stateNode.containerInfo),m=a.pendingProps,i===null?a.child=Sa(a,null,m,c):ur(i,a,m,c),a.child;case 11:return Jw(i,a,a.type,a.pendingProps,c);case 7:return ur(i,a,a.pendingProps,c),a.child;case 8:return ur(i,a,a.pendingProps.children,c),a.child;case 12:return ur(i,a,a.pendingProps.children,c),a.child;case 10:return m=a.pendingProps,xo(a,a.type,m.value),ur(i,a,m.children,c),a.child;case 9:return _=a.type._context,m=a.pendingProps.children,_a(a),_=cr(_),m=m(_),a.flags|=1,ur(i,a,m,c),a.child;case 14:return eS(i,a,a.type,a.pendingProps,c);case 15:return tS(i,a,a.type,a.pendingProps,c);case 19:return uS(i,a,c);case 31:return yO(i,a,c);case 22:return nS(i,a,c,a.pendingProps);case 24:return _a(a),m=cr(An),i===null?(_=Mg(),_===null&&(_=rn,x=Tg(),_.pooledCache=x,x.refCount++,x!==null&&(_.pooledCacheLanes|=c),_=x),a.memoizedState={parent:m,cache:_},Dg(a),xo(a,An,_)):((i.lanes&c)!==0&&(jg(i,a),ou(a,null,null,c),su()),_=i.memoizedState,x=a.memoizedState,_.parent!==m?(_={parent:m,cache:m},a.memoizedState=_,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=_),xo(a,An,m)):(m=x.cache,xo(a,An,m),m!==_.cache&&Rg(a,[An],c,!0))),ur(i,a,a.pendingProps.children,c),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Ls(i){i.flags|=4}function mv(i,a,c,m,_){if((a=(i.mode&32)!==0)&&(a=!1),a){if(i.flags|=16777216,(_&335544128)===_)if(i.stateNode.complete)i.flags|=8192;else if(BS())i.flags|=8192;else throw wa=Rh,Ag}else i.flags&=-16777217}function hS(i,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!RC(a))if(BS())i.flags|=8192;else throw wa=Rh,Ag}function Wh(i,a){a!==null&&(i.flags|=4),i.flags&16384&&(a=i.tag!==22?gt():536870912,i.lanes|=a,Bl|=a)}function hu(i,a){if(!Dt)switch(i.tailMode){case"hidden":a=i.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:m.sibling=null}}function cn(i){var a=i.alternate!==null&&i.alternate.child===i.child,c=0,m=0;if(a)for(var _=i.child;_!==null;)c|=_.lanes|_.childLanes,m|=_.subtreeFlags&65011712,m|=_.flags&65011712,_.return=i,_=_.sibling;else for(_=i.child;_!==null;)c|=_.lanes|_.childLanes,m|=_.subtreeFlags,m|=_.flags,_.return=i,_=_.sibling;return i.subtreeFlags|=m,i.childLanes=c,a}function wO(i,a,c){var m=a.pendingProps;switch(wg(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(a),null;case 1:return cn(a),null;case 3:return c=a.stateNode,m=null,i!==null&&(m=i.memoizedState.cache),a.memoizedState.cache!==m&&(a.flags|=2048),As(An),he(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(kl(a)?Ls(a):i===null||i.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Cg())),cn(a),null;case 26:var _=a.type,x=a.memoizedState;return i===null?(Ls(a),x!==null?(cn(a),hS(a,x)):(cn(a),mv(a,_,null,m,c))):x?x!==i.memoizedState?(Ls(a),cn(a),hS(a,x)):(cn(a),a.flags&=-16777217):(i=i.memoizedProps,i!==m&&Ls(a),cn(a),mv(a,_,i,m,c)),null;case 27:if(ke(a),c=J.current,_=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==m&&Ls(a);else{if(!m){if(a.stateNode===null)throw Error(r(166));return cn(a),null}i=ne.current,kl(a)?V1(a):(i=_C(_,m,c),a.stateNode=i,Ls(a))}return cn(a),null;case 5:if(ke(a),_=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==m&&Ls(a);else{if(!m){if(a.stateNode===null)throw Error(r(166));return cn(a),null}if(x=ne.current,kl(a))V1(a);else{var T=of(J.current);switch(x){case 1:x=T.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:x=T.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":x=T.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":x=T.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":x=T.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof m.is=="string"?T.createElement("select",{is:m.is}):T.createElement("select"),m.multiple?x.multiple=!0:m.size&&(x.size=m.size);break;default:x=typeof m.is=="string"?T.createElement(_,{is:m.is}):T.createElement(_)}}x[K]=a,x[Ie]=m;e:for(T=a.child;T!==null;){if(T.tag===5||T.tag===6)x.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===a)break e;for(;T.sibling===null;){if(T.return===null||T.return===a)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}a.stateNode=x;e:switch(dr(x,_,m),_){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Ls(a)}}return cn(a),mv(a,a.type,i===null?null:i.memoizedProps,a.pendingProps,c),null;case 6:if(i&&a.stateNode!=null)i.memoizedProps!==m&&Ls(a);else{if(typeof m!="string"&&a.stateNode===null)throw Error(r(166));if(i=J.current,kl(a)){if(i=a.stateNode,c=a.memoizedProps,m=null,_=lr,_!==null)switch(_.tag){case 27:case 5:m=_.memoizedProps}i[K]=a,i=!!(i.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||lC(i.nodeValue,c)),i||yo(a,!0)}else i=of(i).createTextNode(m),i[K]=a,a.stateNode=i}return cn(a),null;case 31:if(c=a.memoizedState,i===null||i.memoizedState!==null){if(m=kl(a),c!==null){if(i===null){if(!m)throw Error(r(318));if(i=a.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[K]=a}else va(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;cn(a),i=!1}else c=Cg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return a.flags&256?(Xr(a),a):(Xr(a),null);if((a.flags&128)!==0)throw Error(r(558))}return cn(a),null;case 13:if(m=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(_=kl(a),m!==null&&m.dehydrated!==null){if(i===null){if(!_)throw Error(r(318));if(_=a.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[K]=a}else va(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;cn(a),_=!1}else _=Cg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=_),_=!0;if(!_)return a.flags&256?(Xr(a),a):(Xr(a),null)}return Xr(a),(a.flags&128)!==0?(a.lanes=c,a):(c=m!==null,i=i!==null&&i.memoizedState!==null,c&&(m=a.child,_=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(_=m.alternate.memoizedState.cachePool.pool),x=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(x=m.memoizedState.cachePool.pool),x!==_&&(m.flags|=2048)),c!==i&&c&&(a.child.flags|=8192),Wh(a,a.updateQueue),cn(a),null);case 4:return he(),i===null&&zv(a.stateNode.containerInfo),cn(a),null;case 10:return As(a.type),cn(a),null;case 19:if(X(En),m=a.memoizedState,m===null)return cn(a),null;if(_=(a.flags&128)!==0,x=m.rendering,x===null)if(_)hu(m,!1);else{if(wn!==0||i!==null&&(i.flags&128)!==0)for(i=a.child;i!==null;){if(x=Ah(i),x!==null){for(a.flags|=128,hu(m,!1),i=x.updateQueue,a.updateQueue=i,Wh(a,i),a.subtreeFlags=0,i=c,c=a.child;c!==null;)F1(c,i),c=c.sibling;return N(En,En.current&1|2),Dt&&Ns(a,m.treeForkCount),a.child}i=i.sibling}m.tail!==null&&Se()>Yh&&(a.flags|=128,_=!0,hu(m,!1),a.lanes=4194304)}else{if(!_)if(i=Ah(x),i!==null){if(a.flags|=128,_=!0,i=i.updateQueue,a.updateQueue=i,Wh(a,i),hu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!x.alternate&&!Dt)return cn(a),null}else 2*Se()-m.renderingStartTime>Yh&&c!==536870912&&(a.flags|=128,_=!0,hu(m,!1),a.lanes=4194304);m.isBackwards?(x.sibling=a.child,a.child=x):(i=m.last,i!==null?i.sibling=x:a.child=x,m.last=x)}return m.tail!==null?(i=m.tail,m.rendering=i,m.tail=i.sibling,m.renderingStartTime=Se(),i.sibling=null,c=En.current,N(En,_?c&1|2:c&1),Dt&&Ns(a,m.treeForkCount),i):(cn(a),null);case 22:case 23:return Xr(a),Pg(),m=a.memoizedState!==null,i!==null?i.memoizedState!==null!==m&&(a.flags|=8192):m&&(a.flags|=8192),m?(c&536870912)!==0&&(a.flags&128)===0&&(cn(a),a.subtreeFlags&6&&(a.flags|=8192)):cn(a),c=a.updateQueue,c!==null&&Wh(a,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),m=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(m=a.memoizedState.cachePool.pool),m!==c&&(a.flags|=2048),i!==null&&X(ya),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),As(An),cn(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function SO(i,a){switch(wg(a),a.tag){case 1:return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return As(An),he(),i=a.flags,(i&65536)!==0&&(i&128)===0?(a.flags=i&-65537|128,a):null;case 26:case 27:case 5:return ke(a),null;case 31:if(a.memoizedState!==null){if(Xr(a),a.alternate===null)throw Error(r(340));va()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 13:if(Xr(a),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(r(340));va()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return X(En),null;case 4:return he(),null;case 10:return As(a.type),null;case 22:case 23:return Xr(a),Pg(),i!==null&&X(ya),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 24:return As(An),null;case 25:return null;default:return null}}function fS(i,a){switch(wg(a),a.tag){case 3:As(An),he();break;case 26:case 27:case 5:ke(a);break;case 4:he();break;case 31:a.memoizedState!==null&&Xr(a);break;case 13:Xr(a);break;case 19:X(En);break;case 10:As(a.type);break;case 22:case 23:Xr(a),Pg(),i!==null&&X(ya);break;case 24:As(An)}}function fu(i,a){try{var c=a.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var _=m.next;c=_;do{if((c.tag&i)===i){m=void 0;var x=c.create,T=c.inst;m=x(),T.destroy=m}c=c.next}while(c!==_)}}catch(z){qt(a,a.return,z)}}function Ro(i,a,c){try{var m=a.updateQueue,_=m!==null?m.lastEffect:null;if(_!==null){var x=_.next;m=x;do{if((m.tag&i)===i){var T=m.inst,z=T.destroy;if(z!==void 0){T.destroy=void 0,_=a;var Z=c,le=z;try{le()}catch(ve){qt(_,Z,ve)}}}m=m.next}while(m!==x)}}catch(ve){qt(a,a.return,ve)}}function mS(i){var a=i.updateQueue;if(a!==null){var c=i.stateNode;try{iw(a,c)}catch(m){qt(i,i.return,m)}}}function pS(i,a,c){c.props=ka(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(m){qt(i,a,m)}}function mu(i,a){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var m=i.stateNode;break;case 30:m=i.stateNode;break;default:m=i.stateNode}typeof c=="function"?i.refCleanup=c(m):c.current=m}}catch(_){qt(i,a,_)}}function es(i,a){var c=i.ref,m=i.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(_){qt(i,a,_)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(_){qt(i,a,_)}else c.current=null}function gS(i){var a=i.type,c=i.memoizedProps,m=i.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(_){qt(i,i.return,_)}}function pv(i,a,c){try{var m=i.stateNode;VO(m,i.type,c,a),m[Ie]=a}catch(_){qt(i,i.return,_)}}function vS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Oo(i.type)||i.tag===4}function gv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||vS(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&&Oo(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 vv(i,a,c){var m=i.tag;if(m===5||m===6)i=i.stateNode,a?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,a):(a=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,a.appendChild(i),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=Es));else if(m!==4&&(m===27&&Oo(i.type)&&(c=i.stateNode,a=null),i=i.child,i!==null))for(vv(i,a,c),i=i.sibling;i!==null;)vv(i,a,c),i=i.sibling}function Vh(i,a,c){var m=i.tag;if(m===5||m===6)i=i.stateNode,a?c.insertBefore(i,a):c.appendChild(i);else if(m!==4&&(m===27&&Oo(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Vh(i,a,c),i=i.sibling;i!==null;)Vh(i,a,c),i=i.sibling}function bS(i){var a=i.stateNode,c=i.memoizedProps;try{for(var m=i.type,_=a.attributes;_.length;)a.removeAttributeNode(_[0]);dr(a,m,c),a[K]=i,a[Ie]=c}catch(x){qt(i,i.return,x)}}var zs=!1,On=!1,bv=!1,_S=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function CO(i,a){if(i=i.containerInfo,Iv=ff,i=A1(i),dg(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var _=m.anchorOffset,x=m.focusNode;m=m.focusOffset;try{c.nodeType,x.nodeType}catch{c=null;break e}var T=0,z=-1,Z=-1,le=0,ve=0,_e=i,ce=null;t:for(;;){for(var de;_e!==c||_!==0&&_e.nodeType!==3||(z=T+_),_e!==x||m!==0&&_e.nodeType!==3||(Z=T+m),_e.nodeType===3&&(T+=_e.nodeValue.length),(de=_e.firstChild)!==null;)ce=_e,_e=de;for(;;){if(_e===i)break t;if(ce===c&&++le===_&&(z=T),ce===x&&++ve===m&&(Z=T),(de=_e.nextSibling)!==null)break;_e=ce,ce=_e.parentNode}_e=de}c=z===-1||Z===-1?null:{start:z,end:Z}}else c=null}c=c||{start:0,end:0}}else c=null;for(Fv={focusedElem:i,selectionRange:c},ff=!1,Xn=a;Xn!==null;)if(a=Xn,i=a.child,(a.subtreeFlags&1028)!==0&&i!==null)i.return=a,Xn=i;else for(;Xn!==null;){switch(a=Xn,x=a.alternate,i=a.flags,a.tag){case 0:if((i&4)!==0&&(i=a.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)_=i[c],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,c=a,_=x.memoizedProps,x=x.memoizedState,m=c.stateNode;try{var $e=ka(c.type,_);i=m.getSnapshotBeforeUpdate($e,x),m.__reactInternalSnapshotBeforeUpdate=i}catch(tt){qt(c,c.return,tt)}}break;case 3:if((i&1024)!==0){if(i=a.stateNode.containerInfo,c=i.nodeType,c===9)$v(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":$v(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=a.sibling,i!==null){i.return=a.return,Xn=i;break}Xn=a.return}}function yS(i,a,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:Bs(i,c),m&4&&fu(5,c);break;case 1:if(Bs(i,c),m&4)if(i=c.stateNode,a===null)try{i.componentDidMount()}catch(T){qt(c,c.return,T)}else{var _=ka(c.type,a.memoizedProps);a=a.memoizedState;try{i.componentDidUpdate(_,a,i.__reactInternalSnapshotBeforeUpdate)}catch(T){qt(c,c.return,T)}}m&64&&mS(c),m&512&&mu(c,c.return);break;case 3:if(Bs(i,c),m&64&&(i=c.updateQueue,i!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{iw(i,a)}catch(T){qt(c,c.return,T)}}break;case 27:a===null&&m&4&&bS(c);case 26:case 5:Bs(i,c),a===null&&m&4&&gS(c),m&512&&mu(c,c.return);break;case 12:Bs(i,c);break;case 31:Bs(i,c),m&4&&SS(i,c);break;case 13:Bs(i,c),m&4&&CS(i,c),m&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=jO.bind(null,c),JO(i,c))));break;case 22:if(m=c.memoizedState!==null||zs,!m){a=a!==null&&a.memoizedState!==null||On,_=zs;var x=On;zs=m,(On=a)&&!x?Is(i,c,(c.subtreeFlags&8772)!==0):Bs(i,c),zs=_,On=x}break;case 30:break;default:Bs(i,c)}}function xS(i){var a=i.alternate;a!==null&&(i.alternate=null,xS(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&Hc(a)),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 dn=null,Lr=!1;function Ps(i,a,c){for(c=c.child;c!==null;)wS(i,a,c),c=c.sibling}function wS(i,a,c){if(Ke&&typeof Ke.onCommitFiberUnmount=="function")try{Ke.onCommitFiberUnmount(Le,c)}catch{}switch(c.tag){case 26:On||es(c,a),Ps(i,a,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:On||es(c,a);var m=dn,_=Lr;Oo(c.type)&&(dn=c.stateNode,Lr=!1),Ps(i,a,c),Su(c.stateNode),dn=m,Lr=_;break;case 5:On||es(c,a);case 6:if(m=dn,_=Lr,dn=null,Ps(i,a,c),dn=m,Lr=_,dn!==null)if(Lr)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(c.stateNode)}catch(x){qt(c,a,x)}else try{dn.removeChild(c.stateNode)}catch(x){qt(c,a,x)}break;case 18:dn!==null&&(Lr?(i=dn,mC(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),ql(i)):mC(dn,c.stateNode));break;case 4:m=dn,_=Lr,dn=c.stateNode.containerInfo,Lr=!0,Ps(i,a,c),dn=m,Lr=_;break;case 0:case 11:case 14:case 15:Ro(2,c,a),On||Ro(4,c,a),Ps(i,a,c);break;case 1:On||(es(c,a),m=c.stateNode,typeof m.componentWillUnmount=="function"&&pS(c,a,m)),Ps(i,a,c);break;case 21:Ps(i,a,c);break;case 22:On=(m=On)||c.memoizedState!==null,Ps(i,a,c),On=m;break;default:Ps(i,a,c)}}function SS(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ql(i)}catch(c){qt(a,a.return,c)}}}function CS(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ql(i)}catch(c){qt(a,a.return,c)}}function kO(i){switch(i.tag){case 31:case 13:case 19:var a=i.stateNode;return a===null&&(a=i.stateNode=new _S),a;case 22:return i=i.stateNode,a=i._retryCache,a===null&&(a=i._retryCache=new _S),a;default:throw Error(r(435,i.tag))}}function qh(i,a){var c=kO(i);a.forEach(function(m){if(!c.has(m)){c.add(m);var _=OO.bind(null,i,m);m.then(_,_)}})}function zr(i,a){var c=a.deletions;if(c!==null)for(var m=0;m<c.length;m++){var _=c[m],x=i,T=a,z=T;e:for(;z!==null;){switch(z.tag){case 27:if(Oo(z.type)){dn=z.stateNode,Lr=!1;break e}break;case 5:dn=z.stateNode,Lr=!1;break e;case 3:case 4:dn=z.stateNode.containerInfo,Lr=!0;break e}z=z.return}if(dn===null)throw Error(r(160));wS(x,T,_),dn=null,Lr=!1,x=_.alternate,x!==null&&(x.return=null),_.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)kS(a,i),a=a.sibling}var Pi=null;function kS(i,a){var c=i.alternate,m=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:zr(a,i),Pr(i),m&4&&(Ro(3,i,i.return),fu(3,i),Ro(5,i,i.return));break;case 1:zr(a,i),Pr(i),m&512&&(On||c===null||es(c,c.return)),m&64&&zs&&(i=i.updateQueue,i!==null&&(m=i.callbacks,m!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var _=Pi;if(zr(a,i),Pr(i),m&512&&(On||c===null||es(c,c.return)),m&4){var x=c!==null?c.memoizedState:null;if(m=i.memoizedState,c===null)if(m===null)if(i.stateNode===null){e:{m=i.type,c=i.memoizedProps,_=_.ownerDocument||_;t:switch(m){case"title":x=_.getElementsByTagName("title")[0],(!x||x[Ss]||x[K]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=_.createElement(m),_.head.insertBefore(x,_.querySelector("head > title"))),dr(x,m,c),x[K]=i,Mn(x),m=x;break e;case"link":var T=kC("link","href",_).get(m+(c.href||""));if(T){for(var z=0;z<T.length;z++)if(x=T[z],x.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&x.getAttribute("rel")===(c.rel==null?null:c.rel)&&x.getAttribute("title")===(c.title==null?null:c.title)&&x.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){T.splice(z,1);break t}}x=_.createElement(m),dr(x,m,c),_.head.appendChild(x);break;case"meta":if(T=kC("meta","content",_).get(m+(c.content||""))){for(z=0;z<T.length;z++)if(x=T[z],x.getAttribute("content")===(c.content==null?null:""+c.content)&&x.getAttribute("name")===(c.name==null?null:c.name)&&x.getAttribute("property")===(c.property==null?null:c.property)&&x.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&x.getAttribute("charset")===(c.charSet==null?null:c.charSet)){T.splice(z,1);break t}}x=_.createElement(m),dr(x,m,c),_.head.appendChild(x);break;default:throw Error(r(468,m))}x[K]=i,Mn(x),m=x}i.stateNode=m}else EC(_,i.type,i.stateNode);else i.stateNode=CC(_,m,i.memoizedProps);else x!==m?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,m===null?EC(_,i.type,i.stateNode):CC(_,m,i.memoizedProps)):m===null&&i.stateNode!==null&&pv(i,i.memoizedProps,c.memoizedProps)}break;case 27:zr(a,i),Pr(i),m&512&&(On||c===null||es(c,c.return)),c!==null&&m&4&&pv(i,i.memoizedProps,c.memoizedProps);break;case 5:if(zr(a,i),Pr(i),m&512&&(On||c===null||es(c,c.return)),i.flags&32){_=i.stateNode;try{pl(_,"")}catch($e){qt(i,i.return,$e)}}m&4&&i.stateNode!=null&&(_=i.memoizedProps,pv(i,_,c!==null?c.memoizedProps:_)),m&1024&&(bv=!0);break;case 6:if(zr(a,i),Pr(i),m&4){if(i.stateNode===null)throw Error(r(162));m=i.memoizedProps,c=i.stateNode;try{c.nodeValue=m}catch($e){qt(i,i.return,$e)}}break;case 3:if(cf=null,_=Pi,Pi=af(a.containerInfo),zr(a,i),Pi=_,Pr(i),m&4&&c!==null&&c.memoizedState.isDehydrated)try{ql(a.containerInfo)}catch($e){qt(i,i.return,$e)}bv&&(bv=!1,ES(i));break;case 4:m=Pi,Pi=af(i.stateNode.containerInfo),zr(a,i),Pr(i),Pi=m;break;case 12:zr(a,i),Pr(i);break;case 31:zr(a,i),Pr(i),m&4&&(m=i.updateQueue,m!==null&&(i.updateQueue=null,qh(i,m)));break;case 13:zr(a,i),Pr(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Gh=Se()),m&4&&(m=i.updateQueue,m!==null&&(i.updateQueue=null,qh(i,m)));break;case 22:_=i.memoizedState!==null;var Z=c!==null&&c.memoizedState!==null,le=zs,ve=On;if(zs=le||_,On=ve||Z,zr(a,i),On=ve,zs=le,Pr(i),m&8192)e:for(a=i.stateNode,a._visibility=_?a._visibility&-2:a._visibility|1,_&&(c===null||Z||zs||On||Ea(i)),c=null,a=i;;){if(a.tag===5||a.tag===26){if(c===null){Z=c=a;try{if(x=Z.stateNode,_)T=x.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{z=Z.stateNode;var _e=Z.memoizedProps.style,ce=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;z.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch($e){qt(Z,Z.return,$e)}}}else if(a.tag===6){if(c===null){Z=a;try{Z.stateNode.nodeValue=_?"":Z.memoizedProps}catch($e){qt(Z,Z.return,$e)}}}else if(a.tag===18){if(c===null){Z=a;try{var de=Z.stateNode;_?pC(de,!0):pC(Z.stateNode,!1)}catch($e){qt(Z,Z.return,$e)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===i)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;c===a&&(c=null),a=a.return}c===a&&(c=null),a.sibling.return=a.return,a=a.sibling}m&4&&(m=i.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,qh(i,c))));break;case 19:zr(a,i),Pr(i),m&4&&(m=i.updateQueue,m!==null&&(i.updateQueue=null,qh(i,m)));break;case 30:break;case 21:break;default:zr(a,i),Pr(i)}}function Pr(i){var a=i.flags;if(a&2){try{for(var c,m=i.return;m!==null;){if(vS(m)){c=m;break}m=m.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var _=c.stateNode,x=gv(i);Vh(i,x,_);break;case 5:var T=c.stateNode;c.flags&32&&(pl(T,""),c.flags&=-33);var z=gv(i);Vh(i,z,T);break;case 3:case 4:var Z=c.stateNode.containerInfo,le=gv(i);vv(i,le,Z);break;default:throw Error(r(161))}}catch(ve){qt(i,i.return,ve)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function ES(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var a=i;ES(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),i=i.sibling}}function Bs(i,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)yS(i,a.alternate,a),a=a.sibling}function Ea(i){for(i=i.child;i!==null;){var a=i;switch(a.tag){case 0:case 11:case 14:case 15:Ro(4,a,a.return),Ea(a);break;case 1:es(a,a.return);var c=a.stateNode;typeof c.componentWillUnmount=="function"&&pS(a,a.return,c),Ea(a);break;case 27:Su(a.stateNode);case 26:case 5:es(a,a.return),Ea(a);break;case 22:a.memoizedState===null&&Ea(a);break;case 30:Ea(a);break;default:Ea(a)}i=i.sibling}}function Is(i,a,c){for(c=c&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var m=a.alternate,_=i,x=a,T=x.flags;switch(x.tag){case 0:case 11:case 15:Is(_,x,c),fu(4,x);break;case 1:if(Is(_,x,c),m=x,_=m.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(le){qt(m,m.return,le)}if(m=x,_=m.updateQueue,_!==null){var z=m.stateNode;try{var Z=_.shared.hiddenCallbacks;if(Z!==null)for(_.shared.hiddenCallbacks=null,_=0;_<Z.length;_++)rw(Z[_],z)}catch(le){qt(m,m.return,le)}}c&&T&64&&mS(x),mu(x,x.return);break;case 27:bS(x);case 26:case 5:Is(_,x,c),c&&m===null&&T&4&&gS(x),mu(x,x.return);break;case 12:Is(_,x,c);break;case 31:Is(_,x,c),c&&T&4&&SS(_,x);break;case 13:Is(_,x,c),c&&T&4&&CS(_,x);break;case 22:x.memoizedState===null&&Is(_,x,c),mu(x,x.return);break;case 30:break;default:Is(_,x,c)}a=a.sibling}}function _v(i,a){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&eu(c))}function yv(i,a){i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&eu(i))}function Bi(i,a,c,m){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)RS(i,a,c,m),a=a.sibling}function RS(i,a,c,m){var _=a.flags;switch(a.tag){case 0:case 11:case 15:Bi(i,a,c,m),_&2048&&fu(9,a);break;case 1:Bi(i,a,c,m);break;case 3:Bi(i,a,c,m),_&2048&&(i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&eu(i)));break;case 12:if(_&2048){Bi(i,a,c,m),i=a.stateNode;try{var x=a.memoizedProps,T=x.id,z=x.onPostCommit;typeof z=="function"&&z(T,a.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(Z){qt(a,a.return,Z)}}else Bi(i,a,c,m);break;case 31:Bi(i,a,c,m);break;case 13:Bi(i,a,c,m);break;case 23:break;case 22:x=a.stateNode,T=a.alternate,a.memoizedState!==null?x._visibility&2?Bi(i,a,c,m):pu(i,a):x._visibility&2?Bi(i,a,c,m):(x._visibility|=2,Ll(i,a,c,m,(a.subtreeFlags&10256)!==0||!1)),_&2048&&_v(T,a);break;case 24:Bi(i,a,c,m),_&2048&&yv(a.alternate,a);break;default:Bi(i,a,c,m)}}function Ll(i,a,c,m,_){for(_=_&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var x=i,T=a,z=c,Z=m,le=T.flags;switch(T.tag){case 0:case 11:case 15:Ll(x,T,z,Z,_),fu(8,T);break;case 23:break;case 22:var ve=T.stateNode;T.memoizedState!==null?ve._visibility&2?Ll(x,T,z,Z,_):pu(x,T):(ve._visibility|=2,Ll(x,T,z,Z,_)),_&&le&2048&&_v(T.alternate,T);break;case 24:Ll(x,T,z,Z,_),_&&le&2048&&yv(T.alternate,T);break;default:Ll(x,T,z,Z,_)}a=a.sibling}}function pu(i,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var c=i,m=a,_=m.flags;switch(m.tag){case 22:pu(c,m),_&2048&&_v(m.alternate,m);break;case 24:pu(c,m),_&2048&&yv(m.alternate,m);break;default:pu(c,m)}a=a.sibling}}var gu=8192;function zl(i,a,c){if(i.subtreeFlags&gu)for(i=i.child;i!==null;)TS(i,a,c),i=i.sibling}function TS(i,a,c){switch(i.tag){case 26:zl(i,a,c),i.flags&gu&&i.memoizedState!==null&&d4(c,Pi,i.memoizedState,i.memoizedProps);break;case 5:zl(i,a,c);break;case 3:case 4:var m=Pi;Pi=af(i.stateNode.containerInfo),zl(i,a,c),Pi=m;break;case 22:i.memoizedState===null&&(m=i.alternate,m!==null&&m.memoizedState!==null?(m=gu,gu=16777216,zl(i,a,c),gu=m):zl(i,a,c));break;default:zl(i,a,c)}}function NS(i){var a=i.alternate;if(a!==null&&(i=a.child,i!==null)){a.child=null;do a=i.sibling,i.sibling=null,i=a;while(i!==null)}}function vu(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var m=a[c];Xn=m,AS(m,i)}NS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)MS(i),i=i.sibling}function MS(i){switch(i.tag){case 0:case 11:case 15:vu(i),i.flags&2048&&Ro(9,i,i.return);break;case 3:vu(i);break;case 12:vu(i);break;case 22:var a=i.stateNode;i.memoizedState!==null&&a._visibility&2&&(i.return===null||i.return.tag!==13)?(a._visibility&=-3,Kh(i)):vu(i);break;default:vu(i)}}function Kh(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var m=a[c];Xn=m,AS(m,i)}NS(i)}for(i=i.child;i!==null;){switch(a=i,a.tag){case 0:case 11:case 15:Ro(8,a,a.return),Kh(a);break;case 22:c=a.stateNode,c._visibility&2&&(c._visibility&=-3,Kh(a));break;default:Kh(a)}i=i.sibling}}function AS(i,a){for(;Xn!==null;){var c=Xn;switch(c.tag){case 0:case 11:case 15:Ro(8,c,a);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:eu(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,Xn=m;else e:for(c=i;Xn!==null;){m=Xn;var _=m.sibling,x=m.return;if(xS(m),m===c){Xn=null;break e}if(_!==null){_.return=x,Xn=_;break e}Xn=x}}}var EO={getCacheForType:function(i){var a=cr(An),c=a.data.get(i);return c===void 0&&(c=i(),a.data.set(i,c)),c},cacheSignal:function(){return cr(An).controller.signal}},RO=typeof WeakMap=="function"?WeakMap:Map,Ft=0,rn=null,St=null,Nt=0,Vt=0,Zr=null,To=!1,Pl=!1,xv=!1,Fs=0,wn=0,No=0,Ra=0,wv=0,Qr=0,Bl=0,bu=null,Br=null,Sv=!1,Gh=0,DS=0,Yh=1/0,Xh=null,Mo=null,In=0,Ao=null,Il=null,Hs=0,Cv=0,kv=null,jS=null,_u=0,Ev=null;function Jr(){return(Ft&2)!==0&&Nt!==0?Nt&-Nt:O.T!==null?Dv():Yt()}function OS(){if(Qr===0)if((Nt&536870912)===0||Dt){var i=Sr;Sr<<=1,(Sr&3932160)===0&&(Sr=262144),Qr=i}else Qr=536870912;return i=Yr.current,i!==null&&(i.flags|=32),Qr}function Ir(i,a,c){(i===rn&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)&&(Fl(i,0),Do(i,Nt,Qr,!1)),ut(i,c),((Ft&2)===0||i!==rn)&&(i===rn&&((Ft&2)===0&&(Ra|=c),wn===4&&Do(i,Nt,Qr,!1)),ts(i))}function LS(i,a,c){if((Ft&6)!==0)throw Error(r(327));var m=!c&&(a&127)===0&&(a&i.expiredLanes)===0||ot(i,a),_=m?MO(i,a):Tv(i,a,!0),x=m;do{if(_===0){Pl&&!m&&Do(i,a,0,!1);break}else{if(c=i.current.alternate,x&&!TO(c)){_=Tv(i,a,!1),x=!1;continue}if(_===2){if(x=a,i.errorRecoveryDisabledLanes&x)var T=0;else T=i.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){a=T;e:{var z=i;_=bu;var Z=z.current.memoizedState.isDehydrated;if(Z&&(Fl(z,T).flags|=256),T=Tv(z,T,!1),T!==2){if(xv&&!Z){z.errorRecoveryDisabledLanes|=x,Ra|=x,_=4;break e}x=Br,Br=_,x!==null&&(Br===null?Br=x:Br.push.apply(Br,x))}_=T}if(x=!1,_!==2)continue}}if(_===1){Fl(i,0),Do(i,a,0,!0);break}e:{switch(m=i,x=_,x){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:Do(m,a,Qr,!To);break e;case 2:Br=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(_=Gh+300-Se(),10<_)){if(Do(m,a,Qr,!To),Pe(m,0,!0)!==0)break e;Hs=a,m.timeoutHandle=hC(zS.bind(null,m,c,Br,Xh,Sv,a,Qr,Ra,Bl,To,x,"Throttled",-0,0),_);break e}zS(m,c,Br,Xh,Sv,a,Qr,Ra,Bl,To,x,null,-0,0)}}break}while(!0);ts(i)}function zS(i,a,c,m,_,x,T,z,Z,le,ve,_e,ce,de){if(i.timeoutHandle=-1,_e=a.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Es},TS(a,x,_e);var $e=(x&62914560)===x?Gh-Se():(x&4194048)===x?DS-Se():0;if($e=h4(_e,$e),$e!==null){Hs=x,i.cancelPendingCommit=$e(WS.bind(null,i,a,x,c,m,_,T,z,Z,ve,_e,null,ce,de)),Do(i,x,T,!le);return}}WS(i,a,x,c,m,_,T,z,Z)}function TO(i){for(var a=i;;){var c=a.tag;if((c===0||c===11||c===15)&&a.flags&16384&&(c=a.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var _=c[m],x=_.getSnapshot;_=_.value;try{if(!Kr(x(),_))return!1}catch{return!1}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Do(i,a,c,m){a&=~wv,a&=~Ra,i.suspendedLanes|=a,i.pingedLanes&=~a,m&&(i.warmLanes|=a),m=i.expirationTimes;for(var _=a;0<_;){var x=31-we(_),T=1<<x;m[x]=-1,_&=~T}c!==0&&yn(i,c,a)}function Zh(){return(Ft&6)===0?(yu(0),!1):!0}function Rv(){if(St!==null){if(Vt===0)var i=St.return;else i=St,Ms=ba=null,$g(i),Ml=null,nu=0,i=St;for(;i!==null;)fS(i.alternate,i),i=i.return;St=null}}function Fl(i,a){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,GO(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Hs=0,Rv(),rn=i,St=c=Ts(i.current,null),Nt=a,Vt=0,Zr=null,To=!1,Pl=ot(i,a),xv=!1,Bl=Qr=wv=Ra=No=wn=0,Br=bu=null,Sv=!1,(a&8)!==0&&(a|=a&32);var m=i.entangledLanes;if(m!==0)for(i=i.entanglements,m&=a;0<m;){var _=31-we(m),x=1<<_;a|=i[_],m&=~x}return Fs=a,bh(),c}function PS(i,a){ct=null,O.H=uu,a===Nl||a===Eh?(a=J1(),Vt=3):a===Ag?(a=J1(),Vt=4):Vt=a===sv?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Zr=a,St===null&&(wn=1,Fh(i,fi(a,i.current)))}function BS(){var i=Yr.current;return i===null?!0:(Nt&4194048)===Nt?vi===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?i===vi:!1}function IS(){var i=O.H;return O.H=uu,i===null?uu:i}function FS(){var i=O.A;return O.A=EO,i}function Qh(){wn=4,To||(Nt&4194048)!==Nt&&Yr.current!==null||(Pl=!0),(No&134217727)===0&&(Ra&134217727)===0||rn===null||Do(rn,Nt,Qr,!1)}function Tv(i,a,c){var m=Ft;Ft|=2;var _=IS(),x=FS();(rn!==i||Nt!==a)&&(Xh=null,Fl(i,a)),a=!1;var T=wn;e:do try{if(Vt!==0&&St!==null){var z=St,Z=Zr;switch(Vt){case 8:Rv(),T=6;break e;case 3:case 2:case 9:case 6:Yr.current===null&&(a=!0);var le=Vt;if(Vt=0,Zr=null,Hl(i,z,Z,le),c&&Pl){T=0;break e}break;default:le=Vt,Vt=0,Zr=null,Hl(i,z,Z,le)}}NO(),T=wn;break}catch(ve){PS(i,ve)}while(!0);return a&&i.shellSuspendCounter++,Ms=ba=null,Ft=m,O.H=_,O.A=x,St===null&&(rn=null,Nt=0,bh()),T}function NO(){for(;St!==null;)HS(St)}function MO(i,a){var c=Ft;Ft|=2;var m=IS(),_=FS();rn!==i||Nt!==a?(Xh=null,Yh=Se()+500,Fl(i,a)):Pl=ot(i,a);e:do try{if(Vt!==0&&St!==null){a=St;var x=Zr;t:switch(Vt){case 1:Vt=0,Zr=null,Hl(i,a,x,1);break;case 2:case 9:if(Z1(x)){Vt=0,Zr=null,US(a);break}a=function(){Vt!==2&&Vt!==9||rn!==i||(Vt=7),ts(i)},x.then(a,a);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:Z1(x)?(Vt=0,Zr=null,US(a)):(Vt=0,Zr=null,Hl(i,a,x,7));break;case 5:var T=null;switch(St.tag){case 26:T=St.memoizedState;case 5:case 27:var z=St;if(T?RC(T):z.stateNode.complete){Vt=0,Zr=null;var Z=z.sibling;if(Z!==null)St=Z;else{var le=z.return;le!==null?(St=le,Jh(le)):St=null}break t}}Vt=0,Zr=null,Hl(i,a,x,5);break;case 6:Vt=0,Zr=null,Hl(i,a,x,6);break;case 8:Rv(),wn=6;break e;default:throw Error(r(462))}}AO();break}catch(ve){PS(i,ve)}while(!0);return Ms=ba=null,O.H=m,O.A=_,Ft=c,St!==null?0:(rn=null,Nt=0,bh(),wn)}function AO(){for(;St!==null&&!nt();)HS(St)}function HS(i){var a=dS(i.alternate,i,Fs);i.memoizedProps=i.pendingProps,a===null?Jh(i):St=a}function US(i){var a=i,c=a.alternate;switch(a.tag){case 15:case 0:a=sS(c,a,a.pendingProps,a.type,void 0,Nt);break;case 11:a=sS(c,a,a.pendingProps,a.type.render,a.ref,Nt);break;case 5:$g(a);default:fS(c,a),a=St=F1(a,Fs),a=dS(c,a,Fs)}i.memoizedProps=i.pendingProps,a===null?Jh(i):St=a}function Hl(i,a,c,m){Ms=ba=null,$g(a),Ml=null,nu=0;var _=a.return;try{if(_O(i,_,a,c,Nt)){wn=1,Fh(i,fi(c,i.current)),St=null;return}}catch(x){if(_!==null)throw St=_,x;wn=1,Fh(i,fi(c,i.current)),St=null;return}a.flags&32768?(Dt||m===1?i=!0:Pl||(Nt&536870912)!==0?i=!1:(To=i=!0,(m===2||m===9||m===3||m===6)&&(m=Yr.current,m!==null&&m.tag===13&&(m.flags|=16384))),$S(a,i)):Jh(a)}function Jh(i){var a=i;do{if((a.flags&32768)!==0){$S(a,To);return}i=a.return;var c=wO(a.alternate,a,Fs);if(c!==null){St=c;return}if(a=a.sibling,a!==null){St=a;return}St=a=i}while(a!==null);wn===0&&(wn=5)}function $S(i,a){do{var c=SO(i.alternate,i);if(c!==null){c.flags&=32767,St=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!a&&(i=i.sibling,i!==null)){St=i;return}St=i=c}while(i!==null);wn=6,St=null}function WS(i,a,c,m,_,x,T,z,Z){i.cancelPendingCommit=null;do ef();while(In!==0);if((Ft&6)!==0)throw Error(r(327));if(a!==null){if(a===i.current)throw Error(r(177));if(x=a.lanes|a.childLanes,x|=gg,mt(i,c,x,T,z,Z),i===rn&&(St=rn=null,Nt=0),Il=a,Ao=i,Hs=c,Cv=x,kv=_,jS=m,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,LO(Ne,function(){return YS(),null})):(i.callbackNode=null,i.callbackPriority=0),m=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||m){m=O.T,O.T=null,_=$.p,$.p=2,T=Ft,Ft|=4;try{CO(i,a,c)}finally{Ft=T,$.p=_,O.T=m}}In=1,VS(),qS(),KS()}}function VS(){if(In===1){In=0;var i=Ao,a=Il,c=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||c){c=O.T,O.T=null;var m=$.p;$.p=2;var _=Ft;Ft|=4;try{kS(a,i);var x=Fv,T=A1(i.containerInfo),z=x.focusedElem,Z=x.selectionRange;if(T!==z&&z&&z.ownerDocument&&M1(z.ownerDocument.documentElement,z)){if(Z!==null&&dg(z)){var le=Z.start,ve=Z.end;if(ve===void 0&&(ve=le),"selectionStart"in z)z.selectionStart=le,z.selectionEnd=Math.min(ve,z.value.length);else{var _e=z.ownerDocument||document,ce=_e&&_e.defaultView||window;if(ce.getSelection){var de=ce.getSelection(),$e=z.textContent.length,tt=Math.min(Z.start,$e),Jt=Z.end===void 0?tt:Math.min(Z.end,$e);!de.extend&&tt>Jt&&(T=Jt,Jt=tt,tt=T);var re=N1(z,tt),ee=N1(z,Jt);if(re&&ee&&(de.rangeCount!==1||de.anchorNode!==re.node||de.anchorOffset!==re.offset||de.focusNode!==ee.node||de.focusOffset!==ee.offset)){var ae=_e.createRange();ae.setStart(re.node,re.offset),de.removeAllRanges(),tt>Jt?(de.addRange(ae),de.extend(ee.node,ee.offset)):(ae.setEnd(ee.node,ee.offset),de.addRange(ae))}}}}for(_e=[],de=z;de=de.parentNode;)de.nodeType===1&&_e.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<_e.length;z++){var be=_e[z];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}ff=!!Iv,Fv=Iv=null}finally{Ft=_,$.p=m,O.T=c}}i.current=a,In=2}}function qS(){if(In===2){In=0;var i=Ao,a=Il,c=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||c){c=O.T,O.T=null;var m=$.p;$.p=2;var _=Ft;Ft|=4;try{yS(i,a.alternate,a)}finally{Ft=_,$.p=m,O.T=c}}In=3}}function KS(){if(In===4||In===3){In=0,Kt();var i=Ao,a=Il,c=Hs,m=jS;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?In=5:(In=0,Il=Ao=null,GS(i,i.pendingLanes));var _=i.pendingLanes;if(_===0&&(Mo=null),it(c),a=a.stateNode,Ke&&typeof Ke.onCommitFiberRoot=="function")try{Ke.onCommitFiberRoot(Le,a,void 0,(a.current.flags&128)===128)}catch{}if(m!==null){a=O.T,_=$.p,$.p=2,O.T=null;try{for(var x=i.onRecoverableError,T=0;T<m.length;T++){var z=m[T];x(z.value,{componentStack:z.stack})}}finally{O.T=a,$.p=_}}(Hs&3)!==0&&ef(),ts(i),_=i.pendingLanes,(c&261930)!==0&&(_&42)!==0?i===Ev?_u++:(_u=0,Ev=i):_u=0,yu(0)}}function GS(i,a){(i.pooledCacheLanes&=a)===0&&(a=i.pooledCache,a!=null&&(i.pooledCache=null,eu(a)))}function ef(){return VS(),qS(),KS(),YS()}function YS(){if(In!==5)return!1;var i=Ao,a=Cv;Cv=0;var c=it(Hs),m=O.T,_=$.p;try{$.p=32>c?32:c,O.T=null,c=kv,kv=null;var x=Ao,T=Hs;if(In=0,Il=Ao=null,Hs=0,(Ft&6)!==0)throw Error(r(331));var z=Ft;if(Ft|=4,MS(x.current),RS(x,x.current,T,c),Ft=z,yu(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot=="function")try{Ke.onPostCommitFiberRoot(Le,x)}catch{}return!0}finally{$.p=_,O.T=m,GS(i,a)}}function XS(i,a,c){a=fi(c,a),a=iv(i.stateNode,a,2),i=Co(i,a,2),i!==null&&(ut(i,2),ts(i))}function qt(i,a,c){if(i.tag===3)XS(i,i,c);else for(;a!==null;){if(a.tag===3){XS(a,i,c);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Mo===null||!Mo.has(m))){i=fi(c,i),c=Zw(2),m=Co(a,c,2),m!==null&&(Qw(c,m,a,i),ut(m,2),ts(m));break}}a=a.return}}function Nv(i,a,c){var m=i.pingCache;if(m===null){m=i.pingCache=new RO;var _=new Set;m.set(a,_)}else _=m.get(a),_===void 0&&(_=new Set,m.set(a,_));_.has(c)||(xv=!0,_.add(c),i=DO.bind(null,i,a,c),a.then(i,i))}function DO(i,a,c){var m=i.pingCache;m!==null&&m.delete(a),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,rn===i&&(Nt&c)===c&&(wn===4||wn===3&&(Nt&62914560)===Nt&&300>Se()-Gh?(Ft&2)===0&&Fl(i,0):wv|=c,Bl===Nt&&(Bl=0)),ts(i)}function ZS(i,a){a===0&&(a=gt()),i=pa(i,a),i!==null&&(ut(i,a),ts(i))}function jO(i){var a=i.memoizedState,c=0;a!==null&&(c=a.retryLane),ZS(i,c)}function OO(i,a){var c=0;switch(i.tag){case 31:case 13:var m=i.stateNode,_=i.memoizedState;_!==null&&(c=_.retryLane);break;case 19:m=i.stateNode;break;case 22:m=i.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(a),ZS(i,c)}function LO(i,a){return et(i,a)}var tf=null,Ul=null,Mv=!1,nf=!1,Av=!1,jo=0;function ts(i){i!==Ul&&i.next===null&&(Ul===null?tf=Ul=i:Ul=Ul.next=i),nf=!0,Mv||(Mv=!0,PO())}function yu(i,a){if(!Av&&nf){Av=!0;do for(var c=!1,m=tf;m!==null;){if(i!==0){var _=m.pendingLanes;if(_===0)var x=0;else{var T=m.suspendedLanes,z=m.pingedLanes;x=(1<<31-we(42|i)+1)-1,x&=_&~(T&~z),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,tC(m,x))}else x=Nt,x=Pe(m,m===rn?x:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(x&3)===0||ot(m,x)||(c=!0,tC(m,x));m=m.next}while(c);Av=!1}}function zO(){QS()}function QS(){nf=Mv=!1;var i=0;jo!==0&&KO()&&(i=jo);for(var a=Se(),c=null,m=tf;m!==null;){var _=m.next,x=JS(m,a);x===0?(m.next=null,c===null?tf=_:c.next=_,_===null&&(Ul=c)):(c=m,(i!==0||(x&3)!==0)&&(nf=!0)),m=_}In!==0&&In!==5||yu(i),jo!==0&&(jo=0)}function JS(i,a){for(var c=i.suspendedLanes,m=i.pingedLanes,_=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var T=31-we(x),z=1<<T,Z=_[T];Z===-1?((z&c)===0||(z&m)!==0)&&(_[T]=wt(z,a)):Z<=a&&(i.expiredLanes|=z),x&=~z}if(a=rn,c=Nt,c=Pe(i,i===a?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),m=i.callbackNode,c===0||i===a&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)return m!==null&&m!==null&<(m),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||ot(i,c)){if(a=c&-c,a===i.callbackPriority)return a;switch(m!==null&<(m),it(c)){case 2:case 8:c=pe;break;case 32:c=Ne;break;case 268435456:c=Oe;break;default:c=Ne}return m=eC.bind(null,i),c=et(c,m),i.callbackPriority=a,i.callbackNode=c,a}return m!==null&&m!==null&<(m),i.callbackPriority=2,i.callbackNode=null,2}function eC(i,a){if(In!==0&&In!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(ef()&&i.callbackNode!==c)return null;var m=Nt;return m=Pe(i,i===rn?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),m===0?null:(LS(i,m,a),JS(i,Se()),i.callbackNode!=null&&i.callbackNode===c?eC.bind(null,i):null)}function tC(i,a){if(ef())return null;LS(i,a,!0)}function PO(){YO(function(){(Ft&6)!==0?et(se,zO):QS()})}function Dv(){if(jo===0){var i=Rl;i===0&&(i=Kn,Kn<<=1,(Kn&261888)===0&&(Kn=256)),jo=i}return jo}function nC(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:uh(""+i)}function rC(i,a){var c=a.ownerDocument.createElement("input");return c.name=a.name,c.value=a.value,i.id&&c.setAttribute("form",i.id),a.parentNode.insertBefore(c,a),i=new FormData(i),c.parentNode.removeChild(c),i}function BO(i,a,c,m,_){if(a==="submit"&&c&&c.stateNode===_){var x=nC((_[Ie]||null).action),T=m.submitter;T&&(a=(a=T[Ie]||null)?nC(a.formAction):T.getAttribute("formAction"),a!==null&&(x=a,T=null));var z=new mh("action","action",null,m,_);i.push({event:z,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(jo!==0){var Z=T?rC(_,T):new FormData(_);Qg(c,{pending:!0,data:Z,method:_.method,action:x},null,Z)}}else typeof x=="function"&&(z.preventDefault(),Z=T?rC(_,T):new FormData(_),Qg(c,{pending:!0,data:Z,method:_.method,action:x},x,Z))},currentTarget:_}]})}}for(var jv=0;jv<pg.length;jv++){var Ov=pg[jv],IO=Ov.toLowerCase(),FO=Ov[0].toUpperCase()+Ov.slice(1);zi(IO,"on"+FO)}zi(O1,"onAnimationEnd"),zi(L1,"onAnimationIteration"),zi(z1,"onAnimationStart"),zi("dblclick","onDoubleClick"),zi("focusin","onFocus"),zi("focusout","onBlur"),zi(nO,"onTransitionRun"),zi(rO,"onTransitionStart"),zi(iO,"onTransitionCancel"),zi(P1,"onTransitionEnd"),go("onMouseEnter",["mouseout","mouseover"]),go("onMouseLeave",["mouseout","mouseover"]),go("onPointerEnter",["pointerout","pointerover"]),go("onPointerLeave",["pointerout","pointerover"]),Cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xu="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(" "),HO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xu));function iC(i,a){a=(a&4)!==0;for(var c=0;c<i.length;c++){var m=i[c],_=m.event;m=m.listeners;e:{var x=void 0;if(a)for(var T=m.length-1;0<=T;T--){var z=m[T],Z=z.instance,le=z.currentTarget;if(z=z.listener,Z!==x&&_.isPropagationStopped())break e;x=z,_.currentTarget=le;try{x(_)}catch(ve){vh(ve)}_.currentTarget=null,x=Z}else for(T=0;T<m.length;T++){if(z=m[T],Z=z.instance,le=z.currentTarget,z=z.listener,Z!==x&&_.isPropagationStopped())break e;x=z,_.currentTarget=le;try{x(_)}catch(ve){vh(ve)}_.currentTarget=null,x=Z}}}}function Ct(i,a){var c=a[ui];c===void 0&&(c=a[ui]=new Set);var m=i+"__bubble";c.has(m)||(sC(a,i,2,!1),c.add(m))}function Lv(i,a,c){var m=0;a&&(m|=4),sC(c,i,m,a)}var rf="_reactListening"+Math.random().toString(36).slice(2);function zv(i){if(!i[rf]){i[rf]=!0,ah.forEach(function(c){c!=="selectionchange"&&(HO.has(c)||Lv(c,!1,i),Lv(c,!0,i))});var a=i.nodeType===9?i:i.ownerDocument;a===null||a[rf]||(a[rf]=!0,Lv("selectionchange",!1,a))}}function sC(i,a,c,m){switch(OC(a)){case 2:var _=p4;break;case 8:_=g4;break;default:_=Zv}c=_.bind(null,a,c,i),_=void 0,!ng||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(_=!0),m?_!==void 0?i.addEventListener(a,c,{capture:!0,passive:_}):i.addEventListener(a,c,!0):_!==void 0?i.addEventListener(a,c,{passive:_}):i.addEventListener(a,c,!1)}function Pv(i,a,c,m,_){var x=m;if((a&1)===0&&(a&2)===0&&m!==null)e:for(;;){if(m===null)return;var T=m.tag;if(T===3||T===4){var z=m.stateNode.containerInfo;if(z===_)break;if(T===4)for(T=m.return;T!==null;){var Z=T.tag;if((Z===3||Z===4)&&T.stateNode.containerInfo===_)return;T=T.return}for(;z!==null;){if(T=fo(z),T===null)return;if(Z=T.tag,Z===5||Z===6||Z===26||Z===27){m=x=T;continue e}z=z.parentNode}}m=m.return}u1(function(){var le=x,ve=eg(c),_e=[];e:{var ce=B1.get(i);if(ce!==void 0){var de=mh,$e=i;switch(i){case"keypress":if(hh(c)===0)break e;case"keydown":case"keyup":de=O3;break;case"focusin":$e="focus",de=og;break;case"focusout":$e="blur",de=og;break;case"beforeblur":case"afterblur":de=og;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":de=f1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=w3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=P3;break;case O1:case L1:case z1:de=k3;break;case P1:de=I3;break;case"scroll":case"scrollend":de=y3;break;case"wheel":de=H3;break;case"copy":case"cut":case"paste":de=R3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=p1;break;case"toggle":case"beforetoggle":de=$3}var tt=(a&4)!==0,Jt=!tt&&(i==="scroll"||i==="scrollend"),re=tt?ce!==null?ce+"Capture":null:ce;tt=[];for(var ee=le,ae;ee!==null;){var be=ee;if(ae=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ae===null||re===null||(be=$c(ee,re),be!=null&&tt.push(wu(ee,be,ae))),Jt)break;ee=ee.return}0<tt.length&&(ce=new de(ce,$e,null,c,ve),_e.push({event:ce,listeners:tt}))}}if((a&7)===0){e:{if(ce=i==="mouseover"||i==="pointerover",de=i==="mouseout"||i==="pointerout",ce&&c!==Jp&&($e=c.relatedTarget||c.fromElement)&&(fo($e)||$e[mn]))break e;if((de||ce)&&(ce=ve.window===ve?ve:(ce=ve.ownerDocument)?ce.defaultView||ce.parentWindow:window,de?($e=c.relatedTarget||c.toElement,de=le,$e=$e?fo($e):null,$e!==null&&(Jt=o($e),tt=$e.tag,$e!==Jt||tt!==5&&tt!==27&&tt!==6)&&($e=null)):(de=null,$e=le),de!==$e)){if(tt=f1,be="onMouseLeave",re="onMouseEnter",ee="mouse",(i==="pointerout"||i==="pointerover")&&(tt=p1,be="onPointerLeave",re="onPointerEnter",ee="pointer"),Jt=de==null?ce:da(de),ae=$e==null?ce:da($e),ce=new tt(be,ee+"leave",de,c,ve),ce.target=Jt,ce.relatedTarget=ae,be=null,fo(ve)===le&&(tt=new tt(re,ee+"enter",$e,c,ve),tt.target=ae,tt.relatedTarget=Jt,be=tt),Jt=be,de&&$e)t:{for(tt=UO,re=de,ee=$e,ae=0,be=re;be;be=tt(be))ae++;be=0;for(var Qe=ee;Qe;Qe=tt(Qe))be++;for(;0<ae-be;)re=tt(re),ae--;for(;0<be-ae;)ee=tt(ee),be--;for(;ae--;){if(re===ee||ee!==null&&re===ee.alternate){tt=re;break t}re=tt(re),ee=tt(ee)}tt=null}else tt=null;de!==null&&oC(_e,ce,de,tt,!1),$e!==null&&Jt!==null&&oC(_e,Jt,$e,tt,!0)}}e:{if(ce=le?da(le):window,de=ce.nodeName&&ce.nodeName.toLowerCase(),de==="select"||de==="input"&&ce.type==="file")var zt=S1;else if(x1(ce))if(C1)zt=J3;else{zt=Z3;var Ye=X3}else de=ce.nodeName,!de||de.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&Qp(le.elementType)&&(zt=S1):zt=Q3;if(zt&&(zt=zt(i,le))){w1(_e,zt,c,ve);break e}Ye&&Ye(i,ce,le),i==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&ml(ce,"number",ce.value)}switch(Ye=le?da(le):window,i){case"focusin":(x1(Ye)||Ye.contentEditable==="true")&&(_l=Ye,hg=le,Zc=null);break;case"focusout":Zc=hg=_l=null;break;case"mousedown":fg=!0;break;case"contextmenu":case"mouseup":case"dragend":fg=!1,D1(_e,c,ve);break;case"selectionchange":if(tO)break;case"keydown":case"keyup":D1(_e,c,ve)}var dt;if(lg)e:{switch(i){case"compositionstart":var Mt="onCompositionStart";break e;case"compositionend":Mt="onCompositionEnd";break e;case"compositionupdate":Mt="onCompositionUpdate";break e}Mt=void 0}else bl?_1(i,c)&&(Mt="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Mt="onCompositionStart");Mt&&(g1&&c.locale!=="ko"&&(bl||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&bl&&(dt=d1()):(vo=ve,rg="value"in vo?vo.value:vo.textContent,bl=!0)),Ye=sf(le,Mt),0<Ye.length&&(Mt=new m1(Mt,i,null,c,ve),_e.push({event:Mt,listeners:Ye}),dt?Mt.data=dt:(dt=y1(c),dt!==null&&(Mt.data=dt)))),(dt=V3?q3(i,c):K3(i,c))&&(Mt=sf(le,"onBeforeInput"),0<Mt.length&&(Ye=new m1("onBeforeInput","beforeinput",null,c,ve),_e.push({event:Ye,listeners:Mt}),Ye.data=dt)),BO(_e,i,le,c,ve)}iC(_e,a)})}function wu(i,a,c){return{instance:i,listener:a,currentTarget:c}}function sf(i,a){for(var c=a+"Capture",m=[];i!==null;){var _=i,x=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||x===null||(_=$c(i,c),_!=null&&m.unshift(wu(i,_,x)),_=$c(i,a),_!=null&&m.push(wu(i,_,x))),i.tag===3)return m;i=i.return}return[]}function UO(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function oC(i,a,c,m,_){for(var x=a._reactName,T=[];c!==null&&c!==m;){var z=c,Z=z.alternate,le=z.stateNode;if(z=z.tag,Z!==null&&Z===m)break;z!==5&&z!==26&&z!==27||le===null||(Z=le,_?(le=$c(c,x),le!=null&&T.unshift(wu(c,le,Z))):_||(le=$c(c,x),le!=null&&T.push(wu(c,le,Z)))),c=c.return}T.length!==0&&i.push({event:a,listeners:T})}var $O=/\r\n?/g,WO=/\u0000|\uFFFD/g;function aC(i){return(typeof i=="string"?i:""+i).replace($O,`
|
|
49
|
+
`).replace(WO,"")}function lC(i,a){return a=aC(a),aC(i)===a}function Qt(i,a,c,m,_,x){switch(c){case"children":typeof m=="string"?a==="body"||a==="textarea"&&m===""||pl(i,m):(typeof m=="number"||typeof m=="bigint")&&a!=="body"&&pl(i,""+m);break;case"className":fl(i,"class",m);break;case"tabIndex":fl(i,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":fl(i,c,m);break;case"style":l1(i,m,x);break;case"data":if(a!=="object"){fl(i,"data",m);break}case"src":case"href":if(m===""&&(a!=="a"||c!=="href")){i.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){i.removeAttribute(c);break}m=uh(""+m),i.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="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 x=="function"&&(c==="formAction"?(a!=="input"&&Qt(i,a,"name",_.name,_,null),Qt(i,a,"formEncType",_.formEncType,_,null),Qt(i,a,"formMethod",_.formMethod,_,null),Qt(i,a,"formTarget",_.formTarget,_,null)):(Qt(i,a,"encType",_.encType,_,null),Qt(i,a,"method",_.method,_,null),Qt(i,a,"target",_.target,_,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){i.removeAttribute(c);break}m=uh(""+m),i.setAttribute(c,m);break;case"onClick":m!=null&&(i.onclick=Es);break;case"onScroll":m!=null&&Ct("scroll",i);break;case"onScrollEnd":m!=null&&Ct("scrollend",i);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(c=m.__html,c!=null){if(_.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":i.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){i.removeAttribute("xlink:href");break}c=uh(""+m),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":m!=null&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(c,""+m):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":m&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":m===!0?i.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(c,m):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?i.setAttribute(c,m):i.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?i.removeAttribute(c):i.setAttribute(c,m);break;case"popover":Ct("beforetoggle",i),Ct("toggle",i),hl(i,"popover",m);break;case"xlinkActuate":di(i,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":di(i,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":di(i,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":di(i,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":di(i,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":di(i,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":di(i,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":di(i,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":di(i,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":hl(i,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=b3.get(c)||c,hl(i,c,m))}}function Bv(i,a,c,m,_,x){switch(c){case"style":l1(i,m,x);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(c=m.__html,c!=null){if(_.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof m=="string"?pl(i,m):(typeof m=="number"||typeof m=="bigint")&&pl(i,""+m);break;case"onScroll":m!=null&&Ct("scroll",i);break;case"onScrollEnd":m!=null&&Ct("scrollend",i);break;case"onClick":m!=null&&(i.onclick=Es);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lh.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(_=c.endsWith("Capture"),a=c.slice(2,_?c.length-7:void 0),x=i[Ie]||null,x=x!=null?x[c]:null,typeof x=="function"&&i.removeEventListener(a,x,_),typeof m=="function")){typeof x!="function"&&x!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(a,m,_);break e}c in i?i[c]=m:m===!0?i.setAttribute(c,""):hl(i,c,m)}}}function dr(i,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ct("error",i),Ct("load",i);var m=!1,_=!1,x;for(x in c)if(c.hasOwnProperty(x)){var T=c[x];if(T!=null)switch(x){case"src":m=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Qt(i,a,x,T,c,null)}}_&&Qt(i,a,"srcSet",c.srcSet,c,null),m&&Qt(i,a,"src",c.src,c,null);return;case"input":Ct("invalid",i);var z=x=T=_=null,Z=null,le=null;for(m in c)if(c.hasOwnProperty(m)){var ve=c[m];if(ve!=null)switch(m){case"name":_=ve;break;case"type":T=ve;break;case"checked":Z=ve;break;case"defaultChecked":le=ve;break;case"value":x=ve;break;case"defaultValue":z=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,a));break;default:Qt(i,a,m,ve,c,null)}}Zi(i,x,z,Z,le,T,_,!1);return;case"select":Ct("invalid",i),m=T=x=null;for(_ in c)if(c.hasOwnProperty(_)&&(z=c[_],z!=null))switch(_){case"value":x=z;break;case"defaultValue":T=z;break;case"multiple":m=z;default:Qt(i,a,_,z,c,null)}a=x,c=T,i.multiple=!!m,a!=null?ks(i,!!m,a,!1):c!=null&&ks(i,!!m,c,!0);return;case"textarea":Ct("invalid",i),x=_=m=null;for(T in c)if(c.hasOwnProperty(T)&&(z=c[T],z!=null))switch(T){case"value":m=z;break;case"defaultValue":_=z;break;case"children":x=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(91));break;default:Qt(i,a,T,z,c,null)}o1(i,m,_,x);return;case"option":for(Z in c)if(c.hasOwnProperty(Z)&&(m=c[Z],m!=null))switch(Z){case"selected":i.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Qt(i,a,Z,m,c,null)}return;case"dialog":Ct("beforetoggle",i),Ct("toggle",i),Ct("cancel",i),Ct("close",i);break;case"iframe":case"object":Ct("load",i);break;case"video":case"audio":for(m=0;m<xu.length;m++)Ct(xu[m],i);break;case"image":Ct("error",i),Ct("load",i);break;case"details":Ct("toggle",i);break;case"embed":case"source":case"link":Ct("error",i),Ct("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(le in c)if(c.hasOwnProperty(le)&&(m=c[le],m!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Qt(i,a,le,m,c,null)}return;default:if(Qp(a)){for(ve in c)c.hasOwnProperty(ve)&&(m=c[ve],m!==void 0&&Bv(i,a,ve,m,c,void 0));return}}for(z in c)c.hasOwnProperty(z)&&(m=c[z],m!=null&&Qt(i,a,z,m,c,null))}function VO(i,a,c,m){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,x=null,T=null,z=null,Z=null,le=null,ve=null;for(de in c){var _e=c[de];if(c.hasOwnProperty(de)&&_e!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":Z=_e;default:m.hasOwnProperty(de)||Qt(i,a,de,null,m,_e)}}for(var ce in m){var de=m[ce];if(_e=c[ce],m.hasOwnProperty(ce)&&(de!=null||_e!=null))switch(ce){case"type":x=de;break;case"name":_=de;break;case"checked":le=de;break;case"defaultChecked":ve=de;break;case"value":T=de;break;case"defaultValue":z=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,a));break;default:de!==_e&&Qt(i,a,ce,de,m,_e)}}Yn(i,T,z,Z,le,ve,x,_);return;case"select":de=T=z=ce=null;for(x in c)if(Z=c[x],c.hasOwnProperty(x)&&Z!=null)switch(x){case"value":break;case"multiple":de=Z;default:m.hasOwnProperty(x)||Qt(i,a,x,null,m,Z)}for(_ in m)if(x=m[_],Z=c[_],m.hasOwnProperty(_)&&(x!=null||Z!=null))switch(_){case"value":ce=x;break;case"defaultValue":z=x;break;case"multiple":T=x;default:x!==Z&&Qt(i,a,_,x,m,Z)}a=z,c=T,m=de,ce!=null?ks(i,!!c,ce,!1):!!m!=!!c&&(a!=null?ks(i,!!c,a,!0):ks(i,!!c,c?[]:"",!1));return;case"textarea":de=ce=null;for(z in c)if(_=c[z],c.hasOwnProperty(z)&&_!=null&&!m.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Qt(i,a,z,null,m,_)}for(T in m)if(_=m[T],x=c[T],m.hasOwnProperty(T)&&(_!=null||x!=null))switch(T){case"value":ce=_;break;case"defaultValue":de=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==x&&Qt(i,a,T,_,m,x)}s1(i,ce,de);return;case"option":for(var $e in c)if(ce=c[$e],c.hasOwnProperty($e)&&ce!=null&&!m.hasOwnProperty($e))switch($e){case"selected":i.selected=!1;break;default:Qt(i,a,$e,null,m,ce)}for(Z in m)if(ce=m[Z],de=c[Z],m.hasOwnProperty(Z)&&ce!==de&&(ce!=null||de!=null))switch(Z){case"selected":i.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:Qt(i,a,Z,ce,m,de)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var tt in c)ce=c[tt],c.hasOwnProperty(tt)&&ce!=null&&!m.hasOwnProperty(tt)&&Qt(i,a,tt,null,m,ce);for(le in m)if(ce=m[le],de=c[le],m.hasOwnProperty(le)&&ce!==de&&(ce!=null||de!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,a));break;default:Qt(i,a,le,ce,m,de)}return;default:if(Qp(a)){for(var Jt in c)ce=c[Jt],c.hasOwnProperty(Jt)&&ce!==void 0&&!m.hasOwnProperty(Jt)&&Bv(i,a,Jt,void 0,m,ce);for(ve in m)ce=m[ve],de=c[ve],!m.hasOwnProperty(ve)||ce===de||ce===void 0&&de===void 0||Bv(i,a,ve,ce,m,de);return}}for(var re in c)ce=c[re],c.hasOwnProperty(re)&&ce!=null&&!m.hasOwnProperty(re)&&Qt(i,a,re,null,m,ce);for(_e in m)ce=m[_e],de=c[_e],!m.hasOwnProperty(_e)||ce===de||ce==null&&de==null||Qt(i,a,_e,ce,m,de)}function cC(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function qO(){if(typeof performance.getEntriesByType=="function"){for(var i=0,a=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var _=c[m],x=_.transferSize,T=_.initiatorType,z=_.duration;if(x&&z&&cC(T)){for(T=0,z=_.responseEnd,m+=1;m<c.length;m++){var Z=c[m],le=Z.startTime;if(le>z)break;var ve=Z.transferSize,_e=Z.initiatorType;ve&&cC(_e)&&(Z=Z.responseEnd,T+=ve*(Z<z?1:(z-le)/(Z-le)))}if(--m,a+=8*(x+T)/(_.duration/1e3),i++,10<i)break}}if(0<i)return a/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Iv=null,Fv=null;function of(i){return i.nodeType===9?i:i.ownerDocument}function uC(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 dC(i,a){if(i===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&a==="foreignObject"?0:i}function Hv(i,a){return i==="textarea"||i==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Uv=null;function KO(){var i=window.event;return i&&i.type==="popstate"?i===Uv?!1:(Uv=i,!0):(Uv=null,!1)}var hC=typeof setTimeout=="function"?setTimeout:void 0,GO=typeof clearTimeout=="function"?clearTimeout:void 0,fC=typeof Promise=="function"?Promise:void 0,YO=typeof queueMicrotask=="function"?queueMicrotask:typeof fC<"u"?function(i){return fC.resolve(null).then(i).catch(XO)}:hC;function XO(i){setTimeout(function(){throw i})}function Oo(i){return i==="head"}function mC(i,a){var c=a,m=0;do{var _=c.nextSibling;if(i.removeChild(c),_&&_.nodeType===8)if(c=_.data,c==="/$"||c==="/&"){if(m===0){i.removeChild(_),ql(a);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")Su(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,Su(c);for(var x=c.firstChild;x;){var T=x.nextSibling,z=x.nodeName;x[Ss]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=T}}else c==="body"&&Su(i.ownerDocument.body);c=_}while(c);ql(a)}function pC(i,a){var c=i;i=0;do{var m=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=m}while(c)}function $v(i){var a=i.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":$v(c),Hc(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function ZO(i,a,c,m){for(;i.nodeType===1;){var _=c;if(i.nodeName.toLowerCase()!==a.toLowerCase()){if(!m&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(m){if(!i[Ss])switch(a){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==_.rel||i.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||i.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||i.getAttribute("title")!==(_.title==null?null:_.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(_.src==null?null:_.src)||i.getAttribute("type")!==(_.type==null?null:_.type)||i.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(a==="input"&&i.type==="hidden"){var x=_.name==null?null:""+_.name;if(_.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=bi(i.nextSibling),i===null)break}return null}function QO(i,a,c){if(a==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=bi(i.nextSibling),i===null))return null;return i}function gC(i,a){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=bi(i.nextSibling),i===null))return null;return i}function Wv(i){return i.data==="$?"||i.data==="$~"}function Vv(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function JO(i,a){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=a;else if(i.data!=="$?"||c.readyState!=="loading")a();else{var m=function(){a(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),i._reactRetry=m}}function bi(i){for(;i!=null;i=i.nextSibling){var a=i.nodeType;if(a===1||a===3)break;if(a===8){if(a=i.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return i}var qv=null;function vC(i){i=i.nextSibling;for(var a=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(a===0)return bi(i.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}i=i.nextSibling}return null}function bC(i){i=i.previousSibling;for(var a=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return i;a--}else c!=="/$"&&c!=="/&"||a++}i=i.previousSibling}return null}function _C(i,a,c){switch(a=of(c),i){case"html":if(i=a.documentElement,!i)throw Error(r(452));return i;case"head":if(i=a.head,!i)throw Error(r(453));return i;case"body":if(i=a.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Su(i){for(var a=i.attributes;a.length;)i.removeAttributeNode(a[0]);Hc(i)}var _i=new Map,yC=new Set;function af(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Us=$.d;$.d={f:e4,r:t4,D:n4,C:r4,L:i4,m:s4,X:a4,S:o4,M:l4};function e4(){var i=Us.f(),a=Zh();return i||a}function t4(i){var a=mo(i);a!==null&&a.tag===5&&a.type==="form"?Pw(a):Us.r(i)}var $l=typeof document>"u"?null:document;function xC(i,a,c){var m=$l;if(m&&typeof a=="string"&&a){var _=jt(a);_='link[rel="'+i+'"][href="'+_+'"]',typeof c=="string"&&(_+='[crossorigin="'+c+'"]'),yC.has(_)||(yC.add(_),i={rel:i,crossOrigin:c,href:a},m.querySelector(_)===null&&(a=m.createElement("link"),dr(a,"link",i),Mn(a),m.head.appendChild(a)))}}function n4(i){Us.D(i),xC("dns-prefetch",i,null)}function r4(i,a){Us.C(i,a),xC("preconnect",i,a)}function i4(i,a,c){Us.L(i,a,c);var m=$l;if(m&&i&&a){var _='link[rel="preload"][as="'+jt(a)+'"]';a==="image"&&c&&c.imageSrcSet?(_+='[imagesrcset="'+jt(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(_+='[imagesizes="'+jt(c.imageSizes)+'"]')):_+='[href="'+jt(i)+'"]';var x=_;switch(a){case"style":x=Wl(i);break;case"script":x=Vl(i)}_i.has(x)||(i=p({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:i,as:a},c),_i.set(x,i),m.querySelector(_)!==null||a==="style"&&m.querySelector(Cu(x))||a==="script"&&m.querySelector(ku(x))||(a=m.createElement("link"),dr(a,"link",i),Mn(a),m.head.appendChild(a)))}}function s4(i,a){Us.m(i,a);var c=$l;if(c&&i){var m=a&&typeof a.as=="string"?a.as:"script",_='link[rel="modulepreload"][as="'+jt(m)+'"][href="'+jt(i)+'"]',x=_;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Vl(i)}if(!_i.has(x)&&(i=p({rel:"modulepreload",href:i},a),_i.set(x,i),c.querySelector(_)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(ku(x)))return}m=c.createElement("link"),dr(m,"link",i),Mn(m),c.head.appendChild(m)}}}function o4(i,a,c){Us.S(i,a,c);var m=$l;if(m&&i){var _=po(m).hoistableStyles,x=Wl(i);a=a||"default";var T=_.get(x);if(!T){var z={loading:0,preload:null};if(T=m.querySelector(Cu(x)))z.loading=5;else{i=p({rel:"stylesheet",href:i,"data-precedence":a},c),(c=_i.get(x))&&Kv(i,c);var Z=T=m.createElement("link");Mn(Z),dr(Z,"link",i),Z._p=new Promise(function(le,ve){Z.onload=le,Z.onerror=ve}),Z.addEventListener("load",function(){z.loading|=1}),Z.addEventListener("error",function(){z.loading|=2}),z.loading|=4,lf(T,a,m)}T={type:"stylesheet",instance:T,count:1,state:z},_.set(x,T)}}}function a4(i,a){Us.X(i,a);var c=$l;if(c&&i){var m=po(c).hoistableScripts,_=Vl(i),x=m.get(_);x||(x=c.querySelector(ku(_)),x||(i=p({src:i,async:!0},a),(a=_i.get(_))&&Gv(i,a),x=c.createElement("script"),Mn(x),dr(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},m.set(_,x))}}function l4(i,a){Us.M(i,a);var c=$l;if(c&&i){var m=po(c).hoistableScripts,_=Vl(i),x=m.get(_);x||(x=c.querySelector(ku(_)),x||(i=p({src:i,async:!0,type:"module"},a),(a=_i.get(_))&&Gv(i,a),x=c.createElement("script"),Mn(x),dr(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},m.set(_,x))}}function wC(i,a,c,m){var _=(_=J.current)?af(_):null;if(!_)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(a=Wl(c.href),c=po(_).hoistableStyles,m=c.get(a),m||(m={type:"style",instance:null,count:0,state:null},c.set(a,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=Wl(c.href);var x=po(_).hoistableStyles,T=x.get(i);if(T||(_=_.ownerDocument||_,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,T),(x=_.querySelector(Cu(i)))&&!x._p&&(T.instance=x,T.state.loading=5),_i.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},_i.set(i,c),x||c4(_,i,c,T.state))),a&&m===null)throw Error(r(528,""));return T}if(a&&m!==null)throw Error(r(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Vl(c),c=po(_).hoistableScripts,m=c.get(a),m||(m={type:"script",instance:null,count:0,state:null},c.set(a,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Wl(i){return'href="'+jt(i)+'"'}function Cu(i){return'link[rel="stylesheet"]['+i+"]"}function SC(i){return p({},i,{"data-precedence":i.precedence,precedence:null})}function c4(i,a,c,m){i.querySelector('link[rel="preload"][as="style"]['+a+"]")?m.loading=1:(a=i.createElement("link"),m.preload=a,a.addEventListener("load",function(){return m.loading|=1}),a.addEventListener("error",function(){return m.loading|=2}),dr(a,"link",c),Mn(a),i.head.appendChild(a))}function Vl(i){return'[src="'+jt(i)+'"]'}function ku(i){return"script[async]"+i}function CC(i,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var m=i.querySelector('style[data-href~="'+jt(c.href)+'"]');if(m)return a.instance=m,Mn(m),m;var _=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(i.ownerDocument||i).createElement("style"),Mn(m),dr(m,"style",_),lf(m,c.precedence,i),a.instance=m;case"stylesheet":_=Wl(c.href);var x=i.querySelector(Cu(_));if(x)return a.state.loading|=4,a.instance=x,Mn(x),x;m=SC(c),(_=_i.get(_))&&Kv(m,_),x=(i.ownerDocument||i).createElement("link"),Mn(x);var T=x;return T._p=new Promise(function(z,Z){T.onload=z,T.onerror=Z}),dr(x,"link",m),a.state.loading|=4,lf(x,c.precedence,i),a.instance=x;case"script":return x=Vl(c.src),(_=i.querySelector(ku(x)))?(a.instance=_,Mn(_),_):(m=c,(_=_i.get(x))&&(m=p({},c),Gv(m,_)),i=i.ownerDocument||i,_=i.createElement("script"),Mn(_),dr(_,"link",m),i.head.appendChild(_),a.instance=_);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(m=a.instance,a.state.loading|=4,lf(m,c.precedence,i));return a.instance}function lf(i,a,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=m.length?m[m.length-1]:null,x=_,T=0;T<m.length;T++){var z=m[T];if(z.dataset.precedence===a)x=z;else if(x!==_)break}x?x.parentNode.insertBefore(i,x.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(i,a.firstChild))}function Kv(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.title==null&&(i.title=a.title)}function Gv(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.integrity==null&&(i.integrity=a.integrity)}var cf=null;function kC(i,a,c){if(cf===null){var m=new Map,_=cf=new Map;_.set(c,m)}else _=cf,m=_.get(c),m||(m=new Map,_.set(c,m));if(m.has(i))return m;for(m.set(i,null),c=c.getElementsByTagName(i),_=0;_<c.length;_++){var x=c[_];if(!(x[Ss]||x[K]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var T=x.getAttribute(a)||"";T=i+T;var z=m.get(T);z?z.push(x):m.set(T,[x])}}return m}function EC(i,a,c){i=i.ownerDocument||i,i.head.insertBefore(c,a==="title"?i.querySelector("head > title"):null)}function u4(i,a,c){if(c===1||a.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return i=a.disabled,typeof a.precedence=="string"&&i==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function RC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function d4(i,a,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var _=Wl(m.href),x=a.querySelector(Cu(_));if(x){a=x._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(i.count++,i=uf.bind(i),a.then(i,i)),c.state.loading|=4,c.instance=x,Mn(x);return}x=a.ownerDocument||a,m=SC(m),(_=_i.get(_))&&Kv(m,_),x=x.createElement("link"),Mn(x);var T=x;T._p=new Promise(function(z,Z){T.onload=z,T.onerror=Z}),dr(x,"link",m),c.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=uf.bind(i),a.addEventListener("load",c),a.addEventListener("error",c))}}var Yv=0;function h4(i,a){return i.stylesheets&&i.count===0&&hf(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var m=setTimeout(function(){if(i.stylesheets&&hf(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+a);0<i.imgBytes&&Yv===0&&(Yv=62500*qO());var _=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&hf(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>Yv?50:800)+a);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(m),clearTimeout(_)}}:null}function uf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hf(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var df=null;function hf(i,a){i.stylesheets=null,i.unsuspend!==null&&(i.count++,df=new Map,a.forEach(f4,i),df=null,uf.call(i))}function f4(i,a){if(!(a.state.loading&4)){var c=df.get(i);if(c)var m=c.get(null);else{c=new Map,df.set(i,c);for(var _=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<_.length;x++){var T=_[x];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(c.set(T.dataset.precedence,T),m=T)}m&&c.set(null,m)}_=a.instance,T=_.getAttribute("data-precedence"),x=c.get(T)||m,x===m&&c.set(null,_),c.set(T,_),this.count++,m=uf.bind(this),_.addEventListener("load",m),_.addEventListener("error",m),x?x.parentNode.insertBefore(_,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(_,i.firstChild)),a.state.loading|=4}}var Eu={$$typeof:E,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function m4(i,a,c,m,_,x,T,z,Z){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=At(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.hiddenUpdates=At(null),this.identifierPrefix=m,this.onUncaughtError=_,this.onCaughtError=x,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function TC(i,a,c,m,_,x,T,z,Z,le,ve,_e){return i=new m4(i,a,c,T,Z,le,ve,_e,z),a=1,x===!0&&(a|=24),x=Gr(3,null,null,a),i.current=x,x.stateNode=i,a=Tg(),a.refCount++,i.pooledCache=a,a.refCount++,x.memoizedState={element:m,isDehydrated:c,cache:a},Dg(x),i}function NC(i){return i?(i=wl,i):wl}function MC(i,a,c,m,_,x){_=NC(_),m.context===null?m.context=_:m.pendingContext=_,m=So(a),m.payload={element:c},x=x===void 0?null:x,x!==null&&(m.callback=x),c=Co(i,m,a),c!==null&&(Ir(c,i,a),iu(c,i,a))}function AC(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<a?c:a}}function Xv(i,a){AC(i,a),(i=i.alternate)&&AC(i,a)}function DC(i){if(i.tag===13||i.tag===31){var a=pa(i,67108864);a!==null&&Ir(a,i,67108864),Xv(i,67108864)}}function jC(i){if(i.tag===13||i.tag===31){var a=Jr();a=Tt(a);var c=pa(i,a);c!==null&&Ir(c,i,a),Xv(i,a)}}var ff=!0;function p4(i,a,c,m){var _=O.T;O.T=null;var x=$.p;try{$.p=2,Zv(i,a,c,m)}finally{$.p=x,O.T=_}}function g4(i,a,c,m){var _=O.T;O.T=null;var x=$.p;try{$.p=8,Zv(i,a,c,m)}finally{$.p=x,O.T=_}}function Zv(i,a,c,m){if(ff){var _=Qv(m);if(_===null)Pv(i,a,m,mf,c),LC(i,m);else if(b4(_,i,a,c,m))m.stopPropagation();else if(LC(i,m),a&4&&-1<v4.indexOf(i)){for(;_!==null;){var x=mo(_);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var T=It(x.pendingLanes);if(T!==0){var z=x;for(z.pendingLanes|=2,z.entangledLanes|=2;T;){var Z=1<<31-we(T);z.entanglements[1]|=Z,T&=~Z}ts(x),(Ft&6)===0&&(Yh=Se()+500,yu(0))}}break;case 31:case 13:z=pa(x,2),z!==null&&Ir(z,x,2),Zh(),Xv(x,2)}if(x=Qv(m),x===null&&Pv(i,a,m,mf,c),x===_)break;_=x}_!==null&&m.stopPropagation()}else Pv(i,a,m,null,c)}}function Qv(i){return i=eg(i),Jv(i)}var mf=null;function Jv(i){if(mf=null,i=fo(i),i!==null){var a=o(i);if(a===null)i=null;else{var c=a.tag;if(c===13){if(i=l(a),i!==null)return i;i=null}else if(c===31){if(i=u(a),i!==null)return i;i=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return mf=i,null}function OC(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(qe()){case se:return 2;case pe:return 8;case Ne:case He:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var eb=!1,Lo=null,zo=null,Po=null,Ru=new Map,Tu=new Map,Bo=[],v4="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 LC(i,a){switch(i){case"focusin":case"focusout":Lo=null;break;case"dragenter":case"dragleave":zo=null;break;case"mouseover":case"mouseout":Po=null;break;case"pointerover":case"pointerout":Ru.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tu.delete(a.pointerId)}}function Nu(i,a,c,m,_,x){return i===null||i.nativeEvent!==x?(i={blockedOn:a,domEventName:c,eventSystemFlags:m,nativeEvent:x,targetContainers:[_]},a!==null&&(a=mo(a),a!==null&&DC(a)),i):(i.eventSystemFlags|=m,a=i.targetContainers,_!==null&&a.indexOf(_)===-1&&a.push(_),i)}function b4(i,a,c,m,_){switch(a){case"focusin":return Lo=Nu(Lo,i,a,c,m,_),!0;case"dragenter":return zo=Nu(zo,i,a,c,m,_),!0;case"mouseover":return Po=Nu(Po,i,a,c,m,_),!0;case"pointerover":var x=_.pointerId;return Ru.set(x,Nu(Ru.get(x)||null,i,a,c,m,_)),!0;case"gotpointercapture":return x=_.pointerId,Tu.set(x,Nu(Tu.get(x)||null,i,a,c,m,_)),!0}return!1}function zC(i){var a=fo(i.target);if(a!==null){var c=o(a);if(c!==null){if(a=c.tag,a===13){if(a=l(c),a!==null){i.blockedOn=a,an(i.priority,function(){jC(c)});return}}else if(a===31){if(a=u(c),a!==null){i.blockedOn=a,an(i.priority,function(){jC(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function pf(i){if(i.blockedOn!==null)return!1;for(var a=i.targetContainers;0<a.length;){var c=Qv(i.nativeEvent);if(c===null){c=i.nativeEvent;var m=new c.constructor(c.type,c);Jp=m,c.target.dispatchEvent(m),Jp=null}else return a=mo(c),a!==null&&DC(a),i.blockedOn=c,!1;a.shift()}return!0}function PC(i,a,c){pf(i)&&c.delete(a)}function _4(){eb=!1,Lo!==null&&pf(Lo)&&(Lo=null),zo!==null&&pf(zo)&&(zo=null),Po!==null&&pf(Po)&&(Po=null),Ru.forEach(PC),Tu.forEach(PC)}function gf(i,a){i.blockedOn===a&&(i.blockedOn=null,eb||(eb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_4)))}var vf=null;function BC(i){vf!==i&&(vf=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){vf===i&&(vf=null);for(var a=0;a<i.length;a+=3){var c=i[a],m=i[a+1],_=i[a+2];if(typeof m!="function"){if(Jv(m||c)===null)continue;break}var x=mo(c);x!==null&&(i.splice(a,3),a-=3,Qg(x,{pending:!0,data:_,method:c.method,action:m},m,_))}}))}function ql(i){function a(Z){return gf(Z,i)}Lo!==null&&gf(Lo,i),zo!==null&&gf(zo,i),Po!==null&&gf(Po,i),Ru.forEach(a),Tu.forEach(a);for(var c=0;c<Bo.length;c++){var m=Bo[c];m.blockedOn===i&&(m.blockedOn=null)}for(;0<Bo.length&&(c=Bo[0],c.blockedOn===null);)zC(c),c.blockedOn===null&&Bo.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var _=c[m],x=c[m+1],T=_[Ie]||null;if(typeof x=="function")T||BC(c);else if(T){var z=null;if(x&&x.hasAttribute("formAction")){if(_=x,T=x[Ie]||null)z=T.formAction;else if(Jv(_)!==null)continue}else z=T.action;typeof z=="function"?c[m+1]=z:(c.splice(m,3),m-=3),BC(c)}}}function IC(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(T){return _=T})},focusReset:"manual",scroll:"manual"})}function a(){_!==null&&(_(),_=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,_=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),_!==null&&(_(),_=null)}}}function tb(i){this._internalRoot=i}bf.prototype.render=tb.prototype.render=function(i){var a=this._internalRoot;if(a===null)throw Error(r(409));var c=a.current,m=Jr();MC(c,m,i,a,null,null)},bf.prototype.unmount=tb.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var a=i.containerInfo;MC(i.current,2,null,i,null,null),Zh(),a[mn]=null}};function bf(i){this._internalRoot=i}bf.prototype.unstable_scheduleHydration=function(i){if(i){var a=Yt();i={blockedOn:null,target:i,priority:a};for(var c=0;c<Bo.length&&a!==0&&a<Bo[c].priority;c++);Bo.splice(c,0,i),c===0&&zC(i)}};var FC=t.version;if(FC!=="19.2.1")throw Error(r(527,FC,"19.2.1"));$.findDOMNode=function(i){var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(a),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var y4={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_f.isDisabled&&_f.supportsFiber)try{Le=_f.inject(y4),Ke=_f}catch{}}return Du.createRoot=function(i,a){if(!s(i))throw Error(r(299));var c=!1,m="",_=Kw,x=Gw,T=Yw;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(_=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError)),a=TC(i,1,!1,null,null,c,m,null,_,x,T,IC),i[mn]=a.current,zv(i),new tb(a)},Du.hydrateRoot=function(i,a,c){if(!s(i))throw Error(r(299));var m=!1,_="",x=Kw,T=Gw,z=Yw,Z=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(T=c.onCaughtError),c.onRecoverableError!==void 0&&(z=c.onRecoverableError),c.formState!==void 0&&(Z=c.formState)),a=TC(i,1,!0,a,c??null,m,_,Z,x,T,z,IC),a.context=NC(null),c=a.current,m=Jr(),m=Tt(m),_=So(m),_.callback=null,Co(c,_,m),c=m,a.current.lanes=c,ut(a,c),ts(a),i[mn]=a.current,zv(i),new bf(a)},Du.version="19.2.1",Du}var ek;function D4(){if(ek)return ib.exports;ek=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(),ib.exports=A4(),ib.exports}var j4=D4();/**
|
|
50
|
+
* react-router v7.13.2
|
|
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 tk="popstate";function nk(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function O4(e={}){function t(r,s){var d;let o=(d=s.state)==null?void 0:d.masked,{pathname:l,search:u,hash:h}=o||r.location;return k_("",{pathname:l,search:u,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:vd(s)}return z4(t,n,null,e)}function hn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Di(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function L4(){return Math.random().toString(36).substring(2,10)}function rk(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 k_(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Sc(t):t,state:n,key:t&&t.key||r||L4(),unstable_mask:s}}function vd({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 Sc(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 z4(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,l=s.history,u="POP",h=null,d=g();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function g(){return(l.state||{idx:null}).idx}function p(){u="POP";let C=g(),k=C==null?null:C-d;d=C,h&&h({action:u,location:S.location,delta:k})}function v(C,k){u="PUSH";let R=nk(C)?C:k_(S.location,C,k);d=g()+1;let E=rk(R,d),M=S.createHref(R.unstable_mask||R);try{l.pushState(E,"",M)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;s.location.assign(M)}o&&h&&h({action:u,location:S.location,delta:1})}function y(C,k){u="REPLACE";let R=nk(C)?C:k_(S.location,C,k);d=g();let E=rk(R,d),M=S.createHref(R.unstable_mask||R);l.replaceState(E,"",M),o&&h&&h({action:u,location:S.location,delta:0})}function w(C){return P4(C)}let S={get action(){return u},get location(){return e(s,l)},listen(C){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(tk,p),h=C,()=>{s.removeEventListener(tk,p),h=null}},createHref(C){return t(s,C)},createURL:w,encodeLocation(C){let k=w(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:v,replace:y,go(C){return l.go(C)}};return S}function P4(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),hn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:vd(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function cT(e,t,n="/"){return B4(e,t,n,!1)}function B4(e,t,n,r){let s=typeof t=="string"?Sc(t):t,o=Qs(s.pathname||"/",n);if(o==null)return null;let l=uT(e);I4(l);let u=null;for(let h=0;u==null&&h<l.length;++h){let d=X4(o);u=G4(l[h],d,r)}return u}function uT(e,t=[],n=[],r="",s=!1){let o=(l,u,h=s,d)=>{let g={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&h)return;hn(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let p=gs([r,g.relativePath]),v=n.concat(g);l.children&&l.children.length>0&&(hn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),uT(l.children,t,v,p,h)),!(l.path==null&&!l.index)&&t.push({path:p,score:q4(p,l.index),routesMeta:v})};return e.forEach((l,u)=>{var h;if(l.path===""||!((h=l.path)!=null&&h.includes("?")))o(l,u);else for(let d of dT(l.path))o(l,u,!0,d)}),t}function dT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let l=dT(r.join("/")),u=[];return u.push(...l.map(h=>h===""?o:[o,h].join("/"))),s&&u.push(...l),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function I4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:K4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var F4=/^:[\w-]+$/,H4=3,U4=2,$4=1,W4=10,V4=-2,ik=e=>e==="*";function q4(e,t){let n=e.split("/"),r=n.length;return n.some(ik)&&(r+=V4),t&&(r+=U4),n.filter(s=>!ik(s)).reduce((s,o)=>s+(F4.test(o)?H4:o===""?$4:W4),r)}function K4(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 G4(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",l=[];for(let u=0;u<r.length;++u){let h=r[u],d=u===r.length-1,g=o==="/"?t:t.slice(o.length)||"/",p=bm({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},g),v=h.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=bm({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!p)return null;Object.assign(s,p.params),l.push({params:s,pathname:gs([o,p.pathname]),pathnameBase:eL(gs([o,p.pathnameBase])),route:v}),p.pathnameBase!=="/"&&(o=gs([o,p.pathnameBase]))}return l}function bm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Y4(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],l=o.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((d,{paramName:g,isOptional:p},v)=>{if(g==="*"){let w=u[v]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const y=u[v];return p&&!y?d[g]=void 0:d[g]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:l,pattern:e}}function Y4(e,t=!1,n=!0){Di(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,h,d,g)=>{if(r.push({paramName:u,isOptional:h!=null}),h){let p=g.charAt(d+l.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 X4(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Di(!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 Qs(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 Z4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Q4(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Sc(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=sk(n.substring(1),"/"):o=sk(n,t)):o=t,{pathname:o,search:tL(r),hash:nL(s)}}function sk(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 lb(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 J4(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fx(e){let t=J4(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function rp(e,t,n,r=!1){let s;typeof e=="string"?s=Sc(e):(s={...e},hn(!s.pathname||!s.pathname.includes("?"),lb("?","pathname","search",s)),hn(!s.pathname||!s.pathname.includes("#"),lb("#","pathname","hash",s)),hn(!s.search||!s.search.includes("#"),lb("#","search","hash",s)));let o=e===""||s.pathname==="",l=o?"/":s.pathname,u;if(l==null)u=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),p-=1;s.pathname=v.join("/")}u=p>=0?t[p]:"/"}let h=Q4(s,u),d=l&&l!=="/"&&l.endsWith("/"),g=(o||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(d||g)&&(h.pathname+="/"),h}var gs=e=>e.join("/").replace(/\/\/+/g,"/"),eL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),tL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,rL=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 iL(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function sL(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var hT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function fT(e,t){let n=e;if(typeof n!="string"||!Z4.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(hT)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),u=Qs(l.pathname,t);l.origin===o.origin&&u!=null?n=u+l.search+l.hash:s=!0}catch{Di(!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 mT=["POST","PUT","PATCH","DELETE"];new Set(mT);var oL=["GET",...mT];new Set(oL);var Cc=b.createContext(null);Cc.displayName="DataRouter";var ip=b.createContext(null);ip.displayName="DataRouterState";var aL=b.createContext(!1),pT=b.createContext({isTransitioning:!1});pT.displayName="ViewTransition";var lL=b.createContext(new Map);lL.displayName="Fetchers";var cL=b.createContext(null);cL.displayName="Await";var ci=b.createContext(null);ci.displayName="Navigation";var Od=b.createContext(null);Od.displayName="Location";var ji=b.createContext({outlet:null,matches:[],isDataRoute:!1});ji.displayName="Route";var mx=b.createContext(null);mx.displayName="RouteError";var gT="REACT_ROUTER_ERROR",uL="REDIRECT",dL="ROUTE_ERROR_RESPONSE";function hL(e){if(e.startsWith(`${gT}:${uL}:{`))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 fL(e){if(e.startsWith(`${gT}:${dL}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new rL(t.status,t.statusText,t.data)}catch{}}function mL(e,{relative:t}={}){hn(kc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=b.useContext(ci),{hash:s,pathname:o,search:l}=Ld(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:gs([n,o])),r.createHref({pathname:u,search:l,hash:s})}function kc(){return b.useContext(Od)!=null}function Oi(){return hn(kc(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Od).location}var vT="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bT(e){b.useContext(ci).static||b.useLayoutEffect(e)}function rl(){let{isDataRoute:e}=b.useContext(ji);return e?TL():pL()}function pL(){hn(kc(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Cc),{basename:t,navigator:n}=b.useContext(ci),{matches:r}=b.useContext(ji),{pathname:s}=Oi(),o=JSON.stringify(fx(r)),l=b.useRef(!1);return bT(()=>{l.current=!0}),b.useCallback((h,d={})=>{if(Di(l.current,vT),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=rp(h,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:gs([t,g.pathname])),(d.replace?n.replace:n.push)(g,d.state,d)},[t,n,o,s,e])}var _T=b.createContext(null);function sp(){return b.useContext(_T)}function gL(e){let t=b.useContext(ji).outlet;return b.useMemo(()=>t&&b.createElement(_T.Provider,{value:e},t),[t,e])}function yT(){let{matches:e}=b.useContext(ji),t=e[e.length-1];return t?t.params:{}}function Ld(e,{relative:t}={}){let{matches:n}=b.useContext(ji),{pathname:r}=Oi(),s=JSON.stringify(fx(n));return b.useMemo(()=>rp(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function vL(e,t){return xT(e,t)}function xT(e,t,n){var C;hn(kc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=b.useContext(ci),{matches:s}=b.useContext(ji),o=s[s.length-1],l=o?o.params:{},u=o?o.pathname:"/",h=o?o.pathnameBase:"/",d=o&&o.route;{let k=d&&d.path||"";ST(u,!d||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 g=Oi(),p;if(t){let k=typeof t=="string"?Sc(t):t;hn(h==="/"||((C=k.pathname)==null?void 0:C.startsWith(h)),`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 "${h}" but pathname "${k.pathname}" was given in the \`location\` prop.`),p=k}else p=g;let v=p.pathname||"/",y=v;if(h!=="/"){let k=h.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=cT(e,{pathname:y});Di(d||w!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Di(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.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 S=wL(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:gs([h,r.encodeLocation?r.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:gs([h,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&S?b.createElement(Od.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},S):S}function bL(){let e=RL(),t=iL(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},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:s},n):null,l)}var _L=b.createElement(bL,null),wT=class extends b.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=fL(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(ji.Provider,{value:this.props.routeContext},b.createElement(mx.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(yL,{error:e},t):t}};wT.contextType=aL;var cb=new WeakMap;function yL({children:e,error:t}){let{basename:n}=b.useContext(ci);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=hL(t.digest);if(r){let s=cb.get(t);if(s)throw s;let o=fT(r.location,n);if(hT&&!cb.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw cb.set(t,l),l}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function xL({routeContext:e,match:t,children:n}){let r=b.useContext(Cc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(ji.Provider,{value:e},n)}function wL(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,o=r==null?void 0:r.errors;if(o!=null){let g=s.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);hn(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,g+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let g=0;g<s.length;g++){let p=s[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=g),p.route.id){let{loaderData:v,errors:y}=r,w=p.route.loader&&!v.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||w){n.isStatic&&(l=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let h=n==null?void 0:n.onError,d=r&&h?(g,p)=>{var v,y;h(g,{location:r.location,params:((y=(v=r.matches)==null?void 0:v[0])==null?void 0:y.params)??{},unstable_pattern:sL(r.matches),errorInfo:p})}:void 0;return s.reduceRight((g,p,v)=>{let y,w=!1,S=null,C=null;r&&(y=o&&p.route.id?o[p.route.id]:void 0,S=p.route.errorElement||_L,l&&(u<0&&v===0?(ST("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):u===v&&(w=!0,C=p.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,v+1)),R=()=>{let E;return y?E=S:w?E=C:p.route.Component?E=b.createElement(p.route.Component,null):p.route.element?E=p.route.element:E=g,b.createElement(xL,{match:p,routeContext:{outlet:g,matches:k,isDataRoute:r!=null},children:E})};return r&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?b.createElement(wT,{location:r.location,revalidation:r.revalidation,component:S,error:y,children:R(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):R()},null)}function px(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function SL(e){let t=b.useContext(Cc);return hn(t,px(e)),t}function CL(e){let t=b.useContext(ip);return hn(t,px(e)),t}function kL(e){let t=b.useContext(ji);return hn(t,px(e)),t}function gx(e){let t=kL(e),n=t.matches[t.matches.length-1];return hn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function EL(){return gx("useRouteId")}function RL(){var r;let e=b.useContext(mx),t=CL("useRouteError"),n=gx("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function TL(){let{router:e}=SL("useNavigate"),t=gx("useNavigate"),n=b.useRef(!1);return bT(()=>{n.current=!0}),b.useCallback(async(s,o={})=>{Di(n.current,vT),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var ok={};function ST(e,t,n){!t&&!ok[e]&&(ok[e]=!0,Di(!1,n))}b.memo(NL);function NL({routes:e,future:t,state:n,isStatic:r,onError:s}){return xT(e,void 0,{state:n,isStatic:r,onError:s})}function ML({to:e,replace:t,state:n,relative:r}){hn(kc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=b.useContext(ci);Di(!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:o}=b.useContext(ji),{pathname:l}=Oi(),u=rl(),h=rp(e,fx(o),l,r==="path"),d=JSON.stringify(h);return b.useEffect(()=>{u(JSON.parse(d),{replace:t,state:n,relative:r})},[u,d,r,t,n]),null}function AL(e){return gL(e.context)}function La(e){hn(!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 DL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1,unstable_useTransitions:l}){hn(!kc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:u,navigator:s,static:o,unstable_useTransitions:l,future:{}}),[u,s,o,l]);typeof n=="string"&&(n=Sc(n));let{pathname:d="/",search:g="",hash:p="",state:v=null,key:y="default",unstable_mask:w}=n,S=b.useMemo(()=>{let C=Qs(d,u);return C==null?null:{location:{pathname:C,search:g,hash:p,state:v,key:y,unstable_mask:w},navigationType:r}},[u,d,g,p,v,y,r,w]);return Di(S!=null,`<Router basename="${u}"> is not able to match the URL "${d}${g}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:b.createElement(ci.Provider,{value:h},b.createElement(Od.Provider,{children:t,value:S}))}function jL({children:e,location:t}){return vL(E_(e),t)}function E_(e,t=[]){let n=[];return b.Children.forEach(e,(r,s)=>{if(!b.isValidElement(r))return;let o=[...t,s];if(r.type===b.Fragment){n.push.apply(n,E_(r.props.children,o));return}hn(r.type===La,`[${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>`),hn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.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=E_(r.props.children,o)),n.push(l)}),n}var tm="get",nm="application/x-www-form-urlencoded";function op(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function OL(e){return op(e)&&e.tagName.toLowerCase()==="button"}function LL(e){return op(e)&&e.tagName.toLowerCase()==="form"}function zL(e){return op(e)&&e.tagName.toLowerCase()==="input"}function PL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function BL(e,t){return e.button===0&&(!t||t==="_self")&&!PL(e)}function R_(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function IL(e,t){let n=R_(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var yf=null;function FL(){if(yf===null)try{new FormData(document.createElement("form"),0),yf=!1}catch{yf=!0}return yf}var HL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ub(e){return e!=null&&!HL.has(e)?(Di(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${nm}"`),null):e}function UL(e,t){let n,r,s,o,l;if(LL(e)){let u=e.getAttribute("action");r=u?Qs(u,t):null,n=e.getAttribute("method")||tm,s=ub(e.getAttribute("enctype"))||nm,o=new FormData(e)}else if(OL(e)||zL(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 h=e.getAttribute("formaction")||u.getAttribute("action");if(r=h?Qs(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||tm,s=ub(e.getAttribute("formenctype"))||ub(u.getAttribute("enctype"))||nm,o=new FormData(u,e),!FL()){let{name:d,type:g,value:p}=e;if(g==="image"){let v=d?`${d}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else d&&o.append(d,p)}}else{if(op(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=tm,r=null,s=nm,l=e}return o&&s==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $L(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&&Qs(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function WL(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 VL(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 qL(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let l=await WL(o,n);return l.links?l.links():[]}return[]}));return XL(r.flat(1).filter(VL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function ak(e,t,n,r,s,o){let l=(h,d)=>n[d]?h.route.id!==n[d].route.id:!0,u=(h,d)=>{var g;return n[d].pathname!==h.pathname||((g=n[d].route.path)==null?void 0:g.endsWith("*"))&&n[d].params["*"]!==h.params["*"]};return o==="assets"?t.filter((h,d)=>l(h,d)||u(h,d)):o==="data"?t.filter((h,d)=>{var p;let g=r.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(l(h,d)||u(h,d))return!0;if(h.route.shouldRevalidate){let v=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function KL(e,t,{includeHydrateFallback:n}={}){return GL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function GL(e){return[...new Set(e)]}function YL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function XL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(YL(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function CT(){let e=b.useContext(Cc);return vx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ZL(){let e=b.useContext(ip);return vx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var bx=b.createContext(void 0);bx.displayName="FrameworkContext";function kT(){let e=b.useContext(bx);return vx(e,"You must render this element inside a <HydratedRouter> element"),e}function QL(e,t){let n=b.useContext(bx),[r,s]=b.useState(!1),[o,l]=b.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:d,onMouseLeave:g,onTouchStart:p}=t,v=b.useRef(null);b.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=k=>{k.forEach(R=>{l(R.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[e]),b.useEffect(()=>{if(r){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[r]);let y=()=>{s(!0)},w=()=>{s(!1),l(!1)};return n?e!=="intent"?[o,v,{}]:[o,v,{onFocus:ju(u,y),onBlur:ju(h,w),onMouseEnter:ju(d,y),onMouseLeave:ju(g,w),onTouchStart:ju(p,y)}]:[!1,v,{}]}function ju(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function JL({page:e,...t}){let{router:n}=CT(),r=b.useMemo(()=>cT(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?b.createElement(tz,{page:e,matches:r,...t}):null}function ez(e){let{manifest:t,routeModules:n}=kT(),[r,s]=b.useState([]);return b.useEffect(()=>{let o=!1;return qL(e,t,n).then(l=>{o||s(l)}),()=>{o=!0}},[e,t,n]),r}function tz({page:e,matches:t,...n}){let r=Oi(),{future:s,manifest:o,routeModules:l}=kT(),{basename:u}=CT(),{loaderData:h,matches:d}=ZL(),g=b.useMemo(()=>ak(e,t,d,o,r,"data"),[e,t,d,o,r]),p=b.useMemo(()=>ak(e,t,d,o,r,"assets"),[e,t,d,o,r]),v=b.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,C=!1;if(t.forEach(R=>{var M;let E=o.routes[R.route.id];!E||!E.hasLoader||(!g.some(L=>L.route.id===R.route.id)&&R.route.id in h&&((M=l[R.route.id])!=null&&M.shouldRevalidate)||E.hasClientLoader?C=!0:S.add(R.route.id))}),S.size===0)return[];let k=$L(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return C&&S.size>0&&k.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[k.pathname+k.search]},[u,s.unstable_trailingSlashAwareDataRequests,h,r,o,g,t,e,l]),y=b.useMemo(()=>KL(p,o),[p,o]),w=ez(p);return b.createElement(b.Fragment,null,v.map(S=>b.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),y.map(S=>b.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),w.map(({key:S,link:C})=>b.createElement("link",{key:S,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function nz(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var rz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rz&&(window.__reactRouterVersion="7.13.2")}catch{}function iz({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=b.useRef();s.current==null&&(s.current=O4({window:r,v5Compat:!0}));let o=s.current,[l,u]=b.useState({action:o.action,location:o.location}),h=b.useCallback(d=>{n===!1?u(d):b.startTransition(()=>u(d))},[n]);return b.useLayoutEffect(()=>o.listen(h),[o,h]),b.createElement(DL,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var ET=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RT=b.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:l,unstable_mask:u,state:h,target:d,to:g,preventScrollReset:p,viewTransition:v,unstable_defaultShouldRevalidate:y,...w},S){let{basename:C,navigator:k,unstable_useTransitions:R}=b.useContext(ci),E=typeof g=="string"&&ET.test(g),M=fT(g,C);g=M.to;let L=mL(g,{relative:s}),j=Oi(),D=null;if(u){let V=rp(u,[],j.unstable_mask?j.unstable_mask.pathname:"/",!0);C!=="/"&&(V.pathname=V.pathname==="/"?C:gs([C,V.pathname])),D=k.createHref(V)}let[H,G,I]=QL(r,w),q=lz(g,{replace:l,unstable_mask:u,state:h,target:d,preventScrollReset:p,relative:s,viewTransition:v,unstable_defaultShouldRevalidate:y,unstable_useTransitions:R});function B(V){t&&t(V),V.defaultPrevented||q(V)}let W=!(M.isExternal||o),F=b.createElement("a",{...w,...I,href:(W?D:void 0)||M.absoluteURL||L,onClick:W?B:t,ref:nz(S,G),target:d,"data-discover":!E&&n==="render"?"true":void 0});return H&&!E?b.createElement(b.Fragment,null,F,b.createElement(JL,{page:L})):F});RT.displayName="Link";var sz=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:l,viewTransition:u,children:h,...d},g){let p=Ld(l,{relative:d.relative}),v=Oi(),y=b.useContext(ip),{navigator:w,basename:S}=b.useContext(ci),C=y!=null&&mz(p)&&u===!0,k=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,R=v.pathname,E=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(R=R.toLowerCase(),E=E?E.toLowerCase():null,k=k.toLowerCase()),E&&S&&(E=Qs(E,S)||E);const M=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let L=R===k||!s&&R.startsWith(k)&&R.charAt(M)==="/",j=E!=null&&(E===k||!s&&E.startsWith(k)&&E.charAt(k.length)==="/"),D={isActive:L,isPending:j,isTransitioning:C},H=L?t:void 0,G;typeof r=="function"?G=r(D):G=[r,L?"active":null,j?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let I=typeof o=="function"?o(D):o;return b.createElement(RT,{...d,"aria-current":H,className:G,ref:g,style:I,to:l,viewTransition:u},typeof h=="function"?h(D):h)});sz.displayName="NavLink";var oz=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:l=tm,action:u,onSubmit:h,relative:d,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:v,...y},w)=>{let{unstable_useTransitions:S}=b.useContext(ci),C=hz(),k=fz(u,{relative:d}),R=l.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&ET.test(u),M=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let j=L.nativeEvent.submitter,D=(j==null?void 0:j.getAttribute("formmethod"))||l,H=()=>C(j||L.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:s,state:o,relative:d,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:v});S&&n!==!1?b.startTransition(()=>H()):H()};return b.createElement("form",{ref:w,method:R,action:k,onSubmit:r?h:M,...y,"data-discover":!E&&e==="render"?"true":void 0})});oz.displayName="Form";function az(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TT(e){let t=b.useContext(Cc);return hn(t,az(e)),t}function lz(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:o,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:d}={}){let g=rl(),p=Oi(),v=Ld(e,{relative:l});return b.useCallback(y=>{if(BL(y,t)){y.preventDefault();let w=n!==void 0?n:vd(p)===vd(v),S=()=>g(e,{replace:w,unstable_mask:r,state:s,preventScrollReset:o,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:h});d?b.startTransition(()=>S()):S()}},[p,g,v,n,r,s,t,e,o,l,u,h,d])}function cz(e){Di(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=b.useRef(R_(e)),n=b.useRef(!1),r=Oi(),s=b.useMemo(()=>IL(r.search,n.current?null:t.current),[r.search]),o=rl(),l=b.useCallback((u,h)=>{const d=R_(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,o("?"+d,h)},[o,s]);return[s,l]}var uz=0,dz=()=>`__${String(++uz)}__`;function hz(){let{router:e}=TT("useSubmit"),{basename:t}=b.useContext(ci),n=EL(),r=e.fetch,s=e.navigate;return b.useCallback(async(o,l={})=>{let{action:u,method:h,encType:d,formData:g,body:p}=UL(o,t);if(l.navigate===!1){let v=l.fetcherKey||dz();await r(v,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:p,formMethod:l.method||h,formEncType:l.encType||d,flushSync:l.flushSync})}else await s(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:p,formMethod:l.method||h,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,s,t,n])}function fz(e,{relative:t}={}){let{basename:n}=b.useContext(ci),r=b.useContext(ji);hn(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Ld(e||".",{relative:t})},l=Oi();if(e==null){o.search=l.search;let u=new URLSearchParams(o.search),h=u.getAll("index");if(h.some(g=>g==="")){u.delete("index"),h.filter(p=>p).forEach(p=>u.append("index",p));let g=u.toString();o.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:gs([n,o.pathname])),vd(o)}function mz(e,{relative:t}={}){let n=b.useContext(pT);hn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=TT("useViewTransitionState"),s=Ld(e,{relative:t});if(!n.isTransitioning)return!1;let o=Qs(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Qs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return bm(s.pathname,l)!=null||bm(s.pathname,o)!=null}var Ui=lT();const NT=np(Ui);function pz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const gz=e=>{switch(e){case"success":return _z;case"info":return xz;case"warning":return yz;case"error":return wz;default:return null}},vz=Array(12).fill(0),bz=({visible:e,className:t})=>xe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},xe.createElement("div",{className:"sonner-spinner"},vz.map((n,r)=>xe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),_z=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),yz=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},xe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),xz=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),wz=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Sz=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},xe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),xe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Cz=()=>{const[e,t]=xe.useState(document.hidden);return xe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let T_=1;class kz{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:T_++,l=this.toasts.find(h=>h.id===o),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(h=>h.id===o?(this.publish({...h,...t,id:o,title:r}),{...h,...t,id:o,dismissible:u,title:r}):h):this.addToast({title:r,...s,dismissible:u,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const u=s.then(async d=>{if(l=["resolve",d],xe.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if(Rz(d)&&!d.ok){o=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!xe.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...w})}else if(d instanceof Error){o=!1;const p=typeof n.error=="function"?await n.error(d):n.error,v=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!xe.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...w})}else if(n.success!==void 0){o=!1;const p=typeof n.success=="function"?await n.success(d):n.success,v=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!xe.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:v,...w})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){o=!1;const g=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,y=typeof g=="object"&&!xe.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),h=()=>new Promise((d,g)=>u.then(()=>l[0]==="reject"?g(l[1]):d(l[1])).catch(g));return typeof r!="string"&&typeof r!="number"?{unwrap:h}:Object.assign(r,{unwrap:h})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||T_++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const $r=new kz,Ez=(e,t)=>{const n=(t==null?void 0:t.id)||T_++;return $r.addToast({title:e,...t,id:n}),n},Rz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Tz=Ez,Nz=()=>$r.toasts,Mz=()=>$r.getActiveToasts(),xf=Object.assign(Tz,{success:$r.success,info:$r.info,warning:$r.warning,error:$r.error,custom:$r.custom,message:$r.message,promise:$r.promise,dismiss:$r.dismiss,loading:$r.loading},{getHistory:Nz,getToasts:Mz});pz("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function wf(e){return e.label!==void 0}const Az=3,Dz="24px",jz="16px",lk=4e3,Oz=356,Lz=14,zz=45,Pz=200;function ns(...e){return e.filter(Boolean).join(" ")}function Bz(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Iz=e=>{var t,n,r,s,o,l,u,h,d;const{invert:g,toast:p,unstyled:v,interacting:y,setHeights:w,visibleToasts:S,heights:C,index:k,toasts:R,expanded:E,removeToast:M,defaultRichColors:L,closeButton:j,style:D,cancelButtonStyle:H,actionButtonStyle:G,className:I="",descriptionClassName:q="",duration:B,position:W,gap:F,expandByDefault:V,classNames:O,icons:$,closeButtonAriaLabel:U="Close toast"}=e,[Y,A]=xe.useState(null),[P,X]=xe.useState(null),[N,ne]=xe.useState(!1),[oe,J]=xe.useState(!1),[te,ue]=xe.useState(!1),[he,ge]=xe.useState(!1),[ke,Ee]=xe.useState(!1),[De,Xe]=xe.useState(0),[pt,at]=xe.useState(0),fe=xe.useRef(p.duration||B||lk),Ve=xe.useRef(null),Ae=xe.useRef(null),et=k===0,lt=k+1<=S,nt=p.type,Kt=p.dismissible!==!1,Se=p.className||"",qe=p.descriptionClassName||"",se=xe.useMemo(()=>C.findIndex(Pe=>Pe.toastId===p.id)||0,[C,p.id]),pe=xe.useMemo(()=>{var Pe;return(Pe=p.closeButton)!=null?Pe:j},[p.closeButton,j]),Ne=xe.useMemo(()=>p.duration||B||lk,[p.duration,B]),He=xe.useRef(0),Oe=xe.useRef(0),xt=xe.useRef(0),Bt=xe.useRef(null),[Le,Ke]=W.split("-"),ft=xe.useMemo(()=>C.reduce((Pe,ot,wt)=>wt>=se?Pe:Pe+ot.height,0),[C,se]),we=Cz(),Rt=p.invert||g,Gt=nt==="loading";Oe.current=xe.useMemo(()=>se*F+ft,[se,ft]),xe.useEffect(()=>{fe.current=Ne},[Ne]),xe.useEffect(()=>{ne(!0)},[]),xe.useEffect(()=>{const Pe=Ae.current;if(Pe){const ot=Pe.getBoundingClientRect().height;return at(ot),w(wt=>[{toastId:p.id,height:ot,position:p.position},...wt]),()=>w(wt=>wt.filter(gt=>gt.toastId!==p.id))}},[w,p.id]),xe.useLayoutEffect(()=>{if(!N)return;const Pe=Ae.current,ot=Pe.style.height;Pe.style.height="auto";const wt=Pe.getBoundingClientRect().height;Pe.style.height=ot,at(wt),w(gt=>gt.find(ut=>ut.toastId===p.id)?gt.map(ut=>ut.toastId===p.id?{...ut,height:wt}:ut):[{toastId:p.id,height:wt,position:p.position},...gt])},[N,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const _n=xe.useCallback(()=>{J(!0),Xe(Oe.current),w(Pe=>Pe.filter(ot=>ot.toastId!==p.id)),setTimeout(()=>{M(p)},Pz)},[p,M,w,Oe]);xe.useEffect(()=>{if(p.promise&&nt==="loading"||p.duration===1/0||p.type==="loading")return;let Pe;return E||y||we?(()=>{if(xt.current<He.current){const gt=new Date().getTime()-He.current;fe.current=fe.current-gt}xt.current=new Date().getTime()})():(()=>{fe.current!==1/0&&(He.current=new Date().getTime(),Pe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),_n()},fe.current))})(),()=>clearTimeout(Pe)},[E,y,p,nt,we,_n]),xe.useEffect(()=>{p.delete&&(_n(),p.onDismiss==null||p.onDismiss.call(p,p))},[_n,p.delete]);function Kn(){var Pe;if($!=null&&$.loading){var ot;return xe.createElement("div",{className:ns(O==null?void 0:O.loader,p==null||(ot=p.classNames)==null?void 0:ot.loader,"sonner-loader"),"data-visible":nt==="loading"},$.loading)}return xe.createElement(bz,{className:ns(O==null?void 0:O.loader,p==null||(Pe=p.classNames)==null?void 0:Pe.loader),visible:nt==="loading"})}const Sr=p.icon||($==null?void 0:$[nt])||gz(nt);var Lt,It;return xe.createElement("li",{tabIndex:0,ref:Ae,className:ns(I,Se,O==null?void 0:O.toast,p==null||(t=p.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[nt],p==null||(n=p.classNames)==null?void 0:n[nt]),"data-sonner-toast":"","data-rich-colors":(Lt=p.richColors)!=null?Lt:L,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":N,"data-promise":!!p.promise,"data-swiped":ke,"data-removed":oe,"data-visible":lt,"data-y-position":Le,"data-x-position":Ke,"data-index":k,"data-front":et,"data-swiping":te,"data-dismissible":Kt,"data-type":nt,"data-invert":Rt,"data-swipe-out":he,"data-swipe-direction":P,"data-expanded":!!(E||V&&N),"data-testid":p.testId,style:{"--index":k,"--toasts-before":k,"--z-index":R.length-k,"--offset":`${oe?De:Oe.current}px`,"--initial-height":V?"auto":`${pt}px`,...D,...p.style},onDragEnd:()=>{ue(!1),A(null),Bt.current=null},onPointerDown:Pe=>{Pe.button!==2&&(Gt||!Kt||(Ve.current=new Date,Xe(Oe.current),Pe.target.setPointerCapture(Pe.pointerId),Pe.target.tagName!=="BUTTON"&&(ue(!0),Bt.current={x:Pe.clientX,y:Pe.clientY})))},onPointerUp:()=>{var Pe,ot,wt;if(he||!Kt)return;Bt.current=null;const gt=Number(((Pe=Ae.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),At=Number(((ot=Ae.current)==null?void 0:ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ut=new Date().getTime()-((wt=Ve.current)==null?void 0:wt.getTime()),mt=Y==="x"?gt:At,yn=Math.abs(mt)/ut;if(Math.abs(mt)>=zz||yn>.11){Xe(Oe.current),p.onDismiss==null||p.onDismiss.call(p,p),X(Y==="x"?gt>0?"right":"left":At>0?"down":"up"),_n(),ge(!0);return}else{var Te,je;(Te=Ae.current)==null||Te.style.setProperty("--swipe-amount-x","0px"),(je=Ae.current)==null||je.style.setProperty("--swipe-amount-y","0px")}Ee(!1),ue(!1),A(null)},onPointerMove:Pe=>{var ot,wt,gt;if(!Bt.current||!Kt||((ot=window.getSelection())==null?void 0:ot.toString().length)>0)return;const ut=Pe.clientY-Bt.current.y,mt=Pe.clientX-Bt.current.x;var yn;const Te=(yn=e.swipeDirections)!=null?yn:Bz(W);!Y&&(Math.abs(mt)>1||Math.abs(ut)>1)&&A(Math.abs(mt)>Math.abs(ut)?"x":"y");let je={x:0,y:0};const Tt=it=>1/(1.5+Math.abs(it)/20);if(Y==="y"){if(Te.includes("top")||Te.includes("bottom"))if(Te.includes("top")&&ut<0||Te.includes("bottom")&&ut>0)je.y=ut;else{const it=ut*Tt(ut);je.y=Math.abs(it)<Math.abs(ut)?it:ut}}else if(Y==="x"&&(Te.includes("left")||Te.includes("right")))if(Te.includes("left")&&mt<0||Te.includes("right")&&mt>0)je.x=mt;else{const it=mt*Tt(mt);je.x=Math.abs(it)<Math.abs(mt)?it:mt}(Math.abs(je.x)>0||Math.abs(je.y)>0)&&Ee(!0),(wt=Ae.current)==null||wt.style.setProperty("--swipe-amount-x",`${je.x}px`),(gt=Ae.current)==null||gt.style.setProperty("--swipe-amount-y",`${je.y}px`)}},pe&&!p.jsx&&nt!=="loading"?xe.createElement("button",{"aria-label":U,"data-disabled":Gt,"data-close-button":!0,onClick:Gt||!Kt?()=>{}:()=>{_n(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ns(O==null?void 0:O.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(It=$==null?void 0:$.close)!=null?It:Sz):null,(nt||p.icon||p.promise)&&p.icon!==null&&(($==null?void 0:$[nt])!==null||p.icon)?xe.createElement("div",{"data-icon":"",className:ns(O==null?void 0:O.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Kn():null,p.type!=="loading"?Sr:null):null,xe.createElement("div",{"data-content":"",className:ns(O==null?void 0:O.content,p==null||(o=p.classNames)==null?void 0:o.content)},xe.createElement("div",{"data-title":"",className:ns(O==null?void 0:O.title,p==null||(l=p.classNames)==null?void 0:l.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?xe.createElement("div",{"data-description":"",className:ns(q,qe,O==null?void 0:O.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),xe.isValidElement(p.cancel)?p.cancel:p.cancel&&wf(p.cancel)?xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||H,onClick:Pe=>{wf(p.cancel)&&Kt&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Pe),_n())},className:ns(O==null?void 0:O.cancelButton,p==null||(h=p.classNames)==null?void 0:h.cancelButton)},p.cancel.label):null,xe.isValidElement(p.action)?p.action:p.action&&wf(p.action)?xe.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||G,onClick:Pe=>{wf(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Pe),!Pe.defaultPrevented&&_n())},className:ns(O==null?void 0:O.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function ck(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Fz(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,l=o?"--mobile-offset":"--offset",u=o?jz:Dz;function h(d){["top","right","bottom","left"].forEach(g=>{n[`${l}-${g}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?h(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=u:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):h(u)}),n}const Hz=xe.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:h,className:d,offset:g,mobileOffset:p,theme:v="light",richColors:y,duration:w,style:S,visibleToasts:C=Az,toastOptions:k,dir:R=ck(),gap:E=Lz,icons:M,containerAriaLabel:L="Notifications"}=t,[j,D]=xe.useState([]),H=xe.useMemo(()=>r?j.filter(N=>N.toasterId===r):j.filter(N=>!N.toasterId),[j,r]),G=xe.useMemo(()=>Array.from(new Set([o].concat(H.filter(N=>N.position).map(N=>N.position)))),[H,o]),[I,q]=xe.useState([]),[B,W]=xe.useState(!1),[F,V]=xe.useState(!1),[O,$]=xe.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=xe.useRef(null),Y=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=xe.useRef(null),P=xe.useRef(!1),X=xe.useCallback(N=>{D(ne=>{var oe;return(oe=ne.find(J=>J.id===N.id))!=null&&oe.delete||$r.dismiss(N.id),ne.filter(({id:J})=>J!==N.id)})},[]);return xe.useEffect(()=>$r.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{D(ne=>ne.map(oe=>oe.id===N.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{NT.flushSync(()=>{D(ne=>{const oe=ne.findIndex(J=>J.id===N.id);return oe!==-1?[...ne.slice(0,oe),{...ne[oe],...N},...ne.slice(oe+1)]:[N,...ne]})})})}),[j]),xe.useEffect(()=>{if(v!=="system"){$(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const N=window.matchMedia("(prefers-color-scheme: dark)");try{N.addEventListener("change",({matches:ne})=>{$(ne?"dark":"light")})}catch{N.addListener(({matches:oe})=>{try{$(oe?"dark":"light")}catch(J){console.error(J)}})}},[v]),xe.useEffect(()=>{j.length<=1&&W(!1)},[j]),xe.useEffect(()=>{const N=ne=>{var oe;if(l.every(ue=>ne[ue]||ne.code===ue)){var te;W(!0),(te=U.current)==null||te.focus()}ne.code==="Escape"&&(document.activeElement===U.current||(oe=U.current)!=null&&oe.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[l]),xe.useEffect(()=>{if(U.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,P.current=!1)}},[U.current]),xe.createElement("section",{ref:n,"aria-label":`${L} ${Y}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},G.map((N,ne)=>{var oe;const[J,te]=N.split("-");return H.length?xe.createElement("ol",{key:N,dir:R==="auto"?ck():R,tabIndex:-1,ref:U,className:d,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":J,"data-x-position":te,style:{"--front-toast-height":`${((oe=I[0])==null?void 0:oe.height)||0}px`,"--width":`${Oz}px`,"--gap":`${E}px`,...S,...Fz(g,p)},onBlur:ue=>{P.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(P.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||P.current||(P.current=!0,A.current=ue.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{F||W(!1)},onDragEnd:()=>W(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},H.filter(ue=>!ue.position&&ne===0||ue.position===N).map((ue,he)=>{var ge,ke;return xe.createElement(Iz,{key:ue.id,icons:M,index:he,toast:ue,defaultRichColors:y,duration:(ge=k==null?void 0:k.duration)!=null?ge:w,className:k==null?void 0:k.className,descriptionClassName:k==null?void 0:k.descriptionClassName,invert:s,visibleToasts:C,closeButton:(ke=k==null?void 0:k.closeButton)!=null?ke:h,interacting:F,position:N,style:k==null?void 0:k.style,unstyled:k==null?void 0:k.unstyled,classNames:k==null?void 0:k.classNames,cancelButtonStyle:k==null?void 0:k.cancelButtonStyle,actionButtonStyle:k==null?void 0:k.actionButtonStyle,closeButtonAriaLabel:k==null?void 0:k.closeButtonAriaLabel,removeToast:X,toasts:H.filter(Ee=>Ee.position==ue.position),heights:I.filter(Ee=>Ee.position==ue.position),setHeights:q,expandByDefault:u,gap:E,expanded:B,swipeDirections:t.swipeDirections})})):null}))});function MT(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=MT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function AT(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=MT(e))&&(r&&(r+=" "),r+=t);return r}const uk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,dk=AT,Uz=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return dk(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(d=>{const g=n==null?void 0:n[d],p=o==null?void 0:o[d];if(g===null)return null;const v=uk(g)||uk(p);return s[d][v]}),u=n&&Object.entries(n).reduce((d,g)=>{let[p,v]=g;return v===void 0||(d[p]=v),d},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,g)=>{let{class:p,className:v,...y}=g;return Object.entries(y).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...o,...u}[S]):{...o,...u}[S]===C})?[...d,p,v]:d},[]);return dk(e,l,h,n==null?void 0:n.class,n==null?void 0:n.className)},$z=(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},Wz=(e,t)=>({classGroupId:e,validator:t}),DT=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),_m="-",hk=[],Vz="arbitrary..",qz=e=>{const t=Gz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Kz(l);const u=l.split(_m),h=u[0]===""&&u.length>1?1:0;return jT(u,h,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const h=r[l],d=n[l];return h?d?$z(d,h):h:d||hk}return n[l]||hk}}},jT=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const d=jT(e,t+1,o);if(d)return d}const l=n.validators;if(l===null)return;const u=t===0?e.join(_m):e.slice(t).join(_m),h=l.length;for(let d=0;d<h;d++){const g=l[d];if(g.validator(u))return g.classGroupId}},Kz=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?Vz+r:void 0})(),Gz=e=>{const{theme:t,classGroups:n}=e;return Yz(n,t)},Yz=(e,t)=>{const n=DT();for(const r in e){const s=e[r];_x(s,n,r,t)}return n},_x=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const l=e[o];Xz(l,t,n,r)}},Xz=(e,t,n,r)=>{if(typeof e=="string"){Zz(e,t,n);return}if(typeof e=="function"){Qz(e,t,n,r);return}Jz(e,t,n,r)},Zz=(e,t,n)=>{const r=e===""?t:OT(t,e);r.classGroupId=n},Qz=(e,t,n,r)=>{if(eP(e)){_x(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Wz(n,e))},Jz=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let l=0;l<o;l++){const[u,h]=s[l];_x(h,OT(t,u),n,r)}},OT=(e,t)=>{let n=e;const r=t.split(_m),s=r.length;for(let o=0;o<s;o++){const l=r[o];let u=n.nextPart.get(l);u||(u=DT(),n.nextPart.set(l,u)),n=u}return n},eP=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,tP=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return s(o,l),l},set(o,l){o in n?n[o]=l:s(o,l)}}},N_="!",fk=":",nP=[],mk=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),rP=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let l=0,u=0,h=0,d;const g=s.length;for(let S=0;S<g;S++){const C=s[S];if(l===0&&u===0){if(C===fk){o.push(s.slice(h,S)),h=S+1;continue}if(C==="/"){d=S;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const p=o.length===0?s:s.slice(h);let v=p,y=!1;p.endsWith(N_)?(v=p.slice(0,-1),y=!0):p.startsWith(N_)&&(v=p.slice(1),y=!0);const w=d&&d>h?d-h:void 0;return mk(o,y,v,w)};if(t){const s=t+fk,o=r;r=l=>l.startsWith(s)?o(l.slice(s.length)):mk(nP,!1,l,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},iP=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let o=0;o<n.length;o++){const l=n[o],u=l[0]==="[",h=t.has(l);u||h?(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}},sP=e=>({cache:tP(e.cacheSize),parseClassName:rP(e),sortModifiers:iP(e),...qz(e)}),oP=/\s+/,aP=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,l=[],u=e.trim().split(oP);let h="";for(let d=u.length-1;d>=0;d-=1){const g=u[d],{isExternal:p,modifiers:v,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:S}=n(g);if(p){h=g+(h.length>0?" "+h:h);continue}let C=!!S,k=r(C?w.substring(0,S):w);if(!k){if(!C){h=g+(h.length>0?" "+h:h);continue}if(k=r(w),!k){h=g+(h.length>0?" "+h:h);continue}C=!1}const R=v.length===0?"":v.length===1?v[0]:o(v).join(":"),E=y?R+N_:R,M=E+k;if(l.indexOf(M)>-1)continue;l.push(M);const L=s(k,C);for(let j=0;j<L.length;++j){const D=L[j];l.push(E+D)}h=g+(h.length>0?" "+h:h)}return h},lP=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=LT(n))&&(s&&(s+=" "),s+=r);return s},LT=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=LT(e[r]))&&(n&&(n+=" "),n+=t);return n},cP=(e,...t)=>{let n,r,s,o;const l=h=>{const d=t.reduce((g,p)=>p(g),e());return n=sP(d),r=n.cache.get,s=n.cache.set,o=u,u(h)},u=h=>{const d=r(h);if(d)return d;const g=aP(h,n);return s(h,g),g};return o=l,(...h)=>o(lP(...h))},uP=[],Hn=e=>{const t=n=>n[e]||uP;return t.isThemeGetter=!0,t},zT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,PT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dP=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fP=/\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$/,mP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fo=e=>dP.test(e),bt=e=>!!e&&!Number.isNaN(Number(e)),Ho=e=>!!e&&Number.isInteger(Number(e)),db=e=>e.endsWith("%")&&bt(e.slice(0,-1)),$s=e=>hP.test(e),BT=()=>!0,vP=e=>fP.test(e)&&!mP.test(e),yx=()=>!1,bP=e=>pP.test(e),_P=e=>gP.test(e),yP=e=>!We(e)&&!Ge(e),xP=e=>ia(e,HT,yx),We=e=>zT.test(e),Ta=e=>ia(e,UT,vP),pk=e=>ia(e,NP,bt),wP=e=>ia(e,WT,BT),SP=e=>ia(e,$T,yx),gk=e=>ia(e,IT,yx),CP=e=>ia(e,FT,_P),Sf=e=>ia(e,VT,bP),Ge=e=>PT.test(e),Ou=e=>il(e,UT),kP=e=>il(e,$T),vk=e=>il(e,IT),EP=e=>il(e,HT),RP=e=>il(e,FT),Cf=e=>il(e,VT,!0),TP=e=>il(e,WT,!0),ia=(e,t,n)=>{const r=zT.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},il=(e,t,n=!1)=>{const r=PT.exec(e);return r?r[1]?t(r[1]):n:!1},IT=e=>e==="position"||e==="percentage",FT=e=>e==="image"||e==="url",HT=e=>e==="length"||e==="size"||e==="bg-size",UT=e=>e==="length",NP=e=>e==="number",$T=e=>e==="family-name",WT=e=>e==="number"||e==="weight",VT=e=>e==="shadow",MP=()=>{const e=Hn("color"),t=Hn("font"),n=Hn("text"),r=Hn("font-weight"),s=Hn("tracking"),o=Hn("leading"),l=Hn("breakpoint"),u=Hn("container"),h=Hn("spacing"),d=Hn("radius"),g=Hn("shadow"),p=Hn("inset-shadow"),v=Hn("text-shadow"),y=Hn("drop-shadow"),w=Hn("blur"),S=Hn("perspective"),C=Hn("aspect"),k=Hn("ease"),R=Hn("animate"),E=()=>["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(),Ge,We],j=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],H=()=>[Ge,We,h],G=()=>[Fo,"full","auto",...H()],I=()=>[Ho,"none","subgrid",Ge,We],q=()=>["auto",{span:["full",Ho,Ge,We]},Ho,Ge,We],B=()=>[Ho,"auto",Ge,We],W=()=>["auto","min","max","fr",Ge,We],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...H()],$=()=>[Fo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],U=()=>[Fo,"screen","full","dvw","lvw","svw","min","max","fit",...H()],Y=()=>[Fo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],A=()=>[e,Ge,We],P=()=>[...M(),vk,gk,{position:[Ge,We]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",EP,xP,{size:[Ge,We]}],ne=()=>[db,Ou,Ta],oe=()=>["","none","full",d,Ge,We],J=()=>["",bt,Ou,Ta],te=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[bt,db,vk,gk],ge=()=>["","none",w,Ge,We],ke=()=>["none",bt,Ge,We],Ee=()=>["none",bt,Ge,We],De=()=>[bt,Ge,We],Xe=()=>[Fo,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$s],breakpoint:[$s],color:[BT],container:[$s],"drop-shadow":[$s],ease:["in","out","in-out"],font:[yP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$s],shadow:[$s],spacing:["px",bt],text:[$s],"text-shadow":[$s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fo,We,Ge,C]}],container:["container"],columns:[{columns:[bt,We,Ge,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],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:[Ho,"auto",Ge,We]}],basis:[{basis:[Fo,"full","auto",u,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[bt,Fo,"auto","initial","none",We]}],grow:[{grow:["",bt,Ge,We]}],shrink:[{shrink:["",bt,Ge,We]}],order:[{order:[Ho,"first","last","none",Ge,We]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],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:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[u,"screen",...$()]}],"min-w":[{"min-w":[u,"screen","none",...$()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Ou,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,TP,wP]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",db,We]}],"font-family":[{font:[kP,SP,t]}],"font-features":[{"font-features":[We]}],"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,Ge,We]}],"line-clamp":[{"line-clamp":[bt,"none",Ge,pk]}],leading:[{leading:[o,...H()]}],"list-image":[{"list-image":["none",Ge,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,We]}],"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:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[bt,"from-font","auto",Ge,Ta]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[bt,"auto",Ge,We]}],"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",Ge,We]}],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",Ge,We]}],"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:X()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ho,Ge,We],radial:["",Ge,We],conic:[Ho,Ge,We]},RP,CP]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"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:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[bt,Ge,We]}],"outline-w":[{outline:["",bt,Ou,Ta]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",g,Cf,Sf]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",p,Cf,Sf]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[bt,Ta]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",v,Cf,Sf]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[bt,Ge,We]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[bt]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"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":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"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":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"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":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"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":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"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":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"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":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ge,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"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":[bt]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"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:X()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,We]}],filter:[{filter:["","none",Ge,We]}],blur:[{blur:ge()}],brightness:[{brightness:[bt,Ge,We]}],contrast:[{contrast:[bt,Ge,We]}],"drop-shadow":[{"drop-shadow":["","none",y,Cf,Sf]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",bt,Ge,We]}],"hue-rotate":[{"hue-rotate":[bt,Ge,We]}],invert:[{invert:["",bt,Ge,We]}],saturate:[{saturate:[bt,Ge,We]}],sepia:[{sepia:["",bt,Ge,We]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,We]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[bt,Ge,We]}],"backdrop-contrast":[{"backdrop-contrast":[bt,Ge,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",bt,Ge,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[bt,Ge,We]}],"backdrop-invert":[{"backdrop-invert":["",bt,Ge,We]}],"backdrop-opacity":[{"backdrop-opacity":[bt,Ge,We]}],"backdrop-saturate":[{"backdrop-saturate":[bt,Ge,We]}],"backdrop-sepia":[{"backdrop-sepia":["",bt,Ge,We]}],"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",Ge,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[bt,"initial",Ge,We]}],ease:[{ease:["linear","initial",k,Ge,We]}],delay:[{delay:[bt,Ge,We]}],animate:[{animate:["none",R,Ge,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ge,We]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:De()}],"skew-x":[{"skew-x":De()}],"skew-y":[{"skew-y":De()}],transform:[{transform:[Ge,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xe()}],"translate-x":[{"translate-x":Xe()}],"translate-y":[{"translate-y":Xe()}],"translate-z":[{"translate-z":Xe()}],"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",Ge,We]}],"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",Ge,We]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[bt,Ou,Ta,pk]}],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"]}},AP=cP(MP);function me(...e){return AP(AT(e))}function id(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function bk(e){return e.startsWith("chatId:")?e.slice(7):e}const qT=Uz("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 border-input disabled:bg-transparent disabled:text-foreground/50 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-9 w-9 rounded-full","icon-sm":"h-5.5 w-5.5 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),Ze=b.forwardRef(({className:e,variant:t,size:n,...r},s)=>f.jsx("button",{className:me(qT({variant:t,size:n,className:e})),ref:s,...r}));Ze.displayName="Button";function Fe(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 _k(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xx(...e){return t=>{let n=!1;const r=e.map(s=>{const o=_k(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():_k(e[s],null)}}}}function Ut(...e){return b.useCallback(xx(...e),e)}function DP(e,t){const n=b.createContext(t),r=o=>{const{children:l,...u}=o,h=b.useMemo(()=>u,Object.values(u));return f.jsx(n.Provider,{value:h,children:l})};r.displayName=e+"Provider";function s(o){const l=b.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function io(e,t=[]){let n=[];function r(o,l){const u=b.createContext(l),h=n.length;n=[...n,l];const d=p=>{var k;const{scope:v,children:y,...w}=p,S=((k=v==null?void 0:v[e])==null?void 0:k[h])||u,C=b.useMemo(()=>w,Object.values(w));return f.jsx(S.Provider,{value:C,children:y})};d.displayName=o+"Provider";function g(p,v){var S;const y=((S=v==null?void 0:v[e])==null?void 0:S[h])||u,w=b.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[d,g]}const s=()=>{const o=n.map(l=>b.createContext(l));return function(u){const h=(u==null?void 0:u[e])||o;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:h}}),[u,h])}};return s.scopeName=e,[r,jP(s,...t)]}function jP(...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(o){const l=r.reduce((u,{useScope:h,scopeName:d})=>{const p=h(o)[`__scope${d}`];return{...u,...p}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var xr=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},OP=aT[" useId ".trim().toString()]||(()=>{}),LP=0;function Zs(e){const[t,n]=b.useState(OP());return xr(()=>{n(r=>r??String(LP++))},[e]),t?`radix-${t}`:""}var zP=aT[" useInsertionEffect ".trim().toString()]||xr;function pc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,l]=PP({defaultProp:t,onChange:n}),u=e!==void 0,h=u?e:s;{const g=b.useRef(e!==void 0);b.useEffect(()=>{const p=g.current;p!==u&&console.warn(`${r} is changing from ${p?"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.`),g.current=u},[u,r])}const d=b.useCallback(g=>{var p;if(u){const v=BP(g)?g(e):g;v!==e&&((p=l.current)==null||p.call(l,v))}else o(g)},[u,e,o,l]);return[h,d]}function PP({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),s=b.useRef(n),o=b.useRef(t);return zP(()=>{o.current=t},[t]),b.useEffect(()=>{var l;s.current!==n&&((l=o.current)==null||l.call(o,n),s.current=n)},[n,s]),[n,r,o]}function BP(e){return typeof e=="function"}function qa(e){const t=IP(e),n=b.forwardRef((r,s)=>{const{children:o,...l}=r,u=b.Children.toArray(o),h=u.find(HP);if(h){const d=h.props.children,g=u.map(p=>p===h?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:p);return f.jsx(t,{...l,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,g):null})}return f.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function IP(e){const t=b.forwardRef((n,r)=>{const{children:s,...o}=n;if(b.isValidElement(s)){const l=$P(s),u=UP(o,s.props);return s.type!==b.Fragment&&(u.ref=r?xx(r,l):l),b.cloneElement(s,u)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KT=Symbol("radix.slottable");function FP(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=KT,t}function HP(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KT}function UP(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{const h=o(...u);return s(...u),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function $P(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 WP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Et=WP.reduce((e,t)=>{const n=qa(`Primitive.${t}`),r=b.forwardRef((s,o)=>{const{asChild:l,...u}=s,h=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(h,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function GT(e,t){e&&Ui.flushSync(()=>e.dispatchEvent(t))}function Vi(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function VP(e,t=globalThis==null?void 0:globalThis.document){const n=Vi(e);b.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 qP="DismissableLayer",M_="dismissableLayer.update",KP="dismissableLayer.pointerDownOutside",GP="dismissableLayer.focusOutside",yk,YT=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ec=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...h}=e,d=b.useContext(YT),[g,p]=b.useState(null),v=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=b.useState({}),w=Ut(t,D=>p(D)),S=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),R=g?S.indexOf(g):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,M=R>=k,L=ZP(D=>{const H=D.target,G=[...d.branches].some(I=>I.contains(H));!M||G||(s==null||s(D),l==null||l(D),D.defaultPrevented||u==null||u())},v),j=QP(D=>{const H=D.target;[...d.branches].some(I=>I.contains(H))||(o==null||o(D),l==null||l(D),D.defaultPrevented||u==null||u())},v);return VP(D=>{R===d.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&u&&(D.preventDefault(),u()))},v),b.useEffect(()=>{if(g)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(yk=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(g)),d.layers.add(g),xk(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=yk)}},[g,v,n,d]),b.useEffect(()=>()=>{g&&(d.layers.delete(g),d.layersWithOutsidePointerEventsDisabled.delete(g),xk())},[g,d]),b.useEffect(()=>{const D=()=>y({});return document.addEventListener(M_,D),()=>document.removeEventListener(M_,D)},[]),f.jsx(Et.div,{...h,ref:w,style:{pointerEvents:E?M?"auto":"none":void 0,...e.style},onFocusCapture:Fe(e.onFocusCapture,j.onFocusCapture),onBlurCapture:Fe(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Fe(e.onPointerDownCapture,L.onPointerDownCapture)})});Ec.displayName=qP;var YP="DismissableLayerBranch",XP=b.forwardRef((e,t)=>{const n=b.useContext(YT),r=b.useRef(null),s=Ut(t,r);return b.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),f.jsx(Et.div,{...e,ref:s})});XP.displayName=YP;function ZP(e,t=globalThis==null?void 0:globalThis.document){const n=Vi(e),r=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let h=function(){XT(KP,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=h,t.addEventListener("click",s.current,{once:!0})):h()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function QP(e,t=globalThis==null?void 0:globalThis.document){const n=Vi(e),r=b.useRef(!1);return b.useEffect(()=>{const s=o=>{o.target&&!r.current&&XT(GP,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function xk(){const e=new CustomEvent(M_);document.dispatchEvent(e)}function XT(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?GT(s,o):s.dispatchEvent(o)}var hb="focusScope.autoFocusOnMount",fb="focusScope.autoFocusOnUnmount",wk={bubbles:!1,cancelable:!0},JP="FocusScope",zd=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=e,[u,h]=b.useState(null),d=Vi(s),g=Vi(o),p=b.useRef(null),v=Ut(t,S=>h(S)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let S=function(E){if(y.paused||!u)return;const M=E.target;u.contains(M)?p.current=M:Ko(p.current,{select:!0})},C=function(E){if(y.paused||!u)return;const M=E.relatedTarget;M!==null&&(u.contains(M)||Ko(p.current,{select:!0}))},k=function(E){if(document.activeElement===document.body)for(const L of E)L.removedNodes.length>0&&Ko(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const R=new MutationObserver(k);return u&&R.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),R.disconnect()}}},[r,u,y.paused]),b.useEffect(()=>{if(u){Ck.add(y);const S=document.activeElement;if(!u.contains(S)){const k=new CustomEvent(hb,wk);u.addEventListener(hb,d),u.dispatchEvent(k),k.defaultPrevented||(eB(sB(ZT(u)),{select:!0}),document.activeElement===S&&Ko(u))}return()=>{u.removeEventListener(hb,d),setTimeout(()=>{const k=new CustomEvent(fb,wk);u.addEventListener(fb,g),u.dispatchEvent(k),k.defaultPrevented||Ko(S??document.body,{select:!0}),u.removeEventListener(fb,g),Ck.remove(y)},0)}}},[u,d,g,y]);const w=b.useCallback(S=>{if(!n&&!r||y.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const R=S.currentTarget,[E,M]=tB(R);E&&M?!S.shiftKey&&k===M?(S.preventDefault(),n&&Ko(E,{select:!0})):S.shiftKey&&k===E&&(S.preventDefault(),n&&Ko(M,{select:!0})):k===R&&S.preventDefault()}},[n,r,y.paused]);return f.jsx(Et.div,{tabIndex:-1,...l,ref:v,onKeyDown:w})});zd.displayName=JP;function eB(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ko(r,{select:t}),document.activeElement!==n)return}function tB(e){const t=ZT(e),n=Sk(t,e),r=Sk(t.reverse(),e);return[n,r]}function ZT(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 Sk(e,t){for(const n of e)if(!nB(n,{upTo:t}))return n}function nB(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 rB(e){return e instanceof HTMLInputElement&&"select"in e}function Ko(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rB(e)&&t&&e.select()}}var Ck=iB();function iB(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=kk(e,t),e.unshift(t)},remove(t){var n;e=kk(e,t),(n=e[0])==null||n.resume()}}}function kk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function sB(e){return e.filter(t=>t.tagName!=="A")}var oB="Portal",Rc=b.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,o]=b.useState(!1);xr(()=>o(!0),[]);const l=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?NT.createPortal(f.jsx(Et.div,{...r,ref:t}),l):null});Rc.displayName=oB;function aB(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Li=e=>{const{present:t,children:n}=e,r=lB(t),s=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=Ut(r.ref,cB(s));return typeof n=="function"||r.isPresent?b.cloneElement(s,{ref:o}):null};Li.displayName="Presence";function lB(e){const[t,n]=b.useState(),r=b.useRef(null),s=b.useRef(e),o=b.useRef("none"),l=e?"mounted":"unmounted",[u,h]=aB(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const d=kf(r.current);o.current=u==="mounted"?d:"none"},[u]),xr(()=>{const d=r.current,g=s.current;if(g!==e){const v=o.current,y=kf(d);e?h("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?h("UNMOUNT"):h(g&&v!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),xr(()=>{if(t){let d;const g=t.ownerDocument.defaultView??window,p=y=>{const S=kf(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(h("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=kf(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{g.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function kf(e){return(e==null?void 0:e.animationName)||"none"}function cB(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 mb=0;function ap(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ek()),document.body.insertAdjacentElement("beforeend",e[1]??Ek()),mb++,()=>{mb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),mb--}},[])}function Ek(){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 us=function(){return us=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},us.apply(this,arguments)};function QT(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 uB(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var rm="right-scroll-bar-position",im="width-before-scroll-bar",dB="with-scroll-bars-hidden",hB="--removed-body-scroll-bar-size";function pb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function fB(e,t){var n=b.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 mB=typeof window<"u"?b.useLayoutEffect:b.useEffect,Rk=new WeakMap;function pB(e,t){var n=fB(null,function(r){return e.forEach(function(s){return pb(s,r)})});return mB(function(){var r=Rk.get(n);if(r){var s=new Set(r),o=new Set(e),l=n.current;s.forEach(function(u){o.has(u)||pb(u,null)}),o.forEach(function(u){s.has(u)||pb(u,l)})}Rk.set(n,e)},[e]),n}function gB(e){return e}function vB(e,t){t===void 0&&(t=gB);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(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(o),l=n}var h=function(){var g=l;l=[],g.forEach(o)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(g){l.push(g),d()},filter:function(g){return l=l.filter(g),n}}}};return s}function bB(e){e===void 0&&(e={});var t=vB(null);return t.options=us({async:!0,ssr:!1},e),t}var JT=function(e){var t=e.sideCar,n=QT(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 b.createElement(r,us({},n))};JT.isSideCarExport=!0;function _B(e,t){return e.useMedium(t),JT}var eN=bB(),gb=function(){},lp=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:gb,onWheelCapture:gb,onTouchMoveCapture:gb}),s=r[0],o=r[1],l=e.forwardProps,u=e.children,h=e.className,d=e.removeScrollBar,g=e.enabled,p=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,R=k===void 0?"div":k,E=e.gapMode,M=QT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=v,j=pB([n,t]),D=us(us({},M),s);return b.createElement(b.Fragment,null,g&&b.createElement(L,{sideCar:eN,removeScrollBar:d,shards:p,noRelative:y,noIsolation:w,inert:S,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:E}),l?b.cloneElement(b.Children.only(u),us(us({},D),{ref:j})):b.createElement(R,us({},D,{className:h,ref:j}),u))});lp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lp.classNames={fullWidth:im,zeroRight:rm};var yB=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xB(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=yB();return t&&e.setAttribute("nonce",t),e}function wB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SB(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var CB=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xB())&&(wB(t,n),SB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kB=function(){var e=CB();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tN=function(){var e=kB(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},EB={left:0,top:0,right:0,gap:0},vb=function(e){return parseInt(e||"",10)||0},RB=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[vb(n),vb(r),vb(s)]},TB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return EB;var t=RB(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])}},NB=tN(),cc="data-scroll-locked",MB=function(e,t,n,r){var s=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
+
.`.concat(dB,` {
|
|
62
|
+
overflow: hidden `).concat(r,`;
|
|
63
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
64
|
+
}
|
|
65
|
+
body[`).concat(cc,`] {
|
|
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(o,`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(rm,` {
|
|
79
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(im,` {
|
|
83
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.`).concat(rm," .").concat(rm,` {
|
|
87
|
+
right: 0 `).concat(r,`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.`).concat(im," .").concat(im,` {
|
|
91
|
+
margin-right: 0 `).concat(r,`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
body[`).concat(cc,`] {
|
|
95
|
+
`).concat(hB,": ").concat(u,`px;
|
|
96
|
+
}
|
|
97
|
+
`)},Tk=function(){var e=parseInt(document.body.getAttribute(cc)||"0",10);return isFinite(e)?e:0},AB=function(){b.useEffect(function(){return document.body.setAttribute(cc,(Tk()+1).toString()),function(){var e=Tk()-1;e<=0?document.body.removeAttribute(cc):document.body.setAttribute(cc,e.toString())}},[])},DB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;AB();var o=b.useMemo(function(){return TB(s)},[s]);return b.createElement(NB,{styles:MB(o,!t,s,n?"":"!important")})},A_=!1;if(typeof window<"u")try{var Ef=Object.defineProperty({},"passive",{get:function(){return A_=!0,!0}});window.addEventListener("test",Ef,Ef),window.removeEventListener("test",Ef,Ef)}catch{A_=!1}var Kl=A_?{passive:!1}:!1,jB=function(e){return e.tagName==="TEXTAREA"},nN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!jB(e)&&n[t]==="visible")},OB=function(e){return nN(e,"overflowY")},LB=function(e){return nN(e,"overflowX")},Nk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=rN(e,r);if(s){var o=iN(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},PB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},rN=function(e,t){return e==="v"?OB(t):LB(t)},iN=function(e,t){return e==="v"?zB(t):PB(t)},BB=function(e,t){return e==="h"&&t==="rtl"?-1:1},IB=function(e,t,n,r,s){var o=BB(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,h=t.contains(u),d=!1,g=l>0,p=0,v=0;do{if(!u)break;var y=iN(e,u),w=y[0],S=y[1],C=y[2],k=S-C-o*w;(w||k)&&rN(e,u)&&(p+=k,v+=w);var R=u.parentNode;u=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!h&&u!==document.body||h&&(t.contains(u)||t===u));return(g&&Math.abs(p)<1||!g&&Math.abs(v)<1)&&(d=!0),d},Rf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mk=function(e){return[e.deltaX,e.deltaY]},Ak=function(e){return e&&"current"in e?e.current:e},FB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HB=function(e){return`
|
|
98
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
99
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
100
|
+
`)},UB=0,Gl=[];function $B(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),s=b.useState(UB++)[0],o=b.useState(tN)[0],l=b.useRef(e);b.useEffect(function(){l.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=uB([e.lockRef.current],(e.shards||[]).map(Ak),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=b.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var k=Rf(S),R=n.current,E="deltaX"in S?S.deltaX:R[0]-k[0],M="deltaY"in S?S.deltaY:R[1]-k[1],L,j=S.target,D=Math.abs(E)>Math.abs(M)?"h":"v";if("touches"in S&&D==="h"&&j.type==="range")return!1;var H=window.getSelection(),G=H&&H.anchorNode,I=G?G===j||G.contains(j):!1;if(I)return!1;var q=Nk(D,j);if(!q)return!0;if(q?L=D:(L=D==="v"?"h":"v",q=Nk(D,j)),!q)return!1;if(!r.current&&"changedTouches"in S&&(E||M)&&(r.current=L),!L)return!0;var B=r.current||L;return IB(B,C,S,B==="h"?E:M)},[]),h=b.useCallback(function(S){var C=S;if(!(!Gl.length||Gl[Gl.length-1]!==o)){var k="deltaY"in C?Mk(C):Rf(C),R=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&FB(L.delta,k)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var E=(l.current.shards||[]).map(Ak).filter(Boolean).filter(function(L){return L.contains(C.target)}),M=E.length>0?u(C,E[0]):!l.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),d=b.useCallback(function(S,C,k,R){var E={name:S,delta:C,target:k,should:R,shadowParent:WB(k)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(M){return M!==E})},1)},[]),g=b.useCallback(function(S){n.current=Rf(S),r.current=void 0},[]),p=b.useCallback(function(S){d(S.type,Mk(S),S.target,u(S,e.lockRef.current))},[]),v=b.useCallback(function(S){d(S.type,Rf(S),S.target,u(S,e.lockRef.current))},[]);b.useEffect(function(){return Gl.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",h,Kl),document.addEventListener("touchmove",h,Kl),document.addEventListener("touchstart",g,Kl),function(){Gl=Gl.filter(function(S){return S!==o}),document.removeEventListener("wheel",h,Kl),document.removeEventListener("touchmove",h,Kl),document.removeEventListener("touchstart",g,Kl)}},[]);var y=e.removeScrollBar,w=e.inert;return b.createElement(b.Fragment,null,w?b.createElement(o,{styles:HB(s)}):null,y?b.createElement(DB,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function WB(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const VB=_B(eN,$B);var Pd=b.forwardRef(function(e,t){return b.createElement(lp,us({},e,{ref:t,sideCar:VB}))});Pd.classNames=lp.classNames;var qB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Yl=new WeakMap,Tf=new WeakMap,Nf={},bb=0,sN=function(e){return e&&(e.host||sN(e.parentNode))},KB=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=sN(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})},GB=function(e,t,n,r){var s=KB(t,Array.isArray(e)?e:[e]);Nf[n]||(Nf[n]=new WeakMap);var o=Nf[n],l=[],u=new Set,h=new Set(s),d=function(p){!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);var g=function(p){!p||h.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))g(v);else try{var y=v.getAttribute(r),w=y!==null&&y!=="false",S=(Yl.get(v)||0)+1,C=(o.get(v)||0)+1;Yl.set(v,S),o.set(v,C),l.push(v),S===1&&w&&Tf.set(v,!0),C===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",v,k)}})};return g(t),u.clear(),bb++,function(){l.forEach(function(p){var v=Yl.get(p)-1,y=o.get(p)-1;Yl.set(p,v),o.set(p,y),v||(Tf.has(p)||p.removeAttribute(r),Tf.delete(p)),y||p.removeAttribute(n)}),bb--,bb||(Yl=new WeakMap,Yl=new WeakMap,Tf=new WeakMap,Nf={})}},cp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=qB(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),GB(r,s,n,"aria-hidden")):function(){return null}},up="Dialog",[oN,Nre]=io(up),[YB,Xi]=oN(up),aN=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,u=b.useRef(null),h=b.useRef(null),[d,g]=pc({prop:r,defaultProp:s??!1,onChange:o,caller:up});return f.jsx(YB,{scope:t,triggerRef:u,contentRef:h,contentId:Zs(),titleId:Zs(),descriptionId:Zs(),open:d,onOpenChange:g,onOpenToggle:b.useCallback(()=>g(p=>!p),[g]),modal:l,children:n})};aN.displayName=up;var lN="DialogTrigger",XB=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xi(lN,n),o=Ut(t,s.triggerRef);return f.jsx(Et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Cx(s.open),...r,ref:o,onClick:Fe(e.onClick,s.onOpenToggle)})});XB.displayName=lN;var wx="DialogPortal",[ZB,cN]=oN(wx,{forceMount:void 0}),uN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Xi(wx,t);return f.jsx(ZB,{scope:t,forceMount:n,children:b.Children.map(r,l=>f.jsx(Li,{present:n||o.open,children:f.jsx(Rc,{asChild:!0,container:s,children:l})}))})};uN.displayName=wx;var ym="DialogOverlay",dN=b.forwardRef((e,t)=>{const n=cN(ym,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Xi(ym,e.__scopeDialog);return o.modal?f.jsx(Li,{present:r||o.open,children:f.jsx(JB,{...s,ref:t})}):null});dN.displayName=ym;var QB=qa("DialogOverlay.RemoveScroll"),JB=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xi(ym,n);return f.jsx(Pd,{as:QB,allowPinchZoom:!0,shards:[s.contentRef],children:f.jsx(Et.div,{"data-state":Cx(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ka="DialogContent",hN=b.forwardRef((e,t)=>{const n=cN(Ka,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Xi(Ka,e.__scopeDialog);return f.jsx(Li,{present:r||o.open,children:o.modal?f.jsx(eI,{...s,ref:t}):f.jsx(tI,{...s,ref:t})})});hN.displayName=Ka;var eI=b.forwardRef((e,t)=>{const n=Xi(Ka,e.__scopeDialog),r=b.useRef(null),s=Ut(t,n.contentRef,r);return b.useEffect(()=>{const o=r.current;if(o)return cp(o)},[]),f.jsx(fN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Fe(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Fe(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Fe(e.onFocusOutside,o=>o.preventDefault())})}),tI=b.forwardRef((e,t)=>{const n=Xi(Ka,e.__scopeDialog),r=b.useRef(!1),s=b.useRef(!1);return f.jsx(fN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),fN=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,u=Xi(Ka,n),h=b.useRef(null),d=Ut(t,h);return ap(),f.jsxs(f.Fragment,{children:[f.jsx(zd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:f.jsx(Ec,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Cx(u.open),...l,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(nI,{titleId:u.titleId}),f.jsx(iI,{contentRef:h,descriptionId:u.descriptionId})]})]})}),Sx="DialogTitle",mN=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xi(Sx,n);return f.jsx(Et.h2,{id:s.titleId,...r,ref:t})});mN.displayName=Sx;var pN="DialogDescription",gN=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xi(pN,n);return f.jsx(Et.p,{id:s.descriptionId,...r,ref:t})});gN.displayName=pN;var vN="DialogClose",bN=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xi(vN,n);return f.jsx(Et.button,{type:"button",...r,ref:t,onClick:Fe(e.onClick,()=>s.onOpenChange(!1))})});bN.displayName=vN;function Cx(e){return e?"open":"closed"}var _N="DialogTitleWarning",[Mre,yN]=DP(_N,{contentName:Ka,titleName:Sx,docsSlug:"dialog"}),nI=({titleId:e})=>{const t=yN(_N),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 b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},rI="DialogDescriptionWarning",iI=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yN(rI).contentName}}.`;return b.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},sI=aN,oI=uN,xN=dN,wN=hN,aI=mN,lI=gN,cI=bN;/**
|
|
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 uI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Dk=e=>{const t=dI(e);return t.charAt(0).toUpperCase()+t.slice(1)},SN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),hI=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 fI={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 mI=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:l,...u},h)=>b.createElement("svg",{ref:h,...fI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:SN("lucide",s),...!o&&!hI(u)&&{"aria-hidden":"true"},...u},[...l.map(([d,g])=>b.createElement(d,g)),...Array.isArray(o)?o:[o]]));/**
|
|
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 ze=(e,t)=>{const n=b.forwardRef(({className:r,...s},o)=>b.createElement(mI,{ref:o,iconNode:t,className:SN(`lucide-${uI(Dk(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Dk(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 pI=[["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"}]],gI=ze("archive",pI);/**
|
|
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 vI=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],bI=ze("arrow-down-to-line",vI);/**
|
|
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 _I=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],yI=ze("arrow-down",_I);/**
|
|
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 xI=[["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"}]],wI=ze("arrow-left-right",xI);/**
|
|
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 SI=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],CI=ze("arrow-left",SI);/**
|
|
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 kI=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],EI=ze("arrow-up",kI);/**
|
|
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 RI=[["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"}]],TI=ze("asterisk",RI);/**
|
|
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 NI=[["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"}]],ni=ze("brain",NI);/**
|
|
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 MI=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],AI=ze("check-check",MI);/**
|
|
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 DI=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],jI=ze("check-line",DI);/**
|
|
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 OI=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qi=ze("check",OI);/**
|
|
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 LI=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dp=ze("chevron-down",LI);/**
|
|
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 zI=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],CN=ze("chevron-left",zI);/**
|
|
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 PI=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Mr=ze("chevron-right",PI);/**
|
|
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 BI=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],II=ze("chevron-up",BI);/**
|
|
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 FI=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],HI=ze("chevrons-up",FI);/**
|
|
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 UI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],$I=ze("circle-slash",UI);/**
|
|
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 WI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],VI=ze("circle",WI);/**
|
|
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 qI=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],KI=ze("cloud-download",qI);/**
|
|
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 GI=[["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"}]],jk=ze("code-xml",GI);/**
|
|
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 YI=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],kN=ze("code",YI);/**
|
|
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 XI=[["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"}]],ZI=ze("command",XI);/**
|
|
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 QI=[["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"}]],Bd=ze("copy",QI);/**
|
|
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 JI=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],e6=ze("corner-down-left",JI);/**
|
|
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 t6=[["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"}]],n6=ze("eraser",t6);/**
|
|
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 r6=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],i6=ze("external-link",r6);/**
|
|
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 s6=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ok=ze("eye",s6);/**
|
|
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 o6=[["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"}]],a6=ze("file-pen",o6);/**
|
|
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 l6=[["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"}]],c6=ze("file-plus-corner",l6);/**
|
|
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 u6=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],d6=ze("file-text",u6);/**
|
|
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 h6=[["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"}]],f6=ze("file",h6);/**
|
|
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 m6=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],_b=ze("folder-git-2",m6);/**
|
|
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 p6=[["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"}]],EN=ze("folder-open",p6);/**
|
|
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 g6=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],RN=ze("folder-plus",g6);/**
|
|
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 v6=[["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"}]],TN=ze("folder",v6);/**
|
|
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 b6=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Ws=ze("gauge",b6);/**
|
|
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 _6=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],y6=ze("git-branch",_6);/**
|
|
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 x6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],w6=ze("info",x6);/**
|
|
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 S6=[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]],C6=ze("layout-panel-left",S6);/**
|
|
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 k6=[["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"}]],E6=ze("list-checks",k6);/**
|
|
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 R6=[["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"}]],xm=ze("list-todo",R6);/**
|
|
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 T6=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],li=ze("loader-circle",T6);/**
|
|
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 N6=[["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"}]],Lk=ze("lock-open",N6);/**
|
|
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 M6=[["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"}]],zk=ze("map",M6);/**
|
|
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 A6=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],D_=ze("menu",A6);/**
|
|
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 D6=[["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"}]],NN=ze("message-circle-question-mark",D6);/**
|
|
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 j6=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],O6=ze("message-square-quote",j6);/**
|
|
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 L6=[["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"}]],MN=ze("minimize",L6);/**
|
|
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 z6=[["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"}]],AN=ze("monitor",z6);/**
|
|
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 P6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],j_=ze("panel-left",P6);/**
|
|
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 B6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],I6=ze("panel-right",B6);/**
|
|
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 F6=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],DN=ze("paperclip",F6);/**
|
|
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 H6=[["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"}]],gc=ze("pencil",H6);/**
|
|
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 U6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],kx=ze("plus",U6);/**
|
|
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 $6=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ex=ze("refresh-cw",$6);/**
|
|
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 W6=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yb=ze("search",W6);/**
|
|
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 V6=[["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"}]],q6=ze("send",V6);/**
|
|
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 K6=[["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"}]],G6=ze("settings",K6);/**
|
|
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 Y6=[["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"}]],X6=ze("settings-2",Y6);/**
|
|
420
|
+
* @license lucide-react v0.562.0 - ISC
|
|
421
|
+
*
|
|
422
|
+
* This source code is licensed under the ISC license.
|
|
423
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
424
|
+
*/const Z6=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],Q6=ze("slash",Z6);/**
|
|
425
|
+
* @license lucide-react v0.562.0 - ISC
|
|
426
|
+
*
|
|
427
|
+
* This source code is licensed under the ISC license.
|
|
428
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
429
|
+
*/const J6=[["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"}]],Nn=ze("sparkles",J6);/**
|
|
430
|
+
* @license lucide-react v0.562.0 - ISC
|
|
431
|
+
*
|
|
432
|
+
* This source code is licensed under the ISC license.
|
|
433
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
434
|
+
*/const e8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 8h10",key:"1jw688"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h10",key:"wp8him"}]],Pk=ze("square-menu",e8);/**
|
|
435
|
+
* @license lucide-react v0.562.0 - ISC
|
|
436
|
+
*
|
|
437
|
+
* This source code is licensed under the ISC license.
|
|
438
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
439
|
+
*/const t8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]],Bk=ze("square-minus",t8);/**
|
|
440
|
+
* @license lucide-react v0.562.0 - ISC
|
|
441
|
+
*
|
|
442
|
+
* This source code is licensed under the ISC license.
|
|
443
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
444
|
+
*/const n8=[["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"}]],jN=ze("square-pen",n8);/**
|
|
445
|
+
* @license lucide-react v0.562.0 - ISC
|
|
446
|
+
*
|
|
447
|
+
* This source code is licensed under the ISC license.
|
|
448
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
449
|
+
*/const r8=[["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"}]],i8=ze("square-x",r8);/**
|
|
450
|
+
* @license lucide-react v0.562.0 - ISC
|
|
451
|
+
*
|
|
452
|
+
* This source code is licensed under the ISC license.
|
|
453
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
454
|
+
*/const s8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],o8=ze("square",s8);/**
|
|
455
|
+
* @license lucide-react v0.562.0 - ISC
|
|
456
|
+
*
|
|
457
|
+
* This source code is licensed under the ISC license.
|
|
458
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
459
|
+
*/const a8=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Rx=ze("terminal",a8);/**
|
|
460
|
+
* @license lucide-react v0.562.0 - ISC
|
|
461
|
+
*
|
|
462
|
+
* This source code is licensed under the ISC license.
|
|
463
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
464
|
+
*/const l8=[["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"}]],c8=ze("toy-brick",l8);/**
|
|
465
|
+
* @license lucide-react v0.562.0 - ISC
|
|
466
|
+
*
|
|
467
|
+
* This source code is licensed under the ISC license.
|
|
468
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
469
|
+
*/const u8=[["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"}]],bd=ze("trash-2",u8);/**
|
|
470
|
+
* @license lucide-react v0.562.0 - ISC
|
|
471
|
+
*
|
|
472
|
+
* This source code is licensed under the ISC license.
|
|
473
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
474
|
+
*/const d8=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Tx=ze("user-round",d8);/**
|
|
475
|
+
* @license lucide-react v0.562.0 - ISC
|
|
476
|
+
*
|
|
477
|
+
* This source code is licensed under the ISC license.
|
|
478
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
479
|
+
*/const h8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Js=ze("x",h8);/**
|
|
480
|
+
* @license lucide-react v0.562.0 - ISC
|
|
481
|
+
*
|
|
482
|
+
* This source code is licensed under the ISC license.
|
|
483
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
484
|
+
*/const f8=[["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"}]],cs=ze("zap",f8),_d="data-focus-fallback-ignore",ON="data-allow-focus-retain",wm="kaizen:restore-chat-input-focus",Nx="data-chat-input",Sm="data-chat-selection-zone";function Ba(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function O_(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:Ba(e,ON):!1}function m8(e){const t=e;return t!=null&&t.matches?O_(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:Ba(e,ON):!1}function Ik(e){return!!e.querySelector(`[${_d}][data-state='open']`)}function p8(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function g8(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${Nx}]`)).filter(l=>!l.disabled);if(n.length===0)return!1;const r=n.indexOf(e),s=r>=0?(r+1)%n.length:0,o=n[s];return o?(o.focus({preventScroll:!0}),!0):!1}function Fk(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||Ba(t,Nx)||e.canCancel?"none":"escape-focus";const{pointerStartTarget:s,pointerEndTarget:o,root:l,hasActiveSelection:u}=e,h=o??s;return!l||!h||!l.contains(h)||Ba(h,_d)||Ba(t,_d)||O_(h)||u&&(Ba(s,Sm)||Ba(h,Sm))||O_(t)?"none":t&&t===h?"restore":m8(t)?"none":"restore"}const hp=sI,v8=oI,LN=b.forwardRef(({className:e,...t},n)=>f.jsx(xN,{ref:n,className:me("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}));LN.displayName=xN.displayName;const b8={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},Id=b.forwardRef(({className:e,children:t,size:n="md",...r},s)=>f.jsxs(v8,{children:[f.jsx(LN,{}),f.jsxs(wN,{ref:s,[_d]:"",onCloseAutoFocus:o=>{var l;o.preventDefault(),window.dispatchEvent(new Event(wm)),(l=r.onCloseAutoFocus)==null||l.call(r,o)},className:me("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 backdrop-blur-md 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",b8[n],e),...r,children:[t,f.jsxs(cI,{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:[f.jsx(Js,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Id.displayName=wN.displayName;function fp({className:e,...t}){return f.jsx(aI,{className:me("text-lg font-medium leading-none tracking-tight",e),...t})}function Mx({className:e,...t}){return f.jsx(lI,{className:me("text-sm text-muted-foreground",e),...t})}function mp({className:e,...t}){return f.jsx("div",{className:me("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function pp({className:e,...t}){return f.jsx("div",{className:me("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",e),...t})}const ki=b.forwardRef(({className:e,type:t,...n},r)=>f.jsx("input",{ref:r,type:t,className:me("flex w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n}));ki.displayName="Input";const zN=b.createContext(null);function _8({children:e}){const[t,n]=b.useState(null),[r,s]=b.useState(""),o=b.useRef(null);b.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(s(t.options.initialValue??""),setTimeout(()=>{var y,w;(y=o.current)==null||y.focus(),(w=o.current)==null||w.select()},0))},[t]);const l=b.useCallback(()=>{n(null),s("")},[]),u=b.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!1):t.kind==="prompt"?t.resolve(null):t.resolve(),l())},[l,t]),h=b.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!0):t.kind==="prompt"?t.resolve(r.trim()||null):t.resolve(),l())},[l,t,r]),d=b.useCallback(y=>new Promise(w=>{n({kind:"confirm",options:y,resolve:w})}),[]),g=b.useCallback(y=>new Promise(w=>{n({kind:"prompt",options:y,resolve:w})}),[]),p=b.useCallback(y=>new Promise(w=>{n({kind:"alert",options:y,resolve:w})}),[]),v=b.useMemo(()=>({confirm:d,prompt:g,alert:p}),[p,d,g]);return f.jsxs(zN.Provider,{value:v,children:[e,f.jsx(hp,{open:t!==null,onOpenChange:y=>{y||!t||u()},children:f.jsx(Id,{size:"sm",onKeyDown:y=>{y.key!=="Enter"||y.shiftKey||!t||t.kind!=="confirm"||(y.preventDefault(),h())},children:t?f.jsxs(f.Fragment,{children:[f.jsxs(mp,{className:"space-y-4",children:[f.jsx(fp,{children:t.options.title}),t.options.description?f.jsx(Mx,{children:t.options.description}):null,t.kind==="prompt"?f.jsx(ki,{ref:o,type:"text",value:r,onChange:y=>s(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),h())},placeholder:t.options.placeholder}):null]}),f.jsxs(pp,{children:[f.jsx(Ze,{variant:"ghost",size:"sm",onClick:u,className:t.kind==="alert"?"hidden":void 0,children:"cancelLabel"in t.options?t.options.cancelLabel??"Cancel":"Cancel"}),f.jsx(Ze,{variant:t.kind==="confirm"?t.options.confirmVariant??"default":"secondary",size:"sm",onClick:h,disabled:t.kind==="prompt"&&!r.trim(),children:t.kind==="alert"?t.options.closeLabel??"OK":"confirmLabel"in t.options?t.options.confirmLabel??"Confirm":"Confirm"})]})]}):null})})]})}function y8(){const e=b.useContext(zN);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const Fd=b.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:me("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}));Fd.displayName="Textarea";function x8(e){return e.trim().length>0}function w8({open:e,onOpenChange:t,onConfirm:n}){const[r,s]=b.useState(""),[o,l]=b.useState(""),u=b.useRef(null);b.useEffect(()=>{e&&(s(""),l(""),setTimeout(()=>{var g;return(g=u.current)==null?void 0:g.focus()},0))},[e]);const h=x8(r),d=()=>{h&&n({title:r.trim(),description:o.trim()})};return f.jsx(hp,{open:e,onOpenChange:t,children:f.jsx(Id,{size:"sm",onKeyDown:g=>{(g.metaKey||g.ctrlKey)&&g.key==="Enter"&&(g.preventDefault(),d())},children:f.jsxs("form",{onSubmit:g=>{g.preventDefault(),d()},children:[f.jsxs(mp,{className:"space-y-4",children:[f.jsx(fp,{children:"Create Feature"}),f.jsx(Mx,{children:"Name the feature folder and optionally add a short description for the feature."}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{htmlFor:"feature-title",className:"text-sm font-medium",children:"Feature name"}),f.jsx(ki,{id:"feature-title",ref:u,type:"text",value:r,onChange:g=>s(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),d())},placeholder:"Feature name"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"feature-description",className:"text-sm font-medium",children:["Description ",f.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),f.jsx(Fd,{id:"feature-description",value:o,onChange:g=>l(g.target.value),rows:5,placeholder:"Leave blank to add it later"})]})]}),f.jsxs(pp,{children:[f.jsx(Ze,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),f.jsx(Ze,{type:"submit",variant:"secondary",size:"sm",disabled:!h,children:"Create"})]})]})})})}const Hk=`1. Sign in on the opened Cursor spending page.
|
|
485
|
+
2. Open DevTools > Network.
|
|
486
|
+
3. Refresh the page.
|
|
487
|
+
4. Right-click the get-current-period-usage request.
|
|
488
|
+
5. Copy > Copy as cURL.
|
|
489
|
+
6. Paste it here.`;function S8({open:e,onOpenChange:t,onSubmit:n}){const r=b.useRef(null),[s,o]=b.useState(""),[l,u]=b.useState(!1);b.useEffect(()=>{e&&(o(""),setTimeout(()=>{var p;return(p=r.current)==null?void 0:p.focus()},0))},[e]);async function h(){const p=await navigator.clipboard.readText();o(p)}async function d(){await navigator.clipboard.writeText(Hk),u(!0),setTimeout(()=>u(!1),2e3)}const g=s.trim().length>0;return f.jsx(hp,{open:e,onOpenChange:t,children:f.jsx(Id,{size:"lg",children:f.jsxs("form",{onSubmit:p=>{p.preventDefault(),g&&n(s.trim())},children:[f.jsxs(mp,{className:"space-y-4",children:[f.jsx(fp,{children:"Import Cursor Session"}),f.jsxs(Mx,{children:["Paste the copied ",f.jsx("code",{children:"get-current-period-usage"})," curl command and Kaizen will import the session for you."]}),f.jsx("div",{className:"rounded-xl border border-border bg-card px-3 py-3 text-sm text-muted-foreground whitespace-pre-line",children:Hk}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ze,{type:"button",variant:"ghost",size:"sm",onClick:()=>void h(),children:"Paste Clipboard"}),f.jsxs(Ze,{type:"button",variant:"ghost",size:"sm",onClick:()=>void d(),children:[l?f.jsx(qi,{className:"h-4 w-4"}):f.jsx(Bd,{className:"h-4 w-4"}),f.jsx("span",{className:"ml-1",children:l?"Copied":"Copy Steps"})]})]}),f.jsx(Fd,{ref:r,value:s,onChange:p=>o(p.target.value),rows:10,placeholder:"Paste the copied curl command here",className:"font-mono text-xs"})]}),f.jsxs(pp,{children:[f.jsx(Ze,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),f.jsx(Ze,{type:"submit",variant:"secondary",size:"sm",disabled:!g,children:"Import Session"})]})]})})})}const C8=["top","right","bottom","left"],na=Math.min,si=Math.max,Cm=Math.round,Mf=Math.floor,vs=e=>({x:e,y:e}),k8={left:"right",right:"left",bottom:"top",top:"bottom"};function L_(e,t,n){return si(e,na(t,n))}function eo(e,t){return typeof e=="function"?e(t):e}function to(e){return e.split("-")[0]}function Tc(e){return e.split("-")[1]}function Ax(e){return e==="x"?"y":"x"}function Dx(e){return e==="y"?"height":"width"}function ds(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jx(e){return Ax(ds(e))}function E8(e,t,n){n===void 0&&(n=!1);const r=Tc(e),s=jx(e),o=Dx(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=km(l)),[l,km(l)]}function R8(e){const t=km(e);return[z_(e),t,z_(t)]}function z_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Uk=["left","right"],$k=["right","left"],T8=["top","bottom"],N8=["bottom","top"];function M8(e,t,n){switch(e){case"top":case"bottom":return n?t?$k:Uk:t?Uk:$k;case"left":case"right":return t?T8:N8;default:return[]}}function A8(e,t,n,r){const s=Tc(e);let o=M8(to(e),n==="start",r);return s&&(o=o.map(l=>l+"-"+s),t&&(o=o.concat(o.map(z_)))),o}function km(e){const t=to(e);return k8[t]+e.slice(t.length)}function D8(e){return{top:0,right:0,bottom:0,left:0,...e}}function PN(e){return typeof e!="number"?D8(e):{top:e,right:e,bottom:e,left:e}}function Em(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 Wk(e,t,n){let{reference:r,floating:s}=e;const o=ds(t),l=jx(t),u=Dx(l),h=to(t),d=o==="y",g=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,v=r[u]/2-s[u]/2;let y;switch(h){case"top":y={x:g,y:r.y-s.height};break;case"bottom":y={x:g,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}switch(Tc(t)){case"start":y[l]-=v*(n&&d?-1:1);break;case"end":y[l]+=v*(n&&d?-1:1);break}return y}async function j8(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:l,elements:u,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:g="viewport",elementContext:p="floating",altBoundary:v=!1,padding:y=0}=eo(t,e),w=PN(y),C=u[v?p==="floating"?"reference":"floating":p],k=Em(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:d,rootBoundary:g,strategy:h})),R=p==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),M=await(o.isElement==null?void 0:o.isElement(E))?await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1}:{x:1,y:1},L=Em(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:E,strategy:h}):R);return{top:(k.top-L.top+w.top)/M.y,bottom:(L.bottom-k.bottom+w.bottom)/M.y,left:(k.left-L.left+w.left)/M.x,right:(L.right-k.right+w.right)/M.x}}const O8=50,L8=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:j8},h=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:p}=Wk(d,r,h),v=r,y=0;const w={};for(let S=0;S<o.length;S++){const C=o[S];if(!C)continue;const{name:k,fn:R}=C,{x:E,y:M,data:L,reset:j}=await R({x:g,y:p,initialPlacement:r,placement:v,strategy:s,middlewareData:w,rects:d,platform:u,elements:{reference:e,floating:t}});g=E??g,p=M??p,w[k]={...w[k],...L},j&&y<O8&&(y++,typeof j=="object"&&(j.placement&&(v=j.placement),j.rects&&(d=j.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):j.rects),{x:g,y:p}=Wk(d,v,h)),S=-1)}return{x:g,y:p,placement:v,strategy:s,middlewareData:w}},z8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:l,elements:u,middlewareData:h}=t,{element:d,padding:g=0}=eo(e,t)||{};if(d==null)return{};const p=PN(g),v={x:n,y:r},y=jx(s),w=Dx(y),S=await l.getDimensions(d),C=y==="y",k=C?"top":"left",R=C?"bottom":"right",E=C?"clientHeight":"clientWidth",M=o.reference[w]+o.reference[y]-v[y]-o.floating[w],L=v[y]-o.reference[y],j=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let D=j?j[E]:0;(!D||!await(l.isElement==null?void 0:l.isElement(j)))&&(D=u.floating[E]||o.floating[w]);const H=M/2-L/2,G=D/2-S[w]/2-1,I=na(p[k],G),q=na(p[R],G),B=I,W=D-S[w]-q,F=D/2-S[w]/2+H,V=L_(B,F,W),O=!h.arrow&&Tc(s)!=null&&F!==V&&o.reference[w]/2-(F<B?I:q)-S[w]/2<0,$=O?F<B?F-B:F-W:0;return{[y]:v[y]+$,data:{[y]:V,centerOffset:F-V-$,...O&&{alignmentOffset:$}},reset:O}}}),P8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:l,initialPlacement:u,platform:h,elements:d}=t,{mainAxis:g=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...C}=eo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=to(s),R=ds(u),E=to(u)===u,M=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=v||(E||!S?[km(u)]:R8(u)),j=w!=="none";!v&&j&&L.push(...A8(u,S,w,M));const D=[u,...L],H=await h.detectOverflow(t,C),G=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(g&&G.push(H[k]),p){const F=E8(s,l,M);G.push(H[F[0]],H[F[1]])}if(I=[...I,{placement:s,overflows:G}],!G.every(F=>F<=0)){var q,B;const F=(((q=o.flip)==null?void 0:q.index)||0)+1,V=D[F];if(V&&(!(p==="alignment"?R!==ds(V):!1)||I.every(U=>ds(U.placement)===R?U.overflows[0]>0:!0)))return{data:{index:F,overflows:I},reset:{placement:V}};let O=(B=I.filter($=>$.overflows[0]<=0).sort(($,U)=>$.overflows[1]-U.overflows[1])[0])==null?void 0:B.placement;if(!O)switch(y){case"bestFit":{var W;const $=(W=I.filter(U=>{if(j){const Y=ds(U.placement);return Y===R||Y==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(Y=>Y>0).reduce((Y,A)=>Y+A,0)]).sort((U,Y)=>U[1]-Y[1])[0])==null?void 0:W[0];$&&(O=$);break}case"initialPlacement":O=u;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function Vk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qk(e){return C8.some(t=>e[t]>=0)}const B8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...o}=eo(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...o,elementContext:"reference"}),u=Vk(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:qk(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...o,altBoundary:!0}),u=Vk(l,n.floating);return{data:{escapedOffsets:u,escaped:qk(u)}}}default:return{}}}}},BN=new Set(["left","top"]);async function I8(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=to(n),u=Tc(n),h=ds(n)==="y",d=BN.has(l)?-1:1,g=o&&h?-1:1,p=eo(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof w=="number"&&(y=u==="end"?w*-1:w),h?{x:y*g,y:v*d}:{x:v*d,y:y*g}}const F8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:l,middlewareData:u}=t,h=await I8(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:o+h.y,data:{...h,placement:l}}}}},H8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:h={fn:k=>{let{x:R,y:E}=k;return{x:R,y:E}}},...d}=eo(e,t),g={x:n,y:r},p=await o.detectOverflow(t,d),v=ds(to(s)),y=Ax(v);let w=g[y],S=g[v];if(l){const k=y==="y"?"top":"left",R=y==="y"?"bottom":"right",E=w+p[k],M=w-p[R];w=L_(E,w,M)}if(u){const k=v==="y"?"top":"left",R=v==="y"?"bottom":"right",E=S+p[k],M=S-p[R];S=L_(E,S,M)}const C=h.fn({...t,[y]:w,[v]:S});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:l,[v]:u}}}}}},U8=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=eo(e,t),g={x:n,y:r},p=ds(s),v=Ax(p);let y=g[v],w=g[p];const S=eo(u,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const E=v==="y"?"height":"width",M=o.reference[v]-o.floating[E]+C.mainAxis,L=o.reference[v]+o.reference[E]-C.mainAxis;y<M?y=M:y>L&&(y=L)}if(d){var k,R;const E=v==="y"?"width":"height",M=BN.has(to(s)),L=o.reference[p]-o.floating[E]+(M&&((k=l.offset)==null?void 0:k[p])||0)+(M?0:C.crossAxis),j=o.reference[p]+o.reference[E]+(M?0:((R=l.offset)==null?void 0:R[p])||0)-(M?C.crossAxis:0);w<L?w=L:w>j&&(w=j)}return{[v]:y,[p]:w}}}},$8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:l,elements:u}=t,{apply:h=()=>{},...d}=eo(e,t),g=await l.detectOverflow(t,d),p=to(s),v=Tc(s),y=ds(s)==="y",{width:w,height:S}=o.floating;let C,k;p==="top"||p==="bottom"?(C=p,k=v===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(k=p,C=v==="end"?"top":"bottom");const R=S-g.top-g.bottom,E=w-g.left-g.right,M=na(S-g[C],R),L=na(w-g[k],E),j=!t.middlewareData.shift;let D=M,H=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(H=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=R),j&&!v){const I=si(g.left,0),q=si(g.right,0),B=si(g.top,0),W=si(g.bottom,0);y?H=w-2*(I!==0||q!==0?I+q:si(g.left,g.right)):D=S-2*(B!==0||W!==0?B+W:si(g.top,g.bottom))}await h({...t,availableWidth:H,availableHeight:D});const G=await l.getDimensions(u.floating);return w!==G.width||S!==G.height?{reset:{rects:!0}}:{}}}};function gp(){return typeof window<"u"}function Nc(e){return IN(e)?(e.nodeName||"").toLowerCase():"#document"}function oi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xs(e){var t;return(t=(IN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function IN(e){return gp()?e instanceof Node||e instanceof oi(e).Node:!1}function Ki(e){return gp()?e instanceof Element||e instanceof oi(e).Element:!1}function so(e){return gp()?e instanceof HTMLElement||e instanceof oi(e).HTMLElement:!1}function Kk(e){return!gp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof oi(e).ShadowRoot}function Hd(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Gi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function W8(e){return/^(table|td|th)$/.test(Nc(e))}function vp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const V8=/transform|translate|scale|rotate|perspective|filter/,q8=/paint|layout|strict|content/,Na=e=>!!e&&e!=="none";let xb;function Ox(e){const t=Ki(e)?Gi(e):e;return Na(t.transform)||Na(t.translate)||Na(t.scale)||Na(t.rotate)||Na(t.perspective)||!Lx()&&(Na(t.backdropFilter)||Na(t.filter))||V8.test(t.willChange||"")||q8.test(t.contain||"")}function K8(e){let t=ra(e);for(;so(t)&&!vc(t);){if(Ox(t))return t;if(vp(t))return null;t=ra(t)}return null}function Lx(){return xb==null&&(xb=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xb}function vc(e){return/^(html|body|#document)$/.test(Nc(e))}function Gi(e){return oi(e).getComputedStyle(e)}function bp(e){return Ki(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ra(e){if(Nc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Kk(e)&&e.host||xs(e);return Kk(t)?t.host:t}function FN(e){const t=ra(e);return vc(t)?e.ownerDocument?e.ownerDocument.body:e.body:so(t)&&Hd(t)?t:FN(t)}function yd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=FN(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),l=oi(s);if(o){const u=P_(l);return t.concat(l,l.visualViewport||[],Hd(s)?s:[],u&&n?yd(u):[])}else return t.concat(s,yd(s,[],n))}function P_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function HN(e){const t=Gi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=so(e),o=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=Cm(n)!==o||Cm(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function zx(e){return Ki(e)?e:e.contextElement}function uc(e){const t=zx(e);if(!so(t))return vs(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=HN(t);let l=(o?Cm(n.width):n.width)/r,u=(o?Cm(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const G8=vs(0);function UN(e){const t=oi(e);return!Lx()||!t.visualViewport?G8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Y8(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==oi(e)?!1:t}function Ga(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=zx(e);let l=vs(1);t&&(r?Ki(r)&&(l=uc(r)):l=uc(e));const u=Y8(o,n,r)?UN(o):vs(0);let h=(s.left+u.x)/l.x,d=(s.top+u.y)/l.y,g=s.width/l.x,p=s.height/l.y;if(o){const v=oi(o),y=r&&Ki(r)?oi(r):r;let w=v,S=P_(w);for(;S&&r&&y!==w;){const C=uc(S),k=S.getBoundingClientRect(),R=Gi(S),E=k.left+(S.clientLeft+parseFloat(R.paddingLeft))*C.x,M=k.top+(S.clientTop+parseFloat(R.paddingTop))*C.y;h*=C.x,d*=C.y,g*=C.x,p*=C.y,h+=E,d+=M,w=oi(S),S=P_(w)}}return Em({width:g,height:p,x:h,y:d})}function _p(e,t){const n=bp(e).scrollLeft;return t?t.left+n:Ga(xs(e)).left+n}function $N(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-_p(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function X8(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",l=xs(r),u=t?vp(t.floating):!1;if(r===l||u&&o)return n;let h={scrollLeft:0,scrollTop:0},d=vs(1);const g=vs(0),p=so(r);if((p||!p&&!o)&&((Nc(r)!=="body"||Hd(l))&&(h=bp(r)),p)){const y=Ga(r);d=uc(r),g.x=y.x+r.clientLeft,g.y=y.y+r.clientTop}const v=l&&!p&&!o?$N(l,h):vs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-h.scrollLeft*d.x+g.x+v.x,y:n.y*d.y-h.scrollTop*d.y+g.y+v.y}}function Z8(e){return Array.from(e.getClientRects())}function Q8(e){const t=xs(e),n=bp(e),r=e.ownerDocument.body,s=si(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=si(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+_p(e);const u=-n.scrollTop;return Gi(r).direction==="rtl"&&(l+=si(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:l,y:u}}const Gk=25;function J8(e,t){const n=oi(e),r=xs(e),s=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,h=0;if(s){o=s.width,l=s.height;const g=Lx();(!g||g&&t==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}const d=_p(r);if(d<=0){const g=r.ownerDocument,p=g.body,v=getComputedStyle(p),y=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(r.clientWidth-p.clientWidth-y);w<=Gk&&(o-=w)}else d<=Gk&&(o+=d);return{width:o,height:l,x:u,y:h}}function e9(e,t){const n=Ga(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=so(e)?uc(e):vs(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,h=s*o.x,d=r*o.y;return{width:l,height:u,x:h,y:d}}function Yk(e,t,n){let r;if(t==="viewport")r=J8(e,n);else if(t==="document")r=Q8(xs(e));else if(Ki(t))r=e9(t,n);else{const s=UN(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Em(r)}function WN(e,t){const n=ra(e);return n===t||!Ki(n)||vc(n)?!1:Gi(n).position==="fixed"||WN(n,t)}function t9(e,t){const n=t.get(e);if(n)return n;let r=yd(e,[],!1).filter(u=>Ki(u)&&Nc(u)!=="body"),s=null;const o=Gi(e).position==="fixed";let l=o?ra(e):e;for(;Ki(l)&&!vc(l);){const u=Gi(l),h=Ox(l);!h&&u.position==="fixed"&&(s=null),(o?!h&&!s:!h&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Hd(l)&&!h&&WN(e,l))?r=r.filter(g=>g!==l):s=u,l=ra(l)}return t.set(e,r),r}function n9(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?vp(t)?[]:t9(t,this._c):[].concat(n),r],u=Yk(t,l[0],s);let h=u.top,d=u.right,g=u.bottom,p=u.left;for(let v=1;v<l.length;v++){const y=Yk(t,l[v],s);h=si(y.top,h),d=na(y.right,d),g=na(y.bottom,g),p=si(y.left,p)}return{width:d-p,height:g-h,x:p,y:h}}function r9(e){const{width:t,height:n}=HN(e);return{width:t,height:n}}function i9(e,t,n){const r=so(t),s=xs(t),o=n==="fixed",l=Ga(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const h=vs(0);function d(){h.x=_p(s)}if(r||!r&&!o)if((Nc(t)!=="body"||Hd(s))&&(u=bp(t)),r){const y=Ga(t,!0,o,t);h.x=y.x+t.clientLeft,h.y=y.y+t.clientTop}else s&&d();o&&!r&&s&&d();const g=s&&!r&&!o?$N(s,u):vs(0),p=l.left+u.scrollLeft-h.x-g.x,v=l.top+u.scrollTop-h.y-g.y;return{x:p,y:v,width:l.width,height:l.height}}function wb(e){return Gi(e).position==="static"}function Xk(e,t){if(!so(e)||Gi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xs(e)===n&&(n=n.ownerDocument.body),n}function VN(e,t){const n=oi(e);if(vp(e))return n;if(!so(e)){let s=ra(e);for(;s&&!vc(s);){if(Ki(s)&&!wb(s))return s;s=ra(s)}return n}let r=Xk(e,t);for(;r&&W8(r)&&wb(r);)r=Xk(r,t);return r&&vc(r)&&wb(r)&&!Ox(r)?n:r||K8(e)||n}const s9=async function(e){const t=this.getOffsetParent||VN,n=this.getDimensions,r=await n(e.floating);return{reference:i9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function o9(e){return Gi(e).direction==="rtl"}const a9={convertOffsetParentRelativeRectToViewportRelativeRect:X8,getDocumentElement:xs,getClippingRect:n9,getOffsetParent:VN,getElementRects:s9,getClientRects:Z8,getDimensions:r9,getScale:uc,isElement:Ki,isRTL:o9};function qN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function l9(e,t){let n=null,r;const s=xs(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),o();const d=e.getBoundingClientRect(),{left:g,top:p,width:v,height:y}=d;if(u||t(),!v||!y)return;const w=Mf(p),S=Mf(s.clientWidth-(g+v)),C=Mf(s.clientHeight-(p+y)),k=Mf(g),E={rootMargin:-w+"px "+-S+"px "+-C+"px "+-k+"px",threshold:si(0,na(1,h))||1};let M=!0;function L(j){const D=j[0].intersectionRatio;if(D!==h){if(!M)return l();D?l(!1,D):r=setTimeout(()=>{l(!1,1e-7)},1e3)}D===1&&!qN(d,e.getBoundingClientRect())&&l(),M=!1}try{n=new IntersectionObserver(L,{...E,root:s.ownerDocument})}catch{n=new IntersectionObserver(L,E)}n.observe(e)}return l(!0),o}function c9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,d=zx(e),g=s||o?[...d?yd(d):[],...t?yd(t):[]]:[];g.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const p=d&&u?l9(d,n):null;let v=-1,y=null;l&&(y=new ResizeObserver(k=>{let[R]=k;R&&R.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var E;(E=y)==null||E.observe(t)})),n()}),d&&!h&&y.observe(d),t&&y.observe(t));let w,S=h?Ga(e):null;h&&C();function C(){const k=Ga(e);S&&!qN(S,k)&&n(),S=k,w=requestAnimationFrame(C)}return n(),()=>{var k;g.forEach(R=>{s&&R.removeEventListener("scroll",n),o&&R.removeEventListener("resize",n)}),p==null||p(),(k=y)==null||k.disconnect(),y=null,h&&cancelAnimationFrame(w)}}const u9=F8,d9=H8,h9=P8,f9=$8,m9=B8,Zk=z8,p9=U8,g9=(e,t,n)=>{const r=new Map,s={platform:a9,...n},o={...s.platform,_c:r};return L8(e,t,{...s,platform:o})};var v9=typeof document<"u",b9=function(){},sm=v9?b.useLayoutEffect:b9;function Rm(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(!Rm(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 o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Rm(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function KN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qk(e,t){const n=KN(e);return Math.round(t*n)/n}function Sb(e){const t=b.useRef(e);return sm(()=>{t.current=e}),t}function _9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:h,open:d}=e,[g,p]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=b.useState(r);Rm(v,r)||y(r);const[w,S]=b.useState(null),[C,k]=b.useState(null),R=b.useCallback(U=>{U!==j.current&&(j.current=U,S(U))},[]),E=b.useCallback(U=>{U!==D.current&&(D.current=U,k(U))},[]),M=o||w,L=l||C,j=b.useRef(null),D=b.useRef(null),H=b.useRef(g),G=h!=null,I=Sb(h),q=Sb(s),B=Sb(d),W=b.useCallback(()=>{if(!j.current||!D.current)return;const U={placement:t,strategy:n,middleware:v};q.current&&(U.platform=q.current),g9(j.current,D.current,U).then(Y=>{const A={...Y,isPositioned:B.current!==!1};F.current&&!Rm(H.current,A)&&(H.current=A,Ui.flushSync(()=>{p(A)}))})},[v,t,n,q,B]);sm(()=>{d===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[d]);const F=b.useRef(!1);sm(()=>(F.current=!0,()=>{F.current=!1}),[]),sm(()=>{if(M&&(j.current=M),L&&(D.current=L),M&&L){if(I.current)return I.current(M,L,W);W()}},[M,L,W,I,G]);const V=b.useMemo(()=>({reference:j,floating:D,setReference:R,setFloating:E}),[R,E]),O=b.useMemo(()=>({reference:M,floating:L}),[M,L]),$=b.useMemo(()=>{const U={position:n,left:0,top:0};if(!O.floating)return U;const Y=Qk(O.floating,g.x),A=Qk(O.floating,g.y);return u?{...U,transform:"translate("+Y+"px, "+A+"px)",...KN(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:A}},[n,u,O.floating,g.x,g.y]);return b.useMemo(()=>({...g,update:W,refs:V,elements:O,floatingStyles:$}),[g,W,V,O,$])}const y9=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?Zk({element:r.current,padding:s}).fn(n):{}:r?Zk({element:r,padding:s}).fn(n):{}}}},x9=(e,t)=>{const n=u9(e);return{name:n.name,fn:n.fn,options:[e,t]}},w9=(e,t)=>{const n=d9(e);return{name:n.name,fn:n.fn,options:[e,t]}},S9=(e,t)=>({fn:p9(e).fn,options:[e,t]}),C9=(e,t)=>{const n=h9(e);return{name:n.name,fn:n.fn,options:[e,t]}},k9=(e,t)=>{const n=f9(e);return{name:n.name,fn:n.fn,options:[e,t]}},E9=(e,t)=>{const n=m9(e);return{name:n.name,fn:n.fn,options:[e,t]}},R9=(e,t)=>{const n=y9(e);return{name:n.name,fn:n.fn,options:[e,t]}};var T9="Arrow",GN=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return f.jsx(Et.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});GN.displayName=T9;var N9=GN;function M9(e){const[t,n]=b.useState(void 0);return xr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let l,u;if("borderBoxSize"in o){const h=o.borderBoxSize,d=Array.isArray(h)?h[0]:h;l=d.inlineSize,u=d.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 Px="Popper",[YN,sa]=io(Px),[A9,XN]=YN(Px),ZN=e=>{const{__scopePopper:t,children:n}=e,[r,s]=b.useState(null);return f.jsx(A9,{scope:t,anchor:r,onAnchorChange:s,children:n})};ZN.displayName=Px;var QN="PopperAnchor",JN=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=XN(QN,n),l=b.useRef(null),u=Ut(t,l),h=b.useRef(null);return b.useEffect(()=>{const d=h.current;h.current=(r==null?void 0:r.current)||l.current,d!==h.current&&o.onAnchorChange(h.current)}),r?null:f.jsx(Et.div,{...s,ref:u})});JN.displayName=QN;var Bx="PopperContent",[D9,j9]=YN(Bx),eM=b.forwardRef((e,t)=>{var te,ue,he,ge,ke,Ee;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:g=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:w,...S}=e,C=XN(Bx,n),[k,R]=b.useState(null),E=Ut(t,De=>R(De)),[M,L]=b.useState(null),j=M9(M),D=(j==null?void 0:j.width)??0,H=(j==null?void 0:j.height)??0,G=r+(o!=="center"?"-"+o:""),I=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},q=Array.isArray(d)?d:[d],B=q.length>0,W={padding:I,boundary:q.filter(L9),altBoundary:B},{refs:F,floatingStyles:V,placement:O,isPositioned:$,middlewareData:U}=_9({strategy:"fixed",placement:G,whileElementsMounted:(...De)=>c9(...De,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[x9({mainAxis:s+H,alignmentAxis:l}),h&&w9({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?S9():void 0,...W}),h&&C9({...W}),k9({...W,apply:({elements:De,rects:Xe,availableWidth:pt,availableHeight:at})=>{const{width:fe,height:Ve}=Xe.reference,Ae=De.floating.style;Ae.setProperty("--radix-popper-available-width",`${pt}px`),Ae.setProperty("--radix-popper-available-height",`${at}px`),Ae.setProperty("--radix-popper-anchor-width",`${fe}px`),Ae.setProperty("--radix-popper-anchor-height",`${Ve}px`)}}),M&&R9({element:M,padding:u}),z9({arrowWidth:D,arrowHeight:H}),v&&E9({strategy:"referenceHidden",...W})]}),[Y,A]=rM(O),P=Vi(w);xr(()=>{$&&(P==null||P())},[$,P]);const X=(te=U.arrow)==null?void 0:te.x,N=(ue=U.arrow)==null?void 0:ue.y,ne=((he=U.arrow)==null?void 0:he.centerOffset)!==0,[oe,J]=b.useState();return xr(()=>{k&&J(window.getComputedStyle(k).zIndex)},[k]),f.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:$?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(ge=U.transformOrigin)==null?void 0:ge.x,(ke=U.transformOrigin)==null?void 0:ke.y].join(" "),...((Ee=U.hide)==null?void 0:Ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(D9,{scope:n,placedSide:Y,onArrowChange:L,arrowX:X,arrowY:N,shouldHideArrow:ne,children:f.jsx(Et.div,{"data-side":Y,"data-align":A,...S,ref:E,style:{...S.style,animation:$?void 0:"none"}})})})});eM.displayName=Bx;var tM="PopperArrow",O9={top:"bottom",right:"left",bottom:"top",left:"right"},nM=b.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=j9(tM,r),l=O9[o.placedSide];return f.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:f.jsx(N9,{...s,ref:n,style:{...s.style,display:"block"}})})});nM.displayName=tM;function L9(e){return e!==null}var z9=e=>({name:"transformOrigin",options:e,fn(t){var C,k,R;const{placement:n,rects:r,middlewareData:s}=t,l=((C=s.arrow)==null?void 0:C.centerOffset)!==0,u=l?0:e.arrowWidth,h=l?0:e.arrowHeight,[d,g]=rM(n),p={start:"0%",center:"50%",end:"100%"}[g],v=(((k=s.arrow)==null?void 0:k.x)??0)+u/2,y=(((R=s.arrow)==null?void 0:R.y)??0)+h/2;let w="",S="";return d==="bottom"?(w=l?p:`${v}px`,S=`${-h}px`):d==="top"?(w=l?p:`${v}px`,S=`${r.floating.height+h}px`):d==="right"?(w=`${-h}px`,S=l?p:`${y}px`):d==="left"&&(w=`${r.floating.width+h}px`,S=l?p:`${y}px`),{data:{x:w,y:S}}}});function rM(e){const[t,n="center"]=e.split("-");return[t,n]}var yp=ZN,Ud=JN,xp=eM,wp=nM,iM=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"}),P9="VisuallyHidden",sM=b.forwardRef((e,t)=>f.jsx(Et.span,{...e,ref:t,style:{...iM,...e.style}}));sM.displayName=P9;var B9=sM,[Sp,Are]=io("Tooltip",[sa]),Cp=sa(),oM="TooltipProvider",I9=700,B_="tooltip.open",[F9,Ix]=Sp(oM),aM=e=>{const{__scopeTooltip:t,delayDuration:n=I9,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,l=b.useRef(!0),u=b.useRef(!1),h=b.useRef(0);return b.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),f.jsx(F9,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(h.current),l.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:b.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:o})};aM.displayName=oM;var xd="Tooltip",[H9,$d]=Sp(xd),lM=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,h=Ix(xd,e.__scopeTooltip),d=Cp(t),[g,p]=b.useState(null),v=Zs(),y=b.useRef(0),w=l??h.disableHoverableContent,S=u??h.delayDuration,C=b.useRef(!1),[k,R]=pc({prop:r,defaultProp:s??!1,onChange:D=>{D?(h.onOpen(),document.dispatchEvent(new CustomEvent(B_))):h.onClose(),o==null||o(D)},caller:xd}),E=b.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),M=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,R(!0)},[R]),L=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,R(!1)},[R]),j=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,R(!0),y.current=0},S)},[S,R]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),f.jsx(yp,{...d,children:f.jsx(H9,{scope:t,contentId:v,open:k,stateAttribute:E,trigger:g,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{h.isOpenDelayedRef.current?j():M()},[h.isOpenDelayedRef,j,M]),onTriggerLeave:b.useCallback(()=>{w?L():(window.clearTimeout(y.current),y.current=0)},[L,w]),onOpen:M,onClose:L,disableHoverableContent:w,children:n})})};lM.displayName=xd;var I_="TooltipTrigger",cM=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=$d(I_,n),o=Ix(I_,n),l=Cp(n),u=b.useRef(null),h=Ut(t,u,s.onTriggerChange),d=b.useRef(!1),g=b.useRef(!1),p=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),f.jsx(Ud,{asChild:!0,...l,children:f.jsx(Et.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:Fe(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:Fe(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:Fe(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Fe(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Fe(e.onBlur,s.onClose),onClick:Fe(e.onClick,s.onClose)})})});cM.displayName=I_;var Fx="TooltipPortal",[U9,$9]=Sp(Fx,{forceMount:void 0}),uM=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,o=$d(Fx,t);return f.jsx(U9,{scope:t,forceMount:n,children:f.jsx(Li,{present:n||o.open,children:f.jsx(Rc,{asChild:!0,container:s,children:r})})})};uM.displayName=Fx;var bc="TooltipContent",dM=b.forwardRef((e,t)=>{const n=$9(bc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,l=$d(bc,e.__scopeTooltip);return f.jsx(Li,{present:r||l.open,children:l.disableHoverableContent?f.jsx(hM,{side:s,...o,ref:t}):f.jsx(W9,{side:s,...o,ref:t})})}),W9=b.forwardRef((e,t)=>{const n=$d(bc,e.__scopeTooltip),r=Ix(bc,e.__scopeTooltip),s=b.useRef(null),o=Ut(t,s),[l,u]=b.useState(null),{trigger:h,onClose:d}=n,g=s.current,{onPointerInTransitChange:p}=r,v=b.useCallback(()=>{u(null),p(!1)},[p]),y=b.useCallback((w,S)=>{const C=w.currentTarget,k={x:w.clientX,y:w.clientY},R=Y9(k,C.getBoundingClientRect()),E=X9(k,R),M=Z9(S.getBoundingClientRect()),L=J9([...E,...M]);u(L),p(!0)},[p]);return b.useEffect(()=>()=>v(),[v]),b.useEffect(()=>{if(h&&g){const w=C=>y(C,g),S=C=>y(C,h);return h.addEventListener("pointerleave",w),g.addEventListener("pointerleave",S),()=>{h.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",S)}}},[h,g,y,v]),b.useEffect(()=>{if(l){const w=S=>{const C=S.target,k={x:S.clientX,y:S.clientY},R=(h==null?void 0:h.contains(C))||(g==null?void 0:g.contains(C)),E=!Q9(k,l);R?v():E&&(v(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[h,g,l,d,v]),f.jsx(hM,{...e,ref:o})}),[V9,q9]=Sp(xd,{isInside:!1}),K9=FP("TooltipContent"),hM=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,h=$d(bc,n),d=Cp(n),{onClose:g}=h;return b.useEffect(()=>(document.addEventListener(B_,g),()=>document.removeEventListener(B_,g)),[g]),b.useEffect(()=>{if(h.trigger){const p=v=>{const y=v.target;y!=null&&y.contains(h.trigger)&&g()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[h.trigger,g]),f.jsx(Ec,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:g,children:f.jsxs(xp,{"data-state":h.stateAttribute,...d,...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:[f.jsx(K9,{children:r}),f.jsx(V9,{scope:n,isInside:!0,children:f.jsx(B9,{id:h.contentId,role:"tooltip",children:s||r})})]})})});dM.displayName=bc;var fM="TooltipArrow",G9=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Cp(n);return q9(fM,n).isInside?null:f.jsx(wp,{...s,...r,ref:t})});G9.displayName=fM;function Y9(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function X9(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 Z9(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 Q9(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],h=t[l],d=u.x,g=u.y,p=h.x,v=h.y;g>r!=v>r&&n<(p-d)*(r-g)/(v-g)+d&&(s=!s)}return s}function J9(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),e7(t)}function e7(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 o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.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 o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.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 t7=aM,mM=lM,pM=cM,gM=uM,Hx=dM;function n7({className:e,...t}){return f.jsx("kbd",{className:me("pointer-events-none inline-flex h-5 min-w-5 items-center justify-center rounded border border-border/60 bg-muted/50 px-1.5 font-mono text-[11px] font-medium text-current select-none",e),...t})}function r7({className:e,...t}){return f.jsx("span",{className:me("inline-flex items-center gap-0.5",e),...t})}const i7="z-50 overflow-hidden rounded-md border border-border backdrop-blur-md p-0.5 text-[11px] font-medium text-card-foreground 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",s7=t7,hs=mM,fs=pM,$i=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>f.jsx(gM,{children:f.jsx(Hx,{ref:r,sideOffset:t,className:me("z-50 overflow-hidden rounded-md bg-card text-card-foreground border border-border backdrop-blur-md 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})}));$i.displayName=Hx.displayName;const Vu=mM,qu=pM;function vM(e){return e.toUpperCase()}function o7(e){const t=e.split("+");return f.jsx(r7,{children:t.map((n,r)=>f.jsx(n7,{children:vM(n)},`${n}-${r}`))})}const ic=b.forwardRef(({className:e,sideOffset:t=4,children:n,shortcut:r,...s},o)=>{const l=r===void 0?null:Array.isArray(r)?r[0]??null:r;return f.jsx(gM,{children:f.jsx(Hx,{ref:o,sideOffset:t,className:me(i7,e),...s,children:l?o7(l):f.jsx("span",{children:typeof n=="string"?vM(n):n})})})});ic.displayName="HotkeyTooltipContent";const a7="0.3.0",l7={version:a7},Pn="Kaizen",Jk="kaizen",c7=".kaizen",u7=".kaizen-dev",Cb=".kaizen",d7="KAIZEN_RUNTIME_PROFILE",Ux=`kaizen/${l7.version}`,h7="[kaizen]",f7=`~/${Pn}`,kp="kaizen:";function Ep(){var t;return(t=globalThis.process)==null?void 0:t.env}function m7(e=Ep()){const t=e==null?void 0:e[d7];return(t==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function p7(e=Ep()){return m7(e)==="dev"?u7:c7}function g7(e=Ep()){return`~/${p7(e)}`}function v7(e=Ep()){return`${g7(e)}/keybindings.json`}function Af(e){return e?`${Jk} ${e}`:Jk}const Tm=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],F_=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],H_=[{id:"off",label:"Off"},{id:"standard",label:"Standard"},{id:"high",label:"High"}],U_="claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]",bM=[{id:"composer-2[fast=true]",label:"Composer 2",supportsEffort:!1},{id:"composer-1.5[]",label:"Composer 1.5",supportsEffort:!1},{id:"gpt-5.3-codex[reasoning=medium,fast=false]",label:"Codex 5.3",supportsEffort:!1},{id:"gpt-5.4[reasoning=medium,context=272k,fast=false]",label:"GPT-5.4",supportsEffort:!1},{id:"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]",label:"Sonnet 4.6",supportsEffort:!1},{id:"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]",label:"Opus 4.6",supportsEffort:!1},{id:"claude-opus-4-5[thinking=true]",label:"Opus 4.5",supportsEffort:!1},{id:"gpt-5.2[reasoning=medium,fast=false]",label:"GPT-5.2",supportsEffort:!1},{id:"gemini-3.1-pro[]",label:"Gemini 3.1 Pro",supportsEffort:!1},{id:"gpt-5.4-mini[reasoning=medium]",label:"GPT-5.4 Mini",supportsEffort:!1},{id:"gpt-5.4-nano[reasoning=medium]",label:"GPT-5.4 Nano",supportsEffort:!1},{id:"claude-haiku-4-5[thinking=true]",label:"Haiku 4.5",supportsEffort:!1},{id:"gpt-5.3-codex-spark[reasoning=medium]",label:"Codex 5.3 Spark",supportsEffort:!1},{id:"grok-4-20[thinking=true]",label:"Grok 4.20",supportsEffort:!1},{id:"claude-sonnet-4-5[thinking=true,context=200k]",label:"Sonnet 4.5",supportsEffort:!1},{id:"gpt-5.2-codex[reasoning=medium,fast=false]",label:"Codex 5.2",supportsEffort:!1},{id:"gemini-3-flash[]",label:"Gemini 3 Flash",supportsEffort:!1},{id:"claude-sonnet-4[thinking=false,context=200k]",label:"Sonnet 4",supportsEffort:!1},{id:"kimi-k2.5[]",label:"Kimi K2.5",supportsEffort:!1}],b7={"composer-2-fast":"composer-2[fast=true]","composer-1.5":"composer-1.5[]","gpt-5.3-codex":"gpt-5.3-codex[reasoning=medium,fast=false]","gpt-5.4":"gpt-5.4[reasoning=medium,context=272k,fast=false]","gpt-5.4-medium":"gpt-5.4[reasoning=medium,context=272k,fast=false]","claude-4.6-sonnet-medium-thinking":"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]","claude-4.6-opus-high-thinking":"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]","claude-4.5-opus-high-thinking":"claude-opus-4-5[thinking=true]","gpt-5.2":"gpt-5.2[reasoning=medium,fast=false]","gemini-3.1-pro":"gemini-3.1-pro[]","gpt-5.4-mini":"gpt-5.4-mini[reasoning=medium]","gpt-5.4-mini-medium":"gpt-5.4-mini[reasoning=medium]","gpt-5.4-nano":"gpt-5.4-nano[reasoning=medium]","gpt-5.4-nano-medium":"gpt-5.4-nano[reasoning=medium]","claude-haiku-4.5":"claude-haiku-4-5[thinking=true]","gpt-5.3-codex-spark-preview":"gpt-5.3-codex-spark[reasoning=medium]","grok-4-20":"grok-4-20[thinking=true]","grok-4-20-thinking":"grok-4-20[thinking=true]","claude-4.5-sonnet-thinking":"claude-sonnet-4-5[thinking=true,context=200k]","gpt-5.2-codex":"gpt-5.2-codex[reasoning=medium,fast=false]","gemini-3-flash":"gemini-3-flash[]","claude-4-sonnet":"claude-sonnet-4[thinking=false,context=200k]","kimi-k2.5":"kimi-k2.5[]"};function _7(e){return e?bM.some(t=>t.id===e)?e:b7[e]??U_:U_}function e2(e){const t=e.indexOf("[");return t>=0?e.slice(0,t):e}function nc(e){const t=e.match(/\bfast=(true|false)\b/);return t?t[1]==="true"?"fast":"standard":null}function t2(e){return Tm.some(t=>t.id===e)}function n2(e){return F_.some(t=>t.id===e)}const $_=[{id:"200k",label:"200k"},{id:"1m",label:"1M"}];function y7(e){return H_.some(t=>t.id===e)}const Qo=[{id:"claude",label:"Claude",systemActive:!0,defaultModel:"sonnet",defaultEffort:"high",defaultModelOptions:{reasoningEffort:"high",contextWindow:"200k"},supportsPlanMode:!0,models:[{id:"opus",label:"Opus",supportsEffort:!0,contextWindowOptions:[...$_]},{id:"sonnet",label:"Sonnet",supportsEffort:!0,contextWindowOptions:[...$_]},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...Tm]},{id:"codex",label:"Codex",systemActive:!0,defaultModel:"gpt-5.4",defaultModelOptions:{reasoningEffort:"high",fastMode:!1},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:[]},{id:"gemini",label:"Gemini",systemActive:!1,defaultModel:"auto-gemini-2.5",defaultModelOptions:{thinkingMode:"standard"},supportsPlanMode:!0,models:[{id:"auto-gemini-3",label:"Auto (Gemini 3)",supportsEffort:!1},{id:"auto-gemini-2.5",label:"Auto (Gemini 2.5)",supportsEffort:!1},{id:"gemini-3.1-pro-preview",label:"3.1 Pro Preview",supportsEffort:!1},{id:"gemini-3-pro-preview",label:"3 Pro Preview",supportsEffort:!1},{id:"gemini-3-flash-preview",label:"3 Flash Preview",supportsEffort:!1},{id:"gemini-2.5-pro",label:"2.5 Pro",supportsEffort:!1},{id:"gemini-2.5-flash",label:"2.5 Flash",supportsEffort:!1},{id:"gemini-2.5-flash-lite",label:"2.5 Flash Lite",supportsEffort:!1}],efforts:[]},{id:"cursor",label:"Cursor",systemActive:!0,defaultModel:U_,defaultModelOptions:{},supportsPlanMode:!0,models:[...bM],efforts:[]}],Wn={claude:{active:!0},codex:{active:!0},gemini:{active:!0},cursor:{active:!0}};function tn(e){const t=Qo.find(n=>n.id===e);if(!t)throw new Error(`Unknown provider: ${e}`);return t}function $x(e,t){const n=Wn[t],r=e==null?void 0:e[t];return{active:(r==null?void 0:r.active)??n.active}}function x7(e,t){const n=tn(e),r=$x(t,e);return n.systemActive&&r.active?null:`Provider ${n.label} is currently not active.`}function r2(e,t){const n=tn(e),r=$x(t,e);return n.systemActive&&r.active}function w7(e){return Qo.map(t=>{const n=$x(e,t.id),r=t.systemActive&&n.active;return{...t,active:n.active,isSelectable:r,isUsageEnabled:r,isInactive:!r,inactiveMessage:x7(t.id,e)}})}function Wx(e){return w7(e).filter(t=>t.isSelectable).map(({active:t,isSelectable:n,isUsageEnabled:r,isInactive:s,inactiveMessage:o,...l})=>l)}function Ni(e){return tn(e).defaultModelOptions}const _M=Ni("claude");Ni("codex");Ni("gemini");Ni("cursor");function S7(e){return tn("claude").models.find(t=>t.id===e)}function C7(e){var t;return((t=S7(e))==null?void 0:t.contextWindowOptions)??[]}function k7(e,t){const n=C7(e);if(n.length!==0)return n.some(r=>r.id===t)?t:_M.contextWindow}const E7=["idea","todo","progress","testing","done"],i2={idea:"IDEA",todo:"TODO",progress:"PROGRESS",testing:"TESTING",done:"DONE"},as={submitChatMessage:["enter"],toggleProjectsSidebar:["ctrl+a"],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+/"]},Nm=8,yM=10*1024*1024,Mm=["image/png","image/jpeg","image/webp","image/gif"],R7="/assets/icon-4rSnra9R.svg";function sd({alt:e="",className:t,...n}){return f.jsx("img",{alt:e,src:R7,className:me("shrink-0 object-contain",t),...n})}var Rp="Popover",[xM,Dre]=io(Rp,[sa]),Wd=sa(),[T7,oa]=xM(Rp),wM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:l=!1}=e,u=Wd(t),h=b.useRef(null),[d,g]=b.useState(!1),[p,v]=pc({prop:r,defaultProp:s??!1,onChange:o,caller:Rp});return f.jsx(yp,{...u,children:f.jsx(T7,{scope:t,contentId:Zs(),triggerRef:h,open:p,onOpenChange:v,onOpenToggle:b.useCallback(()=>v(y=>!y),[v]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>g(!0),[]),onCustomAnchorRemove:b.useCallback(()=>g(!1),[]),modal:l,children:n})})};wM.displayName=Rp;var SM="PopoverAnchor",CM=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=oa(SM,n),o=Wd(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=s;return b.useEffect(()=>(l(),()=>u()),[l,u]),f.jsx(Ud,{...o,...r,ref:t})});CM.displayName=SM;var kM="PopoverTrigger",EM=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=oa(kM,n),o=Wd(n),l=Ut(t,s.triggerRef),u=f.jsx(Et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":AM(s.open),...r,ref:l,onClick:Fe(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:f.jsx(Ud,{asChild:!0,...o,children:u})});EM.displayName=kM;var Vx="PopoverPortal",[N7,M7]=xM(Vx,{forceMount:void 0}),RM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=oa(Vx,t);return f.jsx(N7,{scope:t,forceMount:n,children:f.jsx(Li,{present:n||o.open,children:f.jsx(Rc,{asChild:!0,container:s,children:r})})})};RM.displayName=Vx;var _c="PopoverContent",TM=b.forwardRef((e,t)=>{const n=M7(_c,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=oa(_c,e.__scopePopover);return f.jsx(Li,{present:r||o.open,children:o.modal?f.jsx(D7,{...s,ref:t}):f.jsx(j7,{...s,ref:t})})});TM.displayName=_c;var A7=qa("PopoverContent.RemoveScroll"),D7=b.forwardRef((e,t)=>{const n=oa(_c,e.__scopePopover),r=b.useRef(null),s=Ut(t,r),o=b.useRef(!1);return b.useEffect(()=>{const l=r.current;if(l)return cp(l)},[]),f.jsx(Pd,{as:A7,allowPinchZoom:!0,children:f.jsx(NM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Fe(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Fe(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,d=u.button===2||h;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Fe(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),j7=b.forwardRef((e,t)=>{const n=oa(_c,e.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return f.jsx(NM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),NM=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:g,...p}=e,v=oa(_c,n),y=Wd(n);return ap(),f.jsx(zd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:f.jsx(Ec,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:g,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:f.jsx(xp,{"data-state":AM(v.open),role:"dialog",id:v.contentId,...y,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),MM="PopoverClose",O7=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=oa(MM,n);return f.jsx(Et.button,{type:"button",...r,ref:t,onClick:Fe(e.onClick,()=>s.onOpenChange(!1))})});O7.displayName=MM;var L7="PopoverArrow",z7=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Wd(n);return f.jsx(wp,{...s,...r,ref:t})});z7.displayName=L7;function AM(e){return e?"open":"closed"}var DM=wM,P7=CM,B7=EM,jM=RM,qx=TM;const OM=DM,LM=B7,Kx=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>f.jsx(jM,{children:f.jsx(qx,{ref:s,align:t,sideOffset:n,[_d]:"",onCloseAutoFocus:o=>{var l;o.preventDefault(),window.dispatchEvent(new Event(wm)),(l=r.onCloseAutoFocus)==null||l.call(r,o)},className:me("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg backdrop-blur-md 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})}));Kx.displayName=qx.displayName;function I7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:me("shrink-0",e),...t,children:f.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 F7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:me("shrink-0",e),...t,children:f.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"})})}function H7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:me("shrink-0",e),...t,children:f.jsx("path",{d:"M12 0C12 0 12 8 8 12C4 16 0 12 0 12C0 12 4 12 8 12C12 12 12 16 12 24C12 24 12 16 16 12C20 8 24 12 24 12C24 12 16 12 16 12C12 12 12 4 12 0Z"})})}function U7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:me("shrink-0",e),...t,children:f.jsx("path",{d:"M12 0 2.4 5.5v13L12 24l9.6-5.5v-13Zm0 3.1 6.8 3.9v5.1L15 14.3V9.7L12 8l-3 1.7v4.6l-3.8-2.2V7Zm-6.8 9.8 3.8 2.2v4.5l3 1.8 3-1.8v-4.5l3.8-2.2v3.8L12 20.9l-6.8-3.9Z"})})}function $7(e){return!(e.startsWith("gemini-3")||e==="auto-gemini-3")}const W7=["Composer","GPT","Claude","Gemini","Grok","Kimi"];function V7(e){return e.startsWith("composer-")?"Composer":e.startsWith("gpt-")?"GPT":e.startsWith("claude-")?"Claude":e.startsWith("gemini-")?"Gemini":e.startsWith("grok-")?"Grok":"Kimi"}function kb(e,t){const n=nc(t);return!n||n==="standard"?e:`${e} (${n==="fast"?"Fast":"Standard"})`}const Am={claude:I7,codex:F7,gemini:H7,cursor:U7},Df={auto:Nn,opus:ni,sonnet:Nn,haiku:cs,"gpt-5.4":ni,"gpt-5.4[reasoning=medium,context=272k,fast=false]":ni,"gpt-5.4-mini[reasoning=medium]":Nn,"gpt-5.4-nano[reasoning=medium]":cs,"gpt-5.3-codex":Nn,"gpt-5.3-codex[reasoning=medium,fast=false]":Nn,"gpt-5.3-codex-spark[reasoning=medium]":cs,"gpt-5.2[reasoning=medium,fast=false]":Nn,"gpt-5.2-codex[reasoning=medium,fast=false]":Nn,"gpt-5.3-codex-spark":cs,"gemini-2.5-pro":ni,"gemini-2.5-flash":Nn,"gemini-2.5-flash-lite":cs,"auto-gemini-3":ni,"auto-gemini-2.5":Nn,"gemini-3.1-pro-preview":ni,"gemini-3.1-pro[]":ni,"gemini-3-flash[]":Nn,"gemini-3-pro-preview":ni,"gemini-3-flash-preview":Nn,"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]":ni,"claude-opus-4-5[thinking=true]":ni,"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]":Nn,"claude-sonnet-4-5[thinking=true,context=200k]":Nn,"claude-sonnet-4[thinking=false,context=200k]":Nn,"claude-haiku-4-5[thinking=true]":cs,"grok-4-20[thinking=true]":ni,"kimi-k2.5[]":Nn,"composer-2[fast=true]":ni,"composer-1.5[]":Nn};function Fr({onClick:e,selected:t,icon:n,label:r,description:s,disabled:o}){return f.jsxs("button",{onClick:e,disabled:o,className:me("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",o&&"opacity-40 cursor-not-allowed"),children:[n,f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium",children:r}),s?f.jsx("div",{className:"text-xs text-muted-foreground",children:s}):null]})]})}function Uo({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[s,o]=b.useState(!1);return n?f.jsx("button",{disabled:!0,className:me("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}):f.jsxs(OM,{open:s,onOpenChange:o,children:[f.jsx(LM,{asChild:!0,children:f.jsx("button",{className:me("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})}),f.jsx(Kx,{align:"center",className:"w-64 p-1",children:f.jsx("div",{className:"max-h-[min(24rem,60vh)] space-y-1 overflow-y-auto pr-1",children:typeof r=="function"?r(()=>o(!1)):r})})]})}function Ku({availableProviders:e,selectedProvider:t,disabled:n=!1,showProviderPicker:r=!0,providerLocked:s=!1,model:o,modelOptions:l,onProviderChange:u,onModelChange:h,onClaudeReasoningEffortChange:d,onClaudeContextWindowChange:g,onCodexReasoningEffortChange:p,onGeminiThinkingModeChange:v,onCodexFastModeChange:y,planMode:w=!1,onPlanModeChange:S,includePlanMode:C=!0,className:k}){var Y,A,P,X,N,ne,oe;const[R,E]=b.useState(null),M=e.find(J=>J.id===t)??tn(t),L=Am[t],j=Df[o]??Nn,D=C&&(M==null?void 0:M.supportsPlanMode)&&S,H=t==="claude"?l:null,G=t==="codex"?l:null,I=t==="gemini"?l:null,q=((Y=M.models.find(J=>J.id===o))==null?void 0:Y.contextWindowOptions)??[],B=(H==null?void 0:H.contextWindow)??$_[0].id,W=B==="1m"?Pk:Bk,F=t==="claude"||t==="codex",V=t==="cursor"?nc(o):null,O=M.id==="cursor"?M.models.filter(J=>e2(J.id)===e2(o)):[],$=t==="cursor"&&O.some(J=>nc(J.id)==="fast")&&O.some(J=>nc(J.id)==="standard"),U=M.id==="cursor"?W7.map(J=>({family:J,models:M.models.filter(te=>V7(te.id)===J)})).filter(J=>J.models.length>0):[];return b.useEffect(()=>{E(null)},[t]),f.jsx("div",{className:me("max-w-full overflow-x-auto scrollbar-hide",n&&"pointer-events-none opacity-60",k),children:f.jsxs("div",{className:"flex w-max items-center justify-center gap-0.5 mx-auto",children:[r?f.jsx(Uo,{disabled:s||!u,trigger:f.jsxs(f.Fragment,{children:[f.jsx(L,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"hidden md:inline",children:(M==null?void 0:M.label)??t})]}),children:J=>e.map(te=>{const ue=Am[te.id];return f.jsx(Fr,{onClick:()=>{u==null||u(te.id),J()},selected:t===te.id,icon:f.jsx(ue,{className:"h-4 w-4 text-muted-foreground"}),label:te.label},te.id)})}):null,f.jsx(Uo,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(j,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:M.id==="cursor"?kb(((A=M.models.find(J=>J.id===o))==null?void 0:A.label)??o,o):((P=M.models.find(J=>J.id===o))==null?void 0:P.label)??o})]}),children:J=>{var te;return M.id==="cursor"?R?f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:()=>E(null),className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm text-muted-foreground transition-opacity hover:opacity-70",children:[f.jsx(CN,{className:"h-4 w-4"}),f.jsx("span",{children:R})]}),(te=U.find(ue=>ue.family===R))==null?void 0:te.models.map(ue=>{const he=Df[ue.id]??Nn;return f.jsx(Fr,{onClick:()=>{h(t,ue.id),E(null),J()},selected:o===ue.id,icon:f.jsx(he,{className:"h-4 w-4 text-muted-foreground"}),label:kb(ue.label,ue.id)},ue.id)})]}):U.map(ue=>{var ke;const he=ue.models.some(Ee=>Ee.id===o),ge=Df[((ke=ue.models[0])==null?void 0:ke.id)??""]??Nn;return f.jsxs("div",{className:"relative",children:[f.jsx(Fr,{onClick:()=>E(ue.family),selected:he,icon:f.jsx(ge,{className:"h-4 w-4 text-muted-foreground"}),label:ue.family,description:`${ue.models.length} model${ue.models.length===1?"":"s"}`}),f.jsx(Mr,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"})]},ue.family)}):M.models.map(ue=>{const he=Df[ue.id]??Nn;return f.jsx(Fr,{onClick:()=>{h(t,ue.id),J()},selected:o===ue.id,icon:f.jsx(he,{className:"h-4 w-4 text-muted-foreground"}),label:M.id==="cursor"?kb(ue.label,ue.id):ue.label},ue.id)})}}),$?f.jsx(Uo,{trigger:f.jsxs(f.Fragment,{children:[V==="fast"?f.jsx(cs,{className:"h-3.5 w-3.5"}):f.jsx(Ws,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:V==="fast"?"Fast":"Standard"})]}),triggerClassName:V==="fast"?"text-emerald-500 dark:text-emerald-400":void 0,children:J=>f.jsxs(f.Fragment,{children:[O.filter(te=>nc(te.id)==="standard").map(te=>f.jsx(Fr,{onClick:()=>{h(t,te.id),J()},selected:o===te.id,icon:f.jsx(Ws,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"},te.id)),O.filter(te=>nc(te.id)==="fast").map(te=>f.jsx(Fr,{onClick:()=>{h(t,te.id),J()},selected:o===te.id,icon:f.jsx(cs,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast"},te.id))]})}):null,F?f.jsx(Uo,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(Ws,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:t==="claude"?((X=Tm.find(J=>J.id===l.reasoningEffort))==null?void 0:X.label)??l.reasoningEffort:((N=F_.find(J=>J.id===l.reasoningEffort))==null?void 0:N.label)??l.reasoningEffort})]}),children:J=>t==="claude"?Tm.map(te=>f.jsx(Fr,{onClick:()=>{d(te.id),J()},selected:l.reasoningEffort===te.id,icon:f.jsx(Ws,{className:"h-4 w-4 text-muted-foreground"}),label:te.label,disabled:te.id==="max"&&o!=="opus"},te.id)):F_.map(te=>f.jsx(Fr,{onClick:()=>{p(te.id),J()},selected:l.reasoningEffort===te.id,icon:f.jsx(Ws,{className:"h-4 w-4 text-muted-foreground"}),label:te.label},te.id))}):null,t==="claude"&&q.length>1?f.jsx(Uo,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(W,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:((ne=q.find(J=>J.id===B))==null?void 0:ne.label)??B})]}),children:J=>q.map(te=>f.jsx(Fr,{onClick:()=>{g(te.id),J()},selected:B===te.id,icon:te.id==="1m"?f.jsx(Pk,{className:"h-4 w-4 text-muted-foreground"}):f.jsx(Bk,{className:"h-4 w-4 text-muted-foreground"}),label:te.label,description:te.id==="1m"?"Expanded context window":"Standard context window"},te.id))}):null,t==="gemini"?f.jsx(Uo,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(Ws,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:((oe=H_.find(J=>J.id===(I==null?void 0:I.thinkingMode)))==null?void 0:oe.label)??(I==null?void 0:I.thinkingMode)??"Standard"})]}),children:J=>H_.map(te=>f.jsx(Fr,{onClick:()=>{v(te.id),J()},selected:(I==null?void 0:I.thinkingMode)===te.id,icon:f.jsx(Ws,{className:"h-4 w-4 text-muted-foreground"}),label:te.label,disabled:te.id==="off"&&!$7(o)},te.id))}):null,t==="codex"?f.jsx(Uo,{trigger:f.jsxs(f.Fragment,{children:[G!=null&&G.fastMode?f.jsx(cs,{className:"h-3.5 w-3.5"}):f.jsx(Ws,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:G!=null&&G.fastMode?"Fast Mode":"Standard"})]}),triggerClassName:G!=null&&G.fastMode?"text-emerald-500 dark:text-emerald-400":void 0,children:J=>f.jsxs(f.Fragment,{children:[f.jsx(Fr,{onClick:()=>{y(!1),J()},selected:!(G!=null&&G.fastMode),icon:f.jsx(Ws,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"}),f.jsx(Fr,{onClick:()=>{y(!0),J()},selected:!!(G!=null&&G.fastMode),icon:f.jsx(cs,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,D?f.jsx(Uo,{trigger:f.jsxs(f.Fragment,{children:[w?f.jsx(xm,{className:"h-3.5 w-3.5"}):f.jsx(Lk,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"hidden md:inline",children:w?"Plan":"Implement"}),f.jsx("span",{className:"md:hidden",children:w?"Plan":"Impl"})]}),triggerClassName:w?"text-blue-400 dark:text-blue-300":void 0,children:J=>f.jsxs(f.Fragment,{children:[f.jsx(Fr,{onClick:()=>{S(!1),J()},selected:!w,icon:f.jsx(Lk,{className:"h-4 w-4 text-muted-foreground"}),label:"Implement",description:"Start execution"}),f.jsx(Fr,{onClick:()=>{S(!0),J()},selected:w,icon:f.jsx(xm,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan",description:"Review a plan before execution"})]})}):null]})})}const Tp=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...s})=>f.jsx("span",{style:{"--shiny-width":`${Math.min(n,100)}px`},className:me("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 W_(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const q7=[/^(?:\/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 K7(e){const t=e.trim();for(const n of q7){const r=t.match(n);if(!r)continue;const s=(r[2]??r[1]??"").trim();if(s)return s}return t}function Dm(e){return e.split("/").pop()||e}function G7(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,s=60*r,o=24*s,l=7*o;return n<r?"now":n<s?`${Math.floor(n/r)}m`:n<o?`${Math.floor(n/s)}h`:n<l?`${Math.floor(n/o)}d`:`${Math.floor(n/l)}w`}const Y7='button, select, input, textarea, [role="combobox"], [role="listbox"], [data-no-touch-drag]';function s2(e){var t;try{(t=navigator.vibrate)==null||t.call(navigator,e)}catch{}}function Gx({enabled:e,visualElementRef:t,onTap:n,onContextMenu:r,onDragStart:s,onDragMove:o,onDragEnd:l,holdDelay:u=300,contextMenuDelay:h=2500,scrollThreshold:d=8,dragMoveThreshold:g=5}){const[p,v]=b.useState(!1),[y,w]=b.useState(!1),[S,C]=b.useState(null),[k,R]=b.useState(null),E=b.useCallback(O=>{R(O)},[]),M=b.useRef("idle"),L=b.useRef({x:0,y:0}),j=b.useRef(null),D=b.useRef(null),H=b.useRef(n),G=b.useRef(r),I=b.useRef(s),q=b.useRef(o),B=b.useRef(l);H.current=n,G.current=r,I.current=s,q.current=o,B.current=l;const W=b.useCallback((O,$)=>{const U=(t==null?void 0:t.current)??k;if(!U)return document.elementFromPoint(O,$);const Y=U.style.pointerEvents;U.style.pointerEvents="none";const A=document.elementFromPoint(O,$);return U.style.pointerEvents=Y,A},[t,k]),F=b.useCallback(()=>{j.current&&(clearTimeout(j.current),j.current=null),D.current&&(clearTimeout(D.current),D.current=null)},[]),V=b.useCallback(()=>{F(),M.current="idle",w(!1),v(!1),C(null)},[F]);return b.useEffect(()=>{if(!k||!e)return;const O=A=>{if(A.target.closest(Y7))return;const P=A.touches[0];P&&(L.current={x:P.clientX,y:P.clientY},M.current="holding",j.current=setTimeout(()=>{j.current=null,M.current==="holding"&&(M.current="armed",w(!0),s2(30),D.current=setTimeout(()=>{var N;if(D.current=null,M.current!=="armed")return;s2(100);const X={...L.current};M.current="idle",w(!1),(N=G.current)==null||N.call(G,X)},h))},u))},$=A=>{var J,te;const P=M.current;if(P==="idle")return;const X=A.touches[0];if(!X)return;const N=X.clientX-L.current.x,ne=X.clientY-L.current.y,oe=Math.sqrt(N*N+ne*ne);if(P==="holding"){oe>d&&(F(),M.current="idle");return}if(P==="armed"){oe>g&&(D.current&&(clearTimeout(D.current),D.current=null),M.current="dragging",w(!1),v(!0),C({x:X.clientX,y:X.clientY}),A.preventDefault(),(J=I.current)==null||J.call(I,{x:X.clientX,y:X.clientY}));return}if(P==="dragging"){A.preventDefault(),C({x:X.clientX,y:X.clientY});const ue=W(X.clientX,X.clientY);(te=q.current)==null||te.call(q,{x:X.clientX,y:X.clientY,elementBelow:ue})}},U=A=>{var X,N;const P=M.current;if(P==="holding"){F(),M.current="idle",w(!1),v(!1),A.preventDefault(),(X=H.current)==null||X.call(H);return}if(P==="armed"){V();return}if(P==="dragging"){const ne=A.changedTouches[0];if(ne){const oe=W(ne.clientX,ne.clientY);(N=B.current)==null||N.call(B,{x:ne.clientX,y:ne.clientY,elementBelow:oe})}V()}},Y=()=>{var A;M.current==="dragging"&&((A=B.current)==null||A.call(B,{x:0,y:0,elementBelow:null})),V()};return k.addEventListener("touchstart",O,{passive:!1}),k.addEventListener("touchmove",$,{passive:!1}),k.addEventListener("touchend",U),k.addEventListener("touchcancel",Y),()=>{k.removeEventListener("touchstart",O),k.removeEventListener("touchmove",$),k.removeEventListener("touchend",U),k.removeEventListener("touchcancel",Y),F(),M.current="idle"}},[k,e,u,h,d,g,F,V,W]),{touchRef:E,isDragging:p,isArmed:y,dragPosition:S}}function zM({position:e,children:t,className:n}){return e?Ui.createPortal(f.jsx("div",{style:{position:"fixed",left:e.x,top:e.y,transform:"translate(-50%, calc(-100% - 14px))",zIndex:9999,pointerEvents:"none",willChange:"transform"},className:me("flex items-center gap-2 rounded-xl border-2 border-primary/60 bg-card px-3 py-2","shadow-[0_8px_32px_rgba(0,0,0,0.25)] dark:shadow-[0_8px_32px_rgba(0,0,0,0.5)]","min-w-[120px] max-w-[240px]","scale-[1.04]",n),children:t}),document.body):null}const X7=new Set(["starting","running"]);function Z7({chat:e,activeChatId:t,nowMs:n,showProviderIcon:r=!1,isCompleted:s=!1,onSelectChat:o,onDeleteChat:l,draggable:u=!1,onDragStart:h,onDragEnd:d,isTouchDevice:g=!1,onTouchDragMove:p,onTouchDragEnd:v}){const y=G7(e.lastMessageAt,n),w=g&&u,S=e.provider?Am[e.provider]:null,{touchRef:C,isArmed:k,isDragging:R,dragPosition:E}=Gx({enabled:w,onTap:()=>o(e.chatId),onDragStart:()=>h==null?void 0:h(e),onDragMove:({x:M,y:L,elementBelow:j})=>p==null?void 0:p(M,L,j),onDragEnd:({x:M,y:L,elementBelow:j})=>{v==null||v(M,L,j),d==null||d()}});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{ref:w?C:void 0,"data-chat-id":bk(e.chatId),className:me("group flex items-center gap-2 pl-2.5 pr-0.5 py-0.5 rounded-lg cursor-pointer border transition-all duration-150 select-none",t===bk(e.chatId)?"bg-muted hover:bg-muted border-border":"border-border/0 hover:border-border hover:bg-muted/20 dark:hover:border-slate-400/10",k&&"scale-[1.03] shadow-md ring-2 ring-primary/50 bg-card border-primary/40",R&&!k&&"opacity-20 scale-[0.98]"),draggable:u&&!g,onDragStart:u&&!g?()=>h==null?void 0:h(e):void 0,onDragEnd:u&&!g?d:void 0,onClick:g?void 0:()=>o(e.chatId),children:[X7.has(e.status)?f.jsx(li,{className:"size-3.5 flex-shrink-0 animate-spin text-muted-foreground"}):e.status==="waiting_for_user"?f.jsx("div",{className:"relative",children:f.jsxs("div",{className:"rounded-full z-0 size-3.5 flex items-center justify-center",children:[f.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-blue-400/80 animate-ping"}),f.jsx("div",{className:"rounded-full z-0 size-2.5 bg-blue-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):s?f.jsx("div",{className:"relative",children:f.jsxs("div",{className:"rounded-full z-0 size-3.5 flex items-center justify-center",children:[f.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-emerald-400/80 animate-ping"}),f.jsx("div",{className:"rounded-full z-0 size-2.5 bg-emerald-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):null,r&&S?f.jsx(S,{className:"size-3.5 flex-shrink-0 text-muted-foreground/80","aria-label":`${e.provider} provider`}):null,f.jsx("span",{className:"text-sm truncate flex-1 translate-y-[-0.5px]",children:e.status!=="idle"&&e.status!=="waiting_for_user"?f.jsx(Tp,{animate:e.status==="running",shimmerWidth:Math.max(20,e.title.length*3),children:e.title}):e.title}),f.jsxs("div",{className:"relative h-7 w-7 mr-[2px] shrink-0",children:[y?f.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:y}):null,f.jsx(Ze,{variant:"ghost",size:"icon",className:me("absolute inset-0 h-7 w-7 opacity-100 cursor-pointer rounded-sm hover:!bg-transparent !border-0",y?"md:opacity-0 md:group-hover:opacity-100":"opacity-100 md:opacity-0 md:group-hover:opacity-100"),"data-no-touch-drag":!0,onClick:M=>{M.stopPropagation(),l(e.chatId)},title:"Delete chat",children:f.jsx(gI,{className:"size-3.5"})})]})]},e._id),f.jsx(zM,{position:E,children:f.jsx("span",{className:"text-sm font-medium truncate",children:e.title})})]})}function Q7(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Np=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Yx(e){return"nodeType"in e}function Vr(e){var t,n;return e?Mc(e)?e:Yx(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Xx(e){const{Document:t}=Vr(e);return e instanceof t}function Vd(e){return Mc(e)?!1:e instanceof Vr(e).HTMLElement}function PM(e){return e instanceof Vr(e).SVGElement}function Ac(e){return e?Mc(e)?e.document:Yx(e)?Xx(e)?e:Vd(e)||PM(e)?e.ownerDocument:document:document:document}const _s=Np?b.useLayoutEffect:b.useEffect;function Zx(e){const t=b.useRef(e);return _s(()=>{t.current=e}),b.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 J7(){const e=b.useRef(null),t=b.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function wd(e,t){t===void 0&&(t=[e]);const n=b.useRef(e);return _s(()=>{n.current!==e&&(n.current=e)},t),n}function qd(e,t){const n=b.useRef();return b.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function jm(e){const t=Zx(e),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function V_(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let Eb={};function Kd(e,t){return b.useMemo(()=>{if(t)return t;const n=Eb[e]==null?0:Eb[e]+1;return Eb[e]=n,e+"-"+n},[e,t])}function BM(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((o,l)=>{const u=Object.entries(l);for(const[h,d]of u){const g=o[h];g!=null&&(o[h]=g+e*d)}return o},{...t})}}const dc=BM(1),Om=BM(-1);function eF(e){return"clientX"in e&&"clientY"in e}function Qx(e){if(!e)return!1;const{KeyboardEvent:t}=Vr(e.target);return t&&e instanceof t}function tF(e){if(!e)return!1;const{TouchEvent:t}=Vr(e.target);return t&&e instanceof t}function q_(e){if(tF(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 eF(e)?{x:e.clientX,y:e.clientY}:null}const Sd=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[Sd.Translate.toString(e),Sd.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),o2="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function nF(e){return e.matches(o2)?e:e.querySelector(o2)}const rF={display:"none"};function iF(e){let{id:t,value:n}=e;return xe.createElement("div",{id:t,style:rF},n)}function sF(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 xe.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function oF(){const[e,t]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const IM=b.createContext(null);function aF(e){const t=b.useContext(IM);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function lF(){const[e]=b.useState(()=>new Set),t=b.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[b.useCallback(r=>{let{type:s,event:o}=r;e.forEach(l=>{var u;return(u=l[s])==null?void 0:u.call(l,o)})},[e]),t]}const cF={draggable:`
|
|
490
|
+
To pick up a draggable item, press the space bar.
|
|
491
|
+
While dragging, use the arrow keys to move the item.
|
|
492
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
493
|
+
`},uF={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 dF(e){let{announcements:t=uF,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=cF}=e;const{announce:o,announcement:l}=oF(),u=Kd("DndLiveRegion"),[h,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),aF(b.useMemo(()=>({onDragStart(p){let{active:v}=p;o(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:y}=p;t.onDragMove&&o(t.onDragMove({active:v,over:y}))},onDragOver(p){let{active:v,over:y}=p;o(t.onDragOver({active:v,over:y}))},onDragEnd(p){let{active:v,over:y}=p;o(t.onDragEnd({active:v,over:y}))},onDragCancel(p){let{active:v,over:y}=p;o(t.onDragCancel({active:v,over:y}))}}),[o,t])),!h)return null;const g=xe.createElement(xe.Fragment,null,xe.createElement(iF,{id:r,value:s.draggable}),xe.createElement(sF,{id:u,announcement:l}));return n?Ui.createPortal(g,n):g}var Vn;(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"})(Vn||(Vn={}));function Lm(){}function Rb(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function hF(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Yi=Object.freeze({x:0,y:0});function fF(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function mF(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function pF(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function gF(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function a2(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 vF=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=a2(t,t.left,t.top),o=[];for(const l of r){const{id:u}=l,h=n.get(u);if(h){const d=fF(a2(h),s);o.push({id:u,data:{droppableContainer:l,value:d}})}}return o.sort(mF)};function bF(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),o=Math.min(t.top+t.height,e.top+e.height),l=s-r,u=o-n;if(r<s&&n<o){const h=t.width*t.height,d=e.width*e.height,g=l*u,p=g/(h+d-g);return Number(p.toFixed(4))}return 0}const _F=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const o of r){const{id:l}=o,u=n.get(l);if(u){const h=bF(u,t);h>0&&s.push({id:l,data:{droppableContainer:o,value:h}})}}return s.sort(pF)};function yF(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function FM(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Yi}function xF(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];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 wF=xF(1);function SF(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 CF(e,t,n){const r=SF(t);if(!r)return e;const{scaleX:s,scaleY:o,x:l,y:u}=r,h=e.left-l-(1-s)*parseFloat(n),d=e.top-u-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),g=s?e.width/s:e.width,p=o?e.height/o:e.height;return{width:g,height:p,top:d,right:h+g,bottom:d+p,left:h}}const kF={ignoreTransform:!1};function Dc(e,t){t===void 0&&(t=kF);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=Vr(e).getComputedStyle(e);d&&(n=CF(n,d,g))}const{top:r,left:s,width:o,height:l,bottom:u,right:h}=n;return{top:r,left:s,width:o,height:l,bottom:u,right:h}}function l2(e){return Dc(e,{ignoreTransform:!0})}function EF(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function RF(e,t){return t===void 0&&(t=Vr(e).getComputedStyle(e)),t.position==="fixed"}function TF(e,t){t===void 0&&(t=Vr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?n.test(o):!1})}function Jx(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Xx(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Vd(s)||PM(s)||n.includes(s))return n;const o=Vr(e).getComputedStyle(s);return s!==e&&TF(s,o)&&n.push(s),RF(s,o)?n:r(s.parentNode)}return e?r(e):n}function HM(e){const[t]=Jx(e,1);return t??null}function Tb(e){return!Np||!e?null:Mc(e)?e:Yx(e)?Xx(e)||e===Ac(e).scrollingElement?window:Vd(e)?e:null:null}function UM(e){return Mc(e)?e.scrollX:e.scrollLeft}function $M(e){return Mc(e)?e.scrollY:e.scrollTop}function K_(e){return{x:UM(e),y:$M(e)}}var er;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(er||(er={}));function WM(e){return!Np||!e?!1:e===document.scrollingElement}function VM(e){const t={x:0,y:0},n=WM(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,o=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:o,isBottom:l,isRight:u,maxScroll:r,minScroll:t}}const NF={x:.2,y:.2};function MF(e,t,n,r,s){let{top:o,left:l,right:u,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=NF);const{isTop:d,isBottom:g,isLeft:p,isRight:v}=VM(e),y={x:0,y:0},w={x:0,y:0},S={height:t.height*s.y,width:t.width*s.x};return!d&&o<=t.top+S.height?(y.y=er.Backward,w.y=r*Math.abs((t.top+S.height-o)/S.height)):!g&&h>=t.bottom-S.height&&(y.y=er.Forward,w.y=r*Math.abs((t.bottom-S.height-h)/S.height)),!v&&u>=t.right-S.width?(y.x=er.Forward,w.x=r*Math.abs((t.right-S.width-u)/S.width)):!p&&l<=t.left+S.width&&(y.x=er.Backward,w.x=r*Math.abs((t.left+S.width-l)/S.width)),{direction:y,speed:w}}function AF(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,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 qM(e){return e.reduce((t,n)=>dc(t,K_(n)),Yi)}function DF(e){return e.reduce((t,n)=>t+UM(n),0)}function jF(e){return e.reduce((t,n)=>t+$M(n),0)}function OF(e,t){if(t===void 0&&(t=Dc),!e)return;const{top:n,left:r,bottom:s,right:o}=t(e);HM(e)&&(s<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const LF=[["x",["left","right"],DF],["y",["top","bottom"],jF]];class e0{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=Jx(n),s=qM(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,l,u]of LF)for(const h of l)Object.defineProperty(this,h,{get:()=>{const d=u(r),g=s[o]-d;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class od{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 zF(e){const{EventTarget:t}=Vr(e);return e instanceof t?e:Ac(e)}function Nb(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 Ei;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ei||(Ei={}));function c2(e){e.preventDefault()}function PF(e){e.stopPropagation()}var Ht;(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"})(Ht||(Ht={}));const KM={start:[Ht.Space,Ht.Enter],cancel:[Ht.Esc],end:[Ht.Space,Ht.Enter,Ht.Tab]},BF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ht.Right:return{...n,x:n.x+25};case Ht.Left:return{...n,x:n.x-25};case Ht.Down:return{...n,y:n.y+25};case Ht.Up:return{...n,y:n.y-25}}};class t0{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 od(Ac(n)),this.windowListeners=new od(Vr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ei.Resize,this.handleCancel),this.windowListeners.add(Ei.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ei.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&OF(r),n(Yi)}handleKeyDown(t){if(Qx(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:o=KM,coordinateGetter:l=BF,scrollBehavior:u="smooth"}=s,{code:h}=t;if(o.end.includes(h)){this.handleEnd(t);return}if(o.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:d}=r.current,g=d?{x:d.left,y:d.top}:Yi;this.referenceCoordinates||(this.referenceCoordinates=g);const p=l(t,{active:n,context:r.current,currentCoordinates:g});if(p){const v=Om(p,g),y={x:0,y:0},{scrollableAncestors:w}=r.current;for(const S of w){const C=t.code,{isTop:k,isRight:R,isLeft:E,isBottom:M,maxScroll:L,minScroll:j}=VM(S),D=AF(S),H={x:Math.min(C===Ht.Right?D.right-D.width/2:D.right,Math.max(C===Ht.Right?D.left:D.left+D.width/2,p.x)),y:Math.min(C===Ht.Down?D.bottom-D.height/2:D.bottom,Math.max(C===Ht.Down?D.top:D.top+D.height/2,p.y))},G=C===Ht.Right&&!R||C===Ht.Left&&!E,I=C===Ht.Down&&!M||C===Ht.Up&&!k;if(G&&H.x!==p.x){const q=S.scrollLeft+v.x,B=C===Ht.Right&&q<=L.x||C===Ht.Left&&q>=j.x;if(B&&!v.y){S.scrollTo({left:q,behavior:u});return}B?y.x=S.scrollLeft-q:y.x=C===Ht.Right?S.scrollLeft-L.x:S.scrollLeft-j.x,y.x&&S.scrollBy({left:-y.x,behavior:u});break}else if(I&&H.y!==p.y){const q=S.scrollTop+v.y,B=C===Ht.Down&&q<=L.y||C===Ht.Up&&q>=j.y;if(B&&!v.x){S.scrollTo({top:q,behavior:u});return}B?y.y=S.scrollTop-q:y.y=C===Ht.Down?S.scrollTop-L.y:S.scrollTop-j.y,y.y&&S.scrollBy({top:-y.y,behavior:u});break}}this.handleMove(t,dc(Om(p,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()}}t0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=KM,onActivation:s}=t,{active:o}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const u=o.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function u2(e){return!!(e&&"distance"in e)}function d2(e){return!!(e&&"delay"in e)}class n0{constructor(t,n,r){var s;r===void 0&&(r=zF(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:o}=t,{target:l}=o;this.props=t,this.events=n,this.document=Ac(l),this.documentListeners=new od(this.document),this.listeners=new od(r),this.windowListeners=new od(Vr(l)),this.initialCoordinates=(s=q_(o))!=null?s:Yi,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(Ei.Resize,this.handleCancel),this.windowListeners.add(Ei.DragStart,c2),this.windowListeners.add(Ei.VisibilityChange,this.handleCancel),this.windowListeners.add(Ei.ContextMenu,c2),this.documentListeners.add(Ei.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(d2(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(u2(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(Ei.Click,PF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ei.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:o}=this,{onMove:l,options:{activationConstraint:u}}=o;if(!s)return;const h=(n=q_(t))!=null?n:Yi,d=Om(s,h);if(!r&&u){if(u2(u)){if(u.tolerance!=null&&Nb(d,u.tolerance))return this.handleCancel();if(Nb(d,u.distance))return this.handleStart()}if(d2(u)&&Nb(d,u.tolerance))return this.handleCancel();this.handlePending(u,d);return}t.cancelable&&t.preventDefault(),l(h)}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===Ht.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const IF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class r0 extends n0{constructor(t){const{event:n}=t,r=Ac(n.target);super(t,IF,r)}}r0.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 FF={move:{name:"mousemove"},end:{name:"mouseup"}};var G_;(function(e){e[e.RightClick=2]="RightClick"})(G_||(G_={}));class HF extends n0{constructor(t){super(t,FF,Ac(t.event.target))}}HF.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===G_.RightClick?!1:(r==null||r({event:n}),!0)}}];const Mb={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class GM extends n0{constructor(t){super(t,Mb)}static setup(){return window.addEventListener(Mb.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Mb.move.name,t)};function t(){}}}GM.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 ad;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ad||(ad={}));var zm;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(zm||(zm={}));function UF(e){let{acceleration:t,activator:n=ad.Pointer,canScroll:r,draggingRect:s,enabled:o,interval:l=5,order:u=zm.TreeOrder,pointerCoordinates:h,scrollableAncestors:d,scrollableAncestorRects:g,delta:p,threshold:v}=e;const y=WF({delta:p,disabled:!o}),[w,S]=J7(),C=b.useRef({x:0,y:0}),k=b.useRef({x:0,y:0}),R=b.useMemo(()=>{switch(n){case ad.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case ad.DraggableRect:return s}},[n,s,h]),E=b.useRef(null),M=b.useCallback(()=>{const j=E.current;if(!j)return;const D=C.current.x*k.current.x,H=C.current.y*k.current.y;j.scrollBy(D,H)},[]),L=b.useMemo(()=>u===zm.TreeOrder?[...d].reverse():d,[u,d]);b.useEffect(()=>{if(!o||!d.length||!R){S();return}for(const j of L){if((r==null?void 0:r(j))===!1)continue;const D=d.indexOf(j),H=g[D];if(!H)continue;const{direction:G,speed:I}=MF(j,H,R,t,v);for(const q of["x","y"])y[q][G[q]]||(I[q]=0,G[q]=0);if(I.x>0||I.y>0){S(),E.current=j,w(M,l),C.current=I,k.current=G;return}}C.current={x:0,y:0},k.current={x:0,y:0},S()},[t,M,r,S,o,l,JSON.stringify(R),JSON.stringify(y),w,d,L,g,JSON.stringify(v)])}const $F={x:{[er.Backward]:!1,[er.Forward]:!1},y:{[er.Backward]:!1,[er.Forward]:!1}};function WF(e){let{delta:t,disabled:n}=e;const r=V_(t);return qd(s=>{if(n||!r||!s)return $F;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[er.Backward]:s.x[er.Backward]||o.x===-1,[er.Forward]:s.x[er.Forward]||o.x===1},y:{[er.Backward]:s.y[er.Backward]||o.y===-1,[er.Forward]:s.y[er.Forward]||o.y===1}}},[n,t,r])}function VF(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return qd(s=>{var o;return t==null?null:(o=r??s)!=null?o:null},[r,t])}function qF(e,t){return b.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,o=s.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...o]},[]),[e,t])}var Cd;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Cd||(Cd={}));var Y_;(function(e){e.Optimized="optimized"})(Y_||(Y_={}));const h2=new Map;function KF(e,t){let{dragging:n,dependencies:r,config:s}=t;const[o,l]=b.useState(null),{frequency:u,measure:h,strategy:d}=s,g=b.useRef(e),p=C(),v=wd(p),y=b.useCallback(function(k){k===void 0&&(k=[]),!v.current&&l(R=>R===null?k:R.concat(k.filter(E=>!R.includes(E))))},[v]),w=b.useRef(null),S=qd(k=>{if(p&&!n)return h2;if(!k||k===h2||g.current!==e||o!=null){const R=new Map;for(let E of e){if(!E)continue;if(o&&o.length>0&&!o.includes(E.id)&&E.rect.current){R.set(E.id,E.rect.current);continue}const M=E.node.current,L=M?new e0(h(M),M):null;E.rect.current=L,L&&R.set(E.id,L)}return R}return k},[e,o,n,p,h]);return b.useEffect(()=>{g.current=e},[e]),b.useEffect(()=>{p||y()},[n,p]),b.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),b.useEffect(()=>{p||typeof u!="number"||w.current!==null||(w.current=setTimeout(()=>{y(),w.current=null},u))},[u,p,y,...r]),{droppableRects:S,measureDroppableContainers:y,measuringScheduled:o!=null};function C(){switch(d){case Cd.Always:return!1;case Cd.BeforeDragging:return n;default:return!n}}}function YM(e,t){return qd(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function GF(e,t){return YM(e,t)}function YF(e){let{callback:t,disabled:n}=e;const r=Zx(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Mp(e){let{callback:t,disabled:n}=e;const r=Zx(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function XF(e){return new e0(Dc(e),e)}function f2(e,t,n){t===void 0&&(t=XF);const[r,s]=b.useState(null);function o(){s(h=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=h??n)!=null?d:null}const g=t(e);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const l=YF({callback(h){if(e)for(const d of h){const{type:g,target:p}=d;if(g==="childList"&&p instanceof HTMLElement&&p.contains(e)){o();break}}}}),u=Mp({callback:o});return _s(()=>{o(),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 ZF(e){const t=YM(e);return FM(e,t)}const m2=[];function QF(e){const t=b.useRef(e),n=qd(r=>e?r&&r!==m2&&e&&t.current&&e.parentNode===t.current.parentNode?r:Jx(e):m2,[e]);return b.useEffect(()=>{t.current=e},[e]),n}function JF(e){const[t,n]=b.useState(null),r=b.useRef(e),s=b.useCallback(o=>{const l=Tb(o.target);l&&n(u=>u?(u.set(l,K_(l)),new Map(u)):null)},[]);return b.useEffect(()=>{const o=r.current;if(e!==o){l(o);const u=e.map(h=>{const d=Tb(h);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,K_(d)]):null}).filter(h=>h!=null);n(u.length?new Map(u):null),r.current=e}return()=>{l(e),l(o)};function l(u){u.forEach(h=>{const d=Tb(h);d==null||d.removeEventListener("scroll",s)})}},[s,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,l)=>dc(o,l),Yi):qM(e):Yi,[e,t])}function p2(e,t){t===void 0&&(t=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},t),b.useEffect(()=>{const r=e!==Yi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Om(e,n.current):Yi}function eH(e){b.useEffect(()=>{if(!Np)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 tH(e,t){return b.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:o}=r;return n[s]=l=>{o(l,t)},n},{}),[e,t])}function XM(e){return b.useMemo(()=>e?EF(e):null,[e])}const g2=[];function nH(e,t){t===void 0&&(t=Dc);const[n]=e,r=XM(n?Vr(n):null),[s,o]=b.useState(g2);function l(){o(()=>e.length?e.map(h=>WM(h)?r:new e0(t(h),h)):g2)}const u=Mp({callback:l});return _s(()=>{u==null||u.disconnect(),l(),e.forEach(h=>u==null?void 0:u.observe(h))},[e]),s}function rH(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Vd(t)?t:e}function iH(e){let{measure:t}=e;const[n,r]=b.useState(null),s=b.useCallback(d=>{for(const{target:g}of d)if(Vd(g)){r(p=>{const v=t(g);return p?{...p,width:v.width,height:v.height}:v});break}},[t]),o=Mp({callback:s}),l=b.useCallback(d=>{const g=rH(d);o==null||o.disconnect(),g&&(o==null||o.observe(g)),r(g?t(g):null)},[t,o]),[u,h]=jm(l);return b.useMemo(()=>({nodeRef:u,rect:n,setRef:h}),[n,u,h])}const sH=[{sensor:r0,options:{}},{sensor:t0,options:{}}],oH={current:{}},om={draggable:{measure:l2},droppable:{measure:l2,strategy:Cd.WhileDragging,frequency:Y_.Optimized},dragOverlay:{measure:Dc}};class ld 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 aH={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ld,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Lm},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:om,measureDroppableContainers:Lm,windowRect:null,measuringScheduled:!1},lH={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Lm,draggableNodes:new Map,over:null,measureDroppableContainers:Lm},Ap=b.createContext(lH),ZM=b.createContext(aH);function cH(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ld}}}function uH(e,t){switch(t.type){case Vn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Vn.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 Vn.DragEnd:case Vn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Vn.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new ld(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Vn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new ld(e.droppable.containers);return l.set(n,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:l}}}case Vn.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const o=new ld(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function dH(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(Ap),o=V_(r),l=V_(n==null?void 0:n.id);return b.useEffect(()=>{if(!t&&!r&&o&&l!=null){if(!Qx(o)||document.activeElement===o.target)return;const u=s.get(l);if(!u)return;const{activatorNode:h,node:d}=u;if(!h.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[h.current,d.current]){if(!g)continue;const p=nF(g);if(p){p.focus();break}}})}},[r,t,s,l,o]),null}function hH(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...r}),n):n}function fH(e){return b.useMemo(()=>({draggable:{...om.draggable,...e==null?void 0:e.draggable},droppable:{...om.droppable,...e==null?void 0:e.droppable},dragOverlay:{...om.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 mH(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const o=b.useRef(!1),{x:l,y:u}=typeof s=="boolean"?{x:s,y:s}:s;_s(()=>{if(!l&&!u||!t){o.current=!1;return}if(o.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const g=n(d),p=FM(g,r);if(l||(p.x=0),u||(p.y=0),o.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const v=HM(d);v&&v.scrollBy({top:p.y,left:p.x})}},[t,l,u,r,n])}const QM=b.createContext({...Yi,scaleX:1,scaleY:1});var Yo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Yo||(Yo={}));const pH=b.memo(function(t){var n,r,s,o;let{id:l,accessibility:u,autoScroll:h=!0,children:d,sensors:g=sH,collisionDetection:p=_F,measuring:v,modifiers:y,...w}=t;const S=b.useReducer(uH,void 0,cH),[C,k]=S,[R,E]=lF(),[M,L]=b.useState(Yo.Uninitialized),j=M===Yo.Initialized,{draggable:{active:D,nodes:H,translate:G},droppable:{containers:I}}=C,q=D!=null?H.get(D):null,B=b.useRef({initial:null,translated:null}),W=b.useMemo(()=>{var Lt;return D!=null?{id:D,data:(Lt=q==null?void 0:q.data)!=null?Lt:oH,rect:B}:null},[D,q]),F=b.useRef(null),[V,O]=b.useState(null),[$,U]=b.useState(null),Y=wd(w,Object.values(w)),A=Kd("DndDescribedBy",l),P=b.useMemo(()=>I.getEnabled(),[I]),X=fH(v),{droppableRects:N,measureDroppableContainers:ne,measuringScheduled:oe}=KF(P,{dragging:j,dependencies:[G.x,G.y],config:X.droppable}),J=VF(H,D),te=b.useMemo(()=>$?q_($):null,[$]),ue=Sr(),he=GF(J,X.draggable.measure);mH({activeNode:D!=null?H.get(D):null,config:ue.layoutShiftCompensation,initialRect:he,measure:X.draggable.measure});const ge=f2(J,X.draggable.measure,he),ke=f2(J?J.parentElement:null),Ee=b.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),De=I.getNodeFor((n=Ee.current.over)==null?void 0:n.id),Xe=iH({measure:X.dragOverlay.measure}),pt=(r=Xe.nodeRef.current)!=null?r:J,at=j?(s=Xe.rect)!=null?s:ge:null,fe=!!(Xe.nodeRef.current&&Xe.rect),Ve=ZF(fe?null:ge),Ae=XM(pt?Vr(pt):null),et=QF(j?De??J:null),lt=nH(et),nt=hH(y,{transform:{x:G.x-Ve.x,y:G.y-Ve.y,scaleX:1,scaleY:1},activatorEvent:$,active:W,activeNodeRect:ge,containerNodeRect:ke,draggingNodeRect:at,over:Ee.current.over,overlayNodeRect:Xe.rect,scrollableAncestors:et,scrollableAncestorRects:lt,windowRect:Ae}),Kt=te?dc(te,G):null,Se=JF(et),qe=p2(Se),se=p2(Se,[ge]),pe=dc(nt,qe),Ne=at?wF(at,nt):null,He=W&&Ne?p({active:W,collisionRect:Ne,droppableRects:N,droppableContainers:P,pointerCoordinates:Kt}):null,Oe=gF(He,"id"),[xt,Bt]=b.useState(null),Le=fe?nt:dc(nt,se),Ke=yF(Le,(o=xt==null?void 0:xt.rect)!=null?o:null,ge),ft=b.useRef(null),we=b.useCallback((Lt,It)=>{let{sensor:Pe,options:ot}=It;if(F.current==null)return;const wt=H.get(F.current);if(!wt)return;const gt=Lt.nativeEvent,At=new Pe({active:F.current,activeNode:wt,event:gt,options:ot,context:Ee,onAbort(mt){if(!H.get(mt))return;const{onDragAbort:Te}=Y.current,je={id:mt};Te==null||Te(je),R({type:"onDragAbort",event:je})},onPending(mt,yn,Te,je){if(!H.get(mt))return;const{onDragPending:it}=Y.current,Yt={id:mt,constraint:yn,initialCoordinates:Te,offset:je};it==null||it(Yt),R({type:"onDragPending",event:Yt})},onStart(mt){const yn=F.current;if(yn==null)return;const Te=H.get(yn);if(!Te)return;const{onDragStart:je}=Y.current,Tt={activatorEvent:gt,active:{id:yn,data:Te.data,rect:B}};Ui.unstable_batchedUpdates(()=>{je==null||je(Tt),L(Yo.Initializing),k({type:Vn.DragStart,initialCoordinates:mt,active:yn}),R({type:"onDragStart",event:Tt}),O(ft.current),U(gt)})},onMove(mt){k({type:Vn.DragMove,coordinates:mt})},onEnd:ut(Vn.DragEnd),onCancel:ut(Vn.DragCancel)});ft.current=At;function ut(mt){return async function(){const{active:Te,collisions:je,over:Tt,scrollAdjustedTranslate:it}=Ee.current;let Yt=null;if(Te&&it){const{cancelDrop:an}=Y.current;Yt={activatorEvent:gt,active:Te,collisions:je,delta:it,over:Tt},mt===Vn.DragEnd&&typeof an=="function"&&await Promise.resolve(an(Yt))&&(mt=Vn.DragCancel)}F.current=null,Ui.unstable_batchedUpdates(()=>{k({type:mt}),L(Yo.Uninitialized),Bt(null),O(null),U(null),ft.current=null;const an=mt===Vn.DragEnd?"onDragEnd":"onDragCancel";if(Yt){const $t=Y.current[an];$t==null||$t(Yt),R({type:an,event:Yt})}})}}},[H]),Rt=b.useCallback((Lt,It)=>(Pe,ot)=>{const wt=Pe.nativeEvent,gt=H.get(ot);if(F.current!==null||!gt||wt.dndKit||wt.defaultPrevented)return;const At={active:gt};Lt(Pe,It.options,At)===!0&&(wt.dndKit={capturedBy:It.sensor},F.current=ot,we(Pe,It))},[H,we]),Gt=qF(g,Rt);eH(g),_s(()=>{ge&&M===Yo.Initializing&&L(Yo.Initialized)},[ge,M]),b.useEffect(()=>{const{onDragMove:Lt}=Y.current,{active:It,activatorEvent:Pe,collisions:ot,over:wt}=Ee.current;if(!It||!Pe)return;const gt={active:It,activatorEvent:Pe,collisions:ot,delta:{x:pe.x,y:pe.y},over:wt};Ui.unstable_batchedUpdates(()=>{Lt==null||Lt(gt),R({type:"onDragMove",event:gt})})},[pe.x,pe.y]),b.useEffect(()=>{const{active:Lt,activatorEvent:It,collisions:Pe,droppableContainers:ot,scrollAdjustedTranslate:wt}=Ee.current;if(!Lt||F.current==null||!It||!wt)return;const{onDragOver:gt}=Y.current,At=ot.get(Oe),ut=At&&At.rect.current?{id:At.id,rect:At.rect.current,data:At.data,disabled:At.disabled}:null,mt={active:Lt,activatorEvent:It,collisions:Pe,delta:{x:wt.x,y:wt.y},over:ut};Ui.unstable_batchedUpdates(()=>{Bt(ut),gt==null||gt(mt),R({type:"onDragOver",event:mt})})},[Oe]),_s(()=>{Ee.current={activatorEvent:$,active:W,activeNode:J,collisionRect:Ne,collisions:He,droppableRects:N,draggableNodes:H,draggingNode:pt,draggingNodeRect:at,droppableContainers:I,over:xt,scrollableAncestors:et,scrollAdjustedTranslate:pe},B.current={initial:at,translated:Ne}},[W,J,He,Ne,H,pt,at,N,I,xt,et,pe]),UF({...ue,delta:G,draggingRect:Ne,pointerCoordinates:Kt,scrollableAncestors:et,scrollableAncestorRects:lt});const _n=b.useMemo(()=>({active:W,activeNode:J,activeNodeRect:ge,activatorEvent:$,collisions:He,containerNodeRect:ke,dragOverlay:Xe,draggableNodes:H,droppableContainers:I,droppableRects:N,over:xt,measureDroppableContainers:ne,scrollableAncestors:et,scrollableAncestorRects:lt,measuringConfiguration:X,measuringScheduled:oe,windowRect:Ae}),[W,J,ge,$,He,ke,Xe,H,I,N,xt,ne,et,lt,X,oe,Ae]),Kn=b.useMemo(()=>({activatorEvent:$,activators:Gt,active:W,activeNodeRect:ge,ariaDescribedById:{draggable:A},dispatch:k,draggableNodes:H,over:xt,measureDroppableContainers:ne}),[$,Gt,W,ge,k,A,H,xt,ne]);return xe.createElement(IM.Provider,{value:E},xe.createElement(Ap.Provider,{value:Kn},xe.createElement(ZM.Provider,{value:_n},xe.createElement(QM.Provider,{value:Ke},d)),xe.createElement(dH,{disabled:(u==null?void 0:u.restoreFocus)===!1})),xe.createElement(dF,{...u,hiddenTextDescribedById:A}));function Sr(){const Lt=(V==null?void 0:V.autoScrollEnabled)===!1,It=typeof h=="object"?h.enabled===!1:h===!1,Pe=j&&!Lt&&!It;return typeof h=="object"?{...h,enabled:Pe}:{enabled:Pe}}}),gH=b.createContext(null),v2="button",vH="Draggable";function bH(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const o=Kd(vH),{activators:l,activatorEvent:u,active:h,activeNodeRect:d,ariaDescribedById:g,draggableNodes:p,over:v}=b.useContext(Ap),{role:y=v2,roleDescription:w="draggable",tabIndex:S=0}=s??{},C=(h==null?void 0:h.id)===t,k=b.useContext(C?QM:gH),[R,E]=jm(),[M,L]=jm(),j=tH(l,t),D=wd(n);_s(()=>(p.set(t,{id:t,key:o,node:R,activatorNode:M,data:D}),()=>{const G=p.get(t);G&&G.key===o&&p.delete(t)}),[p,t]);const H=b.useMemo(()=>({role:y,tabIndex:S,"aria-disabled":r,"aria-pressed":C&&y===v2?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,y,S,C,w,g.draggable]);return{active:h,activatorEvent:u,activeNodeRect:d,attributes:H,isDragging:C,listeners:r?void 0:j,node:R,over:v,setNodeRef:E,setActivatorNodeRef:L,transform:k}}function _H(){return b.useContext(ZM)}const yH="Droppable",xH={timeout:25};function wH(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const o=Kd(yH),{active:l,dispatch:u,over:h,measureDroppableContainers:d}=b.useContext(Ap),g=b.useRef({disabled:n}),p=b.useRef(!1),v=b.useRef(null),y=b.useRef(null),{disabled:w,updateMeasurementsFor:S,timeout:C}={...xH,...s},k=wd(S??r),R=b.useCallback(()=>{if(!p.current){p.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),y.current=null},C)},[C]),E=Mp({callback:R,disabled:w||!l}),M=b.useCallback((H,G)=>{E&&(G&&(E.unobserve(G),p.current=!1),H&&E.observe(H))},[E]),[L,j]=jm(M),D=wd(t);return b.useEffect(()=>{!E||!L.current||(E.disconnect(),p.current=!1,E.observe(L.current))},[L,E]),b.useEffect(()=>(u({type:Vn.RegisterDroppable,element:{id:r,key:o,disabled:n,node:L,rect:v,data:D}}),()=>u({type:Vn.UnregisterDroppable,key:o,id:r})),[r]),b.useEffect(()=>{n!==g.current.disabled&&(u({type:Vn.SetDroppableDisabled,id:r,key:o,disabled:n}),g.current.disabled=n)},[r,o,n,u]),{active:l,rect:v,isOver:(h==null?void 0:h.id)===r,node:L,over:h,setNodeRef:j}}function Dp(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function SH(e,t){return e.reduce((n,r,s)=>{const o=t.get(r);return o&&(n[s]=o),n},Array(e.length))}function jf(e){return e!==null&&e>=0}function CH(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 kH(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const JM=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const o=Dp(t,r,n),l=t[s],u=o[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}},Of={scaleX:1,scaleY:1},EH=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:o,overIndex:l}=e;const u=(t=o[n])!=null?t:r;if(!u)return null;if(s===n){const d=o[l];return d?{x:0,y:n<l?d.top+d.height-(u.top+u.height):d.top-u.top,...Of}:null}const h=RH(o,s,n);return s>n&&s<=l?{x:0,y:-u.height-h,...Of}:s<n&&s>=l?{x:0,y:u.height+h,...Of}:{x:0,y:0,...Of}};function RH(e,t,n){const r=e[t],s=e[t-1],o=e[t+1];return r?n<t?s?r.top-(s.top+s.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const e5="Sortable",t5=xe.createContext({activeIndex:-1,containerId:e5,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:JM,disabled:{draggable:!1,droppable:!1}});function TH(e){let{children:t,id:n,items:r,strategy:s=JM,disabled:o=!1}=e;const{active:l,dragOverlay:u,droppableRects:h,over:d,measureDroppableContainers:g}=_H(),p=Kd(e5,n),v=u.rect!==null,y=b.useMemo(()=>r.map(j=>typeof j=="object"&&"id"in j?j.id:j),[r]),w=l!=null,S=l?y.indexOf(l.id):-1,C=d?y.indexOf(d.id):-1,k=b.useRef(y),R=!CH(y,k.current),E=C!==-1&&S===-1||R,M=kH(o);_s(()=>{R&&w&&g(y)},[R,y,w,g]),b.useEffect(()=>{k.current=y},[y]);const L=b.useMemo(()=>({activeIndex:S,containerId:p,disabled:M,disableTransforms:E,items:y,overIndex:C,useDragOverlay:v,sortedRects:SH(y,h),strategy:s}),[S,p,M.draggable,M.droppable,E,y,C,h,v,s]);return xe.createElement(t5.Provider,{value:L},t)}const NH=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Dp(n,r,s).indexOf(t)},MH=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:o,newIndex:l,previousItems:u,previousContainerId:h,transition:d}=e;return!d||!r||u!==o&&s===l?!1:n?!0:l!==s&&t===h},AH={duration:200,easing:"ease"},n5="transform",DH=Sd.Transition.toString({property:n5,duration:0,easing:"linear"}),jH={roleDescription:"sortable"};function OH(e){let{disabled:t,index:n,node:r,rect:s}=e;const[o,l]=b.useState(null),u=b.useRef(n);return _s(()=>{if(!t&&n!==u.current&&r.current){const h=s.current;if(h){const d=Dc(r.current,{ignoreTransform:!0}),g={x:h.left-d.left,y:h.top-d.top,scaleX:h.width/d.width,scaleY:h.height/d.height};(g.x||g.y)&&l(g)}}n!==u.current&&(u.current=n)},[t,n,r,s]),b.useEffect(()=>{o&&l(null)},[o]),o}function LH(e){let{animateLayoutChanges:t=MH,attributes:n,disabled:r,data:s,getNewIndex:o=NH,id:l,strategy:u,resizeObserverConfig:h,transition:d=AH}=e;const{items:g,containerId:p,activeIndex:v,disabled:y,disableTransforms:w,sortedRects:S,overIndex:C,useDragOverlay:k,strategy:R}=b.useContext(t5),E=zH(r,y),M=g.indexOf(l),L=b.useMemo(()=>({sortable:{containerId:p,index:M,items:g},...s}),[p,s,M,g]),j=b.useMemo(()=>g.slice(g.indexOf(l)),[g,l]),{rect:D,node:H,isOver:G,setNodeRef:I}=wH({id:l,data:L,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...h}}),{active:q,activatorEvent:B,activeNodeRect:W,attributes:F,setNodeRef:V,listeners:O,isDragging:$,over:U,setActivatorNodeRef:Y,transform:A}=bH({id:l,data:L,attributes:{...jH,...n},disabled:E.draggable}),P=Q7(I,V),X=!!q,N=X&&!w&&jf(v)&&jf(C),ne=!k&&$,oe=ne&&N?A:null,te=N?oe??(u??R)({rects:S,activeNodeRect:W,activeIndex:v,overIndex:C,index:M}):null,ue=jf(v)&&jf(C)?o({id:l,items:g,activeIndex:v,overIndex:C}):M,he=q==null?void 0:q.id,ge=b.useRef({activeId:he,items:g,newIndex:ue,containerId:p}),ke=g!==ge.current.items,Ee=t({active:q,containerId:p,isDragging:$,isSorting:X,id:l,index:M,items:g,newIndex:ge.current.newIndex,previousItems:ge.current.items,previousContainerId:ge.current.containerId,transition:d,wasDragging:ge.current.activeId!=null}),De=OH({disabled:!Ee,index:M,node:H,rect:D});return b.useEffect(()=>{X&&ge.current.newIndex!==ue&&(ge.current.newIndex=ue),p!==ge.current.containerId&&(ge.current.containerId=p),g!==ge.current.items&&(ge.current.items=g)},[X,ue,p,g]),b.useEffect(()=>{if(he===ge.current.activeId)return;if(he!=null&&ge.current.activeId==null){ge.current.activeId=he;return}const pt=setTimeout(()=>{ge.current.activeId=he},50);return()=>clearTimeout(pt)},[he]),{active:q,activeIndex:v,attributes:F,data:L,rect:D,index:M,newIndex:ue,items:g,isOver:G,isSorting:X,isDragging:$,listeners:O,node:H,overIndex:C,over:U,setNodeRef:P,setActivatorNodeRef:Y,setDroppableNodeRef:I,setDraggableNodeRef:V,transform:De??te,transition:Xe()};function Xe(){if(De||ke&&ge.current.newIndex===M)return DH;if(!(ne&&!Qx(B)||!d)&&(X||Ee))return Sd.Transition.toString({...d,property:n5})}}function zH(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}}Ht.Down,Ht.Right,Ht.Up,Ht.Left;const b2={idea:"border-amber-500/30 bg-amber-500/15 text-amber-700 dark:border-amber-500/40 dark:bg-amber-500/12 dark:text-amber-200",todo:"border-sky-500/30 bg-sky-500/15 text-sky-700 dark:border-sky-500/40 dark:bg-sky-500/12 dark:text-sky-200",progress:"border-indigo-500/30 bg-indigo-500/15 text-indigo-700 dark:border-indigo-500/40 dark:bg-indigo-500/12 dark:text-indigo-200",testing:"border-cyan-500/30 bg-cyan-500/15 text-cyan-700 dark:border-cyan-500/40 dark:bg-cyan-500/12 dark:text-cyan-200",done:"border-emerald-500/30 bg-emerald-500/15 text-emerald-700 dark:border-emerald-500/40 dark:bg-emerald-500/12 dark:text-emerald-200"};function _2(e,[t,n]){return Math.min(n,Math.max(t,e))}function i0(e){const t=e+"CollectionProvider",[n,r]=io(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:k}=S,R=xe.useRef(null),E=xe.useRef(new Map).current;return f.jsx(s,{scope:C,itemMap:E,collectionRef:R,children:k})};l.displayName=t;const u=e+"CollectionSlot",h=qa(u),d=xe.forwardRef((S,C)=>{const{scope:k,children:R}=S,E=o(u,k),M=Ut(C,E.collectionRef);return f.jsx(h,{ref:M,children:R})});d.displayName=u;const g=e+"CollectionItemSlot",p="data-radix-collection-item",v=qa(g),y=xe.forwardRef((S,C)=>{const{scope:k,children:R,...E}=S,M=xe.useRef(null),L=Ut(C,M),j=o(g,k);return xe.useEffect(()=>(j.itemMap.set(M,{ref:M,...E}),()=>void j.itemMap.delete(M))),f.jsx(v,{[p]:"",ref:L,children:R})});y.displayName=g;function w(S){const C=o(e+"CollectionConsumer",S);return xe.useCallback(()=>{const R=C.collectionRef.current;if(!R)return[];const E=Array.from(R.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((j,D)=>E.indexOf(j.ref.current)-E.indexOf(D.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:d,ItemSlot:y},w,r]}var PH=b.createContext(void 0);function s0(e){const t=b.useContext(PH);return e||t||"ltr"}function BH(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var IH=[" ","Enter","ArrowUp","ArrowDown"],FH=[" ","Enter"],Ya="Select",[jp,Op,HH]=i0(Ya),[jc,jre]=io(Ya,[HH,sa]),Lp=sa(),[UH,aa]=jc(Ya),[$H,WH]=jc(Ya),r5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:l,defaultValue:u,onValueChange:h,dir:d,name:g,autoComplete:p,disabled:v,required:y,form:w}=e,S=Lp(t),[C,k]=b.useState(null),[R,E]=b.useState(null),[M,L]=b.useState(!1),j=s0(d),[D,H]=pc({prop:r,defaultProp:s??!1,onChange:o,caller:Ya}),[G,I]=pc({prop:l,defaultProp:u,onChange:h,caller:Ya}),q=b.useRef(null),B=C?w||!!C.closest("form"):!0,[W,F]=b.useState(new Set),V=Array.from(W).map(O=>O.props.value).join(";");return f.jsx(yp,{...S,children:f.jsxs(UH,{required:y,scope:t,trigger:C,onTriggerChange:k,valueNode:R,onValueNodeChange:E,valueNodeHasChildren:M,onValueNodeHasChildrenChange:L,contentId:Zs(),value:G,onValueChange:I,open:D,onOpenChange:H,dir:j,triggerPointerDownPosRef:q,disabled:v,children:[f.jsx(jp.Provider,{scope:t,children:f.jsx($H,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(O=>{F($=>new Set($).add(O))},[]),onNativeOptionRemove:b.useCallback(O=>{F($=>{const U=new Set($);return U.delete(O),U})},[]),children:n})}),B?f.jsxs(T5,{"aria-hidden":!0,required:y,tabIndex:-1,name:g,autoComplete:p,value:G,onChange:O=>I(O.target.value),disabled:v,form:w,children:[G===void 0?f.jsx("option",{value:""}):null,Array.from(W)]},V):null]})})};r5.displayName=Ya;var i5="SelectTrigger",s5=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Lp(n),l=aa(i5,n),u=l.disabled||r,h=Ut(t,l.onTriggerChange),d=Op(n),g=b.useRef("touch"),[p,v,y]=M5(S=>{const C=d().filter(E=>!E.disabled),k=C.find(E=>E.value===l.value),R=A5(C,S,k);R!==void 0&&l.onValueChange(R.value)}),w=S=>{u||(l.onOpenChange(!0),y()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return f.jsx(Ud,{asChild:!0,...o,children:f.jsx(Et.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":N5(l.value)?"":void 0,...s,ref:h,onClick:Fe(s.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&w(S)}),onPointerDown:Fe(s.onPointerDown,S=>{g.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(w(S),S.preventDefault())}),onKeyDown:Fe(s.onKeyDown,S=>{const C=p.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&v(S.key),!(C&&S.key===" ")&&IH.includes(S.key)&&(w(),S.preventDefault())})})})});s5.displayName=i5;var o5="SelectValue",a5=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:l="",...u}=e,h=aa(o5,n),{onValueNodeHasChildrenChange:d}=h,g=o!==void 0,p=Ut(t,h.onValueNodeChange);return xr(()=>{d(g)},[d,g]),f.jsx(Et.span,{...u,ref:p,style:{pointerEvents:"none"},children:N5(h.value)?f.jsx(f.Fragment,{children:l}):o})});a5.displayName=o5;var VH="SelectIcon",l5=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return f.jsx(Et.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});l5.displayName=VH;var qH="SelectPortal",c5=e=>f.jsx(Rc,{asChild:!0,...e});c5.displayName=qH;var Xa="SelectContent",u5=b.forwardRef((e,t)=>{const n=aa(Xa,e.__scopeSelect),[r,s]=b.useState();if(xr(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Ui.createPortal(f.jsx(d5,{scope:e.__scopeSelect,children:f.jsx(jp.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),o):null}return f.jsx(h5,{...e,ref:t})});u5.displayName=Xa;var Hi=10,[d5,la]=jc(Xa),KH="SelectContentImpl",GH=qa("SelectContent.RemoveScroll"),h5=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:h,align:d,alignOffset:g,arrowPadding:p,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:S,avoidCollisions:C,...k}=e,R=aa(Xa,n),[E,M]=b.useState(null),[L,j]=b.useState(null),D=Ut(t,te=>M(te)),[H,G]=b.useState(null),[I,q]=b.useState(null),B=Op(n),[W,F]=b.useState(!1),V=b.useRef(!1);b.useEffect(()=>{if(E)return cp(E)},[E]),ap();const O=b.useCallback(te=>{const[ue,...he]=B().map(Ee=>Ee.ref.current),[ge]=he.slice(-1),ke=document.activeElement;for(const Ee of te)if(Ee===ke||(Ee==null||Ee.scrollIntoView({block:"nearest"}),Ee===ue&&L&&(L.scrollTop=0),Ee===ge&&L&&(L.scrollTop=L.scrollHeight),Ee==null||Ee.focus(),document.activeElement!==ke))return},[B,L]),$=b.useCallback(()=>O([H,E]),[O,H,E]);b.useEffect(()=>{W&&$()},[W,$]);const{onOpenChange:U,triggerPointerDownPosRef:Y}=R;b.useEffect(()=>{if(E){let te={x:0,y:0};const ue=ge=>{var ke,Ee;te={x:Math.abs(Math.round(ge.pageX)-(((ke=Y.current)==null?void 0:ke.x)??0)),y:Math.abs(Math.round(ge.pageY)-(((Ee=Y.current)==null?void 0:Ee.y)??0))}},he=ge=>{te.x<=10&&te.y<=10?ge.preventDefault():E.contains(ge.target)||U(!1),document.removeEventListener("pointermove",ue),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",he,{capture:!0})}}},[E,U,Y]),b.useEffect(()=>{const te=()=>U(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[U]);const[A,P]=M5(te=>{const ue=B().filter(ke=>!ke.disabled),he=ue.find(ke=>ke.ref.current===document.activeElement),ge=A5(ue,te,he);ge&&setTimeout(()=>ge.ref.current.focus())}),X=b.useCallback((te,ue,he)=>{const ge=!V.current&&!he;(R.value!==void 0&&R.value===ue||ge)&&(G(te),ge&&(V.current=!0))},[R.value]),N=b.useCallback(()=>E==null?void 0:E.focus(),[E]),ne=b.useCallback((te,ue,he)=>{const ge=!V.current&&!he;(R.value!==void 0&&R.value===ue||ge)&&q(te)},[R.value]),oe=r==="popper"?X_:f5,J=oe===X_?{side:u,sideOffset:h,align:d,alignOffset:g,arrowPadding:p,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:S,avoidCollisions:C}:{};return f.jsx(d5,{scope:n,content:E,viewport:L,onViewportChange:j,itemRefCallback:X,selectedItem:H,onItemLeave:N,itemTextRefCallback:ne,focusSelectedItem:$,selectedItemText:I,position:r,isPositioned:W,searchRef:A,children:f.jsx(Pd,{as:GH,allowPinchZoom:!0,children:f.jsx(zd,{asChild:!0,trapped:R.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:Fe(s,te=>{var ue;(ue=R.trigger)==null||ue.focus({preventScroll:!0}),te.preventDefault()}),children:f.jsx(Ec,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:f.jsx(oe,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:te=>te.preventDefault(),...k,...J,onPlaced:()=>F(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Fe(k.onKeyDown,te=>{const ue=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!ue&&te.key.length===1&&P(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let ge=B().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(te.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const ke=te.target,Ee=ge.indexOf(ke);ge=ge.slice(Ee+1)}setTimeout(()=>O(ge)),te.preventDefault()}})})})})})})});h5.displayName=KH;var YH="SelectItemAlignedPosition",f5=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=aa(Xa,n),l=la(Xa,n),[u,h]=b.useState(null),[d,g]=b.useState(null),p=Ut(t,D=>g(D)),v=Op(n),y=b.useRef(!1),w=b.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:k,focusSelectedItem:R}=l,E=b.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&S&&C&&k){const D=o.trigger.getBoundingClientRect(),H=d.getBoundingClientRect(),G=o.valueNode.getBoundingClientRect(),I=k.getBoundingClientRect();if(o.dir!=="rtl"){const ke=I.left-H.left,Ee=G.left-ke,De=D.left-Ee,Xe=D.width+De,pt=Math.max(Xe,H.width),at=window.innerWidth-Hi,fe=_2(Ee,[Hi,Math.max(Hi,at-pt)]);u.style.minWidth=Xe+"px",u.style.left=fe+"px"}else{const ke=H.right-I.right,Ee=window.innerWidth-G.right-ke,De=window.innerWidth-D.right-Ee,Xe=D.width+De,pt=Math.max(Xe,H.width),at=window.innerWidth-Hi,fe=_2(Ee,[Hi,Math.max(Hi,at-pt)]);u.style.minWidth=Xe+"px",u.style.right=fe+"px"}const q=v(),B=window.innerHeight-Hi*2,W=S.scrollHeight,F=window.getComputedStyle(d),V=parseInt(F.borderTopWidth,10),O=parseInt(F.paddingTop,10),$=parseInt(F.borderBottomWidth,10),U=parseInt(F.paddingBottom,10),Y=V+O+W+U+$,A=Math.min(C.offsetHeight*5,Y),P=window.getComputedStyle(S),X=parseInt(P.paddingTop,10),N=parseInt(P.paddingBottom,10),ne=D.top+D.height/2-Hi,oe=B-ne,J=C.offsetHeight/2,te=C.offsetTop+J,ue=V+O+te,he=Y-ue;if(ue<=ne){const ke=q.length>0&&C===q[q.length-1].ref.current;u.style.bottom="0px";const Ee=d.clientHeight-S.offsetTop-S.offsetHeight,De=Math.max(oe,J+(ke?N:0)+Ee+$),Xe=ue+De;u.style.height=Xe+"px"}else{const ke=q.length>0&&C===q[0].ref.current;u.style.top="0px";const De=Math.max(ne,V+S.offsetTop+(ke?X:0)+J)+he;u.style.height=De+"px",S.scrollTop=ue-ne+S.offsetTop}u.style.margin=`${Hi}px 0`,u.style.minHeight=A+"px",u.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[v,o.trigger,o.valueNode,u,d,S,C,k,o.dir,r]);xr(()=>E(),[E]);const[M,L]=b.useState();xr(()=>{d&&L(window.getComputedStyle(d).zIndex)},[d]);const j=b.useCallback(D=>{D&&w.current===!0&&(E(),R==null||R(),w.current=!1)},[E,R]);return f.jsx(ZH,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:y,onScrollButtonChange:j,children:f.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx(Et.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});f5.displayName=YH;var XH="SelectPopperPosition",X_=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Hi,...o}=e,l=Lp(n);return f.jsx(xp,{...l,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});X_.displayName=XH;var[ZH,o0]=jc(Xa,{}),Z_="SelectViewport",m5=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=la(Z_,n),l=o0(Z_,n),u=Ut(t,o.onViewportChange),h=b.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx(jp.Slot,{scope:n,children:f.jsx(Et.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Fe(s.onScroll,d=>{const g=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:v}=l;if(v!=null&&v.current&&p){const y=Math.abs(h.current-g.scrollTop);if(y>0){const w=window.innerHeight-Hi*2,S=parseFloat(p.style.minHeight),C=parseFloat(p.style.height),k=Math.max(S,C);if(k<w){const R=k+y,E=Math.min(w,R),M=R-E;p.style.height=E+"px",p.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,p.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})});m5.displayName=Z_;var p5="SelectGroup",[QH,JH]=jc(p5),g5=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Zs();return f.jsx(QH,{scope:n,id:s,children:f.jsx(Et.div,{role:"group","aria-labelledby":s,...r,ref:t})})});g5.displayName=p5;var v5="SelectLabel",b5=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=JH(v5,n);return f.jsx(Et.div,{id:s.id,...r,ref:t})});b5.displayName=v5;var Pm="SelectItem",[eU,_5]=jc(Pm),y5=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...l}=e,u=aa(Pm,n),h=la(Pm,n),d=u.value===r,[g,p]=b.useState(o??""),[v,y]=b.useState(!1),w=Ut(t,R=>{var E;return(E=h.itemRefCallback)==null?void 0:E.call(h,R,r,s)}),S=Zs(),C=b.useRef("touch"),k=()=>{s||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(eU,{scope:n,value:r,disabled:s,textId:S,isSelected:d,onItemTextChange:b.useCallback(R=>{p(E=>E||((R==null?void 0:R.textContent)??"").trim())},[]),children:f.jsx(jp.ItemSlot,{scope:n,value:r,disabled:s,textValue:g,children:f.jsx(Et.div,{role:"option","aria-labelledby":S,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:w,onFocus:Fe(l.onFocus,()=>y(!0)),onBlur:Fe(l.onBlur,()=>y(!1)),onClick:Fe(l.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Fe(l.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Fe(l.onPointerDown,R=>{C.current=R.pointerType}),onPointerMove:Fe(l.onPointerMove,R=>{var E;C.current=R.pointerType,s?(E=h.onItemLeave)==null||E.call(h):C.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Fe(l.onPointerLeave,R=>{var E;R.currentTarget===document.activeElement&&((E=h.onItemLeave)==null||E.call(h))}),onKeyDown:Fe(l.onKeyDown,R=>{var M;((M=h.searchRef)==null?void 0:M.current)!==""&&R.key===" "||(FH.includes(R.key)&&k(),R.key===" "&&R.preventDefault())})})})})});y5.displayName=Pm;var Gu="SelectItemText",x5=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,l=aa(Gu,n),u=la(Gu,n),h=_5(Gu,n),d=WH(Gu,n),[g,p]=b.useState(null),v=Ut(t,k=>p(k),h.onItemTextChange,k=>{var R;return(R=u.itemTextRefCallback)==null?void 0:R.call(u,k,h.value,h.disabled)}),y=g==null?void 0:g.textContent,w=b.useMemo(()=>f.jsx("option",{value:h.value,disabled:h.disabled,children:y},h.value),[h.disabled,h.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=d;return xr(()=>(S(w),()=>C(w)),[S,C,w]),f.jsxs(f.Fragment,{children:[f.jsx(Et.span,{id:h.textId,...o,ref:v}),h.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ui.createPortal(o.children,l.valueNode):null]})});x5.displayName=Gu;var w5="SelectItemIndicator",S5=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return _5(w5,n).isSelected?f.jsx(Et.span,{"aria-hidden":!0,...r,ref:t}):null});S5.displayName=w5;var Q_="SelectScrollUpButton",C5=b.forwardRef((e,t)=>{const n=la(Q_,e.__scopeSelect),r=o0(Q_,e.__scopeSelect),[s,o]=b.useState(!1),l=Ut(t,r.onScrollButtonChange);return xr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollTop>0;o(d)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?f.jsx(E5,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop-h.offsetHeight)}}):null});C5.displayName=Q_;var J_="SelectScrollDownButton",k5=b.forwardRef((e,t)=>{const n=la(J_,e.__scopeSelect),r=o0(J_,e.__scopeSelect),[s,o]=b.useState(!1),l=Ut(t,r.onScrollButtonChange);return xr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollHeight-h.clientHeight,g=Math.ceil(h.scrollTop)<d;o(g)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?f.jsx(E5,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop+h.offsetHeight)}}):null});k5.displayName=J_;var E5=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=la("SelectScrollButton",n),l=b.useRef(null),u=Op(n),h=b.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return b.useEffect(()=>()=>h(),[h]),xr(()=>{var g;const d=u().find(p=>p.ref.current===document.activeElement);(g=d==null?void 0:d.ref.current)==null||g.scrollIntoView({block:"nearest"})},[u]),f.jsx(Et.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Fe(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Fe(s.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Fe(s.onPointerLeave,()=>{h()})})}),tU="SelectSeparator",R5=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(Et.div,{"aria-hidden":!0,...r,ref:t})});R5.displayName=tU;var ey="SelectArrow",nU=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Lp(n),o=aa(ey,n),l=la(ey,n);return o.open&&l.position==="popper"?f.jsx(wp,{...s,...r,ref:t}):null});nU.displayName=ey;var rU="SelectBubbleInput",T5=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=b.useRef(null),o=Ut(r,s),l=BH(t);return b.useEffect(()=>{const u=s.current;if(!u)return;const h=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(h,"value").set;if(l!==t&&g){const p=new Event("change",{bubbles:!0});g.call(u,t),u.dispatchEvent(p)}},[l,t]),f.jsx(Et.select,{...n,style:{...iM,...n.style},ref:o,defaultValue:t})});T5.displayName=rU;function N5(e){return e===""||e===void 0}function M5(e){const t=Vi(e),n=b.useRef(""),r=b.useRef(0),s=b.useCallback(l=>{const u=n.current+l;t(u),function h(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>h(""),1e3))}(u)},[t]),o=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function A5(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=iU(e,Math.max(o,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function iU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sU=r5,D5=s5,oU=a5,aU=l5,lU=c5,j5=u5,cU=m5,uU=g5,O5=b5,a0=y5,L5=x5,z5=S5,P5=C5,B5=k5,I5=R5;const hr=sU,Ab=uU,vr=oU,Zn=b.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(D5,{ref:r,className:me("flex h-9 w-full items-center justify-between gap-2 rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none transition-colors","placeholder:text-muted-foreground","focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:line-clamp-1",e),...n,children:[t,f.jsx(aU,{asChild:!0,children:f.jsx(dp,{className:"h-4 w-4 shrink-0 opacity-50"})})]}));Zn.displayName=D5.displayName;const F5=b.forwardRef(({className:e,...t},n)=>f.jsx(P5,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(II,{className:"h-4 w-4"})}));F5.displayName=P5.displayName;const H5=b.forwardRef(({className:e,...t},n)=>f.jsx(B5,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(dp,{className:"h-4 w-4"})}));H5.displayName=B5.displayName;const Qn=b.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>f.jsx(lU,{children:f.jsxs(j5,{ref:s,className:me("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-background text-foreground shadow-md backdrop-blur-md","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-[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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[f.jsx(F5,{}),f.jsx(cU,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(H5,{})]})}));Qn.displayName=j5.displayName;const dU=b.forwardRef(({className:e,...t},n)=>f.jsx(O5,{ref:n,className:me("px-2 py-1.5 text-sm font-semibold",e),...t}));dU.displayName=O5.displayName;const _t=b.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(a0,{ref:r,className:me("relative flex w-full cursor-default select-none items-center rounded-md py-1.5 pl-2 pr-8 text-sm outline-none","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[f.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(z5,{children:f.jsx(qi,{className:"h-4 w-4"})})}),f.jsx(L5,{children:t})]}));_t.displayName=a0.displayName;const am=b.forwardRef(({className:e,children:t,thumbnail:n,thumbnailAlt:r="",...s},o)=>f.jsxs(a0,{ref:o,className:me("flex w-full cursor-default select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-2 text-sm outline-none","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[f.jsx("div",{className:"min-w-0 flex-1 truncate",children:f.jsx(L5,{children:t})}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n?f.jsx("img",{src:n,alt:r,className:"h-5 w-9 rounded object-cover opacity-90"}):null,f.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(z5,{children:f.jsx(qi,{className:"h-4 w-4"})})})]})]}));am.displayName="SelectItemWithThumbnail";const hU=b.forwardRef(({className:e,...t},n)=>f.jsx(I5,{ref:n,className:me("-mx-1 my-1 h-px bg-border",e),...t}));hU.displayName=I5.displayName;var Db="rovingFocusGroup.onEntryFocus",fU={bubbles:!1,cancelable:!0},Gd="RovingFocusGroup",[ty,U5,mU]=i0(Gd),[pU,$5]=io(Gd,[mU]),[gU,vU]=pU(Gd),W5=b.forwardRef((e,t)=>f.jsx(ty.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(ty.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(bU,{...e,ref:t})})}));W5.displayName=Gd;var bU=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:g=!1,...p}=e,v=b.useRef(null),y=Ut(t,v),w=s0(o),[S,C]=pc({prop:l,defaultProp:u??null,onChange:h,caller:Gd}),[k,R]=b.useState(!1),E=Vi(d),M=U5(n),L=b.useRef(!1),[j,D]=b.useState(0);return b.useEffect(()=>{const H=v.current;if(H)return H.addEventListener(Db,E),()=>H.removeEventListener(Db,E)},[E]),f.jsx(gU,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:S,onItemFocus:b.useCallback(H=>C(H),[C]),onItemShiftTab:b.useCallback(()=>R(!0),[]),onFocusableItemAdd:b.useCallback(()=>D(H=>H+1),[]),onFocusableItemRemove:b.useCallback(()=>D(H=>H-1),[]),children:f.jsx(Et.div,{tabIndex:k||j===0?-1:0,"data-orientation":r,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:Fe(e.onMouseDown,()=>{L.current=!0}),onFocus:Fe(e.onFocus,H=>{const G=!L.current;if(H.target===H.currentTarget&&G&&!k){const I=new CustomEvent(Db,fU);if(H.currentTarget.dispatchEvent(I),!I.defaultPrevented){const q=M().filter(O=>O.focusable),B=q.find(O=>O.active),W=q.find(O=>O.id===S),V=[B,W,...q].filter(Boolean).map(O=>O.ref.current);K5(V,g)}}L.current=!1}),onBlur:Fe(e.onBlur,()=>R(!1))})})}),V5="RovingFocusGroupItem",q5=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...u}=e,h=Zs(),d=o||h,g=vU(V5,n),p=g.currentTabStopId===d,v=U5(n),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:S}=g;return b.useEffect(()=>{if(r)return y(),()=>w()},[r,y,w]),f.jsx(ty.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:f.jsx(Et.span,{tabIndex:p?0:-1,"data-orientation":g.orientation,...u,ref:t,onMouseDown:Fe(e.onMouseDown,C=>{r?g.onItemFocus(d):C.preventDefault()}),onFocus:Fe(e.onFocus,()=>g.onItemFocus(d)),onKeyDown:Fe(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){g.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=xU(C,g.orientation,g.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let E=v().filter(M=>M.focusable).map(M=>M.ref.current);if(k==="last")E.reverse();else if(k==="prev"||k==="next"){k==="prev"&&E.reverse();const M=E.indexOf(C.currentTarget);E=g.loop?wU(E,M+1):E.slice(M+1)}setTimeout(()=>K5(E))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:S!=null}):l})})});q5.displayName=V5;var _U={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yU(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function xU(e,t,n){const r=yU(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _U[r]}function K5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function wU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var SU=W5,CU=q5,ny=["Enter"," "],kU=["ArrowDown","PageUp","Home"],G5=["ArrowUp","PageDown","End"],EU=[...kU,...G5],RU={ltr:[...ny,"ArrowRight"],rtl:[...ny,"ArrowLeft"]},TU={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Yd="Menu",[kd,NU,MU]=i0(Yd),[sl,Y5]=io(Yd,[MU,sa,$5]),zp=sa(),X5=$5(),[AU,ol]=sl(Yd),[DU,Xd]=sl(Yd),Z5=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:l=!0}=e,u=zp(t),[h,d]=b.useState(null),g=b.useRef(!1),p=Vi(o),v=s0(s);return b.useEffect(()=>{const y=()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>g.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),f.jsx(yp,{...u,children:f.jsx(AU,{scope:t,open:n,onOpenChange:p,content:h,onContentChange:d,children:f.jsx(DU,{scope:t,onClose:b.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:g,dir:v,modal:l,children:r})})})};Z5.displayName=Yd;var jU="MenuAnchor",l0=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=zp(n);return f.jsx(Ud,{...s,...r,ref:t})});l0.displayName=jU;var c0="MenuPortal",[OU,Q5]=sl(c0,{forceMount:void 0}),J5=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=ol(c0,t);return f.jsx(OU,{scope:t,forceMount:n,children:f.jsx(Li,{present:n||o.open,children:f.jsx(Rc,{asChild:!0,container:s,children:r})})})};J5.displayName=c0;var Mi="MenuContent",[LU,u0]=sl(Mi),eA=b.forwardRef((e,t)=>{const n=Q5(Mi,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ol(Mi,e.__scopeMenu),l=Xd(Mi,e.__scopeMenu);return f.jsx(kd.Provider,{scope:e.__scopeMenu,children:f.jsx(Li,{present:r||o.open,children:f.jsx(kd.Slot,{scope:e.__scopeMenu,children:l.modal?f.jsx(zU,{...s,ref:t}):f.jsx(PU,{...s,ref:t})})})})}),zU=b.forwardRef((e,t)=>{const n=ol(Mi,e.__scopeMenu),r=b.useRef(null),s=Ut(t,r);return b.useEffect(()=>{const o=r.current;if(o)return cp(o)},[]),f.jsx(d0,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Fe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),PU=b.forwardRef((e,t)=>{const n=ol(Mi,e.__scopeMenu);return f.jsx(d0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),BU=qa("MenuContent.ScrollLock"),d0=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:h,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:p,onInteractOutside:v,onDismiss:y,disableOutsideScroll:w,...S}=e,C=ol(Mi,n),k=Xd(Mi,n),R=zp(n),E=X5(n),M=NU(n),[L,j]=b.useState(null),D=b.useRef(null),H=Ut(t,D,C.onContentChange),G=b.useRef(0),I=b.useRef(""),q=b.useRef(0),B=b.useRef(null),W=b.useRef("right"),F=b.useRef(0),V=w?Pd:b.Fragment,O=w?{as:BU,allowPinchZoom:!0}:void 0,$=Y=>{var te,ue;const A=I.current+Y,P=M().filter(he=>!he.disabled),X=document.activeElement,N=(te=P.find(he=>he.ref.current===X))==null?void 0:te.textValue,ne=P.map(he=>he.textValue),oe=XU(ne,A,N),J=(ue=P.find(he=>he.textValue===oe))==null?void 0:ue.ref.current;(function he(ge){I.current=ge,window.clearTimeout(G.current),ge!==""&&(G.current=window.setTimeout(()=>he(""),1e3))})(A),J&&setTimeout(()=>J.focus())};b.useEffect(()=>()=>window.clearTimeout(G.current),[]),ap();const U=b.useCallback(Y=>{var P,X;return W.current===((P=B.current)==null?void 0:P.side)&&QU(Y,(X=B.current)==null?void 0:X.area)},[]);return f.jsx(LU,{scope:n,searchRef:I,onItemEnter:b.useCallback(Y=>{U(Y)&&Y.preventDefault()},[U]),onItemLeave:b.useCallback(Y=>{var A;U(Y)||((A=D.current)==null||A.focus(),j(null))},[U]),onTriggerLeave:b.useCallback(Y=>{U(Y)&&Y.preventDefault()},[U]),pointerGraceTimerRef:q,onPointerGraceIntentChange:b.useCallback(Y=>{B.current=Y},[]),children:f.jsx(V,{...O,children:f.jsx(zd,{asChild:!0,trapped:s,onMountAutoFocus:Fe(o,Y=>{var A;Y.preventDefault(),(A=D.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:f.jsx(Ec,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:p,onInteractOutside:v,onDismiss:y,children:f.jsx(SU,{asChild:!0,...E,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:L,onCurrentTabStopIdChange:j,onEntryFocus:Fe(h,Y=>{k.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(xp,{role:"menu","aria-orientation":"vertical","data-state":gA(C.open),"data-radix-menu-content":"",dir:k.dir,...R,...S,ref:H,style:{outline:"none",...S.style},onKeyDown:Fe(S.onKeyDown,Y=>{const P=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,X=Y.ctrlKey||Y.altKey||Y.metaKey,N=Y.key.length===1;P&&(Y.key==="Tab"&&Y.preventDefault(),!X&&N&&$(Y.key));const ne=D.current;if(Y.target!==ne||!EU.includes(Y.key))return;Y.preventDefault();const J=M().filter(te=>!te.disabled).map(te=>te.ref.current);G5.includes(Y.key)&&J.reverse(),GU(J)}),onBlur:Fe(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(G.current),I.current="")}),onPointerMove:Fe(e.onPointerMove,Ed(Y=>{const A=Y.target,P=F.current!==Y.clientX;if(Y.currentTarget.contains(A)&&P){const X=Y.clientX>F.current?"right":"left";W.current=X,F.current=Y.clientX}}))})})})})})})});eA.displayName=Mi;var IU="MenuGroup",h0=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Et.div,{role:"group",...r,ref:t})});h0.displayName=IU;var FU="MenuLabel",tA=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Et.div,{...r,ref:t})});tA.displayName=FU;var Bm="MenuItem",y2="menu.itemSelect",Pp=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=b.useRef(null),l=Xd(Bm,e.__scopeMenu),u=u0(Bm,e.__scopeMenu),h=Ut(t,o),d=b.useRef(!1),g=()=>{const p=o.current;if(!n&&p){const v=new CustomEvent(y2,{bubbles:!0,cancelable:!0});p.addEventListener(y2,y=>r==null?void 0:r(y),{once:!0}),GT(p,v),v.defaultPrevented?d.current=!1:l.onClose()}};return f.jsx(nA,{...s,ref:h,disabled:n,onClick:Fe(e.onClick,g),onPointerDown:p=>{var v;(v=e.onPointerDown)==null||v.call(e,p),d.current=!0},onPointerUp:Fe(e.onPointerUp,p=>{var v;d.current||(v=p.currentTarget)==null||v.click()}),onKeyDown:Fe(e.onKeyDown,p=>{const v=u.searchRef.current!=="";n||v&&p.key===" "||ny.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Pp.displayName=Bm;var nA=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,l=u0(Bm,n),u=X5(n),h=b.useRef(null),d=Ut(t,h),[g,p]=b.useState(!1),[v,y]=b.useState("");return b.useEffect(()=>{const w=h.current;w&&y((w.textContent??"").trim())},[o.children]),f.jsx(kd.ItemSlot,{scope:n,disabled:r,textValue:s??v,children:f.jsx(CU,{asChild:!0,...u,focusable:!r,children:f.jsx(Et.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Fe(e.onPointerMove,Ed(w=>{r?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Fe(e.onPointerLeave,Ed(w=>l.onItemLeave(w))),onFocus:Fe(e.onFocus,()=>p(!0)),onBlur:Fe(e.onBlur,()=>p(!1))})})})}),HU="MenuCheckboxItem",rA=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return f.jsx(lA,{scope:e.__scopeMenu,checked:n,children:f.jsx(Pp,{role:"menuitemcheckbox","aria-checked":Im(n)?"mixed":n,...s,ref:t,"data-state":m0(n),onSelect:Fe(s.onSelect,()=>r==null?void 0:r(Im(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rA.displayName=HU;var iA="MenuRadioGroup",[UU,$U]=sl(iA,{value:void 0,onValueChange:()=>{}}),sA=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=Vi(r);return f.jsx(UU,{scope:e.__scopeMenu,value:n,onValueChange:o,children:f.jsx(h0,{...s,ref:t})})});sA.displayName=iA;var oA="MenuRadioItem",aA=b.forwardRef((e,t)=>{const{value:n,...r}=e,s=$U(oA,e.__scopeMenu),o=n===s.value;return f.jsx(lA,{scope:e.__scopeMenu,checked:o,children:f.jsx(Pp,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":m0(o),onSelect:Fe(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});aA.displayName=oA;var f0="MenuItemIndicator",[lA,WU]=sl(f0,{checked:!1}),cA=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=WU(f0,n);return f.jsx(Li,{present:r||Im(o.checked)||o.checked===!0,children:f.jsx(Et.span,{...s,ref:t,"data-state":m0(o.checked)})})});cA.displayName=f0;var VU="MenuSeparator",uA=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});uA.displayName=VU;var qU="MenuArrow",dA=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=zp(n);return f.jsx(wp,{...s,...r,ref:t})});dA.displayName=qU;var KU="MenuSub",[Ore,hA]=sl(KU),Yu="MenuSubTrigger",fA=b.forwardRef((e,t)=>{const n=ol(Yu,e.__scopeMenu),r=Xd(Yu,e.__scopeMenu),s=hA(Yu,e.__scopeMenu),o=u0(Yu,e.__scopeMenu),l=b.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=o,d={__scopeMenu:e.__scopeMenu},g=b.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return b.useEffect(()=>g,[g]),b.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),h(null)}},[u,h]),f.jsx(l0,{asChild:!0,...d,children:f.jsx(nA,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":gA(n.open),...e,ref:xx(t,s.onTriggerChange),onClick:p=>{var v;(v=e.onClick)==null||v.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Fe(e.onPointerMove,Ed(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:Fe(e.onPointerLeave,Ed(p=>{var y,w;g();const v=(y=n.content)==null?void 0:y.getBoundingClientRect();if(v){const S=(w=n.content)==null?void 0:w.dataset.side,C=S==="right",k=C?-5:5,R=v[C?"left":"right"],E=v[C?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+k,y:p.clientY},{x:R,y:v.top},{x:E,y:v.top},{x:E,y:v.bottom},{x:R,y:v.bottom}],side:S}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Fe(e.onKeyDown,p=>{var y;const v=o.searchRef.current!=="";e.disabled||v&&p.key===" "||RU[r.dir].includes(p.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),p.preventDefault())})})})});fA.displayName=Yu;var mA="MenuSubContent",pA=b.forwardRef((e,t)=>{const n=Q5(Mi,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ol(Mi,e.__scopeMenu),l=Xd(Mi,e.__scopeMenu),u=hA(mA,e.__scopeMenu),h=b.useRef(null),d=Ut(t,h);return f.jsx(kd.Provider,{scope:e.__scopeMenu,children:f.jsx(Li,{present:r||o.open,children:f.jsx(kd.Slot,{scope:e.__scopeMenu,children:f.jsx(d0,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:d,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var p;l.isUsingKeyboardRef.current&&((p=h.current)==null||p.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Fe(e.onFocusOutside,g=>{g.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Fe(e.onEscapeKeyDown,g=>{l.onClose(),g.preventDefault()}),onKeyDown:Fe(e.onKeyDown,g=>{var y;const p=g.currentTarget.contains(g.target),v=TU[l.dir].includes(g.key);p&&v&&(o.onOpenChange(!1),(y=u.trigger)==null||y.focus(),g.preventDefault())})})})})})});pA.displayName=mA;function gA(e){return e?"open":"closed"}function Im(e){return e==="indeterminate"}function m0(e){return Im(e)?"indeterminate":e?"checked":"unchecked"}function GU(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function YU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function XU(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=YU(e,Math.max(o,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function ZU(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],h=t[l],d=u.x,g=u.y,p=h.x,v=h.y;g>r!=v>r&&n<(p-d)*(r-g)/(v-g)+d&&(s=!s)}return s}function QU(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ZU(n,t)}function Ed(e){return t=>t.pointerType==="mouse"?e(t):void 0}var JU=Z5,e$=l0,t$=J5,n$=eA,r$=h0,i$=tA,s$=Pp,o$=rA,a$=sA,l$=aA,c$=cA,u$=uA,d$=dA,h$=fA,f$=pA,p0="ContextMenu",[m$,Lre]=io(p0,[Y5]),Ar=Y5(),[p$,vA]=m$(p0),bA=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:o=!0}=e,[l,u]=b.useState(!1),h=Ar(t),d=Vi(r),g=b.useCallback(p=>{u(p),d(p)},[d]);return f.jsx(p$,{scope:t,open:l,onOpenChange:g,modal:o,children:f.jsx(JU,{...h,dir:s,open:l,onOpenChange:g,modal:o,children:n})})};bA.displayName=p0;var _A="ContextMenuTrigger",yA=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,o=vA(_A,n),l=Ar(n),u=b.useRef({x:0,y:0}),h=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),d=b.useRef(0),g=b.useCallback(()=>window.clearTimeout(d.current),[]),p=v=>{u.current={x:v.clientX,y:v.clientY},o.onOpenChange(!0)};return b.useEffect(()=>g,[g]),b.useEffect(()=>void(r&&g()),[r,g]),f.jsxs(f.Fragment,{children:[f.jsx(e$,{...l,virtualRef:h}),f.jsx(Et.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Fe(e.onContextMenu,v=>{g(),p(v),v.preventDefault()}),onPointerDown:r?e.onPointerDown:Fe(e.onPointerDown,Lf(v=>{g(),d.current=window.setTimeout(()=>p(v),700)})),onPointerMove:r?e.onPointerMove:Fe(e.onPointerMove,Lf(g)),onPointerCancel:r?e.onPointerCancel:Fe(e.onPointerCancel,Lf(g)),onPointerUp:r?e.onPointerUp:Fe(e.onPointerUp,Lf(g))})]})});yA.displayName=_A;var g$="ContextMenuPortal",xA=e=>{const{__scopeContextMenu:t,...n}=e,r=Ar(t);return f.jsx(t$,{...r,...n})};xA.displayName=g$;var wA="ContextMenuContent",SA=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=vA(wA,n),o=Ar(n),l=b.useRef(!1);return f.jsx(n$,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{var h;(h=e.onCloseAutoFocus)==null||h.call(e,u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{var h;(h=e.onInteractOutside)==null||h.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)"}})});SA.displayName=wA;var v$="ContextMenuGroup",b$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(r$,{...s,...r,ref:t})});b$.displayName=v$;var _$="ContextMenuLabel",y$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(i$,{...s,...r,ref:t})});y$.displayName=_$;var x$="ContextMenuItem",CA=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(s$,{...s,...r,ref:t})});CA.displayName=x$;var w$="ContextMenuCheckboxItem",S$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(o$,{...s,...r,ref:t})});S$.displayName=w$;var C$="ContextMenuRadioGroup",k$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(a$,{...s,...r,ref:t})});k$.displayName=C$;var E$="ContextMenuRadioItem",R$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(l$,{...s,...r,ref:t})});R$.displayName=E$;var T$="ContextMenuItemIndicator",N$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(c$,{...s,...r,ref:t})});N$.displayName=T$;var M$="ContextMenuSeparator",A$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(u$,{...s,...r,ref:t})});A$.displayName=M$;var D$="ContextMenuArrow",j$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(d$,{...s,...r,ref:t})});j$.displayName=D$;var O$="ContextMenuSubTrigger",L$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(h$,{...s,...r,ref:t})});L$.displayName=O$;var z$="ContextMenuSubContent",P$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ar(n);return f.jsx(f$,{...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)"}})});P$.displayName=z$;function Lf(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var B$=bA,I$=yA,F$=xA,kA=SA,EA=CA;const RA=B$,TA=I$,g0=b.forwardRef(({className:e,...t},n)=>f.jsx(F$,{children:f.jsx(kA,{ref:n,className:me("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg backdrop-blur-md 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})}));g0.displayName=kA.displayName;const Fm=b.forwardRef(({className:e,...t},n)=>f.jsx(EA,{ref:n,className:me("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}));Fm.displayName=EA.displayName;function NA({open:e,onOpenChange:t,position:n,children:r}){return f.jsxs(DM,{open:e,onOpenChange:t,children:[f.jsx(P7,{style:n?{position:"fixed",left:n.x,top:n.y,width:0,height:0}:void 0}),f.jsx(jM,{children:f.jsx(qx,{side:"bottom",align:"start",sideOffset:4,onOpenAutoFocus:s=>s.preventDefault(),className:me("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg backdrop-blur-md","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"),children:r})})]})}function ry({onSelect:e,className:t,children:n}){return f.jsx("button",{type:"button",className:me("relative flex w-full cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium outline-hidden transition-colors","hover:bg-accent focus:bg-accent",t),onPointerDown:r=>{r.preventDefault(),e()},children:n})}function H$({onRemove:e,children:t,mobileMenuPosition:n,onMobileMenuClose:r,skipContextMenu:s}){return f.jsxs(f.Fragment,{children:[s?t:f.jsxs(RA,{children:[f.jsx(TA,{asChild:!0,children:t}),f.jsx(g0,{children:f.jsxs(Fm,{onSelect:o=>{o.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:[f.jsx(bd,{className:"h-4 w-4"}),f.jsx("span",{className:"text-xs font-medium",children:"Hide"})]})})]}),f.jsx(NA,{open:!!n,onOpenChange:o=>{o||r==null||r()},position:n??null,children:f.jsxs(ry,{onSelect:()=>{r==null||r(),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:[f.jsx(bd,{className:"h-4 w-4"}),f.jsx("span",{children:"Hide"})]})})]})}function U$({onRename:e,onDelete:t,children:n,mobileMenuPosition:r,onMobileMenuClose:s,skipContextMenu:o}){return f.jsxs(f.Fragment,{children:[o?n:f.jsxs(RA,{children:[f.jsx(TA,{asChild:!0,children:n}),f.jsxs(g0,{children:[f.jsxs(Fm,{onSelect:l=>{l.stopPropagation(),e()},children:[f.jsx(gc,{className:"h-4 w-4"}),f.jsx("span",{className:"text-xs font-medium",children:"Rename Feature"})]}),f.jsxs(Fm,{onSelect:l=>{l.stopPropagation(),t()},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:[f.jsx(bd,{className:"h-4 w-4"}),f.jsx("span",{className:"text-xs font-medium",children:"Delete Feature"})]})]})]}),f.jsxs(NA,{open:!!r,onOpenChange:l=>{l||s==null||s()},position:r??null,children:[f.jsxs(ry,{onSelect:()=>{s==null||s(),e()},children:[f.jsx(gc,{className:"h-4 w-4"}),f.jsx("span",{children:"Rename Feature"})]}),f.jsxs(ry,{onSelect:()=>{s==null||s(),t()},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:[f.jsx(bd,{className:"h-4 w-4"}),f.jsx("span",{children:"Delete Feature"})]})]})]})}function Zd(e){const[t,n]=b.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return b.useEffect(()=>{const r=window.matchMedia(e),s=()=>n(r.matches);return s(),r.addEventListener?(r.addEventListener("change",s),()=>r.removeEventListener("change",s)):(r.addListener(s),()=>r.removeListener(s))},[e]),t}function MA({iconDataUrl:e,alt:t,className:n,fallback:r=null}){return e?f.jsx("img",{src:e,alt:t,className:me("shrink-0 object-contain",n)}):f.jsx(f.Fragment,{children:r})}const x2=e=>{let t;const n=new Set,r=(d,g)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const v=t;t=g??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,v))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>h,subscribe:d=>(n.add(d),()=>n.delete(d))},h=t=e(r,s,u);return u},$$=e=>e?x2(e):x2,W$=e=>e;function V$(e,t=W$){const n=xe.useSyncExternalStore(e.subscribe,xe.useCallback(()=>t(e.getState()),[e,t]),xe.useCallback(()=>t(e.getInitialState()),[e,t]));return xe.useDebugValue(n),n}const q$=e=>{const t=$$(e),n=r=>V$(t,r);return Object.assign(n,t),n},oo=e=>q$;function K$(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const l=h=>h===null?null:JSON.parse(h,void 0),u=(o=n.getItem(s))!=null?o:null;return u instanceof Promise?u.then(l):l(u)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const iy=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return iy(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return iy(r)(n)}}}},G$=(e,t)=>(n,r,s)=>{let o={storage:K$(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},l=!1,u=0;const h=new Set,d=new Set;let g=o.storage;if(!g)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...C)},r,s);const p=()=>{const C=o.partialize({...r()});return g.setItem(o.name,{state:C,version:o.version})},v=s.setState;s.setState=(C,k)=>(v(C,k),p());const y=e((...C)=>(n(...C),p()),r,s);s.getInitialState=()=>y;let w;const S=()=>{var C,k;if(!g)return;const R=++u;l=!1,h.forEach(M=>{var L;return M((L=r())!=null?L:y)});const E=((k=o.onRehydrateStorage)==null?void 0:k.call(o,(C=r())!=null?C:y))||void 0;return iy(g.getItem.bind(g))(o.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==o.version){if(o.migrate){const L=o.migrate(M.state,M.version);return L instanceof Promise?L.then(j=>[!0,j]):[!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(R!==u)return;const[j,D]=M;if(w=o.merge(D,(L=r())!=null?L:y),n(w,!0),j)return p()}).then(()=>{R===u&&(E==null||E(r(),void 0),w=r(),l=!0,d.forEach(M=>M(w)))}).catch(M=>{R===u&&(E==null||E(void 0,M))})};return s.persist={setOptions:C=>{o={...o,...C},C.storage&&(g=C.storage)},clearStorage:()=>{g==null||g.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},o.skipHydration||S(),w||y},ao=G$,bn=oo()(ao(e=>({themePreference:"system",colorTheme:"default",customAppearance:"system",backgroundImage:null,backgroundOpacity:1,backgroundBlur:0,showProjectIconsInSidebar:!0,setThemePreference:t=>e({themePreference:t}),setColorTheme:t=>e({colorTheme:t}),setCustomAppearance:t=>e({customAppearance:t}),setBackgroundImage:t=>e({backgroundImage:t}),setBackgroundOpacity:t=>e({backgroundOpacity:t}),setBackgroundBlur:t=>e({backgroundBlur:t}),setShowProjectIconsInSidebar:t=>e({showProjectIconsInSidebar:t})}),{name:"theme-settings"})),AA=8;function sy(e,t){return!e.has(t)}function jb(e,t,n){const r=e.map(l=>l.featureId),s=r.indexOf(t),o=r.indexOf(n);return s===-1||o===-1||s===o?null:Dp(r,s,o)}function Y$(e){return{activeFeatures:e.filter(t=>t.stage!=="done"),completedFeatures:e.filter(t=>t.stage==="done")}}function X$(e,t){return t?e:e.slice(0,AA)}function Z$(e,t){return e.map(n=>`feature:${n.featureId}`).filter(n=>!t.has(n))}function w2({feature:e,groupKey:t,collapsedSections:n,onToggleSection:r,renderChatRow:s,onNewLocalChat:o,onRenameFeature:l,onDeleteFeature:u,onSetFeatureBrowserState:h,onSetFeatureStage:d,kanbanStatusesEnabled:g=!0,showFeatureOverviewInSidebar:p=!1,activeOverviewFeatureId:v=null,onOpenFeatureOverview:y,showAllChats:w,onToggleShowAllChats:S,draggedFeatureId:C,draggedChatId:k,hoveredDropTarget:R,isTouchDevice:E,onFeatureDragStart:M,onFeatureDragEnd:L,onFeatureDrop:j,onChatDrop:D,onTouchDragMove:H,onTouchDragEnd:G,onChatDragStart:I,onChatDragEnd:q}){const B=`feature:${e.featureId}`,W=sy(n,B),F=k!==null,V=X$(e.chats,w),O=Math.max(0,e.chats.length-AA),$=O>0,U=v===e.featureId,[Y,A]=b.useState(null);function P(){r(B),h==null||h(e.featureId,W?"CLOSED":"OPEN")}const X=b.useRef(null),{touchRef:N,isDragging:ne,isArmed:oe,dragPosition:J}=Gx({enabled:E,visualElementRef:X,onTap:P,onContextMenu:ge=>A(ge),onDragStart:()=>M(e.featureId),onDragMove:({x:ge,y:ke,elementBelow:Ee})=>H(ge,ke,Ee),onDragEnd:({x:ge,y:ke,elementBelow:Ee})=>G(ge,ke,Ee)}),te=C===e.featureId||ne,ue=f.jsxs("div",{ref:X,"data-feature-drop-target":e.featureId,onDragOver:E?void 0:ge=>{if(C&&C!==e.featureId){ge.preventDefault();return}F&&ge.preventDefault()},onDrop:E?void 0:ge=>{if(ge.preventDefault(),C&&C!==e.featureId){j(C,e.featureId);return}k&&D(k,e.featureId)},className:me("rounded-lg border border-border/60 bg-muted/10 transition-all duration-150 select-none",F&&!E&&"border-dashed hover:border-primary/60 hover:bg-primary/5",R===e.featureId&&"border-primary/60 bg-primary/5",oe&&"scale-[1.03] shadow-md ring-2 ring-primary/50 bg-card",te&&!oe&&"opacity-20 scale-[0.98]"),children:[f.jsxs("div",{ref:E?N:void 0,className:"flex items-center gap-2 px-2 py-1.5",children:[E?f.jsxs(f.Fragment,{children:[f.jsx("button",{type:"button","data-no-touch-drag":!0,onClick:P,className:"flex shrink-0 items-center",children:f.jsx(Mr,{className:me("size-3 transition-transform",W&&"rotate-90")})}),f.jsx(_b,{className:"size-3.5 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.title})]}):f.jsxs("button",{type:"button",onClick:P,draggable:!0,"data-feature-drag-handle":e.featureId,onDragStart:()=>M(e.featureId),onDragEnd:L,className:"flex min-w-0 flex-1 basis-0 items-center gap-2 text-left",children:[f.jsx(Mr,{className:me("size-3 transition-transform",W&&"rotate-90")}),f.jsx(_b,{className:"size-3.5 text-muted-foreground"}),f.jsxs(hs,{children:[f.jsx(fs,{asChild:!0,children:f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.title})}),f.jsx($i,{side:"right",sideOffset:4,children:e.title})]})]}),g?f.jsxs(hr,{value:e.stage,onValueChange:ge=>d==null?void 0:d(e.featureId,ge),children:[f.jsx(Zn,{"data-no-touch-drag":!0,className:me("h-7 w-auto min-w-[70px] shrink-0 items-center gap-1 rounded-full px-2 pr-1.5 text-[10px] font-semibold leading-none tracking-[0.04em] shadow-none focus:ring-0 focus:ring-offset-0 [&>span]:flex [&>span]:items-center [&>span]:leading-none [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:translate-y-0 [&>svg]:opacity-60",b2[e.stage]),children:f.jsx(vr,{children:i2[e.stage]})}),f.jsx(Qn,{children:E7.map(ge=>f.jsx(_t,{value:ge,className:me("text-[11px] font-medium",ge===e.stage&&b2[ge]),children:i2[ge]},ge))})]}):null,o?f.jsx(Ze,{variant:"ghost",size:"icon",className:"h-6 w-6","data-no-touch-drag":!0,onClick:()=>o(t,e.featureId),title:"New chat in feature",children:f.jsx(jN,{className:"size-3.5"})}):null]}),W?f.jsxs("div",{className:"space-y-[2px] border-t border-border/50 p-1 pl-3",children:[p&&e.overviewRelativePath?f.jsxs("button",{type:"button",onClick:()=>y==null?void 0:y(e.featureId),className:me("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors",U?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"),children:[f.jsx(d6,{className:"size-3.5 shrink-0"}),f.jsx("span",{className:"truncate",children:"overview.md"})]}):null,V.map(ge=>s(ge,{draggable:!0,onDragStart:ke=>I(ke.chatId),onDragEnd:q,isTouchDevice:E,onTouchDragMove:H,onTouchDragEnd:G})),$?f.jsx("div",{className:"pt-1",children:f.jsx(Ze,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:S,children:w?"Show less":`Show ${O} more`})}):null]}):null]}),he=f.jsxs(zM,{position:J,children:[f.jsx(_b,{className:"size-3.5 shrink-0 text-primary"}),f.jsx("span",{className:"text-sm font-medium truncate",children:e.title})]});return u?f.jsxs(f.Fragment,{children:[f.jsx(U$,{onRename:()=>l==null?void 0:l(e.featureId),onDelete:()=>u(e.featureId),mobileMenuPosition:Y,onMobileMenuClose:()=>A(null),skipContextMenu:E,children:ue}),he]}):f.jsxs(f.Fragment,{children:[ue,he]})}function Q$({group:e,collapsedSections:t,onToggleSection:n,renderChatRow:r,onNewLocalChat:s,onCreateFeature:o,onRenameFeature:l,onDeleteFeature:u,onSetProjectBrowserState:h,onSetProjectGeneralChatsBrowserState:d,onSetFeatureBrowserState:g,onSetFeatureStage:p,onSetChatFeature:v,onReorderFeatures:y,onRemoveProject:w,isConnected:S,startingLocalPath:C,folderGroupsEnabled:k=!0,showFeatureOverviewInSidebar:R=!1,kanbanStatusesEnabled:E=!0,activeOverviewFeatureId:M=null,onOpenFeatureOverview:L}){const j=bn(Le=>Le.showProjectIconsInSidebar),{groupKey:D,localPath:H,features:G,generalChats:I}=e,{activeFeatures:q,completedFeatures:B}=b.useMemo(()=>Y$(G),[G]),W=`project:${D}`,F=`general:${D}`,V=sy(t,W),O=G.length===0||sy(t,F),[$,U]=b.useState(null),[Y,A]=b.useState(null),[P,X]=b.useState(null),[N,ne]=b.useState(!1),[oe,J]=b.useState(!1),[te,ue]=b.useState({}),[he,ge]=b.useState(null),ke=Zd("(pointer: coarse)"),Ee=k&&!N?I.slice(0,10):I,De=k&&I.length>10,{attributes:Xe,listeners:pt,setNodeRef:at,setActivatorNodeRef:fe,transform:Ve,transition:Ae,isDragging:et}=LH({id:D}),lt=b.useRef(null),nt={transform:Sd.Translate.toString(Ve),transition:Ae};function Kt(){n(W),h==null||h(D,V?"CLOSED":"OPEN")}function Se(){n(F),d==null||d(D,O?"CLOSED":"OPEN")}function qe(Le){ue(Ke=>({...Ke,[Le]:!Ke[Le]}))}function se(Le){Le.stopPropagation();for(const Ke of Z$(G,t))n(Ke);for(const Ke of G)g==null||g(Ke.featureId,"CLOSED")}function pe(Le){if(!Le)return null;const Ke=Le.closest("[data-feature-drop-target]");return Ke?{type:"feature",featureId:Ke.getAttribute("data-feature-drop-target")}:Le.closest(`[data-general-chats-drop-target="${D}"]`)?{type:"general"}:null}function Ne(Le,Ke,ft){const we=lt.current;if(we){const Gt=we.getBoundingClientRect(),_n=60;Ke<Gt.top+_n?we.scrollBy(0,-6):Ke>Gt.bottom-_n&&we.scrollBy(0,6)}const Rt=pe(ft);X((Rt==null?void 0:Rt.type)==="feature"?Rt.featureId:null)}function He(Le,Ke,ft){const we=pe(ft);if(Y){if((we==null?void 0:we.type)==="feature"&&we.featureId!==Y&&y){const Rt=jb(G,Y,we.featureId);Rt&&y(D,Rt)}A(null)}else $&&v&&((we==null?void 0:we.type)==="feature"?v($,we.featureId):(we==null?void 0:we.type)==="general"&&v($,null),U(null));X(null)}const Oe=b.useRef(null),{touchRef:xt}=Gx({enabled:ke&&!!w,onTap:Kt,onContextMenu:Le=>ge(Le)}),Bt=f.jsxs("div",{ref:Le=>{fe(Le),Oe.current=Le,ke&&w&&xt(Le)},className:me("sticky top-0 bg-background dark:bg-card z-10 relative p-[10px] flex items-center justify-between cursor-grab active:cursor-grabbing select-none",et&&"cursor-grabbing"),onClick:ke?void 0:Kt,...pt,children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx("span",{className:"relative size-3.5 shrink-0 cursor-pointer",children:f.jsx(Mr,{className:me("translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-transform duration-200",V&&"rotate-90")})}),j?f.jsx(MA,{iconDataUrl:e.iconDataUrl,alt:`${e.title||Dm(H)} icon`,className:"size-5",fallback:f.jsx("span",{className:"size-5 shrink-0","aria-hidden":"true"})}):null,f.jsxs(hs,{children:[f.jsx(fs,{asChild:!0,children:f.jsx("span",{className:"truncate max-w-[180px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:e.title||Dm(H)})}),f.jsx($i,{side:"right",sideOffset:4,children:H})]})]}),f.jsxs("div",{className:"absolute right-2 flex items-center gap-1",children:[o?f.jsxs(hs,{children:[f.jsx(fs,{asChild:!0,children:f.jsx(Ze,{variant:"ghost",size:"icon",className:"h-5.5 w-5.5 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100","data-no-touch-drag":!0,onClick:Le=>{Le.stopPropagation(),o(D)},children:f.jsx(RN,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),f.jsx($i,{side:"right",sideOffset:4,children:"New feature"})]}):null,G.length>0?f.jsxs(hs,{children:[f.jsx(fs,{asChild:!0,children:f.jsx(Ze,{variant:"ghost",size:"icon",className:"h-5.5 w-5.5 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100","data-no-touch-drag":!0,onClick:se,children:f.jsx(HI,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),f.jsx($i,{side:"right",sideOffset:4,children:"Close all feature folders"})]}):null,s?f.jsxs(hs,{children:[f.jsx(fs,{asChild:!0,children:f.jsx(Ze,{variant:"ghost",size:"icon",className:me("h-5.5 w-5.5 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100",(!S||C===H)&&"opacity-50 cursor-not-allowed"),disabled:!S||C===H,"data-no-touch-drag":!0,onClick:Le=>{Le.stopPropagation(),s(D)},children:C===H?f.jsx(li,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):f.jsx(jN,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),f.jsx($i,{side:"right",sideOffset:4,children:S?"New general chat":`Start ${Pn} to connect`})]}):null]})]});return f.jsxs("div",{ref:Le=>{at(Le),lt.current=(Le==null?void 0:Le.closest("[data-sidebar-scroll]"))??null},style:nt,className:me("group/section",et&&"opacity-50 shadow-lg z-50 relative"),...Xe,children:[w?f.jsx(H$,{onRemove:()=>w(D),mobileMenuPosition:he,onMobileMenuClose:()=>ge(null),skipContextMenu:ke,children:Bt}):Bt,V?f.jsxs("div",{className:"mb-2 space-y-2",children:[k&&q.length>0?f.jsx("section",{className:"space-y-2 pl-6",children:q.map(Le=>f.jsx(w2,{feature:Le,groupKey:D,collapsedSections:t,onToggleSection:n,renderChatRow:r,onNewLocalChat:s,onRenameFeature:l,onDeleteFeature:u,onSetFeatureBrowserState:g,onSetFeatureStage:p,kanbanStatusesEnabled:E,showFeatureOverviewInSidebar:R,activeOverviewFeatureId:M,onOpenFeatureOverview:L,showAllChats:!!te[Le.featureId],onToggleShowAllChats:()=>qe(Le.featureId),draggedFeatureId:Y,draggedChatId:$,hoveredDropTarget:P,isTouchDevice:ke,onFeatureDragStart:Ke=>A(Ke),onFeatureDragEnd:()=>A(null),onFeatureDrop:(Ke,ft)=>{const we=jb(G,Ke,ft);A(null),we&&(y==null||y(D,we))},onChatDrop:(Ke,ft)=>{v==null||v(Ke,ft),U(null)},onTouchDragMove:Ne,onTouchDragEnd:He,onChatDragStart:Ke=>U(Ke),onChatDragEnd:()=>U(null)},Le.featureId))}):null,k&&B.length>0?f.jsxs("section",{className:"pl-6",children:[f.jsxs("button",{type:"button",onClick:()=>J(Le=>!Le),className:"flex w-full items-center gap-2 px-2 py-1 text-left text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:[f.jsx(Mr,{className:me("size-3 transition-transform",oe&&"rotate-90")}),f.jsx("span",{children:oe?"Hide completed":"Show completed"}),f.jsx("span",{className:"ml-auto",children:B.length})]}),oe?f.jsx("div",{className:"space-y-2 pt-1",children:B.map(Le=>f.jsx(w2,{feature:Le,groupKey:D,collapsedSections:t,onToggleSection:n,renderChatRow:r,onNewLocalChat:s,onRenameFeature:l,onDeleteFeature:u,onSetFeatureBrowserState:g,onSetFeatureStage:p,kanbanStatusesEnabled:E,showFeatureOverviewInSidebar:R,activeOverviewFeatureId:M,onOpenFeatureOverview:L,showAllChats:!!te[Le.featureId],onToggleShowAllChats:()=>qe(Le.featureId),draggedFeatureId:Y,draggedChatId:$,hoveredDropTarget:P,isTouchDevice:ke,onFeatureDragStart:Ke=>A(Ke),onFeatureDragEnd:()=>A(null),onFeatureDrop:(Ke,ft)=>{const we=jb(G,Ke,ft);A(null),we&&(y==null||y(D,we))},onChatDrop:(Ke,ft)=>{v==null||v(Ke,ft),U(null)},onTouchDragMove:Ne,onTouchDragEnd:He,onChatDragStart:Ke=>U(Ke),onChatDragEnd:()=>U(null)},Le.featureId))}):null]}):null,I.length>0?f.jsxs("section",{"data-general-chats-drop-target":D,onDragOver:$&&!ke?Le=>Le.preventDefault():void 0,onDrop:$&&!ke&&v?Le=>{Le.preventDefault(),v($,null),U(null)}:void 0,children:[k?f.jsxs("button",{type:"button",onClick:Se,className:"flex w-full items-center gap-2 px-4 py-1 text-left text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:[f.jsx(Mr,{className:me("size-3 transition-transform",O&&"rotate-90")}),f.jsx("span",{children:"General Chats"}),f.jsx("span",{className:"ml-auto",children:I.length})]}):null,!k||O?f.jsxs("div",{className:me("space-y-[2px]",k?"pl-7":"pl-4"),children:[Ee.map(Le=>r(Le,{draggable:!0,onDragStart:Ke=>U(Ke.chatId),onDragEnd:()=>U(null),isTouchDevice:ke,onTouchDragMove:Ne,onTouchDragEnd:He})),De?f.jsx("div",{className:"pt-1",children:f.jsx(Ze,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:()=>ne(Le=>!Le),children:N?"Show less":`Show ${I.length-10} more`})}):null]}):null]}):null]}):null]})}function J$({projectGroups:e,collapsedSections:t,onToggleSection:n,onSetProjectBrowserState:r,onSetProjectGeneralChatsBrowserState:s,renderChatRow:o,onNewLocalChat:l,onCreateFeature:u,onRenameFeature:h,onDeleteFeature:d,onSetFeatureBrowserState:g,onSetFeatureStage:p,onSetChatFeature:v,onReorderFeatures:y,onRemoveProject:w,onReorderGroups:S,isConnected:C,startingLocalPath:k,folderGroupsEnabled:R=!0,showFeatureOverviewInSidebar:E=!1,kanbanStatusesEnabled:M=!0,activeOverviewFeatureId:L=null,onOpenFeatureOverview:j}){const D=hF(Rb(r0,{activationConstraint:{distance:8}}),Rb(GM,{activationConstraint:{delay:250,tolerance:5}}),Rb(t0)),H=b.useMemo(()=>e.map(B=>B.groupKey),[e]),G=b.useRef(null);function I(B){const W=B.active.id;t.has(W)?G.current=null:(G.current=W,n(W))}function q(B){const{active:W,over:F}=B;if(F&&W.id!==F.id&&S){const V=H.indexOf(W.id),O=H.indexOf(F.id);V!==-1&&O!==-1&&S(Dp(H,V,O))}if(G.current){const V=G.current;G.current=null,requestAnimationFrame(()=>n(V))}}return f.jsx(pH,{sensors:D,collisionDetection:vF,onDragStart:I,onDragEnd:q,children:f.jsx(TH,{items:H,strategy:EH,children:e.map(B=>f.jsx(Q$,{group:B,collapsedSections:t,onToggleSection:n,onSetProjectBrowserState:r,onSetProjectGeneralChatsBrowserState:s,renderChatRow:o,onNewLocalChat:l,onCreateFeature:u,onRenameFeature:h,onDeleteFeature:d,onSetFeatureBrowserState:g,onSetFeatureStage:p,onSetChatFeature:v,onReorderFeatures:y,onRemoveProject:w,onReorderGroups:S,isConnected:C,startingLocalPath:k,folderGroupsEnabled:R,showFeatureOverviewInSidebar:E,kanbanStatusesEnabled:M,activeOverviewFeatureId:L,onOpenFeatureOverview:j},B.groupKey))})})}const DA=`${kp}provider-usage-collapsed`,jA=`${kp}provider-usage-mode`,eW=Qo.map(e=>e.id),tW=["claude","codex"],oy=Object.fromEntries(Qo.map(e=>[e.id,e.label]));function S2(e){return e===null?"bg-muted":e>=90?"bg-red-500":e>=75?"bg-amber-500":"bg-emerald-500"}function Ob(e){return e===null?"N/A":`${e.toFixed(1)}%`}function C2(e,t){if(t!=null&&t.trim())return`Resets ${t.trim()}`;if(e===null)return null;const n=Date.now();if(e<=n)return"Limit may have reset";const r=e-n,s=Math.ceil(r/6e4);return s<60?`Resets in ${s} min`:`Resets at ${new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`}function nW(){try{return localStorage.getItem(DA)==="true"}catch{return!1}}function rW(){try{return localStorage.getItem(jA)==="weekly"?"weekly":"session"}catch{return"session"}}function iW(e){try{localStorage.setItem(DA,String(e))}catch{}}function sW(e){try{localStorage.setItem(jA,e)}catch{}}function k2(e){const{entry:t,mode:n,isPending:r,onRefreshProviderUsage:s,onOpenProviderLogin:o}=e,l=Am[t.provider],u=e.labelOverride??oy[t.provider],h=t.availability==="unavailable",d=t.availability==="login_required",g=t.availability==="stale",p=t.provider==="cursor",v=e.percentOverride!==void 0?e.percentOverride:n==="weekly"?t.weeklyLimitUsedPercent??null:t.sessionLimitUsedPercent,y=v,w=p?null:n==="weekly"?C2(t.weeklyRateLimitResetAt??null,t.weeklyRateLimitResetLabel??null):C2(t.rateLimitResetAt,t.rateLimitResetLabel),S=[];d?S.push("Login required to fetch Cursor usage"):h?S.push("Usage data unavailable"):(e.bars?S.push("Cursor limit usage"):v!==null&&S.push(`${Ob(v)} of ${n} limit used`),w&&S.push(w),g&&S.push("Data may be outdated"),S.length===0&&S.push("No usage data yet")),t.statusDetail&&S.push(t.statusDetail.replaceAll("_"," "));const C=!e.hideActions&&p&&d,k=p&&!e.hideActions&&h&&!d&&t.statusDetail!=="unsupported_platform";return f.jsxs(hs,{children:[f.jsx(fs,{asChild:!0,children:f.jsxs("div",{className:me("flex flex-col",g&&"opacity-50"),children:[f.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 rounded-md",children:[f.jsx(l,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"text-[11px] text-muted-foreground w-11 shrink-0",children:u}),h&&!e.bars?f.jsx("span",{className:"text-[10px] text-muted-foreground/60 ml-auto",children:"N/A"}):e.bars?f.jsx("div",{className:"flex-1"}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden min-w-0",children:y!==null?f.jsx("div",{className:me("h-full rounded-full transition-all",S2(y)),style:{width:`${Math.min(100,Math.max(0,y))}%`}}):null}),f.jsx("span",{className:"text-[10px] tabular-nums text-muted-foreground w-7 text-right shrink-0",children:Ob(y)})]}),C?f.jsx("button",{type:"button",disabled:r,onClick:R=>{R.stopPropagation(),o==null||o("cursor")},className:"ml-auto rounded border border-border/70 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50",children:"Sign In"}):null,k?f.jsxs("button",{type:"button",disabled:r,onClick:R=>{R.stopPropagation(),s==null||s("cursor")},className:"flex items-center gap-1 rounded border border-border/70 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50",children:[r&&f.jsx(Ex,{className:"h-2 w-2 animate-spin"}),r?"Checking":"Refresh"]}):null]}),e.bars&&f.jsx("div",{className:"flex flex-col gap-1 pb-1",children:e.bars.map((R,E)=>f.jsxs("div",{className:"flex items-center gap-2 pl-7 pr-2",children:[f.jsx("span",{className:"text-[10px] text-muted-foreground w-12 shrink-0",children:R.label}),h?f.jsx("span",{className:"text-[10px] text-muted-foreground/60 ml-auto",children:"N/A"}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden min-w-0",children:R.percent!==null?f.jsx("div",{className:me("h-full rounded-full transition-all",S2(R.percent)),style:{width:`${Math.min(100,Math.max(0,R.percent))}%`}}):null}),f.jsx("span",{className:"text-[10px] tabular-nums text-muted-foreground w-7 text-right shrink-0",children:Ob(R.percent)})]})]},E))})]})}),f.jsx($i,{side:"right",className:"max-w-48",children:S.map((R,E)=>f.jsx("div",{className:"text-xs",children:R},E))})]})}function oW({providerUsage:e,visibleProviders:t=eW,onRefreshProviderUsage:n,onOpenProviderLogin:r}){const[s,o]=b.useState(nW),[l,u]=b.useState(rW),[h,d]=b.useState(null),g=()=>{o(v=>{const y=!v;return iW(y),y})},p=async()=>{d("all");try{await(n==null?void 0:n()),xf("Usage checked successfully.")}catch{xf("Failed to check usage.")}finally{d(v=>v==="all"?null:v)}};return f.jsxs("div",{className:"px-1 pb-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2 px-2 pb-0.5",children:[f.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-1 text-left group",children:[s?f.jsx(Mr,{className:"h-3 w-3 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors"}):f.jsx(dp,{className:"h-3 w-3 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors"}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 font-medium group-hover:text-muted-foreground transition-colors",children:"Provider Usage"})]}),!s&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{type:"button",onClick:p,disabled:h==="all",className:"shrink-0 rounded-md border border-border/70 bg-muted/40 p-1 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors disabled:opacity-50",title:"Refresh usages",children:f.jsx(Ex,{className:me("h-3 w-3",h==="all"&&"animate-spin")})}),f.jsx("button",{type:"button",onClick:()=>{u(v=>{const y=v==="session"?"weekly":"session";return sW(y),y})},className:"shrink-0 rounded-md border border-border/70 bg-muted/40 px-2 py-0.5 text-[10px] uppercase tracking-wider text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:l==="session"?"Session":"Weekly"})]})]}),!s&&(l==="weekly"?tW:t).flatMap(v=>{const y=(e==null?void 0:e[v])??{provider:v,sessionLimitUsedPercent:null,apiLimitUsedPercent:null,rateLimitResetAt:null,rateLimitResetLabel:null,weeklyLimitUsedPercent:null,weeklyRateLimitResetAt:null,weeklyRateLimitResetLabel:null,statusDetail:null,availability:"unavailable",lastRequestedAt:null,updatedAt:null,warnings:[]},w=async C=>{d(C);try{await(n==null?void 0:n(C)),xf(`${oy[C]??"Provider"} usage checked successfully.`)}catch{xf(`Failed to check ${oy[C]??"provider"} usage.`)}finally{d(k=>k===C?null:k)}},S=C=>{d(C),Promise.resolve(r==null?void 0:r(C)).finally(()=>{d(k=>k===C?null:k)})};return v==="cursor"&&l==="session"?[f.jsx(k2,{entry:y,mode:l,isPending:h==="cursor",bars:[{label:"API",percent:y.apiLimitUsedPercent??null},{label:"Composer",percent:y.sessionLimitUsedPercent}],onRefreshProviderUsage:w,onOpenProviderLogin:S},"cursor")]:[f.jsx(k2,{entry:y,mode:l,isPending:h===v||h==="all",onRefreshProviderUsage:w,onOpenProviderLogin:S},v)]})]})}function aW(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function lW(e){return e==="claude"||e==="codex"||e==="gemini"||e==="cursor"?e:"last_used"}function Ha(e){var o,l;const t=(o=e==null?void 0:e.modelOptions)==null?void 0:o.reasoningEffort,n=t2(t)?t:t2(e==null?void 0:e.effort)?e.effort:_M.reasoningEffort,r=(e==null?void 0:e.model)??tn("claude").defaultModel,s=k7(r,(l=e==null?void 0:e.modelOptions)==null?void 0:l.contextWindow);return{model:r,modelOptions:{reasoningEffort:r!=="opus"&&n==="max"?"high":n,...s?{contextWindow:s}:{}},planMode:!!(e!=null&&e.planMode)}}function Ua(e){var r,s;const t=Ni("codex"),n=(r=e==null?void 0:e.modelOptions)==null?void 0:r.reasoningEffort;return{model:aW((e==null?void 0:e.model)??tn("codex").defaultModel),modelOptions:{reasoningEffort:n2(n)?n:n2(e==null?void 0:e.effort)?e.effort:t.reasoningEffort,fastMode:typeof((s=e==null?void 0:e.modelOptions)==null?void 0:s.fastMode)=="boolean"?e.modelOptions.fastMode:t.fastMode},planMode:!!(e!=null&&e.planMode)}}function sc(e){var n;const t=Ni("gemini");return{model:(e==null?void 0:e.model)??tn("gemini").defaultModel,modelOptions:{thinkingMode:y7((n=e==null?void 0:e.modelOptions)==null?void 0:n.thinkingMode)?e.modelOptions.thinkingMode:t.thinkingMode},planMode:!!(e!=null&&e.planMode)}}function $a(e){return e==null||e.modelOptions,{model:_7((e==null?void 0:e.model)??tn("cursor").defaultModel),modelOptions:{...Ni("cursor")},planMode:!!(e!=null&&e.planMode)}}function cW(){return{claude:{model:tn("claude").defaultModel,modelOptions:{...Ni("claude")},planMode:!1},codex:{model:tn("codex").defaultModel,modelOptions:{...Ni("codex")},planMode:!1},gemini:{model:tn("gemini").defaultModel,modelOptions:{...Ni("gemini")},planMode:!1},cursor:{model:tn("cursor").defaultModel,modelOptions:{...Ni("cursor")},planMode:!1}}}function uW(e){return{claude:Ha(e==null?void 0:e.claude),codex:Ua(e==null?void 0:e.codex),gemini:sc(e==null?void 0:e.gemini),cursor:$a(e==null?void 0:e.cursor)}}function E2(e,t){if(t===void 0){console.info(`[chat-preferences] ${e}`);return}console.info(`[chat-preferences] ${e}`,t)}function ay(e,t){if(e==="claude"){const r=t.claude;return{provider:"claude",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}if(e==="gemini"){const r=t.gemini;return{provider:"gemini",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}if(e==="cursor"){const r=t.cursor;return{provider:"cursor",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}const n=t.codex;return{provider:"codex",model:n.model,modelOptions:{...n.modelOptions},planMode:n.planMode}}function dW(e,t,n,r){if((e==null?void 0:e.provider)==="claude"){const s=Ha(e);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="codex"){const s=Ua(e);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="gemini"){const s=sc(e);return{provider:"gemini",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="cursor"){const s=$a(e);return{provider:"cursor",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="claude"){const s=Ha(r==null?void 0:r.claude);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="codex"){const s=Ua(r==null?void 0:r.codex);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="cursor"){const s=$a(r==null?void 0:r.cursor);return{provider:"cursor",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}return ay("claude",t)}function hW(e){const t=uW(e==null?void 0:e.providerDefaults);return{defaultProvider:lW(e==null?void 0:e.defaultProvider),providerDefaults:t,showProviderIconsInSideTray:(e==null?void 0:e.showProviderIconsInSideTray)===!0,composerState:dW(e==null?void 0:e.composerState,t,e==null?void 0:e.liveProvider,e==null?void 0:e.livePreferences)}}const Si=oo()(ao(e=>({defaultProvider:"last_used",providerDefaults:cW(),showProviderIconsInSideTray:!1,composerState:{provider:"claude",model:tn("claude").defaultModel,modelOptions:{...Ni("claude")},planMode:!1},setDefaultProvider:t=>e({defaultProvider:t}),setShowProviderIconsInSideTray:t=>e({showProviderIconsInSideTray:t}),setProviderDefaultModel:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?Ha({...r.providerDefaults.claude,model:n}):t==="gemini"?sc({...r.providerDefaults.gemini,model:n}):t==="cursor"?$a({...r.providerDefaults.cursor,model:n}):Ua({...r.providerDefaults.codex,model:n})}})),setProviderDefaultModelOptions:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?Ha({...r.providerDefaults.claude,modelOptions:{...r.providerDefaults.claude.modelOptions,...n}}):t==="gemini"?sc({...r.providerDefaults.gemini,modelOptions:{...r.providerDefaults.gemini.modelOptions,...n}}):t==="cursor"?$a({...r.providerDefaults.cursor,modelOptions:{...r.providerDefaults.cursor.modelOptions,...n}}):Ua({...r.providerDefaults.codex,modelOptions:{...r.providerDefaults.codex.modelOptions,...n}})}})),setProviderDefaultPlanMode:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:{...r.providerDefaults[t],planMode:n}}})),setComposerProvider:t=>e(n=>({composerState:{...n.composerState,provider:t}})),setComposerModel:t=>e(n=>n.composerState.provider==="claude"?{composerState:{provider:"claude",model:t,modelOptions:Ha({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="gemini"?{composerState:{provider:"gemini",model:t,modelOptions:sc({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="cursor"?{composerState:{provider:"cursor",model:t,modelOptions:$a({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:t,modelOptions:Ua({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}),setComposerModelOptions:t=>e(n=>n.composerState.provider==="claude"?{composerState:{provider:"claude",model:n.composerState.model,modelOptions:Ha({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="gemini"?{composerState:{provider:"gemini",model:n.composerState.model,modelOptions:sc({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="cursor"?{composerState:{provider:"cursor",model:n.composerState.model,modelOptions:$a({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:n.composerState.model,modelOptions:Ua({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}),setComposerPlanMode:t=>e(n=>({composerState:{...n.composerState,planMode:t}})),resetComposerFromProvider:t=>e(n=>({composerState:ay(t,n.providerDefaults)})),initializeComposerForNewChat:()=>e(t=>{if(t.defaultProvider==="last_used")return E2("initializeComposerForNewChat:last_used",{defaultProvider:t.defaultProvider,composerState:t.composerState,providerDefaults:t.providerDefaults}),{composerState:{...t.composerState}};const n=ay(t.defaultProvider,t.providerDefaults);return E2("initializeComposerForNewChat:explicit_default",{defaultProvider:t.defaultProvider,composerState:n,providerDefaults:t.providerDefaults}),{composerState:n}})}),{name:"chat-preferences",version:5,migrate:e=>hW(e)})),R2=oo()(ao(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"})),Hm=315,fW=240,mW=520;function pW(e){return typeof e=="object"&&e!==null}function Bp(e){return Number.isFinite(e)?Math.min(mW,Math.max(fW,Math.round(e))):Hm}function gW(e){return pW(e)?{widthPx:Bp(typeof e.widthPx=="number"?e.widthPx:Hm)}:{widthPx:Hm}}const T2=oo()(ao(e=>({widthPx:Hm,setWidth:t=>e({widthPx:Bp(t)})}),{name:"left-sidebar-layout",version:1,migrate:gW}));function OA(e,t){return e&&!t}function vW(e,t,n){if(OA(e,t))return{width:`${Bp(n)}px`}}function bW({data:e,completedChatIds:t,activeChatId:n,activeOverviewFeatureId:r,connectionStatus:s,ready:o,open:l,collapsed:u,isDesktopViewport:h,showMobileOpenButton:d,desktopWidth:g,onOpen:p,onClose:v,onToggle:y,onExpand:w,toggleShortcut:S,onResizeDesktopWidth:C,onCreateChat:k,onCreateFeature:R,onRenameFeature:E,onDeleteFeature:M,onSetProjectBrowserState:L,onSetProjectGeneralChatsBrowserState:j,onSetFeatureBrowserState:D,onSetFeatureStage:H,onSetChatFeature:G,onReorderFeatures:I,folderGroupsEnabled:q,showFeatureOverviewInSidebar:B,kanbanStatusesEnabled:W,onOpenFeatureOverview:F,onDeleteChat:V,onRemoveProject:O,onRefreshProviderUsage:$,onOpenProviderLogin:U,providerSettings:Y,startingLocalPath:A,updateSnapshot:P,onInstallUpdate:X}){const N=Oi(),ne=rl(),oe=b.useRef(null),J=b.useRef(null),te=b.useRef(0),ue=b.useRef(null),he=b.useRef(null),ge=b.useRef({}),ke=b.useRef({}),Ee=b.useRef({}),[De,Xe]=b.useState(new Set),[pt,at]=b.useState(!1),[fe,Ve]=b.useState(null),[Ae,et]=b.useState(()=>Date.now()),lt=R2(Te=>Te.order),nt=R2(Te=>Te.setOrder),Kt=b.useMemo(()=>Wx((Y==null?void 0:Y.settings)??Wn).map(Te=>Te.id),[Y==null?void 0:Y.settings]),Se=b.useMemo(()=>{if(lt.length===0)return e.projectGroups;const Te=new Map(e.projectGroups.map(it=>[it.groupKey,it])),je=lt.filter(it=>Te.has(it)).map(it=>Te.get(it)),Tt=new Set(lt);for(const it of e.projectGroups)Tt.has(it.groupKey)||je.push(it);return je},[e.projectGroups,lt]),qe=b.useCallback(()=>{ne({pathname:"/",search:"?newProject=1"}),v()},[ne,v]),se=b.useMemo(()=>q?Se:Se.map(Te=>({...Te,features:[],generalChats:N2(Te)})),[q,Se]),pe=b.useCallback(Te=>nt(Te),[nt]),Ne=b.useMemo(()=>se.reduce((Te,je)=>Te+N2(je).length,0),[se]),He=b.useCallback(Te=>{Xe(je=>{const Tt=new Set(je);return Tt.has(Te)?Tt.delete(Te):Tt.add(Te),Tt})},[]);b.useEffect(()=>{const Te=ge.current,je=ke.current,Tt=Ee.current;Xe($t=>{const K=new Set([...$t].filter(Ie=>!Ie.startsWith("project:")&&!Ie.startsWith("general:")&&!Ie.startsWith("feature:")));for(const Ie of se)(Te[Ie.groupKey]??Ie.browserState)==="CLOSED"&&K.add(`project:${Ie.groupKey}`),(je[Ie.groupKey]??Ie.generalChatsBrowserState)==="CLOSED"&&K.add(`general:${Ie.groupKey}`);for(const Ie of se)for(const mn of Ie.features)(Tt[mn.featureId]??mn.browserState)==="CLOSED"&&K.add(`feature:${mn.featureId}`);return K});const it={...Te};for(const $t of se)it[$t.groupKey]===$t.browserState&&delete it[$t.groupKey];ge.current=it;const Yt={...je};for(const $t of se)Yt[$t.groupKey]===$t.generalChatsBrowserState&&delete Yt[$t.groupKey];ke.current=Yt;const an={...Tt};for(const $t of se)for(const K of $t.features)an[K.featureId]===K.browserState&&delete an[K.featureId];Ee.current=an},[se]);const Oe=b.useCallback((Te,je)=>{ge.current={...ge.current,[Te]:je},L(Te,je)},[L]),xt=b.useCallback((Te,je)=>{ke.current={...ke.current,[Te]:je},j(Te,je)},[j]),Bt=b.useCallback((Te,je)=>{Ee.current={...Ee.current,[Te]:je},D(Te,je)},[D]),Le=b.useCallback(Te=>{ne(`/chat/${Te}`),l&&v()},[ne,v,l]),Ke=Si(Te=>Te.showProviderIconsInSideTray),ft=b.useCallback((Te,je)=>f.jsx(Z7,{chat:Te,activeChatId:n,nowMs:Ae,showProviderIcon:Ke,isCompleted:t.has(Te.chatId),onSelectChat:Le,onDeleteChat:()=>V(Te),draggable:je==null?void 0:je.draggable,onDragStart:je==null?void 0:je.onDragStart,onDragEnd:je==null?void 0:je.onDragEnd,isTouchDevice:je==null?void 0:je.isTouchDevice,onTouchDragMove:je==null?void 0:je.onTouchDragMove,onTouchDragEnd:je==null?void 0:je.onTouchDragEnd},Te._id),[n,t,Le,Ae,V,Ke]);b.useEffect(()=>{const Te=window.setInterval(()=>{et(Date.now())},3e4);return()=>window.clearInterval(Te)},[]),b.useEffect(()=>{if(pt)return document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.body.style.cursor="",document.body.style.userSelect=""}},[pt]),b.useEffect(()=>()=>{he.current!==null&&window.cancelAnimationFrame(he.current)},[]),b.useEffect(()=>{!n||!J.current||requestAnimationFrame(()=>{const Te=J.current,je=Te==null?void 0:Te.querySelector(`[data-chat-id="${n}"]`);if(!je||!Te)return;const Tt=je.getBoundingClientRect(),it=Te.getBoundingClientRect();if(Tt.top<it.top+38){const Yt=Tt.top-it.top+Te.scrollTop;Te.scrollTo({top:Yt-38,behavior:"smooth"})}else if(Tt.bottom>it.bottom){const Yt=Tt.top+Tt.height/2-it.top+Te.scrollTop,an=Te.clientHeight/2;Te.scrollTo({top:Yt-an,behavior:"smooth"})}})},[n,Ne]);const we=Ne>0,Rt=N.pathname==="/",Gt=N.pathname.startsWith("/settings"),_n=Rt||Gt,Kn=s==="connecting"||!o,Sr=Kn?"Connecting":s==="connected"?"Connected":"Disconnected",Lt=s==="connected"?"bg-emerald-500":"bg-amber-500",It=(P==null?void 0:P.updateAvailable)===!0,Pe=P?P.latestVersion===`${P.currentVersion}-dev`:!1,ot=(P==null?void 0:P.status)==="updating"||(P==null?void 0:P.status)==="restart_pending",gt=vW(h,u,fe??g),At=OA(h,u),ut=S&&S.length>0?`Toggle sidebar (${S[0]})`:"Toggle sidebar",mt=t.size>0,yn=b.useCallback(Te=>{var Yt;if(!At)return;Te.preventDefault(),at(!0),te.current=((Yt=oe.current)==null?void 0:Yt.getBoundingClientRect().left)??0,Ve(g);const je=an=>{ue.current=Bp(an-te.current),he.current===null&&(he.current=window.requestAnimationFrame(()=>{he.current=null,ue.current!==null&&Ve(ue.current)}))};je(Te.clientX);const Tt=an=>{je(an.clientX)},it=()=>{at(!1),he.current!==null&&(window.cancelAnimationFrame(he.current),he.current=null);const an=ue.current??g;ue.current=null,Ve(null),C(an),window.removeEventListener("pointermove",Tt),window.removeEventListener("pointerup",it),window.removeEventListener("pointercancel",it)};window.addEventListener("pointermove",Tt),window.addEventListener("pointerup",it),window.addEventListener("pointercancel",it)},[g,C,At]);return f.jsxs(f.Fragment,{children:[!l&&d&&f.jsx("div",{className:me("fixed top-2 left-2.5 z-50 md:hidden","flex items-center gap-1 flex-shrink-0","bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1"),children:f.jsxs(Ze,{variant:"ghost",size:"icon",className:"relative",onClick:p,children:[f.jsx(D_,{className:"h-5 w-5"}),mt&&f.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]})}),u&&_n&&f.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:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs("div",{className:"relative",children:[f.jsx(sd,{className:"size-6 text-logo"}),mt&&f.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]}),f.jsx(Ze,{variant:"ghost",size:"icon",onClick:w,title:"Expand sidebar",children:f.jsx(j_,{className:"h-5 w-5"})})]})}),f.jsxs("div",{ref:oe,"data-sidebar":"open",className:me("fixed inset-0 z-50 bg-background dark:bg-card backdrop-blur-2xl flex flex-col h-[100dvh] select-none","md:relative md:inset-auto md:bg-background md:dark:bg-card md:backdrop-blur-none md:flex-none md:mr-0 md:h-[calc(100dvh-16px)] md:my-2 md:ml-2 md:border md:border-border md:rounded-2xl",l?"flex":"hidden md:flex",u&&"md:hidden"),style:gt,children:[At?f.jsx("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical",className:me("group/sidebar-resize hidden md:flex absolute top-0 right-0 z-20 h-full w-3 translate-x-1/2 cursor-col-resize items-center justify-center",pt&&"after:bg-logo/70"),onPointerDown:yn,children:f.jsx("span",{className:me("h-14 w-px rounded-full bg-border/80 opacity-0 transition-opacity group-hover/sidebar-resize:opacity-100",pt&&"bg-logo/70 opacity-100")})}):null,f.jsxs("div",{className:"relative pl-2.5 md:pl-3 pr-[7px] h-[64px] max-h-[64px] md:h-[55px] md:max-h-[55px] border-b flex items-center justify-between",children:[f.jsxs("div",{className:me("flex items-center gap-1 flex-shrink-0 z-10","bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1","md:bg-transparent md:dark:bg-transparent md:backdrop-blur-none md:border-transparent md:p-0 md:rounded-none"),children:[f.jsxs(Ze,{variant:"ghost",size:"icon",className:"relative md:hidden",onClick:()=>y(h),children:[f.jsx(D_,{className:"h-5 w-5"}),mt&&f.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]}),f.jsxs("button",{type:"button",onClick:()=>y(h),title:ut,"aria-label":ut,className:"group/sidebar-collapse hidden md:flex relative items-center justify-center h-5 w-5",children:[f.jsx(sd,{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"}),f.jsx(j_,{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"})]})]}),f.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 md:hidden",children:f.jsx(sd,{className:"h-6 w-6 text-logo"})}),f.jsxs("div",{className:"flex items-center z-10",children:[Pe?f.jsx("span",{className:"mr-1 inline-flex items-center rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-bold tracking-wider text-muted-foreground",title:"Development build",children:"DEV"}):It?f.jsxs(Ze,{variant:"outline",size:"sm",className:"rounded-full !h-auto mr-1 py-0.5 px-2 bg-logo/20 hover:bg-logo text-logo border-logo/20 hover:text-foreground hover:border-logo/20 text-[11px] font-bold tracking-wider",onClick:X,disabled:ot,title:P!=null&&P.latestVersion?`Update to ${P.latestVersion}`:"Update Kaizen",children:[ot?f.jsx(li,{className:"mr-1.5 h-3 w-3 animate-spin"}):null,"UPDATE"]}):null,f.jsx(Ze,{variant:"ghost",size:"icon",onClick:qe,className:"size-10 rounded-lg",title:"Add project",children:f.jsx(RN,{className:"size-5"})})]})]}),f.jsx("div",{ref:J,"data-sidebar-scroll":!0,className:"flex-1 min-h-0 overflow-y-auto scrollbar-hide",style:{WebkitOverflowScrolling:"touch"},children:f.jsxs("div",{className:"p-[7px]",children:[!we&&Kn?f.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(Te=>f.jsxs("div",{className:"space-y-2 animate-pulse",children:[f.jsx("div",{className:"h-4 w-28 rounded bg-muted"}),f.jsx("div",{className:"space-y-1",children:[0,1,2].map(je=>f.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",children:[f.jsx("div",{className:"h-3.5 w-3.5 rounded-full bg-muted"}),f.jsx("div",{className:me("h-3.5 rounded bg-muted",je===0?"w-32":je===1?"w-40":"w-28")})]},je))})]},Te))}):null,!we&&!Kn&&e.projectGroups.length===0?f.jsx("p",{className:"text-sm text-slate-400 p-2 mt-6 text-center",children:"No conversations yet"}):null,f.jsx(J$,{projectGroups:se,onReorderGroups:pe,collapsedSections:De,onToggleSection:He,onSetProjectBrowserState:Oe,onSetProjectGeneralChatsBrowserState:xt,onSetFeatureBrowserState:Bt,renderChatRow:ft,onNewLocalChat:k,onCreateFeature:q?R:void 0,onRenameFeature:E,onDeleteFeature:M,onSetFeatureStage:W?H:void 0,onSetChatFeature:G,onReorderFeatures:I,onRemoveProject:O,isConnected:s==="connected",startingLocalPath:A,folderGroupsEnabled:q,showFeatureOverviewInSidebar:B,kanbanStatusesEnabled:W,activeOverviewFeatureId:r,onOpenFeatureOverview:F})]})}),f.jsxs("div",{className:"border-t border-border p-2",children:[f.jsx(oW,{providerUsage:e.providerUsage,visibleProviders:Kt,onRefreshProviderUsage:$,onOpenProviderLogin:U}),f.jsx("button",{type:"button",onClick:()=>{ne("/settings/general"),v()},className:me("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",Gt?"bg-muted border-border":"border-border/0 hover:bg-muted hover:border-border active:bg-muted/80"),children:f.jsxs("div",{className:"flex items- justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(G6,{className:"h-4 w-4 text-muted-foreground"}),f.jsx("span",{className:"text-sm",children:"Settings"})]}),f.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[f.jsx("span",{children:Sr}),Kn?f.jsx(li,{className:"h-2 w-2 animate-spin"}):f.jsx("span",{className:me("h-2 w-2 rounded-full",Lt)})]})]})})]})]})]})}function N2(e){return[...e.features.flatMap(t=>t.chats),...e.generalChats]}const LA={submitChatMessage:"Submit Chat Message",toggleProjectsSidebar:"Toggle Projects Sidebar",toggleEmbeddedTerminal:"Toggle Embedded Terminal",toggleRightSidebar:"Toggle Right Sidebar",openInFinder:"Open In Finder",openInEditor:"Open In Editor",addSplitTerminal:"Add Split Terminal"};function Lb(e){return(e??[]).join(", ")}function Ma(e){return e.split(",").map(t=>t.trim()).map(t=>t.toLowerCase()).filter(Boolean)}const _W=new Map([["cmd","meta"],["meta","meta"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["option","alt"],["shift","shift"]]);function yW(e,t){const n=xW(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 Ia(e,t,n){return((e==null?void 0:e.bindings[t])??as[t]).some(s=>yW(s,n))}function v0(e){return{bindings:{submitChatMessage:(e==null?void 0:e.bindings.submitChatMessage)??as.submitChatMessage,toggleProjectsSidebar:(e==null?void 0:e.bindings.toggleProjectsSidebar)??as.toggleProjectsSidebar,toggleEmbeddedTerminal:(e==null?void 0:e.bindings.toggleEmbeddedTerminal)??as.toggleEmbeddedTerminal,toggleRightSidebar:(e==null?void 0:e.bindings.toggleRightSidebar)??as.toggleRightSidebar,openInFinder:(e==null?void 0:e.bindings.openInFinder)??as.openInFinder,openInEditor:(e==null?void 0:e.bindings.openInEditor)??as.openInEditor,addSplitTerminal:(e==null?void 0:e.bindings.addSplitTerminal)??as.addSplitTerminal},warning:(e==null?void 0:e.warning)??null,filePathDisplay:(e==null?void 0:e.filePathDisplay)??""}}function xW(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(),o=_W.get(s);if(o==="ctrl"){n.ctrl=!0;continue}if(o==="meta"){n.meta=!0;continue}if(o==="alt"){n.alt=!0;continue}if(o==="shift"){n.shift=!0;continue}if(n.key)return null;n.key=s}return n.key?n:null}function wW(e){if(!e||typeof e!="object")return!1;const t=e;if(t.isContentEditable===!0)return!0;if(typeof t.tagName=="string"){const n=t.tagName.toLowerCase();if(n==="input"||n==="textarea"||n==="select")return!0}return typeof t.closest=="function"?!!t.closest('input, textarea, select, [contenteditable], [contenteditable="true"]'):!1}function SW(){const[e,t]=b.useState(()=>{if(typeof window>"u")return!1;const n=navigator.standalone===!0,r=window.matchMedia("(display-mode: standalone)").matches;return n||r});return b.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 CW=oo()(ao((e,t)=>({drafts:{},setDraft:(n,r)=>e(s=>{if(!r){const{[n]:o,...l}=s.drafts;return{drafts:l}}return{drafts:{...s.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:s,...o}=r.drafts;return{drafts:o}}),getDraft:n=>t().drafts[n]??""}),{name:"chat-input-drafts"}));async function kW(e){const t=await new Promise((n,r)=>{const s=new FileReader;s.onload=()=>{if(typeof s.result=="string"){n(s.result);return}r(new Error("Failed to read image attachment"))},s.onerror=()=>r(s.error??new Error("Failed to read image attachment")),s.readAsDataURL(e)});return{type:"image",name:e.name,mimeType:e.type,sizeBytes:e.size,dataUrl:t}}function M2(e,t){if(t===void 0){console.info(`[ChatInput] ${e}`);return}console.info(`[ChatInput] ${e}`,t)}function Ks(e,t,n,r,s){return e==="claude"?t.provider==="claude"?{provider:"claude",model:r??t.model,modelOptions:{...t.modelOptions},planMode:s??t.planMode}:{provider:"claude",model:r??n.claude.model,modelOptions:{...n.claude.modelOptions},planMode:s??n.claude.planMode}:e==="gemini"?t.provider==="gemini"?{provider:"gemini",model:r??t.model,modelOptions:{...t.modelOptions},planMode:s??t.planMode}:{provider:"gemini",model:r??n.gemini.model,modelOptions:{...n.gemini.modelOptions},planMode:s??n.gemini.planMode}:e==="cursor"?t.provider==="cursor"?{provider:"cursor",model:r??t.model,modelOptions:{...t.modelOptions},planMode:s??t.planMode}:{provider:"cursor",model:r??n.cursor.model,modelOptions:{...n.cursor.modelOptions},planMode:s??n.cursor.planMode}:t.provider==="codex"?{provider:"codex",model:r??t.model,modelOptions:{...t.modelOptions},planMode:s??t.planMode}:{provider:"codex",model:r??n.codex.model,modelOptions:{...n.codex.modelOptions},planMode:s??n.codex.planMode}}function EW(e,t,n,r){return r&&e.key==="Enter"?!1:Ia(t,"submitChatMessage",e)&&!n&&!e.isComposing}function RW(e){if(!e.providerLocked)return{composerPlanMode:e.planMode,lockedComposerState:e.lockedComposerState};const t=e.lockedComposerState??Ks(e.selectedProvider,e.composerState,e.providerDefaults);return{composerPlanMode:e.composerState.planMode,lockedComposerState:{...t,planMode:e.planMode}}}const TW=b.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:s,chatId:o,activeProvider:l,activeModel:u,activePlanMode:h,availableProviders:d,keybindings:g},p){const{getDraft:v,setDraft:y,clearDraft:w}=CW(),{composerState:S,providerDefaults:C,setComposerModel:k,setComposerModelOptions:R,setComposerPlanMode:E,resetComposerFromProvider:M}=Si(),[L,j]=b.useState(()=>o?v(o):""),[D,H]=b.useState([]),[G,I]=b.useState(null),[q,B]=b.useState(!1),W=b.useRef(null),F=b.useRef(null),V=SW(),O=Zd("(pointer: coarse)"),[$,U]=b.useState(()=>l?Ks(l,S,C,u,h):null),Y=l!==null,A=!Y&&d.length===0,P=Y?$??Ks(l,S,C,u,h):S,X=Y?l:S.provider,N=d.find(fe=>fe.id===X)??tn(X),ne=(N==null?void 0:N.supportsPlanMode)??!1,oe=r||A,J=b.useCallback(()=>{const fe=W.current;fe&&(fe.style.height="auto",fe.style.height=`${fe.scrollHeight}px`)},[]),te=b.useCallback(fe=>{if(W.current=fe,!!p){if(typeof p=="function"){p(fe);return}p.current=fe}},[p]);b.useEffect(()=>{J()},[L,J]),b.useEffect(()=>(window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)),[J]),b.useEffect(()=>{var fe;(fe=W.current)==null||fe.focus()},[o]),b.useEffect(()=>()=>{for(const fe of D)URL.revokeObjectURL(fe.previewUrl)},[D]),b.useEffect(()=>{if(l===null){U(null);return}U(Ks(l,S,C,u,h))},[u,h,l,o,S,C]),b.useEffect(()=>{Y||d.length!==0&&(d.some(fe=>fe.id===S.provider)||M(d[0].id))},[d,S.provider,Y,M]),b.useEffect(()=>{M2("resolved provider state",{chatId:o??null,activeProvider:l,composerProvider:S.provider,composerModel:S.model,effectiveProvider:P.provider,effectiveModel:P.model,selectedProvider:X,providerLocked:Y,lockedComposerProvider:($==null?void 0:$.provider)??null})},[l,o,S.model,S.provider,$==null?void 0:$.provider,Y,P.model,P.provider,X]);function ue(fe){if(Y){U(Ve=>{const Ae=Ve??Ks(X,S,C);return Ae.provider==="claude"?{...Ae,modelOptions:{...Ae.modelOptions,reasoningEffort:fe}}:Ae.provider==="gemini"?Ae:{...Ae,modelOptions:{...Ae.modelOptions,reasoningEffort:fe}}});return}if(X==="claude"){R({reasoningEffort:fe});return}R({reasoningEffort:fe})}function he(fe){if(Y){U(Ve=>{const Ae=Ve??Ks(X,S,C);return Ae.provider!=="gemini"?Ae:{...Ae,modelOptions:{...Ae.modelOptions,thinkingMode:fe}}});return}X==="gemini"&&R({thinkingMode:fe})}function ge(fe){if(Y){U(Ve=>{const Ae=Ve??Ks(X,S,C);return Ae.provider!=="claude"?Ae:{...Ae,modelOptions:{...Ae.modelOptions,contextWindow:fe}}});return}X==="claude"&&R({contextWindow:fe})}function ke(fe){const Ve=RW({providerLocked:Y,planMode:fe,selectedProvider:X,composerState:S,providerDefaults:C,lockedComposerState:$});Ve.lockedComposerState!==$&&U(Ve.lockedComposerState),Ve.composerPlanMode!==S.planMode&&E(Ve.composerPlanMode)}function Ee(){ke(!P.planMode)}async function De(){if(oe||!L.trim()&&D.length===0)return;const fe=L,Ve=D;let Ae;P.provider==="claude"?Ae={claude:{...P.modelOptions}}:P.provider==="gemini"?Ae={gemini:{...P.modelOptions}}:Ae={codex:{...P.modelOptions}};const et={provider:X,model:P.model,modelOptions:Ae,planMode:ne?P.planMode:!1};M2("submit settings",{chatId:o??null,activeProvider:l,composerProvider:P.provider,submitOptions:et}),j(""),I(null),o&&w(o),W.current&&(W.current.style.height="auto");try{await t({text:fe.trim(),attachments:Ve.length?await Promise.all(Ve.map(lt=>kW(lt.file))):void 0},et);for(const lt of Ve)URL.revokeObjectURL(lt.previewUrl);H([])}catch(lt){console.error("[ChatInput] Submit failed:",lt),j(fe),o&&y(o,fe)}}const Xe=b.useCallback(fe=>{if(oe)return;const Ve=fe.filter(Ae=>Ae.type.startsWith("image/"));if(Ve.length===0){I("Only PNG, JPEG, WEBP, and GIF images are supported.");return}H(Ae=>{const et=[...Ae];let lt=null;for(const nt of Ve){if(!Mm.includes(nt.type)){lt=`Unsupported image type: ${nt.type||"unknown"}`;continue}if(nt.size<=0||nt.size>yM){lt=`${nt.name} is empty or larger than 10 MB.`;continue}if(et.length>=Nm){lt=`You can attach up to ${Nm} images per message.`;break}et.push({id:id(),file:nt,name:nt.name||"image",mimeType:nt.type,sizeBytes:nt.size,previewUrl:URL.createObjectURL(nt)})}return I(lt),et})},[oe]),pt=b.useCallback(fe=>{H(Ve=>{const Ae=Ve.find(et=>et.id===fe);return Ae&&URL.revokeObjectURL(Ae.previewUrl),Ve.filter(et=>et.id!==fe)}),I(null)},[]);function at(fe){if(fe.key==="Tab"&&!fe.shiftKey){fe.preventDefault(),g8(W.current,document);return}if(fe.key==="Tab"&&fe.shiftKey&&ne){fe.preventDefault(),Ee();return}if(fe.key==="Escape"&&s){fe.preventDefault(),n==null||n();return}EW(fe.nativeEvent,g,s,O)&&(fe.preventDefault(),De())}return f.jsxs("div",{className:me("p-3 pt-0 px-2 md:px-3 md:pb-2 flex flex-col items-center",V&&"px-3"),style:V?{paddingBottom:"var(--app-composer-bottom-padding)"}:void 0,children:[f.jsxs("div",{className:"flex flex-col items-center relative z-10 w-full max-w-[840px] mx-auto",children:[f.jsxs("div",{className:me("w-full border dark:bg-card/40 bg-background/95 backdrop-blur-lg border-border rounded-[29px] px-2 pb-2 transition-colors relative z-10",q&&"border-foreground/40 bg-muted/30"),onDragEnter:fe=>{r||!fe.dataTransfer.types.includes("Files")||(fe.preventDefault(),B(!0))},onDragOver:fe=>{r||!fe.dataTransfer.types.includes("Files")||(fe.preventDefault(),fe.dataTransfer.dropEffect="copy",B(!0))},onDragLeave:fe=>{if(!fe.dataTransfer.types.includes("Files"))return;fe.preventDefault();const Ve=fe.relatedTarget;Ve instanceof Node&&fe.currentTarget.contains(Ve)||B(!1)},onDrop:fe=>{var Ve;r||!fe.dataTransfer.types.includes("Files")||(fe.preventDefault(),B(!1),Xe(Array.from(fe.dataTransfer.files)),(Ve=W.current)==null||Ve.focus())},children:[f.jsx("input",{ref:F,type:"file",accept:Mm.join(","),multiple:!0,className:"hidden",onChange:fe=>{Xe(Array.from(fe.target.files??[])),fe.target.value=""}}),D.length?f.jsx("div",{className:"grid grid-cols-2 gap-2 px-2 pt-2 sm:grid-cols-3",children:D.map(fe=>f.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/80 bg-background/80",children:[f.jsx("img",{src:fe.previewUrl,alt:fe.name,className:"h-28 w-full object-cover"}),f.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 px-2 py-1.5",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate text-xs text-foreground",children:fe.name}),f.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[Math.max(1,Math.round(fe.sizeBytes/1024))," KB"]})]}),f.jsx(Ze,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>pt(fe.id),disabled:oe,children:f.jsx(Js,{className:"h-3.5 w-3.5"})})]})]},fe.id))}):null,f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsx(Ze,{type:"button",variant:"ghost",size:"icon",className:"mt-1.5 md:mt-0 md:mb-1 h-10 w-10 shrink-0 rounded-full",disabled:oe||s,onClick:()=>{var fe;return(fe=F.current)==null?void 0:fe.click()},children:f.jsx(DN,{className:"h-4.5 w-4.5"})}),f.jsx(Fd,{ref:te,placeholder:"Build something...",value:L,autoFocus:!0,[Nx]:"",rows:1,onChange:fe=>{j(fe.target.value),o&&y(o,fe.target.value),J()},onPaste:fe=>{const Ve=Array.from(fe.clipboardData.files);Ve.some(Ae=>Ae.type.startsWith("image/"))&&(fe.preventDefault(),Xe(Ve))},onKeyDown:at,disabled:oe,className:"flex-1 text-base py-2 md:py-3.75 px-1 md:px-2 resize-none max-h-[200px] outline-none bg-transparent border-0 shadow-none"}),f.jsx(Ze,{type:"button",onPointerDown:fe=>{fe.preventDefault(),s?n==null||n():!oe&&(L.trim()||D.length>0)&&De()},disabled:!s&&(oe||!L.trim()&&D.length===0),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 md:mb-0.5 -mr-0.5 md:mr-0 touch-manipulation disabled:bg-white/60 disabled:text-slate-700",children:s?f.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):f.jsx(EI,{className:"h-5 w-5 md:h-6 md:w-6"})})]})]}),f.jsxs("div",{className:me("border-x border-b border-t-0 border-border rounded-b-[20px] px-3 py-1.5 transition-colors relative z-20 -mt-[1px] flex-shrink-0 shadow-sm","dark:bg-card/40 bg-background/95 backdrop-blur-lg",q&&"border-foreground/40 bg-muted/30"),children:[f.jsx("div",{className:"absolute top-0 left-0 right-0 h-[1px] bg-background"}),f.jsx(Ku,{availableProviders:d,selectedProvider:X,disabled:oe,providerLocked:Y,model:P.model,modelOptions:P.modelOptions,onProviderChange:fe=>{Y||M(fe)},onModelChange:(fe,Ve)=>{if(Y){U(Ae=>({...Ae??Ks(X,S,C),model:Ve}));return}k(Ve)},onClaudeReasoningEffortChange:fe=>ue(fe),onClaudeContextWindowChange:fe=>ge(fe),onCodexReasoningEffortChange:fe=>ue(fe),onGeminiThinkingModeChange:fe=>he(fe),onCodexFastModeChange:fe=>{if(Y){U(Ve=>{const Ae=Ve??Ks(X,S,C);return Ae.provider!=="codex"?Ae:{...Ae,modelOptions:{...Ae.modelOptions,fastMode:fe}}});return}R({fastMode:fe})},planMode:P.planMode,onPlanModeChange:ke,includePlanMode:ne,className:"w-full relative z-10"}),A?f.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No active providers are available. Re-enable one in Settings."}):null]})]}),G?f.jsx("div",{className:"max-w-[840px] mx-auto mt-2 px-2 text-xs text-destructive relative z-10",children:G}):null]})}),NW=b.memo(TW);function A2({label:e,isCurrent:t,icon:n,onClick:r,className:s}){return f.jsxs("button",{onClick:r,className:me("w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left text-sm transition-colors hover:bg-muted",s),children:[f.jsx("span",{className:"flex-shrink-0 w-4 flex items-center justify-center",children:n??(t?f.jsx(qi,{className:"h-3.5 w-3.5 text-muted-foreground"}):null)}),f.jsx("span",{className:"flex-1 min-w-0 truncate",children:e}),t&&f.jsx("span",{className:"flex-shrink-0 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full border border-border",children:"current"})]})}function MW({projectId:e,socket:t}){const[n,r]=b.useState({phase:"loading"}),[s,o]=b.useState(!1),[l,u]=b.useState(""),h=b.useDeferredValue(l),[d,g]=b.useTransition(),p=b.useRef(null),v=b.useCallback(async()=>{try{const R=await t.command({type:"git.getBranches",projectId:e});if(!R.isRepo){r({phase:"not-a-repo"});return}r({phase:"ready",currentBranch:R.currentBranch,branches:R.branches})}catch(R){r({phase:"error",message:R instanceof Error?R.message:String(R)})}},[e,t]);b.useEffect(()=>{v()},[v]),b.useEffect(()=>{s&&(u(""),v())},[s,v]),b.useEffect(()=>{if(s&&n.phase==="ready"){const R=setTimeout(()=>{var E;return(E=p.current)==null?void 0:E.focus()},50);return()=>clearTimeout(R)}},[s,n.phase]);function y(R){n.phase!=="ready"||R===n.currentBranch||(o(!1),g(async()=>{try{await t.command({type:"git.switchBranch",projectId:e,branchName:R}),await v()}catch(E){r({phase:"error",message:E instanceof Error?E.message:String(E)})}}))}function w(R){R.trim()&&(o(!1),g(async()=>{try{await t.command({type:"git.createBranch",projectId:e,branchName:R.trim(),checkout:!0}),await v()}catch(E){r({phase:"error",message:E instanceof Error?E.message:String(E)})}}))}if(n.phase==="not-a-repo")return null;const S=n.phase==="ready"?n.branches.filter(R=>R.toLowerCase().includes(h.toLowerCase())):[],C=n.phase==="ready"&&n.branches.some(R=>R===h.trim()),k=h.trim().length>0&&!C;return f.jsxs(OM,{open:s,onOpenChange:o,children:[f.jsx(LM,{asChild:!0,children:f.jsxs(Ze,{variant:"ghost",size:"icon",className:me("h-10 w-auto max-w-[180px] gap-1.5 rounded-lg border border-border/0 px-3 text-sm text-muted-foreground",n.phase==="error"&&"text-destructive"),children:[d?f.jsx(li,{className:"h-4.5 w-4.5 flex-shrink-0 animate-spin"}):f.jsx(y6,{className:"h-4.5 w-4.5 flex-shrink-0"}),n.phase==="ready"&&f.jsx("span",{className:"truncate",children:n.currentBranch??"HEAD detached"}),n.phase==="error"&&f.jsx("span",{className:"truncate",children:"git error"})]})}),f.jsxs(Kx,{align:"end",className:"w-64 p-0 overflow-hidden",children:[f.jsx("div",{className:"border-b border-border",children:f.jsx("input",{ref:p,value:l,onChange:R=>u(R.target.value),placeholder:"Search or create branch...",className:"w-full px-3 py-2 text-sm bg-transparent outline-none placeholder:text-muted-foreground",onKeyDown:R=>{R.key==="Enter"&&k&&w(l)}})}),f.jsxs("div",{className:"max-h-[220px] overflow-y-auto p-1",children:[n.phase==="loading"&&f.jsx("div",{className:"flex items-center justify-center py-6 text-muted-foreground",children:f.jsx(li,{className:"h-4 w-4 animate-spin"})}),n.phase==="error"&&f.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:n.message}),n.phase==="ready"&&f.jsxs(f.Fragment,{children:[S.length===0&&!k&&f.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No branches match"}),S.map(R=>f.jsx(A2,{label:R,isCurrent:R===n.currentBranch,onClick:()=>y(R)},R)),k&&f.jsx(A2,{label:`Create branch "${h.trim()}"`,icon:f.jsx(kx,{className:"h-3.5 w-3.5 text-muted-foreground"}),onClick:()=>w(l),className:"text-muted-foreground border-t border-border/50 mt-1 pt-2 rounded-none"})]})]})]})]})}const b0=b.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:me("bg-card text-card-foreground",e),...t}));b0.displayName="Card";const zA=b.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-2",e),...t}));zA.displayName="CardHeader";const AW=b.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));AW.displayName="CardTitle";const DW=b.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));DW.displayName="CardDescription";const _0=b.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:me("p-6 pt-0",e),...t}));_0.displayName="CardContent";const jW=b.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));jW.displayName="CardFooter";function OW({sidebarCollapsed:e,hasCompletedChats:t=!1,onOpenSidebar:n,onExpandSidebar:r,usage:s,localPath:o,embeddedTerminalVisible:l=!1,onToggleEmbeddedTerminal:u,rightSidebarVisible:h=!1,onToggleRightSidebar:d,onOpenExternal:g,editorLabel:p="Editor",projectId:v,socket:y,finderShortcut:w,editorShortcut:S,terminalShortcut:C,rightSidebarShortcut:k}){const R=M=>M==null?"Unavailable":`${Math.round(M)}%`,E=s!=null&&s.warnings.includes("context_critical")||s!=null&&s.warnings.includes("rate_critical")?"text-amber-300 bg-amber-500/10":s!=null&&s.warnings.includes("context_warning")||s!=null&&s.warnings.includes("rate_warning")?"text-amber-100 bg-amber-500/5":"text-muted-foreground bg-background/70";return f.jsx(zA,{className:me("absolute top-0 md:top-2 left-0 right-0 z-10 px-2.5 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"," bg-gradient-to-b from-background"),children:f.jsxs("div",{className:"relative flex items-center gap-2 w-full",children:[f.jsxs("div",{className:me("flex items-center gap-1 flex-shrink-0","bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1",!e&&"md:bg-transparent md:dark:bg-transparent md:backdrop-blur-none md:border-transparent md:p-0"),children:[f.jsxs(Ze,{variant:"ghost",size:"icon",className:"relative md:hidden",onClick:n,children:[f.jsx(D_,{className:"h-5 w-5"}),t&&f.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]}),e&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative flex items-center justify-center w-[40px] h-[40px]",children:[f.jsx(sd,{className:"h-4 w-4 sm:h-5 sm:w-5 ml-1 hidden md:block"}),t&&f.jsx("span",{className:"absolute top-1.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background hidden md:block"})]}),f.jsx(Ze,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:r,title:"Expand sidebar",children:f.jsx(j_,{className:"size-4.5"})})]})]}),f.jsx("div",{className:"flex-1 min-w-0"}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1",children:[v?f.jsxs("div",{className:"hidden md:flex items-center gap-1 mr-1",children:[f.jsxs(hs,{children:[(s==null?void 0:s.contextUsedPercent)!==null&&(s==null?void 0:s.contextUsedPercent)!==void 0?f.jsx(fs,{asChild:!0,children:f.jsxs("div",{className:me("px-2.5 py-1 rounded-lg text-[14px] font-medium",E),children:["Context: ",R(s.contextUsedPercent)]})}):null,f.jsx($i,{side:"bottom",children:(s==null?void 0:s.contextWindowTokens)!==null&&(s==null?void 0:s.contextWindowTokens)!==void 0&&(s==null?void 0:s.threadTokens)!==null&&(s==null?void 0:s.threadTokens)!==void 0?`${Math.round(s.threadTokens).toLocaleString()} of ${Math.round(s.contextWindowTokens).toLocaleString()} tokens`:"Context window unavailable for this chat yet"})]}),((s==null?void 0:s.sessionLimitUsedPercent)??0)>=75?f.jsxs(hs,{children:[f.jsx(fs,{asChild:!0,children:f.jsxs("div",{className:me("px-2.5 py-1 rounded-lg border text-[11px] font-medium",E),children:["Session: ",R(s==null?void 0:s.sessionLimitUsedPercent)]})}),f.jsx($i,{side:"bottom",children:s!=null&&s.rateLimitResetAt?`Resets ${new Date(s.rateLimitResetAt).toLocaleString()}`:"No reset time available yet"})]}):null]}):null,v?f.jsx(MW,{projectId:v,socket:y}):null,o&&(g||u)&&f.jsxs(f.Fragment,{children:[g?f.jsxs(Vu,{children:[f.jsx(qu,{asChild:!0,children:f.jsx(Ze,{variant:"ghost",size:"icon",onClick:()=>g("open_finder"),title:"Open in Finder",className:"border border-border/0",children:f.jsx(EN,{className:"h-4.5 w-4.5"})})}),f.jsx(ic,{side:"bottom",shortcut:w})]}):null,u?f.jsxs(Vu,{children:[f.jsx(qu,{asChild:!0,children:f.jsx(Ze,{variant:"ghost",size:"icon",onClick:u,className:me("border border-border/0",l&&"text-white"),children:f.jsx(Rx,{className:"h-4.5 w-4.5"})})}),f.jsx(ic,{side:"bottom",shortcut:C})]}):null,g?f.jsxs(Vu,{children:[f.jsx(qu,{asChild:!0,children:f.jsx(Ze,{variant:"ghost",size:"icon",onClick:()=>g("open_editor"),title:`Open in ${p}`,className:"border border-border/0",children:f.jsx(kN,{className:"h-4.5 w-4.5"})})}),f.jsx(ic,{side:"bottom",shortcut:S})]}):null]}),d?f.jsxs(Vu,{children:[f.jsx(qu,{asChild:!0,children:f.jsx(Ze,{variant:"ghost",size:"icon",onClick:d,className:me("border border-border/0",h&&"text-white"),children:f.jsx(I6,{className:"h-4.5 w-4.5"})})}),f.jsx(ic,{side:"bottom",shortcut:k})]}):null]})]})})}function D2({onClose:e,className:t}){return f.jsx("div",{className:me("h-full min-h-0 bg-background md:min-w-[300px] md:border-l md:border-border",t),children:f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[f.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[f.jsx("div",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:"Diffs"}),f.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:f.jsx(Js,{className:"h-4 w-4"})})]}),f.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"diffs coming soon"})})]})})}function LW(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function zW(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function PW(e){return e/100*window.innerHeight}function BW(e){return e/100*window.innerWidth}function IW(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 Xu({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,o]=IW(n);switch(o){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=zW(t,s);break}case"em":{r=LW(t,s);break}case"vh":{r=PW(s);break}case"vw":{r=BW(s);break}}return r}function Wr(e){return parseFloat(e.toFixed(3))}function yc({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 ly(e){const{panels:t}=e,n=yc({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:o}=r;let l=0;if(o.collapsedSize!==void 0){const g=Xu({groupSize:n,panelElement:s,styleProp:o.collapsedSize});l=Wr(g/n*100)}let u;if(o.defaultSize!==void 0){const g=Xu({groupSize:n,panelElement:s,styleProp:o.defaultSize});u=Wr(g/n*100)}let h=0;if(o.minSize!==void 0){const g=Xu({groupSize:n,panelElement:s,styleProp:o.minSize});h=Wr(g/n*100)}let d=100;if(o.maxSize!==void 0){const g=Xu({groupSize:n,panelElement:s,styleProp:o.maxSize});d=Wr(g/n*100)}return{groupResizeBehavior:o.groupResizeBehavior,collapsedSize:l,collapsible:o.collapsible===!0,defaultSize:u,disabled:o.disabled,minSize:h,maxSize:d,panelId:r.id}})}function nn(e,t="Assertion error"){if(!e)throw Error(t)}function cy(e,t){return Array.from(t).sort(e==="horizontal"?FW:HW)}function FW(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function HW(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function PA(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function BA(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 UW({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,o=Number.MAX_VALUE;for(const l of t){const{x:u,y:h}=BA(r,l),d=e==="horizontal"?u:h;d<o&&(o=d,s=l)}return nn(s,"No rect found"),s}let zf;function $W(){return zf===void 0&&(typeof matchMedia=="function"?zf=!!matchMedia("(pointer:coarse)").matches:zf=!1),zf}function IA(e){const{element:t,orientation:n,panels:r,separators:s}=e,o=cy(n,Array.from(t.children).filter(PA).map(w=>({element:w}))).map(({element:w})=>w),l=[];let u=!1,h=!1,d=-1,g=-1,p=0,v,y=[];{let w=-1;for(const S of o)S.hasAttribute("data-panel")&&(w++,S.hasAttribute("data-disabled")||(p++,d===-1&&(d=w),g=w))}if(p>1){let w=-1;for(const S of o)if(S.hasAttribute("data-panel")){w++;const C=r.find(k=>k.element===S);if(C){if(v){const k=v.element.getBoundingClientRect(),R=S.getBoundingClientRect();let E;if(h){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(R.left,R.top,0,R.height):new DOMRect(R.left,R.top,R.width,0);switch(y.length){case 0:{E=[M,L];break}case 1:{const j=y[0],D=UW({orientation:n,rects:[k,R],targetRect:j.element.getBoundingClientRect()});E=[j,D===k?L:M];break}default:{E=y;break}}}else y.length?E=y:E=[n==="horizontal"?new DOMRect(k.right,R.top,R.left-k.right,R.height):new DOMRect(R.left,k.bottom,R.width,R.top-k.bottom)];for(const M of E){let L="width"in M?M:M.element.getBoundingClientRect();const j=$W()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<j){const H=j-L.width;L=new DOMRect(L.x-H/2,L.y,L.width+H,L.height)}if(L.height<j){const H=j-L.height;L=new DOMRect(L.x,L.y-H/2,L.width,L.height+H)}const D=w<=d||w>g;!u&&!D&&l.push({group:e,groupSize:yc({group:e}),panels:[v,C],separator:"width"in M?void 0:M,rect:L}),u=!1}}h=!1,v=C,y=[]}}else if(S.hasAttribute("data-separator")){S.ariaDisabled!==null&&(u=!0);const C=s.find(k=>k.element===S);C?y.push(C):(v=void 0,y=[])}else h=!0}return l}var Zo,rT;let FA=(rT=class{constructor(){$C(this,Zo,{})}addListener(t,n){const r=Mu(this,Zo)[t];return r===void 0?Mu(this,Zo)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=Mu(this,Zo)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,o=null;const l=Array.from(r);for(let u=0;u<l.length;u++){const h=l[u];try{h.call(null,n)}catch(d){o===null&&(s=!0,o=d)}}if(s)throw o}}removeAllListeners(){WC(this,Zo,{})}removeListener(t,n){const r=Mu(this,Zo)[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},Zo=new WeakMap,rT),ms=new Map;const HA=new FA;function WW(e){ms=new Map(ms),ms.delete(e)}function j2(e,t){for(const[n]of ms)if(n.id===e)return n}function ea(e,t){for(const[n,r]of ms)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function al(){return ms}function y0(e,t){return HA.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function no(e,t){const n=ms.get(e);ms=new Map(ms),ms.set(e,t),HA.emit("groupChange",{group:e,prev:n,next:t})}function VW(e,t,n){let r,s={x:1/0,y:1/0};for(const o of t){const l=BA(n,o.rect);switch(e){case"horizontal":{l.x<=s.x&&(r=o,s=l);break}case"vertical":{l.y<=s.y&&(r=o,s=l);break}}}return r?{distance:s,hitRegion:r}:void 0}function qW(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function KW(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:z2(e),b:z2(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();nn(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:L2(O2(n.a)),b:L2(O2(n.b))};if(s.a===s.b){const o=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let u=o.length;for(;u--;){const h=o[u];if(h===l.a)return 1;if(h===l.b)return-1}}return Math.sign(s.a-s.b)}const GW=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function YW(e){const t=getComputedStyle(UA(e)??e).display;return t==="flex"||t==="inline-flex"}function XW(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||YW(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"||GW.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function O2(e){let t=e.length;for(;t--;){const n=e[t];if(nn(n,"Missing node"),XW(n))return n}return null}function L2(e){return e&&Number(getComputedStyle(e).zIndex)||0}function z2(e){const t=[];for(;e;)t.push(e),e=UA(e);return t}function UA(e){const{parentNode:t}=e;return qW(t)?t.host:t}function ZW(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 QW({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!PA(n)||n.contains(e)||e.contains(n))return!0;if(KW(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(ZW(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function x0(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const o=IA(s),l=VW(s.orientation,o,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&QW({groupElement:s.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function JW(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 Tr(e,t,n=0){return Math.abs(Wr(e)-Wr(t))<=n}function ls(e,t){return Tr(e,t)?0:e>t?1:-1}function oc({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:o,disabled:l,maxSize:u=100,minSize:h=0}=t;if(l&&!e)return n;if(ls(r,h)<0)if(o){const d=(s+h)/2;ls(r,d)<0?r=s:r=h}else r=h;return r=Math.min(u,r),r=Wr(r),r}function Rd({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:o}){if(Tr(e,0))return t;const l=o==="imperative-api",u=Object.values(t),h=Object.values(s),d=[...u],[g,p]=r;nn(g!=null,"Invalid first pivot index"),nn(p!=null,"Invalid second pivot index");let v=0;switch(o){case"keyboard":{{const S=e<0?p:g,C=n[S];nn(C,`Panel constraints not found for index ${S}`);const{collapsedSize:k=0,collapsible:R,minSize:E=0}=C;if(R){const M=u[S];if(nn(M!=null,`Previous layout not found for panel index ${S}`),Tr(M,k)){const L=E-M;ls(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const S=e<0?g:p,C=n[S];nn(C,`No panel constraints found for index ${S}`);const{collapsedSize:k=0,collapsible:R,minSize:E=0}=C;if(R){const M=u[S];if(nn(M!=null,`Previous layout not found for panel index ${S}`),Tr(M,E)){const L=M-k;ls(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const S=e<0?p:g,C=n[S];nn(C,`Panel constraints not found for index ${S}`);const k=u[S],{collapsible:R,collapsedSize:E,minSize:M}=C;if(R&&ls(k,M)<0)if(e>0){const L=M-E,j=L/2,D=k+e;ls(D,M)<0&&(e=ls(e,j)<=0?0:L)}else{const L=M-E,j=100-L/2,D=k-e;ls(D,M)<0&&(e=ls(100+e,j)>0?0:-L)}break}}{const S=e<0?1:-1;let C=e<0?p:g,k=0;for(;;){const E=u[C];nn(E!=null,`Previous layout not found for panel index ${C}`);const M=oc({overrideDisabledPanels:l,panelConstraints:n[C],prevSize:E,size:100})-E;if(k+=M,C+=S,C<0||C>=n.length)break}const R=Math.min(Math.abs(e),Math.abs(k));e=e<0?0-R:R}{let S=e<0?g:p;for(;S>=0&&S<n.length;){const C=Math.abs(e)-Math.abs(v),k=u[S];nn(k!=null,`Previous layout not found for panel index ${S}`);const R=k-C,E=oc({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:k,size:R});if(!Tr(k,E)&&(v+=k-E,d[S]=E,v.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?S--:S++}}if(JW(h,d))return s;{const S=e<0?p:g,C=u[S];nn(C!=null,`Previous layout not found for panel index ${S}`);const k=C+v,R=oc({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:C,size:k});if(d[S]=R,!Tr(R,k)){let E=k-R,M=e<0?p:g;for(;M>=0&&M<n.length;){const L=d[M];nn(L!=null,`Previous layout not found for panel index ${M}`);const j=L+E,D=oc({overrideDisabledPanels:l,panelConstraints:n[M],prevSize:L,size:j});if(Tr(L,D)||(E-=D-L,d[M]=D),Tr(E,0))break;e>0?M--:M++}}}const y=Object.values(d).reduce((S,C)=>C+S,0);if(!Tr(y,100,.1))return s;const w=Object.keys(s);return d.reduce((S,C,k)=>(S[w[k]]=C,S),{})}function Za(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||ls(e[n],t[n])!==0)return!1;return!0}function Qa({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((u,h)=>u+h,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!Tr(s,100)&&r.length>0)for(let u=0;u<t.length;u++){const h=r[u];nn(h!=null,`No layout data found for index ${u}`);const d=100/s*h;r[u]=d}let o=0;for(let u=0;u<t.length;u++){const h=n[u];nn(h!=null,`No layout data found for index ${u}`);const d=r[u];nn(d!=null,`No layout data found for index ${u}`);const g=oc({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});d!=g&&(o+=d-g,r[u]=g)}if(!Tr(o,0))for(let u=0;u<t.length;u++){const h=r[u];nn(h!=null,`No layout data found for index ${u}`);const d=h+o,g=oc({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});if(h!==g&&(o-=g-h,r[u]=g,Tr(o,0)))break}const l=Object.keys(e);return r.reduce((u,h,d)=>(u[l[d]]=h,u),{})}function $A({groupId:e,panelId:t}){const n=()=>{const u=al();for(const[h,{defaultLayoutDeferred:d,derivedPanelConstraints:g,layout:p,groupSize:v,separatorToPanels:y}]of u)if(h.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:g,group:h,groupSize:v,layout:p,separatorToPanels:y};throw Error(`Group ${e} not found`)},r=()=>{const u=n().derivedPanelConstraints.find(h=>h.panelId===t);if(u!==void 0)return u;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const u=n().group.panels.find(h=>h.id===t);if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},o=()=>{const u=n().layout[t];if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},l=u=>{const h=o();if(u===h)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:g,group:p,groupSize:v,layout:y,separatorToPanels:w}=n(),S=p.panels.findIndex(E=>E.id===t),C=S===p.panels.length-1,k=Rd({delta:C?h-u:u-h,initialLayout:y,panelConstraints:g,pivotIndices:C?[S-1,S]:[S,S+1],prevLayout:y,trigger:"imperative-api"}),R=Qa({layout:k,panelConstraints:g});Za(y,R)||no(p,{defaultLayoutDeferred:d,derivedPanelConstraints:g,groupSize:v,layout:R,separatorToPanels:w})};return{collapse:()=>{const{collapsible:u,collapsedSize:h}=r(),{mutableValues:d}=s(),g=o();u&&g!==h&&(d.expandToSize=g,l(h))},expand:()=>{const{collapsible:u,collapsedSize:h,minSize:d}=r(),{mutableValues:g}=s(),p=o();if(u&&p===h){let v=g.expandToSize??d;v===0&&(v=1),l(v)}},getSize:()=>{const{group:u}=n(),h=o(),{element:d}=s(),g=u.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:h,inPixels:g}},isCollapsed:()=>{const{collapsible:u,collapsedSize:h}=r(),d=o();return u&&Tr(h,d)},resize:u=>{const{group:h}=n(),{element:d}=s(),g=yc({group:h}),p=Xu({groupSize:g,panelElement:d,styleProp:u}),v=Wr(p/g*100);l(v)}}}function P2(e){if(e.defaultPrevented)return;const t=al();x0(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,o=$A({groupId:n.group.id,panelId:r.id});o&&s!==void 0&&(o.resize(s),e.preventDefault())}}})}function lm(e){const t=al();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 WA({groupId:e}){const t=()=>{const n=al();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:o,groupSize:l,layout:u,separatorToPanels:h}=t(),d=Qa({layout:n,panelConstraints:s});return r?u:(Za(u,d)||no(o,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:l,layout:d,separatorToPanels:h}),d)}}}function Aa(e,t){const n=lm(e),r=ea(n.id,!0),s=n.separators.find(g=>g.element===e);nn(s,"Matching separator not found");const o=r.separatorToPanels.get(s);nn(o,"Matching panels not found");const l=o.map(g=>n.panels.indexOf(g)),u=WA({groupId:n.id}).getLayout(),h=Rd({delta:t,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:l,prevLayout:u,trigger:"keyboard"}),d=Qa({layout:h,panelConstraints:r.derivedPanelConstraints});Za(u,d)||no(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels})}function B2(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=lm(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Aa(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Aa(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Aa(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Aa(t,-5);break}case"End":{e.preventDefault(),Aa(t,100);break}case"Enter":{e.preventDefault();const r=lm(t),s=ea(r.id,!0),{derivedPanelConstraints:o,layout:l,separatorToPanels:u}=s,h=r.separators.find(v=>v.element===t);nn(h,"Matching separator not found");const d=u.get(h);nn(d,"Matching panels not found");const g=d[0],p=o.find(v=>v.panelId===g.id);if(nn(p,"Panel metadata not found"),p.collapsible){const v=l[g.id],y=p.collapsedSize===v?r.mutableState.expandedPanelSizes[g.id]??p.minSize:p.collapsedSize;Aa(t,y-v)}break}case"F6":{e.preventDefault();const r=lm(t).separators.map(l=>l.element),s=Array.from(r).findIndex(l=>l===e.currentTarget);nn(s!==null,"Index not found");const o=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[o].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Aa(t,-100);break}}}let hc={cursorFlags:0,state:"inactive"};const w0=new FA;function Ja(){return hc}function eV(e){return w0.addListener("change",e)}function tV(e){const t=hc,n={...hc};n.cursorFlags=e,hc=n,w0.emit("change",{prev:t,next:n})}function fc(e){const t=hc;hc=e,w0.emit("change",{prev:t,next:e})}function I2(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=al(),n=x0(e,t),r=new Map;let s=!1;n.forEach(o=>{o.separator&&(s||(s=!0,o.separator.element.focus({preventScroll:!0})));const l=t.get(o.group);l&&r.set(o.group,l.layout)}),fc({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const nV=e=>e,zb=()=>{},VA=1,qA=2,KA=4,GA=8,F2=3,H2=12;let Pf;function U2(){return Pf===void 0&&(Pf=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Pf=!0)),Pf}function rV({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(o=>{if(!o.mutableState.disableCursor)switch(o.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&U2()){const o=(e&VA)!==0,l=(e&qA)!==0,u=(e&KA)!==0,h=(e&GA)!==0;if(o)return u?"se-resize":h?"ne-resize":"e-resize";if(l)return u?"sw-resize":h?"nw-resize":"w-resize";if(u)return"s-resize";if(h)return"n-resize"}break}}return U2()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const $2=new WeakMap;function S0(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=$2.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=Ja();switch(r.state){case"active":case"hover":{const s=rV({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(l=>l.group),state:r.state}),o=`*, *:hover {cursor: ${s} !important; }`;if(t===o)return;t=o,s?n.cssRules.length===0?n.insertRule(o):n.replaceSync(o):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}$2.set(e,{prevStyle:t,styleSheet:n})}function YA({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:o,prevCursorFlags:l}){let u=0;n.forEach(d=>{const{group:g,groupSize:p}=d,{orientation:v,panels:y}=g,{disableCursor:w}=g.mutableState;let S=0;o?v==="horizontal"?S=(t.clientX-o.x)/p*100:S=(t.clientY-o.y)/p*100:v==="horizontal"?S=t.clientX<0?-100:100:S=t.clientY<0?-100:100;const C=r.get(g),k=s.get(g);if(!C||!k)return;const{defaultLayoutDeferred:R,derivedPanelConstraints:E,groupSize:M,layout:L,separatorToPanels:j}=k;if(E&&L&&j){const D=Rd({delta:S,initialLayout:C,panelConstraints:E,pivotIndices:d.panels.map(H=>y.indexOf(H)),prevLayout:L,trigger:"mouse-or-touch"});if(Za(D,L)){if(S!==0&&!w)switch(v){case"horizontal":{u|=S<0?VA:qA;break}case"vertical":{u|=S<0?KA:GA;break}}}else no(d.group,{defaultLayoutDeferred:R,derivedPanelConstraints:E,groupSize:M,layout:D,separatorToPanels:j})}});let h=0;t.movementX===0?h|=l&F2:h|=u&F2,t.movementY===0?h|=l&H2:h|=u&H2,tV(h),S0(e)}function W2(e){const t=al(),n=Ja();switch(n.state){case"active":YA({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function V2(e){var r,s;if(e.defaultPrevented)return;const t=Ja(),n=al();switch(t.state){case"active":{if(e.buttons===0){fc({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{const l=ea(o.group.id,!0);no(o.group,l)});return}for(const o of t.hitRegions)if(o.separator){const{element:l}=o.separator;(r=l.hasPointerCapture)!=null&&r.call(l,e.pointerId)||((s=l.setPointerCapture)==null||s.call(l,e.pointerId))}YA({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const o=x0(e,n);o.length===0?t.state!=="inactive"&&fc({cursorFlags:0,state:"inactive"}):fc({cursorFlags:0,hitRegions:o,state:"hover"}),S0(e.currentTarget);break}}}function q2(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Ja().state){case"hover":fc({cursorFlags:0,state:"inactive"})}}function K2(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Ja();switch(t.state){case"active":fc({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(S0(e.currentTarget),t.hitRegions.forEach(n=>{const r=ea(n.group.id,!0);no(n.group,r)}),e.preventDefault())}}function G2(e){let t=0,n=0;const r={};for(const o of e)if(o.defaultSize!==void 0){t++;const l=Wr(o.defaultSize);n+=l,r[o.panelId]=l}else r[o.panelId]=void 0;const s=e.length-t;if(s!==0){const o=Wr((100-n)/s);for(const l of e)l.defaultSize===void 0&&(r[l.panelId]=o)}return r}function iV(e,t,n){if(!n[0])return;const r=e.panels.find(h=>h.element===t);if(!r||!r.onResize)return;const s=yc({group:e}),o=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,l=r.mutableValues.prevSize,u={asPercentage:Wr(o/s*100),inPixels:o};r.mutableValues.prevSize=u,r.onResize(u,r.id,l)}function sV(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 oV({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,o=0,l=!1;const u=new Map,h=[];for(const p of e.panels){const v=r[p.id]??0;switch(p.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{l=!0;const y=v/100*n,w=Wr(y/t*100);u.set(p.id,w),s+=w;break}case"preserve-relative-size":default:{h.push(p.id),o+=v;break}}}if(!l||h.length===0)return r;const d=100-s,g={...r};if(u.forEach((p,v)=>{g[v]=p}),o>0)for(const p of h){const v=r[p]??0;g[p]=Wr(v/o*d)}else{const p=Wr(d/h.length);for(const v of h)g[v]=p}return g}function aV(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 Xl=new Map;function lV(e){let t=!0;nn(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,o=new n(w=>{for(const S of w){const{borderBoxSize:C,target:k}=S;if(k===e.element){if(t){const R=yc({group:e});if(R===0)return;const E=ea(e.id);if(!E)return;const M=ly(e),L=E.defaultLayoutDeferred?G2(M):E.layout,j=oV({group:e,nextGroupSize:R,prevGroupSize:E.groupSize,prevLayout:L}),D=Qa({layout:j,panelConstraints:M});if(!E.defaultLayoutDeferred&&Za(E.layout,D)&&sV(E.derivedPanelConstraints,M)&&E.groupSize===R)return;no(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:M,groupSize:R,layout:D,separatorToPanels:E.separatorToPanels})}}else iV(e,k,C)}});o.observe(e.element),e.panels.forEach(w=>{nn(!r.has(w.id),`Panel ids must be unique; id "${w.id}" was used more than once`),r.add(w.id),w.onResize&&o.observe(w.element)});const l=yc({group:e}),u=ly(e),h=e.panels.map(({id:w})=>w).join(",");let d=e.mutableState.defaultLayout;d&&(aV(e.panels,d)||(d=void 0));const g=e.mutableState.layouts[h]??d??G2(u),p=Qa({layout:g,panelConstraints:u}),v=e.element.ownerDocument;Xl.set(v,(Xl.get(v)??0)+1);const y=new Map;return IA(e).forEach(w=>{w.separator&&y.set(w.separator,w.panels)}),no(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:u,groupSize:l,layout:p,separatorToPanels:y}),e.separators.forEach(w=>{nn(!s.has(w.id),`Separator ids must be unique; id "${w.id}" was used more than once`),s.add(w.id),w.element.addEventListener("keydown",B2)}),Xl.get(v)===1&&(v.addEventListener("dblclick",P2,!0),v.addEventListener("pointerdown",I2,!0),v.addEventListener("pointerleave",W2),v.addEventListener("pointermove",V2),v.addEventListener("pointerout",q2),v.addEventListener("pointerup",K2,!0)),function(){t=!1,Xl.set(v,Math.max(0,(Xl.get(v)??0)-1)),WW(e),e.separators.forEach(w=>{w.element.removeEventListener("keydown",B2)}),Xl.get(v)||(v.removeEventListener("dblclick",P2,!0),v.removeEventListener("pointerdown",I2,!0),v.removeEventListener("pointerleave",W2),v.removeEventListener("pointermove",V2),v.removeEventListener("pointerout",q2),v.removeEventListener("pointerup",K2,!0)),o.disconnect()}}function cV(){const[e,t]=b.useState({}),n=b.useCallback(()=>t({}),[]);return[e,n]}function C0(e){const t=b.useId();return`${e??t}`}const ll=typeof window<"u"?b.useLayoutEffect:b.useEffect;function cd(e){const t=b.useRef(e);return ll(()=>{t.current=e},[e]),b.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function k0(...e){return cd(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function E0(e){const t=b.useRef({...e});return ll(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const XA=b.createContext(null);function uV(e,t){const n=b.useRef({getLayout:()=>({}),setLayout:nV});b.useImperativeHandle(t,()=>n.current,[]),ll(()=>{Object.assign(n.current,WA({groupId:e}))})}function ZA({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:o,groupRef:l,id:u,onLayoutChange:h,onLayoutChanged:d,orientation:g="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:v,...y}){const w=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),S=cd(q=>{Za(w.current.onLayoutChange,q)||(w.current.onLayoutChange=q,h==null||h(q))}),C=cd(q=>{Za(w.current.onLayoutChanged,q)||(w.current.onLayoutChanged=q,d==null||d(q))}),k=C0(u),R=b.useRef(null),[E,M]=cV(),L=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),j=k0(R,o);uV(k,l);const D=cd((q,B)=>{const W=Ja(),F=j2(q),V=ea(q);if(V){let O=!1;switch(W.state){case"active":{O=W.hitRegions.some($=>$.group===F);break}}return{flexGrow:V.layout[B]??1,pointerEvents:O?"none":void 0}}if(n!=null&&n[B])return{flexGrow:n==null?void 0:n[B]}}),H=E0({defaultLayout:n,disableCursor:r}),G=b.useMemo(()=>({get disableCursor(){return!!H.disableCursor},getPanelStyles:D,id:k,orientation:g,registerPanel:q=>{const B=L.current;return B.panels=cy(g,[...B.panels,q]),M(),()=>{B.panels=B.panels.filter(W=>W!==q),M()}},registerSeparator:q=>{const B=L.current;return B.separators=cy(g,[...B.separators,q]),M(),()=>{B.separators=B.separators.filter(W=>W!==q),M()}},togglePanelDisabled:(q,B)=>{const W=L.current.panels.find(O=>O.id===q);W&&(W.panelConstraints.disabled=B);const F=j2(k),V=ea(k);F&&V&&no(F,{...V,derivedPanelConstraints:ly(F)})},toggleSeparatorDisabled:(q,B)=>{const W=L.current.separators.find(F=>F.id===q);W&&(W.disabled=B)}}),[D,k,M,g,H]),I=b.useRef(null);return ll(()=>{const q=R.current;if(q===null)return;const B=L.current;let W;if(H.defaultLayout!==void 0&&Object.keys(H.defaultLayout).length===B.panels.length){W={};for(const A of B.panels){const P=H.defaultLayout[A.id];P!==void 0&&(W[A.id]=P)}}const F={disabled:!!s,element:q,id:k,mutableState:{defaultLayout:W,disableCursor:!!H.disableCursor,expandedPanelSizes:L.current.lastExpandedPanelSizes,layouts:L.current.layouts},orientation:g,panels:B.panels,resizeTargetMinimumSize:B.resizeTargetMinimumSize,separators:B.separators};I.current=F;const V=lV(F),{defaultLayoutDeferred:O,derivedPanelConstraints:$,layout:U}=ea(F.id,!0);!O&&$.length>0&&(S(U),C(U));const Y=y0(k,A=>{const{defaultLayoutDeferred:P,derivedPanelConstraints:X,layout:N}=A.next;if(P||X.length===0)return;const ne=F.panels.map(({id:J})=>J).join(",");F.mutableState.layouts[ne]=N,X.forEach(J=>{if(J.collapsible){const{layout:te}=A.prev??{};if(te){const ue=Tr(J.collapsedSize,N[J.panelId]),he=Tr(J.collapsedSize,te[J.panelId]);ue&&!he&&(F.mutableState.expandedPanelSizes[J.panelId]=te[J.panelId])}}});const oe=Ja().state!=="active";S(N),oe&&C(N)});return()=>{I.current=null,V(),Y()}},[s,k,C,S,g,E,H]),b.useEffect(()=>{const q=I.current;q&&(q.mutableState.defaultLayout=n,q.mutableState.disableCursor=!!r)}),f.jsx(XA.Provider,{value:G,children:f.jsx("div",{...y,className:t,"data-group":!0,"data-testid":k,id:k,ref:j,style:{height:"100%",width:"100%",overflow:"hidden",...v,display:"flex",flexDirection:g==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:g==="horizontal"?"pan-y":"pan-x"},children:e})})}ZA.displayName="Group";function R0(){const e=b.useContext(XA);return nn(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function dV(e,t){const{id:n}=R0(),r=b.useRef({collapse:zb,expand:zb,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:zb});b.useImperativeHandle(t,()=>r.current,[]),ll(()=>{Object.assign(r.current,$A({groupId:n,panelId:e}))})}function QA({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:o,elementRef:l,groupResizeBehavior:u="preserve-relative-size",id:h,maxSize:d="100%",minSize:g="0%",onResize:p,panelRef:v,style:y,...w}){const S=!!h,C=C0(h),k=E0({disabled:o}),R=b.useRef(null),E=k0(R,l),{getPanelStyles:M,id:L,orientation:j,registerPanel:D,togglePanelDisabled:H}=R0(),G=p!==null,I=cd((F,V,O)=>{p==null||p(F,h,O)});ll(()=>{const F=R.current;if(F!==null){const V={element:F,id:C,idIsStable:S,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:G?I:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:s,disabled:k.disabled,maxSize:d,minSize:g}};return D(V)}},[u,n,r,s,G,C,S,d,g,I,D,k]),b.useEffect(()=>{H(C,!!o)},[o,C,H]),dV(C,v);const q=()=>{const F=M(L,C);if(F)return JSON.stringify(F)},B=b.useSyncExternalStore(F=>y0(L,F),q,q);let W;return B?W=JSON.parse(B):s?W={flexGrow:void 0,flexShrink:void 0,flexBasis:s}:W={flexGrow:1},f.jsx("div",{...w,"data-disabled":o||void 0,"data-panel":!0,"data-testid":C,id:C,ref:E,style:{...hV,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...W},children:f.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:j==="horizontal"?"pan-y":"pan-x"},children:e})})}QA.displayName="Panel";const hV={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function fV({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,o;const l=e[n],u=t.find(h=>h.panelId===n);if(u){const h=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,g=[r,r+1];o=Qa({layout:Rd({delta:d-l,initialLayout:e,panelConstraints:t,pivotIndices:g,prevLayout:e}),panelConstraints:t})[n],s=Qa({layout:Rd({delta:h-l,initialLayout:e,panelConstraints:t,pivotIndices:g,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:o,valueNow:l}}function JA({children:e,className:t,disabled:n,elementRef:r,id:s,style:o,...l}){const u=C0(s),h=E0({disabled:n}),[d,g]=b.useState({}),[p,v]=b.useState("inactive"),y=b.useRef(null),w=k0(y,r),{disableCursor:S,id:C,orientation:k,registerSeparator:R,toggleSeparatorDisabled:E}=R0(),M=k==="horizontal"?"vertical":"horizontal";ll(()=>{const j=y.current;if(j!==null){const D={disabled:h.disabled,element:j,id:u},H=R(D),G=eV(q=>{v(q.next.state!=="inactive"&&q.next.hitRegions.some(B=>B.separator===D)?q.next.state:"inactive")}),I=y0(C,q=>{const{derivedPanelConstraints:B,layout:W,separatorToPanels:F}=q.next,V=F.get(D);if(V){const O=V[0],$=V.indexOf(O);g(fV({layout:W,panelConstraints:B,panelId:O.id,panelIndex:$}))}});return()=>{G(),I(),H()}}},[C,u,R,h]),b.useEffect(()=>{E(u,!!n)},[n,u,E]);let L;return n&&!S&&(L="not-allowed"),f.jsx("div",{...l,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":M,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":n?"disabled":p,"data-testid":u,id:u,ref:w,role:"separator",style:{flexBasis:"auto",cursor:L,...o,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}JA.displayName="Separator";const ud=({className:e,...t})=>f.jsx(ZA,{className:me("flex h-full w-full",e),...t}),Ys=e=>f.jsx(QA,{...e}),dd=({withHandle:e,orientation:t,disabled:n,className:r,...s})=>f.jsx(JA,{disabled:n,className:me("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:f.jsx("span",{className:"sr-only",children:t==="vertical"?"Resize rows":"Resize columns"})});/**
|
|
494
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
495
|
+
* @license MIT
|
|
496
|
+
*
|
|
497
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
498
|
+
* @license MIT
|
|
499
|
+
*
|
|
500
|
+
* Originally forked from (with the author's permission):
|
|
501
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
502
|
+
* http://bellard.org/jslinux/
|
|
503
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
504
|
+
*/var tr=0,nr=0,rr=0,Sn=0,_r;(e=>{function t(s,o,l,u){return u!==void 0?`#${Da(s)}${Da(o)}${Da(l)}${Da(u)}`:`#${Da(s)}${Da(o)}${Da(l)}`}e.toCss=t;function n(s,o,l,u=255){return(s<<24|o<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,o,l,u){return{css:e.toCss(s,o,l,u),rgba:e.toRgba(s,o,l,u)}}e.toColor=r})(_r||(_r={}));var mV;(e=>{function t(h,d){if(Sn=(d.rgba&255)/255,Sn===1)return{css:d.css,rgba:d.rgba};let g=d.rgba>>24&255,p=d.rgba>>16&255,v=d.rgba>>8&255,y=h.rgba>>24&255,w=h.rgba>>16&255,S=h.rgba>>8&255;tr=y+Math.round((g-y)*Sn),nr=w+Math.round((p-w)*Sn),rr=S+Math.round((v-S)*Sn);let C=_r.toCss(tr,nr,rr),k=_r.toRgba(tr,nr,rr);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,g){let p=cm.ensureContrastRatio(h.rgba,d.rgba,g);if(p)return _r.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[tr,nr,rr]=cm.toChannels(d),{css:_r.toCss(tr,nr,rr),rgba:d}}e.opaque=s;function o(h,d){return Sn=Math.round(d*255),[tr,nr,rr]=cm.toChannels(h.rgba),{css:_r.toCss(tr,nr,rr,Sn),rgba:_r.toRgba(tr,nr,rr,Sn)}}e.opacity=o;function l(h,d){return Sn=h.rgba&255,o(h,Sn*d/255)}e.multiplyOpacity=l;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(mV||(mV={}));var fr;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let o=s.getContext("2d",{willReadFrequently:!0});o&&(t=o,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 tr=parseInt(s.slice(1,2).repeat(2),16),nr=parseInt(s.slice(2,3).repeat(2),16),rr=parseInt(s.slice(3,4).repeat(2),16),_r.toColor(tr,nr,rr);case 5:return tr=parseInt(s.slice(1,2).repeat(2),16),nr=parseInt(s.slice(2,3).repeat(2),16),rr=parseInt(s.slice(3,4).repeat(2),16),Sn=parseInt(s.slice(4,5).repeat(2),16),_r.toColor(tr,nr,rr,Sn);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 o=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(o)return tr=parseInt(o[1]),nr=parseInt(o[2]),rr=parseInt(o[3]),Sn=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),_r.toColor(tr,nr,rr,Sn);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),[tr,nr,rr,Sn]=t.getImageData(0,0,1,1).data,Sn!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_r.toRgba(tr,nr,rr,Sn),css:s}}e.toColor=r})(fr||(fr={}));var Er;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,o){let l=r/255,u=s/255,h=o/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),g=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+g*.7152+p*.0722}e.relativeLuminance2=n})(Er||(Er={}));var cm;(e=>{function t(l,u){if(Sn=(u&255)/255,Sn===1)return u;let h=u>>24&255,d=u>>16&255,g=u>>8&255,p=l>>24&255,v=l>>16&255,y=l>>8&255;return tr=p+Math.round((h-p)*Sn),nr=v+Math.round((d-v)*Sn),rr=y+Math.round((g-y)*Sn),_r.toRgba(tr,nr,rr)}e.blend=t;function n(l,u,h){let d=Er.relativeLuminance(l>>8),g=Er.relativeLuminance(u>>8);if(Vs(d,g)<h){if(g<d){let y=r(l,u,h),w=Vs(d,Er.relativeLuminance(y>>8));if(w<h){let S=s(l,u,h),C=Vs(d,Er.relativeLuminance(S>>8));return w>C?y:S}return y}let p=s(l,u,h),v=Vs(d,Er.relativeLuminance(p>>8));if(v<h){let y=r(l,u,h),w=Vs(d,Er.relativeLuminance(y>>8));return v>w?p:y}return p}}e.ensureContrastRatio=n;function r(l,u,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,w=u>>8&255,S=Vs(Er.relativeLuminance2(v,y,w),Er.relativeLuminance2(d,g,p));for(;S<h&&(v>0||y>0||w>0);)v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),w-=Math.max(0,Math.ceil(w*.1)),S=Vs(Er.relativeLuminance2(v,y,w),Er.relativeLuminance2(d,g,p));return(v<<24|y<<16|w<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,w=u>>8&255,S=Vs(Er.relativeLuminance2(v,y,w),Er.relativeLuminance2(d,g,p));for(;S<h&&(v<255||y<255||w<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),S=Vs(Er.relativeLuminance2(v,y,w),Er.relativeLuminance2(d,g,p));return(v<<24|y<<16|w<<8|255)>>>0}e.increaseLuminance=s;function o(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=o})(cm||(cm={}));function Da(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Vs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var pV=Object.freeze((()=>{let e=[fr.toColor("#2e3436"),fr.toColor("#cc0000"),fr.toColor("#4e9a06"),fr.toColor("#c4a000"),fr.toColor("#3465a4"),fr.toColor("#75507b"),fr.toColor("#06989a"),fr.toColor("#d3d7cf"),fr.toColor("#555753"),fr.toColor("#ef2929"),fr.toColor("#8ae234"),fr.toColor("#fce94f"),fr.toColor("#729fcf"),fr.toColor("#ad7fa8"),fr.toColor("#34e2e2"),fr.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],o=t[n%6];e.push({css:_r.toCss(r,s,o),rgba:_r.toRgba(r,s,o)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:_r.toCss(r,r,r),rgba:_r.toRgba(r,r,r)})}return e})());function Y2(e,t,n){return Math.max(t,Math.min(e,n))}function gV(e){switch(e){case"&":return"&";case"<":return"<"}return e}var eD=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),o=r,l=t.start.y,u=t.end.y,h=t.start.x,d=t.end.x;this._beforeSerialize(u-l,l,u);for(let g=l;g<=u;g++){let p=this._buffer.getLine(g);if(p){let v=g===t.start.y?h:0,y=g===t.end.y?d:p.length;for(let w=v;w<y;w++){let S=p.getCell(w,o===r?s:r);if(!S){console.warn(`Can't get cell at row=${g}, col=${w}`);continue}this._nextCell(S,o,g,w),o=S}}this._rowEnd(g,g===u)}return this._afterSerialize(),this._serializeString(n)}_nextCell(t,n,r,s){}_rowEnd(t,n){}_beforeSerialize(t,n,r){}_afterSerialize(){}_serializeString(t){return""}};function tD(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function Gs(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function nD(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 vV=class extends eD{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&&!Gs(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 o=this._buffer.getLine(t),l=this._buffer.getLine(t+1);if(!l.isWrapped)r=`\r
|
|
505
|
+
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{r="";let u=o.getCell(o.length-1,this._thisRowLastChar),h=o.getCell(o.length-2,this._thisRowLastSecondChar),d=l.getCell(0,this._nextRowFirstChar),g=d.getWidth()>1,p=!1;(d.getChars()&&g?this._nullCellCount<=1:this._nullCellCount<=0)&&((u.getChars()||u.getWidth()===0)&&Gs(u,d)&&(p=!0),g&&(h.getChars()||h.getWidth()===0)&&Gs(u,d)&&Gs(h,d)&&(p=!0)),p||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${o.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${o.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=!tD(t,n),o=!Gs(t,n),l=!nD(t,n);if(s||o||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(o){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 o=t.getChars()==="",l=this._diffStyle(t,this._cursorStyle);if(o?!Gs(this._cursorStyle,t):l.length>0){this._nullCellCount>0&&(Gs(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)}o?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(Gs(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,h=l!==this._lastCursorRow||u!==this._lastCursorCol,d=g=>{g>0?r+=`\x1B[${g}C`:g<0&&(r+=`\x1B[${-g}D`)};h&&((g=>{g>0?r+=`\x1B[${g}B`:g<0&&(r+=`\x1B[${-g}A`)})(l-this._lastCursorRow),d(u-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,o=this._diffStyle(s,this._cursorStyle);return o.length>0&&(r+=`\x1B[${o.join(";")}m`),r}},bV=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let s=n.length,o=r===void 0?s:Y2(r+t.rows,0,s);return this._serializeBufferByRange(t,n,{start:s-o,end:s-1},!1)}_serializeBufferByRange(t,n,r,s){return new vV(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 h;let r=t.buffer.active,s=new _V(r,t,n),o=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(!o){let d=r.length,g=n.scrollback,p=g===void 0?d:Y2(g+t.rows,0,d);return s.serialize({start:{x:0,y:d-p},end:{x:t.cols,y:d-1}})}let u=(h=this._terminal)==null?void 0:h.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(){}},_V=class extends eD{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=pV}_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,h;this._htmlContent+="<html><body><!--StartFragment--><pre>";let s="#000000",o="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((u=this._terminal.options.theme)==null?void 0:u.foreground)??"#ffffff",o=((h=this._terminal.options.theme)==null?void 0:h.background)??"#000000");let l=[];l.push("color: "+s+";"),l.push("background-color: "+o+";"),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=!tD(t,n),o=!Gs(t,n),l=!nD(t,n);if(s||o||l){let u=this._getHexColor(t,!0);u&&r.push("color: "+u+";");let h=this._getHexColor(t,!1);return h&&r.push("background-color: "+h+";"),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 o=t.getChars()==="",l=this._diffStyle(t,n);l&&(this._currentRow+=l.length===0?"</span><span>":"</span><span style='"+l.join(" ")+"'>"),o?this._currentRow+=" ":this._currentRow+=gV(t.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
506
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
507
|
+
* @license MIT
|
|
508
|
+
*
|
|
509
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
510
|
+
* @license MIT
|
|
511
|
+
*
|
|
512
|
+
* Originally forked from (with the author's permission):
|
|
513
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
514
|
+
* http://bellard.org/jslinux/
|
|
515
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
516
|
+
*/var yV=class{constructor(t,n,r,s={}){this._terminal=t,this._regex=n,this._handler=r,this._options=s}provideLinks(t,n){let r=wV.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:o}=n;this._options.hover(r,s,o)}},n))}};function xV(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 wV=class um{static computeLink(t,n,r,s){let o=new RegExp(n.source,(n.flags||"")+"g"),[l,u]=um._getWindowedLineStrings(t-1,r),h=l.join(""),d,g=[];for(;d=o.exec(h);){let p=d[0];if(!xV(p))continue;let[v,y]=um._mapStrIdx(r,u,0,d.index),[w,S]=um._mapStrIdx(r,v,y,p.length);if(v===-1||y===-1||w===-1||S===-1)continue;let C={start:{x:y+1,y:v+1},end:{x:S,y:w+1}};g.push({range:C,text:p,activate:s})}return g}static _getWindowedLineStrings(t,n){let r,s=t,o=t,l=0,u="",h=[];if(r=n.buffer.active.getLine(t)){let d=r.translateToString(!0);if(r.isWrapped&&d[0]!==" "){for(l=0;(r=n.buffer.active.getLine(--s))&&l<2048&&(u=r.translateToString(!0),l+=u.length,h.push(u),!(!r.isWrapped||u.indexOf(" ")!==-1)););h.reverse()}for(h.push(d),l=0;(r=n.buffer.active.getLine(++o))&&r.isWrapped&&l<2048&&(u=r.translateToString(!0),l+=u.length,h.push(u),u.indexOf(" ")===-1););}return[h,s]}static _mapStrIdx(t,n,r,s){let o=t.buffer.active,l=o.getNullCell(),u=r;for(;s;){let h=o.getLine(n);if(!h)return[-1,-1];for(let d=u;d<h.length;++d){h.getCell(d,l);let g=l.getChars();if(l.getWidth()&&(s-=g.length||1,d===h.length-1&&g==="")){let p=o.getLine(n+1);p&&p.isWrapped&&(p.getCell(0,l),l.getWidth()===2&&(s+=1))}if(s<0)return[n,d]}n++,u=0}return[n,u]}},SV=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function CV(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 kV=class{constructor(t=CV,n={}){this._handler=t,this._options=n}activate(t){this._terminal=t;let n=this._options,r=n.urlRegex||SV;this._linkProvider=this._terminal.registerLinkProvider(new yV(this._terminal,r,this._handler,n))}dispose(){var t;(t=this._linkProvider)==null||t.dispose()}};/**
|
|
517
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
518
|
+
* @license MIT
|
|
519
|
+
*
|
|
520
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
521
|
+
* @license MIT
|
|
522
|
+
*
|
|
523
|
+
* Originally forked from (with the author's permission):
|
|
524
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
525
|
+
* http://bellard.org/jslinux/
|
|
526
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
527
|
+
*/var rD=Object.defineProperty,EV=Object.getOwnPropertyDescriptor,RV=(e,t)=>{for(var n in t)rD(e,n,{get:t[n],enumerable:!0})},kn=(e,t,n,r)=>{for(var s=r>1?void 0:r?EV(t,n):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(s=(r?l(t,n,s):l(s))||s);return r&&s&&rD(t,n,s),s},Be=(e,t)=>(n,r)=>t(n,r,e),X2="Terminal input",uy={get:()=>X2,set:e=>X2=e},Z2="Too much output to announce, navigate to rows manually to read",dy={get:()=>Z2,set:e=>Z2=e};function TV(e){return e.replace(/\r?\n/g,"\r")}function NV(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function MV(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function AV(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");iD(s,t,n,r)}}function iD(e,t,n,r){e=TV(e),e=NV(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function sD(e,t,n){let r=n.getBoundingClientRect(),s=e.clientX-r.left-10,o=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${o}px`,t.style.zIndex="1000",t.focus()}function Q2(e,t,n,r,s){sD(e,t,n),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Xo(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Ip(e,t=0,n=e.length){let r="";for(let s=t;s<n;++s){let o=e[s];o>65535?(o-=65536,r+=String.fromCharCode((o>>10)+55296)+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r}var DV=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 o=e.charCodeAt(s++);56320<=o&&o<=57343?t[r++]=(this._interim-55296)*1024+o-56320+65536:(t[r++]=this._interim,t[r++]=o),this._interim=0}for(let o=s;o<n;++o){let l=e.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=n)return this._interim=l,r;let u=e.charCodeAt(o);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}},jV=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,o,l,u,h=0,d=0;if(this.interim[0]){let v=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let w=0,S;for(;(S=this.interim[++w]&63)&&w<4;)y<<=6,y|=S;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-w;for(;d<k;){if(d>=n)return 0;if(S=e[d++],(S&192)!==128){d--,v=!0;break}else this.interim[w++]=S,y<<=6,y|=S&63}v||(C===2?y<128?d--: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 g=n-4,p=d;for(;p<n;){for(;p<g&&!((s=e[p])&128)&&!((o=e[p+1])&128)&&!((l=e[p+2])&128)&&!((u=e[p+3])&128);)t[r++]=s,t[r++]=o,t[r++]=l,t[r++]=u,p+=4;if(s=e[p++],s<128)t[r++]=s;else if((s&224)===192){if(p>=n)return this.interim[0]=s,r;if(o=e[p++],(o&192)!==128){p--;continue}if(h=(s&31)<<6|o&63,h<128){p--;continue}t[r++]=h}else if((s&240)===224){if(p>=n)return this.interim[0]=s,r;if(o=e[p++],(o&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=o,r;if(l=e[p++],(l&192)!==128){p--;continue}if(h=(s&15)<<12|(o&63)<<6|l&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[r++]=h}else if((s&248)===240){if(p>=n)return this.interim[0]=s,r;if(o=e[p++],(o&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=o,r;if(l=e[p++],(l&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=l,r;if(u=e[p++],(u&192)!==128){p--;continue}if(h=(s&7)<<18|(o&63)<<12|(l&63)<<6|u&63,h<65536||h>1114111)continue;t[r++]=h}}return r}},oD="",Jo=" ",Qd=class aD{constructor(){this.fg=0,this.bg=0,this.extended=new Um}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 aD;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}},Um=class lD{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 lD(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ai=class cD extends Qd{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Um,this.combinedData=""}static fromCharData(t){let n=new cD;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?Xo(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()]}},J2="di$target",hy="di$dependencies",Pb=new Map;function OV(e){return e[hy]||[]}function ar(e){if(Pb.has(e))return Pb.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");LV(t,n,s)};return t._id=e,Pb.set(e,t),t}function LV(e,t,n){t[J2]===t?t[hy].push({id:e,index:n}):(t[hy]=[{id:e,index:n}],t[J2]=t)}var Dr=ar("BufferService"),uD=ar("CoreMouseService"),cl=ar("CoreService"),zV=ar("CharsetService"),T0=ar("InstantiationService"),dD=ar("LogService"),jr=ar("OptionsService"),hD=ar("OscLinkService"),PV=ar("UnicodeService"),Jd=ar("DecorationService"),fy=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var g;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],s=this._optionsService.rawOptions.linkHandler,o=new Ai,l=n.getTrimmedLength(),u=-1,h=-1,d=!1;for(let p=0;p<l;p++)if(!(h===-1&&!n.hasContent(p))){if(n.loadCell(p,o),o.hasExtendedAttrs()&&o.extended.urlId)if(h===-1){h=p,u=o.extended.urlId;continue}else d=o.extended.urlId!==u;else h!==-1&&(d=!0);if(d||h!==-1&&p===l-1){let v=(g=this._oscLinkService.getLinkData(u))==null?void 0:g.uri;if(v){let y={start:{x:h+1,y:e},end:{x:p+(!d&&p===l-1?1:0),y:e}},w=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let S=new URL(v);["http:","https:"].includes(S.protocol)||(w=!0)}catch{w=!0}w||r.push({text:v,range:y,activate:(S,C)=>s?s.activate(S,C,y):BV(S,C),hover:(S,C)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,S,C,y)},leave:(S,C)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,S,C,y)}})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(h=p,u=o.extended.urlId):(h=-1,u=-1)}}t(r)}};fy=kn([Be(0,Dr),Be(1,jr),Be(2,hD)],fy);function BV(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
528
|
+
|
|
529
|
+
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 Fp=ar("CharSizeService"),lo=ar("CoreBrowserService"),N0=ar("MouseService"),co=ar("RenderService"),IV=ar("SelectionService"),fD=ar("CharacterJoinerService"),Oc=ar("ThemeService"),mD=ar("LinkProviderService"),FV=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?eE.isErrorNoTelemetry(e)?new eE(e.message+`
|
|
530
|
+
|
|
531
|
+
`+e.stack):new Error(e.message+`
|
|
532
|
+
|
|
533
|
+
`+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)}},HV=new FV;function dm(e){UV(e)||HV.onUnexpectedError(e)}var my="Canceled";function UV(e){return e instanceof $V?!0:e instanceof Error&&e.name===my&&e.message===my}var $V=class extends Error{constructor(){super(my),this.name=this.message}};function WV(e){return new Error(`Illegal argument: ${e}`)}var eE=class py extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof py)return t;let n=new py;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},gy=class pD extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,pD.prototype)}};function ei(e,t=0){return e[e.length-(1+t)]}var VV;(e=>{function t(o){return o<0}e.isLessThan=t;function n(o){return o<=0}e.isLessThanOrEqual=n;function r(o){return o>0}e.isGreaterThan=r;function s(o){return o===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(VV||(VV={}));function qV(e,t){let n=this,r=!1,s;return function(){return r||(r=!0,t||(s=e.apply(n,arguments))),s}}var gD;(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 o(M){return t(M)?M:s(M)}e.wrap=o;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 h(M){return!M||M[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(M){return M[Symbol.iterator]().next().value}e.first=d;function g(M,L){let j=0;for(let D of M)if(L(D,j++))return!0;return!1}e.some=g;function p(M,L){for(let j of M)if(L(j))return j}e.find=p;function*v(M,L){for(let j of M)L(j)&&(yield j)}e.filter=v;function*y(M,L){let j=0;for(let D of M)yield L(D,j++)}e.map=y;function*w(M,L){let j=0;for(let D of M)yield*L(D,j++)}e.flatMap=w;function*S(...M){for(let L of M)yield*L}e.concat=S;function C(M,L,j){let D=j;for(let H of M)D=L(D,H);return D}e.reduce=C;function*k(M,L,j=M.length){for(L<0&&(L+=M.length),j<0?j+=M.length:j>M.length&&(j=M.length);L<j;L++)yield M[L]}e.slice=k;function R(M,L=Number.POSITIVE_INFINITY){let j=[];if(L===0)return[j,M];let D=M[Symbol.iterator]();for(let H=0;H<L;H++){let G=D.next();if(G.done)return[j,e.empty()];j.push(G.value)}return[j,{[Symbol.iterator](){return D}}]}e.consume=R;async function E(M){let L=[];for await(let j of M)L.push(j);return Promise.resolve(L)}e.asyncToArray=E})(gD||(gD={}));function el(e){if(gD.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 KV(...e){return fn(()=>el(e))}function fn(e){return{dispose:qV(()=>{e()})}}var vD=class bD{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{el(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?bD.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)}};vD.DISABLE_DISPOSED_WARNING=!1;var ta=vD,yt=class{constructor(){this._store=new ta,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)}};yt.None=Object.freeze({dispose(){}});var xc=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}},Xs=typeof window=="object"?window:globalThis,vy=class by{constructor(t){this.element=t,this.next=by.Undefined,this.prev=by.Undefined}};vy.Undefined=new vy(void 0);var pn=vy,tE=class{constructor(){this._first=pn.Undefined,this._last=pn.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===pn.Undefined}clear(){let e=this._first;for(;e!==pn.Undefined;){let t=e.next;e.prev=pn.Undefined,e.next=pn.Undefined,e=t}this._first=pn.Undefined,this._last=pn.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new pn(e);if(this._first===pn.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!==pn.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==pn.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==pn.Undefined&&e.next!==pn.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===pn.Undefined&&e.next===pn.Undefined?(this._first=pn.Undefined,this._last=pn.Undefined):e.next===pn.Undefined?(this._last=this._last.prev,this._last.next=pn.Undefined):e.prev===pn.Undefined&&(this._first=this._first.next,this._first.prev=pn.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==pn.Undefined;)yield e.element,e=e.next}},GV=globalThis.performance&&typeof globalThis.performance.now=="function",YV=class _D{static create(t){return new _D(t)}constructor(t){this._now=GV&&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}},pr;(e=>{e.None=()=>yt.None;function t(B,W){return p(B,()=>{},0,void 0,!0,void 0,W)}e.defer=t;function n(B){return(W,F=null,V)=>{let O=!1,$;return $=B(U=>{if(!O)return $?$.dispose():O=!0,W.call(F,U)},null,V),O&&$.dispose(),$}}e.once=n;function r(B,W,F){return d((V,O=null,$)=>B(U=>V.call(O,W(U)),null,$),F)}e.map=r;function s(B,W,F){return d((V,O=null,$)=>B(U=>{W(U),V.call(O,U)},null,$),F)}e.forEach=s;function o(B,W,F){return d((V,O=null,$)=>B(U=>W(U)&&V.call(O,U),null,$),F)}e.filter=o;function l(B){return B}e.signal=l;function u(...B){return(W,F=null,V)=>{let O=KV(...B.map($=>$(U=>W.call(F,U))));return g(O,V)}}e.any=u;function h(B,W,F,V){let O=F;return r(B,$=>(O=W(O,$),O),V)}e.reduce=h;function d(B,W){let F,V={onWillAddFirstListener(){F=B(O.fire,O)},onDidRemoveLastListener(){F==null||F.dispose()}},O=new Me(V);return W==null||W.add(O),O.event}function g(B,W){return W instanceof Array?W.push(B):W&&W.add(B),B}function p(B,W,F=100,V=!1,O=!1,$,U){let Y,A,P,X=0,N,ne={leakWarningThreshold:$,onWillAddFirstListener(){Y=B(J=>{X++,A=W(A,J),V&&!P&&(oe.fire(A),A=void 0),N=()=>{let te=A;A=void 0,P=void 0,(!V||X>1)&&oe.fire(te),X=0},typeof F=="number"?(clearTimeout(P),P=setTimeout(N,F)):P===void 0&&(P=0,queueMicrotask(N))})},onWillRemoveListener(){O&&X>0&&(N==null||N())},onDidRemoveLastListener(){N=void 0,Y.dispose()}},oe=new Me(ne);return U==null||U.add(oe),oe.event}e.debounce=p;function v(B,W=0,F){return e.debounce(B,(V,O)=>V?(V.push(O),V):[O],W,void 0,!0,void 0,F)}e.accumulate=v;function y(B,W=(V,O)=>V===O,F){let V=!0,O;return o(B,$=>{let U=V||!W($,O);return V=!1,O=$,U},F)}e.latch=y;function w(B,W,F){return[e.filter(B,W,F),e.filter(B,V=>!W(V),F)]}e.split=w;function S(B,W=!1,F=[],V){let O=F.slice(),$=B(A=>{O?O.push(A):Y.fire(A)});V&&V.add($);let U=()=>{O==null||O.forEach(A=>Y.fire(A)),O=null},Y=new Me({onWillAddFirstListener(){$||($=B(A=>Y.fire(A)),V&&V.add($))},onDidAddFirstListener(){O&&(W?setTimeout(U):U())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return V&&V.add(Y),Y.event}e.buffer=S;function C(B,W){return(F,V,O)=>{let $=W(new R);return B(function(U){let Y=$.evaluate(U);Y!==k&&F.call(V,Y)},void 0,O)}}e.chain=C;let k=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(W){return this.steps.push(W),this}forEach(W){return this.steps.push(F=>(W(F),F)),this}filter(W){return this.steps.push(F=>W(F)?F:k),this}reduce(W,F){let V=F;return this.steps.push(O=>(V=W(V,O),V)),this}latch(W=(F,V)=>F===V){let F=!0,V;return this.steps.push(O=>{let $=F||!W(O,V);return F=!1,V=O,$?O:k}),this}evaluate(W){for(let F of this.steps)if(W=F(W),W===k)break;return W}}function E(B,W,F=V=>V){let V=(...Y)=>U.fire(F(...Y)),O=()=>B.on(W,V),$=()=>B.removeListener(W,V),U=new Me({onWillAddFirstListener:O,onDidRemoveLastListener:$});return U.event}e.fromNodeEventEmitter=E;function M(B,W,F=V=>V){let V=(...Y)=>U.fire(F(...Y)),O=()=>B.addEventListener(W,V),$=()=>B.removeEventListener(W,V),U=new Me({onWillAddFirstListener:O,onDidRemoveLastListener:$});return U.event}e.fromDOMEventEmitter=M;function L(B){return new Promise(W=>n(B)(W))}e.toPromise=L;function j(B){let W=new Me;return B.then(F=>{W.fire(F)},()=>{W.fire(void 0)}).finally(()=>{W.dispose()}),W.event}e.fromPromise=j;function D(B,W){return B(F=>W.fire(F))}e.forward=D;function H(B,W,F){return W(F),B(V=>W(V))}e.runAndSubscribe=H;class G{constructor(W,F){this._observable=W,this._counter=0,this._hasChanged=!1;let V={onWillAddFirstListener:()=>{W.addObserver(this)},onDidRemoveLastListener:()=>{W.removeObserver(this)}};this.emitter=new Me(V),F&&F.add(this.emitter)}beginUpdate(W){this._counter++}handlePossibleChange(W){}handleChange(W,F){this._hasChanged=!0}endUpdate(W){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function I(B,W){return new G(B,W).emitter.event}e.fromObservable=I;function q(B){return(W,F,V)=>{let O=0,$=!1,U={beginUpdate(){O++},endUpdate(){O--,O===0&&(B.reportChanges(),$&&($=!1,W.call(F)))},handlePossibleChange(){},handleChange(){$=!0}};B.addObserver(U),B.reportChanges();let Y={dispose(){B.removeObserver(U)}};return V instanceof ta?V.add(Y):Array.isArray(V)&&V.push(Y),Y}}e.fromObservableLight=q})(pr||(pr={}));var _y=class yy{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${yy._idPool++}`,yy.all.add(this)}start(t){this._stopWatch=new YV,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}}};_y.all=new Set,_y._idPool=0;var XV=_y,ZV=-1,yD=class xD{constructor(t,n,r=(xD._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[o,l]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${l}):`;console.warn(u),console.warn(o);let h=new eq(u,o);this._errorHandler(h)}return()=>{let o=this._stacks.get(t.value)||0;this._stacks.set(t.value,o-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}};yD._idPool=1;var QV=yD,JV=class wD{constructor(t){this.value=t}static create(){let t=new Error;return new wD(t.stack??"")}print(){console.warn(this.value.split(`
|
|
534
|
+
`).slice(2).join(`
|
|
535
|
+
`))}},eq=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},tq=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},nq=0,Bb=class{constructor(e){this.value=e,this.id=nq++}},rq=2,iq,Me=class{constructor(e){var t,n,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new QV((e==null?void 0:e.onListenerError)??dm,((n=this._options)==null?void 0:n.leakWarningThreshold)??ZV):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new XV(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,h,d,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let p=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(p);let v=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new tq(`${p}. HINT: Stack shows most frequent listener (${v[1]}-times)`,v[0]);return(((l=this._options)==null?void 0:l.onListenerError)||dm)(y),yt.None}if(this._disposed)return yt.None;t&&(e=e.bind(t));let r=new Bb(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=JV.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Bb?(this._deliveryQueue??(this._deliveryQueue=new sq),this._listeners=[this._listeners,r]):this._listeners.push(r):((h=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||h.call(u,this),this._listeners=r,(g=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||g.call(d,this)),this._size++;let o=fn(()=>{s==null||s(),this._removeListener(r)});return n instanceof ta?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var s,o,l,u;if((o=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||o.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*rq<=t.length){let h=0;for(let d=0;d<t.length;d++)t[d]?t[h++]=t[d]:r&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=h}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||dm;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 Bb)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},sq=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}},xy=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Me,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Me,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}};xy.INSTANCE=new xy;var M0=xy;function oq(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}M0.INSTANCE.onDidChangeZoomLevel;function aq(e){return M0.INSTANCE.getZoomFactor(e)}M0.INSTANCE.onDidChangeFullscreen;var Lc=typeof navigator=="object"?navigator.userAgent:"",wy=Lc.indexOf("Firefox")>=0,lq=Lc.indexOf("AppleWebKit")>=0,A0=Lc.indexOf("Chrome")>=0,cq=!A0&&Lc.indexOf("Safari")>=0;Lc.indexOf("Electron/")>=0;Lc.indexOf("Android")>=0;var Ib=!1;if(typeof Xs.matchMedia=="function"){let e=Xs.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Xs.matchMedia("(display-mode: fullscreen)");Ib=e.matches,oq(Xs,e,({matches:n})=>{Ib&&t.matches||(Ib=n)})}var ac="en",Sy=!1,Cy=!1,hm=!1,SD=!1,Bf,fm=ac,nE=ac,uq,Fi,Va=globalThis,mr,iT;typeof Va.vscode<"u"&&typeof Va.vscode.process<"u"?mr=Va.vscode.process:typeof process<"u"&&typeof((iT=process==null?void 0:process.versions)==null?void 0:iT.node)=="string"&&(mr=process);var sT,dq=typeof((sT=mr==null?void 0:mr.versions)==null?void 0:sT.electron)=="string",hq=dq&&(mr==null?void 0:mr.type)==="renderer",oT;if(typeof mr=="object"){Sy=mr.platform==="win32",Cy=mr.platform==="darwin",hm=mr.platform==="linux",hm&&mr.env.SNAP&&mr.env.SNAP_REVISION,mr.env.CI||mr.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Bf=ac,fm=ac;let e=mr.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Bf=t.userLocale,nE=t.osLocale,fm=t.resolvedLanguage||ac,uq=(oT=t.languagePack)==null?void 0:oT.translationsConfigFile}catch{}SD=!0}else typeof navigator=="object"&&!hq?(Fi=navigator.userAgent,Sy=Fi.indexOf("Windows")>=0,Cy=Fi.indexOf("Macintosh")>=0,(Fi.indexOf("Macintosh")>=0||Fi.indexOf("iPad")>=0||Fi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,hm=Fi.indexOf("Linux")>=0,(Fi==null?void 0:Fi.indexOf("Mobi"))>=0,fm=globalThis._VSCODE_NLS_LANGUAGE||ac,Bf=navigator.language.toLowerCase(),nE=Bf):console.error("Unable to resolve platform.");var CD=Sy,bs=Cy,fq=hm,rE=SD,ys=Fi,$o=fm,mq;(e=>{function t(){return $o}e.value=t;function n(){return $o.length===2?$o==="en":$o.length>=3?$o[0]==="e"&&$o[1]==="n"&&$o[2]==="-":!1}e.isDefaultVariant=n;function r(){return $o==="en"}e.isDefault=r})(mq||(mq={}));var pq=typeof Va.postMessage=="function"&&!Va.importScripts;(()=>{if(pq){let e=[];Va.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=e.length;r<s;r++){let o=e[r];if(o.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),o.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Va.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var gq=!!(ys&&ys.indexOf("Chrome")>=0);ys&&ys.indexOf("Firefox")>=0;!gq&&ys&&ys.indexOf("Safari")>=0;ys&&ys.indexOf("Edg/")>=0;ys&&ys.indexOf("Android")>=0;var Zl=typeof navigator=="object"?navigator:{};rE||document.queryCommandSupported&&document.queryCommandSupported("copy")||Zl&&Zl.clipboard&&Zl.clipboard.writeText,rE||Zl&&Zl.clipboard&&Zl.clipboard.readText;var D0=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}},Fb=new D0,iE=new D0,sE=new D0,vq=new Array(230),kD;(e=>{function t(u){return Fb.keyCodeToStr(u)}e.toString=t;function n(u){return Fb.strToKeyCode(u)}e.fromString=n;function r(u){return iE.keyCodeToStr(u)}e.toUserSettingsUS=r;function s(u){return sE.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function o(u){return iE.strToKeyCode(u)||sE.strToKeyCode(u)}e.fromUserSettings=o;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 Fb.keyCodeToStr(u)}e.toElectronAccelerator=l})(kD||(kD={}));var bq=class ED{constructor(t,n,r,s,o){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=o}equals(t){return t instanceof ED&&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 _q([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},_q=class{constructor(e){if(e.length===0)throw WV("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 yq(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return kD.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(wy)switch(t){case 59:return 85;case 60:if(fq)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(bs)return 57;break}else if(lq&&(bs&&t===93||!bs&&t===92))return 57;return vq[t]||0}var xq=bs?256:2048,wq=512,Sq=1024,Cq=bs?2048:256,oE=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=yq(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|=xq),this.altKey&&(t|=wq),this.shiftKey&&(t|=Sq),this.metaKey&&(t|=Cq),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new bq(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},aE=new WeakMap;function kq(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 Eq=class{static getSameOriginWindowChain(e){let t=aE.get(e);if(!t){t=[],aE.set(e,t);let n=e,r;do r=kq(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 o of s){let l=o.window.deref();if(n+=(l==null?void 0:l.scrollY)??0,r+=(l==null?void 0:l.scrollX)??0,l===t||!o.iframeElement)break;let u=o.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},If=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=Eq.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},lE=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(A0){let o=navigator.userAgent.match(/Chrome\/(\d+)/);r=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,u=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof o.wheelDeltaY<"u")r?this.deltaY=o.wheelDeltaY/(120*u):this.deltaY=o.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 h=e;h.deltaMode===h.DOM_DELTA_LINE?wy&&!bs?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")cq&&CD?this.deltaX=-(o.wheelDeltaX/120):r?this.deltaX=o.wheelDeltaX/(120*u):this.deltaX=o.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 h=e;h.deltaMode===h.DOM_DELTA_LINE?wy&&!bs?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()}},RD=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),Rq;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof Tq?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:pr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:RD})})(Rq||(Rq={}));var Tq=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?RD:(this._emitter||(this._emitter=new Me),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},j0=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 gy("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new gy("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Nq=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 gy("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=fn(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Mq;(e=>{async function t(r){let s,o=await Promise.all(r.map(l=>l.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return o}e.settled=t;function n(r){return new Promise(async(s,o)=>{try{await r(s,o)}catch(l){o(l)}})}e.withAsyncBody=n})(Mq||(Mq={}));var cE=class wi{static fromArray(t){return new wi(n=>{n.emitMany(t)})}static fromPromise(t){return new wi(async n=>{n.emitMany(await t)})}static fromPromises(t){return new wi(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new wi(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 Me,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 pr.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 wi(async r=>{for await(let s of t)r.emitOne(n(s))})}map(t){return wi.map(this,t)}static filter(t,n){return new wi(async r=>{for await(let s of t)n(s)&&r.emitOne(s)})}filter(t){return wi.filter(this,t)}static coalesce(t){return wi.filter(t,n=>!!n)}coalesce(){return wi.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return wi.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())}};cE.EMPTY=cE.fromArray([]);var{getWindow:ps,getWindowId:Aq,onDidRegisterWindow:Dq}=function(){let e=new Map,t={window:Xs,disposables:new ta};e.set(Xs.vscodeWindowId,t);let n=new Me,r=new Me,s=new Me;function o(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 yt.None;let u=new ta,h={window:l,disposables:u.add(new ta)};return e.set(l.vscodeWindowId,h),u.add(fn(()=>{e.delete(l.vscodeWindowId),r.fire(l)})),u.add(rt(l,Jn.BEFORE_UNLOAD,()=>{s.fire(l)})),n.fire(h),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:o,getWindow(l){var d;let u=l;if((d=u==null?void 0:u.ownerDocument)!=null&&d.defaultView)return u.ownerDocument.defaultView.window;let h=l;return h!=null&&h.view?h.view.window:Xs},getDocument(l){return ps(l).document}}}(),jq=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 rt(e,t,n,r){return new jq(e,t,n,r)}var uE=function(e,t,n,r){return rt(e,t,n,r)},O0,Oq=class extends Nq{constructor(e){super(),this.defaultTarget=e&&ps(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},dE=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){dm(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=o=>{n.set(o,!1);let l=e.get(o)??[];for(t.set(o,l),e.set(o,[]),r.set(o,!0);l.length>0;)l.sort(dE.sort),l.shift().execute();r.set(o,!1)};O0=(o,l,u=0)=>{let h=Aq(o),d=new dE(l,u),g=e.get(h);return g||(g=[],e.set(h,g)),g.push(d),n.get(h)||(n.set(h,!0),o.requestAnimationFrame(()=>s(h))),d}})();function Lq(e){let t=e.getBoundingClientRect(),n=ps(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var Jn={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"},zq=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=Hr(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Hr(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Hr(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Hr(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Hr(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Hr(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Hr(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Hr(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Hr(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Hr(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Hr(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=Hr(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=Hr(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Hr(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 Hr(e){return typeof e=="number"?`${e}px`:e}function hd(e){return new zq(e)}var TD=class{constructor(){this._hooks=new ta,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 o=e;try{e.setPointerCapture(t),this._hooks.add(fn(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=ps(e)}this._hooks.add(rt(o,Jn.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(rt(o,Jn.POINTER_UP,l=>this.stopMonitoring(!0)))}};function Pq(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 o=`$memoize$${t}`;n[r]=function(...l){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,l)}),this[o]}}var ss;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(ss||(ss={}));var Zu=class br extends yt{constructor(){super(),this.dispatched=!1,this.targets=new tE,this.ignoreTargets=new tE,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(pr.runAndSubscribe(Dq,({window:t,disposables:n})=>{n.add(rt(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(rt(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(rt(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:Xs,disposables:this._store}))}static addTarget(t){if(!br.isTouchDevice())return yt.None;br.INSTANCE||(br.INSTANCE=new br);let n=br.INSTANCE.targets.push(t);return fn(n)}static ignoreTarget(t){if(!br.isTouchDevice())return yt.None;br.INSTANCE||(br.INSTANCE=new br);let n=br.INSTANCE.ignoreTargets.push(t);return fn(n)}static isTouchDevice(){return"ontouchstart"in Xs||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 o=t.targetTouches.item(r);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:n,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[n],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};let l=this.newGestureEvent(ss.Start,o.target);l.pageX=o.pageX,l.pageY=o.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 o=0,l=n.changedTouches.length;o<l;o++){let u=n.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let h=this.activeTouches[u.identifier],d=Date.now()-h.initialTimeStamp;if(d<br.HOLD_DELAY&&Math.abs(h.initialPageX-ei(h.rollingPageX))<30&&Math.abs(h.initialPageY-ei(h.rollingPageY))<30){let g=this.newGestureEvent(ss.Tap,h.initialTarget);g.pageX=ei(h.rollingPageX),g.pageY=ei(h.rollingPageY),this.dispatchEvent(g)}else if(d>=br.HOLD_DELAY&&Math.abs(h.initialPageX-ei(h.rollingPageX))<30&&Math.abs(h.initialPageY-ei(h.rollingPageY))<30){let g=this.newGestureEvent(ss.Contextmenu,h.initialTarget);g.pageX=ei(h.rollingPageX),g.pageY=ei(h.rollingPageY),this.dispatchEvent(g)}else if(s===1){let g=ei(h.rollingPageX),p=ei(h.rollingPageY),v=ei(h.rollingTimestamps)-h.rollingTimestamps[0],y=g-h.rollingPageX[0],w=p-h.rollingPageY[0],S=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,S,r,Math.abs(y)/v,y>0?1:-1,g,Math.abs(w)/v,w>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(ss.End,h.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===ss.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>br.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===ss.Change||t.type===ss.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,o=t.initialTarget;for(;o&&o!==r;)s++,o=o.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,o,l,u,h,d){this.handle=O0(t,()=>{let g=Date.now(),p=g-r,v=0,y=0,w=!0;s+=br.SCROLL_FRICTION*p,u+=br.SCROLL_FRICTION*p,s>0&&(w=!1,v=o*s*p),u>0&&(w=!1,y=h*u*p);let S=this.newGestureEvent(ss.Change);S.translationX=v,S.translationY=y,n.forEach(C=>C.dispatchEvent(S)),w||this.inertia(t,n,g,s,o,l+v,u,h,d+y)})}onTouchMove(t){let n=Date.now();for(let r=0,s=t.changedTouches.length;r<s;r++){let o=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}let l=this.activeTouches[o.identifier],u=this.newGestureEvent(ss.Change,l.initialTarget);u.translationX=o.pageX-ei(l.rollingPageX),u.translationY=o.pageY-ei(l.rollingPageY),u.pageX=o.pageX,u.pageY=o.pageY,this.dispatchEvent(u),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(o.pageX),l.rollingPageY.push(o.pageY),l.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Zu.SCROLL_FRICTION=-.005,Zu.HOLD_DELAY=700,Zu.CLEAR_TAP_COUNT_TIME=400,kn([Pq],Zu,"isTouchDevice",1);var Bq=Zu,L0=class extends yt{onclick(e,t){this._register(rt(e,Jn.CLICK,n=>t(new If(ps(e),n))))}onmousedown(e,t){this._register(rt(e,Jn.MOUSE_DOWN,n=>t(new If(ps(e),n))))}onmouseover(e,t){this._register(rt(e,Jn.MOUSE_OVER,n=>t(new If(ps(e),n))))}onmouseleave(e,t){this._register(rt(e,Jn.MOUSE_LEAVE,n=>t(new If(ps(e),n))))}onkeydown(e,t){this._register(rt(e,Jn.KEY_DOWN,n=>t(new oE(n))))}onkeyup(e,t){this._register(rt(e,Jn.KEY_UP,n=>t(new oE(n))))}oninput(e,t){this._register(rt(e,Jn.INPUT,t))}onblur(e,t){this._register(rt(e,Jn.BLUR,t))}onfocus(e,t){this._register(rt(e,Jn.FOCUS,t))}onchange(e,t){this._register(rt(e,Jn.CHANGE,t))}ignoreGesture(e){return Bq.ignoreTarget(e)}},hE=11,Iq=class extends L0{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=hE+"px",this.domNode.style.height=hE+"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 TD),this._register(uE(this.bgDomNode,Jn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(uE(this.domNode,Jn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Oq),this._pointerdownScheduleRepeatTimer=this._register(new j0)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ps(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()}},Fq=class ky{constructor(t,n,r,s,o,l,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,o=o|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),o<0&&(o=0),u+o>l&&(u=l-o),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=o,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 ky(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 ky(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,o=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,h=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:o,heightChanged:l,scrollHeightChanged:u,scrollTopChanged:h}}},Hq=class extends yt{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Me),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Fq(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 mE(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=mE.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)))}},fE=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Hb(e,t){let n=t-e;return function(r){return e+n*Wq(r)}}function Uq(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var mE=class Ey{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,o;return t<n?(s=t+.75*r,o=n-.75*r):(s=t-.75*r,o=n+.75*r),Uq(Hb(t,s),Hb(o,n),.33)}return Hb(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 fE(r,s,!1)}return new fE(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return Ey.start(t,n,r)}static start(t,n,r){r=r+10;let s=Date.now()-10;return new Ey(t,n,s,r)}};function $q(e){return Math.pow(e,3)}function Wq(e){return 1-$q(1-e)}var Vq=class extends yt{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 j0)}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":"")))}},qq=140,ND=class extends L0{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 Vq(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new TD),this._shouldRender=!0,this.domNode=hd(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(rt(this.domNode.domNode,Jn.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new Iq(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=hd(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(rt(this.slider.domNode,Jn.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=Lq(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 o=this._sliderOrthogonalPointerPosition(s),l=Math.abs(o-n);if(CD&&l>qq){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()}},MD=class Ry{constructor(t,n,r,s,o,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Ry(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,o){let l=Math.max(0,r-t),u=Math.max(0,l-2*n),h=s>0&&s>r;if(!h)return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*u/s))),g=(u-d)/(s-r),p=o*g;return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(d),computedSliderRatio:g,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let t=Ry._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)}},Kq=class extends ND{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new MD(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}},Gq=class extends ND{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new MD(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}},Yq=500,pE=50,Xq=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},Ty=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 o=s===this._front?t:Math.pow(2,-r);if(t-=o,n+=this._memory[s].score*o,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(A0){let n=ps(t.browserEvent),r=aq(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,o=new Xq(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=o,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]=o),o.score=this._computeScore(o,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),o=Math.abs(t.deltaY),l=Math.abs(n.deltaX),u=Math.abs(n.deltaY),h=Math.max(Math.min(s,l),1),d=Math.max(Math.min(o,u),1),g=Math.max(s,l),p=Math.max(o,u);g%h===0&&p%d===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Ty.INSTANCE=new Ty;var Zq=Ty,Qq=class extends L0{constructor(e,t,n){super(),this._onScroll=this._register(new Me),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Me),this.onWillScroll=this._onWillScroll.event,this._options=eK(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 Gq(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Kq(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=hd(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=hd(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=hd(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 j0),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=el(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,bs&&(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 lE(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=el(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new lE(n))};this._mouseWheelToDispose.push(rt(this._listenOnDomNode,Jn.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=Zq.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+o===0?l=o=0:Math.abs(o)>=Math.abs(l)?l=0:o=0),this._options.flipAxes&&([o,l]=[l,o]);let u=!bs&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!l&&(l=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),d={};if(o){let g=pE*o,p=h.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(d,p)}if(l){let g=pE*l,p=h.scrollLeft-(g<0?Math.floor(g):Math.ceil(g));this._horizontalScrollbar.writeScrollPosition(d,p)}d=this._scrollable.validateScrollPosition(d),(h.scrollLeft!==d.scrollLeft||h.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),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":"",o=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${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(),Yq)}},Jq=class extends Qq{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 eK(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,bs&&(t.className+=" mac"),t}var Ny=class extends yt{constructor(e,t,n,r,s,o,l,u){super(),this._bufferService=n,this._optionsService=l,this._renderService=u,this._onRequestScrollLines=this._register(new Me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new Hq({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>O0(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Jq(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(pr.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(fn(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(fn(()=>this._styleElement.remove())),this._register(pr.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
536
|
+
`)})),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(d=>this._handleScroll(d)))}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}};Ny=kn([Be(2,Dr),Be(3,lo),Be(4,uD),Be(5,Oc),Be(6,jr),Be(7,co)],Ny);var My=class extends yt{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(o=>this._removeDecoration(o))),this._register(fn(()=>{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()}};My=kn([Be(1,Dr),Be(2,lo),Be(3,Jd),Be(4,co)],My);var tK=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)}},rs={full:0,left:0,center:0,right:0},Wo={full:0,left:0,center:0,right:0},Lu={full:0,left:0,center:0,right:0},$m=class extends yt{constructor(e,t,n,r,s,o,l,u){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=o,this._themeService=l,this._coreBrowserService=u,this._colorZoneStore=new tK,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(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(fn(()=>{var g;return(g=this._canvas)==null?void 0:g.remove()}));let h=this._canvas.getContext("2d");if(h)this._ctx=h;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);Wo.full=this._canvas.width,Wo.left=e,Wo.center=t,Wo.right=e,this._refreshDrawHeightConstants(),Lu.full=1,Lu.left=1,Lu.center=1+Wo.left,Lu.right=1+Wo.left+Wo.center}_refreshDrawHeightConstants(){rs.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);rs.left=t,rs.center=t,rs.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*rs.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*rs.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*rs.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*rs.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(Lu[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-rs[e.position||"full"]/2),Wo[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+rs[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}))}};$m=kn([Be(2,Dr),Be(3,Jd),Be(4,co),Be(5,jr),Be(6,Oc),Be(7,lo)],$m);var ye;(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=`
|
|
537
|
+
`,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=""))(ye||(ye={}));var mm;(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=""))(mm||(mm={}));var AD;(e=>e.ST=`${ye.ESC}\\`)(AD||(AD={}));var Ay=class{constructor(e,t,n,r,s,o){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=o,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(`${ye.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 o=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Ay=kn([Be(2,Dr),Be(3,jr),Be(4,cl),Be(5,co)],Ay);var ir=0,sr=0,or=0,Cn=0,gE={css:"#00000000",rgba:0},Bn;(e=>{function t(s,o,l,u){return u!==void 0?`#${ja(s)}${ja(o)}${ja(l)}${ja(u)}`:`#${ja(s)}${ja(o)}${ja(l)}`}e.toCss=t;function n(s,o,l,u=255){return(s<<24|o<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,o,l,u){return{css:e.toCss(s,o,l,u),rgba:e.toRgba(s,o,l,u)}}e.toColor=r})(Bn||(Bn={}));var un;(e=>{function t(h,d){if(Cn=(d.rgba&255)/255,Cn===1)return{css:d.css,rgba:d.rgba};let g=d.rgba>>24&255,p=d.rgba>>16&255,v=d.rgba>>8&255,y=h.rgba>>24&255,w=h.rgba>>16&255,S=h.rgba>>8&255;ir=y+Math.round((g-y)*Cn),sr=w+Math.round((p-w)*Cn),or=S+Math.round((v-S)*Cn);let C=Bn.toCss(ir,sr,or),k=Bn.toRgba(ir,sr,or);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,g){let p=pm.ensureContrastRatio(h.rgba,d.rgba,g);if(p)return Bn.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[ir,sr,or]=pm.toChannels(d),{css:Bn.toCss(ir,sr,or),rgba:d}}e.opaque=s;function o(h,d){return Cn=Math.round(d*255),[ir,sr,or]=pm.toChannels(h.rgba),{css:Bn.toCss(ir,sr,or,Cn),rgba:Bn.toRgba(ir,sr,or,Cn)}}e.opacity=o;function l(h,d){return Cn=h.rgba&255,o(h,Cn*d/255)}e.multiplyOpacity=l;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(un||(un={}));var vn;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let o=s.getContext("2d",{willReadFrequently:!0});o&&(t=o,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 ir=parseInt(s.slice(1,2).repeat(2),16),sr=parseInt(s.slice(2,3).repeat(2),16),or=parseInt(s.slice(3,4).repeat(2),16),Bn.toColor(ir,sr,or);case 5:return ir=parseInt(s.slice(1,2).repeat(2),16),sr=parseInt(s.slice(2,3).repeat(2),16),or=parseInt(s.slice(3,4).repeat(2),16),Cn=parseInt(s.slice(4,5).repeat(2),16),Bn.toColor(ir,sr,or,Cn);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 o=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(o)return ir=parseInt(o[1]),sr=parseInt(o[2]),or=parseInt(o[3]),Cn=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),Bn.toColor(ir,sr,or,Cn);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),[ir,sr,or,Cn]=t.getImageData(0,0,1,1).data,Cn!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Bn.toRgba(ir,sr,or,Cn),css:s}}e.toColor=r})(vn||(vn={}));var Rr;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,o){let l=r/255,u=s/255,h=o/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),g=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+g*.7152+p*.0722}e.relativeLuminance2=n})(Rr||(Rr={}));var pm;(e=>{function t(l,u){if(Cn=(u&255)/255,Cn===1)return u;let h=u>>24&255,d=u>>16&255,g=u>>8&255,p=l>>24&255,v=l>>16&255,y=l>>8&255;return ir=p+Math.round((h-p)*Cn),sr=v+Math.round((d-v)*Cn),or=y+Math.round((g-y)*Cn),Bn.toRgba(ir,sr,or)}e.blend=t;function n(l,u,h){let d=Rr.relativeLuminance(l>>8),g=Rr.relativeLuminance(u>>8);if(qs(d,g)<h){if(g<d){let y=r(l,u,h),w=qs(d,Rr.relativeLuminance(y>>8));if(w<h){let S=s(l,u,h),C=qs(d,Rr.relativeLuminance(S>>8));return w>C?y:S}return y}let p=s(l,u,h),v=qs(d,Rr.relativeLuminance(p>>8));if(v<h){let y=r(l,u,h),w=qs(d,Rr.relativeLuminance(y>>8));return v>w?p:y}return p}}e.ensureContrastRatio=n;function r(l,u,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,w=u>>8&255,S=qs(Rr.relativeLuminance2(v,y,w),Rr.relativeLuminance2(d,g,p));for(;S<h&&(v>0||y>0||w>0);)v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),w-=Math.max(0,Math.ceil(w*.1)),S=qs(Rr.relativeLuminance2(v,y,w),Rr.relativeLuminance2(d,g,p));return(v<<24|y<<16|w<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,w=u>>8&255,S=qs(Rr.relativeLuminance2(v,y,w),Rr.relativeLuminance2(d,g,p));for(;S<h&&(v<255||y<255||w<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),S=qs(Rr.relativeLuminance2(v,y,w),Rr.relativeLuminance2(d,g,p));return(v<<24|y<<16|w<<8|255)>>>0}e.increaseLuminance=s;function o(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=o})(pm||(pm={}));function ja(e){let t=e.toString(16);return t.length<2?"0"+t:t}function qs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var nK=class extends Qd{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()]}},Wm=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Ai}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,o=0,l=0,u=t.getFg(0),h=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==u||this._workCell.bg!==h){if(d-s>1){let g=this._getJoinedRanges(r,l,o,t,s);for(let p=0;p<g.length;p++)n.push(g[p])}s=d,l=o,u=this._workCell.fg,h=this._workCell.bg}o+=this._workCell.getChars().length||Jo.length}if(this._bufferService.cols-s>1){let d=this._getJoinedRanges(r,l,o,t,s);for(let g=0;g<d.length;g++)n.push(d[g])}return n}_getJoinedRanges(e,t,n,r,s){let o=e.substring(t,n),l=[];try{l=this._characterJoiners[0].handler(o)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let h=this._characterJoiners[u].handler(o);for(let d=0;d<h.length;d++)Wm._mergeRanges(l,h[d])}catch(h){console.error(h)}return this._stringRangesToCellRanges(l,r,s),l}_stringRangesToCellRanges(e,t,n){let r=0,s=!1,o=0,l=e[r];if(l){for(let u=n;u<this._bufferService.cols;u++){let h=t.getWidth(u),d=t.getString(u).length||Jo.length;if(h!==0){if(!s&&l[0]<=o&&(l[0]=u,s=!0),l[1]<=o){if(l[1]=u,l=e[++r],!l)break;l[0]<=o?(l[0]=u,s=!0):s=!1}o+=d}}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}};Wm=kn([Be(0,Dr)],Wm);function rK(e){return 57508<=e&&e<=57558}function iK(e){return 9472<=e&&e<=9631}function sK(e){return rK(e)||iK(e)}function oK(){return{css:{canvas:Ff(),cell:Ff()},device:{canvas:Ff(),cell:Ff(),char:{width:0,height:0,left:0,top:0}}}}function Ff(){return{width:0,height:0}}var Dy=class{constructor(e,t,n,r,s,o,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=o,this._themeService=l,this._workCell=new Ai,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,o,l,u,h,d,g){let p=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,w=e.getNoBgTrimmedLength();n&&w<o+1&&(w=o+1);let S,C=0,k="",R=0,E=0,M=0,L=0,j=!1,D=0,H=!1,G=0,I=0,q=[],B=d!==-1&&g!==-1;for(let W=0;W<w;W++){e.loadCell(W,this._workCell);let F=this._workCell.getWidth();if(F===0)continue;let V=!1,O=W>=I,$=W,U=this._workCell;if(v.length>0&&W===v[0][0]&&O){let De=v.shift(),Xe=this._isCellInSelection(De[0],t);for(R=De[0]+1;R<De[1];R++)O&&(O=Xe===this._isCellInSelection(R,t));O&&(O=!n||o<De[0]||o>=De[1]),O?(V=!0,U=new nK(this._workCell,e.translateToString(!0,De[0],De[1]),De[1]-De[0]),$=De[1]-1,F=U.getWidth()):I=De[1]}let Y=this._isCellInSelection(W,t),A=n&&W===o,P=B&&W>=d&&W<=g,X=!1;this._decorationService.forEachDecorationAtCell(W,t,void 0,De=>{X=!0});let N=U.getChars()||Jo;if(N===" "&&(U.isUnderline()||U.isOverline())&&(N=" "),G=F*u-h.get(N,U.isBold(),U.isItalic()),!S)S=this._document.createElement("span");else if(C&&(Y&&H||!Y&&!H&&U.bg===E)&&(Y&&H&&y.selectionForeground||U.fg===M)&&U.extended.ext===L&&P===j&&G===D&&!A&&!V&&!X&&O){U.isInvisible()?k+=Jo:k+=N,C++;continue}else C&&(S.textContent=k),S=this._document.createElement("span"),C=0,k="";if(E=U.bg,M=U.fg,L=U.extended.ext,j=P,D=G,H=Y,V&&o>=W&&o<=$&&(o=W),!this._coreService.isCursorHidden&&A&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&q.push("xterm-cursor-blink"),q.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline");break}}if(U.isBold()&&q.push("xterm-bold"),U.isItalic()&&q.push("xterm-italic"),U.isDim()&&q.push("xterm-dim"),U.isInvisible()?k=Jo:k=U.getChars()||Jo,U.isUnderline()&&(q.push(`xterm-underline-${U.extended.underlineStyle}`),k===" "&&(k=" "),!U.isUnderlineColorDefault()))if(U.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${Qd.toColorRGB(U.getUnderlineColor()).join(",")})`;else{let De=U.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&U.isBold()&&De<8&&(De+=8),S.style.textDecorationColor=y.ansi[De].css}U.isOverline()&&(q.push("xterm-overline"),k===" "&&(k=" ")),U.isStrikethrough()&&q.push("xterm-strikethrough"),P&&(S.style.textDecoration="underline");let ne=U.getFgColor(),oe=U.getFgColorMode(),J=U.getBgColor(),te=U.getBgColorMode(),ue=!!U.isInverse();if(ue){let De=ne;ne=J,J=De;let Xe=oe;oe=te,te=Xe}let he,ge,ke=!1;this._decorationService.forEachDecorationAtCell(W,t,void 0,De=>{De.options.layer!=="top"&&ke||(De.backgroundColorRGB&&(te=50331648,J=De.backgroundColorRGB.rgba>>8&16777215,he=De.backgroundColorRGB),De.foregroundColorRGB&&(oe=50331648,ne=De.foregroundColorRGB.rgba>>8&16777215,ge=De.foregroundColorRGB),ke=De.options.layer==="top")}),!ke&&Y&&(he=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,J=he.rgba>>8&16777215,te=50331648,ke=!0,y.selectionForeground&&(oe=50331648,ne=y.selectionForeground.rgba>>8&16777215,ge=y.selectionForeground)),ke&&q.push("xterm-decoration-top");let Ee;switch(te){case 16777216:case 33554432:Ee=y.ansi[J],q.push(`xterm-bg-${J}`);break;case 50331648:Ee=Bn.toColor(J>>16,J>>8&255,J&255),this._addStyle(S,`background-color:#${vE((J>>>0).toString(16),"0",6)}`);break;case 0:default:ue?(Ee=y.foreground,q.push("xterm-bg-257")):Ee=y.background}switch(he||U.isDim()&&(he=un.multiplyOpacity(Ee,.5)),oe){case 16777216:case 33554432:U.isBold()&&ne<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ne+=8),this._applyMinimumContrast(S,Ee,y.ansi[ne],U,he,void 0)||q.push(`xterm-fg-${ne}`);break;case 50331648:let De=Bn.toColor(ne>>16&255,ne>>8&255,ne&255);this._applyMinimumContrast(S,Ee,De,U,he,ge)||this._addStyle(S,`color:#${vE(ne.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(S,Ee,y.foreground,U,he,ge)||ue&&q.push("xterm-fg-257")}q.length&&(S.className=q.join(" "),q.length=0),!A&&!V&&!X&&O?C++:S.textContent=k,G!==this.defaultSpacing&&(S.style.letterSpacing=`${G}px`),p.push(S),W=$}return S&&C&&(S.textContent=k),p}_applyMinimumContrast(e,t,n,r,s,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||sK(r.getCode()))return!1;let l=this._getContrastCache(r),u;if(!s&&!o&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=un.ensureContrastRatio(s||t,o||n,h),l.setColor((s||t).rgba,(o||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]}};Dy=kn([Be(1,fD),Be(2,jr),Be(3,lo),Be(4,cl),Be(5,Jd),Be(6,Oc)],Dy);function vE(e,t,n){for(;e.length<n;)e=t+e;return e}var aK=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 o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[n,r,s,o],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(o),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 o=this._holey.get(s);if(o===void 0){let l=0;t&&(l|=1),n&&(l|=2),o=this._measure(e,l),o>0&&this._holey.set(s,o)}return o}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},lK=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,o=t[1]-s,l=n[1]-s,u=Math.max(o,0),h=Math.min(l,e.rows-1);if(u>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=o,this.viewportEndRow=l,this.viewportCappedStartRow=u,this.viewportCappedEndRow=h,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 cK(){return new lK}var Ub="xterm-dom-renderer-owner-",yi="xterm-rows",Hf="xterm-fg-",bE="xterm-bg-",zu="xterm-focus",Uf="xterm-selection",uK=1,jy=class extends yt{constructor(e,t,n,r,s,o,l,u,h,d,g,p,v,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=o,this._linkifier2=l,this._charSizeService=h,this._optionsService=d,this._bufferService=g,this._coreService=p,this._coreBrowserService=v,this._themeService=y,this._terminalClass=uK++,this._rowElements=[],this._selectionRenderModel=cK(),this.onRequestRedraw=this._register(new Me).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(yi),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(Uf),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=oK(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(w=>this._injectCss(w))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(Dy,document),this._element.classList.add(Ub+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(w=>this._handleLinkHover(w))),this._register(this._linkifier2.onHideLinkUnderline(w=>this._handleLinkLeave(w))),this._register(fn(()=>{this._element.classList.remove(Ub+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new aK(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} .${yi} 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} .${yi} { 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} .${yi} .xterm-dim { color: ${un.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} .${yi}.${zu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${yi}.${zu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${yi}.${zu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${yi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Uf} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Uf} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Uf} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,l]of e.ansi.entries())t+=`${this._terminalSelector} .${Hf}${o} { color: ${l.css}; }${this._terminalSelector} .${Hf}${o}.xterm-dim { color: ${un.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${bE}${o} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${Hf}257 { color: ${un.opaque(e.background).css}; }${this._terminalSelector} .${Hf}257.xterm-dim { color: ${un.multiplyOpacity(un.opaque(e.background),.5).css}; }${this._terminalSelector} .${bE}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(zu),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(zu),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,o=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let h=e[0]>t[0];u.appendChild(this._createSelectionElement(o,h?t[0]:e[0],h?e[0]:t[0],l-o+1))}else{let h=r===o?e[0]:0,d=o===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(o,h,d));let g=l-o-1;if(u.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,g)),o!==l){let p=s===l?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,0,p))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let s=this._document.createElement("div"),o=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-t);return o+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-o),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${o}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),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){let d=h+n.ydisp,g=this._rowElements[h],p=n.lines.get(d);if(!g||!p)break;g.replaceChildren(...this._rowFactory.createRow(p,d,d===r,l,u,s,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Ub}${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,o){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,h=u.ybase+u.y,d=Math.min(u.x,s-1),g=this._optionsService.rawOptions.cursorBlink,p=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=r;++y){let w=y+u.ydisp,S=this._rowElements[y],C=u.lines.get(w);if(!S||!C)break;S.replaceChildren(...this._rowFactory.createRow(C,w,w===h,p,v,d,g,this.dimensions.css.cell.width,this._widthCache,o?y===n?e:0:-1,o?(y===r?t:s)-1:-1))}}};jy=kn([Be(7,T0),Be(8,Fp),Be(9,jr),Be(10,Dr),Be(11,cl),Be(12,lo),Be(13,Oc)],jy);var Oy=class extends yt{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Me),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new hK(this._optionsService))}catch{this._measureStrategy=this._register(new dK(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())}};Oy=kn([Be(2,jr)],Oy);var DD=class extends yt{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)}},dK=class extends DD{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}},hK=class extends DD{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}},fK=class extends yt{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 mK(this._window)),this._onDprChange=this._register(new Me),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Me),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(pr.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(rt(this._textarea,"focus",()=>this._isFocused=!0)),this._register(rt(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}},mK=class extends yt{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new xc),this._onDprChange=this._register(new Me),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(fn(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=rt(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)}},pK=class extends yt{constructor(){super(),this.linkProviders=[],this._register(fn(()=>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 z0(e,t,n){let r=n.getBoundingClientRect(),s=e.getComputedStyle(n),o=parseInt(s.getPropertyValue("padding-left")),l=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-r.left-o,t.clientY-r.top-l]}function gK(e,t,n,r,s,o,l,u,h){if(!o)return;let d=z0(e,t,n);if(d)return d[0]=Math.ceil((d[0]+(h?l/2:0))/l),d[1]=Math.ceil(d[1]/u),d[0]=Math.min(Math.max(d[0],1),r+(h?1:0)),d[1]=Math.min(Math.max(d[1],1),s),d}var Ly=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,s){return gK(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=z0(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])}}};Ly=kn([Be(0,co),Be(1,Fp)],Ly);var vK=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=[]}},jD={};RV(jD,{getSafariVersion:()=>_K,isChromeOS:()=>PD,isFirefox:()=>OD,isIpad:()=>yK,isIphone:()=>xK,isLegacyEdge:()=>bK,isLinux:()=>P0,isMac:()=>Vm,isNode:()=>Hp,isSafari:()=>LD,isWindows:()=>zD});var Hp=typeof process<"u"&&"title"in process,eh=Hp?"node":navigator.userAgent,th=Hp?"node":navigator.platform,OD=eh.includes("Firefox"),bK=eh.includes("Edge"),LD=/^((?!chrome|android).)*safari/i.test(eh);function _K(){if(!LD)return 0;let e=eh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Vm=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(th),yK=th==="iPad",xK=th==="iPhone",zD=["Windows","Win16","Win32","WinCE"].includes(th),P0=th.indexOf("Linux")>=0,PD=/\bCrOS\b/.test(eh),BD=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()}},wK=class extends BD{_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())}}},SK=class extends BD{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},qm=!Hp&&"requestIdleCallback"in window?SK:wK,CK=class{constructor(){this._queue=new qm}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},zy=class extends yt{constructor(e,t,n,r,s,o,l,u,h){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new xc),this._pausedResizeTask=new CK,this._observerDisposable=this._register(new xc),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 Me),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Me),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Me),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Me),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new vK((d,g)=>this._renderRows(d,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new kK(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(fn(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.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(h.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,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=fn(()=>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()}};zy=kn([Be(2,jr),Be(3,Fp),Be(4,cl),Be(5,Jd),Be(6,Dr),Be(7,lo),Be(8,Oc)],zy);var kK=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 EK(e,t,n,r){let s=n.buffer.x,o=n.buffer.y;if(!n.buffer.hasScrollback)return NK(s,o,e,t,n,r)+Up(o,t,n,r)+MK(s,o,e,t,n,r);let l;if(o===t)return l=s>e?"D":"C",Nd(Math.abs(s-e),Td(l,r));l=o>t?"D":"C";let u=Math.abs(o-t),h=TK(o>t?e:s,n)+(u-1)*n.cols+1+RK(o>t?s:e);return Nd(h,Td(l,r))}function RK(e,t){return e-1}function TK(e,t){return t.cols-e}function NK(e,t,n,r,s,o){return Up(t,r,s,o).length===0?"":Nd(FD(e,t,e,t-tl(t,s),!1,s).length,Td("D",o))}function Up(e,t,n,r){let s=e-tl(e,n),o=t-tl(t,n),l=Math.abs(s-o)-AK(e,t,n);return Nd(l,Td(ID(e,t),r))}function MK(e,t,n,r,s,o){let l;Up(t,r,s,o).length>0?l=r-tl(r,s):l=t;let u=r,h=DK(e,t,n,r,s,o);return Nd(FD(e,l,n,u,h==="C",s).length,Td(h,o))}function AK(e,t,n){var l;let r=0,s=e-tl(e,n),o=t-tl(t,n);for(let u=0;u<Math.abs(s-o);u++){let h=ID(e,t)==="A"?-1:1;(l=n.buffer.lines.get(s+h*u))!=null&&l.isWrapped&&r++}return r}function tl(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 DK(e,t,n,r,s,o){let l;return Up(n,r,s,o).length>0?l=r-tl(r,s):l=t,e<n&&l<=r||e>=n&&l<r?"C":"D"}function ID(e,t){return e>t?"A":"B"}function FD(e,t,n,r,s,o){let l=e,u=t,h="";for(;(l!==n||u!==r)&&u>=0&&u<o.buffer.lines.length;)l+=s?1:-1,s&&l>o.cols-1?(h+=o.buffer.translateBufferLineToString(u,!1,e,l),l=0,e=0,u++):!s&&l<0&&(h+=o.buffer.translateBufferLineToString(u,!1,0,e+1),l=o.cols-1,e=l,u--);return h+o.buffer.translateBufferLineToString(u,!1,e,l)}function Td(e,t){let n=t?"O":"[";return ye.ESC+n+e}function Nd(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var jK=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 _E(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 $b=50,OK=15,LK=50,zK=500,PK=" ",BK=new RegExp(PK,"g"),Py=class extends yt{constructor(e,t,n,r,s,o,l,u,h){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=o,this._optionsService=l,this._renderService=u,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Ai,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Me),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Me),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Me),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new jK(this._bufferService),this._activeSelectionMode=0,this._register(fn(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.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],o=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let u=n.translateBufferLineToString(l,!0,s,o);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 o=e[1]+1;o<=t[1]-1;o++){let l=n.lines.get(o),u=n.translateBufferLineToString(o,!0);l!=null&&l.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let o=n.lines.get(t[1]),l=n.translateBufferLineToString(t[1],!0,0,t[0]);o&&o.isWrapped?r[r.length-1]+=l:r.push(l)}}return r.map(s=>s.replace(BK," ")).join(zD?`\r
|
|
538
|
+
`:`
|
|
539
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),P0&&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,o;let n=(o=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:o.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=_E(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=z0(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,-$b),$b),t/=$b,t/Math.abs(t)+Math.round(t*(OK-1)))}shouldForceSelection(e){return Vm?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(),LK)}_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&&!(Vm&&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<zK&&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=EK(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,o=s.lines.get(e[1]);if(!o)return;let l=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(o,e[0]),h=u,d=e[0]-u,g=0,p=0,v=0,y=0;if(l.charAt(u)===" "){for(;u>0&&l.charAt(u-1)===" ";)u--;for(;h<l.length&&l.charAt(h+1)===" ";)h++}else{let C=e[0],k=e[0];o.getWidth(C)===0&&(g++,C--),o.getWidth(k)===2&&(p++,k++);let R=o.getString(k).length;for(R>1&&(y+=R-1,h+=R-1);C>0&&u>0&&!this._isCharWordSeparator(o.loadCell(C-1,this._workCell));){o.loadCell(C-1,this._workCell);let E=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,C--):E>1&&(v+=E-1,u-=E-1),u--,C--}for(;k<o.length&&h+1<l.length&&!this._isCharWordSeparator(o.loadCell(k+1,this._workCell));){o.loadCell(k+1,this._workCell);let E=this._workCell.getChars().length;this._workCell.getWidth()===2?(p++,k++):E>1&&(y+=E-1,h+=E-1),h++,k++}}h++;let w=u+d-g+v,S=Math.min(this._bufferService.cols,h-u+g+p-v-y);if(!(!t&&l.slice(u,h).trim()==="")){if(n&&w===0&&o.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&o.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 R=this._bufferService.cols-k.start;w-=R,S+=R}}}if(r&&w+S===this._bufferService.cols&&o.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&&(S+=k.length)}}return{start:w,length:S}}}_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=_E(n,this._bufferService.cols)}};Py=kn([Be(3,Dr),Be(4,cl),Be(5,N0),Be(6,jr),Be(7,co),Be(8,lo)],Py);var yE=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={}}},xE=class{constructor(){this._color=new yE,this._css=new yE}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()}},Un=Object.freeze((()=>{let e=[vn.toColor("#2e3436"),vn.toColor("#cc0000"),vn.toColor("#4e9a06"),vn.toColor("#c4a000"),vn.toColor("#3465a4"),vn.toColor("#75507b"),vn.toColor("#06989a"),vn.toColor("#d3d7cf"),vn.toColor("#555753"),vn.toColor("#ef2929"),vn.toColor("#8ae234"),vn.toColor("#fce94f"),vn.toColor("#729fcf"),vn.toColor("#ad7fa8"),vn.toColor("#34e2e2"),vn.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],o=t[n%6];e.push({css:Bn.toCss(r,s,o),rgba:Bn.toRgba(r,s,o)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Bn.toCss(r,r,r),rgba:Bn.toRgba(r,r,r)})}return e})()),za=vn.toColor("#ffffff"),Qu=vn.toColor("#000000"),wE=vn.toColor("#ffffff"),SE=Qu,Pu={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},IK=za,By=class extends yt{constructor(e){super(),this._optionsService=e,this._contrastCache=new xE,this._halfContrastCache=new xE,this._onChangeColors=this._register(new Me),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:za,background:Qu,cursor:wE,cursorAccent:SE,selectionForeground:void 0,selectionBackgroundTransparent:Pu,selectionBackgroundOpaque:un.blend(Qu,Pu),selectionInactiveBackgroundTransparent:Pu,selectionInactiveBackgroundOpaque:un.blend(Qu,Pu),scrollbarSliderBackground:un.opacity(za,.2),scrollbarSliderHoverBackground:un.opacity(za,.4),scrollbarSliderActiveBackground:un.opacity(za,.5),overviewRulerBorder:za,ansi:Un.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=en(e.foreground,za),t.background=en(e.background,Qu),t.cursor=un.blend(t.background,en(e.cursor,wE)),t.cursorAccent=un.blend(t.background,en(e.cursorAccent,SE)),t.selectionBackgroundTransparent=en(e.selectionBackground,Pu),t.selectionBackgroundOpaque=un.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=en(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=un.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?en(e.selectionForeground,gE):void 0,t.selectionForeground===gE&&(t.selectionForeground=void 0),un.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=un.opacity(t.selectionBackgroundTransparent,.3)),un.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=un.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=en(e.scrollbarSliderBackground,un.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=en(e.scrollbarSliderHoverBackground,un.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=en(e.scrollbarSliderActiveBackground,un.opacity(t.foreground,.5)),t.overviewRulerBorder=en(e.overviewRulerBorder,IK),t.ansi=Un.slice(),t.ansi[0]=en(e.black,Un[0]),t.ansi[1]=en(e.red,Un[1]),t.ansi[2]=en(e.green,Un[2]),t.ansi[3]=en(e.yellow,Un[3]),t.ansi[4]=en(e.blue,Un[4]),t.ansi[5]=en(e.magenta,Un[5]),t.ansi[6]=en(e.cyan,Un[6]),t.ansi[7]=en(e.white,Un[7]),t.ansi[8]=en(e.brightBlack,Un[8]),t.ansi[9]=en(e.brightRed,Un[9]),t.ansi[10]=en(e.brightGreen,Un[10]),t.ansi[11]=en(e.brightYellow,Un[11]),t.ansi[12]=en(e.brightBlue,Un[12]),t.ansi[13]=en(e.brightMagenta,Un[13]),t.ansi[14]=en(e.brightCyan,Un[14]),t.ansi[15]=en(e.brightWhite,Un[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]=en(e.extendedAnsi[r],Un[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()}}};By=kn([Be(0,jr)],By);function en(e,t){if(e!==void 0)try{return vn.toColor(e)}catch{}return t}var FK=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)}},HK=class{constructor(){this._services=new FK,this._services.set(T0,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=OV(e).sort((o,l)=>o.index-l.index),r=[];for(let o of n){let l=this._services.get(o.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${o.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)}},UK={trace:0,debug:1,info:2,warn:3,error:4,off:5},$K="xterm.js: ",Iy=class extends yt{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=UK[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?"":$K)+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)}};Iy=kn([Be(0,jr)],Iy);var CE=class extends yt{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Me),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Me),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Me),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}},vt=3,zn=Object.freeze(new Qd),$f=0,Wb=2,Ju=class HD{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*vt);let s=n||Ai.fromCharData([0,oD,1,0]);for(let o=0;o<t;++o)this.setCell(o,s);this.length=t}get(t){let n=this._data[t*vt+0],r=n&2097151;return[this._data[t*vt+1],n&2097152?this._combined[t]:r?Xo(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*vt+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*vt+0]=t|2097152|n[2]<<22):this._data[t*vt+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*vt+0]>>22}hasWidth(t){return this._data[t*vt+0]&12582912}getFg(t){return this._data[t*vt+1]}getBg(t){return this._data[t*vt+2]}hasContent(t){return this._data[t*vt+0]&4194303}getCodePoint(t){let n=this._data[t*vt+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*vt+0]&2097152}getString(t){let n=this._data[t*vt+0];return n&2097152?this._combined[t]:n&2097151?Xo(n&2097151):""}isProtected(t){return this._data[t*vt+2]&536870912}loadCell(t,n){return $f=t*vt,n.content=this._data[$f+0],n.fg=this._data[$f+1],n.bg=this._data[$f+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*vt+0]=n.content,this._data[t*vt+1]=n.fg,this._data[t*vt+2]=n.bg}setCellFromCodepoint(t,n,r,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*vt+0]=n|r<<22,this._data[t*vt+1]=s.fg,this._data[t*vt+2]=s.bg}addCodepointToCell(t,n,r){let s=this._data[t*vt+0];s&2097152?this._combined[t]+=Xo(n):s&2097151?(this._combined[t]=Xo(s&2097151)+Xo(n),s&=-2097152,s|=2097152):s=n|1<<22,r&&(s&=-12582913,s|=r<<22),this._data[t*vt+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 Ai;for(let o=this.length-t-n-1;o>=0;--o)this.setCell(t+n+o,this.loadCell(t+o,s));for(let o=0;o<n;++o)this.setCell(t+o,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 Ai;for(let o=0;o<this.length-t-n;++o)this.setCell(t+o,this.loadCell(t+n+o,s));for(let o=this.length-n;o<this.length;++o)this.setCell(o,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*Wb<this._data.buffer.byteLength;let r=t*vt;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 o=Object.keys(this._extendedAttrs);for(let l=0;l<o.length;l++){let u=parseInt(o[l],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*Wb<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Wb<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 HD(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*vt+0]&4194303)return t+(this._data[t*vt+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*vt+0]&4194303||this._data[t*vt+2]&50331648)return t+(this._data[t*vt+0]>>22);return 0}copyCellsFrom(t,n,r,s,o){let l=t._data;if(o)for(let h=s-1;h>=0;h--){for(let d=0;d<vt;d++)this._data[(r+h)*vt+d]=l[(n+h)*vt+d];l[(n+h)*vt+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}else for(let h=0;h<s;h++){for(let d=0;d<vt;d++)this._data[(r+h)*vt+d]=l[(n+h)*vt+d];l[(n+h)*vt+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}let u=Object.keys(t._combined);for(let h=0;h<u.length;h++){let d=parseInt(u[h],10);d>=n&&(this._combined[d-n+r]=t._combined[d])}}translateToString(t,n,r,s){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),s&&(s.length=0);let o="";for(;n<r;){let l=this._data[n*vt+0],u=l&2097151,h=l&2097152?this._combined[n]:u?Xo(u):Jo;if(o+=h,s)for(let d=0;d<h.length;++d)s.push(n);n+=l>>22||1}return s&&s.push(n),o}};function WK(e,t,n,r,s,o){let l=[];for(let u=0;u<e.length-1;u++){let h=u,d=e.get(++h);if(!d.isWrapped)continue;let g=[e.get(u)];for(;h<e.length&&d.isWrapped;)g.push(d),d=e.get(++h);if(!o&&r>=u&&r<h){u+=g.length-1;continue}let p=0,v=Md(g,p,t),y=1,w=0;for(;y<g.length;){let C=Md(g,y,t),k=C-w,R=n-v,E=Math.min(k,R);g[p].copyCellsFrom(g[y],w,v,E,!1),v+=E,v===n&&(p++,v=0),w+=E,w===C&&(y++,w=0),v===0&&p!==0&&g[p-1].getWidth(n-1)===2&&(g[p].copyCellsFrom(g[p-1],n-1,v++,1,!1),g[p-1].setCell(n-1,s))}g[p].replaceCells(v,n,s);let S=0;for(let C=g.length-1;C>0&&(C>p||g[C].getTrimmedLength()===0);C--)S++;S>0&&(l.push(u+g.length-S),l.push(S)),u+=g.length-1}return l}function VK(e,t){let n=[],r=0,s=t[r],o=0;for(let l=0;l<e.length;l++)if(s===l){let u=t[++r];e.onDeleteEmitter.fire({index:l-o,amount:u}),l+=u-1,o+=u,s=t[++r]}else n.push(l);return{layout:n,countRemoved:o}}function qK(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 KK(e,t,n){let r=[],s=e.map((h,d)=>Md(e,d,t)).reduce((h,d)=>h+d),o=0,l=0,u=0;for(;u<s;){if(s-u<n){r.push(s-u);break}o+=n;let h=Md(e,l,t);o>h&&(o-=h,l++);let d=e[l].getWidth(o-1)===2;d&&o--;let g=d?n-1:n;r.push(g),u+=g}return r}function Md(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 UD=class $D{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=$D._nextId++,this._onDispose=this.register(new Me),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),el(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};UD._nextId=1;var GK=UD,qn={},Pa=qn.B;qn[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:"≥","{":"π","|":"≠","}":"£","~":"·"};qn.A={"#":"£"};qn.B=void 0;qn[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};qn.C=qn[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};qn.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};qn.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};qn.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};qn.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};qn.E=qn[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};qn.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};qn.H=qn[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};qn["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var kE=4294967295,EE=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=zn.clone(),this.savedCharset=Pa,this.markers=[],this._nullCell=Ai.fromCharData([0,oD,1,0]),this._whitespaceCell=Ai.fromCharData([0,Jo,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new qm,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new CE(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 Um),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 Um),this._whitespaceCell}getBlankLine(e,t){return new Ju(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>kE?kE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=zn);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 CE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(zn),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 o=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 Ju(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new Ju(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),o&&(this.y+=o),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 o=0;o<this.lines.length;o++)r+=+this.lines.get(o).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=WK(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(zn),n);if(r.length>0){let s=VK(this.lines,r);qK(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(zn),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Ju(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(zn),s=[],o=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 h=[u];for(;u.isWrapped&&l>0;)u=this.lines.get(--l),h.unshift(u);if(!n){let E=this.ybase+this.y;if(E>=l&&E<l+h.length)continue}let d=h[h.length-1].getTrimmedLength(),g=KK(h,this._cols,e),p=g.length-h.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+p):v=Math.max(0,this.lines.length-this.lines.maxLength+p);let y=[];for(let E=0;E<p;E++){let M=this.getBlankLine(zn,!0);y.push(M)}y.length>0&&(s.push({start:l+h.length+o,newLines:y}),o+=y.length),h.push(...y);let w=g.length-1,S=g[w];S===0&&(w--,S=g[w]);let C=h.length-p-1,k=d;for(;C>=0;){let E=Math.min(k,S);if(h[w]===void 0)break;if(h[w].copyCellsFrom(h[C],k-E,S-E,E,!0),S-=E,S===0&&(w--,S=g[w]),k-=E,k===0){C--;let M=Math.max(C,0);k=Md(h,M,this._cols)}}for(let E=0;E<h.length;E++)g[E]<e&&h[E].setCell(g[E],r);let R=p-v;for(;R-- >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+o)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(s.length>0){let l=[],u=[];for(let S=0;S<this.lines.length;S++)u.push(this.lines.get(S));let h=this.lines.length,d=h-1,g=0,p=s[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let v=0;for(let S=Math.min(this.lines.maxLength-1,h+o-1);S>=0;S--)if(p&&p.start>d+v){for(let C=p.newLines.length-1;C>=0;C--)this.lines.set(S--,p.newLines[C]);S++,l.push({index:d+1,amount:p.newLines.length}),v+=p.newLines.length,p=s[++g]}else this.lines.set(S,u[d--]);let y=0;for(let S=l.length-1;S>=0;S--)l[S].index+=y,this.lines.onInsertEmitter.fire(l[S]),y+=l[S].amount;let w=Math.max(0,h+o-this.lines.maxLength);w>0&&this.lines.onTrimEmitter.fire(w)}}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 GK(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)}},YK=class extends yt{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new Me),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 EE(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new EE(!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)}},WD=2,VD=1,Fy=class extends yt{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Me),this.onResize=this._onResize.event,this._onScroll=this._register(new Me),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,WD),this.rows=Math.max(e.rawOptions.rows||0,VD),this.buffers=this._register(new YK(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,o=n.ybase+n.scrollBottom;if(n.scrollTop===0){let l=n.lines.isFull;o===n.lines.length-1?l?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(o+1,0,r.clone()),l?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let l=o-s+1;n.lines.shiftElements(s+1,l-1,-1),n.lines.set(o,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))}};Fy=kn([Be(0,jr)],Fy);var Ql={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:Vm,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},XK=["normal","bold","100","200","300","400","500","600","700","800","900"],ZK=class extends yt{constructor(e){super(),this._onOptionChange=this._register(new Me),this.onOptionChange=this._onOptionChange.event;let t={...Ql};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(fn(()=>{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 Ql))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in Ql))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=Ql[e]),!QK(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Ql[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=XK.includes(t)?t:Ql[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 QK(e){return e==="block"||e==="underline"||e==="bar"}function ed(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]&&ed(e[r],t-1);return n}var RE=Object.freeze({insertMode:!1}),TE=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Hy=class extends yt{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 Me),this.onData=this._onData.event,this._onUserInput=this._register(new Me),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Me),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Me),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ed(RE),this.decPrivateModes=ed(TE)}reset(){this.modes=ed(RE),this.decPrivateModes=ed(TE)}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))}};Hy=kn([Be(0,Dr),Be(1,dD),Be(2,jr)],Hy);var NE={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 Vb(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 qb=String.fromCharCode,ME={DEFAULT:e=>{let t=[Vb(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${qb(t[0])}${qb(t[1])}${qb(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Vb(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Vb(e,!0)};${e.x};${e.y}${t}`}},Uy=class extends yt{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 Me),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(NE))this.addProtocol(r,NE[r]);for(let r of Object.keys(ME))this.addEncoding(r,ME[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)}};Uy=kn([Be(0,Dr),Be(1,cl),Be(2,jr)],Uy);var Kb=[[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]],JK=[[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]],$n;function eG(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 tG=class{constructor(){if(this.version="6",!$n){$n=new Uint8Array(65536),$n.fill(1),$n[0]=0,$n.fill(0,1,32),$n.fill(0,127,160),$n.fill(2,4352,4448),$n[9001]=2,$n[9002]=2,$n.fill(2,11904,42192),$n[12351]=1,$n.fill(2,44032,55204),$n.fill(2,63744,64256),$n.fill(2,65040,65050),$n.fill(2,65072,65136),$n.fill(2,65280,65377),$n.fill(2,65504,65511);for(let e=0;e<Kb.length;++e)$n.fill(0,Kb[e][0],Kb[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?$n[e]:eG(e,JK)?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=Wa.extractWidth(t);s===0?r=!1:s>n&&(n=s)}return Wa.createPropertyValue(0,n,r)}},Wa=class gm{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Me,this.onChange=this._onChange.event;let t=new tG;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 o=0;o<s;++o){let l=t.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=s)return n+this.wcwidth(l);let d=t.charCodeAt(o);56320<=d&&d<=57343?l=(l-55296)*1024+d-56320+65536:n+=this.wcwidth(d)}let u=this.charProperties(l,r),h=gm.extractWidth(u);gm.extractShouldJoin(u)&&(h-=gm.extractWidth(r)),n+=h,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},nG=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 AE(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 Bu=2147483647,rG=256,qD=class $y{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>rG)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 $y;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 o=0;o<s.length;++o)n.addSubParam(s[o]);else n.addParam(s)}return n}clone(){let t=new $y(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>Bu?Bu: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>Bu?Bu: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,Bu):t}},Iu=[],iG=class{constructor(){this._state=0,this._active=Iu,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=Iu}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=Iu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Iu,!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",Ip(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=Iu,this._id=-1,this._state=0}}},ti=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+=Ip(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}},Fu=[],sG=class{constructor(){this._handlers=Object.create(null),this._active=Fu,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Fu}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=Fu,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Fu,!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",Ip(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=Fu,this._ident=0}},td=new qD;td.addParam(0);var DE=class{constructor(e){this._handler=e,this._data="",this._params=td,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():td,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Ip(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=td,this._data="",this._hitLimit=!1,n));return this._params=td,this._data="",this._hitLimit=!1,t}},oG=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}},Ri=160,aG=function(){let e=new oG(4095),t=Array.apply(null,Array(256)).map((u,h)=>h),n=(u,h)=>t.slice(u,h),r=n(32,127),s=n(0,24);s.push(25),s.push.apply(s,n(28,32));let o=n(0,14),l;e.setDefault(1,0),e.addMany(r,0,2,0);for(l in o)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(Ri,0,2,0),e.add(Ri,8,5,8),e.add(Ri,6,0,6),e.add(Ri,11,0,11),e.add(Ri,13,13,13),e}(),lG=class extends yt{constructor(e=aG){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 qD,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(fn(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new iG),this._dcsParser=this._register(new sG),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 o=e.intermediates.charCodeAt(s);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=o}}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,o=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=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,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,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,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=o;u<t;++u){switch(r=e[u],s=this._transitions.table[this.currentState<<8|(r<160?r:Ri)],s>>4){case 2:for(let v=u+1;;++v){if(v>=t||(r=e[v])<32||r>126&&r<Ri){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Ri){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Ri){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Ri){this._printHandler(e,u,v),u=v-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 h=this._csiHandlers[this._collect<<8|r],d=h?h.length-1:-1;for(;d>=0&&(l=h[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._preserveStack(3,h,d,s,u),l;d<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 g=this._escHandlers[this._collect<<8|r],p=g?g.length-1:-1;for(;p>=0&&(l=g[p](),l!==!0);p--)if(l instanceof Promise)return this._preserveStack(4,g,p,s,u),l;p<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 v=u+1;;++v)if(v>=t||(r=e[v])===24||r===26||r===27||r>127&&r<Ri){this._dcsParser.put(e,u,v),u=v-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 v=u+1;;v++)if(v>=t||(r=e[v])<32||r>127&&r<Ri){this._oscParser.put(e,u,v),u=v-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}}},cG=/^([\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})$/,uG=/^[\da-f]+$/;function jE(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=cG.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),uG.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 o=parseInt(t.slice(n*s,n*s+n),16);r[s]=n===1?o<<4:n===2?o:n===3?o>>4:o>>8}return r}}function Gb(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 dG(e,t=16){let[n,r,s]=e;return`rgb:${Gb(n,t)}/${Gb(r,t)}/${Gb(s,t)}`}var hG={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Vo=131072,OE=10;function LE(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 zE=5e3,PE=0,fG=class extends yt{constructor(e,t,n,r,s,o,l,u,h=new lG){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=s,this._oscLinkService=o,this._coreMouseService=l,this._unicodeService=u,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new DV,this._utf8Decoder=new jV,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=zn.clone(),this._eraseAttrDataInternal=zn.clone(),this._onRequestBell=this._register(new Me),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Me),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Me),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Me),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Me),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Me),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Me),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Me),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Me),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Me),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Me),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Me),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Me),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 Wy(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:g.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,g,p)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:g,data:p})}),this._parser.setDcsHandlerFallback((d,g,p)=>{g==="HOOK"&&(p=p.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:g,payload:p})}),this._parser.setPrintHandler((d,g,p)=>this.print(d,g,p)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(ye.BEL,()=>this.bell()),this._parser.setExecuteHandler(ye.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ye.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ye.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ye.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ye.BS,()=>this.backspace()),this._parser.setExecuteHandler(ye.HT,()=>this.tab()),this._parser.setExecuteHandler(ye.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ye.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(mm.IND,()=>this.index()),this._parser.setExecuteHandler(mm.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(mm.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new ti(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new ti(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new ti(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new ti(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new ti(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new ti(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new ti(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new ti(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new ti(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new ti(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new ti(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new ti(d=>this.restoreCursorColor(d))),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 d in qn)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new DE((d,g)=>this.requestStatusString(d,g)))}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"),zE))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${zE} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,s=this._activeBuffer.y,o=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>Vo&&(o=this._parseStack.position+Vo)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Vo&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Vo))),l||this._dirtyRowTracker.clearRange(),e.length>Vo)for(let d=o;d<e.length;d+=Vo){let g=d+Vo<e.length?d+Vo:e.length,p=typeof e=="string"?this._stringDecoder.decode(e.substring(d,g),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,g),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,p))return this._preserveStack(r,s,p,d),this._logSlowResolvingAsync(n),n}else if(!l){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,d))return this._preserveStack(r,s,d,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),h=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,t,n){let r,s,o=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,g=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let v=this._parser.precedingJoinState;for(let y=t;y<n;++y){if(r=e[y],r<127&&o){let k=o[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let w=this._unicodeService.charProperties(r,v);s=Wa.extractWidth(w);let S=Wa.extractShouldJoin(w),C=S?Wa.extractWidth(v):0;if(v=w,l&&this._onA11yChar.fire(Xo(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(h){let k=p,R=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),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&p instanceof Ju&&p.copyCellsFrom(k,R,0,C,!1);R<u;)k.setCellFromCodepoint(R++,0,1,g)}else if(this._activeBuffer.x=u-1,s===2)continue}if(S&&this._activeBuffer.x){let k=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-k,r,s);for(let R=s-C;--R>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(d&&(p.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(g)),p.getWidth(u-1)===2&&p.setCellFromCodepoint(u-1,0,1,g)),p.setCellFromCodepoint(this._activeBuffer.x++,r,s,g),s>0)for(;--s;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=v,this._activeBuffer.x<u&&n-t>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>LE(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new DE(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new ti(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 o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),r&&(o.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(zn));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=Wa.extractWidth(t),s=this._activeBuffer.x-r,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),l=new Uint32Array(o.length*n),u=0;for(let d=0;d<o.length;){let g=o.codePointAt(d)||0;l[u++]=g,d+=g>65535?2:1}let h=u;for(let d=1;d<n;++d)l.copyWithin(h,0,u),h+=u;return this.print(l,0,h),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ye.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ye.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ye.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ye.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ye.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,Pa),this._charsetService.setgCharset(1,Pa),this._charsetService.setgCharset(2,Pa),this._charsetService.setgCharset(3,Pa);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){(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:o}=this._coreMouseService,l=this._coreService,{buffers:u,cols:h}=this._bufferService,{active:d,alt:g}=u,p=this._optionsService.rawOptions,v=(S,C)=>(l.triggerDataEvent(`${ye.ESC}[${t?"":"?"}${S};${C}$y`),!0),y=S=>S?1:2,w=e.params[0];return t?w===2?v(w,4):w===4?v(w,y(l.modes.insertMode)):w===12?v(w,3):w===20?v(w,y(p.convertEol)):v(w,0):w===1?v(w,y(r.applicationCursorKeys)):w===3?v(w,p.windowOptions.setWinLines?h===80?2:h===132?1:0:0):w===6?v(w,y(r.origin)):w===7?v(w,y(r.wraparound)):w===8?v(w,3):w===9?v(w,y(s==="X10")):w===12?v(w,y(p.cursorBlink)):w===25?v(w,y(!l.isCursorHidden)):w===45?v(w,y(r.reverseWraparound)):w===66?v(w,y(r.applicationKeypad)):w===67?v(w,4):w===1e3?v(w,y(s==="VT200")):w===1002?v(w,y(s==="DRAG")):w===1003?v(w,y(s==="ANY")):w===1004?v(w,y(r.sendFocus)):w===1005?v(w,4):w===1006?v(w,y(o==="SGR")):w===1015?v(w,4):w===1016?v(w,y(o==="SGR_PIXELS")):w===1048?v(w,1):w===47||w===1047||w===1049?v(w,y(d===g)):w===2004?v(w,y(r.bracketedPasteMode)):w===2026?v(w,y(r.synchronizedOutput)):v(w,0)}_updateAttrColor(e,t,n,r,s){return t===2?(e|=50331648,e&=-16777216,e|=Qd.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,o=0;do{if(r[o+s]=e.params[t+o],e.hasSubParams(t+o)){let l=e.getSubParams(t+o),u=0;do r[1]===5&&(s=1),r[o+u+1+s]=l[u];while(++u<l.length&&u+o+1+s<r.length);break}if(r[1]===5&&o+s>=2||r[1]===2&&o+s>=5)break;r[1]&&(s=1)}while(++o+t<e.length&&o+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 o}_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=zn.fg,e.bg=zn.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|=zn.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=zn.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|=zn.fg&16777215,r.bg&=-67108864,r.bg|=zn.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ye.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ye.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(`${ye.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=zn.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(!LE(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(`${ye.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>OE&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>OE&&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 o=parseInt(r);if(BE(o))if(s==="?")t.push({type:0,index:o});else{let l=jE(s);l&&t.push({type:1,index:o,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(o=>o.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=jE(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]);BE(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,Pa),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(hG[e[0]],qn[e[1]]||Pa),!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=zn.clone(),this._eraseAttrDataInternal=zn.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 Ai;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(`${ye.ESC}${l}${ye.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)}},Wy=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&&(PE=e,e=t,t=PE),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Wy=kn([Be(0,Dr)],Wy);function BE(e){return 0<=e&&e<256}var mG=5e7,IE=12,pG=50,gG=class extends yt{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 Me),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>mG)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>=IE?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(l);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=IE)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>pG&&(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()}},Vy=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),h={data:e,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(h,u)),this._dataByLinkId.set(h.id,h),h.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 o=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(l,o)),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)))}};Vy=kn([Be(0,Dr)],Vy);var FE=!1,vG=class extends yt{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new xc),this._onBinary=this._register(new Me),this.onBinary=this._onBinary.event,this._onData=this._register(new Me),this.onData=this._onData.event,this._onLineFeed=this._register(new Me),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Me),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Me),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Me),this._instantiationService=new HK,this.optionsService=this._register(new ZK(e)),this._instantiationService.setService(jr,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Fy)),this._instantiationService.setService(Dr,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Iy)),this._instantiationService.setService(dD,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Hy)),this._instantiationService.setService(cl,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Uy)),this._instantiationService.setService(uD,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Wa)),this._instantiationService.setService(PV,this.unicodeService),this._charsetService=this._instantiationService.createInstance(nG),this._instantiationService.setService(zV,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Vy),this._instantiationService.setService(hD,this._oscLinkService),this._inputHandler=this._register(new fG(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(pr.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(pr.forward(this._bufferService.onResize,this._onResize)),this._register(pr.forward(this.coreService.onData,this._onData)),this._register(pr.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 gG((t,n)=>this._inputHandler.parse(t,n))),this._register(pr.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Me),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&&!FE&&(this._logService.warn("writeSync is unreliable and will be removed soon."),FE=!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,WD),t=Math.max(t,VD),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(AE.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(AE(this._bufferService),!1))),this._windowsWrappingHeuristics.value=fn(()=>{for(let t of e)t.dispose()})}}},bG={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 _G(e,t,n,r){var l;let s={type:0,cancel:!1,key:void 0},o=(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=ye.ESC+"OA":s.key=ye.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=ye.ESC+"OD":s.key=ye.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=ye.ESC+"OC":s.key=ye.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=ye.ESC+"OB":s.key=ye.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":ye.DEL,e.altKey&&(s.key=ye.ESC+s.key);break;case 9:if(e.shiftKey){s.key=ye.ESC+"[Z";break}s.key=ye.HT,s.cancel=!0;break;case 13:s.key=e.altKey?ye.ESC+ye.CR:ye.CR,s.cancel=!0;break;case 27:s.key=ye.ESC,e.altKey&&(s.key=ye.ESC+ye.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;o?s.key=ye.ESC+"[1;"+(o+1)+"D":t?s.key=ye.ESC+"OD":s.key=ye.ESC+"[D";break;case 39:if(e.metaKey)break;o?s.key=ye.ESC+"[1;"+(o+1)+"C":t?s.key=ye.ESC+"OC":s.key=ye.ESC+"[C";break;case 38:if(e.metaKey)break;o?s.key=ye.ESC+"[1;"+(o+1)+"A":t?s.key=ye.ESC+"OA":s.key=ye.ESC+"[A";break;case 40:if(e.metaKey)break;o?s.key=ye.ESC+"[1;"+(o+1)+"B":t?s.key=ye.ESC+"OB":s.key=ye.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=ye.ESC+"[2~");break;case 46:o?s.key=ye.ESC+"[3;"+(o+1)+"~":s.key=ye.ESC+"[3~";break;case 36:o?s.key=ye.ESC+"[1;"+(o+1)+"H":t?s.key=ye.ESC+"OH":s.key=ye.ESC+"[H";break;case 35:o?s.key=ye.ESC+"[1;"+(o+1)+"F":t?s.key=ye.ESC+"OF":s.key=ye.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=ye.ESC+"[5;"+(o+1)+"~":s.key=ye.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=ye.ESC+"[6;"+(o+1)+"~":s.key=ye.ESC+"[6~";break;case 112:o?s.key=ye.ESC+"[1;"+(o+1)+"P":s.key=ye.ESC+"OP";break;case 113:o?s.key=ye.ESC+"[1;"+(o+1)+"Q":s.key=ye.ESC+"OQ";break;case 114:o?s.key=ye.ESC+"[1;"+(o+1)+"R":s.key=ye.ESC+"OR";break;case 115:o?s.key=ye.ESC+"[1;"+(o+1)+"S":s.key=ye.ESC+"OS";break;case 116:o?s.key=ye.ESC+"[15;"+(o+1)+"~":s.key=ye.ESC+"[15~";break;case 117:o?s.key=ye.ESC+"[17;"+(o+1)+"~":s.key=ye.ESC+"[17~";break;case 118:o?s.key=ye.ESC+"[18;"+(o+1)+"~":s.key=ye.ESC+"[18~";break;case 119:o?s.key=ye.ESC+"[19;"+(o+1)+"~":s.key=ye.ESC+"[19~";break;case 120:o?s.key=ye.ESC+"[20;"+(o+1)+"~":s.key=ye.ESC+"[20~";break;case 121:o?s.key=ye.ESC+"[21;"+(o+1)+"~":s.key=ye.ESC+"[21~";break;case 122:o?s.key=ye.ESC+"[23;"+(o+1)+"~":s.key=ye.ESC+"[23~";break;case 123:o?s.key=ye.ESC+"[24;"+(o+1)+"~":s.key=ye.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=ye.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=ye.DEL:e.keyCode===219?s.key=ye.ESC:e.keyCode===220?s.key=ye.FS:e.keyCode===221&&(s.key=ye.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(l=bG[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(u)s.key=ye.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,d=String.fromCharCode(h);e.shiftKey&&(d=d.toUpperCase()),s.key=ye.ESC+d}else if(e.keyCode===32)s.key=ye.ESC+(e.ctrlKey?ye.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),s.key=ye.ESC+h,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=ye.US),e.key==="@"&&(s.key=ye.NUL));break}return s}var Tn=0,yG=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new qm,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new qm,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,o)=>this._getKey(s)-this._getKey(o)),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||(Tn=this._search(t),Tn===-1)||this._getKey(this._array[Tn])!==t)return!1;do if(this._array[Tn]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Tn),!0;while(++Tn<this._array.length&&this._getKey(this._array[Tn])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,o)=>s-o),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&&(Tn=this._search(e),!(Tn<0||Tn>=this._array.length)&&this._getKey(this._array[Tn])===e))do yield this._array[Tn];while(++Tn<this._array.length&&this._getKey(this._array[Tn])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Tn=this._search(e),!(Tn<0||Tn>=this._array.length)&&this._getKey(this._array[Tn])===e))do t(this._array[Tn]);while(++Tn<this._array.length&&this._getKey(this._array[Tn])===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}},Yb=0,HE=0,xG=class extends yt{constructor(){super(),this._decorations=new yG(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new Me),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Me),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(fn(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new wG(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 o of this._decorations.getKeyIterator(t))r=o.options.x??0,s=r+(o.options.width??1),e>=r&&e<s&&(!n||(o.options.layer??"bottom")===n)&&(yield o)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,s=>{Yb=s.options.x??0,HE=Yb+(s.options.width??1),e>=Yb&&e<HE&&(!n||(s.options.layer??"bottom")===n)&&r(s)})}},wG=class extends ta{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Me),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Me),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=vn.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=vn.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},SG=1e3,CG=class{constructor(e,t=SG){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,o=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_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)}},UE=20,Km=class extends yt{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 o=0;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);if(this._topBoundaryFocusListener=o=>this._handleBoundaryFocus(o,0),this._bottomBoundaryFocusListener=o=>this._handleBoundaryFocus(o,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 CG(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(o=>this._handleResize(o.rows))),this._register(this._terminal.onRender(o=>this._refreshRows(o.start,o.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(o=>this._handleChar(o))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
540
|
+
`))),this._register(this._terminal.onA11yTab(o=>this._handleTab(o))),this._register(this._terminal.onKey(o=>this._handleKey(o.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(rt(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(fn(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<UE+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
541
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===UE+1&&(this._liveRegion.textContent+=dy.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 o=n.lines.get(n.ydisp+s),l=[],u=(o==null?void 0:o.translateToString(!0,void 0,void 0,l))||"",h=(n.ydisp+s+1).toString(),d=this._rowElements[s];d&&(u.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=u,this._rowColumns.set(d,l)),d.setAttribute("aria-posinset",h),d.setAttribute("aria-setsize",r),this._alignRowWidth(d))}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"),o=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===o||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 h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}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:h,offset:d})=>{let g=h instanceof Text?h.parentNode:h,p=parseInt(g==null?void 0:g.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(g);if(!v)return console.warn("columns is null. Race condition?"),null;let y=d<v.length?v[d]:v.slice(-1)[0]+1;return y>=this._terminal.cols&&(++p,y=0),{row:p,column:y}},o=s(t),l=s(n);if(!(!o||!l)){if(o.row>l.row||o.row===l.row&&o.column>=l.column)throw new Error("invalid range");this._terminal.select(o.column,o.row,(l.row-o.row)*this._terminal.cols-o.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,o;e.style.transform="";let t=e.getBoundingClientRect().width,n=(o=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:o[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};Km=kn([Be(1,T0),Be(2,lo),Be(3,co)],Km);var qy=class extends yt{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 Me),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Me),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(fn(()=>{var o;el(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(o=this._activeProviderReplies)==null||o.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(rt(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(rt(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(rt(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(rt(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(o=>{o==null||o.forEach(l=>{l.link.dispose&&l.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[o,l]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(o)&&(n=this._checkLinkProviderResult(o,e,n)):l.provideLinks(e.y,u=>{var d,g;if(this._isMouseOut)return;let h=u==null?void 0:u.map(p=>({link:p}));(d=this._activeProviderReplies)==null||d.set(o,h),n=this._checkLinkProviderResult(o,e,n),((g=this._activeProviderReplies)==null?void 0:g.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 o=0;o<s.length;o++){let l=s[o],u=l.link.range.start.y<e?0:l.link.range.start.x,h=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let d=u;d<=h;d++){if(n.has(d)){s.splice(o--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,t,n){var o;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=(o=this._activeProviderReplies.get(l))==null?void 0:o.find(h=>this._linkAtPosition(h.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&&kG(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,el(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,o;(r=this._currentLink)!=null&&r.state&&((o=(s=this._currentLink)==null?void 0:s.state)==null?void 0:o.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 o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._askForLink(o,!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}}};qy=kn([Be(1,N0),Be(2,co),Be(3,Dr),Be(4,mD)],qy);function kG(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 EG=class extends vG{constructor(e={}){super(e),this._linkifier=this._register(new xc),this.browser=jD,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new xc),this._onCursorMove=this._register(new Me),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Me),this.onKey=this._onKey.event,this._onRender=this._register(new Me),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Me),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Me),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Me),this.onBell=this._onBell.event,this._onFocus=this._register(new Me),this._onBlur=this._register(new Me),this._onA11yCharEmitter=this._register(new Me),this._onA11yTabEmitter=this._register(new Me),this._onWillOpen=this._register(new Me),this._setup(),this._decorationService=this._instantiationService.createInstance(xG),this._instantiationService.setService(Jd,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(pK),this._instantiationService.setService(mD,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(fy)),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(pr.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(pr.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(pr.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(pr.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(fn(()=>{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=un.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ye.ESC}]${r};${dG(s)}${AD.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(o=>o.ansi[t.index]=Bn.toColor(...t.color));else{let o=n;this._themeService.modifyColors(l=>l[o]=Bn.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(Km,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ye.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(ye.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),o=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=o+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(rt(this.element,"copy",t=>{this.hasSelection()&&MV(t,this._selectionService)}));let e=t=>AV(t,this.textarea,this.coreService,this.optionsService);this._register(rt(this.textarea,"paste",e)),this._register(rt(this.element,"paste",e)),OD?this._register(rt(this.element,"mousedown",t=>{t.button===2&&Q2(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(rt(this.element,"contextmenu",t=>{Q2(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),P0&&this._register(rt(this.element,"auxclick",t=>{t.button===1&&sD(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(rt(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(rt(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(rt(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(rt(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(rt(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(rt(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(rt(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(rt(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),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",uy.get()),PD||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(fK,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(lo,this._coreBrowserService),this._register(rt(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(rt(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Oy,this._document,this._helperContainer),this._instantiationService.setService(Fp,this._charSizeService),this._themeService=this._instantiationService.createInstance(By),this._instantiationService.setService(Oc,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Wm),this._instantiationService.setService(fD,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(zy,this.rows,this.screenElement)),this._instantiationService.setService(co,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Ay,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Ly),this._instantiationService.setService(N0,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(qy,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(Ny,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Py,this.element,this.screenElement,r)),this._instantiationService.setService(IV,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(pr.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var o;this._selectionService.refresh(),(o=this._viewport)==null||o.queueSync()})),this._register(this._instantiationService.createInstance(My,this.screenElement)),this._register(rt(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),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(Km,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance($m,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance($m,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(jy,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(o){var d,g,p,v,y;let l=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!l)return!1;let u,h;switch(o.overrideType||o.type){case"mousemove":h=32,o.buttons===void 0?(u=3,o.button!==void 0&&(u=o.button<3?o.button:3)):u=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":h=0,u=o.button<3?o.button:3;break;case"mousedown":h=1,u=o.button<3?o.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(o)===!1)return!1;let w=o.deltaY;if(w===0||e.coreMouseService.consumeWheelEvent(o,(v=(p=(g=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:g.device)==null?void 0:p.cell)==null?void 0:v.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;h=w<0?0:1,u=4;break;default:return!1}return h===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:h,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:o=>(n(o),o.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(o)),wheel:o=>(n(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&n(o)},mousemove:o=>{o.buttons||n(o)}};this._register(this.coreMouseService.onProtocolChange(o=>{o?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(o)),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()),o&8?r.mousemove||(t.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),o&16?r.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),o&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),o&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(rt(t,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return n(o),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(o)})),this._register(rt(t,"wheel",o=>{var l,u,h,d,g;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(o)===!1)return!1;if(!this.buffer.hasScrollback){if(o.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(o,(d=(h=(u=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:u.device)==null?void 0:h.cell)==null?void 0:d.height,(g=e._coreBrowserService)==null?void 0:g.dpr)===0)return this.cancel(o,!0);let p=ye.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(o.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(p,!0),this.cancel(o,!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){iD(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=_G(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===ye.ETX||n.key===ye.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)&&(RG(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(zn));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(ye.ESC+"[I"):this.coreService.triggerDataEvent(ye.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(`${ye.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(`${ye.ESC}[6;${s};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function RG(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var TG=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)}},NG=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 Ai)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},$E=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 NG(t)}getNullCell(){return new Ai}},MG=class extends yt{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Me),this.onBufferChange=this._onBufferChange.event,this._normal=new $E(this._core.buffers.normal,"normal"),this._alternate=new $E(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)}},AG=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)}},DG=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}},jG=["cols","rows"],is=0,OG=class extends yt{constructor(e){super(),this._core=this._register(new EG(e)),this._addonManager=this._register(new TG),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(jG.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 AG(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new DG(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 MG(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
|
|
542
|
+
`,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 uy.get()},set promptLabel(e){uy.set(e)},get tooMuchOutput(){return dy.get()},set tooMuchOutput(e){dy.set(e)}}}_verifyIntegers(...e){for(is of e)if(is===1/0||isNaN(is)||is%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(is of e)if(is&&(is===1/0||isNaN(is)||is%1!==0||is<0))throw new Error("This API only accepts positive integers")}};const WE="lever-theme",Xb="20260330",LG={light:`/manifest.webmanifest?v=${Xb}`,dark:`/manifest-dark.webmanifest?v=${Xb}`,custom:`/manifest-dark.webmanifest?v=${Xb}`},KD=b.createContext(void 0),zG=e=>e==="light"||e==="dark"||e==="system"||e==="custom",Fa=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",VE=(e,t)=>{if(typeof document>"u")return;let n;e==="custom"?n=t==="system"||!t?Fa():t:n=e==="system"?Fa():e,document.documentElement.classList.toggle("dark",n==="dark")},qE=e=>{if(typeof document>"u")return;document.documentElement.style.colorScheme=e;const t=document.querySelector('meta[name="theme-color"]');if(t){const s=getComputedStyle(document.body).backgroundColor;s&&s!=="rgba(0, 0, 0, 0)"&&s!=="transparent"&&t.setAttribute("content",s)}const n=document.querySelector('link[rel="manifest"]#app-manifest'),r=LG[e];n&&n.getAttribute("href")!==r&&n.setAttribute("href",r)};function PG({children:e}){const t=bn(g=>g.themePreference),n=bn(g=>g.setThemePreference),r=bn(g=>g.colorTheme),s=bn(g=>g.customAppearance),o=bn(g=>g.backgroundImage),l=bn(g=>g.backgroundOpacity),u=bn(g=>g.backgroundBlur);b.useEffect(()=>{if(typeof window>"u")return;const g=window.localStorage.getItem(WE);zG(g)&&(bn.getState().themePreference==="system"&&g!=="system"&&n(g),window.localStorage.removeItem(WE))},[]),b.useEffect(()=>{VE(t,s);const g=t==="custom"?s==="system"?Fa():s:t==="system"?Fa():t;qE(g)},[t,s]),b.useEffect(()=>{if(t!=="system"&&(t!=="custom"||s!=="system"))return;const g=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>{VE(t,s),qE(Fa())};return g.addEventListener?(g.addEventListener("change",p),()=>g.removeEventListener("change",p)):(g.addListener(p),()=>g.removeListener(p))},[t,s]),b.useEffect(()=>{typeof document>"u"||(t==="custom"?document.documentElement.setAttribute("data-theme",r):document.documentElement.removeAttribute("data-theme"))},[t,r]),b.useEffect(()=>{if(typeof document>"u")return;let g=document.getElementById("kaizen-custom-theme-styles");g||(g=document.createElement("style"),g.id="kaizen-custom-theme-styles",document.head.appendChild(g));const p=t==="custom"&&o&&o.trim()!=="",v=[];if(p){const y=u?u*2:0;v.push(`
|
|
543
|
+
body {
|
|
544
|
+
background-image: none !important;
|
|
545
|
+
background-color: transparent !important;
|
|
546
|
+
}
|
|
547
|
+
body::before {
|
|
548
|
+
content: "";
|
|
549
|
+
position: fixed;
|
|
550
|
+
top: -${y}px;
|
|
551
|
+
left: -${y}px;
|
|
552
|
+
right: -${y}px;
|
|
553
|
+
bottom: -${y}px;
|
|
554
|
+
background-image: url("${o}");
|
|
555
|
+
background-size: cover;
|
|
556
|
+
background-position: center;
|
|
557
|
+
filter: blur(${u}px);
|
|
558
|
+
z-index: -2;
|
|
559
|
+
pointer-events: none;
|
|
560
|
+
}
|
|
561
|
+
body::after {
|
|
562
|
+
content: "";
|
|
563
|
+
position: fixed;
|
|
564
|
+
inset: 0;
|
|
565
|
+
background-color: hsl(var(--background) / ${l});
|
|
566
|
+
z-index: -1;
|
|
567
|
+
pointer-events: none;
|
|
568
|
+
}
|
|
569
|
+
#root {
|
|
570
|
+
background-color: transparent !important;
|
|
571
|
+
}
|
|
572
|
+
:root {
|
|
573
|
+
--color-background: transparent !important;
|
|
574
|
+
--color-card: hsl(var(--card) / 0.15) !important;
|
|
575
|
+
--color-popover: hsl(var(--popover) / 0.8) !important;
|
|
576
|
+
--color-muted: hsl(var(--muted) / 0.25) !important;
|
|
577
|
+
}
|
|
578
|
+
.kaizen-terminal, .xterm-viewport, .xterm-screen {
|
|
579
|
+
background-color: transparent !important;
|
|
580
|
+
}
|
|
581
|
+
`)}else v.push(`
|
|
582
|
+
body {
|
|
583
|
+
background-image: none !important;
|
|
584
|
+
}
|
|
585
|
+
body::before {
|
|
586
|
+
display: none;
|
|
587
|
+
}
|
|
588
|
+
#root {
|
|
589
|
+
background-color: transparent;
|
|
590
|
+
}
|
|
591
|
+
`);g.textContent=v.join(`
|
|
592
|
+
`)},[t,o,l,u]);const h=g=>{n(g)},d=b.useMemo(()=>{const g=t==="custom"?s==="system"?Fa():s:t==="system"?Fa():t;return{theme:t,resolvedTheme:g,setTheme:h}},[t,s,n]);return f.jsx(KD.Provider,{value:d,children:e})}function GD(){const e=b.useContext(KD);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const BG={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"},IG={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 YD(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function XD(e,t){var w,S,C,k,R;const n=e.element,r=(k=(C=(S=(w=e._core)==null?void 0:w._renderService)==null?void 0:S.dimensions)==null?void 0:C.css)==null?void 0:k.cell,s=(r==null?void 0:r.width)??0,o=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(s)||!Number.isFinite(o)||s<=0||o<=0)return null;const l=t.getBoundingClientRect(),u=window.getComputedStyle(t),h=window.getComputedStyle(n),d=e.options.scrollback===0?0:((R=e.options.overviewRuler)==null?void 0:R.width)??14,g=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight)+parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),p=parseFloat(u.paddingTop)+parseFloat(u.paddingBottom)+parseFloat(h.paddingTop)+parseFloat(h.paddingBottom),v=Math.max(0,l.width-g-d-1),y=Math.max(0,l.height-p);return{cols:Math.max(2,Math.floor(v/s)),rows:Math.max(1,Math.floor(y/o))}}function Wf(e){e.refresh(0,Math.max(0,e.rows-1))}function Vf(e,t,n,r,s){const o=XD(e,t)??YD(e);return n.current&&n.current.cols===o.cols&&n.current.rows===o.rows||(e.resize(o.cols,o.rows),n.current=o,r&&s(o.cols,o.rows)),o}function FG({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:s,clearVersion:o=0,focusRequestVersion:l=0,onPathChange:u}){const{resolvedTheme:h}=GD(),d=b.useRef(null),g=b.useRef(null),p=b.useRef(null),v=b.useRef(!1),y=b.useRef(0),w=b.useRef(null),S=b.useRef(null),[C,k]=b.useState(null),[R,E]=b.useState(null),M=h==="dark"?IG:BG,L=(D,H)=>{n.command({type:"terminal.resize",terminalId:t,cols:D,rows:H}).catch(()=>{})},j=()=>{const D=()=>{const H=g.current,G=d.current;!H||!G||!v.current||Vf(H,G,S,!0,L)};requestAnimationFrame(()=>{D(),setTimeout(D,0)})};return b.useEffect(()=>{const D=new OG({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 bV;D.loadAddon(H),D.loadAddon(new kV),g.current=D;const G=d.current;G&&(D.open(G),p.current&&D.write(p.current),Vf(D,G,S,!1,()=>{}),Wf(D),j());const I=D.onData(W=>{n.command({type:"terminal.input",terminalId:t,data:W}).catch(F=>{E(F instanceof Error?F.message:String(F))})}),q=D.onResize(({cols:W,rows:F})=>{if(!v.current)return;const V={cols:W,rows:F};S.current&&S.current.cols===W&&S.current.rows===F||(S.current=V,L(W,F))}),B=new ResizeObserver(()=>{const W=g.current,F=d.current;!W||!F||Vf(W,F,S,v.current,(V,O)=>{n.command({type:"terminal.resize",terminalId:t,cols:V,rows:O}).catch(()=>{})})});return G&&B.observe(G),()=>{B.disconnect(),q.dispose(),I.dispose(),p.current=H.serialize(),D.dispose(),g.current=null}},[r,n,t,M]),b.useEffect(()=>{const D=g.current;D&&(D.options.scrollback=r)},[r]),b.useEffect(()=>{const D=g.current;D&&(D.options.theme=M,Wf(D))},[M]),b.useEffect(()=>{if(l===0)return;const D=g.current;D&&requestAnimationFrame(()=>{D.focus()})},[l]),b.useEffect(()=>{if(o===0)return;const D=g.current;D&&(v.current=!1,y.current+=1,w.current=null,p.current=null,k(null),E(null),D.reset(),Wf(D),n.command({type:"terminal.close",terminalId:t}).catch(H=>{E(H instanceof Error?H.message:String(H))}))},[o,n,t]),b.useEffect(()=>{u==null||u((C==null?void 0:C.cwd)??null)},[C==null?void 0:C.cwd,u]),b.useEffect(()=>{const D=I=>{const q=g.current;if(!q)return;const B=JSON.stringify({cwd:I.cwd,shell:I.shell,cols:I.cols,rows:I.rows,scrollback:I.scrollback,status:I.status,exitCode:I.exitCode,serializedState:I.serializedState});if(w.current===B){k({cwd:I.cwd,shell:I.shell,status:I.status,exitCode:I.exitCode}),p.current=I.serializedState||null;return}w.current=B,k({cwd:I.cwd,shell:I.shell,status:I.status,exitCode:I.exitCode}),p.current=I.serializedState||null,q.options.scrollback=I.scrollback,q.reset(),I.serializedState&&q.write(I.serializedState),Wf(q)},H=()=>{const I=g.current,q=d.current;if(!I||!q)return;const B=XD(I,q)??YD(I);I.resize(B.cols,B.rows),S.current=B,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:B.cols,rows:B.rows,scrollback:r}).then(W=>{v.current=!0,E(null),W&&D(W),j()}).catch(W=>{E(W instanceof Error?W.message:String(W))})},G=()=>{const I=++y.current,q=()=>{if(y.current!==I)return;const B=g.current,W=d.current;if(!B||!W)return;Vf(B,W,S,!1,()=>{});const F=W.getBoundingClientRect();if(F.width<=0||F.height<=0){requestAnimationFrame(q);return}H()};requestAnimationFrame(()=>{requestAnimationFrame(q)})};return G(),n.subscribeTerminal(t,{onSnapshot:I=>{if(!I){v.current=!1,w.current=null,s==="connected"&&G();return}v.current=!0,E(null),D(I),j()},onEvent:I=>{const q=g.current;if(q){if(I.type==="terminal.output"){q.write(I.data);return}I.type==="terminal.exit"&&k(B=>({cwd:(B==null?void 0:B.cwd)??"",shell:(B==null?void 0:B.shell)??"",status:"exited",exitCode:I.exitCode}))}}})},[s,e,r,n,t]),f.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden pb-4",children:[f.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden px-3 py-1",children:f.jsx("div",{ref:d,className:"kaizen-terminal min-h-0 min-w-0 flex-1 overflow-hidden w-full"})}),R?f.jsxs("div",{className:"px-3 py-1 text-xs text-destructive",children:["Terminal error: ",R]}):null]})}const HG=24;function ZD(e){return e+HG}function UG(e,t){return Math.max(1,e)*ZD(t)}function KE({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:s,minColumnWidth:o,focusRequestVersion:l=0,splitTerminalShortcut:u,onAddTerminal:h,onRemoveTerminal:d,onTerminalLayout:g}){const p=b.useRef(null),v=b.useRef({}),y=b.useRef([]),[w,S]=b.useState(0),[C,k]=b.useState({}),[R,E]=b.useState({});b.useLayoutEffect(()=>{const G=p.current;if(!G)return;const I=()=>{S(G.getBoundingClientRect().width)},q=new ResizeObserver(I);return q.observe(G),I(),()=>q.disconnect()},[]);const M=t.terminals.length,L=ZD(o),j=UG(M,o),D=Math.max(w,j),H=b.useMemo(()=>t.terminals.map(G=>G.id).join(":"),[t.terminals]);return b.useLayoutEffect(()=>{const G=y.current,I=t.terminals.map(W=>W.id),q=I.find(W=>!G.includes(W));if(y.current=I,!q||G.length===0)return;const B=v.current[q];B&&B.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t.terminals]),f.jsx("div",{className:"flex h-full min-h-0 flex-col",children:f.jsx("div",{ref:p,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:f.jsx("div",{className:"h-full min-h-0",style:{width:D||"100%"},children:f.jsx(ud,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:G=>g(e,t.terminals.map(I=>G[I.id]??I.size)),children:t.terminals.map((G,I)=>f.jsxs(b.Fragment,{children:[f.jsx(Ys,{id:G.id,defaultSize:`${G.size}%`,minSize:`${L}px`,className:"min-h-0 overflow-hidden",style:{minWidth:L},children:f.jsxs("div",{ref:q=>{v.current[G.id]=q},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:[f.jsxs("div",{className:"flex items-center gap-2 px-3 pr-2 pt-2 pb-1",children:[f.jsx("div",{className:"min-w-0 flex-1 text-left",children:f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("div",{className:"shrink-0 text-sm font-medium",children:"Terminal"}),f.jsx("div",{className:"min-w-0 truncate text-xs text-muted-foreground",children:C[G.id]??""})]})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Ze,{variant:"ghost",size:"icon-sm",className:"md:hidden","aria-label":"Send Ctrl+C",onClick:()=>{n.command({type:"terminal.input",terminalId:G.id,data:""}).catch(()=>{})},title:"Send Ctrl+C",children:f.jsx(o8,{className:"size-3.5"})}),f.jsx(Ze,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>E(q=>({...q,[G.id]:(q[G.id]??0)+1})),children:f.jsx(n6,{className:"size-3.5"})}),f.jsxs(Vu,{children:[f.jsx(qu,{asChild:!0,children:f.jsx(Ze,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>h(e,G.id),children:f.jsx(kx,{className:"size-3.5"})})}),f.jsx(ic,{side:"bottom",shortcut:u})]}),f.jsx(Ze,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>d(e,G.id),children:f.jsx(Js,{className:"size-3.5"})})]})]}),f.jsx(FG,{projectId:e,terminalId:G.id,socket:n,scrollback:s,connectionStatus:r,clearVersion:R[G.id]??0,focusRequestVersion:I===0?l:0,onPathChange:q=>k(B=>B[G.id]===q?B:{...B,[G.id]:q})})]})}),I<t.terminals.length-1?f.jsx(dd,{withHandle:!0,orientation:"horizontal"}):null]},G.id))},H)})})})}function GE(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function $G(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:GE(n.groups.line),column:GE(n.groups.column)}:{path:t}}function Zb(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 B0=()=>{},QD=b.createContext(B0);function WG({children:e,onOpenLocalLink:t}){return f.jsx(QD.Provider,{value:t??B0,children:e})}const Ky={Task:xm,TaskOutput:xm,Bash:Rx,Glob:yb,Grep:yb,ExitPlanMode:zk,Read:f6,Edit:a6,Write:c6,NotebookEdit:gc,WebFetch:bI,TodoWrite:jI,WebSearch:yb,KillShell:i8,AskUserQuestion:NN,Skill:Nn,EnterPlanMode:zk},JD=c8;function ej(e){return Ky[e]?Ky[e]:JD}function uo({children:e,className:t}){return f.jsx("div",{className:me("flex gap-3 justify-start items-center",t),children:e})}function VG({children:e,className:t}){return f.jsx("div",{className:me("flex items-center gap-1.5 text-xs",t),children:e})}function ro({children:e,className:t}){return f.jsx("span",{className:me("font-medium text-foreground/80",t),children:e})}function qG({children:e}){return f.jsx("span",{className:"text-muted-foreground",children:e})}function nh({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,s]=b.useState(n);return f.jsxs("div",{className:"flex flex-col w-full",children:[f.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:[f.jsx("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:e}),f.jsx(Mr,{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 Qb({label:e,children:t,copyText:n}){const[r,s]=b.useState(!1),o=n??Gm(t),l=b.useCallback(async()=>{await navigator.clipboard.writeText(o),s(!0),setTimeout(()=>s(!1),2e3)},[o]);return f.jsxs("div",{children:[f.jsx("span",{className:"font-medium text-muted-foreground",children:e}),f.jsxs("div",{className:"relative group/codeblock",children:[f.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}),f.jsx(Ze,{variant:"ghost",size:"icon",className:me("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?f.jsx(qi,{className:"h-3.5 w-3.5 text-green-400"}):f.jsx(Bd,{className:"h-4 w-4"})})]})]})}function tj({children:e,icon:t,className:n}){return f.jsxs("span",{className:me("inline-flex items-center gap-1 px-2 py-1 bg-muted border border-border rounded-full",n),children:[t&&f.jsx(t,{className:"h-3 w-3 text-muted-foreground"}),e]})}function rh({children:e,className:t}){return f.jsxs("div",{className:me("grid grid-cols-[auto_1fr] gap-2 min-w-0",t),children:[f.jsx("div",{className:" min-w-5 flex flex-col relative items-center justify-center",children:f.jsx("div",{className:"min-h-full w-[1px] bg-muted-foreground/20"})}),f.jsx("div",{className:"-ml-[1px] min-w-0 overflow-hidden",children:e})]})}function Gm(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(Gm).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return Gm(t.children)}return""}function YE(e,t){return b.isValidElement(e)?b.cloneElement(e,{className:me(e.props.className,t)}):e}const KG={h1:({children:e})=>f.jsx("h1",{className:"text-[20px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h2:({children:e})=>f.jsx("h2",{className:"text-[18px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h3:({children:e})=>f.jsx("h3",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h4:({children:e})=>f.jsx("h4",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h5:({children:e})=>f.jsx("h5",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h6:({children:e})=>f.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]=b.useState(!1),s=Gm(e),o=async()=>{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)};return f.jsxs("div",{className:"relative overflow-x-auto max-w-full min-w-0 no-code-highlight group/pre",children:[f.jsx("pre",{className:"min-w-0 rounded-xl py-2.5 px-3.5 [.no-pre-highlight_&]:bg-background",...t,children:e}),f.jsx(Ze,{variant:"ghost",size:"icon",className:me("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:o,children:n?f.jsx(qi,{className:"h-4 w-4 text-green-400"}):f.jsx(Bd,{className:"h-4 w-4"})})]})},code:({children:e,className:t,...n})=>t?f.jsx("code",{className:"block text-xs whitespace-pre",...n,children:e}):f.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})=>f.jsx("div",{className:"border border-border rounded-xl overflow-x-auto",children:f.jsx("table",{className:"table-auto min-w-full divide-y divide-border bg-background",...t,children:e})}),tbody:({children:e,...t})=>f.jsx("tbody",{className:"divide-y divide-border",...t,children:e}),th:({children:e,...t})=>f.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})=>f.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal ",...t,children:e}),p:({children:e,...t})=>f.jsx("p",{className:"break-words mt-5 mb-3 first:mt-0 last:mb-0",...t,children:e}),blockquote:({children:e,...t})=>(()=>{const n=b.Children.toArray(e),r=n[0];r!==void 0&&(n[0]=YE(r,"mt-0"));const s=n.length-1,o=n[s];return o!==void 0&&(n[s]=YE(o,"mb-0")),f.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})=>f.jsx("a",{className:"transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/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 zc(e){return{...KG,a:({children:t,href:n,onClick:r,...s})=>{const o=(e==null?void 0:e.onOpenLocalLink)??b.useContext(QD),l=$G(n);return f.jsx("a",{className:"transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/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||o===B0)&&(u.preventDefault(),o(l))},...s,children:t})}}}const GG={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function YG({status:e}){const t=(e?GG[e]:void 0)||"Processing...",n=e==="failed";return f.jsx(uo,{className:"ml-[1px]",children:f.jsxs(VG,{children:[n?f.jsx(Js,{className:"size-4.5 text-red-500"}):f.jsx(li,{className:"size-4.5 animate-spin text-muted-icon"}),f.jsx(Tp,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const $p=b.forwardRef(({className:e,children:t,...n},r)=>f.jsx("div",{ref:r,className:me("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));$p.displayName="ScrollArea";function nj(e){return e==="localhost"||e==="127.0.0.1"||e==="::1"}const Wp=20,Gy=50,rj=30;function ij(e){return Number.isFinite(e)?Math.min(Gy,Math.max(Wp,e)):rj}function XG(){return{isVisible:!1,size:Wp}}function qf(e,t){return e[t]??XG()}function ZG(e){return!e||typeof e!="object"?{projects:{}}:{projects:Object.fromEntries(Object.entries(e.projects??{}).map(([r,s])=>[r,{isVisible:!1,size:ij(s.size??rj)}]))}}const fd=oo()(ao(e=>({projects:{},toggleVisibility:t=>e(n=>({projects:{...n.projects,[t]:{...qf(n.projects,t),isVisible:!qf(n.projects,t).isVisible}}})),setVisibility:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...qf(r.projects,t),isVisible:n}}})),setSize:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...qf(r.projects,t),size:ij(n)}}})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"right-sidebar-layouts",version:2,migrate:ZG})),QG={isVisible:!1,size:Wp},I0=[68,32];function JG(){return{isVisible:!1,mainSizes:[...I0],terminals:[],nextTerminalIndex:0}}function eY(e,t){return e[t]??JG()}function Jb(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 tY(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 nY(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function Jl(e,t,n){return{...e,[t]:n(eY(e,t))}}const Go=oo()(ao(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:Jl(r.projects,t,s=>{var h,d;const o=nY(s.terminals),l={id:((d=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:d.call(h))??`terminal-${Date.now()}-${s.nextTerminalIndex}`,title:tY(s.nextTerminalIndex),size:100/(o.length+1)},u=n?Math.max(o.findIndex(g=>g.id===n)+1,0):o.length;return{...s,isVisible:!0,nextTerminalIndex:s.nextTerminalIndex+1,terminals:[...o.slice(0,u),l,...o.slice(u)]}})})),removeTerminal:(t,n)=>e(r=>({projects:Jl(r.projects,t,s=>{const o=s.terminals.filter(u=>u.id!==n);if(o.length===0)return{...s,isVisible:!1,terminals:[]};const l=Jb(o.map(u=>u.size));return{...s,terminals:o.map((u,h)=>({...u,size:l[h]??100/o.length}))}})})),toggleVisibility:t=>e(n=>({projects:Jl(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),resetMainSizes:t=>e(n=>({projects:Jl(n.projects,t,r=>({...r,mainSizes:[...I0]}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const s=Jb(n);return{projects:Jl(r.projects,t,o=>({...o,mainSizes:s}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:Jl(r.projects,t,s=>{if(n.length!==s.terminals.length)return s;const o=Jb(n);return{...s,terminals:s.terminals.map((l,u)=>({...l,size:o[u]??l.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"terminal-layouts",version:1})),rY={isVisible:!1,mainSizes:[...I0],terminals:[],nextTerminalIndex:0},Ym=1e3,Yy=500,Xy=5e3,Xm=450,Zy=250,Qy=900,Jy="cursor";function ex(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 iY(e){switch(e){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function XE(e){return Number.isFinite(e)?Math.min(Xy,Math.max(Yy,Math.round(e))):Ym}function ZE(e){return Number.isFinite(e)?Math.min(Qy,Math.max(Zy,Math.round(e))):Xm}function QE(e){switch(e){case"vscode":case"windsurf":case"custom":case"cursor":return e;default:return Jy}}function e_(e,t){const n=e==null?void 0:e.trim();return n&&n.length>0?n:ex(t)}const Ci=oo()(ao(e=>({scrollbackLines:Ym,minColumnWidth:Xm,editorPreset:Jy,editorCommandTemplate:ex(Jy),setScrollbackLines:t=>e({scrollbackLines:XE(t)}),setMinColumnWidth:t=>e({minColumnWidth:ZE(t)}),setEditorPreset:t=>e(n=>{const r=QE(t);return{editorPreset:r,editorCommandTemplate:r==="custom"?e_(n.editorCommandTemplate,r):ex(r)}}),setEditorCommandTemplate:t=>e(n=>({editorCommandTemplate:e_(t,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:e=>{const t=e,n=QE(t==null?void 0:t.editorPreset);return{scrollbackLines:XE((t==null?void 0:t.scrollbackLines)??Ym),minColumnWidth:ZE((t==null?void 0:t.minColumnWidth)??Xm),editorPreset:n,editorCommandTemplate:e_(t==null?void 0:t.editorCommandTemplate,n)}}})),sY=35;function oY(e,t){return!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0?0:e*(t/100)}function aY(e,t){const n=oY(e,t);return n>=0&&n<sY}const lc=350,lY=[.4,0,.2,1],cY=8,JE=1e-6;function uY(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function dY(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function hY(e,t,n){const r=1-e;return 3*r*r*t+6*r*e*(n-t)+3*e*e*(1-n)}function fY(e,t,n){let r=e;for(let s=0;s<cY;s+=1){const o=uY(r,t,n)-e;if(Math.abs(o)<JE)return r;const l=hY(r,t,n);if(Math.abs(l)<JE)break;r-=o/l}return r}function mY(e){if(e<=0)return 0;if(e>=1)return 1;const[t,n,r,s]=lY,o=fY(e,t,r);return dY(o,n,s)}function sj(e,t,n){const r=mY(n);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function pY({projectId:e,shouldRenderRightSidebarLayout:t,showRightSidebar:n,rightSidebarSize:r}){const s=b.useRef(null),o=b.useRef(null),l=b.useRef(null),u=b.useRef(null),h=b.useRef(null),d=b.useRef(!1),g=b.useRef(null),p=b.useRef(!1),v=b.useRef(!1);return b.useEffect(()=>()=>{u.current!==null&&window.cancelAnimationFrame(u.current),h.current!==null&&window.clearTimeout(h.current)},[]),b.useLayoutEffect(()=>{var D,H,G,I,q,B;if(!t){u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null),d.current=!1;return}const y=s.current;if(!y)return;u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null);const w=g.current,S=w!==null&&w!==e,C=n&&!v.current,k=!p.current,R=n?[100-r,r]:[100,0],E=S||k&&n,M=C||k?[100,0]:[y.getLayout().workspace??R[0],y.getLayout().rightSidebar??R[1]];if(g.current=e,p.current=t,v.current=n,E||Math.abs(M[0]-R[0])<.1&&Math.abs(M[1]-R[1])<.1){y.setLayout({workspace:R[0],rightSidebar:R[1]}),(D=o.current)==null||D.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}d.current=!0,(I=o.current)==null||I.setAttribute("data-right-sidebar-open",n?"true":"false"),(q=l.current)==null||q.setAttribute("data-right-sidebar-open",n?"true":"false"),(B=l.current)==null||B.setAttribute("data-right-sidebar-animated","true"),y.setLayout({workspace:M[0],rightSidebar:M[1]});const L=performance.now(),j=W=>{const F=Math.min(1,(W-L)/lc),V=sj(M,R,F);if(y.setLayout({workspace:V[0],rightSidebar:V[1]}),F<1){u.current=window.requestAnimationFrame(j);return}y.setLayout({workspace:R[0],rightSidebar:R[1]}),u.current=null,h.current=window.setTimeout(()=>{d.current=!1,h.current=null},0)};u.current=window.requestAnimationFrame(j)},[e,r,t,n]),b.useEffect(()=>{t||(p.current=!1,v.current=!1)},[t]),{isAnimating:d,panelGroupRef:s,sidebarPanelRef:o,sidebarVisualRef:l}}function gY(e){const t=e.previousProjectId!==null&&e.previousProjectId!==e.projectId,n=e.previousProjectId===null&&e.projectId!==null;return!t&&!n&&e.showTerminalPane&&!e.wasTerminalVisible}function vY({previousProjectId:e,projectId:t,previousShouldRenderTerminalLayout:n,previousShowTerminalPane:r,showTerminalPane:s,terminalLayout:o,liveLayout:l}){const u=e!==null&&e!==t,h=s&&!r,d=!n,g=e===null&&t!==null,p=s?o.mainSizes:[100,0];return{currentLayout:h||d?[100,0]:l,shouldSkipAnimation:u||g&&d,targetLayout:p}}function bY({chatInputRef:e,projectId:t,shouldRenderTerminalLayout:n,showTerminalPane:r,terminalLayout:s}){const o=b.useRef(null),l=b.useRef(null),u=b.useRef(null),h=b.useRef(null),d=b.useRef(null),g=b.useRef(!1),p=b.useRef(null),v=b.useRef(!1),y=b.useRef(!1),w=b.useRef(!1),[S,C]=b.useState(0);return b.useEffect(()=>{var E;const k=p.current,R=w.current;gY({previousProjectId:k,projectId:t,showTerminalPane:r,wasTerminalVisible:R})&&C(M=>M+1),k!==null&&k===t&&!r&&R&&((E=e.current)==null||E.focus({preventScroll:!0})),w.current=r,p.current=t},[e,t,r]),b.useEffect(()=>()=>{h.current!==null&&window.cancelAnimationFrame(h.current),d.current!==null&&window.clearTimeout(d.current)},[]),b.useLayoutEffect(()=>{var H,G,I,q,B,W;if(!n){h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null),g.current=!1;return}const k=o.current;if(!k)return;h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null);const R=p.current,{currentLayout:E,shouldSkipAnimation:M,targetLayout:L}=vY({previousProjectId:R,projectId:t,previousShouldRenderTerminalLayout:v.current,previousShowTerminalPane:y.current,showTerminalPane:r,terminalLayout:s,liveLayout:[k.getLayout().chat??s.mainSizes[0],k.getLayout().terminal??s.mainSizes[1]]});if(v.current=n,y.current=r,M||Math.abs(E[0]-L[0])<.1&&Math.abs(E[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"),(I=u.current)==null||I.setAttribute("data-terminal-animated","false");return}g.current=!0,(q=l.current)==null||q.setAttribute("data-terminal-open",r?"true":"false"),(B=u.current)==null||B.setAttribute("data-terminal-open",r?"true":"false"),(W=u.current)==null||W.setAttribute("data-terminal-animated","true"),k.setLayout({chat:E[0],terminal:E[1]});const j=performance.now(),D=F=>{const V=Math.min(1,(F-j)/lc),O=sj(E,L,V);if(k.setLayout({chat:O[0],terminal:O[1]}),V<1){h.current=window.requestAnimationFrame(D);return}k.setLayout({chat:L[0],terminal:L[1]}),h.current=null,d.current=window.setTimeout(()=>{g.current=!1,d.current=null},0)};h.current=window.requestAnimationFrame(D)},[t,n,r,s.mainSizes]),b.useEffect(()=>{n||(v.current=!1,y.current=!1)},[n]),{isAnimating:g,mainPanelGroupRef:o,terminalFocusRequestVersion:S,terminalPanelRef:l,terminalVisualRef:u}}const ii=oo()(ao(e=>({folderGroupsEnabled:!1,showFeatureOverviewInSidebar:!0,kanbanStatusesEnabled:!0,commitProjectMetadataDirectory:!0,setFolderGroupsEnabled:t=>e({folderGroupsEnabled:t}),setShowFeatureOverviewInSidebar:t=>e({showFeatureOverviewInSidebar:t}),setKanbanStatusesEnabled:t=>e({kanbanStatusesEnabled:t}),setCommitProjectMetadataDirectory:t=>e({commitProjectMetadataDirectory:t})}),{name:"feature-settings"}));function Kf(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function _Y(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function yY(e,t){const n=_Y(t);switch(e.toolKind){case"ask_user_question":{const s=Kf(n),o=Kf(s==null?void 0:s.answers)??(s||{});return{answers:Object.fromEntries(Object.entries(o).map(([l,u])=>Array.isArray(u)?[l,u.map(h=>String(h))]:u&&typeof u=="object"&&Array.isArray(u.answers)?[l,u.answers.map(h=>String(h))]:u==null||u===""?[l,[]]:[l,[String(u)]])),...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const s=Kf(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=Kf(n);return{content:typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(n,null,2)};default:return n}}function oj(e){return new Date(e).toISOString()}function xi(e){return{id:e._id,messageId:e.messageId,timestamp:oj(e.createdAt),hidden:e.hidden}}function xY(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:oj(e.createdAt)}}function wY(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function SY(e){if(e!=null&&e.length)return e.map(t=>({...t,previewUrl:`/attachments/${t.relativePath.split("/").map(encodeURIComponent).join("/")}`}))}function eR(e,t){const n=e.at(-1);if((n==null?void 0:n.kind)===t.kind&&n.hidden===t.hidden&&n.messageId===t.messageId){n.text+=t.text;return}e.push(t)}function CY(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...xi(r),kind:"user_prompt",content:r.content,attachments:SY(r.attachments)});break;case"system_init":n.push({...xi(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({...xi(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":eR(n,{...xi(r),kind:"assistant_text",text:r.text});break;case"assistant_thought":eR(n,{...xi(r),kind:"assistant_thought",text:r.text});break;case"tool_call":{const s=xY(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 o=s.normalized.toolKind==="ask_user_question"||s.normalized.toolKind==="exit_plan_mode"?wY(r)??r.content:r.content;s.hydrated.result=yY(s.normalized,o),s.hydrated.rawResult=o,s.hydrated.isError=r.isError}break}case"result":n.push({...xi(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...xi(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...xi(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...xi(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...xi(r),kind:"context_cleared"});break;case"interrupted":n.push({...xi(r),kind:"interrupted"});break;default:n.push({...xi(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const kY=["AskUserQuestion","ExitPlanMode","TodoWrite"],EY=new Set(["TodoWrite"]);function RY(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 TY(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 NY(e){const t={};for(const n of kY)t[n]=EY.has(n)?TY(e,n):RY(e,n);return t}function MY(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function t_(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const AY=25e3,DY=15e3,jY=4e3;class OY{constructor(t){Fn(this,"url");Fn(this,"ws",null);Fn(this,"started",!1);Fn(this,"reconnectTimer",null);Fn(this,"reconnectDelayMs",750);Fn(this,"subscriptions",new Map);Fn(this,"pending",new Map);Fn(this,"outboundQueue",[]);Fn(this,"statusListeners",new Set);Fn(this,"heartbeatTimer",null);Fn(this,"pingTimeoutTimer",null);Fn(this,"pingPromise",null);Fn(this,"lastOpenAt",0);Fn(this,"lastMessageAt",0);Fn(this,"reconnectImmediatelyOnClose",!1);Fn(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});Fn(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});Fn(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=id();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=id(),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=id(),r={v:1,type:"command",id:n,command:t};return new Promise((s,o)=>{this.pending.set(n,{resolve:s,reject:o}),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(){if(!this.started)return;this.emitStatus("connecting");const t=new WebSocket(this.url);this.ws=t,t.addEventListener("open",()=>{if(this.ws===t){this.reconnectDelayMs=750,this.reconnectImmediatelyOnClose=!1,this.lastOpenAt=Date.now(),this.lastMessageAt=this.lastOpenAt,this.emitStatus("connected"),this.startHeartbeat();for(const[n,r]of this.subscriptions.entries())this.sendNow({v:1,type:"subscribe",id:n,topic:r.topic},t);for(;this.outboundQueue.length>0;){const n=this.outboundQueue.shift();n&&this.sendNow(n,t)}}}),t.addEventListener("message",n=>{var s;if(this.ws!==t)return;this.lastMessageAt=Date.now();let r;try{r=JSON.parse(String(n.data))}catch{return}if(r.type==="snapshot"){const o=this.subscriptions.get(r.id);o==null||o.listener(r.snapshot.data);return}if(r.type==="event"){const o=this.subscriptions.get(r.id);(s=o==null?void 0:o.eventListener)==null||s.call(o,r.event);return}if(r.type==="ack"){const o=this.pending.get(r.id);if(!o)return;this.pending.delete(r.id),o.resolve(r.result);return}if(r.type==="error"){if(!r.id){console.error(h7,r.message);return}const o=this.pending.get(r.id);if(!o)return;this.pending.delete(r.id),o.reject(new Error(r.message))}}),t.addEventListener("close",()=>{if(this.ws!==t||!this.started)return;const n=this.reconnectImmediatelyOnClose;this.reconnectImmediatelyOnClose=!1,this.stopHeartbeat(),this.clearPingState(),this.emitStatus("disconnected");for(const r of this.pending.values())r.reject(new Error("Disconnected"));if(this.pending.clear(),n){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>=AY}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()},jY),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()},DY))}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,this.ws);return}this.outboundQueue.push(t)}sendNow(t,n){if(n.readyState!==WebSocket.OPEN){this.outboundQueue.unshift(t);return}n.send(JSON.stringify(t))}}function LY(e,t){var r;const n=e.find(s=>Ad(s).some(o=>o.chatId===t));return n?((r=Ad(n).find(s=>s.chatId!==t))==null?void 0:r.chatId)??null:null}function tR(e,t){var n;return((n=e.find(r=>Ad(r).some(s=>s.chatId===t)))==null?void 0:n.groupKey)??null}function zY(e,t){for(const n of e){const r=Ad(n).find(s=>s.chatId===t);if(r)return r}return null}function PY(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function BY(){const e=b.useRef(null);return e.current||(e.current=new OY(PY())),b.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function nd(e,t){if(t===void 0){console.info(`[useKaizenState] ${e}`);return}console.info(`[useKaizenState] ${e}`,t)}function aj(e){return e<24}function IY(e){return Math.max(136,Math.round(e+24))}function FY(e,t){return e==="awaiting_disconnect"&&t==="disconnected"?"awaiting_reconnect":e==="awaiting_reconnect"&&t==="connected"?"clear_phase":"none"}const F0=`${kp}ui-update-restart`;function HY(){return window.sessionStorage.getItem(F0)}function nR(e){window.sessionStorage.setItem(F0,e)}function n_(){window.sessionStorage.removeItem(F0)}function UY(e){const t=e.selectedProjectId??e.sidebarProjectId??null;return t?{kind:"project_id",projectId:t}:e.fallbackLocalProjectPath?{kind:"local_path",localPath:e.fallbackLocalProjectPath}:null}function $Y(e,t){return!e||!t?null:e.runtime.chatId!==t?(nd("stale snapshot masked",{routeChatId:t,snapshotChatId:e.runtime.chatId,snapshotProvider:e.runtime.provider}),null):e}function WY(e){var di,Cr,Uc;const{activeChatId:t,activeOverviewFeatureId:n}=e,r=rl(),s=BY(),o=y8(),[l,u]=b.useState({projectGroups:[]}),[h,d]=b.useState(null),[g,p]=b.useState(null),[v,y]=b.useState(null),[w,S]=b.useState(null),[C,k]=b.useState(null),[R,E]=b.useState(null),[M,L]=b.useState("connecting"),[j,D]=b.useState(!1),[H,G]=b.useState(!1),[I,q]=b.useState(!1),[B,W]=b.useState(null),[F,V]=b.useState(!1),[O,$]=b.useState(!1),[U,Y]=b.useState(148),[A,P]=b.useState(!0),[X,N]=b.useState(null),[ne,oe]=b.useState(null),[J,te]=b.useState(null),[ue,he]=b.useState(null),[ge,ke]=b.useState(!1),Ee=ii(Q=>Q.folderGroupsEnabled),De=ii(Q=>Q.showFeatureOverviewInSidebar),Xe=ii(Q=>Q.kanbanStatusesEnabled),pt=iY(Ci(Q=>Q.editorPreset)),at=b.useRef(null),fe=b.useRef(null),Ve=fd(Q=>Q.setVisibility),[Ae,et]=b.useState(new Set),lt=b.useRef(new Map),nt=b.useRef(t),Kt=b.useRef(typeof document<"u"?document.visibilityState==="visible":!0),Se=b.useRef(!1),qe=b.useRef(null),se=b.useRef(new Map);b.useEffect(()=>s.onStatus(L),[s]),b.useEffect(()=>{nt.current=t},[t]),b.useEffect(()=>{function Q(){const ie=document.visibilityState==="visible";if(Kt.current=ie,ie){const Ce=nt.current;Ce&&et(Ue=>{if(!Ue.has(Ce))return Ue;const Wt=new Set(Ue);return Wt.delete(Ce),Wt})}}return document.addEventListener("visibilitychange",Q),()=>document.removeEventListener("visibilitychange",Q)},[]),b.useEffect(()=>s.subscribe({type:"sidebar"},Q=>{const ie=new Map;for(const jt of Q.projectGroups)for(const Yn of[...jt.generalChats,...jt.features.flatMap(Zi=>Zi.chats)])ie.set(Yn.chatId,Yn.status);const Ce=lt.current,Ue=nt.current,Wt=Kt.current;et(jt=>{let Yn=jt;for(const[Zi,ml]of ie){const ks=Ce.get(Zi);t_(ml)&&Yn.has(Zi)&&(Yn===jt&&(Yn=new Set(jt)),Yn.delete(Zi)),ks&&t_(ks)&&ml==="idle"&&(Zi!==Ue||!Wt)&&(Yn===jt&&(Yn=new Set(jt)),Yn.add(Zi))}return Yn}),lt.current=ie,u(Q),D(!0),N(null)}),[s]),b.useEffect(()=>s.subscribe({type:"local-projects"},Q=>{d(Q),G(!0),N(null)}),[s]),b.useEffect(()=>s.subscribe({type:"update"},Q=>{p(Q),N(null)}),[s]),b.useEffect(()=>{M==="connected"&&s.command({type:"update.check",force:!0}).catch(Q=>{N(Q instanceof Error?Q.message:String(Q))})},[M,s]),b.useEffect(()=>{const Q=HY(),ie=FY(Q,M);if(ie==="awaiting_reconnect"){nR("awaiting_reconnect");return}ie==="clear_phase"&&n_()},[M,r]),b.useEffect(()=>{function Q(){g!=null&&g.lastCheckedAt&&(Date.now()-g.lastCheckedAt<=3600*1e3||s.command({type:"update.check"}).catch(ie=>{N(ie instanceof Error?ie.message:String(ie))}))}return window.addEventListener("focus",Q),()=>{window.removeEventListener("focus",Q)}},[s,g==null?void 0:g.lastCheckedAt]),b.useEffect(()=>s.subscribe({type:"keybindings"},Q=>{k(Q),N(null)}),[s]),b.useEffect(()=>s.subscribe({type:"theme-settings"},Q=>{bn.setState({themePreference:Q.settings.themePreference,colorTheme:Q.settings.colorTheme,customAppearance:Q.settings.customAppearance,backgroundImage:Q.settings.backgroundImage,backgroundOpacity:Q.settings.backgroundOpacity,backgroundBlur:Q.settings.backgroundBlur,showProjectIconsInSidebar:Q.settings.showProjectIconsInSidebar})}),[s]),b.useEffect(()=>s.subscribe({type:"provider-settings"},Q=>{E(Q),N(null)}),[s]),b.useEffect(()=>{if(!t){nd("clearing chat snapshot for non-chat route"),y(null),q(!0);return}return nd("subscribing to chat",{activeChatId:t}),y(null),q(!1),s.subscribe({type:"chat",chatId:t},Q=>{nd("chat snapshot received",{activeChatId:t,snapshotChatId:(Q==null?void 0:Q.runtime.chatId)??null,snapshotProvider:(Q==null?void 0:Q.runtime.provider)??null,snapshotStatus:(Q==null?void 0:Q.runtime.status)??null}),y(Q),q(!0),N(null)})},[t,s]),b.useEffect(()=>{if(!n){S(null);return}return S(null),s.subscribe({type:"feature-overview",featureId:n},Q=>{S(Q),N(null)})},[n,s]),b.useEffect(()=>{t&&et(Q=>{if(!Q.has(t))return Q;const ie=new Set(Q);return ie.delete(t),ie})},[t]),b.useEffect(()=>{if(!t)return;const Q=tR(l.projectGroups,t);Q&&Ve(Q,!1)},[t,Ve,l.projectGroups]),b.useEffect(()=>{n&&w&&W(w.projectId)},[n,w]),b.useEffect(()=>{if(B)return;const Q=l.projectGroups[0];Q&&W(Q.groupKey)},[B,l.projectGroups]),b.useEffect(()=>{if(!t||!j||!I)return;if(l.projectGroups.some(ie=>Ad(ie).some(Ce=>Ce.chatId===t))){J===t&&te(null);return}J!==t&&r("/")},[t,I,r,J,l.projectGroups,j]),b.useEffect(()=>{v&&(W(v.runtime.projectId),J===v.runtime.chatId&&te(null))},[v,J]),b.useEffect(()=>{Se.current=!1,qe.current!==null&&(window.cancelAnimationFrame(qe.current),qe.current=null),P(!0)},[t]),b.useEffect(()=>()=>{qe.current!==null&&window.cancelAnimationFrame(qe.current)},[]),b.useLayoutEffect(()=>{const Q=fe.current;if(!Q)return;const ie=new ResizeObserver(()=>{Y(Q.getBoundingClientRect().height)});return ie.observe(Q),Y(Q.getBoundingClientRect().height),()=>ie.disconnect()},[]);const pe=b.useMemo(()=>$Y(v,t),[t,v]);b.useEffect(()=>{nd("active snapshot resolved",{routeChatId:t,rawSnapshotChatId:(v==null?void 0:v.runtime.chatId)??null,rawSnapshotProvider:(v==null?void 0:v.runtime.provider)??null,activeSnapshotChatId:(pe==null?void 0:pe.runtime.chatId)??null,activeSnapshotProvider:(pe==null?void 0:pe.runtime.provider)??null,pendingChatId:J})},[t,pe,v,J]);const Ne=b.useMemo(()=>{const Q=pe;if(!Q)return[];const ie=Q.messages,Ce=Q.runtime.chatId,Ue=ie.at(-1),Wt=`${ie.length}:${(Ue==null?void 0:Ue._id)??""}:${(Ue==null?void 0:Ue.createdAt)??0}`,jt=se.current.get(Ce);if((jt==null?void 0:jt.signature)===Wt)return jt.messages;const Yn=CY(ie);return se.current.set(Ce,{signature:Wt,messages:Yn}),Yn},[pe]),He=b.useMemo(()=>NY(Ne),[Ne]),Oe=(pe==null?void 0:pe.runtime)??null,xt=(pe==null?void 0:pe.usage)??null,Bt=(pe==null?void 0:pe.availableProviders)??Wx((R==null?void 0:R.settings)??Wn),Le=t_(Oe==null?void 0:Oe.status),Ke=MY(Oe==null?void 0:Oe.status),ft=IY(U),we=!A&&Ne.length>0,Rt=((di=h==null?void 0:h.projects[0])==null?void 0:di.localPath)??null,Gt=(w==null?void 0:w.localPath)??(Oe==null?void 0:Oe.localPath)??Rt??((Cr=l.projectGroups[0])==null?void 0:Cr.localPath),_n=(w==null?void 0:w.projectId)??(Oe==null?void 0:Oe.projectId)??null,Kn=!!(B??_n??((Uc=l.projectGroups[0])==null?void 0:Uc.groupKey)??Rt);b.useLayoutEffect(()=>{if(Se.current)return;const Q=at.current;Q&&(t&&!Oe||(Q.scrollTo({top:Q.scrollHeight,behavior:"auto"}),qe.current!==null&&window.cancelAnimationFrame(qe.current),qe.current=window.requestAnimationFrame(()=>{const ie=at.current;ie&&(ie.scrollTo({top:ie.scrollHeight,behavior:"auto"}),qe.current=null)}),Se.current=!0))},[t,U,Ne.length,Oe]),b.useEffect(()=>{if(!Se.current||!A)return;const Q=window.requestAnimationFrame(()=>{const ie=at.current;!ie||!A||ie.scrollTo({top:ie.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(Q)},[t,U,A,Ne.length,Oe==null?void 0:Oe.status]);function Sr(){const Q=at.current;if(!Q)return;const ie=Q.scrollHeight-Q.scrollTop-Q.clientHeight;P(aj(ie))}function Lt(Q){const ie=at.current;P(!0),ie&&ie.scrollTo({top:ie.scrollHeight,behavior:Q})}function It(){Lt("smooth")}async function Pe(Q,ie){Si.getState().initializeComposerForNewChat();const Ce=await s.command({type:"chat.create",projectId:Q,featureId:ie});W(Q),te(Ce.chatId),r(`/chat/${Ce.chatId}`),V(!1),N(null)}async function ot(Q,ie=ii.getState().commitProjectMetadataDirectory){await s.command({type:"project.setProjectMetadataDirectoryCommitMode",projectId:Q.projectId,localPath:Q.localPath,commitProjectMetadata:ie})}async function wt(Q){return Q.kind==="project_id"?{projectId:Q.projectId}:Q.kind==="local_path"?{projectId:(await s.command({type:"project.open",localPath:Q.localPath})).projectId,localPath:Q.localPath}:{projectId:(await s.command(Q.project.mode==="new"?{type:"project.create",localPath:Q.project.localPath,title:Q.project.title}:{type:"project.open",localPath:Q.project.localPath})).projectId,localPath:Q.project.localPath}}async function gt(Q){try{const ie=Q.kind==="project_id"?null:Q.kind==="local_path"?Q.localPath:Q.project.localPath;ie&&oe(ie);const{projectId:Ce}=await wt(Q);await ot({projectId:Ce}),await Pe(Ce)}catch(ie){N(ie instanceof Error?ie.message:String(ie))}finally{oe(null)}}async function At(Q){const ie=Q.split("/").filter(Boolean).pop()??Q;if(await o.confirm({title:"Hide Project",description:`Hide "${ie}" from ${Pn}? This only removes it from ${Pn} until you re-add it or reset local state.`,confirmLabel:"Hide",confirmVariant:"destructive"}))try{await s.command({type:"project.hide",localPath:Q}),N(null)}catch(Ue){N(Ue instanceof Error?Ue.message:String(Ue))}}async function ut(Q,ie){try{await Pe(Q,ie)}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}function mt(Q){he(Q)}function yn(Q){r(`/overview/${Q}`),V(!1),N(null)}function Te(){he(null)}async function je(Q){const ie=ue;if(ie)try{const Ce=await s.command({type:"feature.create",projectId:ie,title:Q.title,description:Q.description,generateOverview:ii.getState().showFeatureOverviewInSidebar});he(null),await Pe(ie,Ce.featureId)}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}async function Tt(Q){const ie=l.projectGroups.flatMap(Ue=>Ue.features).find(Ue=>Ue.featureId===Q);if(!ie)return;const Ce=await o.prompt({title:"Rename Feature",placeholder:"Feature name",initialValue:ie.title,confirmLabel:"Rename"});if(!(!Ce||Ce===ie.title))try{await s.command({type:"feature.rename",featureId:Q,title:Ce}),N(null)}catch(Ue){N(Ue instanceof Error?Ue.message:String(Ue))}}async function it(Q){const ie=l.projectGroups.flatMap(Ue=>Ue.features).find(Ue=>Ue.featureId===Q);if(!(!ie||!await o.confirm({title:"Delete Feature",description:`Delete "${ie.title}"? Its chats will move to General and the feature folder will be removed.`,confirmLabel:"Delete",confirmVariant:"destructive"})))try{await s.command({type:"feature.delete",featureId:Q}),n===Q&&r("/"),N(null)}catch(Ue){N(Ue instanceof Error?Ue.message:String(Ue))}}async function Yt(Q,ie){try{await s.command({type:"feature.setBrowserState",featureId:Q,browserState:ie}),N(null)}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}async function an(Q,ie){try{await s.command({type:"project.setBrowserState",projectId:Q,browserState:ie}),N(null)}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}async function $t(Q,ie){try{await s.command({type:"project.setGeneralChatsBrowserState",projectId:Q,browserState:ie}),N(null)}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}async function K(Q,ie){try{await s.command({type:"feature.setStage",featureId:Q,stage:ie}),N(null)}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}async function Ie(Q,ie){try{const Ce=await s.command({type:"feature.updateOverview",featureId:Q,content:ie});return N(null),Ce}catch(Ce){const Ue=Ce instanceof Error?Ce.message:String(Ce);throw N(Ue),Ce}}async function mn(Q){try{await s.command({type:"provider.refreshUsage",provider:Q}),N(null)}catch(ie){N(ie instanceof Error?ie.message:String(ie))}}async function ui(Q){if(Q==="cursor")try{const ie=await s.command({type:"provider.browserLogin",provider:Q});if(ie.availability==="login_required"){ie.statusDetail==="browser_launch_failed"&&ke(!0),N(ie.statusDetail==="browser_launch_failed"?"Could not launch a Chromium browser for Cursor sign-in. Paste a copied cURL command instead.":"Cursor sign-in did not complete. Try again and finish login in the opened browser.");return}N(null)}catch(ie){N(ie instanceof Error?ie.message:String(ie))}}async function ua(Q){try{const ie=await s.command({type:"provider.importUsageCurl",provider:"cursor",curlCommand:Q});if(ie.availability==="login_required"&&ie.statusDetail==="invalid_curl_import"){N("Could not import that cURL command. Copy the get-current-period-usage request as cURL and paste it here.");return}ke(!1),N(null)}catch(ie){N(ie instanceof Error?ie.message:String(ie))}}async function Xt(Q,ie){try{await s.command({type:"chat.setFeature",chatId:Q,featureId:ie}),N(null)}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}async function Gn(Q,ie){try{await s.command({type:"feature.reorder",projectId:Q,orderedFeatureIds:ie}),N(null)}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}async function Ss(Q){await gt({kind:"local_path",localPath:Q})}async function Hc(Q){await gt({kind:"project_request",project:Q})}async function fo(Q){try{await Promise.all(VY((h==null?void 0:h.projects.map(ie=>({localPath:ie.localPath})))??l.projectGroups.map(ie=>({projectId:ie.groupKey,localPath:ie.localPath}))).map(ie=>ot(ie,Q))),N(null)}catch(ie){throw N(ie instanceof Error?ie.message:String(ie)),ie}}async function mo(Q){const ie=new URL("/api/directories",window.location.origin);Q&&ie.searchParams.set("path",Q);const Ce=await fetch(ie.toString());if(!Ce.ok){let Wt="Failed to load directories";try{const jt=await Ce.json();jt.error&&(Wt=jt.error)}catch{}throw new Error(Wt)}const Ue=await Ce.json();return N(null),Ue}async function da(Q){try{await s.command({type:"update.check",force:Q==null?void 0:Q.force}),N(null)}catch(ie){N(ie instanceof Error?ie.message:String(ie))}}async function po(){try{const Q=await s.command({type:"update.install"});if(!Q.ok){n_(),N(null),await o.alert({title:Q.userTitle??"Update failed",description:Q.userMessage??`${Pn} could not install the update. Try again later.`,closeLabel:"OK"});return}if(Q.ok&&Q.action==="reload"){window.location.reload();return}Q.ok&&Q.action==="restart"&&nR("awaiting_disconnect"),N(null)}catch(Q){n_(),N(Q instanceof Error?Q.message:String(Q))}}async function Mn(Q,ie){var Ce;try{let Ue=B??((Ce=l.projectGroups[0])==null?void 0:Ce.groupKey)??null;if(!t&&!Ue&&Rt&&(Ue=(await s.command({type:"project.open",localPath:Rt})).projectId,W(Ue)),!t&&!Ue)throw new Error("Open a project first");if(ie!=null&&ie.provider&&!r2(ie.provider,(R==null?void 0:R.settings)??Wn))throw new Error(`${ie.provider} is inactive.`);if(Lt("auto"),ie!=null&&ie.provider&&!r2(ie.provider,(R==null?void 0:R.settings)??Wn))throw new Error(`${ie.provider} is inactive.`);Lt("auto");const Wt=await s.command({type:"chat.send",chatId:t??void 0,projectId:t?void 0:Ue??void 0,provider:ie==null?void 0:ie.provider,message:Q,model:ie==null?void 0:ie.model,modelOptions:ie==null?void 0:ie.modelOptions,planMode:ie==null?void 0:ie.planMode});!t&&Wt.chatId&&(te(Wt.chatId),r(`/chat/${Wt.chatId}`)),N(null)}catch(Ue){throw N(Ue instanceof Error?Ue.message:String(Ue)),Ue}}async function ah(){if(t)try{await s.command({type:"chat.cancel",chatId:t})}catch(Q){N(Q instanceof Error?Q.message:String(Q))}}async function lh(Q){if(await o.confirm({title:"Delete Chat",description:`Delete "${Q.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await s.command({type:"chat.delete",chatId:Q.chatId}),Q.chatId===t){const Ce=LY(l.projectGroups,Q.chatId);r(Ce?`/chat/${Ce}`:"/")}}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}async function Cs(Q){const ie=l.projectGroups.find(Wt=>Wt.groupKey===Q);if(!ie)return;const Ce=ie.localPath.split("/").filter(Boolean).pop()??ie.localPath;if(await o.confirm({title:"Hide Project",description:`Hide "${Ce}" from ${Pn}? Existing chats for this project will be removed from ${Pn}, but the project itself is not deleted.`,confirmLabel:"Hide",confirmVariant:"destructive"}))try{await s.command({type:"project.remove",projectId:Q}),Go.getState().clearProject(Q),fd.getState().clearProject(Q),((Oe==null?void 0:Oe.projectId)??(w==null?void 0:w.projectId))===Q&&r("/"),N(null)}catch(Wt){N(Wt instanceof Error?Wt.message:String(Wt))}}async function go(Q){var Ce,Ue;const ie=(Oe==null?void 0:Oe.localPath)??((Ce=h==null?void 0:h.projects[0])==null?void 0:Ce.localPath)??((Ue=l.projectGroups[0])==null?void 0:Ue.localPath);if(ie)try{await dl({action:Q,localPath:ie})}catch(Wt){N(Wt instanceof Error?Wt.message:String(Wt))}}async function Xp(Q){try{await dl({action:"open_editor",localPath:Q.path,line:Q.line,column:Q.column})}catch(ie){N(ie instanceof Error?ie.message:String(ie))}}async function ch(Q,ie){try{await dl({action:Q,localPath:ie})}catch(Ce){N(Ce instanceof Error?Ce.message:String(Ce))}}async function dl(Q){const ie=Ci.getState();N(null),await s.command({type:"system.openExternal",...Q,editor:Q.action==="open_editor"?{preset:ie.editorPreset,commandTemplate:ie.editorCommandTemplate}:void 0})}function Zp(){var Ue;const Q=t?zY(l.projectGroups,t):null,ie=t?tR(l.projectGroups,t):null;if(Q&&ie){N(null),ut(ie,Q.featureId??void 0);return}const Ce=UY({selectedProjectId:B,sidebarProjectId:(Ue=l.projectGroups[0])==null?void 0:Ue.groupKey,fallbackLocalProjectPath:Rt});if(Ce){N(null),gt(Ce);return}N("Open a project first")}async function hl(Q,ie,Ce){if(t)try{await s.command({type:"chat.respondTool",chatId:t,toolUseId:Q,result:{questions:ie,answers:Ce}})}catch(Ue){N(Ue instanceof Error?Ue.message:String(Ue))}}async function fl(Q,ie,Ce,Ue,Wt){if(t){ie&&Si.getState().setComposerPlanMode(!1);try{await s.command({type:"chat.respondTool",chatId:t,toolUseId:Q,result:{confirmed:ie,...Ce?{clearContext:!0}:{},...Ue?{message:Ue}:{},...Wt?{attachments:Wt}:{}}})}catch(jt){N(jt instanceof Error?jt.message:String(jt))}}}return{socket:s,activeChatId:t,activeOverviewFeatureId:n,sidebarData:l,completedChatIds:Ae,localProjects:h,updateSnapshot:g,chatSnapshot:v,featureOverviewSnapshot:w,keybindings:C,providerSettings:R,connectionStatus:M,sidebarReady:j,localProjectsReady:H,commandError:X,startingLocalPath:ne,folderGroupsEnabled:Ee,showFeatureOverviewInSidebar:De,kanbanStatusesEnabled:Xe,sidebarOpen:F,sidebarCollapsed:O,scrollRef:at,inputRef:fe,messages:Ne,latestToolIds:He,runtime:Oe,usage:xt,availableProviders:Bt,isProcessing:Le,canCancel:Ke,transcriptPaddingBottom:ft,showScrollButton:we,navbarLocalPath:Gt,editorLabel:pt,hasSelectedProject:Kn,createFeatureModalProjectId:ue,cursorCurlImportOpen:ge,openSidebar:()=>V(!0),closeSidebar:()=>V(!1),collapseSidebar:()=>$(!0),expandSidebar:()=>$(!1),toggleProjectsSidebar:Q=>{if(Q){V(!1),$(ie=>!ie);return}V(ie=>!ie)},updateScrollState:Sr,scrollToBottom:It,handleCreateChat:ut,handleCreateFeature:mt,handleOpenFeatureOverview:yn,handleCloseCreateFeatureModal:Te,handleConfirmCreateFeature:je,handleRenameFeature:Tt,handleDeleteFeature:it,handleSetProjectBrowserState:an,handleSetProjectGeneralChatsBrowserState:$t,handleSetFeatureBrowserState:Yt,handleSetFeatureStage:K,handleSetChatFeature:Xt,handleReorderFeatures:Gn,handleOpenLocalProject:Ss,handleHideLocalProject:At,handleListDirectories:mo,handleCreateProject:Hc,handleCheckForUpdates:da,handleInstallUpdate:po,handleRefreshProviderUsage:mn,handleOpenProviderLogin:ui,handleCloseCursorCurlImport:()=>ke(!1),handleSubmitCursorCurlImport:ua,handleSetCommitProjectMetadataDirectory:fo,handleSend:Mn,handleCancel:ah,handleDeleteChat:lh,handleRemoveProject:Cs,handleUpdateFeatureOverview:Ie,handleOpenExternal:go,handleOpenExternalPath:ch,handleOpenLocalLink:Xp,handleCompose:Zp,handleAskUserQuestion:hl,handleExitPlanMode:fl}}function Ad(e){return[...e.features.flatMap(t=>t.chats),...e.generalChats]}function VY(e){const t=new Set;return e.filter(n=>{const r=n.localPath??n.projectId;return!r||t.has(r)?!1:(t.add(r),!0)})}function qY(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const KY=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,GY=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,YY={};function rR(e,t){return(YY.jsx?GY:KY).test(e)}const XY=/[ \t\n\f\r]/g;function ZY(e){return typeof e=="object"?e.type==="text"?iR(e.value):!1:iR(e)}function iR(e){return e.replace(XY,"")===""}class ih{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ih.prototype.normal={};ih.prototype.property={};ih.prototype.space=void 0;function lj(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ih(n,r,t)}function tx(e){return e.toLowerCase()}class qr{constructor(t,n){this.attribute=n,this.property=t}}qr.prototype.attribute="";qr.prototype.booleanish=!1;qr.prototype.boolean=!1;qr.prototype.commaOrSpaceSeparated=!1;qr.prototype.commaSeparated=!1;qr.prototype.defined=!1;qr.prototype.mustUseProperty=!1;qr.prototype.number=!1;qr.prototype.overloadedBoolean=!1;qr.prototype.property="";qr.prototype.spaceSeparated=!1;qr.prototype.space=void 0;let QY=0;const ht=ul(),Ln=ul(),nx=ul(),Re=ul(),on=ul(),mc=ul(),ri=ul();function ul(){return 2**++QY}const rx=Object.freeze(Object.defineProperty({__proto__:null,boolean:ht,booleanish:Ln,commaOrSpaceSeparated:ri,commaSeparated:mc,number:Re,overloadedBoolean:nx,spaceSeparated:on},Symbol.toStringTag,{value:"Module"})),r_=Object.keys(rx);class H0 extends qr{constructor(t,n,r,s){let o=-1;if(super(t,n),sR(this,"space",s),typeof r=="number")for(;++o<r_.length;){const l=r_[o];sR(this,r_[o],(r&rx[l])===rx[l])}}}H0.prototype.defined=!0;function sR(e,t,n){n&&(e[t]=n)}function Pc(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const o=new H0(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[tx(r)]=r,n[tx(o.attribute)]=r}return new ih(t,n,e.space)}const cj=Pc({properties:{ariaActiveDescendant:null,ariaAtomic:Ln,ariaAutoComplete:null,ariaBusy:Ln,ariaChecked:Ln,ariaColCount:Re,ariaColIndex:Re,ariaColSpan:Re,ariaControls:on,ariaCurrent:null,ariaDescribedBy:on,ariaDetails:null,ariaDisabled:Ln,ariaDropEffect:on,ariaErrorMessage:null,ariaExpanded:Ln,ariaFlowTo:on,ariaGrabbed:Ln,ariaHasPopup:null,ariaHidden:Ln,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:on,ariaLevel:Re,ariaLive:null,ariaModal:Ln,ariaMultiLine:Ln,ariaMultiSelectable:Ln,ariaOrientation:null,ariaOwns:on,ariaPlaceholder:null,ariaPosInSet:Re,ariaPressed:Ln,ariaReadOnly:Ln,ariaRelevant:null,ariaRequired:Ln,ariaRoleDescription:on,ariaRowCount:Re,ariaRowIndex:Re,ariaRowSpan:Re,ariaSelected:Ln,ariaSetSize:Re,ariaSort:null,ariaValueMax:Re,ariaValueMin:Re,ariaValueNow:Re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function uj(e,t){return t in e?e[t]:t}function dj(e,t){return uj(e,t.toLowerCase())}const JY=Pc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mc,acceptCharset:on,accessKey:on,action:null,allow:null,allowFullScreen:ht,allowPaymentRequest:ht,allowUserMedia:ht,alt:null,as:null,async:ht,autoCapitalize:null,autoComplete:on,autoFocus:ht,autoPlay:ht,blocking:on,capture:null,charSet:null,checked:ht,cite:null,className:on,cols:Re,colSpan:null,content:null,contentEditable:Ln,controls:ht,controlsList:on,coords:Re|mc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ht,defer:ht,dir:null,dirName:null,disabled:ht,download:nx,draggable:Ln,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ht,formTarget:null,headers:on,height:Re,hidden:nx,high:Re,href:null,hrefLang:null,htmlFor:on,httpEquiv:on,id:null,imageSizes:null,imageSrcSet:null,inert:ht,inputMode:null,integrity:null,is:null,isMap:ht,itemId:null,itemProp:on,itemRef:on,itemScope:ht,itemType:on,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ht,low:Re,manifest:null,max:null,maxLength:Re,media:null,method:null,min:null,minLength:Re,multiple:ht,muted:ht,name:null,nonce:null,noModule:ht,noValidate:ht,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:ht,optimum:Re,pattern:null,ping:on,placeholder:null,playsInline:ht,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ht,referrerPolicy:null,rel:on,required:ht,reversed:ht,rows:Re,rowSpan:Re,sandbox:on,scope:null,scoped:ht,seamless:ht,selected:ht,shadowRootClonable:ht,shadowRootDelegatesFocus:ht,shadowRootMode:null,shape:null,size:Re,sizes:null,slot:null,span:Re,spellCheck:Ln,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Re,step:null,style:null,tabIndex:Re,target:null,title:null,translate:null,type:null,typeMustMatch:ht,useMap:null,value:Ln,width:Re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:on,axis:null,background:null,bgColor:null,border:Re,borderColor:null,bottomMargin:Re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ht,declare:ht,event:null,face:null,frame:null,frameBorder:null,hSpace:Re,leftMargin:Re,link:null,longDesc:null,lowSrc:null,marginHeight:Re,marginWidth:Re,noResize:ht,noHref:ht,noShade:ht,noWrap:ht,object:null,profile:null,prompt:null,rev:null,rightMargin:Re,rules:null,scheme:null,scrolling:Ln,standby:null,summary:null,text:null,topMargin:Re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ht,disableRemotePlayback:ht,prefix:null,property:null,results:Re,security:null,unselectable:null},space:"html",transform:dj}),eX=Pc({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:ri,accentHeight:Re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Re,amplitude:Re,arabicForm:null,ascent:Re,attributeName:null,attributeType:null,azimuth:Re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Re,by:null,calcMode:null,capHeight:Re,className:on,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:Re,diffuseConstant:Re,direction:null,display:null,dur:null,divisor:Re,dominantBaseline:null,download:ht,dx:null,dy:null,edgeMode:null,editable:null,elevation:Re,enableBackground:null,end:null,event:null,exponent:Re,externalResourcesRequired:null,fill:null,fillOpacity:Re,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:mc,g2:mc,glyphName:mc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Re,horizOriginX:Re,horizOriginY:Re,id:null,ideographic:Re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Re,k:Re,k1:Re,k2:Re,k3:Re,k4:Re,kernelMatrix:ri,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Re,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:Re,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:Re,overlineThickness:Re,paintOrder:null,panose1:null,path:null,pathLength:Re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:on,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Re,pointsAtY:Re,pointsAtZ:Re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ri,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ri,rev:ri,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ri,requiredFeatures:ri,requiredFonts:ri,requiredFormats:ri,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:Re,specularExponent:Re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Re,strikethroughThickness:Re,string:null,stroke:null,strokeDashArray:ri,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Re,strokeOpacity:Re,strokeWidth:null,style:null,surfaceScale:Re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ri,tabIndex:Re,tableValues:null,target:null,targetX:Re,targetY:Re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ri,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Re,underlineThickness:Re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Re,values:null,vAlphabetic:Re,vMathematical:Re,vectorEffect:null,vHanging:Re,vIdeographic:Re,version:null,vertAdvY:Re,vertOriginX:Re,vertOriginY:Re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:uj}),hj=Pc({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()}}),fj=Pc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dj}),mj=Pc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),tX={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"},nX=/[A-Z]/g,oR=/-[a-z]/g,rX=/^data[-\w.:]+$/i;function iX(e,t){const n=tx(t);let r=t,s=qr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rX.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(oR,oX);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!oR.test(o)){let l=o.replace(nX,sX);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=H0}return new s(r,t)}function sX(e){return"-"+e.toLowerCase()}function oX(e){return e.charAt(1).toUpperCase()}const aX=lj([cj,JY,hj,fj,mj],"html"),U0=lj([cj,eX,hj,fj,mj],"svg");function lX(e){return e.join(" ").trim()}var ec={},i_,aR;function cX(){if(aR)return i_;aR=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,h=`
|
|
593
|
+
`,d="/",g="*",p="",v="comment",y="declaration";function w(C,k){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];k=k||{};var R=1,E=1;function M(F){var V=F.match(t);V&&(R+=V.length);var O=F.lastIndexOf(h);E=~O?F.length-O:E+F.length}function L(){var F={line:R,column:E};return function(V){return V.position=new j(F),G(),V}}function j(F){this.start=F,this.end={line:R,column:E},this.source=k.source}j.prototype.content=C;function D(F){var V=new Error(k.source+":"+R+":"+E+": "+F);if(V.reason=F,V.filename=k.source,V.line=R,V.column=E,V.source=C,!k.silent)throw V}function H(F){var V=F.exec(C);if(V){var O=V[0];return M(O),C=C.slice(O.length),V}}function G(){H(n)}function I(F){var V;for(F=F||[];V=q();)V!==!1&&F.push(V);return F}function q(){var F=L();if(!(d!=C.charAt(0)||g!=C.charAt(1))){for(var V=2;p!=C.charAt(V)&&(g!=C.charAt(V)||d!=C.charAt(V+1));)++V;if(V+=2,p===C.charAt(V-1))return D("End of comment missing");var O=C.slice(2,V-2);return E+=2,M(O),C=C.slice(V),E+=2,F({type:v,comment:O})}}function B(){var F=L(),V=H(r);if(V){if(q(),!H(s))return D("property missing ':'");var O=H(o),$=F({type:y,property:S(V[0].replace(e,p)),value:O?S(O[0].replace(e,p)):p});return H(l),$}}function W(){var F=[];I(F);for(var V;V=B();)V!==!1&&(F.push(V),I(F));return F}return G(),W()}function S(C){return C?C.replace(u,p):p}return i_=w,i_}var lR;function uX(){if(lR)return ec;lR=1;var e=ec&&ec.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ec,"__esModule",{value:!0}),ec.default=n;const t=e(cX());function n(r,s){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:g}=h;u?s(d,g,h):g&&(o=o||{},o[d]=g)}),o}return ec}var Hu={},cR;function dX(){if(cR)return Hu;cR=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},l=function(d,g){return g.toUpperCase()},u=function(d,g){return"".concat(g,"-")},h=function(d,g){return g===void 0&&(g={}),o(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(s,u):d=d.replace(r,u),d.replace(t,l))};return Hu.camelCase=h,Hu}var Uu,uR;function hX(){if(uR)return Uu;uR=1;var e=Uu&&Uu.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(uX()),n=dX();function r(s,o){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,h){u&&h&&(l[(0,n.camelCase)(u,o)]=h)}),l}return r.default=r,Uu=r,Uu}var fX=hX();const mX=np(fX),pj=gj("end"),$0=gj("start");function gj(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 pX(e){const t=$0(e),n=pj(e);if(t&&n)return{start:t,end:n}}function md(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?dR(e.position):"start"in e||"end"in e?dR(e):"line"in e||"column"in e?ix(e):""}function ix(e){return hR(e&&e.line)+":"+hR(e&&e.column)}function dR(e){return ix(e&&e.start)+"-"+ix(e&&e.end)}function hR(e){return e&&typeof e=="number"?e:1}class wr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(l=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?o.ruleId=r:(o.source=r.slice(0,h),o.ruleId=r.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.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=md(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wr.prototype.file="";wr.prototype.name="";wr.prototype.reason="";wr.prototype.message="";wr.prototype.stack="";wr.prototype.column=void 0;wr.prototype.line=void 0;wr.prototype.ancestors=void 0;wr.prototype.cause=void 0;wr.prototype.fatal=void 0;wr.prototype.place=void 0;wr.prototype.ruleId=void 0;wr.prototype.source=void 0;const W0={}.hasOwnProperty,gX=new Map,vX=/[A-Z]/g,bX=new Set(["table","tbody","thead","tfoot","tr"]),_X=new Set(["td","th"]),vj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yX(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=TX(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=RX(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"?U0:aX,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=bj(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function bj(e,t,n){if(t.type==="element")return xX(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return wX(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return CX(e,t,n);if(t.type==="mdxjsEsm")return SX(e,t);if(t.type==="root")return kX(e,t,n);if(t.type==="text")return EX(e,t)}function xX(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=U0,e.schema=s),e.ancestors.push(t);const o=yj(e,t.tagName,!1),l=NX(e,t);let u=q0(e,t);return bX.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!ZY(h):!0})),_j(e,l,o,t),V0(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function wX(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)}Dd(e,t.position)}function SX(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Dd(e,t.position)}function CX(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=U0,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:yj(e,t.name,!0),l=MX(e,t),u=q0(e,t);return _j(e,l,o,t),V0(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function kX(e,t,n){const r={};return V0(r,q0(e,t)),e.create(t,e.Fragment,r,n)}function EX(e,t){return t.value}function _j(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function V0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function RX(e,t,n){return r;function r(s,o,l,u){const d=Array.isArray(l.children)?n:t;return u?d(o,l,u):d(o,l)}}function TX(e,t){return n;function n(r,s,o,l){const u=Array.isArray(o.children),h=$0(r);return t(s,o,l,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function NX(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&W0.call(t.properties,s)){const o=AX(e,s,t.properties[s]);if(o){const[l,u]=o;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&_X.has(t.tagName)?r=u:n[l]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function MX(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Dd(e,t.position);else{const s=r.name;let o;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,o=e.evaluater.evaluateExpression(u.expression)}else Dd(e,t.position);else o=r.value===null?!0:r.value;n[s]=o}return n}function q0(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:gX;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const d=s.get(h)||0;l=h+"-"+d,s.set(h,d+1)}}const u=bj(e,o,l);u!==void 0&&n.push(u)}return n}function AX(e,t,n){const r=iX(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qY(n):lX(n)),r.property==="style"){let s=typeof n=="object"?n:DX(e,String(n));return e.stylePropertyNameCase==="css"&&(s=jX(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?tX[r.property]||r.property:r.attribute,n]}}function DX(e,t){try{return mX(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new wr("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=vj+"#cannot-parse-style-attribute",s}}function yj(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,l;for(;++o<s.length;){const u=rR(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(o&&u.type==="Literal"),optional:!1}:u}r=l}else r=rR(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return W0.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Dd(e)}function Dd(e,t){const n=new wr("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=vj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function jX(e){const t={};let n;for(n in e)W0.call(e,n)&&(t[OX(n)]=e[n]);return t}function OX(e){let t=e.replace(vX,LX);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function LX(e){return"-"+e.toLowerCase()}const s_={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"]},zX={};function K0(e,t){const n=zX,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return xj(e,r,s)}function xj(e,t,n){if(PX(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 fR(e.children,t,n)}return Array.isArray(e)?fR(e,t,n):""}function fR(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=xj(e[s],t,n);return r.join("")}function PX(e){return!!(e&&typeof e=="object")}const mR=document.createElement("i");function G0(e){const t="&"+e+";";mR.innerHTML=t;const n=mR.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ai(e,t,n,r){const s=e.length;let o=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);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function Ti(e,t){return e.length>0?(ai(e,e.length,0,t),e):t}const pR={}.hasOwnProperty;function wj(e){const t={};let n=-1;for(;++n<e.length;)BX(t,e[n]);return t}function BX(e,t){let n;for(n in t){const s=(pR.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){pR.call(s,l)||(s[l]=[]);const u=o[l];IX(s[l],Array.isArray(u)?u:u?[u]:[])}}}function IX(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ai(e,0,0,r)}function Sj(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 Wi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nr=ca(/[A-Za-z]/),yr=ca(/[\dA-Za-z]/),FX=ca(/[#-'*+\--9=?A-Z^-~]/);function Zm(e){return e!==null&&(e<32||e===127)}const sx=ca(/\d/),HX=ca(/[\dA-Fa-f]/),UX=ca(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function sn(e){return e!==null&&(e<0||e===32)}function kt(e){return e===-2||e===-1||e===32}const Vp=ca(new RegExp("\\p{P}|\\p{S}","u")),nl=ca(/\s/);function ca(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Bc(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&yr(e.charCodeAt(n+1))&&yr(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(l=String.fromCharCode(o,u),s=1):l="�"}else l=String.fromCharCode(o);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 Ot(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(h){return kt(h)?(e.enter(n),u(h)):t(h)}function u(h){return kt(h)&&o++<s?(e.consume(h),u):(e.exit(n),t(h))}}const $X={tokenize:WX};function WX(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"),Ot(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),o(u)}function o(u){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Je(u)?(e.consume(u),e.exit("chunkText"),o):(e.consume(u),l)}}const VX={tokenize:qX},gR={tokenize:KX};function qX(e){const t=this,n=[];let r=0,s,o,l;return u;function u(E){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,h,d)(E)}return d(E)}function h(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&R();const M=t.events.length;let L=M,j;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){j=t.events[L][1].end;break}k(r);let D=M;for(;D<t.events.length;)t.events[D][1].end={...j},D++;return ai(t.events,L+1,0,t.events.slice(M)),t.events.length=D,d(E)}return u(E)}function d(E){if(r===n.length){if(!s)return v(E);if(s.currentConstruct&&s.currentConstruct.concrete)return w(E);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gR,g,p)(E)}function g(E){return s&&R(),k(r),v(E)}function p(E){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(E)}function v(E){return t.containerState={},e.attempt(gR,y,w)(E)}function y(E){return r++,n.push([t.currentConstruct,t.containerState]),v(E)}function w(E){if(E===null){s&&R(),k(0),e.consume(E);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),S(E)}function S(E){if(E===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(E);return}return Je(E)?(e.consume(E),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(E),S)}function C(E,M){const L=t.sliceStream(E);if(M&&L.push(null),E.previous=o,o&&(o.next=E),o=E,s.defineSkip(E.start),s.write(L),t.parser.lazy[E.start.line]){let j=s.events.length;for(;j--;)if(s.events[j][1].start.offset<l&&(!s.events[j][1].end||s.events[j][1].end.offset>l))return;const D=t.events.length;let H=D,G,I;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(G){I=t.events[H][1].end;break}G=!0}for(k(r),j=D;j<t.events.length;)t.events[j][1].end={...I},j++;ai(t.events,H+1,0,t.events.slice(D)),t.events.length=j}}function k(E){let M=n.length;for(;M-- >E;){const L=n[M];t.containerState=L[1],L[0].exit.call(t,e)}n.length=E}function R(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function KX(e,t,n){return Ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wc(e){if(e===null||sn(e)||nl(e))return 1;if(Vp(e))return 2}function qp(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ox={name:"attention",resolveAll:GX,tokenize:YX};function GX(e,t){let n=-1,r,s,o,l,u,h,d,g;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;h=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 p={...e[r][1].end},v={...e[n][1].start};vR(p,-h),vR(v,h),l={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},u={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Ti(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Ti(d,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=Ti(d,qp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Ti(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,d=Ti(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,ai(e,r-1,n-r+3,d),n=r+d.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function YX(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=wc(r);let o;return l;function l(h){return o=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===o)return e.consume(h),u;const d=e.exit("attentionSequence"),g=wc(h),p=!g||g===2&&s||n.includes(h),v=!s||s===2&&g||n.includes(r);return d._open=!!(o===42?p:p&&(s||!v)),d._close=!!(o===42?v:v&&(g||!p)),t(h)}}function vR(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const XX={name:"autolink",tokenize:ZX};function ZX(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"),o}function o(y){return Nr(y)?(e.consume(y),l):y===64?n(y):d(y)}function l(y){return y===43||y===45||y===46||yr(y)?(r=1,u(y)):d(y)}function u(y){return y===58?(e.consume(y),r=0,h):(y===43||y===45||y===46||yr(y))&&r++<32?(e.consume(y),u):(r=0,d(y))}function h(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||Zm(y)?n(y):(e.consume(y),h)}function d(y){return y===64?(e.consume(y),g):FX(y)?(e.consume(y),d):n(y)}function g(y){return yr(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,g):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):v(y)}function v(y){if((y===45||yr(y))&&r++<63){const w=y===45?v:p;return e.consume(y),w}return n(y)}}const sh={partial:!0,tokenize:QX};function QX(e,t,n){return r;function r(o){return kt(o)?Ot(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||Je(o)?t(o):n(o)}}const Cj={continuation:{tokenize:eZ},exit:tZ,name:"blockQuote",tokenize:JX};function JX(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"),o}return n(l)}function o(l){return kt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function eZ(e,t,n){const r=this;return s;function s(l){return kt(l)?Ot(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Cj,t,n)(l)}}function tZ(e){e.exit("blockQuote")}const kj={name:"characterEscape",tokenize:nZ};function nZ(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return UX(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ej={name:"characterReference",tokenize:rZ};function rZ(e,t,n){const r=this;let s=0,o,l;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,l=yr,g(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=HX,g):(e.enter("characterReferenceValue"),o=7,l=sx,g(p))}function g(p){if(p===59&&s){const v=e.exit("characterReferenceValue");return l===yr&&!G0(r.sliceSerialize(v))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&s++<o?(e.consume(p),g):n(p)}}const bR={partial:!0,tokenize:sZ},_R={concrete:!0,name:"codeFenced",tokenize:iZ};function iZ(e,t,n){const r=this,s={partial:!0,tokenize:L};let o=0,l=0,u;return h;function h(j){return d(j)}function d(j){const D=r.events[r.events.length-1];return o=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,u=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(j)}function g(j){return j===u?(l++,e.consume(j),g):l<3?n(j):(e.exit("codeFencedFenceSequence"),kt(j)?Ot(e,p,"whitespace")(j):p(j))}function p(j){return j===null||Je(j)?(e.exit("codeFencedFence"),r.interrupt?t(j):e.check(bR,S,M)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(j))}function v(j){return j===null||Je(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(j)):kt(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ot(e,y,"whitespace")(j)):j===96&&j===u?n(j):(e.consume(j),v)}function y(j){return j===null||Je(j)?p(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(j))}function w(j){return j===null||Je(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(j)):j===96&&j===u?n(j):(e.consume(j),w)}function S(j){return e.attempt(s,M,C)(j)}function C(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),k}function k(j){return o>0&&kt(j)?Ot(e,R,"linePrefix",o+1)(j):R(j)}function R(j){return j===null||Je(j)?e.check(bR,S,M)(j):(e.enter("codeFlowValue"),E(j))}function E(j){return j===null||Je(j)?(e.exit("codeFlowValue"),R(j)):(e.consume(j),E)}function M(j){return e.exit("codeFenced"),t(j)}function L(j,D,H){let G=0;return I;function I(V){return j.enter("lineEnding"),j.consume(V),j.exit("lineEnding"),q}function q(V){return j.enter("codeFencedFence"),kt(V)?Ot(j,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):B(V)}function B(V){return V===u?(j.enter("codeFencedFenceSequence"),W(V)):H(V)}function W(V){return V===u?(G++,j.consume(V),W):G>=l?(j.exit("codeFencedFenceSequence"),kt(V)?Ot(j,F,"whitespace")(V):F(V)):H(V)}function F(V){return V===null||Je(V)?(j.exit("codeFencedFence"),D(V)):H(V)}}}function sZ(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"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const o_={name:"codeIndented",tokenize:aZ},oZ={partial:!0,tokenize:lZ};function aZ(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),Ot(e,o,"linePrefix",5)(d)}function o(d){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?h(d):Je(d)?e.attempt(oZ,l,h)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Je(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),u)}function h(d){return e.exit("codeIndented"),t(d)}}function lZ(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):Je(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):Ot(e,o,"linePrefix",5)(l)}function o(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):Je(l)?s(l):n(l)}}const cZ={name:"codeText",previous:dZ,resolve:uZ,tokenize:hZ};function uZ(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 dZ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function hZ(e,t,n){let r=0,s,o;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),r++,u):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(o=e.enter("codeTextSequence"),s=0,g(p)):Je(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||Je(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),d)}function g(p){return p===96?(e.consume(p),s++,g):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(o.type="codeTextData",d(p))}}class fZ{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 o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&$u(this.left,r),o.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),$u(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$u(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);$u(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$u(this.left,n.reverse())}}}function $u(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 Rj(e){const t={};let n=-1,r,s,o,l,u,h,d;const g=new fZ(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(r=g.get(n),n&&r[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,mZ(g,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,s=void 0;o--;)if(l=g.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...g.get(s)[1].start},u=g.slice(s,n),u.unshift(r),g.splice(s,n-s+1,u))}}return ai(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function mZ(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,h=[],d={};let g,p,v=-1,y=n,w=0,S=0;const C=[S];for(;y;){for(;e.get(++s)[1]!==y;);o.push(s),y._tokenizer||(g=r.sliceStream(y),y.next||g.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++v<u.length;)u[v][0]==="exit"&&u[v-1][0]==="enter"&&u[v][1].type===u[v-1][1].type&&u[v][1].start.line!==u[v][1].end.line&&(S=v+1,C.push(S),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(),v=C.length;v--;){const k=u.slice(C[v],C[v+1]),R=o.pop();h.push([R,R+k.length-1]),e.splice(R,2,k)}for(h.reverse(),v=-1;++v<h.length;)d[w+h[v][0]]=w+h[v][1],w+=h[v][1]-h[v][0]-1;return d}const pZ={resolve:vZ,tokenize:bZ},gZ={partial:!0,tokenize:_Z};function vZ(e){return Rj(e),e}function bZ(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?o(u):Je(u)?e.check(gZ,l,o)(u):(e.consume(u),s)}function o(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 _Z(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ot(e,o,"linePrefix")}function o(l){if(l===null||Je(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 Tj(e,t,n,r,s,o,l,u,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return p;function p(k){return k===60?(e.enter(r),e.enter(s),e.enter(o),e.consume(k),e.exit(o),v):k===null||k===32||k===41||Zm(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(k))}function v(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),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),v(k)):k===null||k===60||Je(k)?n(k):(e.consume(k),k===92?w:y)}function w(k){return k===60||k===62||k===92?(e.consume(k),y):y(k)}function S(k){return!g&&(k===null||k===41||sn(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(k)):g<d&&k===40?(e.consume(k),g++,S):k===41?(e.consume(k),g--,S):k===null||k===32||k===40||Zm(k)?n(k):(e.consume(k),k===92?C:S)}function C(k){return k===40||k===41||k===92?(e.consume(k),S):S(k)}}function Nj(e,t,n,r,s,o){const l=this;let u=0,h;return d;function d(y){return e.enter(r),e.enter(s),e.consume(y),e.exit(s),e.enter(o),g}function g(y){return u>999||y===null||y===91||y===93&&!h||y===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(o),e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):Je(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||Je(y)||u++>999?(e.exit("chunkString"),g(y)):(e.consume(y),h||(h=!kt(y)),y===92?v:p)}function v(y){return y===91||y===92||y===93?(e.consume(y),u++,p):p(y)}}function Mj(e,t,n,r,s,o){let l;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(s),e.consume(v),e.exit(s),l=v===40?41:v,h):n(v)}function h(v){return v===l?(e.enter(s),e.consume(v),e.exit(s),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===l?(e.exit(o),h(l)):v===null?n(v):Je(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Ot(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===l||v===null||Je(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?p:g)}function p(v){return v===l||v===92?(e.consume(v),g):g(v)}}function pd(e,t){let n;return r;function r(s){return Je(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):kt(s)?Ot(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const yZ={name:"definition",tokenize:wZ},xZ={partial:!0,tokenize:SZ};function wZ(e,t,n){const r=this;let s;return o;function o(y){return e.enter("definition"),l(y)}function l(y){return Nj.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function u(y){return s=Wi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),h):n(y)}function h(y){return sn(y)?pd(e,d)(y):d(y)}function d(y){return Tj(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(xZ,p,p)(y)}function p(y){return kt(y)?Ot(e,v,"whitespace")(y):v(y)}function v(y){return y===null||Je(y)?(e.exit("definition"),r.parser.defined.push(s),t(y)):n(y)}}function SZ(e,t,n){return r;function r(u){return sn(u)?pd(e,s)(u):n(u)}function s(u){return Mj(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return kt(u)?Ot(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Je(u)?t(u):n(u)}}const CZ={name:"hardBreakEscape",tokenize:kZ};function kZ(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Je(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const EZ={name:"headingAtx",resolve:RZ,tokenize:TZ};function RZ(e,t){let n=e.length-2,r=3,s,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ai(e,r,n-r+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function TZ(e,t,n){let r=0;return s;function s(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&r++<6?(e.consume(g),l):g===null||sn(g)?(e.exit("atxHeadingSequence"),u(g)):n(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Je(g)?(e.exit("atxHeading"),t(g)):kt(g)?Ot(e,u,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),u(g))}function d(g){return g===null||g===35||sn(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),d)}}const NZ=["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"],yR=["pre","script","style","textarea"],MZ={concrete:!0,name:"htmlFlow",resolveTo:jZ,tokenize:OZ},AZ={partial:!0,tokenize:zZ},DZ={partial:!0,tokenize:LZ};function jZ(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 OZ(e,t,n){const r=this;let s,o,l,u,h;return d;function d(N){return g(N)}function g(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),p}function p(N){return N===33?(e.consume(N),v):N===47?(e.consume(N),o=!0,S):N===63?(e.consume(N),s=3,r.interrupt?t:A):Nr(N)?(e.consume(N),l=String.fromCharCode(N),C):n(N)}function v(N){return N===45?(e.consume(N),s=2,y):N===91?(e.consume(N),s=5,u=0,w):Nr(N)?(e.consume(N),s=4,r.interrupt?t:A):n(N)}function y(N){return N===45?(e.consume(N),r.interrupt?t:A):n(N)}function w(N){const ne="CDATA[";return N===ne.charCodeAt(u++)?(e.consume(N),u===ne.length?r.interrupt?t:B:w):n(N)}function S(N){return Nr(N)?(e.consume(N),l=String.fromCharCode(N),C):n(N)}function C(N){if(N===null||N===47||N===62||sn(N)){const ne=N===47,oe=l.toLowerCase();return!ne&&!o&&yR.includes(oe)?(s=1,r.interrupt?t(N):B(N)):NZ.includes(l.toLowerCase())?(s=6,ne?(e.consume(N),k):r.interrupt?t(N):B(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?R(N):E(N))}return N===45||yr(N)?(e.consume(N),l+=String.fromCharCode(N),C):n(N)}function k(N){return N===62?(e.consume(N),r.interrupt?t:B):n(N)}function R(N){return kt(N)?(e.consume(N),R):I(N)}function E(N){return N===47?(e.consume(N),I):N===58||N===95||Nr(N)?(e.consume(N),M):kt(N)?(e.consume(N),E):I(N)}function M(N){return N===45||N===46||N===58||N===95||yr(N)?(e.consume(N),M):L(N)}function L(N){return N===61?(e.consume(N),j):kt(N)?(e.consume(N),L):E(N)}function j(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),h=N,D):kt(N)?(e.consume(N),j):H(N)}function D(N){return N===h?(e.consume(N),h=null,G):N===null||Je(N)?n(N):(e.consume(N),D)}function H(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||sn(N)?L(N):(e.consume(N),H)}function G(N){return N===47||N===62||kt(N)?E(N):n(N)}function I(N){return N===62?(e.consume(N),q):n(N)}function q(N){return N===null||Je(N)?B(N):kt(N)?(e.consume(N),q):n(N)}function B(N){return N===45&&s===2?(e.consume(N),O):N===60&&s===1?(e.consume(N),$):N===62&&s===4?(e.consume(N),P):N===63&&s===3?(e.consume(N),A):N===93&&s===5?(e.consume(N),Y):Je(N)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(AZ,X,W)(N)):N===null||Je(N)?(e.exit("htmlFlowData"),W(N)):(e.consume(N),B)}function W(N){return e.check(DZ,F,X)(N)}function F(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),V}function V(N){return N===null||Je(N)?W(N):(e.enter("htmlFlowData"),B(N))}function O(N){return N===45?(e.consume(N),A):B(N)}function $(N){return N===47?(e.consume(N),l="",U):B(N)}function U(N){if(N===62){const ne=l.toLowerCase();return yR.includes(ne)?(e.consume(N),P):B(N)}return Nr(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),U):B(N)}function Y(N){return N===93?(e.consume(N),A):B(N)}function A(N){return N===62?(e.consume(N),P):N===45&&s===2?(e.consume(N),A):B(N)}function P(N){return N===null||Je(N)?(e.exit("htmlFlowData"),X(N)):(e.consume(N),P)}function X(N){return e.exit("htmlFlow"),t(N)}}function LZ(e,t,n){const r=this;return s;function s(l){return Je(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function zZ(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(sh,t,n)}}const PZ={name:"htmlText",tokenize:BZ};function BZ(e,t,n){const r=this;let s,o,l;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),L):A===63?(e.consume(A),E):Nr(A)?(e.consume(A),H):n(A)}function d(A){return A===45?(e.consume(A),g):A===91?(e.consume(A),o=0,w):Nr(A)?(e.consume(A),R):n(A)}function g(A){return A===45?(e.consume(A),y):n(A)}function p(A){return A===null?n(A):A===45?(e.consume(A),v):Je(A)?(l=p,$(A)):(e.consume(A),p)}function v(A){return A===45?(e.consume(A),y):p(A)}function y(A){return A===62?O(A):A===45?v(A):p(A)}function w(A){const P="CDATA[";return A===P.charCodeAt(o++)?(e.consume(A),o===P.length?S:w):n(A)}function S(A){return A===null?n(A):A===93?(e.consume(A),C):Je(A)?(l=S,$(A)):(e.consume(A),S)}function C(A){return A===93?(e.consume(A),k):S(A)}function k(A){return A===62?O(A):A===93?(e.consume(A),k):S(A)}function R(A){return A===null||A===62?O(A):Je(A)?(l=R,$(A)):(e.consume(A),R)}function E(A){return A===null?n(A):A===63?(e.consume(A),M):Je(A)?(l=E,$(A)):(e.consume(A),E)}function M(A){return A===62?O(A):E(A)}function L(A){return Nr(A)?(e.consume(A),j):n(A)}function j(A){return A===45||yr(A)?(e.consume(A),j):D(A)}function D(A){return Je(A)?(l=D,$(A)):kt(A)?(e.consume(A),D):O(A)}function H(A){return A===45||yr(A)?(e.consume(A),H):A===47||A===62||sn(A)?G(A):n(A)}function G(A){return A===47?(e.consume(A),O):A===58||A===95||Nr(A)?(e.consume(A),I):Je(A)?(l=G,$(A)):kt(A)?(e.consume(A),G):O(A)}function I(A){return A===45||A===46||A===58||A===95||yr(A)?(e.consume(A),I):q(A)}function q(A){return A===61?(e.consume(A),B):Je(A)?(l=q,$(A)):kt(A)?(e.consume(A),q):G(A)}function B(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,W):Je(A)?(l=B,$(A)):kt(A)?(e.consume(A),B):(e.consume(A),F)}function W(A){return A===s?(e.consume(A),s=void 0,V):A===null?n(A):Je(A)?(l=W,$(A)):(e.consume(A),W)}function F(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||sn(A)?G(A):(e.consume(A),F)}function V(A){return A===47||A===62||sn(A)?G(A):n(A)}function O(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function $(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),U}function U(A){return kt(A)?Ot(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Y(A)}function Y(A){return e.enter("htmlTextData"),l(A)}}const Y0={name:"labelEnd",resolveAll:UZ,resolveTo:$Z,tokenize:WZ},IZ={tokenize:VZ},FZ={tokenize:qZ},HZ={tokenize:KZ};function UZ(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&&ai(e,0,e.length,n),e}function $Z(e,t){let n=e.length,r=0,s,o,l,u;for(;n--;)if(s=e[n][1],o){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&&(o=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",h,t],["enter",d,t]],u=Ti(u,e.slice(o+1,o+r+3)),u=Ti(u,[["enter",g,t]]),u=Ti(u,qp(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),u=Ti(u,[["exit",g,t],e[l-2],e[l-1],["exit",d,t]]),u=Ti(u,e.slice(l+1)),u=Ti(u,[["exit",h,t]]),ai(e,o,e.length,u),e}function WZ(e,t,n){const r=this;let s=r.events.length,o,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){o=r.events[s][1];break}return u;function u(v){return o?o._inactive?p(v):(l=r.parser.defined.includes(Wi(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):n(v)}function h(v){return v===40?e.attempt(IZ,g,l?g:p)(v):v===91?e.attempt(FZ,g,l?d:p)(v):l?g(v):p(v)}function d(v){return e.attempt(HZ,g,p)(v)}function g(v){return t(v)}function p(v){return o._balanced=!0,n(v)}}function VZ(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return sn(p)?pd(e,o)(p):o(p)}function o(p){return p===41?g(p):Tj(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return sn(p)?pd(e,h)(p):g(p)}function u(p){return n(p)}function h(p){return p===34||p===39||p===40?Mj(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function d(p){return sn(p)?pd(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function qZ(e,t,n){const r=this;return s;function s(u){return Nj.call(r,e,o,l,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(Wi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function KZ(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const GZ={name:"labelStartImage",resolveAll:Y0.resolveAll,tokenize:YZ};function YZ(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(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 XZ={name:"labelStartLink",resolveAll:Y0.resolveAll,tokenize:ZZ};function ZZ(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"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const a_={name:"lineEnding",tokenize:QZ};function QZ(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ot(e,t,"linePrefix")}}const vm={name:"thematicBreak",tokenize:JZ};function JZ(e,t,n){let r=0,s;return o;function o(d){return e.enter("thematicBreak"),l(d)}function l(d){return s=d,u(d)}function u(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):r>=3&&(d===null||Je(d))?(e.exit("thematicBreak"),t(d)):n(d)}function h(d){return d===s?(e.consume(d),r++,h):(e.exit("thematicBreakSequence"),kt(d)?Ot(e,u,"whitespace")(d):u(d))}}const Ur={continuation:{tokenize:rQ},exit:sQ,name:"list",tokenize:nQ},eQ={partial:!0,tokenize:oQ},tQ={partial:!0,tokenize:iQ};function nQ(e,t,n){const r=this,s=r.events[r.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(y){const w=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:sx(y)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(vm,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(y)}return n(y)}function h(y){return sx(y)&&++l<10?(e.consume(y),h):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(sh,r.interrupt?n:g,e.attempt(eQ,v,p))}function g(y){return r.containerState.initialBlankLine=!0,o++,v(y)}function p(y){return kt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function rQ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sh,s,o);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ot(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!kt(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(tQ,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ot(e,e.attempt(Ur,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function iQ(e,t,n){const r=this;return Ot(e,s,"listItemIndent",r.containerState.size+1);function s(o){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(o):n(o)}}function sQ(e){e.exit(this.containerState.type)}function oQ(e,t,n){const r=this;return Ot(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const l=r.events[r.events.length-1];return!kt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const xR={name:"setextUnderline",resolveTo:aQ,tokenize:lQ};function aQ(e,t){let n=e.length,r,s,o;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),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function lQ(e,t,n){const r=this;let s;return o;function o(d){let g=r.events.length,p;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){p=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===s?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),kt(d)?Ot(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Je(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const cQ={tokenize:uQ};function uQ(e){const t=this,n=e.attempt(sh,r,e.attempt(this.parser.constructs.flowInitial,s,Ot(e,e.attempt(this.parser.constructs.flow,s,e.attempt(pZ,s)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const dQ={resolveAll:Dj()},hQ=Aj("string"),fQ=Aj("text");function Aj(e){return{resolveAll:Dj(e==="text"?mQ:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],o=n.attempt(s,l,u);return l;function l(g){return d(g)?o(g):u(g)}function u(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return d(g)?(n.exit("data"),o(g)):(n.consume(g),h)}function d(g){if(g===null)return!0;const p=s[g];let v=-1;if(p)for(;++v<p.length;){const y=p[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function Dj(e){return t;function t(n,r){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,r):n}}function mQ(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 o=s.length,l=-1,u=0,h;for(;o--;){const d=s[o];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(d===-2)h=!0,u++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const pQ={42:Ur,43:Ur,45:Ur,48:Ur,49:Ur,50:Ur,51:Ur,52:Ur,53:Ur,54:Ur,55:Ur,56:Ur,57:Ur,62:Cj},gQ={91:yZ},vQ={[-2]:o_,[-1]:o_,32:o_},bQ={35:EZ,42:vm,45:[xR,vm],60:MZ,61:xR,95:vm,96:_R,126:_R},_Q={38:Ej,92:kj},yQ={[-5]:a_,[-4]:a_,[-3]:a_,33:GZ,38:Ej,42:ox,60:[XX,PZ],91:XZ,92:[CZ,kj],93:Y0,95:ox,96:cZ},xQ={null:[ox,dQ]},wQ={null:[42,95]},SQ={null:[]},CQ=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:wQ,contentInitial:gQ,disable:SQ,document:pQ,flow:bQ,flowInitial:vQ,insideSpan:xQ,string:_Q,text:yQ},Symbol.toStringTag,{value:"Module"}));function kQ(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={},o=[];let l=[],u=[];const h={attempt:D(L),check:D(j),consume:R,enter:E,exit:M,interrupt:D(j,{interrupt:!0})},d={code:null,containerState:{},defineSkip:S,events:[],now:w,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:p};let g=t.tokenize.call(d,h);return t.resolveAll&&o.push(t),d;function p(q){return l=Ti(l,q),C(),l[l.length-1]!==null?[]:(H(t,0),d.events=qp(o,d.events,d),d.events)}function v(q,B){return RQ(y(q),B)}function y(q){return EQ(l,q)}function w(){const{_bufferIndex:q,_index:B,line:W,column:F,offset:V}=r;return{_bufferIndex:q,_index:B,line:W,column:F,offset:V}}function S(q){s[q.line]=q.column,I()}function C(){let q;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<B.length;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(q){g=g(q)}function R(q){Je(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,I()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=q}function E(q,B){const W=B||{};return W.type=q,W.start=w(),d.events.push(["enter",W,d]),u.push(W),W}function M(q){const B=u.pop();return B.end=w(),d.events.push(["exit",B,d]),B}function L(q,B){H(q,B.from)}function j(q,B){B.restore()}function D(q,B){return W;function W(F,V,O){let $,U,Y,A;return Array.isArray(F)?X(F):"tokenize"in F?X([F]):P(F);function P(J){return te;function te(ue){const he=ue!==null&&J[ue],ge=ue!==null&&J.null,ke=[...Array.isArray(he)?he:he?[he]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return X(ke)(ue)}}function X(J){return $=J,U=0,J.length===0?O:N(J[U])}function N(J){return te;function te(ue){return A=G(),Y=J,J.partial||(d.currentConstruct=J),J.name&&d.parser.constructs.disable.null.includes(J.name)?oe():J.tokenize.call(B?Object.assign(Object.create(d),B):d,h,ne,oe)(ue)}}function ne(J){return q(Y,A),V}function oe(J){return A.restore(),++U<$.length?N($[U]):O}}}function H(q,B){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&ai(d.events,B,d.events.length-B,q.resolve(d.events.slice(B),d)),q.resolveTo&&(d.events=q.resolveTo(d.events,d))}function G(){const q=w(),B=d.previous,W=d.currentConstruct,F=d.events.length,V=Array.from(u);return{from:F,restore:O};function O(){r=q,d.previous=B,d.currentConstruct=W,d.events.length=F,u=V,I()}}function I(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function EQ(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,o)];else{if(l=e.slice(n,s),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}o>0&&l.push(e[s].slice(0,o))}return l}function RQ(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
594
|
+
`;break}case-3:{l=`\r
|
|
595
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(o)}s=o===-2,r.push(l)}return r.join("")}function TQ(e){const r={constructs:wj([CQ,...(e||{}).extensions||[]]),content:s($X),defined:[],document:s(VX),flow:s(cQ),lazy:{},string:s(hQ),text:s(fQ)};return r;function s(o){return l;function l(u){return kQ(r,o,u)}}}function NQ(e){for(;!Rj(e););return e}const wR=/[\0\t\n\r]/g;function MQ(){let e=1,t="",n=!0,r;return s;function s(o,l,u){const h=[];let d,g,p,v,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),p=0,t="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p<o.length;){if(wR.lastIndex=p,d=wR.exec(o),v=d&&d.index!==void 0?d.index:o.length,y=o.charCodeAt(v),!d){t=o.slice(p);break}if(y===10&&p===v&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),p<v&&(h.push(o.slice(p,v)),e+=v-p),y){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}p=v+1}return u&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const AQ=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DQ(e){return e.replace(AQ,jQ)}function jQ(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return Sj(n.slice(o?2:1),o?16:10)}return G0(n)||e}const jj={}.hasOwnProperty;function OQ(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),LQ(n)(NQ(TQ(n).document().write(MQ()(e,t,!0))))}function LQ(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ae),autolinkProtocol:G,autolinkEmail:G,atxHeading:o(pt),blockQuote:o(ge),characterEscape:G,characterReference:G,codeFenced:o(ke),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(ke,l),codeText:o(Ee,l),codeTextData:G,data:G,codeFlowValue:G,definition:o(De),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Xe),hardBreakEscape:o(at),hardBreakTrailing:o(at),htmlFlow:o(fe,l),htmlFlowData:G,htmlText:o(fe,l),htmlTextData:G,image:o(Ve),label:l,link:o(Ae),listItem:o(lt),listItemValue:v,listOrdered:o(et,p),listUnordered:o(et),paragraph:o(nt),reference:N,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(pt),strong:o(Kt),thematicBreak:o(qe)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:he,autolinkProtocol:ue,blockQuote:h(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:J,characterReference:te,codeFenced:h(C),codeFencedFence:S,codeFencedFenceInfo:y,codeFencedFenceMeta:w,codeFlowValue:I,codeIndented:h(k),codeText:h(V),codeTextData:I,data:I,definition:h(),definitionDestinationString:M,definitionLabelString:R,definitionTitleString:E,emphasis:h(),hardBreakEscape:h(B),hardBreakTrailing:h(B),htmlFlow:h(W),htmlFlowData:I,htmlText:h(F),htmlTextData:I,image:h($),label:Y,labelText:U,lineEnding:q,link:h(O),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ne,resourceDestinationString:A,resourceTitleString:P,resource:X,setextHeading:h(H),setextHeadingLineSequence:D,setextHeadingText:j,strong:h(),thematicBreak:h()}};Oj(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(se){let pe={type:"root",children:[]};const Ne={stack:[pe],tokenStack:[],config:t,enter:u,exit:d,buffer:l,resume:g,data:n},He=[];let Oe=-1;for(;++Oe<se.length;)if(se[Oe][1].type==="listOrdered"||se[Oe][1].type==="listUnordered")if(se[Oe][0]==="enter")He.push(Oe);else{const xt=He.pop();Oe=s(se,xt,Oe)}for(Oe=-1;++Oe<se.length;){const xt=t[se[Oe][0]];jj.call(xt,se[Oe][1].type)&&xt[se[Oe][1].type].call(Object.assign({sliceSerialize:se[Oe][2].sliceSerialize},Ne),se[Oe][1])}if(Ne.tokenStack.length>0){const xt=Ne.tokenStack[Ne.tokenStack.length-1];(xt[1]||SR).call(Ne,void 0,xt[0])}for(pe.position={start:qo(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:qo(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<t.transforms.length;)pe=t.transforms[Oe](pe)||pe;return pe}function s(se,pe,Ne){let He=pe-1,Oe=-1,xt=!1,Bt,Le,Ke,ft;for(;++He<=Ne;){const we=se[He];switch(we[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{we[0]==="enter"?Oe++:Oe--,ft=void 0;break}case"lineEndingBlank":{we[0]==="enter"&&(Bt&&!ft&&!Oe&&!Ke&&(Ke=He),ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ft=void 0}if(!Oe&&we[0]==="enter"&&we[1].type==="listItemPrefix"||Oe===-1&&we[0]==="exit"&&(we[1].type==="listUnordered"||we[1].type==="listOrdered")){if(Bt){let Rt=He;for(Le=void 0;Rt--;){const Gt=se[Rt];if(Gt[1].type==="lineEnding"||Gt[1].type==="lineEndingBlank"){if(Gt[0]==="exit")continue;Le&&(se[Le][1].type="lineEndingBlank",xt=!0),Gt[1].type="lineEnding",Le=Rt}else if(!(Gt[1].type==="linePrefix"||Gt[1].type==="blockQuotePrefix"||Gt[1].type==="blockQuotePrefixWhitespace"||Gt[1].type==="blockQuoteMarker"||Gt[1].type==="listItemIndent"))break}Ke&&(!Le||Ke<Le)&&(Bt._spread=!0),Bt.end=Object.assign({},Le?se[Le][1].start:we[1].end),se.splice(Le||He,0,["exit",Bt,we[2]]),He++,Ne++}if(we[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},we[1].start),end:void 0};Bt=Rt,se.splice(He,0,["enter",Rt,we[2]]),He++,Ne++,Ke=void 0,ft=!0}}}return se[pe][1]._spread=xt,Ne}function o(se,pe){return Ne;function Ne(He){u.call(this,se(He),He),pe&&pe.call(this,He)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(se,pe,Ne){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([pe,Ne||void 0]),se.position={start:qo(pe.start),end:void 0}}function h(se){return pe;function pe(Ne){se&&se.call(this,Ne),d.call(this,Ne)}}function d(se,pe){const Ne=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==se.type&&(pe?pe.call(this,se,He[0]):(He[1]||SR).call(this,se,He[0]));else throw new Error("Cannot close `"+se.type+"` ("+md({start:se.start,end:se.end})+"): it’s not open");Ne.position.end=qo(se.end)}function g(){return K0(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(se){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function y(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=se}function w(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=se}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se.replace(/(\r?\n|\r)$/g,"")}function R(se){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=pe,Ne.identifier=Wi(this.sliceSerialize(se)).toLowerCase()}function E(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.title=se}function M(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.url=se}function L(se){const pe=this.stack[this.stack.length-1];if(!pe.depth){const Ne=this.sliceSerialize(se).length;pe.depth=Ne}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function D(se){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function G(se){const Ne=this.stack[this.stack.length-1].children;let He=Ne[Ne.length-1];(!He||He.type!=="text")&&(He=Se(),He.position={start:qo(se.start),end:void 0},Ne.push(He)),this.stack.push(He)}function I(se){const pe=this.stack.pop();pe.value+=this.sliceSerialize(se),pe.position.end=qo(se.end)}function q(se){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=pe.children[pe.children.length-1];Ne.position.end=qo(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(G.call(this,se),I.call(this,se))}function B(){this.data.atHardBreak=!0}function W(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function F(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function V(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function O(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=pe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function $(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=pe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function U(se){const pe=this.sliceSerialize(se),Ne=this.stack[this.stack.length-2];Ne.label=DQ(pe),Ne.identifier=Wi(pe).toLowerCase()}function Y(){const se=this.stack[this.stack.length-1],pe=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const He=se.children;Ne.children=He}else Ne.alt=pe}function A(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.url=se}function P(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.title=se}function X(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ne(se){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=pe,Ne.identifier=Wi(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function oe(se){this.data.characterReferenceType=se.type}function J(se){const pe=this.sliceSerialize(se),Ne=this.data.characterReferenceType;let He;Ne?(He=Sj(pe,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=G0(pe);const Oe=this.stack[this.stack.length-1];Oe.value+=He}function te(se){const pe=this.stack.pop();pe.position.end=qo(se.end)}function ue(se){I.call(this,se);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(se)}function he(se){I.call(this,se);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(se)}function ge(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function De(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xe(){return{type:"emphasis",children:[]}}function pt(){return{type:"heading",depth:0,children:[]}}function at(){return{type:"break"}}function fe(){return{type:"html",value:""}}function Ve(){return{type:"image",title:null,url:"",alt:null}}function Ae(){return{type:"link",title:null,url:"",children:[]}}function et(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function lt(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function nt(){return{type:"paragraph",children:[]}}function Kt(){return{type:"strong",children:[]}}function Se(){return{type:"text",value:""}}function qe(){return{type:"thematicBreak"}}}function qo(e){return{line:e.line,column:e.column,offset:e.offset}}function Oj(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Oj(e,r):zQ(e,r)}}function zQ(e,t){let n;for(n in t)if(jj.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 SR(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+md({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+md({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+md({start:t.start,end:t.end})+") is still open")}function PQ(e){const t=this;t.parser=n;function n(r){return OQ(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function BQ(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 IQ(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
596
|
+
`}]}function FQ(e,t){const n=t.value?t.value+`
|
|
597
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function HQ(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UQ(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $Q(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Bc(r.toLowerCase()),o=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=o+1,u+=1,e.footnoteCounts.set(r,u);const h={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,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function WQ(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 VQ(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Lj(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),o=s[0];o&&o.type==="text"?o.value="["+o.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 qQ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lj(e,t);const s={src:Bc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function KQ(e,t){const n={src:Bc(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 GQ(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 YQ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lj(e,t);const s={href:Bc(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function XQ(e,t){const n={href:Bc(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 ZQ(e,t,n){const r=e.all(t),s=n?QQ(n):zj(t),o={},l=[];if(typeof t.checked=="boolean"){const g=r[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const g=r[u];(s||u!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
|
|
598
|
+
`}),g.type==="element"&&g.tagName==="p"&&!s?l.push(...g.children):l.push(g)}const h=r[r.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
|
599
|
+
`});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function QQ(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=zj(n[r])}return t}function zj(e){const t=e.spread;return t??e.children.length>1}function JQ(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 o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function eJ(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tJ(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nJ(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rJ(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=$0(t.children[1]),h=pj(t.children[t.children.length-1]);u&&h&&(l.position={start:u,end:h}),s.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function iJ(e,t,n){const r=n?n.children:void 0,o=(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 h=-1;const d=[];for(;++h<u;){const p=t.children[h],v={},y=l?l[h]:void 0;y&&(v.align=y);let w={type:"element",tagName:o,properties:v,children:[]};p&&(w.children=e.all(p),e.patch(p,w),w=e.applyData(p,w)),d.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,g),e.applyData(t,g)}function sJ(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const CR=9,kR=32;function oJ(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const o=[];for(;r;)o.push(ER(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return o.push(ER(t.slice(s),s>0,!1)),o.join("")}function ER(e,t,n){let r=0,s=e.length;if(t){let o=e.codePointAt(r);for(;o===CR||o===kR;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(s-1);for(;o===CR||o===kR;)s--,o=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function aJ(e,t){const n={type:"text",value:oJ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lJ(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cJ={blockquote:BQ,break:IQ,code:FQ,delete:HQ,emphasis:UQ,footnoteReference:$Q,heading:WQ,html:VQ,imageReference:qQ,image:KQ,inlineCode:GQ,linkReference:YQ,link:XQ,listItem:ZQ,list:JQ,paragraph:eJ,root:tJ,strong:nJ,table:rJ,tableCell:sJ,tableRow:iJ,text:aJ,thematicBreak:lJ,toml:Gf,yaml:Gf,definition:Gf,footnoteDefinition:Gf};function Gf(){}const Pj=-1,Kp=0,gd=1,Qm=2,X0=3,Z0=4,Q0=5,J0=6,Bj=7,Ij=8,RR=typeof self=="object"?self:globalThis,uJ=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),r=s=>{if(e.has(s))return e.get(s);const[o,l]=t[s];switch(o){case Kp:case Pj:return n(l,s);case gd:{const u=n([],s);for(const h of l)u.push(r(h));return u}case Qm:{const u=n({},s);for(const[h,d]of l)u[r(h)]=r(d);return u}case X0:return n(new Date(l),s);case Z0:{const{source:u,flags:h}=l;return n(new RegExp(u,h),s)}case Q0:{const u=n(new Map,s);for(const[h,d]of l)u.set(r(h),r(d));return u}case J0:{const u=n(new Set,s);for(const h of l)u.add(r(h));return u}case Bj:{const{name:u,message:h}=l;return n(new RR[u](h),s)}case Ij: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 RR[o](l),s)};return r},TR=e=>uJ(new Map,e)(0),tc="",{toString:dJ}={},{keys:hJ}=Object,Wu=e=>{const t=typeof e;if(t!=="object"||!e)return[Kp,t];const n=dJ.call(e).slice(8,-1);switch(n){case"Array":return[gd,tc];case"Object":return[Qm,tc];case"Date":return[X0,tc];case"RegExp":return[Z0,tc];case"Map":return[Q0,tc];case"Set":return[J0,tc];case"DataView":return[gd,n]}return n.includes("Array")?[gd,n]:n.includes("Error")?[Bj,n]:[Qm,n]},Yf=([e,t])=>e===Kp&&(t==="function"||t==="symbol"),fJ=(e,t,n,r)=>{const s=(l,u)=>{const h=r.push(l)-1;return n.set(u,h),h},o=l=>{if(n.has(l))return n.get(l);let[u,h]=Wu(l);switch(u){case Kp:{let g=l;switch(h){case"bigint":u=Ij,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([Pj],l)}return s([u,g],l)}case gd:{if(h){let v=l;return h==="DataView"?v=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(l)),s([h,[...v]],l)}const g=[],p=s([u,g],l);for(const v of l)g.push(o(v));return p}case Qm:{if(h)switch(h){case"BigInt":return s([h,l.toString()],l);case"Boolean":case"Number":case"String":return s([h,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const g=[],p=s([u,g],l);for(const v of hJ(l))(e||!Yf(Wu(l[v])))&&g.push([o(v),o(l[v])]);return p}case X0:return s([u,l.toISOString()],l);case Z0:{const{source:g,flags:p}=l;return s([u,{source:g,flags:p}],l)}case Q0:{const g=[],p=s([u,g],l);for(const[v,y]of l)(e||!(Yf(Wu(v))||Yf(Wu(y))))&&g.push([o(v),o(y)]);return p}case J0:{const g=[],p=s([u,g],l);for(const v of l)(e||!Yf(Wu(v)))&&g.push(o(v));return p}}const{message:d}=l;return s([u,{name:h,message:d}],l)};return o},NR=(e,{json:t,lossy:n}={})=>{const r=[];return fJ(!(t||n),!!t,new Map,r)(e),r},Jm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?TR(NR(e,t)):structuredClone(e):(e,t)=>TR(NR(e,t));function mJ(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 pJ(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function gJ(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||mJ,r=e.options.footnoteBackLabel||pJ,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const g=e.all(d),p=String(d.identifier).toUpperCase(),v=Bc(p.toLowerCase());let y=0;const w=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++y<=S;){w.length>0&&w.push({type:"text",value:" "});let R=typeof n=="string"?n:n(h,y);typeof R=="string"&&(R={type:"text",value:R}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,y),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const C=g[g.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const R=C.children[C.children.length-1];R&&R.type==="text"?R.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...w)}else g.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(d,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Jm(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
600
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
601
|
+
`}]}}const Gp=function(e){if(e==null)return yJ;if(typeof e=="function")return Yp(e);if(typeof e=="object")return Array.isArray(e)?vJ(e):bJ(e);if(typeof e=="string")return _J(e);throw new Error("Expected function, string, or object as test")};function vJ(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Gp(e[n]);return Yp(r);function r(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function bJ(e){const t=e;return Yp(n);function n(r){const s=r;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function _J(e){return Yp(t);function t(n){return n&&n.type===e}}function Yp(e){return t;function t(n,r,s){return!!(xJ(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function yJ(){return!0}function xJ(e){return e!==null&&typeof e=="object"&&"type"in e}const Fj=[],wJ=!0,ax=!1,SJ="skip";function Hj(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const o=Gp(s),l=r?-1:1;u(e,void 0,[])();function u(h,d,g){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=Fj,w,S,C;if((!t||o(h,d,g[g.length-1]||void 0))&&(y=CJ(n(h,g)),y[0]===ax))return y;if("children"in h&&h.children){const k=h;if(k.children&&y[0]!==SJ)for(S=(r?k.children.length:-1)+l,C=g.concat(k);S>-1&&S<k.children.length;){const R=k.children[S];if(w=u(R,S,C)(),w[0]===ax)return w;S=typeof w[1]=="number"?w[1]:S+l}}return y}}}function CJ(e){return Array.isArray(e)?e:typeof e=="number"?[wJ,e]:e==null?Fj:[e]}function e1(e,t,n,r){let s,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,s=n):(o=t,l=n,s=r),Hj(e,o,u,s);function u(h,d){const g=d[d.length-1],p=g?g.children.indexOf(h):void 0;return l(h,p,g)}}const lx={}.hasOwnProperty,kJ={};function EJ(e,t){const n=t||kJ,r=new Map,s=new Map,o=new Map,l={...cJ,...n.handlers},u={all:d,applyData:TJ,definitionById:r,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:l,one:h,options:n,patch:RJ,wrap:MJ};return e1(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?r:s,v=String(g.identifier).toUpperCase();p.has(v)||p.set(v,g)}}),u;function h(g,p){const v=g.type,y=u.handlers[v];if(lx.call(u.handlers,v)&&y)return y(u,g,p);if(u.options.passThrough&&u.options.passThrough.includes(v)){if("children"in g){const{children:S,...C}=g,k=Jm(C);return k.children=u.all(g),k}return Jm(g)}return(u.options.unknownHandler||NJ)(u,g,p)}function d(g){const p=[];if("children"in g){const v=g.children;let y=-1;for(;++y<v.length;){const w=u.one(v[y],g);if(w){if(y&&v[y-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=MR(w.value)),!Array.isArray(w)&&w.type==="element")){const S=w.children[0];S&&S.type==="text"&&(S.value=MR(S.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function RJ(e,t){e.position&&(t.position=pX(e))}function TJ(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,o=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"&&o&&Object.assign(n.properties,Jm(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function NJ(e,t){const n=t.data||{},r="value"in t&&!(lx.call(n,"hProperties")||lx.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 MJ(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
602
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
603
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
604
|
+
`}),n}function MR(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function AR(e,t){const n=EJ(e,t),r=n.one(e,void 0),s=gJ(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
605
|
+
`},s),o}function AJ(e,t){return e&&"run"in e?async function(n,r){const s=AR(n,{file:r,...t});await e.run(s,r)}:function(n,r){return AR(n,{file:r,...e||t})}}function DR(e){if(e)throw e}var l_,jR;function DJ(){if(jR)return l_;jR=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!p)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},l=function(d,g){n&&g.name==="__proto__"?n(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},u=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(r)return r(d,g).value}else return;return d[g]};return l_=function h(){var d,g,p,v,y,w,S=arguments[0],C=1,k=arguments.length,R=!1;for(typeof S=="boolean"&&(R=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<k;++C)if(d=arguments[C],d!=null)for(g in d)p=u(S,g),v=u(d,g),S!==v&&(R&&v&&(o(v)||(y=s(v)))?(y?(y=!1,w=p&&s(p)?p:[]):w=p&&o(p)?p:{},l(S,{name:g,newValue:h(R,w,v)})):typeof v<"u"&&l(S,{name:g,newValue:v}));return S},l_}var jJ=DJ();const c_=np(jJ);function cx(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 OJ(){const e=[],t={run:n,use:r};return t;function n(...s){let o=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(h,...d){const g=e[++o];let p=-1;if(h){l(h);return}for(;++p<s.length;)(d[p]===null||d[p]===void 0)&&(d[p]=s[p]);s=d,g?LJ(g,u)(...d):l(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function LJ(e,t){let n;return r;function r(...l){const u=e.length>l.length;let h;u&&l.push(s);try{h=e.apply(this,l)}catch(d){const g=d;if(u&&n)throw g;return s(g)}u||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(l,...u){n||(n=!0,t(l,...u))}function o(l){s(null,l)}}const os={basename:zJ,dirname:PJ,extname:BJ,join:IJ,sep:"/"};function zJ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');oh(e);let n=0,r=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else r<0&&(o=!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(o){n=s+1;break}}else l<0&&(o=!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 PJ(e){if(oh(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 BJ(e){oh(e);let t=e.length,n=-1,r=0,s=-1,o=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:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function IJ(...e){let t=-1,n;for(;++t<e.length;)oh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":FJ(n)}function FJ(e){oh(e);const t=e.codePointAt(0)===47;let n=HJ(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function HJ(e,t){let n="",r=0,s=-1,o=0,l=-1,u,h;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||o===1))if(s!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",r=0):(n=n.slice(0,h),r=n.length-1-n.lastIndexOf("/")),s=l,o=0;continue}}else if(n.length>0){n="",r=0,s=l,o=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,o=0}else u===46&&o>-1?o++:o=-1}return n}function oh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const UJ={cwd:$J};function $J(){return"/"}function ux(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function WJ(e){if(typeof e=="string")e=new URL(e);else if(!ux(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 VJ(e)}function VJ(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 u_=["history","path","basename","stem","extname","dirname"];class Uj{constructor(t){let n;t?ux(t)?n={path:t}:typeof t=="string"||qJ(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":UJ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<u_.length;){const o=u_[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)u_.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?os.basename(this.path):void 0}set basename(t){h_(t,"basename"),d_(t,"basename"),this.path=os.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?os.dirname(this.path):void 0}set dirname(t){OR(this.basename,"dirname"),this.path=os.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?os.extname(this.path):void 0}set extname(t){if(d_(t,"extname"),OR(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=os.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ux(t)&&(t=WJ(t)),h_(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?os.basename(this.path,this.extname):void 0}set stem(t){h_(t,"stem"),d_(t,"stem"),this.path=os.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 wr(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 d_(e,t){if(e&&e.includes(os.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+os.sep+"`")}function h_(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function OR(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function qJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const KJ=function(e){const r=this.constructor.prototype,s=r[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},GJ={}.hasOwnProperty;class t1 extends KJ{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=OJ()}copy(){const t=new t1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(c_(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(p_("data",this.frozen),this.namespace[t]=n,this):GJ.call(this.namespace,t)&&this.namespace[t]||void 0:t?(p_("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=Xf(t),r=this.parser||this.Parser;return f_("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),f_("process",this.parser||this.Parser),m_("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,l){const u=Xf(t),h=r.parse(u);r.run(h,u,function(g,p,v){if(g||!p||!v)return d(g);const y=p,w=r.stringify(y,v);ZJ(w)?v.value=w:v.result=w,d(g,v)});function d(g,p){g||!p?l(g):o?o(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),f_("processSync",this.parser||this.Parser),m_("processSync",this.compiler||this.Compiler),this.process(t,s),zR("processSync","process",n),r;function s(o,l){n=!0,DR(o),r=l}}run(t,n,r){LR(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,u){const h=Xf(n);s.run(t,h,d);function d(g,p,v){const y=p||t;g?u(g):l?l(y):r(void 0,y,v)}}}runSync(t,n){let r=!1,s;return this.run(t,n,o),zR("runSync","run",r),s;function o(l,u){DR(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=Xf(n),s=this.compiler||this.Compiler;return m_("stringify",s),LR(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(p_("use",this.frozen),t!=null)if(typeof t=="function")h(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 o(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...p]=d;h(g,p)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(d.plugins),d.settings&&(s.settings=c_(!0,s.settings,d.settings))}function u(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const p=d[g];o(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,g){let p=-1,v=-1;for(;++p<r.length;)if(r[p][0]===d){v=p;break}if(v===-1)r.push([d,...g]);else if(g.length>0){let[y,...w]=g;const S=r[v][1];cx(S)&&cx(y)&&(y=c_(!0,S,y)),r[v]=[d,y,...w]}}}}const YJ=new t1().freeze();function f_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function m_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function p_(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 LR(e){if(!cx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zR(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Xf(e){return XJ(e)?e:new Uj(e)}function XJ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ZJ(e){return typeof e=="string"||QJ(e)}function QJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JJ="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",PR=[],BR={allowDangerousHtml:!0},eee=/^(https?|ircs?|mailto|xmpp)$/i,tee=[{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 Ic(e){const t=nee(e),n=ree(e);return iee(t.runSync(t.parse(n),n),e)}function nee(e){const t=e.rehypePlugins||PR,n=e.remarkPlugins||PR,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...BR}:BR;return YJ().use(PQ).use(n).use(AJ,r).use(t)}function ree(e){const t=e.children||"",n=new Uj;return typeof t=="string"&&(n.value=t),n}function iee(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,o=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||see;for(const g of tee)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+JJ+g.id,void 0);return e1(e,d),yX(e,{Fragment:f.Fragment,components:s,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function d(g,p,v){if(g.type==="raw"&&v&&typeof p=="number")return l?v.children.splice(p,1):v.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let y;for(y in s_)if(Object.hasOwn(s_,y)&&Object.hasOwn(g.properties,y)){const w=g.properties[y],S=s_[y];(S===null||S.includes(g.tagName))&&(g.properties[y]=h(String(w||""),y,g))}}if(g.type==="element"){let y=n?!n.includes(g.tagName):o?o.includes(g.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(g,p,v)),y&&v&&typeof p=="number")return u&&g.children?v.children.splice(p,1,...g.children):v.children.splice(p,1),p}}}function see(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||eee.test(e.slice(0,t))?e:""}function IR(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 oee(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function aee(e,t,n){const s=Gp((n||{}).ignore||[]),o=lee(t);let l=-1;for(;++l<o.length;)Hj(e,"text",u);function u(d,g){let p=-1,v;for(;++p<g.length;){const y=g[p],w=v?v.children:void 0;if(s(y,w?w.indexOf(y):void 0,v))return;v=y}if(v)return h(d,g)}function h(d,g){const p=g[g.length-1],v=o[l][0],y=o[l][1];let w=0;const C=p.children.indexOf(d);let k=!1,R=[];v.lastIndex=0;let E=v.exec(d.value);for(;E;){const M=E.index,L={index:E.index,input:E.input,stack:[...g,d]};let j=y(...E,L);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?v.lastIndex=M+1:(w!==M&&R.push({type:"text",value:d.value.slice(w,M)}),Array.isArray(j)?R.push(...j):j&&R.push(j),w=M+E[0].length,k=!0),!v.global)break;E=v.exec(d.value)}return k?(w<d.value.length&&R.push({type:"text",value:d.value.slice(w)}),p.children.splice(C,1,...R)):R=[d],C+R.length}}function lee(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([cee(s[0]),uee(s[1])])}return t}function cee(e){return typeof e=="string"?new RegExp(oee(e),"g"):e}function uee(e){return typeof e=="function"?e:function(){return e}}const g_="phrasing",v_=["autolink","link","image","label"];function dee(){return{transforms:[bee],enter:{literalAutolink:fee,literalAutolinkEmail:b_,literalAutolinkHttp:b_,literalAutolinkWww:b_},exit:{literalAutolink:vee,literalAutolinkEmail:gee,literalAutolinkHttp:mee,literalAutolinkWww:pee}}}function hee(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:g_,notInConstruct:v_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:g_,notInConstruct:v_},{character:":",before:"[ps]",after:"\\/",inConstruct:g_,notInConstruct:v_}]}}function fee(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function b_(e){this.config.enter.autolinkProtocol.call(this,e)}function mee(e){this.config.exit.autolinkProtocol.call(this,e)}function pee(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 gee(e){this.config.exit.autolinkEmail.call(this,e)}function vee(e){this.exit(e)}function bee(e){aee(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_ee],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yee]],{ignore:["link","linkReference"]})}function _ee(e,t,n,r,s){let o="";if(!$j(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!xee(n)))return!1;const l=wee(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function yee(e,t,n,r){return!$j(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function xee(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 wee(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=IR(e,"(");let o=IR(e,")");for(;r!==-1&&s>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function $j(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||nl(n)||Vp(n))&&(!t||n!==47)}Wj.peek=Aee;function See(){this.buffer()}function Cee(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function kee(){this.buffer()}function Eee(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ree(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Wi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tee(e){this.exit(e)}function Nee(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Wi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Mee(e){this.exit(e)}function Aee(){return"["}function Wj(e,t,n,r){const s=n.createTracker(r);let o=s.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),l(),o+=s.move("]"),o}function Dee(){return{enter:{gfmFootnoteCallString:See,gfmFootnoteCall:Cee,gfmFootnoteDefinitionLabelString:kee,gfmFootnoteDefinition:Eee},exit:{gfmFootnoteCallString:Ree,gfmFootnoteCall:Tee,gfmFootnoteDefinitionLabelString:Nee,gfmFootnoteDefinition:Mee}}}function jee(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Wj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,o,l){const u=o.createTracker(l);let h=u.move("[^");const d=o.enter("footnoteDefinition"),g=o.enter("label");return h+=u.move(o.safe(o.associationId(r),{before:h,after:"]"})),g(),h+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),h+=u.move((t?`
|
|
606
|
+
`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?Vj:Oee))),d(),h}}function Oee(e,t,n){return t===0?e:Vj(e,t,n)}function Vj(e,t,n){return(n?"":" ")+e}const Lee=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qj.peek=Fee;function zee(){return{canContainEols:["delete"],enter:{strikethrough:Bee},exit:{strikethrough:Iee}}}function Pee(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Lee}],handlers:{delete:qj}}}function Bee(e){this.enter({type:"delete",children:[]},e)}function Iee(e){this.exit(e)}function qj(e,t,n,r){const s=n.createTracker(r),o=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),o(),l}function Fee(){return"~"}function Hee(e){return e.length}function Uee(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||Hee,o=[],l=[],u=[],h=[];let d=0,g=-1;for(;++g<e.length;){const S=[],C=[];let k=-1;for(e[g].length>d&&(d=e[g].length);++k<e[g].length;){const R=$ee(e[g][k]);if(n.alignDelimiters!==!1){const E=s(R);C[k]=E,(h[k]===void 0||E>h[k])&&(h[k]=E)}S.push(R)}l[g]=S,u[g]=C}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)o[p]=FR(r[p]);else{const S=FR(r);for(;++p<d;)o[p]=S}p=-1;const v=[],y=[];for(;++p<d;){const S=o[p];let C="",k="";S===99?(C=":",k=":"):S===108?C=":":S===114&&(k=":");let R=n.alignDelimiters===!1?1:Math.max(1,h[p]-C.length-k.length);const E=C+"-".repeat(R)+k;n.alignDelimiters!==!1&&(R=C.length+R+k.length,R>h[p]&&(h[p]=R),y[p]=R),v[p]=E}l.splice(1,0,v),u.splice(1,0,y),g=-1;const w=[];for(;++g<l.length;){const S=l[g],C=u[g];p=-1;const k=[];for(;++p<d;){const R=S[p]||"";let E="",M="";if(n.alignDelimiters!==!1){const L=h[p]-(C[p]||0),j=o[p];j===114?E=" ".repeat(L):j===99?L%2?(E=" ".repeat(L/2+.5),M=" ".repeat(L/2-.5)):(E=" ".repeat(L/2),M=E):M=" ".repeat(L)}n.delimiterStart!==!1&&!p&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||p)&&k.push(" "),n.alignDelimiters!==!1&&k.push(E),k.push(R),n.alignDelimiters!==!1&&k.push(M),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&k.push("|")}w.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return w.join(`
|
|
607
|
+
`)}function $ee(e){return e==null?"":String(e)}function FR(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 Wee(e,t,n,r){const s=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),Vee);return s(),l}function Vee(e,t,n){return">"+(n?"":" ")+e}function qee(e,t){return HR(e,t.inConstruct,!0)&&!HR(e,t.notInConstruct,!1)}function HR(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 UR(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
608
|
+
`&&qee(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
609
|
+
`}function Kee(e,t){const n=String(e);let r=n.indexOf(t),s=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++o>l&&(l=o):o=1,s=r+t.length,r=n.indexOf(t,s);return l}function Gee(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 Yee(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 Xee(e,t,n,r){const s=Yee(n),o=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(Gee(e,n)){const p=n.enter("codeIndented"),v=n.indentLines(o,Zee);return p(),v}const u=n.createTracker(r),h=s.repeat(Math.max(Kee(o,s)+1,3)),d=n.enter("codeFenced");let g=u.move(h);if(e.lang){const p=n.enter(`codeFencedLang${l}`);g+=u.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);g+=u.move(" "),g+=u.move(n.safe(e.meta,{before:g,after:`
|
|
610
|
+
`,encode:["`"],...u.current()})),p()}return g+=u.move(`
|
|
611
|
+
`),o&&(g+=u.move(o+`
|
|
612
|
+
`)),g+=u.move(h),d(),g}function Zee(e,t,n){return(n?"":" ")+e}function n1(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 Qee(e,t,n,r){const s=n1(n),o=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("[");return d+=h.move(n.safe(n.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
613
|
+
`,...h.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),l(),d}function Jee(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 jd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ep(e,t,n){const r=wc(e),s=wc(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}}Kj.peek=ete;function Kj(e,t,n,r){const s=Jee(n),o=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s);let h=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const d=h.charCodeAt(0),g=ep(r.before.charCodeAt(r.before.length-1),d,s);g.inside&&(h=jd(d)+h.slice(1));const p=h.charCodeAt(h.length-1),v=ep(r.after.charCodeAt(0),p,s);v.inside&&(h=h.slice(0,-1)+jd(p));const y=l.move(s);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+h+y}function ete(e,t,n){return n.options.emphasis||"*"}function tte(e,t){let n=!1;return e1(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ax}),!!((!e.depth||e.depth<3)&&K0(e)&&(t.options.setext||n))}function nte(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(tte(e,n)){const g=n.enter("headingSetext"),p=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:`
|
|
614
|
+
`,after:`
|
|
615
|
+
`});return p(),g(),v+`
|
|
616
|
+
`+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
617
|
+
`))+1))}const l="#".repeat(s),u=n.enter("headingAtx"),h=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
618
|
+
`,...o.current()});return/^[\t ]/.test(d)&&(d=jd(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),h(),u(),d}Gj.peek=rte;function Gj(e){return e.value||""}function rte(){return"<"}Yj.peek=ite;function Yj(e,t,n,r){const s=n1(n),o=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("![");return d+=h.move(n.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),d+=h.move(")"),l(),d}function ite(){return"!"}Xj.peek=ste;function Xj(e,t,n,r){const s=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let h=u.move("![");const d=n.safe(e.alt,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return l(),n.stack=g,o(),s==="full"||!d||d!==p?h+=u.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function ste(){return"!"}Zj.peek=ote;function Zj(e,t,n){let r=e.value||"",s="`",o=-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+" ");++o<n.unsafe.length;){const l=n.unsafe[o],u=n.compilePattern(l);let h;if(l.atBreak)for(;h=u.exec(r);){let d=h.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(h.index+1)}}return s+r+s}function ote(){return"`"}function Qj(e,t){const n=K0(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))}Jj.peek=ate;function Jj(e,t,n,r){const s=n1(n),o=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,h;if(Qj(e,n)){const g=n.stack;n.stack=[],u=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),u(),n.stack=g,p}u=n.enter("link"),h=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(h=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),h(),e.title&&(h=n.enter(`title${o}`),d+=l.move(" "+s),d+=l.move(n.safe(e.title,{before:d,after:s,...l.current()})),d+=l.move(s),h()),d+=l.move(")"),u(),d}function ate(e,t,n){return Qj(e,n)?"<":"["}e3.peek=lte;function e3(e,t,n,r){const s=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let h=u.move("[");const d=n.containerPhrasing(e,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return l(),n.stack=g,o(),s==="full"||!d||d!==p?h+=u.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function lte(){return"["}function r1(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 cte(e){const t=r1(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 ute(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 t3(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 dte(e,t,n,r){const s=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?ute(n):r1(n);const u=e.ordered?l==="."?")":".":cte(n);let h=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&g&&(!g.children||!g.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&&(h=!0),t3(n)===l&&g){let p=-1;for(;++p<e.children.length;){const v=e.children[p];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(l=u),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,s(),d}function hte(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 fte(e,t,n,r){const s=hte(n);let o=n.bulletCurrent||r1(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.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(o+" ".repeat(l-o.length)),u.shift(l);const h=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),g);return h(),d;function g(p,v,y){return v?(y?"":" ".repeat(l))+p:(y?o:o+" ".repeat(l-o.length))+p}}function mte(e,t,n,r){const s=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),s(),l}const pte=Gp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function gte(e,t,n,r){return(e.children.some(function(l){return pte(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function vte(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}n3.peek=bte;function n3(e,t,n,r){const s=vte(n),o=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s);let h=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const d=h.charCodeAt(0),g=ep(r.before.charCodeAt(r.before.length-1),d,s);g.inside&&(h=jd(d)+h.slice(1));const p=h.charCodeAt(h.length-1),v=ep(r.after.charCodeAt(0),p,s);v.inside&&(h=h.slice(0,-1)+jd(p));const y=l.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+h+y}function bte(e,t,n){return n.options.strong||"*"}function _te(e,t,n,r){return n.safe(e.value,r)}function yte(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 xte(e,t,n){const r=(t3(n)+(n.options.ruleSpaces?" ":"")).repeat(yte(n));return n.options.ruleSpaces?r.slice(0,-1):r}const r3={blockquote:Wee,break:UR,code:Xee,definition:Qee,emphasis:Kj,hardBreak:UR,heading:nte,html:Gj,image:Yj,imageReference:Xj,inlineCode:Zj,link:Jj,linkReference:e3,list:dte,listItem:fte,paragraph:mte,root:gte,strong:n3,text:_te,thematicBreak:xte};function wte(){return{enter:{table:Ste,tableData:$R,tableHeader:$R,tableRow:kte},exit:{codeText:Ete,table:Cte,tableData:__,tableHeader:__,tableRow:__}}}function Ste(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 Cte(e){this.exit(e),this.data.inTable=void 0}function kte(e){this.enter({type:"tableRow",children:[]},e)}function __(e){this.exit(e)}function $R(e){this.enter({type:"tableCell",children:[]},e)}function Ete(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Rte));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Rte(e,t){return t==="|"?t:e}function Tte(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
619
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:l,tableCell:h,tableRow:u}};function l(y,w,S,C){return d(g(y,S,C),y.align)}function u(y,w,S,C){const k=p(y,S,C),R=d([k]);return R.slice(0,R.indexOf(`
|
|
620
|
+
`))}function h(y,w,S,C){const k=S.enter("tableCell"),R=S.enter("phrasing"),E=S.containerPhrasing(y,{...C,before:o,after:o});return R(),k(),E}function d(y,w){return Uee(y,{align:w,alignDelimiters:r,padding:n,stringLength:s})}function g(y,w,S){const C=y.children;let k=-1;const R=[],E=w.enter("table");for(;++k<C.length;)R[k]=p(C[k],w,S);return E(),R}function p(y,w,S){const C=y.children;let k=-1;const R=[],E=w.enter("tableRow");for(;++k<C.length;)R[k]=h(C[k],y,w,S);return E(),R}function v(y,w,S){let C=r3.inlineCode(y,w,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function Nte(){return{exit:{taskListCheckValueChecked:WR,taskListCheckValueUnchecked:WR,paragraph:Ate}}}function Mte(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Dte}}}function WR(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Ate(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 o=-1,l;for(;++o<s.length;){const u=s[o];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 Dte(e,t,n,r){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);o&&u.move(l);let h=r3.listItem(e,t,n,{...r,...u.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+l}}function jte(){return[dee(),Dee(),zee(),wte(),Nte()]}function Ote(e){return{extensions:[hee(),jee(e),Pee(),Tte(e),Mte()]}}const Lte={tokenize:Hte,partial:!0},i3={tokenize:Ute,partial:!0},s3={tokenize:$te,partial:!0},o3={tokenize:Wte,partial:!0},zte={tokenize:Vte,partial:!0},a3={name:"wwwAutolink",tokenize:Ite,previous:c3},l3={name:"protocolAutolink",tokenize:Fte,previous:u3},ho={name:"emailAutolink",tokenize:Bte,previous:d3},ws={};function Pte(){return{text:ws}}let Oa=48;for(;Oa<123;)ws[Oa]=ho,Oa++,Oa===58?Oa=65:Oa===91&&(Oa=97);ws[43]=ho;ws[45]=ho;ws[46]=ho;ws[95]=ho;ws[72]=[ho,l3];ws[104]=[ho,l3];ws[87]=[ho,a3];ws[119]=[ho,a3];function Bte(e,t,n){const r=this;let s,o;return l;function l(p){return!dx(p)||!d3.call(r,r.previous)||i1(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return dx(p)?(e.consume(p),u):p===64?(e.consume(p),h):n(p)}function h(p){return p===46?e.check(zte,g,d)(p):p===45||p===95||yr(p)?(o=!0,e.consume(p),h):g(p)}function d(p){return e.consume(p),s=!0,h}function g(p){return o&&s&&Nr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function Ite(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!c3.call(r,r.previous)||i1(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Lte,e.attempt(i3,e.attempt(s3,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Fte(e,t,n){const r=this;let s="",o=!1;return l;function l(p){return(p===72||p===104)&&u3.call(r,r.previous)&&!i1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(Nr(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const v=s.toLowerCase();if(v==="http"||v==="https")return e.consume(p),h}return n(p)}function h(p){return p===47?(e.consume(p),o?d:(o=!0,h)):n(p)}function d(p){return p===null||Zm(p)||sn(p)||nl(p)||Vp(p)?n(p):e.attempt(i3,e.attempt(s3,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function Hte(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),o):n(l)}function o(l){return l===null?n(l):t(l)}}function Ute(e,t,n){let r,s,o;return l;function l(d){return d===46||d===95?e.check(o3,h,u)(d):d===null||sn(d)||nl(d)||d!==45&&Vp(d)?h(d):(o=!0,e.consume(d),l)}function u(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),l}function h(d){return s||r||!o?n(d):t(d)}}function $te(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?o(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(o3,t,o)(l):l===null||sn(l)||nl(l)?t(l):(e.consume(l),s)}function o(l){return l===41&&r++,e.consume(l),s}}function Wte(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),o):u===93?(e.consume(u),s):u===60||u===null||sn(u)||nl(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||sn(u)||nl(u)?t(u):r(u)}function o(u){return Nr(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):Nr(u)?(e.consume(u),l):n(u)}}function Vte(e,t,n){return r;function r(o){return e.consume(o),s}function s(o){return yr(o)?n(o):t(o)}}function c3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||sn(e)}function u3(e){return!Nr(e)}function d3(e){return!(e===47||dx(e))}function dx(e){return e===43||e===45||e===46||e===95||yr(e)}function i1(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 qte={tokenize:ene,partial:!0};function Kte(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Zte,continuation:{tokenize:Qte},exit:Jte}},text:{91:{name:"gfmFootnoteCall",tokenize:Xte},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Gte,resolveTo:Yte}}}}function Gte(e,t,n){const r=this;let s=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const h=r.events[s][1];if(h.type==="labelImage"){l=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return u;function u(h){if(!l||!l._balanced)return n(h);const d=Wi(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function Yte(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 o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function Xte(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(o>999||p===93&&!l||p===null||p===91||sn(p))return n(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return s.includes(Wi(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return sn(p)||(l=!0),o++,e.consume(p),p===92?g:d}function g(p){return p===91||p===92||p===93?(e.consume(p),o++,d):d(p)}}function Zte(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,u;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(w)}function g(w){if(l>999||w===93&&!u||w===null||w===91||sn(w))return n(w);if(w===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return o=Wi(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return sn(w)||(u=!0),l++,e.consume(w),w===92?p:g}function p(w){return w===91||w===92||w===93?(e.consume(w),l++,g):g(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(o)||s.push(o),Ot(e,y,"gfmFootnoteDefinitionWhitespace")):n(w)}function y(w){return t(w)}}function Qte(e,t,n){return e.check(sh,t,e.attempt(qte,t,n))}function Jte(e){e.exit("gfmFootnoteDefinition")}function ene(e,t,n){const r=this;return Ot(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function tne(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,u){let h=-1;for(;++h<l.length;)if(l[h][0]==="enter"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._close){let d=h;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[h][1].end.offset-l[h][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[h][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[h][1].end)},p={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[h][1].start)},v=[["enter",g,u],["enter",l[d][1],u],["exit",l[d][1],u],["enter",p,u]],y=u.parser.constructs.insideSpan.null;y&&ai(v,v.length,0,qp(y,l.slice(d+1,h),u)),ai(v,v.length,0,[["exit",p,u],["enter",l[h][1],u],["exit",l[h][1],u],["exit",g,u]]),ai(l,d-1,h-d+3,v),h=d+v.length-2;break}}for(h=-1;++h<l.length;)l[h][1].type==="strikethroughSequenceTemporary"&&(l[h][1].type="data");return l}function o(l,u,h){const d=this.previous,g=this.events;let p=0;return v;function v(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(l.enter("strikethroughSequenceTemporary"),y(w))}function y(w){const S=wc(d);if(w===126)return p>1?h(w):(l.consume(w),p++,y);if(p<2&&!n)return h(w);const C=l.exit("strikethroughSequenceTemporary"),k=wc(w);return C._open=!k||k===2&&!!S,C._close=!S||S===2&&!!k,u(w)}}}class nne{constructor(){this.map=[]}add(t,n,r){rne(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[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 o of s)t.push(o);s=r.pop()}this.map.length=0}}function rne(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 ine(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 o=r.length-1;r[o]=r[o]==="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 sne(){return{flow:{null:{name:"table",tokenize:one,resolveAll:ane}}}}function one(e,t,n){const r=this;let s=0,o=0,l;return u;function u(I){let q=r.events.length-1;for(;q>-1;){const F=r.events[q][1].type;if(F==="lineEnding"||F==="linePrefix")q--;else break}const B=q>-1?r.events[q][1].type:null,W=B==="tableHead"||B==="tableRow"?j:h;return W===j&&r.parser.lazy[r.now().line]?n(I):W(I)}function h(I){return e.enter("tableHead"),e.enter("tableRow"),d(I)}function d(I){return I===124||(l=!0,o+=1),g(I)}function g(I){return I===null?n(I):Je(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),y):n(I):kt(I)?Ot(e,g,"whitespace")(I):(o+=1,l&&(l=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),l=!0,g):(e.enter("data"),p(I)))}function p(I){return I===null||I===124||sn(I)?(e.exit("data"),g(I)):(e.consume(I),I===92?v:p)}function v(I){return I===92||I===124?(e.consume(I),p):p(I)}function y(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),l=!1,kt(I)?Ot(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):w(I))}function w(I){return I===45||I===58?C(I):I===124?(l=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),S):L(I)}function S(I){return kt(I)?Ot(e,C,"whitespace")(I):C(I)}function C(I){return I===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),k):I===45?(o+=1,k(I)):I===null||Je(I)?M(I):L(I)}function k(I){return I===45?(e.enter("tableDelimiterFiller"),R(I)):L(I)}function R(I){return I===45?(e.consume(I),R):I===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(I))}function E(I){return kt(I)?Ot(e,M,"whitespace")(I):M(I)}function M(I){return I===124?w(I):I===null||Je(I)?!l||s!==o?L(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):L(I)}function L(I){return n(I)}function j(I){return e.enter("tableRow"),D(I)}function D(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),D):I===null||Je(I)?(e.exit("tableRow"),t(I)):kt(I)?Ot(e,D,"whitespace")(I):(e.enter("data"),H(I))}function H(I){return I===null||I===124||sn(I)?(e.exit("data"),D(I)):(e.consume(I),I===92?G:H)}function G(I){return I===92||I===124?(e.consume(I),H):H(I)}}function ane(e,t){let n=-1,r=!0,s=0,o=[0,0,0,0],l=[0,0,0,0],u=!1,h=0,d,g,p;const v=new nne;for(;++n<e.length;){const y=e[n],w=y[1];y[0]==="enter"?w.type==="tableHead"?(u=!1,h!==0&&(VR(v,t,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,p=void 0,o=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(n,0,[["enter",g,t]])),s=w.type==="tableDelimiterRow"?2:g?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],p=Zf(v,t,o,s,void 0,p),o=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],p=Zf(v,t,o,s,void 0,p)),o=l,l=[o[1],n,0,0])):w.type==="tableHead"?(u=!0,h=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=n,o[1]!==0?(l[0]=l[1],p=Zf(v,t,o,s,n,p)):l[1]!==0&&(p=Zf(v,t,l,s,n,p)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(h!==0&&VR(v,t,h,d,g),v.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=ine(t.events,n))}return e}function Zf(e,t,n,r,s,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(o.end=Object.assign({},rc(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const h=rc(t.events,n[1]);if(o={type:l,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=rc(t.events,n[2]),g=rc(t.events,n[3]),p={type:u,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const v=t.events[n[2]],y=t.events[n[3]];if(v[1].end=Object.assign({},y[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,S=n[3]-n[2]-1;e.add(w,S,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(o.end=Object.assign({},rc(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function VR(e,t,n,r,s){const o=[],l=rc(t.events,n);s&&(s.end=Object.assign({},l),o.push(["exit",s,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function rc(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const lne={name:"tasklistCheck",tokenize:une};function cne(){return{text:{91:lne}}}function une(e,t,n){const r=this;return s;function s(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return sn(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),l):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),l):n(h)}function l(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(h)}function u(h){return Je(h)?t(h):kt(h)?e.check({tokenize:dne},t,n)(h):n(h)}}function dne(e,t,n){return Ot(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function hne(e){return wj([Pte(),Kte(),tne(e),sne(),cne()])}const fne={};function Fc(e){const t=this,n=e||fne,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(hne(n)),o.push(jte()),l.push(Ote(n))}function mne({content:e,attachments:t}){const[n,r]=b.useState(null),s=(t==null?void 0:t.find(o=>o.id===n))??null;return b.useEffect(()=>{s||r(null)},[s]),f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex gap-2 justify-end",children:f.jsxs("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:[t!=null&&t.length?f.jsx("div",{className:"mb-2 grid max-w-[420px] grid-cols-2 gap-2",children:t.map(o=>f.jsxs("button",{type:"button",className:"overflow-hidden rounded-lg border border-border/80 bg-background/70 text-left cursor-zoom-in",onClick:()=>r(o.id),children:[f.jsx("img",{src:o.previewUrl,alt:o.name,className:"h-full max-h-[220px] w-full object-cover"}),f.jsx("div",{className:"border-t border-border/60 px-2 py-1 text-[11px] text-muted-foreground",children:o.name})]},o.id))}):null,e.trim()?f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:e}):null]})}),s?f.jsx("button",{type:"button",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4 cursor-zoom-out",onClick:()=>r(null),children:f.jsx("img",{src:s.previewUrl,alt:s.name,className:"max-h-full max-w-full rounded-xl shadow-2xl"})}):null]})}function pne({json:e}){return f.jsx("div",{className:"flex gap-3 justify-start",children:f.jsx("div",{className:"flex-1 max-w-[90%]",children:f.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 h3({title:e,count:t,children:n,badge:r}){const[s,o]=b.useState(!1);return t===0?null:f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("button",{onClick:()=>o(!s),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[f.jsx(Mr,{className:me("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",s&&"rotate-90")}),f.jsx("span",{className:"text-muted-foreground font-medium",children:e}),f.jsx("span",{className:"text-muted-foreground/60",children:t}),r]}),s&&f.jsx("div",{className:"ml-5",children:n})]})}function y_({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:f.jsx(h3,{title:e,count:t.length,children:f.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>f.jsx(tj,{icon:r?r(s):n,children:s},s))})})}function gne(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function f3({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return f.jsx("span",{className:me("inline-block h-2 w-2 rounded-full shrink-0",t)})}function vne(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 qR({server:e}){const[t,n]=b.useState(!1),r=e.status==="connected";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("button",{onClick:()=>r&&e.tools.length>0&&n(!t),className:me("flex items-center gap-1.5",r&&e.tools.length>0&&"cursor-pointer hover:opacity-60 transition-opacity"),children:[r&&e.tools.length>0&&f.jsx(Mr,{className:me("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),f.jsx(f3,{status:e.status}),f.jsx("span",{className:"text-muted-foreground font-medium",children:W_(e.name)}),r?f.jsxs("span",{className:"text-muted-foreground/50",children:[e.tools.length," tools"]}):f.jsx("span",{className:"text-muted-foreground/50",children:vne(e.status)})]}),!r&&e.error&&f.jsx("span",{className:"text-destructive ml-5",children:e.error}),t&&e.tools.length>0&&f.jsx("div",{className:"flex flex-wrap gap-1.5 ml-5",children:e.tools.map(s=>f.jsx(tj,{icon:ej(`mcp__${e.name}__${s}`),children:s},s))})]})}function bne({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?f.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[f.jsx(f3,{status:"failed"}),f.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return f.jsx(h3,{title:"MCP Servers",count:e.length,badge:r,children:f.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(s=>f.jsx(qR,{server:s},s.name)),n.map(s=>f.jsx(qR,{server:s},s.name))]})})}function _ne({rawJson:e}){const[t,n]=b.useState(!1);return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[f.jsx(Mr,{className:me("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),f.jsx("span",{className:"text-muted-foreground font-medium",children:"Raw Message"})]}),t&&f.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 yne({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=b.useMemo(()=>{const s=new Map,o=[];for(const u of e.tools){const h=gne(u);if(h){const d=s.get(h.server)||[];d.push(h.tool),s.set(h.server,d)}else o.push(u)}const l=e.mcpServers.map(u=>({name:u.name,status:u.status,error:u.error,tools:s.get(u.name)||[]}));return{coreTools:o,mcpServersWithTools:l}},[e.tools,e.mcpServers]);return f.jsx(uo,{children:f.jsxs(nh,{expandedContent:f.jsx(rh,{className:"my-4 text-xs",children:f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx(qG,{children:e.model}),f.jsx(y_,{title:"Tools",items:n,getIcon:s=>Ky[s]??JD}),f.jsx(y_,{title:"Agents",items:e.agents,icon:Tx}),f.jsx(y_,{title:"Commands",items:e.slashCommands,icon:Q6}),f.jsx(bne,{servers:r}),t&&f.jsx(_ne,{rawJson:t})]})}),children:[f.jsx(TI,{className:"h-5 w-5 text-logo"}),f.jsx(ro,{children:"Session Started"})]})})}function xne({message:e}){return f.jsx(uo,{className:"hidden",children:f.jsxs(nh,{expandedContent:f.jsx(rh,{className:"my-4 text-xs",children:f.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:[f.jsx("div",{className:"size-5 flex justify-center items-center ",children:f.jsx(Tx,{className:"h-4 w-4 text-muted-foreground"})}),f.jsx(ro,{children:"Account"})]})})}function wne({message:e}){return f.jsx("div",{className:"text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-full space-y-4",children:f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:e.text})})}function Sne({message:e}){return f.jsx(uo,{className:"w-full",children:f.jsxs(nh,{expandedContent:f.jsx(rh,{className:"my-4 text-sm text-muted-foreground/90",children:f.jsx("div",{className:"text-pretty prose prose-sm max-w-full px-0.5 opacity-90 dark:prose-invert",children:f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:e.text})})}),children:[f.jsx(ni,{className:"h-4 w-4 text-muted-icon"}),f.jsx(ro,{className:"text-left text-muted-foreground",children:"Thinking"})]})})}function Cne({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:s}){const o=r&&t>0;return f.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[f.jsxs("div",{className:"relative",children:[f.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:[o?f.jsx("button",{onClick:r,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:f.jsx(CN,{className:"h-4 w-4 -ml-0.5",strokeWidth:3})}):n>1?f.jsxs("span",{className:"font-bold text-muted-foreground whitespace-nowrap",children:[t+1," of ",n]}):null,e]}),n>1&&f.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-border",children:f.jsx("div",{className:"h-full bg-muted-foreground/40 transition-all duration-300",style:{width:`${t/n*100}%`}})})]}),s]})}function KR({label:e,description:t}){return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-foreground text-sm",children:e}),t&&f.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]})}function m3({selected:e,multiSelect:t,onClick:n}){return f.jsx("button",{type:"button",onClick:n,className:me("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&&f.jsx(qi,{strokeWidth:3,className:"translate-y-[0.5px] h-3 w-3 text-white dark:text-background"})})}function kne({option:e,selected:t,multiSelect:n,onClick:r,isLast:s}){const o="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",l=s?"":"border-b border-border";return r?f.jsx("button",{onClick:r,className:me(o,l,"transition-all cursor-pointer"),children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(KR,{label:e.label,description:e.description})}),f.jsx(m3,{selected:t,multiSelect:n})]})}):f.jsx("div",{className:me(o,l),children:f.jsx(KR,{label:e.label,description:e.description})})}function Ene(e){return e==null?void 0:e.answers}function Ii(e){return e.id||e.question}function Rne({message:e,onSubmit:t,isLatest:n}){var O,$;const r=e.input.questions,s=!!e.result,o=Ene(e.result),l=((O=e.result)==null?void 0:O.discarded)===!0,[u,h]=b.useState(0),[d,g]=b.useState({}),[p,v]=b.useState({}),[y,w]=b.useState(o??null),[S,C]=b.useState(s),k=(U,Y)=>{var ne;const A=(ne=p[U])==null?void 0:ne.trim(),P=d[U]||"",X=Y||r.find(oe=>Ii(oe)===U);if(X!=null&&X.multiSelect)return[P,A].filter(Boolean).flatMap(oe=>oe.split(", ").filter(Boolean));const N=A||P;return N?[N]:[]},R=U=>{const Y=d[Ii(U)]||"";return U.multiSelect?Y.split(", ").filter(Boolean):[Y]},E=(U,Y)=>{const A=Ii(U);if(U.multiSelect){const P=d[A]?d[A].split(", ").filter(Boolean):[],X=P.includes(Y)?P.filter(N=>N!==Y):[...P,Y];g({...d,[A]:X.join(", ")})}else g({...d,[A]:Y}),v({...p,[A]:""}),u<r.length-1&&setTimeout(()=>h(u+1),150)},M=(U,Y)=>{const A=Ii(U);v({...p,[A]:Y}),Y&&!U.multiSelect&&g({...d,[A]:""})},L=U=>{const Y=Ii(U);U.multiSelect&&p[Y]&&v({...p,[Y]:""})},j=r.every(U=>k(Ii(U),U).length>0),D=r[u],H=u===r.length-1,G=D&&k(Ii(D),D).length>0,I=()=>{u<r.length-1&&h(u+1)},q=()=>{u>0&&h(u-1)},B=()=>{if(!j)return;const U={};for(const Y of r){const A=Ii(Y);U[A]=k(A,Y)}w(U),C(!0),t(e.toolId,r,U)},W=U=>{if(U.key==="Enter"&&!(!D||!G)){if(U.preventDefault(),H){B();return}I()}};if(S||s){const U=o||y||{};return f.jsx("div",{className:"w-full",children:f.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[f.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:[f.jsxs("p",{children:["Question",r.length!==1?"s":""]}),f.jsx("p",{className:"",children:l?"Discarded":"Answers"})]}),r.map((Y,A)=>{const P=U[Ii(Y)]||U[Y.question]||[],X=A===r.length-1;return f.jsxs("div",{className:me("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!X&&"border-b border-border"),children:[f.jsx("div",{className:"text-sm text-pretty",children:Y.question}),P.length>0&&f.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:P.join(", ")}),P.length===0&&f.jsx("div",{className:"text-sm font-medium text-right italic",children:l?"Discarded":"No Response"})]},Ii(Y))})]})})}if(!n)return f.jsx("div",{className:"w-full py-2",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(NN,{className:"h-4 w-4 text-muted-foreground"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!D)return null;const F=R(D),V=p[Ii(D)]||"";return f.jsxs("div",{className:"w-full space-y-3",children:[f.jsxs(Cne,{question:D.question,currentIndex:u,totalQuestions:r.length,onBack:u>0?q:void 0,children:[($=D.options)==null?void 0:$.map(U=>f.jsx(kne,{option:U,selected:F.includes(U.label),multiSelect:D.multiSelect,onClick:()=>E(D,U.label)},U.label)),f.jsx("div",{className:"transition-all bg-background",children:f.jsxs("div",{className:"flex pr-5 items-center justify-between gap-3",children:[f.jsx("input",{type:"text",value:V,onChange:U=>M(D,U.target.value),onKeyDown:W,placeholder:"Other...",className:"flex-1 px-3 !py-1 pl-4 min-h-[55px] min-w-0 text-base md:text-sm bg-transparent outline-none text-foreground placeholder:text-muted-foreground"}),f.jsx(m3,{selected:!!V,multiSelect:D.multiSelect,onClick:D.multiSelect&&V?()=>L(D):void 0})]})})]}),f.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!H&&G&&(D.multiSelect||!!V)&&f.jsx(Ze,{size:"sm",onClick:I,children:"Next"}),H&&f.jsx(Ze,{size:"sm",onClick:B,disabled:!j,className:me(!j&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}async function Tne(e){const t=await new Promise((n,r)=>{const s=new FileReader;s.onload=()=>{if(typeof s.result=="string"){n(s.result);return}r(new Error("Failed to read image attachment"))},s.onerror=()=>r(s.error??new Error("Failed to read image attachment")),s.readAsDataURL(e)});return{type:"image",name:e.name,mimeType:e.type,sizeBytes:e.size,dataUrl:t}}function Nne({message:e,onConfirm:t,isLatest:n,isActionable:r=n}){const s=!!e.result,[o,l]=b.useState(!1),[u,h]=b.useState(!1),[d,g]=b.useState(!1),[p,v]=b.useState(""),[y,w]=b.useState([]),[S,C]=b.useState(null),[k,R]=b.useState(!1),[E,M]=b.useState(!1),L=b.useRef(null),j=b.useRef(null),D=e.input;b.useEffect(()=>{d&&L.current&&L.current.focus()},[d]),b.useEffect(()=>()=>{for(const F of y)URL.revokeObjectURL(F.previewUrl)},[y]);const H=async()=>{D!=null&&D.plan&&(await navigator.clipboard.writeText(D.plan),h(!0),setTimeout(()=>h(!1),2e3))},G=b.useCallback(F=>{const V=F.filter(O=>O.type.startsWith("image/"));if(V.length===0){C("Only PNG, JPEG, WEBP, and GIF images are supported.");return}w(O=>{const $=[...O];let U=null;for(const Y of V){if(!Mm.includes(Y.type)){U=`Unsupported image type: ${Y.type||"unknown"}`;continue}if(Y.size<=0||Y.size>yM){U=`${Y.name} is empty or larger than 10 MB.`;continue}if($.length>=Nm){U=`You can attach up to ${Nm} images per message.`;break}$.push({id:id(),file:Y,name:Y.name||"image",mimeType:Y.type,sizeBytes:Y.size,previewUrl:URL.createObjectURL(Y)})}return C(U),$})},[]),I=b.useCallback(F=>{w(V=>{const O=V.find($=>$.id===F);return O&&URL.revokeObjectURL(O.previewUrl),V.filter($=>$.id!==F)}),C(null)},[]),q=async()=>{if(!(!p.trim()&&y.length===0)){M(!0);try{const F=y.length?await Promise.all(y.map(V=>Tne(V.file))):void 0;t(e.toolId,!1,void 0,p.trim(),F)}finally{M(!1)}}},B=s?e.result:null,W=(B==null?void 0:B.discarded)===!0;return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"relative rounded-2xl border border-border overflow-hidden group/plan",children:[(D==null?void 0:D.plan)&&f.jsx(Ze,{variant:"ghost",size:"icon",className:me("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",!u&&"hover:text-foreground",u&&"hover:!bg-transparent hover:!border-transparent"),onClick:H,children:u?f.jsx(qi,{className:"h-4 w-4 text-green-400"}):f.jsx(Bd,{className:"h-4 w-4"})}),f.jsxs("div",{className:me("!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",s&&!o?"max-h-[min(400px,40vh)] ":"",s?"hover:!pb-[32px]":""),children:[s&&f.jsxs(Ze,{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:()=>l(!o),children:[o?"Show Less":"Show More",f.jsx(dp,{className:`size-3.5 transition-transform ${o?"rotate-180":""}`})]}),D!=null&&D.plan?f.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:D.plan}),f.jsx("div",{className:"mt-5"})]}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),s?f.jsx("div",{className:"flex justify-end mx-2",children:f.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:[f.jsx("em",{children:W?"Discarded":B!=null&&B.clearContext?"Approved & Cleared Context":B!=null&&B.confirmed?"Approved":B!=null&&B.message?`Adjusted: "${B.message}"`:"Adjusted Plan"}),f.jsx(e6,{className:"inline h-4 w-4 ml-1.5 -mt-0.5"})]})}):n?r?f.jsxs("div",{className:"flex flex-col gap-3",children:[!d&&f.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2 mx-2",children:[f.jsxs(Ze,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-primary-foreground pr-4 md:order-last",children:[f.jsx(AI,{className:"h-4 w-4 mr-1.5"}),"Approve & Clear"]}),f.jsxs("div",{className:"flex items-stretch md:items-center gap-2 md:contents",children:[f.jsxs(Ze,{size:"sm",variant:"outline",onClick:()=>g(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[f.jsx(gc,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),f.jsxs(Ze,{size:"sm",variant:"outline",onClick:()=>t(e.toolId,!0),className:"rounded-full border-border flex-1 md:flex-initial",children:[f.jsx(qi,{className:"h-4 w-4 mr-1.5"}),"Approve"]})]})]}),d&&f.jsxs("div",{className:me("flex flex-col gap-2 rounded-2xl border bg-muted dark:bg-card px-4 py-3 transition-colors",k?"border-foreground/40 bg-muted/80":"border-border"),onDragEnter:F=>{F.dataTransfer.types.includes("Files")&&(F.preventDefault(),R(!0))},onDragOver:F=>{F.dataTransfer.types.includes("Files")&&(F.preventDefault(),F.dataTransfer.dropEffect="copy",R(!0))},onDragLeave:F=>{if(!F.dataTransfer.types.includes("Files"))return;F.preventDefault();const V=F.relatedTarget;V instanceof Node&&F.currentTarget.contains(V)||R(!1)},onDrop:F=>{var V;F.dataTransfer.types.includes("Files")&&(F.preventDefault(),R(!1),G(Array.from(F.dataTransfer.files)),(V=L.current)==null||V.focus())},children:[f.jsx("input",{ref:j,type:"file",accept:Mm.join(","),multiple:!0,className:"hidden",onChange:F=>{G(Array.from(F.target.files??[])),F.target.value=""}}),y.length?f.jsx("div",{className:"grid grid-cols-2 gap-2 pt-1 pb-2 sm:grid-cols-3",children:y.map(F=>f.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/80 bg-background/80",children:[f.jsx("img",{src:F.previewUrl,alt:F.name,className:"h-28 w-full object-cover"}),f.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 px-2 py-1.5",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate text-xs text-foreground",children:F.name}),f.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[Math.max(1,Math.round(F.sizeBytes/1024))," KB"]})]}),f.jsx(Ze,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>I(F.id),disabled:E,children:f.jsx(Js,{className:"h-3.5 w-3.5"})})]})]},F.id))}):null,f.jsx("textarea",{ref:L,value:p,onChange:F=>v(F.target.value),onPaste:F=>{const V=Array.from(F.clipboardData.files);V.some(O=>O.type.startsWith("image/"))&&(F.preventDefault(),G(V))},onKeyDown:F=>{F.key==="Enter"&&!F.shiftKey&&(p.trim()||y.length>0)&&(F.preventDefault(),q()),F.key==="Escape"&&(g(!1),v(""),w([]),C(null))},placeholder:"Describe what you'd like to change...",rows:3,className:"w-full bg-transparent text-[16px] md:text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none"}),S?f.jsx("div",{className:"text-xs text-destructive",children:S}):null,f.jsxs("div",{className:"flex items-center justify-between mt-1",children:[f.jsx(Ze,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full text-muted-foreground hover:text-foreground",onClick:()=>{var F;return(F=j.current)==null?void 0:F.click()},disabled:E,children:f.jsx(DN,{className:"h-4 w-4"})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ze,{size:"sm",variant:"ghost",onClick:()=>{g(!1),v(""),w([]),C(null)},className:"rounded-full text-muted-foreground",disabled:E,children:"Cancel"}),f.jsxs(Ze,{size:"sm",disabled:!p.trim()&&y.length===0||E,onClick:()=>void q(),className:"rounded-full bg-primary text-primary-foreground disabled:opacity-50 disabled:pointer-events-none",children:[f.jsx(q6,{className:"h-4 w-4 mr-1.5"}),E?"Adjusting...":"Adjust Plan"]})]})]})]})]}):f.jsx("div",{className:"flex justify-end mx-2",children:f.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending"})}):f.jsx("div",{className:"flex justify-end mx-2",children:f.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending (newer prompt active)"})})]})}const Mne={completed:{Icon:qi,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:li,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:VI,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function Ane({message:e}){const t=e.input.todos;return t.length?f.jsx("div",{className:"w-full",children:f.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[f.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:[f.jsx(E6,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),f.jsx("div",{children:t.map((n,r)=>{const s=r===t.length-1,{Icon:o,iconClass:l,textClass:u}=Mne[n.status];return f.jsxs("div",{className:me("flex items-center gap-3 px-4 py-2.5 bg-background",!s&&"border-b border-border"),children:[f.jsx(o,{className:me("h-4 w-4 flex-shrink-0",l)}),f.jsx("span",{className:me("text-sm",u),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function Dne(e){const t=e.split(`
|
|
621
|
+
`),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 jne(e){return e.replace(/<[^>]+>/g,"")}function One(e,t){const n=e.split(`
|
|
622
|
+
`),r=t.split(`
|
|
623
|
+
`),s=Lne(n,r),o=zne(n,r,s);return Pne(o)}function Lne(e,t){const n=e.length,r=t.length,s=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let o=1;o<=n;o++)for(let l=1;l<=r;l++)s[o][l]=e[o-1]===t[l-1]?s[o-1][l-1]+1:Math.max(s[o-1][l],s[o][l-1]);return s}function zne(e,t,n){const r=[];let s=e.length,o=t.length;for(;s>0||o>0;)s>0&&o>0&&e[s-1]===t[o-1]?(r.push({type:"context",text:e[s-1],oldIdx:s,newIdx:o}),s--,o--):o>0&&(s===0||n[s][o-1]>=n[s-1][o])?(r.push({type:"added",text:t[o-1],oldIdx:s,newIdx:o}),o--):(r.push({type:"removed",text:e[s-1],oldIdx:s,newIdx:o}),s--);return r.reverse()}function Pne(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function x_({content:e,isDiff:t=!1,oldString:n,newString:r}){const s=b.useMemo(()=>t&&n!==void 0&&r!==void 0?One(n,r):[],[t,n,r]),o=b.useMemo(()=>t?[]:Dne(e),[e,t]),l=b.useMemo(()=>o.some(u=>u.lineNumber!==null),[o]);return t&&s.length>0?f.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:f.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:f.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:f.jsx("tbody",{children:s.map((u,h)=>{const d=u.type==="removed"?"bg-red-500/10 dark:bg-red-500/15":u.type==="added"?"bg-green-500/10 dark:bg-green-500/15":"",g=u.type==="removed"?"text-red-700 dark:text-red-400":u.type==="added"?"text-green-700 dark:text-green-400":"text-foreground";return f.jsxs("tr",{className:d,children:[f.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"?"+":" "}),f.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${g}`,children:u.content.slice(1)})]},h)})})})})}):f.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:f.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:f.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:f.jsx("tbody",{children:o.map((u,h)=>f.jsxs("tr",{children:[l&&f.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:""}),f.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:jne(u.content)})]},h))})})})})}function p3({message:e,isLoading:t=!1,localPath:n}){var k;const r=e.result!==void 0,s=!r&&t,o=b.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 R=e.result.content;if(typeof R=="string")return R}return JSON.stringify(e.result,null,2)},[e.result]),l=b.useMemo(()=>{if((e.toolKind==="read_file"||e.toolKind==="write_file"||e.toolKind==="edit_file")&&e.input.filePath)return e.input.filePath;if(e.toolKind==="edit_file"){const R=o.match(/^Updated\s+(.+)$/m);if(R!=null&&R[1])return R[1].trim()}return""},[e.input,e.toolKind,o]),u=b.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 R=e.input.pattern,E=e.input.outputMode;return E==="count"?`Count \`${R}\` occurrences`:E==="content"?`Find \`${R}\` in text`:`Find \`${R}\` in files`}return e.toolKind==="bash"?e.input.description||(e.input.command?K7(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?l?`Read ${Zb(l,n)}`:"Read file":e.toolKind==="write_file"?l?`Write ${Zb(l,n)}`:"Write file":e.toolKind==="edit_file"?l?`Edit ${Zb(l,n)}`:"Edit file":e.toolKind==="mcp_generic"?`${W_(e.input.tool)} from ${W_(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[l,e.input,e.toolKind,e.toolName,n]),h=b.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),d=b.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),g=e.toolKind==="bash",p=e.toolKind==="write_file",v=e.toolKind==="edit_file",y=e.toolKind==="read_file",w=y&&!!o.trim(),S=v&&(!!e.input.oldString.trim()||!!e.input.newString.trim()),C=b.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 f.jsx(uo,{className:"w-full",children:f.jsxs(nh,{expandedContent:f.jsx(rh,{className:"my-4 text-sm",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[v?S?f.jsx(x_,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):o.trim()?f.jsx(Qb,{label:e.isError?"Error":"Result",copyText:o,children:o}):f.jsx("div",{className:"text-muted-foreground text-xs",children:"Cursor completed this edit, but ACP did not include the file diff details."}):!y&&!p&&f.jsx(Qb,{label:g?f.jsxs("span",{className:"flex items-center gap-2 w-full",children:[f.jsx("span",{children:"Command"}),!!e.input.timeoutMs&&f.jsxs("span",{className:"text-muted-foreground",children:["timeout: ",String(e.input.timeoutMs),"ms"]}),!!e.input.runInBackground&&f.jsx("span",{className:"text-muted-foreground",children:"background"})]}):p?"Contents":"Input",copyText:C,children:C}),r&&y&&!e.isError&&(w?f.jsx(x_,{content:o}):f.jsx("div",{className:"text-muted-foreground text-xs",children:"Cursor completed this read, but ACP did not include the file contents."})),p&&!e.isError&&f.jsx(x_,{content:e.input.content}),r&&!y&&!(p&&!e.isError)&&!(v&&!e.isError)&&f.jsx(Qb,{label:e.isError?"Error":"Result",copyText:o,children:o})]})}),children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:(()=>{if(e.isError)return f.jsx(Js,{className:"size-4 text-destructive"});if(h)return f.jsx(Tx,{className:"size-4 text-muted-icon"});const R=ej(e.toolName);return f.jsx(R,{className:"size-4 text-muted-icon"})})()}),f.jsx(ro,{className:"text-left transition-opacity duration-200 truncate",children:f.jsx(Tp,{animate:s,shimmerWidth:Math.max(20,(((k=d||u)==null?void 0:k.length)??33)*3),children:d||u})})]})})}function Bne({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),s=Math.floor(r/3600),o=Math.floor(r%3600/60),l=r%60;return s>0?`${s}h${o>0?` ${o}m`:""}`:o>0?`${o}m${l>0?` ${l}s`:""}`:`${l}s`};return e.success?f.jsxs(uo,{className:`px-0.5 text-xs tracking-wide ${e.durationMs>6e4?"":"hidden"}`,children:[f.jsx("div",{className:"w-full h-[1px] bg-border"}),f.jsxs(ro,{className:"whitespace-nowrap text-[11px] tracking-widest text-muted-foreground/60 uppercase flex-shrink-0",children:["Worked for ",t(e.durationMs)]}),f.jsx("div",{className:"w-full h-[1px] bg-border"})]}):f.jsx("div",{className:"px-4 py-3 mx-2 my-1 rounded-lg bg-destructive/10 border border-destructive/20 text-destructive text-sm",children:e.result||"An unknown error occurred."})}function Ine({message:e}){return f.jsx("div",{className:"flex items-center justify-end gap-2 text-sm text-muted-foreground my-3",children:f.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:[f.jsx($I,{className:"h-4 w-4 ml-1.5"}),f.jsx("em",{children:"Interrupted"})]})})}function tp({size:e=4}){return f.jsxs("svg",{className:"flex-1",viewBox:`0 0 100 ${e}`,preserveAspectRatio:"none",style:{height:`${e}px`},children:[f.jsx("pattern",{id:"zigzag",width:e,height:e,patternUnits:"userSpaceOnUse",children:f.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"}})}),f.jsx("rect",{width:"100%",height:e,fill:"url(#zigzag)",className:"text-muted-foreground/30"})]})}function Fne(){return f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(tp,{}),f.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),f.jsx(tp,{})]})}function Hne(){return f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(tp,{}),f.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),f.jsx(tp,{})]})}function Une({message:e}){return f.jsx(uo,{children:f.jsxs(nh,{expandedContent:f.jsx(rh,{className:"my-4 text-xs",children:f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:e.summary})})}),children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:f.jsx(MN,{className:"h-4.5 w-4.5 text-muted-foreground"})}),f.jsx(ro,{children:"Summarized"})]})})}const $ne={compacting:"Compacting..."};function Wne({message:e}){const t=$ne[e.status]||e.status;return f.jsxs(uo,{className:"grid grid-cols-[auto_1fr] items-center gap-1.5 text-sm animate-pulse",children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:f.jsx(MN,{className:"h-4.5 w-4.5 text-muted-foreground"})}),f.jsx(ro,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const Vne={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"}},qne={key:"other",singular:"tool call",plural:"tool calls"};function Kne(e){return Vne[e]??qne}function Gne(e){const t=new Map,n=[];for(const r of e){const s=r.toolKind,o=Kne(s),l=t.get(o.key);l?l.count++:(t.set(o.key,{category:o,count:1}),n.push(o.key))}return n.map(r=>{const{category:s,count:o}=t.get(r);return`${o} ${o===1?s.singular:s.plural}`}).join(", ")}function Yne({messages:e,isLoading:t,localPath:n}){const[r,s]=b.useState(!1),o=b.useMemo(()=>Gne(e),[e]),u=e.some(h=>h.result===void 0)&&t;return f.jsx(uo,{className:"w-full",children:f.jsxs("div",{className:"flex flex-col w-full",children:[f.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:f.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:f.jsx(Mr,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),f.jsx(ro,{className:"text-left",children:f.jsx(Tp,{animate:u,children:o})})]})}),r&&f.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(h=>f.jsx(p3,{message:h,isLoading:t,localPath:n},h.id)),e.length>5&&f.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:f.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:f.jsx(Mr,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),f.jsx(ro,{className:"text-left",children:"Collapse"})]})})]})]})})}const Xne=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function GR(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!Xne.has(t)}function Zne(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(GR(r)){const s=[r],o=n;for(n+=1;n<e.length&&GR(e[n]);)s.push(e[n]),n+=1;s.length>=2?t.push({type:"tool-group",messages:s,startIndex:o}):t.push({type:"single",message:r,index:o});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function Qne({messages:e,isLoading:t,localPath:n,latestToolIds:r,onOpenLocalLink:s,onAskUserQuestionSubmit:o,onExitPlanModeConfirm:l,pendingTool:u}){const h=b.useMemo(()=>Zne(e),[e]);function d(g,p){if(g.kind==="user_prompt")return f.jsx(mne,{content:g.content,attachments:g.attachments},g.id);switch(g.kind){case"unknown":return f.jsx(pne,{json:g.json},g.id);case"system_init":return e.findIndex(y=>y.kind==="system_init")===p?f.jsx(yne,{message:g,rawJson:g.debugRaw},g.id):null;case"account_info":return e.findIndex(y=>y.kind==="account_info")===p?f.jsx(xne,{message:g},g.id):null;case"assistant_text":return f.jsx(wne,{message:g},g.id);case"assistant_thought":return f.jsx(Sne,{message:g},g.id);case"tool":return g.toolKind==="ask_user_question"?f.jsx(Rne,{message:g,onSubmit:o,isLatest:g.id===r.AskUserQuestion},g.id):g.toolKind==="exit_plan_mode"?f.jsx(Nne,{message:g,onConfirm:l,isLatest:g.id===r.ExitPlanMode,isActionable:(u==null?void 0:u.toolKind)==="exit_plan_mode"&&u.toolUseId===g.toolId},g.id):g.toolKind==="todo_write"?g.id!==r.TodoWrite?null:f.jsx(Ane,{message:g},g.id):f.jsx(p3,{message:g,isLoading:t,localPath:n},g.id);case"result":{const v=e[p+1],y=e[p-1];return(v==null?void 0:v.kind)==="context_cleared"||(y==null?void 0:y.kind)==="context_cleared"?null:f.jsx(Bne,{message:g},g.id)}case"interrupted":return f.jsx(Ine,{message:g},g.id);case"compact_boundary":return f.jsx(Fne,{},g.id);case"context_cleared":return f.jsx(Hne,{},g.id);case"compact_summary":return f.jsx(Une,{message:g},g.id);case"status":return p===e.length-1?f.jsx(Wne,{message:g},g.id):null}}return f.jsx(WG,{onOpenLocalLink:s,children:h.map(g=>{if(g.type==="tool-group")return f.jsx("div",{className:"group relative",[Sm]:"",children:f.jsx(Yne,{messages:g.messages,isLoading:t,localPath:n})},`group-${g.startIndex}`);const p=d(g.message,g.index);return p?f.jsx("div",{id:`msg-${g.message.id}`,className:"group relative",[Sm]:"",children:p},g.message.id):null})})}function Jne({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){b.useEffect(()=>{if(!n)return;let s=0,o=null;const l=p=>{const v=p instanceof Element?p:null,y=e.current,w=t.current;if(Fk({trigger:"pointer",activeElement:document.activeElement,pointerStartTarget:o,pointerEndTarget:v,root:y,fallback:w,hasActiveOverlay:Ik(document),hasActiveSelection:p8(window.getSelection())})!=="restore"){o=null;return}w==null||w.focus({preventScroll:!0}),o=null},u=p=>{cancelAnimationFrame(s),o=p.target instanceof Element?p.target:null},h=p=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{l(p.target)})},d=()=>{o=null;const p=t.current;!p||p.disabled||p.focus({preventScroll:!0})},g=p=>{if(p.key!=="Escape")return;const v=t.current;Fk({trigger:"escape",activeElement:document.activeElement,fallback:v,hasActiveOverlay:Ik(document),canCancel:r,defaultPrevented:p.defaultPrevented})==="escape-focus"&&(p.preventDefault(),v==null||v.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",u,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("keydown",g,!0),window.addEventListener(wm,d),()=>{cancelAnimationFrame(s),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("keydown",g,!0),window.removeEventListener(wm,d)}},[r,n,t,e])}const Qf="How can I help you?",ere=19,tre=72,nre=120;function rre(){var De,Xe,pt,at,fe,Ve,Ae,et,lt,nt,Kt;const e=sp(),t=b.useRef(null),n=b.useRef(null),r=b.useRef(null),[s,o]=b.useState(""),[l,u]=b.useState(!1),[h,d]=b.useState(0),g=Zd("(min-width: 768px)"),p=typeof window>"u"?!0:nj(window.location.hostname),v=((De=e.runtime)==null?void 0:De.projectId)??null,w=Go(Se=>v?Se.projects[v]:void 0)??rY,C=fd(Se=>v?Se.projects[v]:void 0)??QG,k=Go(Se=>Se.addTerminal),R=Go(Se=>Se.removeTerminal),E=Go(Se=>Se.toggleVisibility),M=Go(Se=>Se.resetMainSizes),L=Go(Se=>Se.setMainSizes),j=Go(Se=>Se.setTerminalSizes),D=fd(Se=>Se.toggleVisibility),H=fd(Se=>Se.setSize),G=Ci(Se=>Se.scrollbackLines),I=Ci(Se=>Se.minColumnWidth),q=e.keybindings,B=b.useMemo(()=>v0(q),[q]),W=w.terminals.length>0,F=!!(v&&w.isVisible&&W),V=!!(v&&W),O=!!(v&&C.isVisible),$=!!(v&&!g&&O),U=!!(v&&g),{isAnimating:Y,mainPanelGroupRef:A,terminalFocusRequestVersion:P,terminalPanelRef:X,terminalVisualRef:N}=bY({showTerminalPane:F,shouldRenderTerminalLayout:V,projectId:v,terminalLayout:w,chatInputRef:r}),{isAnimating:ne,panelGroupRef:oe,sidebarPanelRef:J,sidebarVisualRef:te}=pY({projectId:v,shouldRenderRightSidebarLayout:U,showRightSidebar:O,rightSidebarSize:C.size});Jne({rootRef:n,fallbackRef:r,enabled:e.hasSelectedProject&&((Xe=e.runtime)==null?void 0:Xe.status)!=="waiting_for_user",canCancel:e.canCancel});const ue=()=>{if(v){if(W){E(v);return}k(v)}},he=Se=>{var Ne;if(!v||!F||Y.current)return;const qe=Se.chat,se=Se.terminal;if(!Number.isFinite(qe)||!Number.isFinite(se))return;const pe=((Ne=t.current)==null?void 0:Ne.getBoundingClientRect().height)??0;if(aY(pe,se)){M(v),E(v);return}L(v,[qe,se])};b.useEffect(()=>{if(e.messages.length!==0)return;o(""),u(!1);let Se=0;const qe=window.setInterval(()=>{Se+=1,o(Qf.slice(0,Se)),Se>=Qf.length&&(window.clearInterval(qe),u(!0))},ere);return()=>window.clearInterval(qe)},[e.activeChatId,e.messages.length]),b.useEffect(()=>{function Se(qe){if(v){if(Ia(B,"toggleEmbeddedTerminal",qe)){qe.preventDefault(),ue();return}if(Ia(B,"toggleRightSidebar",qe)){qe.preventDefault(),D(v);return}if(Ia(B,"openInFinder",qe)){if(!p)return;qe.preventDefault(),e.handleOpenExternal("open_finder");return}if(Ia(B,"openInEditor",qe)){if(!p)return;qe.preventDefault(),e.handleOpenExternal("open_editor");return}Ia(B,"addSplitTerminal",qe)&&(qe.preventDefault(),k(v))}}return window.addEventListener("keydown",Se),()=>window.removeEventListener("keydown",Se)},[k,p,ue,v,B,D]),b.useEffect(()=>{const Se=window.requestAnimationFrame(()=>{e.updateScrollState()}),qe=window.setTimeout(()=>{e.updateScrollState()},lc);return()=>{window.cancelAnimationFrame(Se),window.clearTimeout(qe)}},[V,F,e.updateScrollState]),b.useEffect(()=>{function Se(){e.updateScrollState()}return window.addEventListener("resize",Se),()=>window.removeEventListener("resize",Se)},[e.updateScrollState]),b.useEffect(()=>{if(g)return;const Se=window.visualViewport;if(!Se)return;const qe=()=>{const se=e.scrollRef.current;if(!se)return;const pe=se.scrollHeight-se.scrollTop-se.clientHeight;if(aj(pe)){requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.scrollToBottom(),e.updateScrollState()})});return}const Ne=document.activeElement;Ne&&se.contains(Ne)&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{var xt;const He=(xt=e.inputRef.current)==null?void 0:xt.getBoundingClientRect(),Oe=Ne.getBoundingClientRect();if(He&&Oe.bottom>He.top){const Bt=Oe.bottom-He.top;se.scrollBy({top:Bt+16,behavior:"auto"})}e.updateScrollState()})})};return Se.addEventListener("resize",qe),Se.addEventListener("scroll",qe),()=>{Se.removeEventListener("resize",qe),Se.removeEventListener("scroll",qe)}},[g,e.scrollRef,e.scrollToBottom,e.updateScrollState]),b.useEffect(()=>{const Se=t.current;if(!Se||!V)return;const qe=()=>{const pe=Se.getBoundingClientRect().height;if(pe<=0)return;const Ne=pe*(w.mainSizes[1]/100);Ne<=0||d(He=>Math.abs(He-Ne)<1?He:Ne)},se=new ResizeObserver(qe);return se.observe(Se),qe(),()=>se.disconnect()},[v,V,w.mainSizes]);const ge=Se=>Number.isFinite(Se)?Math.min(Gy,Math.max(Wp,Se)):C.size,ke=()=>{v&&D(v)},Ee=f.jsxs(b0,{ref:n,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",children:[f.jsxs(_0,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[f.jsx(OW,{sidebarCollapsed:e.sidebarCollapsed,hasCompletedChats:e.completedChatIds.size>0,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,usage:e.usage,localPath:e.navbarLocalPath,embeddedTerminalVisible:F,onToggleEmbeddedTerminal:v?ue:void 0,rightSidebarVisible:O,onToggleRightSidebar:v?()=>D(v):void 0,onOpenExternal:p?Se=>{e.handleOpenExternal(Se)}:void 0,editorLabel:e.editorLabel,projectId:v??void 0,socket:e.socket,finderShortcut:p?B.bindings.openInFinder:void 0,editorShortcut:p?B.bindings.openInEditor:void 0,terminalShortcut:B.bindings.toggleEmbeddedTerminal,rightSidebarShortcut:B.bindings.toggleRightSidebar}),f.jsxs($p,{ref:e.scrollRef,onScroll:e.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[(pt=e.runtime)!=null&&pt.inactiveProviderMessage?f.jsxs("div",{className:"mx-auto mt-[72px] max-w-[800px] rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-900 dark:text-amber-200",children:["This thread uses ",e.runtime.provider,", which is currently inactive. ",e.runtime.inactiveProviderMessage]}):null,e.messages.length===0?f.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"}):null,e.messages.length>0?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"animate-fade-in space-y-5 pt-[72px] max-w-[800px] mx-auto",children:[f.jsx(Qne,{messages:e.messages,isLoading:e.isProcessing,localPath:(at=e.runtime)==null?void 0:at.localPath,latestToolIds:e.latestToolIds,pendingTool:((fe=e.runtime)==null?void 0:fe.pendingTool)??null,onOpenLocalLink:e.handleOpenLocalLink,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?f.jsx(YG,{status:(Ve=e.runtime)==null?void 0:Ve.status}):null,e.commandError?f.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3",children:e.commandError}):null]}),f.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"})]}):null]}),e.messages.length===0?f.jsx("div",{className:"pointer-events-none absolute inset-x-4 animate-fade-in",style:{top:tre,bottom:e.transcriptPaddingBottom},children:f.jsx("div",{className:"mx-auto flex h-full max-w-[800px] items-center justify-center",children:f.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground gap-4 opacity-70",children:[f.jsx(sd,{className:"size-8 text-muted-foreground kaizen-empty-state-flower"}),f.jsx("div",{className:"text-base font-normal text-muted-foreground text-center max-w-xs flex items-center kaizen-empty-state-text","aria-label":Qf,children:f.jsxs("span",{className:"relative inline-grid place-items-start",children:[f.jsxs("span",{className:"invisible col-start-1 row-start-1 whitespace-pre flex items-center",children:[f.jsx("span",{children:Qf}),f.jsx("span",{className:"kaizen-typewriter-cursor-slot","aria-hidden":"true"})]}),f.jsxs("span",{className:"col-start-1 row-start-1 whitespace-pre flex items-center",children:[f.jsx("span",{children:s}),f.jsx("span",{className:"kaizen-typewriter-cursor-slot","aria-hidden":"true",children:f.jsx("span",{className:"kaizen-typewriter-cursor","data-typing-complete":l?"true":"false"})})]})]})})]})})},e.activeChatId??"new-chat"):null,f.jsx("div",{style:{bottom:nre},className:me("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:f.jsx("button",{onClick:e.scrollToBottom,className:"flex items-center transition-colors gap-1.5 px-2 bg-background/80 dark:bg-card/40 backdrop-blur-lg hover:bg-muted/80 border border-border rounded-full aspect-square cursor-pointer text-sm text-foreground/80 hover:text-foreground",children:f.jsx(yI,{className:"h-5 w-5"})})})]}),f.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-20 pointer-events-none",children:f.jsx("div",{className:"bg-gradient-to-t from-background via-background pointer-events-auto",ref:e.inputRef,children:f.jsx(NW,{ref:r,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((Ae=e.runtime)==null?void 0:Ae.status)==="waiting_for_user"||!!((et=e.runtime)!=null&&et.inactiveProviderMessage),canCancel:e.canCancel,chatId:e.activeChatId,activeProvider:((lt=e.runtime)==null?void 0:lt.provider)??null,activeModel:((nt=e.runtime)==null?void 0:nt.model)??null,activePlanMode:((Kt=e.runtime)==null?void 0:Kt.planMode)??!1,availableProviders:e.availableProviders,keybindings:B},e.activeChatId??"new-chat")})})]});return f.jsxs("div",{ref:t,className:"flex-1 flex flex-col min-w-0 relative",children:[U&&v?f.jsxs(ud,{groupRef:oe,orientation:"horizontal",className:"flex-1 min-h-0",onLayoutChange:Se=>{var se;if(!O||ne.current)return;const qe=ge(Se.rightSidebar);Math.abs(qe-Se.rightSidebar)<.1||(se=oe.current)==null||se.setLayout({workspace:100-qe,rightSidebar:qe})},onLayoutChanged:Se=>{!O||ne.current||H(v,ge(Se.rightSidebar))},children:[f.jsx(Ys,{id:"workspace",defaultSize:`${100-C.size}%`,minSize:"50%",className:"min-h-0 min-w-0",children:V?f.jsxs(ud,{groupRef:A,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:he,children:[f.jsx(Ys,{id:"chat",defaultSize:`${w.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:Ee}),f.jsx(dd,{withHandle:!0,orientation:"vertical",disabled:!F,className:me(!F&&"pointer-events-none opacity-0")}),f.jsx(Ys,{id:"terminal",defaultSize:`${w.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:X,children:f.jsx("div",{ref:N,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":F?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${lc}ms`},children:f.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:f.jsx(KE,{projectId:v,layout:w,onAddTerminal:k,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:G,minColumnWidth:I,splitTerminalShortcut:B.bindings.addSplitTerminal,focusRequestVersion:P,onRemoveTerminal:(Se,qe)=>{e.socket.command({type:"terminal.close",terminalId:qe}).catch(()=>{}),R(Se,qe)},onTerminalLayout:j})})})})]},v):Ee}),f.jsx(dd,{withHandle:!0,orientation:"horizontal",disabled:!O,className:me(!O&&"pointer-events-none opacity-0")}),f.jsx(Ys,{id:"rightSidebar",defaultSize:`${C.size}%`,maxSize:`${Gy}%`,className:"min-h-0 min-w-0",elementRef:J,children:f.jsx("div",{ref:te,className:"h-full min-h-0 overflow-hidden","data-right-sidebar-open":O?"true":"false","data-right-sidebar-animated":"false","data-right-sidebar-visual":!0,style:{"--terminal-toggle-duration":`${lc}ms`},children:f.jsx(D2,{onClose:()=>D(v)})})})]},`${v}-right-sidebar`):V&&v?f.jsxs(ud,{groupRef:A,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:he,children:[f.jsx(Ys,{id:"chat",defaultSize:`${w.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:Ee}),f.jsx(dd,{withHandle:!0,orientation:"vertical",disabled:!F,className:me(!F&&"pointer-events-none opacity-0")}),f.jsx(Ys,{id:"terminal",defaultSize:`${w.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:X,children:f.jsx("div",{ref:N,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":F?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${lc}ms`},children:f.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:f.jsx(KE,{projectId:v,layout:w,onAddTerminal:k,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:G,minColumnWidth:I,splitTerminalShortcut:B.bindings.addSplitTerminal,focusRequestVersion:P,onRemoveTerminal:(Se,qe)=>{e.socket.command({type:"terminal.close",terminalId:qe}).catch(()=>{}),R(Se,qe)},onTerminalLayout:j})})})})]},v):Ee,$?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 z-40 bg-black/40 md:hidden",onClick:ke}),f.jsx("div",{className:"fixed inset-0 z-50 flex flex-col bg-background/95 backdrop-blur-2xl md:hidden",children:f.jsx(D2,{onClose:ke,className:"h-[var(--app-shell-height)]"})})]}):null]})}const ire=700,sre=1500;function ore(){const e=rl(),t=sp(),n=t.featureOverviewSnapshot,r=Zd("(min-width: 768px)"),s=typeof window>"u"?!0:nj(window.location.hostname),[o,l]=b.useState("view"),[u,h]=b.useState(""),[d,g]=b.useState(!1),[p,v]=b.useState("idle"),[y,w]=b.useState(null),S=b.useRef(""),C=b.useRef(0);if(b.useEffect(()=>{n&&(S.current=n.content,h(n.content),g(!1),v("idle"),w(null))},[n==null?void 0:n.featureId]),b.useEffect(()=>{n&&(S.current=n.content,h(j=>d?j:n.content),d||(v("idle"),w(null)))},[d,n]),b.useEffect(()=>{if(!n||!d)return;const j=C.current+1;C.current=j,v("saving"),w(null);const D=window.setTimeout(()=>{t.socket.command({type:"feature.updateOverview",featureId:n.featureId,content:u}).then(H=>{C.current!==j||!H||(S.current=H.content,g(!1),v("saved"))}).catch(H=>{C.current===j&&(v("error"),w(H instanceof Error?H.message:String(H)))})},ire);return()=>window.clearTimeout(D)},[u,d,n==null?void 0:n.featureId,t.socket]),b.useEffect(()=>{if(p!=="saved")return;const j=window.setTimeout(()=>{v("idle")},sre);return()=>window.clearTimeout(j)},[p]),b.useEffect(()=>{r||o!=="split"||l("view")},[r,o]),!n)return f.jsx("div",{className:"flex flex-1 items-center justify-center",children:f.jsx("div",{className:"text-sm text-muted-foreground",children:t.sidebarReady?"Overview not found.":"Loading overview…"})});const k=o==="view"||o==="split",R=p==="saving"?"Saving…":p==="saved"?"Saved":p==="error"?"Save failed":"Ready",E=me("shrink-0 text-[11px] md:text-xs",p==="error"?"text-destructive":"text-muted-foreground"),M=f.jsx($p,{className:"h-full min-h-0",children:f.jsx("div",{className:"mx-auto max-w-4xl px-4 py-5",children:f.jsx("div",{className:"prose prose-slate max-w-none dark:prose-invert",children:f.jsx(Ic,{remarkPlugins:[Fc],components:zc({onOpenLocalLink:t.handleOpenLocalLink}),children:u})})})}),L=f.jsx("div",{className:"flex h-full min-h-0 flex-col",children:f.jsx("div",{className:"mx-auto flex h-full min-h-0 w-full max-w-4xl px-4 py-5",children:f.jsx(Fd,{value:u,onChange:j=>{const D=j.target.value;h(D),g(D!==S.current),p!=="saving"&&v("idle"),w(null)},spellCheck:!1,className:"h-full min-h-0 resize-none rounded-none border-0 bg-transparent px-0 py-0 font-mono text-base leading-7 focus-visible:ring-0 md:text-[13px] md:leading-6"})})});return f.jsx("div",{className:"flex flex-1 min-w-0 flex-col",children:f.jsx(b0,{className:"h-full rounded-none border-0 bg-background",children:f.jsxs(_0,{className:"flex h-full min-h-0 flex-col p-0",children:[f.jsxs("div",{className:"flex flex-col gap-3 border-b border-border px-4 py-3 md:flex-row md:items-center md:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 items-start gap-2 md:flex-1",children:[f.jsx(Ze,{variant:"ghost",size:"icon",className:"mt-0.5 h-8 w-8 shrink-0 rounded-full",title:"Back",onClick:()=>{if(window.history.length>1){e(-1);return}e("/")},children:f.jsx(CI,{className:"size-4"})}),f.jsxs("div",{className:"min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n.title}),r?null:f.jsx("div",{className:me(E,"text-right"),children:R})]}),f.jsx("div",{className:"truncate text-xs text-muted-foreground",children:n.overviewRelativePath})]})]}),f.jsxs("div",{className:"flex items-center gap-2 md:shrink-0 md:gap-3",children:[r?f.jsx("div",{className:E,children:R}):null,f.jsx("div",{className:"flex min-w-0 flex-1 items-center rounded-lg border border-border p-1 md:flex-none",children:(r?[{mode:"view",label:"View",icon:Ok},{mode:"edit",label:"Edit",icon:gc},{mode:"split",label:"Split",icon:C6}]:[{mode:"view",label:"View",icon:Ok},{mode:"edit",label:"Edit",icon:gc}]).map(({mode:j,label:D,icon:H})=>{const G=o===j;return f.jsxs("button",{type:"button",onClick:()=>l(j),className:me("inline-flex flex-1 items-center justify-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors md:flex-none",G?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),children:[f.jsx(H,{className:"size-4"}),f.jsx("span",{children:D})]},j)})}),s?f.jsxs(Ze,{variant:"outline",size:"sm",className:"shrink-0 px-2.5 md:px-3",title:`Open in ${t.editorLabel}`,onClick:()=>{t.handleOpenExternalPath("open_editor",n.localPath)},children:[f.jsx(i6,{className:"size-4"}),f.jsxs("span",{className:"hidden md:inline",children:["Open in ",t.editorLabel]})]}):null]})]}),y?f.jsx("div",{className:"border-b border-destructive/20 bg-destructive/5 px-4 py-2 text-sm text-destructive",children:y}):null,f.jsx("div",{className:"flex-1 min-h-0",children:r&&o==="split"?f.jsxs(ud,{orientation:"horizontal",className:"h-full",children:[f.jsx(Ys,{defaultSize:"50%",minSize:"25%",className:"min-w-0",children:M}),f.jsx(dd,{orientation:"horizontal",withHandle:!0}),f.jsx(Ys,{defaultSize:"50%",minSize:"25%",className:"min-w-0 border-l border-border/60",children:L})]}):k?M:L})]})})})}function YR({narrow:e=!1,title:t,subtitle:n,icon:r=AN}){return f.jsxs("div",{className:me("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[f.jsxs("div",{className:me("flex items-center gap-1 mb-2",e&&"justify-center"),children:[f.jsx("div",{className:"p-2 pl-0 rounded-lg",children:f.jsx(r,{className:"h-6 w-6 text-muted-foreground"})}),f.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t})]}),n&&f.jsx("p",{className:me("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const are={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function lre({value:e,onValueChange:t,options:n,size:r="md",className:s,optionClassName:o}){return f.jsx("div",{className:me("inline-flex items-center rounded-lg border border-border p-[3px] ",s),children:n.map(l=>{const u=l.value===e,h=l.icon,d=h?b.isValidElement(h)?h:(()=>{const p=h;return f.jsx(p,{className:r==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,g=f.jsxs("button",{type:"button",onClick:()=>t(l.value),disabled:l.disabled,"aria-pressed":u,className:me("rounded-[4px] border transition-colors",h?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",are[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",o),children:[d,f.jsx("span",{children:l.label})]},l.value);return l.tooltip?f.jsxs(hs,{children:[f.jsx(fs,{asChild:!0,children:g}),f.jsx($i,{children:l.tooltip})]},l.value):g})})}function cre(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function ure(e){const t=e.split("/").filter(Boolean);return t[t.length-1]||e}function dre({open:e,onOpenChange:t,initialDirectory:n,onListDirectories:r,onConfirm:s}){var O;const[o,l]=b.useState("new"),[u,h]=b.useState(""),[d,g]=b.useState([]),[p,v]=b.useState({}),[y,w]=b.useState([]),[S,C]=b.useState(null),[k,R]=b.useState(""),[E,M]=b.useState(null),[L,j]=b.useState(null),D=b.useRef(null);b.useEffect(()=>{e&&(l("new"),h(""),g(n?n.roots:[]),v(n?{[n.currentPath]:n.entries}:{}),w(n?[n.currentPath]:[]),C((n==null?void 0:n.currentPath)??null),R(""),M(null),j(null),setTimeout(()=>{var $;return($=D.current)==null?void 0:$.focus()},0))},[n,e]),b.useEffect(()=>{e&&setTimeout(()=>{var $;o==="new"&&(($=D.current)==null||$.focus())},0)},[o,e]);const H=cre(u),G=H?`${f7}/${H}`:"",I=k.trim(),q=o==="new"?!!H:!!I,B=async $=>{M(null),j($??"__root__");try{const U=await r($);if(!$){g(U.roots),C(U.currentPath),v({[U.currentPath]:U.entries}),w([U.currentPath]);return}d.length===0&&(g([{name:ure(U.currentPath),localPath:U.currentPath}]),C(U.currentPath)),v(Y=>({...Y,[U.currentPath]:U.entries})),w(Y=>Y.includes(U.currentPath)?Y:[...Y,U.currentPath])}catch(U){M(U instanceof Error?U.message:String(U))}finally{j(null)}},W=async $=>{if(y.includes($)){w(U=>U.filter(Y=>Y!==$));return}if(p[$]){w(U=>[...U,$]);return}await B($)},F=($,U,Y)=>{const A=y.includes($),P=k===$,X=p[$]??[],N=L===$;return f.jsxs("div",{children:[f.jsxs("div",{className:me("grid grid-cols-[auto_1fr] items-center gap-2 px-3 py-2",P?"bg-muted":"hover:bg-muted/50"),style:{paddingLeft:`${12+Y*16}px`},children:[f.jsx("button",{type:"button",className:"flex h-6 w-6 items-center justify-center rounded hover:bg-background disabled:opacity-50",onClick:()=>void W($),disabled:N,children:N?f.jsx(li,{className:"h-4 w-4 animate-spin text-muted-foreground"}):f.jsx(Mr,{className:me("h-4 w-4 text-muted-foreground transition-transform",A&&"rotate-90")})}),f.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",onClick:()=>R($),children:[A?f.jsx(EN,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):f.jsx(TN,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"truncate",children:U})]})]}),A&&X.length>0?X.map(ne=>F(ne.localPath,ne.name,Y+1)):null]},$)},V=()=>{if(q){if(o==="new")s({mode:"new",localPath:G,title:u.trim()});else{const $=I.split("/").pop()||I;s({mode:"existing",localPath:I,title:$})}t(!1)}};return f.jsx(hp,{open:e,onOpenChange:t,children:f.jsxs(Id,{size:"sm",children:[f.jsxs(mp,{className:"space-y-4",children:[f.jsx(fp,{children:"Add Project"}),f.jsx(lre,{value:o,onValueChange:l,options:[{value:"new",label:"New Folder"},{value:"existing",label:"Existing Folder"}],className:"w-full mb-2",optionClassName:"flex-1 justify-center"}),o==="new"?f.jsxs("div",{className:"space-y-2",children:[f.jsx(ki,{ref:D,type:"text",value:u,onChange:$=>h($.target.value),onKeyDown:$=>{$.key==="Enter"&&V(),$.key==="Escape"&&t(!1)},placeholder:"Project name"}),G&&f.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:G})]}):f.jsxs("div",{className:"space-y-2",children:[f.jsx(ki,{type:"text",value:k,onChange:$=>R($.target.value),onKeyDown:$=>{$.key==="Enter"&&B(k||void 0)},placeholder:"Enter a server path, for example /home/bettie/Projects/my-app"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Import an existing folder from the connected server machine. You can type a path manually or choose from the root folder list below."}),f.jsx("div",{className:"flex justify-end",children:f.jsx(Ze,{type:"button",variant:"ghost",size:"sm",onClick:()=>void B("~"),disabled:L!==null,children:"Load Root"})}),d.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Server Folders"}),f.jsxs($p,{className:"max-h-64 rounded-xl border border-border",children:[d.map($=>F($.localPath,$.name,0)),S&&((O=p[S])==null?void 0:O.length)===0?f.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:"No subfolders"}):null]})]}):L?f.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-border px-3 py-2 text-sm text-muted-foreground",children:[f.jsx(li,{className:"h-4 w-4 animate-spin"}),"Loading folders from server machine..."]}):null,E?f.jsx("p",{className:"text-xs text-destructive",children:E}):null]})]}),f.jsxs(pp,{children:[f.jsx(Ze,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),f.jsx(Ze,{variant:"secondary",size:"sm",onClick:V,disabled:!q,children:o==="new"?"Create":"Import"})]})]})})}function hre({text:e}){const[t,n]=b.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return f.jsx(Ze,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void r(),children:t?f.jsx(qi,{className:"h-4 w-4 text-green-400"}):f.jsx(Bd,{className:"h-4 w-4"})})}function XR({children:e}){return f.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:[f.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[f.jsx(Mr,{className:"inline h-4 w-4 opacity-40"}),f.jsx("code",{children:e})]}),f.jsx(hre,{text:e})]})}function Jf({children:e}){return f.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function w_({children:e}){return f.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function S_({icon:e,title:t,subtitle:n,iconClassName:r}){return f.jsxs("div",{className:"flex flex-col items-center gap-0",children:[f.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:f.jsx(e,{className:r||"h-8 w-8 text-muted-foreground"})}),f.jsx("span",{className:"text-sm font-medium",children:t}),f.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function ZR(){return f.jsx(wI,{className:"h-4 w-4 text-muted-foreground"})}function QR({number:e,title:t,children:n}){return f.jsx("div",{className:"flex gap-4",children:f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[f.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[e,"."]}),f.jsx("h3",{className:"font-medium text-foreground mb-2",children:t})]}),f.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:n})]})})}function fre({localPath:e,iconDataUrl:t,loading:n,onClick:r,onHide:s}){const o=bn(l=>l.showProjectIconsInSidebar);return f.jsxs("div",{className:"relative group",children:[f.jsxs(hs,{children:[f.jsx(fs,{asChild:!0,children:f.jsxs("button",{className:me("border border-border hover:border-primary/30 rounded-lg bg-card px-4 py-3 flex items-center gap-3 w-full text-left hover:bg-muted/50 transition-colors",n&&"opacity-50 cursor-not-allowed"),disabled:n,onClick:r,children:[o?f.jsx(MA,{iconDataUrl:t,alt:`${Dm(e)} icon`,className:"h-5.5 w-5.5",fallback:f.jsx(TN,{className:"h-5.5 w-5.5 text-muted-foreground flex-shrink-0"})}):null,f.jsx("span",{className:"font-medium text-foreground truncate flex-1 pr-10",children:Dm(e)}),n?f.jsx(li,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):null]})}),f.jsx($i,{children:f.jsx("p",{children:e})})]}),f.jsx(Ze,{variant:"ghost",size:"icon",className:"absolute right-2 top-1/2 h-7 w-7 -translate-y-1/2 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",disabled:n,onClick:l=>{l.stopPropagation(),s()},children:f.jsx(bd,{className:"h-4 w-4"})})]})}function mre({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:s,onOpenProject:o,onHideProject:l,onListDirectories:u,onCreateProject:h}){const[d,g]=cz(),[p,v]=b.useState(!1),y=b.useMemo(()=>(n==null?void 0:n.projects)??[],[n==null?void 0:n.projects]),w=e==="connecting"||!t,S=e==="connected"&&t,C=d.get("newProject")==="1";b.useEffect(()=>{S&&C&&v(!0)},[S,C]);const k=R=>{if(v(R),!R&&C){const E=new URLSearchParams(d);E.delete("newProject"),g(E,{replace:!0})}};return f.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[S?f.jsxs(f.Fragment,{children:[f.jsx(YR,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${Pn} is connected, choose a project below to get started.`}),f.jsxs("div",{className:"w-full px-6 mb-10",children:[f.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[f.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:"Projects"}),f.jsxs(Ze,{variant:"default",size:"sm",onClick:()=>v(!0),children:[f.jsx(kx,{className:"h-4 w-4 mr-1.5"}),"Add Project"]})]}),y.length>0?f.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:y.map(R=>f.jsx(fre,{localPath:R.localPath,iconDataUrl:R.iconDataUrl,loading:r===R.localPath,onClick:()=>{o(R.localPath)},onHide:()=>{l(R.localPath)}},R.localPath))}):f.jsx(Jf,{children:f.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?f.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]})]}):f.jsxs(f.Fragment,{children:[f.jsx(YR,{narrow:!0,icon:jk,title:w?`Connecting ${Pn}`:`Connect ${Pn}`,subtitle:w?`${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.`}),f.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[f.jsx(w_,{children:"Status"}),f.jsx("div",{className:"mb-8",children:f.jsx(Jf,{children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(li,{className:"h-4 w-4 text-muted-foreground animate-spin"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:w?`Connecting to your local ${Pn} server...`:f.jsxs(f.Fragment,{children:["Not connected. Run ",f.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:Af()})," from any terminal on this machine."]})})]})})}),w?null:f.jsxs("div",{className:"mb-10",children:[f.jsx(w_,{children:"How it works"}),f.jsx(Jf,{children:f.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[f.jsx(S_,{icon:Rx,title:`${Pn} CLI`,subtitle:"On Your Machine"}),f.jsx(ZR,{}),f.jsx(S_,{icon:AN,title:`${Pn} Server`,subtitle:"Local WebSocket"}),f.jsx(ZR,{}),f.jsx(S_,{icon:jk,title:`${Pn} UI`,subtitle:"Project Chat"})]})})]}),w?null:f.jsxs("div",{className:"mb-10",children:[f.jsx(w_,{children:"Setup"}),f.jsx(Jf,{children:f.jsxs("div",{className:"space-y-4",children:[f.jsxs(QR,{number:1,title:`Start ${Pn}`,children:[f.jsx("p",{children:"Run this command in your terminal:"}),f.jsx(XR,{children:Af()})]}),f.jsxs(QR,{number:2,title:"Open the local UI",children:[f.jsxs("p",{children:[Pn," serves the app locally and opens the Local Projects page in an app-style browser window."]}),f.jsx(XR,{children:"http://localhost:3210/local"})]}),f.jsxs("div",{className:"mt-8",children:[f.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Notes"}),f.jsxs("div",{className:"space-y-3 text-sm",children:[f.jsxs("div",{className:"flex gap-4",children:[f.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:Af("").trim()}),f.jsx("span",{className:"text-muted-foreground",children:"Start in the current directory"})]}),f.jsxs("div",{className:"flex gap-4",children:[f.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:Af("--no-open")}),f.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),f.jsx(dre,{open:p,onOpenChange:k,initialDirectory:(n==null?void 0:n.rootDirectory)??null,onListDirectories:u,onConfirm:R=>{h(R)}}),f.jsx("div",{className:"py-4 text-center",children:f.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",Ux.split("/")[1]]})})]})}function pre(){const e=sp();return f.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:f.jsx(mre,{connectionStatus:e.connectionStatus,ready:e.localProjectsReady,snapshot:e.localProjects,startingLocalPath:e.startingLocalPath,commandError:e.commandError,onOpenProject:e.handleOpenLocalProject,onHideProject:e.handleHideLocalProject,onListDirectories:e.handleListDirectories,onCreateProject:e.handleCreateProject})})}function C_({children:e,className:t,icon:n,type:r="button",variant:s="outline",...o}){return f.jsxs("button",{type:r,className:me(qT({variant:s,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",t),...o,children:[n,e?f.jsx("span",{children:e}):null]})}const rd=[{id:"general",label:"General",icon:X6,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"providers",label:"Providers",icon:O6,subtitle:"Manage the default chat provider and saved model defaults for Claude, Codex, Gemini, and Cursor."},{id:"keybindings",label:"Keybindings",icon:ZI,subtitle:"Edit global app shortcuts stored in the active keybindings file."}];function JR(e){return e&&rd.some(t=>t.id===e)?e:null}const gre=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],eT=Object.keys(LA);function vre(e){return`Edit global app shortcuts stored in ${e}.`}function bre(e){const t=(e==null?void 0:e.status)==="checking",n=(e==null?void 0:e.status)==="updating"||(e==null?void 0:e.status)==="restart_pending";return e!=null&&e.updateAvailable?{disabled:n,kind:"update",label:"Update",variant:"default"}:{disabled:t||n,kind:"check",label:"Check for updates",spinning:t,variant:"outline"}}function em(e,t){const n=tn(t),r=(e==null?void 0:e.settings[t])??Wn[t];return n.systemActive?r.active?"Active.":"Inactive.":"Inactive by server policy."}function _re(e){return e&&typeof e=="object"&&"idx"in e&&typeof e.idx=="number"&&e.idx>0?"back":"home"}function tT({themePreference:e,nextBackgroundImage:t,backgroundOpacity:n}){const r=typeof t=="string"&&t.trim()!=="";return e!=="custom"||!r||n!==1?{}:{backgroundOpacity:.85,backgroundBlur:6}}function gn({title:e,description:t,children:n,bordered:r=!0,alignStart:s=!1}){return f.jsx("div",{className:r?"border-t border-border":void 0,children:f.jsxs("div",{className:`flex flex-col sm:flex-row sm:justify-between gap-3 sm:gap-8 py-5 ${s?"sm:items-start":"sm:items-center"}`,children:[f.jsxs("div",{className:"min-w-0 max-w-xl",children:[f.jsx("div",{className:"text-sm font-medium text-foreground",children:e}),f.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:t})]}),f.jsx("div",{className:"flex w-full items-center sm:w-auto sm:shrink-0",children:n})]})})}function yre(){var an,$t;const e=rl(),{sectionId:t}=yT(),n=sp(),{theme:r,setTheme:s}=GD(),o=JR(t)??"general",l=n.connectionStatus==="connecting"||!n.localProjectsReady,u=((an=n.localProjects)==null?void 0:an.machine.displayName)??"Unavailable",h=(($t=n.localProjects)==null?void 0:$t.projects.length)??0,d=Ux.split("/")[1]??"unknown",g=Ci(K=>K.scrollbackLines),p=Ci(K=>K.minColumnWidth),v=Ci(K=>K.editorPreset),y=Ci(K=>K.editorCommandTemplate),w=Ci(K=>K.setScrollbackLines),S=Ci(K=>K.setMinColumnWidth),C=Ci(K=>K.setEditorPreset),k=Ci(K=>K.setEditorCommandTemplate),R=n.keybindings,E=n.providerSettings,M=Si(K=>K.defaultProvider),L=Si(K=>K.providerDefaults),j=Si(K=>K.showProviderIconsInSideTray),D=Si(K=>K.setDefaultProvider),H=Si(K=>K.setProviderDefaultModel),G=Si(K=>K.setProviderDefaultModelOptions),I=Si(K=>K.setProviderDefaultPlanMode),q=Si(K=>K.setShowProviderIconsInSideTray),B=ii(K=>K.folderGroupsEnabled),W=ii(K=>K.showFeatureOverviewInSidebar),F=ii(K=>K.kanbanStatusesEnabled),V=ii(K=>K.commitProjectMetadataDirectory),O=ii(K=>K.setFolderGroupsEnabled),$=ii(K=>K.setShowFeatureOverviewInSidebar),U=ii(K=>K.setKanbanStatusesEnabled),Y=ii(K=>K.setCommitProjectMetadataDirectory),A=bn(K=>K.colorTheme),P=bn(K=>K.customAppearance),X=bn(K=>K.backgroundImage),N=bn(K=>K.backgroundOpacity),ne=bn(K=>K.backgroundBlur),oe=bn(K=>K.showProjectIconsInSidebar),J=bn(K=>K.setColorTheme),te=bn(K=>K.setCustomAppearance),ue=bn(K=>K.setBackgroundImage),he=bn(K=>K.setBackgroundOpacity),ge=bn(K=>K.setBackgroundBlur),ke=bn(K=>K.setShowProjectIconsInSidebar),Ee=b.useMemo(()=>v0(R),[R]),De=Ee.filePathDisplay||v7(),[Xe,pt]=b.useState(String(g)),[at,fe]=b.useState(String(p)),[Ve,Ae]=b.useState(y),[et,lt]=b.useState(X??""),[nt,Kt]=b.useState(String(N)),[Se,qe]=b.useState(String(ne)),[se,pe]=b.useState({}),[Ne,He]=b.useState(null),[Oe,xt]=b.useState(null),Bt=b.useMemo(()=>Wx((E==null?void 0:E.settings)??Wn),[E==null?void 0:E.settings]),Le=M==="last_used"||Bt.some(K=>K.id===M)?M:"last_used",[Ke,ft]=b.useState([]),we=n.updateSnapshot,Rt=bre(we),Gt=(we==null?void 0:we.status)==="checking"?"Checking for updates…":(we==null?void 0:we.status)==="updating"?"Installing update…":(we==null?void 0:we.status)==="restart_pending"?`Restarting ${Pn}…`:(we==null?void 0:we.status)==="available"?`Update available${we.latestVersion?`: ${we.latestVersion}`:""}`:(we==null?void 0:we.status)==="up_to_date"?"Up to date":(we==null?void 0:we.status)==="error"?"Update check failed":"Not checked yet";b.useEffect(()=>{fetch("/api/backgrounds").then(K=>K.json()).then(K=>ft(K)).catch(K=>console.error("Failed to load system backgrounds",K))},[]),b.useEffect(()=>{pt(String(g))},[g]),b.useEffect(()=>{fe(String(p))},[p]),b.useEffect(()=>{Ae(y)},[y]),b.useEffect(()=>{lt(X??"")},[X]),b.useEffect(()=>{Kt(String(N))},[N]),b.useEffect(()=>{qe(String(ne))},[ne]),b.useEffect(()=>{pe(Object.fromEntries(eT.map(K=>[K,Lb(Ee.bindings[K])])))},[Ee]),b.useEffect(()=>{t&&(JR(t)||e("/settings/general",{replace:!0}))},[e,t]);function _n(){const K=Number(Xe);if(!Number.isFinite(K)){pt(String(g));return}w(K)}function Kn(){const K=Number(at);if(!Number.isFinite(K)){fe(String(p));return}S(K)}function Sr(){const K=et.trim()===""?null:et.trim(),Ie=tT({themePreference:r,nextBackgroundImage:K,backgroundOpacity:N});ue(K),Ie.backgroundOpacity!==void 0&&he(Ie.backgroundOpacity),Ie.backgroundBlur!==void 0&&ge(Ie.backgroundBlur),At({backgroundImage:K,...Ie})}function Lt(){const K=Number(nt);if(!Number.isFinite(K)||K<0||K>1){Kt(String(N));return}he(K),At({backgroundOpacity:K})}function It(){const K=Number(Se);if(!Number.isFinite(K)||K<0){qe(String(ne));return}ge(K),At({backgroundBlur:K})}function Pe(K,Ie){K.key==="Enter"&&(Ie(),K.currentTarget.blur())}function ot(K,Ie){K.key==="Enter"&&(Ie(),K.currentTarget.blur())}function wt(){k(Ve)}async function gt(K=se){try{He(null),await n.socket.command({type:"settings.writeKeybindings",bindings:nT(K)})}catch(Ie){He(Ie instanceof Error?Ie.message:"Unable to save keybindings.")}}async function At(K){try{await n.socket.command({type:"settings.writeThemeSettings",settings:{themePreference:(K==null?void 0:K.themePreference)??r,colorTheme:(K==null?void 0:K.colorTheme)??A,customAppearance:(K==null?void 0:K.customAppearance)??P,backgroundImage:(K==null?void 0:K.backgroundImage)!==void 0?K.backgroundImage:X,backgroundOpacity:(K==null?void 0:K.backgroundOpacity)??N,backgroundBlur:(K==null?void 0:K.backgroundBlur)??ne,showProjectIconsInSidebar:(K==null?void 0:K.showProjectIconsInSidebar)??oe}})}catch(Ie){console.error("Failed to save theme settings:",Ie)}}async function ut(K){try{xt(null),await n.socket.command({type:"settings.writeProviderSettings",settings:K})}catch(Ie){xt(Ie instanceof Error?Ie.message:"Unable to save provider settings.")}}async function mt(K){const Ie={...se,[K]:Lb(as[K])};pe(Ie);try{He(null),await n.socket.command({type:"settings.writeKeybindings",bindings:nT(Ie)})}catch(mn){He(mn instanceof Error?mn.message:"Unable to save keybindings.")}}const yn=Ve.replaceAll("{path}","/Users/jake/Projects/kaizen/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),Te=rd.find(K=>K.id===o)??rd[0],je=o==="keybindings"?vre(De):Te.subtitle,Tt=!l,it=o==="keybindings"?f.jsxs(C_,{onClick:()=>{n.handleOpenExternalPath("open_editor",De)},icon:f.jsx(kN,{className:"h-4 w-4"}),children:["Open in ",n.editorLabel]}):o==="general"?f.jsx(C_,{variant:Rt.variant,onClick:()=>{if(Rt.kind==="update"){n.handleInstallUpdate();return}n.handleCheckForUpdates({force:!0})},disabled:Rt.disabled,icon:Rt.kind==="check"?f.jsx(Ex,{className:me("size-3.5",Rt.spinning&&"animate-spin")}):Rt.kind==="update"?f.jsx(KI,{className:me("size-3.5")}):void 0,children:Rt.label}):null;function Yt(){if(_re(window.history.state)==="back"){e(-1);return}e("/",{replace:!0})}return f.jsxs("div",{className:"relative flex h-full flex-1 min-w-0 bg-background",children:[f.jsxs("div",{className:"flex min-w-0 flex-1",children:[f.jsx("aside",{className:`hidden w-[200px] shrink-0 md:block ${Tt?"pb-[89px]":""}`,children:f.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[f.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:"Settings"}),rd.map(K=>f.jsx("button",{type:"button",onClick:()=>e(`/settings/${K.id}`),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${K.id===o?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:f.jsxs("div",{className:"flex items-center gap-2.5",children:[f.jsx(K.icon,{className:"h-4 w-4 shrink-0"}),f.jsx("span",{children:K.label})]})},K.label))]})}),f.jsxs("div",{className:"min-w-0 flex-1 overflow-y-auto",children:[f.jsx("div",{className:"md:hidden sticky top-0 z-10 bg-background border-b border-border px-4 py-2 backdrop-blur-md",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto scrollbar-hide",children:rd.map(K=>f.jsxs("button",{type:"button",onClick:()=>e(`/settings/${K.id}`),className:`flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm transition-colors ${K.id===o?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:[f.jsx(K.icon,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{children:K.label})]},K.id))}),f.jsx("button",{type:"button","aria-label":"Close settings",onClick:Yt,className:"ml-1 flex shrink-0 items-center justify-center rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:f.jsx(Js,{className:"h-4 w-4"})})]})}),f.jsxs("div",{className:"w-full px-6 pt-8 md:pt-16 pb-32",children:[l?f.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:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(li,{className:"h-4 w-4 animate-spin"}),f.jsx("span",{children:"Loading machine settings…"})]})}):f.jsxs("div",{className:"mx-auto max-w-4xl",children:[f.jsxs("div",{className:"pb-6",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4 min-h-[34px]",children:[f.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:Te.label}),f.jsxs("div",{className:"flex items-center gap-2",children:[it,f.jsx(C_,{"aria-label":"Close settings",title:"Close settings",onClick:Yt,icon:f.jsx(Js,{className:"h-4 w-4"}),className:"hidden md:flex"})]})]}),f.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:je})]}),o==="general"?f.jsx(f.Fragment,{children:f.jsxs("div",{className:"border-b border-border",children:[f.jsx(gn,{title:"Application Update",description:f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[Gt,"."]}),we!=null&&we.lastCheckedAt?f.jsxs("span",{children:[" Last checked ",new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(we.lastCheckedAt),"."]}):null,we!=null&&we.error?f.jsxs("span",{children:[" ",we.error]}):null]}),bordered:!1,children:f.jsxs("div",{className:"text-right text-sm text-foreground",children:[f.jsxs("div",{children:["Current: ",(we==null?void 0:we.currentVersion)??d]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latest: ",(we==null?void 0:we.latestVersion)??"Unknown"]})]})}),f.jsx(gn,{title:"Release Notes",description:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"The old GitHub changelog page is hidden after the rebrand because releases are no longer sourced from a public GitHub repo."}),f.jsx("span",{children:" We need to come back to this and wire release notes to the deployment/NPX update flow."})]}),children:f.jsx("div",{className:"rounded-full border border-border bg-muted/40 px-3 py-1 text-xs font-medium text-muted-foreground",children:"Temporary placeholder"})}),f.jsx(gn,{title:"Theme",description:"Choose between light, dark, system, or custom appearance",children:f.jsxs(hr,{value:r,onValueChange:K=>{s(K),At({themePreference:K})},children:[f.jsx(Zn,{className:"w-[150px]",children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"light",children:"Light"}),f.jsx(_t,{value:"dark",children:"Dark"}),f.jsx(_t,{value:"system",children:"System"}),f.jsx(_t,{value:"custom",children:"Custom"})]})]})}),r==="custom"?f.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[f.jsx(gn,{title:"Appearance",description:"Choose light, dark, or system mode for your custom theme",bordered:!1,children:f.jsxs(hr,{value:P,onValueChange:K=>{te(K),At({customAppearance:K})},children:[f.jsx(Zn,{className:"w-[150px]",children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"light",children:"Light"}),f.jsx(_t,{value:"dark",children:"Dark"}),f.jsx(_t,{value:"system",children:"System"})]})]})}),f.jsx(gn,{title:"Color Theme",description:"Choose a color palette for the interface",alignStart:!0,bordered:!1,children:f.jsxs(hr,{value:A,onValueChange:K=>{J(K),At({colorTheme:K})},children:[f.jsx(Zn,{className:"min-w-[180px]",children:f.jsx(vr,{})}),f.jsx(Qn,{children:f.jsxs(Ab,{children:[f.jsx(_t,{value:"default",children:"Default"}),f.jsx(_t,{value:"tokyo-night",children:"Tokyo Night"}),f.jsx(_t,{value:"catppuccin",children:"Catppuccin"}),f.jsx(_t,{value:"dracula",children:"Dracula"}),f.jsx(_t,{value:"nord",children:"Nord"}),f.jsx(_t,{value:"everforest",children:"Everforest"}),f.jsx(_t,{value:"rose-pine",children:"Rose Pine"})]})})]})}),f.jsx(gn,{title:"Background Image",description:"Choose a background or enter a custom URL",alignStart:!0,bordered:!1,children:(()=>{const K=Ke.find(Xt=>Xt.url===et),Ie=!et,mn=!!et&&!K,ui=Ie?"__none__":mn?"__custom__":et,ua=Ie?"None":mn?"Custom URL":(K==null?void 0:K.name)??"Unknown";return f.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[f.jsxs(hr,{value:ui,onValueChange:Xt=>{if(Xt==="__none__")lt(""),ue(null),At({backgroundImage:null});else{const Gn=tT({themePreference:r,nextBackgroundImage:Xt,backgroundOpacity:N});lt(Xt),ue(Xt),Gn.backgroundOpacity!==void 0&&he(Gn.backgroundOpacity),Gn.backgroundBlur!==void 0&&ge(Gn.backgroundBlur),At({backgroundImage:Xt,...Gn})}},children:[f.jsx(Zn,{className:"w-full",children:f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[Ie?null:f.jsx("img",{src:et,alt:"",className:"h-5 w-9 shrink-0 rounded object-cover"}),f.jsx("span",{className:"truncate",children:ua})]})}),f.jsxs(Qn,{children:[f.jsx(am,{value:"__none__",children:"None"}),Ke.map(Xt=>f.jsx(am,{value:Xt.url,thumbnail:Xt.url,thumbnailAlt:Xt.name,children:Xt.name},Xt.id)),mn?f.jsx(am,{value:"__custom__",thumbnail:et,thumbnailAlt:"Custom",children:"Custom URL"}):null]})]}),f.jsx(ki,{type:"text",placeholder:"Or enter a custom URL...",value:et,onChange:Xt=>lt(Xt.target.value),onBlur:Sr,onKeyDown:Xt=>ot(Xt,Sr),className:"w-full"})]})})()}),f.jsx(gn,{title:"Background Opacity",description:"Opacity of the interface layered over the background (0 to 1)",bordered:!1,children:f.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:f.jsx(ki,{type:"number",min:0,max:1,step:.05,value:nt,onChange:K=>Kt(K.target.value),onBlur:Lt,onKeyDown:K=>Pe(K,Lt),className:"hide-number-steppers w-28 text-right font-mono"})})}),f.jsx(gn,{title:"Background Blur",description:"Blur applied to the background image (in pixels)",bordered:!1,children:f.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:f.jsx(ki,{type:"number",min:0,max:50,step:1,value:Se,onChange:K=>qe(K.target.value),onBlur:It,onKeyDown:K=>Pe(K,It),className:"hide-number-steppers w-28 text-right font-mono"})})})]}):null,f.jsx(gn,{title:"Project Icons",description:"Show detected project icons in the sidebar and open-project list.",children:f.jsxs(hr,{value:oe?"enabled":"disabled",onValueChange:K=>{const Ie=K==="enabled";ke(Ie),At({showProjectIconsInSidebar:Ie})},children:[f.jsx(Zn,{className:"w-[100px]",children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"disabled",children:"Off"}),f.jsx(_t,{value:"enabled",children:"On"})]})]})}),f.jsx(gn,{title:"Folder Groups",description:"Show or hide feature folder grouping in the sidebar. Turning this off keeps the existing feature state, but flattens chats into a direct list and hides the new-folder button.",children:f.jsxs(hr,{value:B?"enabled":"disabled",onValueChange:K=>O(K==="enabled"),children:[f.jsx(Zn,{className:"w-[100px]",children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"disabled",children:"Off"}),f.jsx(_t,{value:"enabled",children:"On"})]})]})}),B?f.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[f.jsx(gn,{title:"Feature Overview",description:"Generate and show an `overview.md` file for feature folders. Turning this off stops creating new overview files and hides existing overview rows from the sidebar.",bordered:!1,children:f.jsxs(hr,{value:W?"enabled":"disabled",onValueChange:K=>$(K==="enabled"),children:[f.jsx(Zn,{className:"w-[100px]",children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"disabled",children:"Off"}),f.jsx(_t,{value:"enabled",children:"On"})]})]})}),f.jsx(gn,{title:"Kanban Status",description:"Show or hide feature status controls like Idea, Todo, Progress, Testing, and Done.",bordered:!1,children:f.jsxs(hr,{value:F?"enabled":"disabled",onValueChange:K=>U(K==="enabled"),children:[f.jsx(Zn,{className:"w-[100px]",children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"disabled",children:"Off"}),f.jsx(_t,{value:"enabled",children:"On"})]})]})}),f.jsx(gn,{title:`${Cb} In Git`,description:`Control whether ${Pn} keeps the project ${Cb} directory tracked in git or adds it to .gitignore for currently loaded projects and future opens. This is best suited to solo developers working across multiple machines. For team repos, we recommend ignoring \`${Cb}\`.`,bordered:!1,children:f.jsxs(hr,{value:V?"commit":"ignore",onValueChange:K=>{const Ie=K==="commit";Y(Ie),n.handleSetCommitProjectMetadataDirectory(Ie)},children:[f.jsx(Zn,{className:"w-[120px]",children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"commit",children:"Commit"}),f.jsx(_t,{value:"ignore",children:"Ignore"})]})]})})]}):null,f.jsx(gn,{title:"Provider Icons In Side Tray",description:"Show provider badges next to chats in the left sidebar side tray.",children:f.jsxs(hr,{value:j?"enabled":"disabled",onValueChange:K=>q(K==="enabled"),children:[f.jsx(Zn,{className:"w-[100px]",children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"disabled",children:"Off"}),f.jsx(_t,{value:"enabled",children:"On"})]})]})}),f.jsx(gn,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:f.jsxs(hr,{value:v,onValueChange:K=>C(K),children:[f.jsx(Zn,{className:"min-w-[180px]",children:f.jsx(vr,{})}),f.jsx(Qn,{children:f.jsx(Ab,{children:gre.map(K=>f.jsx(_t,{value:K.value,children:K.label},K.value))})})]})}),v==="custom"?f.jsx("div",{className:"border-t border-border",children:f.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[f.jsxs("div",{className:"min-w-0 max-w-xl",children:[f.jsx("div",{className:"text-sm font-medium text-foreground",children:"Command Template"}),f.jsxs("div",{className:"mt-1 text-[13px] text-muted-foreground",children:["Include ","{path}"," and optionally ","{line}"," and ","{column}"," in your command."]})]}),f.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[f.jsx(ki,{type:"text",value:Ve,onChange:K=>Ae(K.target.value),onBlur:wt,onKeyDown:K=>ot(K,wt),className:"font-mono"}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview: ",f.jsx("span",{className:"font-mono",children:yn})]})]})]})}):null,f.jsx(gn,{title:"Terminal Scrollback",description:"Lines retained for embedded terminal history",children:f.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[f.jsx(ki,{type:"number",min:Yy,max:Xy,step:100,value:Xe,onChange:K=>pt(K.target.value),onBlur:_n,onKeyDown:K=>Pe(K,_n),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),f.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[Yy,"-",Xy," lines",g===Ym?" (default)":""]})]})}),f.jsx(gn,{title:"Terminal Min Column Width",description:"Minimum width for each terminal pane",children:f.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[f.jsx(ki,{type:"number",min:Zy,max:Qy,step:10,value:at,onChange:K=>fe(K.target.value),onBlur:Kn,onKeyDown:K=>Pe(K,Kn),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),f.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[Zy,"-",Qy," px",p===Xm?" (default)":""]})]})})]})}):o==="providers"?f.jsxs("div",{className:"border-b border-border",children:[f.jsx(gn,{title:"Default Provider",description:"The default harness used for new chats before a provider is locked by an existing session.",bordered:!1,children:f.jsxs(hr,{value:Le,onValueChange:K=>D(K),children:[f.jsx(Zn,{className:"min-w-[180px]",children:f.jsx(vr,{})}),f.jsx(Qn,{children:f.jsxs(Ab,{children:[f.jsx(_t,{value:"last_used",children:"Last Used"}),Bt.map(K=>f.jsx(_t,{value:K.id,children:K.label},K.id))]})})]})}),Oe?f.jsx("div",{className:"border-t border-border px-0 py-3 text-sm text-destructive",children:Oe}):null,f.jsx(gn,{title:"Claude Code Defaults",description:`Saved defaults when using Claude Code. ${em(E,"claude")}`,alignStart:!0,children:f.jsxs("div",{className:me("max-w-[420px]",!tn("claude").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(hr,{value:((E==null?void 0:E.settings.claude)??Wn.claude).active?"active":"inactive",onValueChange:K=>{ut({...(E==null?void 0:E.settings)??Wn,claude:{...(E==null?void 0:E.settings.claude)??Wn.claude,active:K==="active"}})},children:[f.jsx(Zn,{className:"min-w-[140px]",disabled:!tn("claude").systemActive,children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"active",children:"Active"}),f.jsx(_t,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Ku,{availableProviders:Qo,selectedProvider:"claude",disabled:!tn("claude").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.claude.model,modelOptions:L.claude.modelOptions,onModelChange:(K,Ie)=>{H("claude",Ie)},onClaudeReasoningEffortChange:K=>{G("claude",{reasoningEffort:K})},onClaudeContextWindowChange:K=>{G("claude",{contextWindow:K})},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:L.claude.planMode,onPlanModeChange:K=>I("claude",K),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),f.jsx(gn,{title:"Codex Defaults",description:`Saved defaults when using Codex. ${em(E,"codex")}`,alignStart:!0,children:f.jsxs("div",{className:me("max-w-[420px]",!tn("codex").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(hr,{value:((E==null?void 0:E.settings.codex)??Wn.codex).active?"active":"inactive",onValueChange:K=>{ut({...(E==null?void 0:E.settings)??Wn,codex:{...(E==null?void 0:E.settings.codex)??Wn.codex,active:K==="active"}})},children:[f.jsx(Zn,{className:"min-w-[140px]",disabled:!tn("codex").systemActive,children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"active",children:"Active"}),f.jsx(_t,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Ku,{availableProviders:Qo,selectedProvider:"codex",disabled:!tn("codex").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.codex.model,modelOptions:L.codex.modelOptions,onModelChange:(K,Ie)=>{H("codex",Ie)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:K=>{G("codex",{reasoningEffort:K})},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:K=>{G("codex",{fastMode:K})},planMode:L.codex.planMode,onPlanModeChange:K=>I("codex",K),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),f.jsx(gn,{title:"Gemini Defaults",description:`Saved defaults when using Gemini. ${em(E,"gemini")}`,alignStart:!0,children:f.jsxs("div",{className:me("max-w-[420px]",!tn("gemini").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(hr,{value:((E==null?void 0:E.settings.gemini)??Wn.gemini).active?"active":"inactive",onValueChange:K=>{ut({...(E==null?void 0:E.settings)??Wn,gemini:{...(E==null?void 0:E.settings.gemini)??Wn.gemini,active:K==="active"}})},children:[f.jsx(Zn,{className:"min-w-[140px]",disabled:!tn("gemini").systemActive,children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"active",children:"Active"}),f.jsx(_t,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Ku,{availableProviders:Qo,selectedProvider:"gemini",disabled:!tn("gemini").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.gemini.model,modelOptions:L.gemini.modelOptions,onModelChange:(K,Ie)=>{H("gemini",Ie)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:K=>{G("gemini",{thinkingMode:K})},onCodexFastModeChange:()=>{},planMode:L.gemini.planMode,onPlanModeChange:K=>I("gemini",K),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),f.jsx(gn,{title:"Cursor Defaults",description:`Saved defaults when using Cursor. ${em(E,"cursor")}`,alignStart:!0,children:f.jsxs("div",{className:me("max-w-[420px]",!tn("cursor").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(hr,{value:((E==null?void 0:E.settings.cursor)??Wn.cursor).active?"active":"inactive",onValueChange:K=>{ut({...(E==null?void 0:E.settings)??Wn,cursor:{...(E==null?void 0:E.settings.cursor)??Wn.cursor,active:K==="active"}})},children:[f.jsx(Zn,{className:"min-w-[140px]",disabled:!tn("cursor").systemActive,children:f.jsx(vr,{})}),f.jsxs(Qn,{children:[f.jsx(_t,{value:"active",children:"Active"}),f.jsx(_t,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Ku,{availableProviders:Qo,selectedProvider:"cursor",disabled:!tn("cursor").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.cursor.model,modelOptions:L.cursor.modelOptions,onModelChange:(K,Ie)=>{H("cursor",Ie)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:L.cursor.planMode,onPlanModeChange:K=>I("cursor",K),includePlanMode:!0,className:"justify-start flex-wrap"})]})})]}):o==="keybindings"?f.jsxs("div",{className:"border-b border-border",children:[Ne?f.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:Ne}):null,Ee.warning?f.jsx("div",{className:"mb-4 rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:Ee.warning}):null,eT.map((K,Ie)=>{const mn=Lb(as[K]),ui=se[K]??"",ua=ui!==mn;return f.jsx(gn,{title:LA[K],description:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"Comma-separated shortcuts."}),ua?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:" "}),f.jsxs("button",{type:"button",onClick:()=>{mt(K)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",mn]})]}):null]}),bordered:Ie!==0,children:f.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:f.jsx(ki,{type:"text",value:ui,onChange:Xt=>{const Gn=Xt.target.value;pe(Ss=>({...Ss,[K]:Gn}))},onBlur:Xt=>{const Gn={...se,[K]:Xt.currentTarget.value};pe(Gn),gt(Gn)},onKeyDown:Xt=>ot(Xt,()=>{const Gn={...se,[K]:Xt.currentTarget.value};pe(Gn),gt(Gn)}),className:"font-mono"})})},K)})]}):null]}),n.commandError?f.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:[f.jsx(w6,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),f.jsx("span",{children:n.commandError})]}):null]})]})]}),Tt?f.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:f.jsx("div",{className:"px-6 py-[14.25px]",children:f.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-xs text-muted-foreground lg:grid-cols-4 lg:gap-3",children:[f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[f.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Machine"}),f.jsx("div",{className:"truncate text-foreground/80",children:u})]})}),f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[f.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Connection"}),f.jsx("div",{className:"truncate text-foreground/80",children:n.connectionStatus})]})}),f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[f.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Projects"}),f.jsx("div",{className:"truncate text-foreground/80",children:h})]})}),f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[f.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Version"}),f.jsx("div",{className:"truncate text-foreground/80",children:d})]})})]})})}):null]})}function nT(e){return{submitChatMessage:Ma(e.submitChatMessage??""),toggleProjectsSidebar:Ma(e.toggleProjectsSidebar??""),toggleEmbeddedTerminal:Ma(e.toggleEmbeddedTerminal??""),toggleRightSidebar:Ma(e.toggleRightSidebar??""),openInFinder:Ma(e.openInFinder??""),openInEditor:Ma(e.openInEditor??""),addSplitTerminal:Ma(e.addSplitTerminal??"")}}function xre(){const e=typeof navigator<"u"&&navigator.standalone===!0,t=typeof window<"u"&&window.matchMedia("(display-mode: standalone)").matches;return e||t}function wre(){const e=window.visualViewport,t=Math.round((e==null?void 0:e.height)??window.innerHeight),n=Math.max(0,Math.round((e==null?void 0:e.offsetTop)??0));return{height:t,offsetTop:n}}function Sre(){b.useLayoutEffect(()=>{let e=0,t=null,n=0;const r=xre(),s=()=>{e=0;const{height:u,offsetTop:h}=wre();t===null&&(t=h),u>n&&(n=u);const d=Math.max(0,h-t),g=n-u>120||d>12,p=document.documentElement;p.style.setProperty("--app-shell-height",`${u}px`),p.style.setProperty("--app-shell-offset-top",r?g?`max(0px, calc(${d}px - env(safe-area-inset-top)))`:"0px":`${d}px`),p.style.setProperty("--app-composer-bottom-padding",r?g?"0px":"max(12px, env(safe-area-inset-bottom))":g?"12px":"20px")},o=()=>{e!==0&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(s)};o();const l=window.visualViewport;return window.addEventListener("resize",o),window.addEventListener("orientationchange",o),l==null||l.addEventListener("resize",o),l==null||l.addEventListener("scroll",o),()=>{e!==0&&window.cancelAnimationFrame(e),window.removeEventListener("resize",o),window.removeEventListener("orientationchange",o),l==null||l.removeEventListener("resize",o),l==null||l.removeEventListener("scroll",o)}},[])}const Cre=`${kp}last-seen-version`;function kre(e,t){return!(!t||e.defaultPrevented||e.isComposing||wW(e.target))}function Ere(){const e=Oi(),t=yT(),n=WY({activeChatId:t.chatId??null,activeOverviewFeatureId:t.featureId??null}),r=Zd("(min-width: 768px)"),s=T2(d=>d.widthPx),o=T2(d=>d.setWidth),l=e.pathname==="/",u=Ux.split("/")[1]??"unknown",h=b.useMemo(()=>v0(n.keybindings),[n.keybindings]);return Sre(),b.useEffect(()=>{window.localStorage.setItem(Cre,u)},[u]),b.useEffect(()=>{function d(g){const p=Ia(h,"toggleProjectsSidebar",g);kre(g,p)&&(g.preventDefault(),n.toggleProjectsSidebar(r))}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[r,h,n.toggleProjectsSidebar]),f.jsxs("div",{className:"relative flex h-[var(--app-shell-height)] min-h-[var(--app-shell-height)] overflow-hidden",style:{top:"var(--app-shell-offset-top)"},children:[f.jsx(bW,{data:n.sidebarData,completedChatIds:n.completedChatIds,activeChatId:n.activeChatId,activeOverviewFeatureId:n.activeOverviewFeatureId,connectionStatus:n.connectionStatus,ready:n.sidebarReady,open:n.sidebarOpen,collapsed:n.sidebarCollapsed,isDesktopViewport:r,showMobileOpenButton:l,onOpen:n.openSidebar,onClose:n.closeSidebar,onToggle:n.toggleProjectsSidebar,onExpand:n.expandSidebar,desktopWidth:s,toggleShortcut:h.bindings.toggleProjectsSidebar,onResizeDesktopWidth:o,onCreateChat:(d,g)=>{n.handleCreateChat(d,g)},onCreateFeature:d=>{n.handleCreateFeature(d)},onRenameFeature:d=>{n.handleRenameFeature(d)},onDeleteFeature:d=>{n.handleDeleteFeature(d)},onSetProjectBrowserState:(d,g)=>{n.handleSetProjectBrowserState(d,g)},onSetProjectGeneralChatsBrowserState:(d,g)=>{n.handleSetProjectGeneralChatsBrowserState(d,g)},onSetFeatureBrowserState:(d,g)=>{n.handleSetFeatureBrowserState(d,g)},onSetFeatureStage:(d,g)=>{n.handleSetFeatureStage(d,g)},onSetChatFeature:(d,g)=>{n.handleSetChatFeature(d,g)},onReorderFeatures:(d,g)=>{n.handleReorderFeatures(d,g)},folderGroupsEnabled:n.folderGroupsEnabled,showFeatureOverviewInSidebar:n.showFeatureOverviewInSidebar,kanbanStatusesEnabled:n.kanbanStatusesEnabled,onOpenFeatureOverview:d=>{n.handleOpenFeatureOverview(d)},onDeleteChat:d=>{n.handleDeleteChat(d)},onRemoveProject:d=>{n.handleRemoveProject(d)},onRefreshProviderUsage:n.handleRefreshProviderUsage,onOpenProviderLogin:d=>{n.handleOpenProviderLogin(d)},providerSettings:n.providerSettings,startingLocalPath:n.startingLocalPath,updateSnapshot:n.updateSnapshot,onInstallUpdate:()=>{n.handleInstallUpdate()}}),f.jsx(w8,{open:n.createFeatureModalProjectId!==null,onOpenChange:d=>{d||n.handleCloseCreateFeatureModal()},onConfirm:d=>n.handleConfirmCreateFeature(d)}),f.jsx(S8,{open:n.cursorCurlImportOpen,onOpenChange:d=>{d||n.handleCloseCursorCurlImport()},onSubmit:d=>n.handleSubmitCursorCurlImport(d)}),f.jsx(AL,{context:n})]})}function Rre(){return f.jsx(s7,{children:f.jsxs(_8,{children:[f.jsx(jL,{children:f.jsxs(La,{element:f.jsx(Ere,{}),children:[f.jsx(La,{path:"/",element:f.jsx(pre,{})}),f.jsx(La,{path:"/settings",element:f.jsx(ML,{to:"/settings/general",replace:!0})}),f.jsx(La,{path:"/settings/:sectionId",element:f.jsx(yre,{})}),f.jsx(La,{path:"/chat/:chatId",element:f.jsx(rre,{})}),f.jsx(La,{path:"/overview/:featureId",element:f.jsx(ore,{})})]})}),f.jsx(Hz,{})]})})}const g3=document.getElementById("root");if(!g3)throw new Error("Missing #root");j4.createRoot(g3).render(f.jsx(b.StrictMode,{children:f.jsx(iz,{children:f.jsx(PG,{children:f.jsx(Rre,{})})})}));
|