kaizenai 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/bin/kaizen +49 -9
- package/dist/client/assets/index-BNd87qOY.js +653 -0
- package/dist/client/assets/index-CVCsARVW.css +32 -0
- package/dist/client/index.html +14 -6
- package/dist/client/manifest-dark.webmanifest +6 -0
- package/dist/client/manifest.webmanifest +6 -0
- package/dist/server/cli-supervisor.js +6 -5
- package/dist/server/cli.js +419 -67
- package/package.json +6 -5
- package/dist/client/assets/index-C4Zm475L.js +0 -638
- package/dist/client/assets/index-CxKis6wK.css +0 -32
|
@@ -0,0 +1,653 @@
|
|
|
1
|
+
var XL=Object.defineProperty;var $k=e=>{throw TypeError(e)};var ZL=(e,t,n)=>t in e?XL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var rr=(e,t,n)=>ZL(e,typeof t!="symbol"?t+"":t,n),Uk=(e,t,n)=>t.has(e)||$k("Cannot "+n);var pd=(e,t,n)=>(Uk(e,t,"read from private field"),n?n.call(e):t.get(e)),Vk=(e,t,n)=>t.has(e)?$k("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Wk=(e,t,n,r)=>(Uk(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function QL(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)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(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Zp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yb={exports:{}},gd={};/**
|
|
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 qk;function JL(){if(qk)return gd;qk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var l=null;if(o!==void 0&&(l=""+o),i.key!==void 0&&(l=""+i.key),"key"in i){o={};for(var c in i)c!=="key"&&(o[c]=i[c])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:o}}return gd.Fragment=t,gd.jsx=n,gd.jsxs=n,gd}var Kk;function ez(){return Kk||(Kk=1,Yb.exports=JL()),Yb.exports}var f=ez(),Xb={exports:{}},dt={};/**
|
|
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 Gk;function tz(){if(Gk)return dt;Gk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=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"),b=Symbol.iterator;function y(B){return B===null||typeof B!="object"?null:(B=b&&B[b]||B["@@iterator"],typeof B=="function"?B:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(B,X,j){this.props=B,this.context=X,this.refs=C,this.updater=j||w}k.prototype.isReactComponent={},k.prototype.setState=function(B,X){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,X,"setState")},k.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function R(){}R.prototype=k.prototype;function E(B,X,j){this.props=B,this.context=X,this.refs=C,this.updater=j||w}var N=E.prototype=new R;N.constructor=E,S(N,k.prototype),N.isPureReactComponent=!0;var L=Array.isArray;function A(){}var O={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function Z(B,X,j){var ie=j.ref;return{$$typeof:e,type:B,key:X,ref:ie!==void 0?ie:null,props:j}}function I(B,X){return Z(B.type,X,B.props)}function q(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function F(B){var X={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(j){return X[j]})}var $=/\/+/g;function W(B,X){return typeof B=="object"&&B!==null&&B.key!=null?F(""+B.key):X.toString(36)}function K(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(A,A):(B.status="pending",B.then(function(X){B.status==="pending"&&(B.status="fulfilled",B.value=X)},function(X){B.status==="pending"&&(B.status="rejected",B.reason=X)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function D(B,X,j,ie,J){var ee=typeof B;(ee==="undefined"||ee==="boolean")&&(B=null);var re=!1;if(B===null)re=!0;else switch(ee){case"bigint":case"string":case"number":re=!0;break;case"object":switch(B.$$typeof){case e:case t:re=!0;break;case g:return re=B._init,D(re(B._payload),X,j,ie,J)}}if(re)return J=J(B),re=ie===""?"."+W(B,0):ie,L(J)?(j="",re!=null&&(j=re.replace($,"$&/")+"/"),D(J,X,j,"",function(ge){return ge})):J!=null&&(q(J)&&(J=I(J,j+(J.key==null||B&&B.key===J.key?"":(""+J.key).replace($,"$&/")+"/")+re)),X.push(J)),1;re=0;var ue=ie===""?".":ie+":";if(L(B))for(var fe=0;fe<B.length;fe++)ie=B[fe],ee=ue+W(ie,fe),re+=D(ie,X,j,ee,J);else if(fe=y(B),typeof fe=="function")for(B=fe.call(B),fe=0;!(ie=B.next()).done;)ie=ie.value,ee=ue+W(ie,fe++),re+=D(ie,X,j,ee,J);else if(ee==="object"){if(typeof B.then=="function")return D(K(B),X,j,ie,J);throw X=String(B),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return re}function U(B,X,j){if(B==null)return B;var ie=[],J=0;return D(B,ie,"","",function(ee){return X.call(j,ee,J++)}),ie}function z(B){if(B._status===-1){var X=B._result;X=X(),X.then(function(j){(B._status===0||B._status===-1)&&(B._status=1,B._result=j)},function(j){(B._status===0||B._status===-1)&&(B._status=2,B._result=j)}),B._status===-1&&(B._status=0,B._result=X)}if(B._status===1)return B._result.default;throw B._result}var G=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},M={map:U,forEach:function(B,X,j){U(B,function(){X.apply(this,arguments)},j)},count:function(B){var X=0;return U(B,function(){X++}),X},toArray:function(B){return U(B,function(X){return X})||[]},only:function(B){if(!q(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return dt.Activity=p,dt.Children=M,dt.Component=k,dt.Fragment=n,dt.Profiler=i,dt.PureComponent=E,dt.StrictMode=r,dt.Suspense=h,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,dt.__COMPILER_RUNTIME={__proto__:null,c:function(B){return O.H.useMemoCache(B)}},dt.cache=function(B){return function(){return B.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(B,X,j){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var ie=S({},B.props),J=B.key;if(X!=null)for(ee in X.key!==void 0&&(J=""+X.key),X)!H.call(X,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&X.ref===void 0||(ie[ee]=X[ee]);var ee=arguments.length-2;if(ee===1)ie.children=j;else if(1<ee){for(var re=Array(ee),ue=0;ue<ee;ue++)re[ue]=arguments[ue+2];ie.children=re}return Z(B.type,J,ie)},dt.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:o,_context:B},B},dt.createElement=function(B,X,j){var ie,J={},ee=null;if(X!=null)for(ie in X.key!==void 0&&(ee=""+X.key),X)H.call(X,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(J[ie]=X[ie]);var re=arguments.length-2;if(re===1)J.children=j;else if(1<re){for(var ue=Array(re),fe=0;fe<re;fe++)ue[fe]=arguments[fe+2];J.children=ue}if(B&&B.defaultProps)for(ie in re=B.defaultProps,re)J[ie]===void 0&&(J[ie]=re[ie]);return Z(B,ee,J)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(B){return{$$typeof:c,render:B}},dt.isValidElement=q,dt.lazy=function(B){return{$$typeof:g,_payload:{_status:-1,_result:B},_init:z}},dt.memo=function(B,X){return{$$typeof:d,type:B,compare:X===void 0?null:X}},dt.startTransition=function(B){var X=O.T,j={};O.T=j;try{var ie=B(),J=O.S;J!==null&&J(j,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(A,G)}catch(ee){G(ee)}finally{X!==null&&j.types!==null&&(X.types=j.types),O.T=X}},dt.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},dt.use=function(B){return O.H.use(B)},dt.useActionState=function(B,X,j){return O.H.useActionState(B,X,j)},dt.useCallback=function(B,X){return O.H.useCallback(B,X)},dt.useContext=function(B){return O.H.useContext(B)},dt.useDebugValue=function(){},dt.useDeferredValue=function(B,X){return O.H.useDeferredValue(B,X)},dt.useEffect=function(B,X){return O.H.useEffect(B,X)},dt.useEffectEvent=function(B){return O.H.useEffectEvent(B)},dt.useId=function(){return O.H.useId()},dt.useImperativeHandle=function(B,X,j){return O.H.useImperativeHandle(B,X,j)},dt.useInsertionEffect=function(B,X){return O.H.useInsertionEffect(B,X)},dt.useLayoutEffect=function(B,X){return O.H.useLayoutEffect(B,X)},dt.useMemo=function(B,X){return O.H.useMemo(B,X)},dt.useOptimistic=function(B,X){return O.H.useOptimistic(B,X)},dt.useReducer=function(B,X,j){return O.H.useReducer(B,X,j)},dt.useRef=function(B){return O.H.useRef(B)},dt.useState=function(B){return O.H.useState(B)},dt.useSyncExternalStore=function(B,X,j){return O.H.useSyncExternalStore(B,X,j)},dt.useTransition=function(){return O.H.useTransition()},dt.version="19.2.1",dt}var Yk;function m0(){return Yk||(Yk=1,Xb.exports=tz()),Xb.exports}var v=m0();const we=Zp(v),TN=QL({__proto__:null,default:we},[v]);var Zb={exports:{}},vd={},Qb={exports:{}},Jb={};/**
|
|
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 Xk;function nz(){return Xk||(Xk=1,function(e){function t(D,U){var z=D.length;D.push(U);e:for(;0<z;){var G=z-1>>>1,M=D[G];if(0<i(M,U))D[G]=U,D[z]=M,z=G;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var U=D[0],z=D.pop();if(z!==U){D[0]=z;e:for(var G=0,M=D.length,B=M>>>1;G<B;){var X=2*(G+1)-1,j=D[X],ie=X+1,J=D[ie];if(0>i(j,z))ie<M&&0>i(J,j)?(D[G]=J,D[ie]=z,G=ie):(D[G]=j,D[X]=z,G=X);else if(ie<M&&0>i(J,z))D[G]=J,D[ie]=z,G=ie;else break e}}return U}function i(D,U){var z=D.sortIndex-U.sortIndex;return z!==0?z:D.id-U.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,c=l.now();e.unstable_now=function(){return l.now()-c}}var h=[],d=[],g=1,p=null,b=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 N(D){for(var U=n(d);U!==null;){if(U.callback===null)r(d);else if(U.startTime<=D)r(d),U.sortIndex=U.expirationTime,t(h,U);else break;U=n(d)}}function L(D){if(S=!1,N(D),!w)if(n(h)!==null)w=!0,A||(A=!0,F());else{var U=n(d);U!==null&&K(L,U.startTime-D)}}var A=!1,O=-1,H=5,Z=-1;function I(){return C?!0:!(e.unstable_now()-Z<H)}function q(){if(C=!1,A){var D=e.unstable_now();Z=D;var U=!0;try{e:{w=!1,S&&(S=!1,R(O),O=-1),y=!0;var z=b;try{t:{for(N(D),p=n(h);p!==null&&!(p.expirationTime>D&&I());){var G=p.callback;if(typeof G=="function"){p.callback=null,b=p.priorityLevel;var M=G(p.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){p.callback=M,N(D),U=!0;break t}p===n(h)&&r(h),N(D)}else r(h);p=n(h)}if(p!==null)U=!0;else{var B=n(d);B!==null&&K(L,B.startTime-D),U=!1}}break e}finally{p=null,b=z,y=!1}U=void 0}}finally{U?F():A=!1}}}var F;if(typeof E=="function")F=function(){E(q)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,W=$.port2;$.port1.onmessage=q,F=function(){W.postMessage(null)}}else F=function(){k(q,0)};function K(D,U){O=k(function(){D(e.unstable_now())},U)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(D){switch(b){case 1:case 2:case 3:var U=3;break;default:U=b}var z=b;b=U;try{return D()}finally{b=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(D,U){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var z=b;b=D;try{return U()}finally{b=z}},e.unstable_scheduleCallback=function(D,U,z){var G=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?G+z:G):z=G,D){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=z+M,D={id:g++,callback:U,priorityLevel:D,startTime:z,expirationTime:M,sortIndex:-1},z>G?(D.sortIndex=z,t(d,D),n(h)===null&&D===n(d)&&(S?(R(O),O=-1):S=!0,K(L,z-G))):(D.sortIndex=M,t(h,D),w||y||(w=!0,A||(A=!0,F()))),D},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(D){var U=b;return function(){var z=b;b=U;try{return D.apply(this,arguments)}finally{b=z}}}}(Jb)),Jb}var Zk;function rz(){return Zk||(Zk=1,Qb.exports=nz()),Qb.exports}var e_={exports:{}},Dr={};/**
|
|
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 Qk;function iz(){if(Qk)return Dr;Qk=1;var e=m0();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},i=Symbol.for("react.portal");function o(h,d,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,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 c(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Dr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dr.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)},Dr.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()}},Dr.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))},Dr.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},Dr.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,p=c(g,d.crossOrigin),b=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:b,fetchPriority:y}):g==="script"&&r.d.X(h,{crossOrigin:p,integrity:b,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Dr.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=c(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)},Dr.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,p=c(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})}},Dr.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=c(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)},Dr.requestFormReset=function(h){r.d.r(h)},Dr.unstable_batchedUpdates=function(h,d){return h(d)},Dr.useFormState=function(h,d,g){return l.H.useFormState(h,d,g)},Dr.useFormStatus=function(){return l.H.useHostTransitionStatus()},Dr.version="19.2.1",Dr}var Jk;function NN(){if(Jk)return e_.exports;Jk=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(),e_.exports=iz(),e_.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 e2;function sz(){if(e2)return vd;e2=1;var e=rz(),t=m0(),n=NN();function r(s){var a="https://react.dev/errors/"+s;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var a=s,u=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,(a.flags&4098)!==0&&(u=a.return),s=a.return;while(s)}return a.tag===3?u:null}function l(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function c(s){if(s.tag===31){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function h(s){if(o(s)!==s)throw Error(r(188))}function d(s){var a=s.alternate;if(!a){if(a=o(s),a===null)throw Error(r(188));return a!==s?null:s}for(var u=s,m=a;;){var _=u.return;if(_===null)break;var x=_.alternate;if(x===null){if(m=_.return,m!==null){u=m;continue}break}if(_.child===x.child){for(x=_.child;x;){if(x===u)return h(_),s;if(x===m)return h(_),a;x=x.sibling}throw Error(r(188))}if(u.return!==m.return)u=_,m=x;else{for(var T=!1,P=_.child;P;){if(P===u){T=!0,u=_,m=x;break}if(P===m){T=!0,m=_,u=x;break}P=P.sibling}if(!T){for(P=x.child;P;){if(P===u){T=!0,u=x,m=_;break}if(P===m){T=!0,m=x,u=_;break}P=P.sibling}if(!T)throw Error(r(189))}}if(u.alternate!==m)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?s:a}function g(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s;for(s=s.child;s!==null;){if(a=g(s),a!==null)return a;s=s.sibling}return null}var p=Object.assign,b=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"),N=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function F(s){return s===null||typeof s!="object"?null:(s=q&&s[q]||s["@@iterator"],typeof s=="function"?s:null)}var $=Symbol.for("react.client.reference");function W(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===$?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case A:return"SuspenseList";case Z:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case E:return s.displayName||"Context";case R:return(s._context.displayName||"Context")+".Consumer";case N:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case O:return a=s.displayName||null,a!==null?a:W(s.type)||"Memo";case H:a=s._payload,s=s._init;try{return W(s(a))}catch{}}return null}var K=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},G=[],M=-1;function B(s){return{current:s}}function X(s){0>M||(s.current=G[M],G[M]=null,M--)}function j(s,a){M++,G[M]=s.current,s.current=a}var ie=B(null),J=B(null),ee=B(null),re=B(null);function ue(s,a){switch(j(ee,a),j(J,s),j(ie,null),a.nodeType){case 9:case 11:s=(s=a.documentElement)&&(s=s.namespaceURI)?dk(s):0;break;default:if(s=a.tagName,a=a.namespaceURI)a=dk(a),s=hk(a,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}X(ie),j(ie,s)}function fe(){X(ie),X(J),X(ee)}function ge(s){s.memoizedState!==null&&j(re,s);var a=ie.current,u=hk(a,s.type);a!==u&&(j(J,s),j(ie,u))}function Ce(s){J.current===s&&(X(ie),X(J)),re.current===s&&(X(re),dd._currentValue=z)}var Re,je;function Qe(s){if(Re===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);Re=a&&a[1]||"",je=-1<u.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Re+s+je}var yt=!1;function Tt(s,a){if(!s||yt)return"";yt=!0;var u=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(he){var ce=he}Reflect.construct(s,[],_e)}else{try{_e.call()}catch(he){ce=he}s.call(_e.prototype)}}else{try{throw Error()}catch(he){ce=he}(_e=s())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(he){if(he&&ce&&typeof he.stack=="string")return[he.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],P=x[1];if(T&&P){var Q=T.split(`
|
|
44
|
+
`),le=P.split(`
|
|
45
|
+
`);for(_=m=0;m<Q.length&&!Q[m].includes("DetermineComponentFrameRoot");)m++;for(;_<le.length&&!le[_].includes("DetermineComponentFrameRoot");)_++;if(m===Q.length||_===le.length)for(m=Q.length-1,_=le.length-1;1<=m&&0<=_&&Q[m]!==le[_];)_--;for(;1<=m&&0<=_;m--,_--)if(Q[m]!==le[_]){if(m!==1||_!==1)do if(m--,_--,0>_||Q[m]!==le[_]){var ve=`
|
|
46
|
+
`+Q[m].replace(" at new "," at ");return s.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",s.displayName)),ve}while(1<=m&&0<=_);break}}}finally{yt=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?Qe(u):""}function me(s,a){switch(s.tag){case 26:case 27:case 5:return Qe(s.type);case 16:return Qe("Lazy");case 13:return s.child!==a&&a!==null?Qe("Suspense Fallback"):Qe("Suspense");case 19:return Qe("SuspenseList");case 0:case 15:return Tt(s.type,!1);case 11:return Tt(s.type.render,!1);case 1:return Tt(s.type,!0);case 31:return Qe("Activity");default:return""}}function Ue(s){try{var a="",u=null;do a+=me(s,u),u=s,s=s.return;while(s);return a}catch(m){return`
|
|
47
|
+
Error generating stack: `+m.message+`
|
|
48
|
+
`+m.stack}}var Oe=Object.prototype.hasOwnProperty,mt=e.unstable_scheduleCallback,pt=e.unstable_cancelCallback,ot=e.unstable_shouldYield,dn=e.unstable_requestPaint,Nt=e.unstable_now,In=e.unstable_getCurrentPriorityLevel,de=e.unstable_ImmediatePriority,oe=e.unstable_UserBlockingPriority,xe=e.unstable_NormalPriority,ke=e.unstable_LowPriority,Ke=e.unstable_IdlePriority,ct=e.log,Je=e.unstable_setDisableYieldValue,Ae=null,$e=null;function lt(s){if(typeof ct=="function"&&Je(s),$e&&typeof $e.setStrictMode=="function")try{$e.setStrictMode(Ae,s)}catch{}}var Fe=Math.clz32?Math.clz32:bn,hn=Math.log,qt=Math.LN2;function bn(s){return s>>>=0,s===0?32:31-(hn(s)/qt|0)|0}var dr=256,er=262144,Kt=4194304;function Ft(s){var a=s&42;if(a!==0)return a;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Pe(s,a,u){var m=s.pendingLanes;if(m===0)return 0;var _=0,x=s.suspendedLanes,T=s.pingedLanes;s=s.warmLanes;var P=m&134217727;return P!==0?(m=P&~x,m!==0?_=Ft(m):(T&=P,T!==0?_=Ft(T):u||(u=P&~s,u!==0&&(_=Ft(u))))):(P=m&~x,P!==0?_=Ft(P):T!==0?_=Ft(T):u||(u=m&~s,u!==0&&(_=Ft(u)))),_===0?0:a!==0&&a!==_&&(a&x)===0&&(x=_&-_,u=a&-a,x>=u||x===32&&(u&4194048)!==0)?a:_}function vt(s,a){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&a)===0}function kt(s,a){switch(s){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 Et(){var s=Kt;return Kt<<=1,(Kt&62914560)===0&&(Kt=4194304),s}function fn(s){for(var a=[],u=0;31>u;u++)a.push(s);return a}function ze(s,a){s.pendingLanes|=a,a!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function rt(s,a,u,m,_,x){var T=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var P=s.entanglements,Q=s.expirationTimes,le=s.hiddenUpdates;for(u=T&~u;0<u;){var ve=31-Fe(u),_e=1<<ve;P[ve]=0,Q[ve]=-1;var ce=le[ve];if(ce!==null)for(le[ve]=null,ve=0;ve<ce.length;ve++){var he=ce[ve];he!==null&&(he.lane&=-536870913)}u&=~_e}m!==0&&xn(s,m,0),x!==0&&_===0&&s.tag!==0&&(s.suspendedLanes|=x&~(T&~a))}function xn(s,a,u){s.pendingLanes|=a,s.suspendedLanes&=~a;var m=31-Fe(a);s.entangledLanes|=a,s.entanglements[m]=s.entanglements[m]|1073741824|u&261930}function Te(s,a){var u=s.entangledLanes|=a;for(s=s.entanglements;u;){var m=31-Fe(u),_=1<<m;_&a|s[m]&a&&(s[m]|=a),u&=~_}}function Le(s,a){var u=a&-a;return u=(u&42)!==0?1:Ot(u),(u&(s.suspendedLanes|a))!==0?0:u}function Ot(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ut(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function mn(){var s=U.p;return s!==0?s:(s=window.event,s===void 0?32:Lk(s.type))}function Qt(s,a){var u=U.p;try{return U.p=s,a()}finally{U.p=u}}var rn=Math.random().toString(36).slice(2),Gt="__reactFiber$"+rn,$t="__reactProps$"+rn,Ar="__reactContainer$"+rn,ms="__reactEvents$"+rn,Hl="__reactListeners$"+rn,Po="__reactHandles$"+rn,Io="__reactResources$"+rn,ps="__reactMarker$"+rn;function Bo(s){delete s[Gt],delete s[$t],delete s[ms],delete s[Hl],delete s[Po]}function hr(s){var a=s[Gt];if(a)return a;for(var u=s.parentNode;u;){if(a=u[Ar]||u[Gt]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(s=_k(s);s!==null;){if(u=s[Gt])return u;s=_k(s)}return a}s=u,u=s.parentNode}return null}function Ei(s){if(s=s[Gt]||s[Ar]){var a=s.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return s}return null}function qs(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s.stateNode;throw Error(r(33))}function gs(s){var a=s[Io];return a||(a=s[Io]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function wn(s){s[ps]=!0}var $l=new Set,Ul={};function Ri(s,a){vs(s,a),vs(s+"Capture",a)}function vs(s,a){for(Ul[s]=a,s=0;s<a.length;s++)$l.add(a[s])}var Vl=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]*$"),Wl={},Ba={};function ql(s){return Oe.call(Ba,s)?!0:Oe.call(Wl,s)?!1:Vl.test(s)?Ba[s]=!0:(Wl[s]=!0,!1)}function Ks(s,a,u){if(ql(a))if(u===null)s.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(a);return;case"boolean":var m=a.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){s.removeAttribute(a);return}}s.setAttribute(a,""+u)}}function V(s,a,u){if(u===null)s.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(a);return}s.setAttribute(a,""+u)}}function nt(s,a,u,m){if(m===null)s.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(a,u,""+m)}}function Jt(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Gs(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Fa(s,a,u){var m=Object.getOwnPropertyDescriptor(s.constructor.prototype,a);if(!s.hasOwnProperty(a)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var _=m.get,x=m.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return _.call(this)},set:function(T){u=""+T,x.call(this,T)}}),Object.defineProperty(s,a,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(T){u=""+T},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function en(s){if(!s._valueTracker){var a=Gs(s)?"checked":"value";s._valueTracker=Fa(s,a,""+s[a])}}function tr(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var u=a.getValue(),m="";return s&&(m=Gs(s)?s.checked?"true":"false":s.value),s=m,s!==u?(a.setValue(s),!0):!1}function Ys(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Xh=/[\n"\\]/g;function Y(s){return s.replace(Xh,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ne(s,a,u,m,_,x,T,P){s.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?s.type=T:s.removeAttribute("type"),a!=null?T==="number"?(a===0&&s.value===""||s.value!=a)&&(s.value=""+Jt(a)):s.value!==""+Jt(a)&&(s.value=""+Jt(a)):T!=="submit"&&T!=="reset"||s.removeAttribute("value"),a!=null?Ve(s,T,Jt(a)):u!=null?Ve(s,T,Jt(u)):m!=null&&s.removeAttribute("value"),_==null&&x!=null&&(s.defaultChecked=!!x),_!=null&&(s.checked=_&&typeof _!="function"&&typeof _!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.name=""+Jt(P):s.removeAttribute("name")}function Se(s,a,u,m,_,x,T,P){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(s.type=x),a!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||a!=null)){en(s);return}u=u!=null?""+Jt(u):"",a=a!=null?""+Jt(a):u,P||a===s.value||(s.value=a),s.defaultValue=a}m=m??_,m=typeof m!="function"&&typeof m!="symbol"&&!!m,s.checked=P?s.checked:!!m,s.defaultChecked=!!m,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.name=T),en(s)}function Ve(s,a,u){a==="number"&&Ys(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function It(s,a,u,m){if(s=s.options,a){a={};for(var _=0;_<u.length;_++)a["$"+u[_]]=!0;for(u=0;u<s.length;u++)_=a.hasOwnProperty("$"+s[u].value),s[u].selected!==_&&(s[u].selected=_),_&&m&&(s[u].defaultSelected=!0)}else{for(u=""+Jt(u),a=null,_=0;_<s.length;_++){if(s[_].value===u){s[_].selected=!0,m&&(s[_].defaultSelected=!0);return}a!==null||s[_].disabled||(a=s[_])}a!==null&&(a.selected=!0)}}function En(s,a,u){if(a!=null&&(a=""+Jt(a),a!==s.value&&(s.value=a),u==null)){s.defaultValue!==a&&(s.defaultValue=a);return}s.defaultValue=u!=null?""+Jt(u):""}function Cr(s,a,u,m){if(a==null){if(m!=null){if(u!=null)throw Error(r(92));if(K(m)){if(1<m.length)throw Error(r(93));m=m[0]}u=m}u==null&&(u=""),a=u}u=Jt(a),s.defaultValue=u,m=s.textContent,m===u&&m!==""&&m!==null&&(s.value=m),en(s)}function Gr(s,a){if(a){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=a;return}}s.textContent=a}var Zh=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 Ru(s,a,u){var m=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?s.setProperty(a,""):a==="float"?s.cssFloat="":s[a]="":m?s.setProperty(a,u):typeof u!="number"||u===0||Zh.has(a)?a==="float"?s.cssFloat=u:s[a]=(""+u).trim():s[a]=u+"px"}function c1(s,a,u){if(a!=null&&typeof a!="object")throw Error(r(62));if(s=s.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||a!=null&&a.hasOwnProperty(m)||(m.indexOf("--")===0?s.setProperty(m,""):m==="float"?s.cssFloat="":s[m]="");for(var _ in a)m=a[_],a.hasOwnProperty(_)&&u[_]!==m&&Ru(s,_,m)}else for(var x in a)a.hasOwnProperty(x)&&Ru(s,x,a[x])}function Wg(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var qO=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"]]),KO=/^[\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 Qh(s){return KO.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Xs(){}var qg=null;function Kg(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Kl=null,Gl=null;function u1(s){var a=Ei(s);if(a&&(s=a.stateNode)){var u=s[$t]||null;e:switch(s=a.stateNode,a.type){case"input":if(ne(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Y(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var m=u[a];if(m!==s&&m.form===s.form){var _=m[$t]||null;if(!_)throw Error(r(90));ne(m,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(a=0;a<u.length;a++)m=u[a],m.form===s.form&&tr(m)}break e;case"textarea":En(s,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&It(s,!!u.multiple,a,!1)}}}var Gg=!1;function d1(s,a,u){if(Gg)return s(a,u);Gg=!0;try{var m=s(a);return m}finally{if(Gg=!1,(Kl!==null||Gl!==null)&&(Ff(),Kl&&(a=Kl,s=Gl,Gl=Kl=null,u1(a),s)))for(a=0;a<s.length;a++)u1(s[a])}}function Tu(s,a){var u=s.stateNode;if(u===null)return null;var m=u[$t]||null;if(m===null)return null;u=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)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(r(231,a,typeof u));return u}var Zs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yg=!1;if(Zs)try{var Nu={};Object.defineProperty(Nu,"passive",{get:function(){Yg=!0}}),window.addEventListener("test",Nu,Nu),window.removeEventListener("test",Nu,Nu)}catch{Yg=!1}var Fo=null,Xg=null,Jh=null;function h1(){if(Jh)return Jh;var s,a=Xg,u=a.length,m,_="value"in Fo?Fo.value:Fo.textContent,x=_.length;for(s=0;s<u&&a[s]===_[s];s++);var T=u-s;for(m=1;m<=T&&a[u-m]===_[x-m];m++);return Jh=_.slice(s,1<m?1-m:void 0)}function ef(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function tf(){return!0}function f1(){return!1}function Yr(s){function a(u,m,_,x,T){this._reactName=u,this._targetInst=_,this.type=m,this.nativeEvent=x,this.target=T,this.currentTarget=null;for(var P in s)s.hasOwnProperty(P)&&(u=s[P],this[P]=u?u(x):x[P]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?tf:f1,this.isPropagationStopped=f1,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=tf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=tf)},persist:function(){},isPersistent:tf}),a}var Ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nf=Yr(Ha),Mu=p({},Ha,{view:0,detail:0}),GO=Yr(Mu),Zg,Qg,ju,rf=p({},Mu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ev,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==ju&&(ju&&s.type==="mousemove"?(Zg=s.screenX-ju.screenX,Qg=s.screenY-ju.screenY):Qg=Zg=0,ju=s),Zg)},movementY:function(s){return"movementY"in s?s.movementY:Qg}}),m1=Yr(rf),YO=p({},rf,{dataTransfer:0}),XO=Yr(YO),ZO=p({},Mu,{relatedTarget:0}),Jg=Yr(ZO),QO=p({},Ha,{animationName:0,elapsedTime:0,pseudoElement:0}),JO=Yr(QO),e3=p({},Ha,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),t3=Yr(e3),n3=p({},Ha,{data:0}),p1=Yr(n3),r3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i3={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"},s3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o3(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=s3[s])?!!a[s]:!1}function ev(){return o3}var a3=p({},Mu,{key:function(s){if(s.key){var a=r3[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=ef(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?i3[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ev,charCode:function(s){return s.type==="keypress"?ef(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?ef(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),l3=Yr(a3),c3=p({},rf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),g1=Yr(c3),u3=p({},Mu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ev}),d3=Yr(u3),h3=p({},Ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),f3=Yr(h3),m3=p({},rf,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),p3=Yr(m3),g3=p({},Ha,{newState:0,oldState:0}),v3=Yr(g3),b3=[9,13,27,32],tv=Zs&&"CompositionEvent"in window,Au=null;Zs&&"documentMode"in document&&(Au=document.documentMode);var _3=Zs&&"TextEvent"in window&&!Au,v1=Zs&&(!tv||Au&&8<Au&&11>=Au),b1=" ",_1=!1;function y1(s,a){switch(s){case"keyup":return b3.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function x1(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Yl=!1;function y3(s,a){switch(s){case"compositionend":return x1(a);case"keypress":return a.which!==32?null:(_1=!0,b1);case"textInput":return s=a.data,s===b1&&_1?null:s;default:return null}}function x3(s,a){if(Yl)return s==="compositionend"||!tv&&y1(s,a)?(s=h1(),Jh=Xg=Fo=null,Yl=!1,s):null;switch(s){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 v1&&a.locale!=="ko"?null:a.data;default:return null}}var w3={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 w1(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!w3[s.type]:a==="textarea"}function S1(s,a,u,m){Kl?Gl?Gl.push(m):Gl=[m]:Kl=m,a=Kf(a,"onChange"),0<a.length&&(u=new nf("onChange","change",null,u,m),s.push({event:u,listeners:a}))}var Du=null,Ou=null;function S3(s){sk(s,0)}function sf(s){var a=qs(s);if(tr(a))return s}function C1(s,a){if(s==="change")return a}var k1=!1;if(Zs){var nv;if(Zs){var rv="oninput"in document;if(!rv){var E1=document.createElement("div");E1.setAttribute("oninput","return;"),rv=typeof E1.oninput=="function"}nv=rv}else nv=!1;k1=nv&&(!document.documentMode||9<document.documentMode)}function R1(){Du&&(Du.detachEvent("onpropertychange",T1),Ou=Du=null)}function T1(s){if(s.propertyName==="value"&&sf(Ou)){var a=[];S1(a,Ou,s,Kg(s)),d1(S3,a)}}function C3(s,a,u){s==="focusin"?(R1(),Du=a,Ou=u,Du.attachEvent("onpropertychange",T1)):s==="focusout"&&R1()}function k3(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return sf(Ou)}function E3(s,a){if(s==="click")return sf(a)}function R3(s,a){if(s==="input"||s==="change")return sf(a)}function T3(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var ci=typeof Object.is=="function"?Object.is:T3;function Lu(s,a){if(ci(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var u=Object.keys(s),m=Object.keys(a);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var _=u[m];if(!Oe.call(a,_)||!ci(s[_],a[_]))return!1}return!0}function N1(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function M1(s,a){var u=N1(s);s=0;for(var m;u;){if(u.nodeType===3){if(m=s+u.textContent.length,s<=a&&m>=a)return{node:u,offset:a-s};s=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=N1(u)}}function j1(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?j1(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function A1(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var a=Ys(s.document);a instanceof s.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)s=a.contentWindow;else break;a=Ys(s.document)}return a}function iv(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}var N3=Zs&&"documentMode"in document&&11>=document.documentMode,Xl=null,sv=null,zu=null,ov=!1;function D1(s,a,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ov||Xl==null||Xl!==Ys(m)||(m=Xl,"selectionStart"in m&&iv(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}),zu&&Lu(zu,m)||(zu=m,m=Kf(sv,"onSelect"),0<m.length&&(a=new nf("onSelect","select",null,a,u),s.push({event:a,listeners:m}),a.target=Xl)))}function $a(s,a){var u={};return u[s.toLowerCase()]=a.toLowerCase(),u["Webkit"+s]="webkit"+a,u["Moz"+s]="moz"+a,u}var Zl={animationend:$a("Animation","AnimationEnd"),animationiteration:$a("Animation","AnimationIteration"),animationstart:$a("Animation","AnimationStart"),transitionrun:$a("Transition","TransitionRun"),transitionstart:$a("Transition","TransitionStart"),transitioncancel:$a("Transition","TransitionCancel"),transitionend:$a("Transition","TransitionEnd")},av={},O1={};Zs&&(O1=document.createElement("div").style,"AnimationEvent"in window||(delete Zl.animationend.animation,delete Zl.animationiteration.animation,delete Zl.animationstart.animation),"TransitionEvent"in window||delete Zl.transitionend.transition);function Ua(s){if(av[s])return av[s];if(!Zl[s])return s;var a=Zl[s],u;for(u in a)if(a.hasOwnProperty(u)&&u in O1)return av[s]=a[u];return s}var L1=Ua("animationend"),z1=Ua("animationiteration"),P1=Ua("animationstart"),M3=Ua("transitionrun"),j3=Ua("transitionstart"),A3=Ua("transitioncancel"),I1=Ua("transitionend"),B1=new Map,lv="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(" ");lv.push("scrollEnd");function Ji(s,a){B1.set(s,a),Ri(a,[s])}var of=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Ti=[],Ql=0,cv=0;function af(){for(var s=Ql,a=cv=Ql=0;a<s;){var u=Ti[a];Ti[a++]=null;var m=Ti[a];Ti[a++]=null;var _=Ti[a];Ti[a++]=null;var x=Ti[a];if(Ti[a++]=null,m!==null&&_!==null){var T=m.pending;T===null?_.next=_:(_.next=T.next,T.next=_),m.pending=_}x!==0&&F1(u,_,x)}}function lf(s,a,u,m){Ti[Ql++]=s,Ti[Ql++]=a,Ti[Ql++]=u,Ti[Ql++]=m,cv|=m,s.lanes|=m,s=s.alternate,s!==null&&(s.lanes|=m)}function uv(s,a,u,m){return lf(s,a,u,m),cf(s)}function Va(s,a){return lf(s,null,null,a),cf(s)}function F1(s,a,u){s.lanes|=u;var m=s.alternate;m!==null&&(m.lanes|=u);for(var _=!1,x=s.return;x!==null;)x.childLanes|=u,m=x.alternate,m!==null&&(m.childLanes|=u),x.tag===22&&(s=x.stateNode,s===null||s._visibility&1||(_=!0)),s=x,x=x.return;return s.tag===3?(x=s.stateNode,_&&a!==null&&(_=31-Fe(u),s=x.hiddenUpdates,m=s[_],m===null?s[_]=[a]:m.push(a),a.lane=u|536870912),x):null}function cf(s){if(50<id)throw id=0,_b=null,Error(r(185));for(var a=s.return;a!==null;)s=a,a=s.return;return s.tag===3?s.stateNode:null}var Jl={};function D3(s,a,u,m){this.tag=s,this.key=u,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 ui(s,a,u,m){return new D3(s,a,u,m)}function dv(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Qs(s,a){var u=s.alternate;return u===null?(u=ui(s.tag,a,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=a,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,a=s.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function H1(s,a){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=a,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,a=u.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),s}function uf(s,a,u,m,_,x){var T=0;if(m=s,typeof s=="function")dv(s)&&(T=1);else if(typeof s=="string")T=IL(s,u,ie.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case Z:return s=ui(31,u,a,_),s.elementType=Z,s.lanes=x,s;case S:return Wa(u.children,_,x,a);case C:T=8,_|=24;break;case k:return s=ui(12,u,a,_|2),s.elementType=k,s.lanes=x,s;case L:return s=ui(13,u,a,_),s.elementType=L,s.lanes=x,s;case A:return s=ui(19,u,a,_),s.elementType=A,s.lanes=x,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case E:T=10;break e;case R:T=9;break e;case N:T=11;break e;case O:T=14;break e;case H:T=16,m=null;break e}T=29,u=Error(r(130,s===null?"null":typeof s,"")),m=null}return a=ui(T,u,a,_),a.elementType=s,a.type=m,a.lanes=x,a}function Wa(s,a,u,m){return s=ui(7,s,m,a),s.lanes=u,s}function hv(s,a,u){return s=ui(6,s,null,a),s.lanes=u,s}function $1(s){var a=ui(18,null,null,0);return a.stateNode=s,a}function fv(s,a,u){return a=ui(4,s.children!==null?s.children:[],s.key,a),a.lanes=u,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}var U1=new WeakMap;function Ni(s,a){if(typeof s=="object"&&s!==null){var u=U1.get(s);return u!==void 0?u:(a={value:s,source:a,stack:Ue(a)},U1.set(s,a),a)}return{value:s,source:a,stack:Ue(a)}}var ec=[],tc=0,df=null,Pu=0,Mi=[],ji=0,Ho=null,bs=1,_s="";function Js(s,a){ec[tc++]=Pu,ec[tc++]=df,df=s,Pu=a}function V1(s,a,u){Mi[ji++]=bs,Mi[ji++]=_s,Mi[ji++]=Ho,Ho=s;var m=bs;s=_s;var _=32-Fe(m)-1;m&=~(1<<_),u+=1;var x=32-Fe(a)+_;if(30<x){var T=_-_%5;x=(m&(1<<T)-1).toString(32),m>>=T,_-=T,bs=1<<32-Fe(a)+_|u<<_|m,_s=x+s}else bs=1<<x|u<<_|m,_s=s}function mv(s){s.return!==null&&(Js(s,1),V1(s,1,0))}function pv(s){for(;s===df;)df=ec[--tc],ec[tc]=null,Pu=ec[--tc],ec[tc]=null;for(;s===Ho;)Ho=Mi[--ji],Mi[ji]=null,_s=Mi[--ji],Mi[ji]=null,bs=Mi[--ji],Mi[ji]=null}function W1(s,a){Mi[ji++]=bs,Mi[ji++]=_s,Mi[ji++]=Ho,bs=a.id,_s=a.overflow,Ho=s}var kr=null,Sn=null,Pt=!1,$o=null,Ai=!1,gv=Error(r(519));function Uo(s){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Iu(Ni(a,s)),gv}function q1(s){var a=s.stateNode,u=s.type,m=s.memoizedProps;switch(a[Gt]=s,a[$t]=m,u){case"dialog":jt("cancel",a),jt("close",a);break;case"iframe":case"object":case"embed":jt("load",a);break;case"video":case"audio":for(u=0;u<od.length;u++)jt(od[u],a);break;case"source":jt("error",a);break;case"img":case"image":case"link":jt("error",a),jt("load",a);break;case"details":jt("toggle",a);break;case"input":jt("invalid",a),Se(a,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":jt("invalid",a);break;case"textarea":jt("invalid",a),Cr(a,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||m.suppressHydrationWarning===!0||ck(a.textContent,u)?(m.popover!=null&&(jt("beforetoggle",a),jt("toggle",a)),m.onScroll!=null&&jt("scroll",a),m.onScrollEnd!=null&&jt("scrollend",a),m.onClick!=null&&(a.onclick=Xs),a=!0):a=!1,a||Uo(s,!0)}function K1(s){for(kr=s.return;kr;)switch(kr.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:kr=kr.return}}function nc(s){if(s!==kr)return!1;if(!Pt)return K1(s),Pt=!0,!1;var a=s.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||Ob(s.type,s.memoizedProps)),u=!u),u&&Sn&&Uo(s),K1(s),a===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Sn=bk(s)}else if(a===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Sn=bk(s)}else a===27?(a=Sn,ra(s.type)?(s=Bb,Bb=null,Sn=s):Sn=a):Sn=kr?Oi(s.stateNode.nextSibling):null;return!0}function qa(){Sn=kr=null,Pt=!1}function vv(){var s=$o;return s!==null&&(Jr===null?Jr=s:Jr.push.apply(Jr,s),$o=null),s}function Iu(s){$o===null?$o=[s]:$o.push(s)}var bv=B(null),Ka=null,eo=null;function Vo(s,a,u){j(bv,a._currentValue),a._currentValue=u}function to(s){s._currentValue=bv.current,X(bv)}function _v(s,a,u){for(;s!==null;){var m=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),s===u)break;s=s.return}}function yv(s,a,u,m){var _=s.child;for(_!==null&&(_.return=s);_!==null;){var x=_.dependencies;if(x!==null){var T=_.child;x=x.firstContext;e:for(;x!==null;){var P=x;x=_;for(var Q=0;Q<a.length;Q++)if(P.context===a[Q]){x.lanes|=u,P=x.alternate,P!==null&&(P.lanes|=u),_v(x.return,u,s),m||(T=null);break e}x=P.next}}else if(_.tag===18){if(T=_.return,T===null)throw Error(r(341));T.lanes|=u,x=T.alternate,x!==null&&(x.lanes|=u),_v(T,u,s),T=null}else T=_.child;if(T!==null)T.return=_;else for(T=_;T!==null;){if(T===s){T=null;break}if(_=T.sibling,_!==null){_.return=T.return,T=_;break}T=T.return}_=T}}function rc(s,a,u,m){s=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 P=_.type;ci(_.pendingProps.value,T.value)||(s!==null?s.push(P):s=[P])}}else if(_===re.current){if(T=_.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(s!==null?s.push(dd):s=[dd])}_=_.return}s!==null&&yv(a,s,u,m),a.flags|=262144}function hf(s){for(s=s.firstContext;s!==null;){if(!ci(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Ga(s){Ka=s,eo=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Er(s){return G1(Ka,s)}function ff(s,a){return Ka===null&&Ga(s),G1(s,a)}function G1(s,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},eo===null){if(s===null)throw Error(r(308));eo=a,s.dependencies={lanes:0,firstContext:a},s.flags|=524288}else eo=eo.next=a;return u}var O3=typeof AbortController<"u"?AbortController:function(){var s=[],a=this.signal={aborted:!1,addEventListener:function(u,m){s.push(m)}};this.abort=function(){a.aborted=!0,s.forEach(function(u){return u()})}},L3=e.unstable_scheduleCallback,z3=e.unstable_NormalPriority,Wn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xv(){return{controller:new O3,data:new Map,refCount:0}}function Bu(s){s.refCount--,s.refCount===0&&L3(z3,function(){s.controller.abort()})}var Fu=null,wv=0,ic=0,sc=null;function P3(s,a){if(Fu===null){var u=Fu=[];wv=0,ic=kb(),sc={status:"pending",value:void 0,then:function(m){u.push(m)}}}return wv++,a.then(Y1,Y1),a}function Y1(){if(--wv===0&&Fu!==null){sc!==null&&(sc.status="fulfilled");var s=Fu;Fu=null,ic=0,sc=null;for(var a=0;a<s.length;a++)(0,s[a])()}}function I3(s,a){var u=[],m={status:"pending",value:null,reason:null,then:function(_){u.push(_)}};return s.then(function(){m.status="fulfilled",m.value=a;for(var _=0;_<u.length;_++)(0,u[_])(a)},function(_){for(m.status="rejected",m.reason=_,_=0;_<u.length;_++)(0,u[_])(void 0)}),m}var X1=D.S;D.S=function(s,a){DC=Nt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&P3(s,a),X1!==null&&X1(s,a)};var Ya=B(null);function Sv(){var s=Ya.current;return s!==null?s:pn.pooledCache}function mf(s,a){a===null?j(Ya,Ya.current):j(Ya,a.pool)}function Z1(){var s=Sv();return s===null?null:{parent:Wn._currentValue,pool:s}}var oc=Error(r(460)),Cv=Error(r(474)),pf=Error(r(542)),gf={then:function(){}};function Q1(s){return s=s.status,s==="fulfilled"||s==="rejected"}function J1(s,a,u){switch(u=s[u],u===void 0?s.push(a):u!==a&&(a.then(Xs,Xs),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,tS(s),s;default:if(typeof a.status=="string")a.then(Xs,Xs);else{if(s=pn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=a,s.status="pending",s.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 s=a.reason,tS(s),s}throw Za=a,oc}}function Xa(s){try{var a=s._init;return a(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Za=u,oc):u}}var Za=null;function eS(){if(Za===null)throw Error(r(459));var s=Za;return Za=null,s}function tS(s){if(s===oc||s===pf)throw Error(r(483))}var ac=null,Hu=0;function vf(s){var a=Hu;return Hu+=1,ac===null&&(ac=[]),J1(ac,s,a)}function $u(s,a){a=a.props.ref,s.ref=a!==void 0?a:null}function bf(s,a){throw a.$$typeof===b?Error(r(525)):(s=Object.prototype.toString.call(a),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s)))}function nS(s){function a(se,te){if(s){var ae=se.deletions;ae===null?(se.deletions=[te],se.flags|=16):ae.push(te)}}function u(se,te){if(!s)return null;for(;te!==null;)a(se,te),te=te.sibling;return null}function m(se){for(var te=new Map;se!==null;)se.key!==null?te.set(se.key,se):te.set(se.index,se),se=se.sibling;return te}function _(se,te){return se=Qs(se,te),se.index=0,se.sibling=null,se}function x(se,te,ae){return se.index=ae,s?(ae=se.alternate,ae!==null?(ae=ae.index,ae<te?(se.flags|=67108866,te):ae):(se.flags|=67108866,te)):(se.flags|=1048576,te)}function T(se){return s&&se.alternate===null&&(se.flags|=67108866),se}function P(se,te,ae,be){return te===null||te.tag!==6?(te=hv(ae,se.mode,be),te.return=se,te):(te=_(te,ae),te.return=se,te)}function Q(se,te,ae,be){var tt=ae.type;return tt===S?ve(se,te,ae.props.children,be,ae.key):te!==null&&(te.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===H&&Xa(tt)===te.type)?(te=_(te,ae.props),$u(te,ae),te.return=se,te):(te=uf(ae.type,ae.key,ae.props,null,se.mode,be),$u(te,ae),te.return=se,te)}function le(se,te,ae,be){return te===null||te.tag!==4||te.stateNode.containerInfo!==ae.containerInfo||te.stateNode.implementation!==ae.implementation?(te=fv(ae,se.mode,be),te.return=se,te):(te=_(te,ae.children||[]),te.return=se,te)}function ve(se,te,ae,be,tt){return te===null||te.tag!==7?(te=Wa(ae,se.mode,be,tt),te.return=se,te):(te=_(te,ae),te.return=se,te)}function _e(se,te,ae){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=hv(""+te,se.mode,ae),te.return=se,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return ae=uf(te.type,te.key,te.props,null,se.mode,ae),$u(ae,te),ae.return=se,ae;case w:return te=fv(te,se.mode,ae),te.return=se,te;case H:return te=Xa(te),_e(se,te,ae)}if(K(te)||F(te))return te=Wa(te,se.mode,ae,null),te.return=se,te;if(typeof te.then=="function")return _e(se,vf(te),ae);if(te.$$typeof===E)return _e(se,ff(se,te),ae);bf(se,te)}return null}function ce(se,te,ae,be){var tt=te!==null?te.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return tt!==null?null:P(se,te,""+ae,be);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case y:return ae.key===tt?Q(se,te,ae,be):null;case w:return ae.key===tt?le(se,te,ae,be):null;case H:return ae=Xa(ae),ce(se,te,ae,be)}if(K(ae)||F(ae))return tt!==null?null:ve(se,te,ae,be,null);if(typeof ae.then=="function")return ce(se,te,vf(ae),be);if(ae.$$typeof===E)return ce(se,te,ff(se,ae),be);bf(se,ae)}return null}function he(se,te,ae,be,tt){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return se=se.get(ae)||null,P(te,se,""+be,tt);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case y:return se=se.get(be.key===null?ae:be.key)||null,Q(te,se,be,tt);case w:return se=se.get(be.key===null?ae:be.key)||null,le(te,se,be,tt);case H:return be=Xa(be),he(se,te,ae,be,tt)}if(K(be)||F(be))return se=se.get(ae)||null,ve(te,se,be,tt,null);if(typeof be.then=="function")return he(se,te,ae,vf(be),tt);if(be.$$typeof===E)return he(se,te,ae,ff(te,be),tt);bf(te,be)}return null}function We(se,te,ae,be){for(var tt=null,Ut=null,Ze=te,bt=te=0,zt=null;Ze!==null&&bt<ae.length;bt++){Ze.index>bt?(zt=Ze,Ze=null):zt=Ze.sibling;var Vt=ce(se,Ze,ae[bt],be);if(Vt===null){Ze===null&&(Ze=zt);break}s&&Ze&&Vt.alternate===null&&a(se,Ze),te=x(Vt,te,bt),Ut===null?tt=Vt:Ut.sibling=Vt,Ut=Vt,Ze=zt}if(bt===ae.length)return u(se,Ze),Pt&&Js(se,bt),tt;if(Ze===null){for(;bt<ae.length;bt++)Ze=_e(se,ae[bt],be),Ze!==null&&(te=x(Ze,te,bt),Ut===null?tt=Ze:Ut.sibling=Ze,Ut=Ze);return Pt&&Js(se,bt),tt}for(Ze=m(Ze);bt<ae.length;bt++)zt=he(Ze,se,bt,ae[bt],be),zt!==null&&(s&&zt.alternate!==null&&Ze.delete(zt.key===null?bt:zt.key),te=x(zt,te,bt),Ut===null?tt=zt:Ut.sibling=zt,Ut=zt);return s&&Ze.forEach(function(la){return a(se,la)}),Pt&&Js(se,bt),tt}function st(se,te,ae,be){if(ae==null)throw Error(r(151));for(var tt=null,Ut=null,Ze=te,bt=te=0,zt=null,Vt=ae.next();Ze!==null&&!Vt.done;bt++,Vt=ae.next()){Ze.index>bt?(zt=Ze,Ze=null):zt=Ze.sibling;var la=ce(se,Ze,Vt.value,be);if(la===null){Ze===null&&(Ze=zt);break}s&&Ze&&la.alternate===null&&a(se,Ze),te=x(la,te,bt),Ut===null?tt=la:Ut.sibling=la,Ut=la,Ze=zt}if(Vt.done)return u(se,Ze),Pt&&Js(se,bt),tt;if(Ze===null){for(;!Vt.done;bt++,Vt=ae.next())Vt=_e(se,Vt.value,be),Vt!==null&&(te=x(Vt,te,bt),Ut===null?tt=Vt:Ut.sibling=Vt,Ut=Vt);return Pt&&Js(se,bt),tt}for(Ze=m(Ze);!Vt.done;bt++,Vt=ae.next())Vt=he(Ze,se,bt,Vt.value,be),Vt!==null&&(s&&Vt.alternate!==null&&Ze.delete(Vt.key===null?bt:Vt.key),te=x(Vt,te,bt),Ut===null?tt=Vt:Ut.sibling=Vt,Ut=Vt);return s&&Ze.forEach(function(YL){return a(se,YL)}),Pt&&Js(se,bt),tt}function an(se,te,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 tt=ae.key;te!==null;){if(te.key===tt){if(tt=ae.type,tt===S){if(te.tag===7){u(se,te.sibling),be=_(te,ae.props.children),be.return=se,se=be;break e}}else if(te.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===H&&Xa(tt)===te.type){u(se,te.sibling),be=_(te,ae.props),$u(be,ae),be.return=se,se=be;break e}u(se,te);break}else a(se,te);te=te.sibling}ae.type===S?(be=Wa(ae.props.children,se.mode,be,ae.key),be.return=se,se=be):(be=uf(ae.type,ae.key,ae.props,null,se.mode,be),$u(be,ae),be.return=se,se=be)}return T(se);case w:e:{for(tt=ae.key;te!==null;){if(te.key===tt)if(te.tag===4&&te.stateNode.containerInfo===ae.containerInfo&&te.stateNode.implementation===ae.implementation){u(se,te.sibling),be=_(te,ae.children||[]),be.return=se,se=be;break e}else{u(se,te);break}else a(se,te);te=te.sibling}be=fv(ae,se.mode,be),be.return=se,se=be}return T(se);case H:return ae=Xa(ae),an(se,te,ae,be)}if(K(ae))return We(se,te,ae,be);if(F(ae)){if(tt=F(ae),typeof tt!="function")throw Error(r(150));return ae=tt.call(ae),st(se,te,ae,be)}if(typeof ae.then=="function")return an(se,te,vf(ae),be);if(ae.$$typeof===E)return an(se,te,ff(se,ae),be);bf(se,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,te!==null&&te.tag===6?(u(se,te.sibling),be=_(te,ae),be.return=se,se=be):(u(se,te),be=hv(ae,se.mode,be),be.return=se,se=be),T(se)):u(se,te)}return function(se,te,ae,be){try{Hu=0;var tt=an(se,te,ae,be);return ac=null,tt}catch(Ze){if(Ze===oc||Ze===pf)throw Ze;var Ut=ui(29,Ze,null,se.mode);return Ut.lanes=be,Ut.return=se,Ut}finally{}}}var Qa=nS(!0),rS=nS(!1),Wo=!1;function kv(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ev(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function qo(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ko(s,a,u){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,(Yt&2)!==0){var _=m.pending;return _===null?a.next=a:(a.next=_.next,_.next=a),m.pending=a,a=cf(s),F1(s,null,u),a}return lf(s,m,a,u),cf(s)}function Uu(s,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var m=a.lanes;m&=s.pendingLanes,u|=m,a.lanes=u,Te(s,u)}}function Rv(s,a){var u=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var _=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var T={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?_=x=T:x=x.next=T,u=u.next}while(u!==null);x===null?_=x=a:x=x.next=a}else _=x=a;u={baseState:m.baseState,firstBaseUpdate:_,lastBaseUpdate:x,shared:m.shared,callbacks:m.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=a:s.next=a,u.lastBaseUpdate=a}var Tv=!1;function Vu(){if(Tv){var s=sc;if(s!==null)throw s}}function Wu(s,a,u,m){Tv=!1;var _=s.updateQueue;Wo=!1;var x=_.firstBaseUpdate,T=_.lastBaseUpdate,P=_.shared.pending;if(P!==null){_.shared.pending=null;var Q=P,le=Q.next;Q.next=null,T===null?x=le:T.next=le,T=Q;var ve=s.alternate;ve!==null&&(ve=ve.updateQueue,P=ve.lastBaseUpdate,P!==T&&(P===null?ve.firstBaseUpdate=le:P.next=le,ve.lastBaseUpdate=Q))}if(x!==null){var _e=_.baseState;T=0,ve=le=Q=null,P=x;do{var ce=P.lane&-536870913,he=ce!==P.lane;if(he?(Lt&ce)===ce:(m&ce)===ce){ce!==0&&ce===ic&&(Tv=!0),ve!==null&&(ve=ve.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var We=s,st=P;ce=a;var an=u;switch(st.tag){case 1:if(We=st.payload,typeof We=="function"){_e=We.call(an,_e,ce);break e}_e=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=st.payload,ce=typeof We=="function"?We.call(an,_e,ce):We,ce==null)break e;_e=p({},_e,ce);break e;case 2:Wo=!0}}ce=P.callback,ce!==null&&(s.flags|=64,he&&(s.flags|=8192),he=_.callbacks,he===null?_.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ve===null?(le=ve=he,Q=_e):ve=ve.next=he,T|=ce;if(P=P.next,P===null){if(P=_.shared.pending,P===null)break;he=P,P=he.next,he.next=null,_.lastBaseUpdate=he,_.shared.pending=null}}while(!0);ve===null&&(Q=_e),_.baseState=Q,_.firstBaseUpdate=le,_.lastBaseUpdate=ve,x===null&&(_.shared.lanes=0),Qo|=T,s.lanes=T,s.memoizedState=_e}}function iS(s,a){if(typeof s!="function")throw Error(r(191,s));s.call(a)}function sS(s,a){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)iS(u[s],a)}var lc=B(null),_f=B(0);function oS(s,a){s=uo,j(_f,s),j(lc,a),uo=s|a.baseLanes}function Nv(){j(_f,uo),j(lc,lc.current)}function Mv(){uo=_f.current,X(lc),X(_f)}var di=B(null),Di=null;function Go(s){var a=s.alternate;j(Bn,Bn.current&1),j(di,s),Di===null&&(a===null||lc.current!==null||a.memoizedState!==null)&&(Di=s)}function jv(s){j(Bn,Bn.current),j(di,s),Di===null&&(Di=s)}function aS(s){s.tag===22?(j(Bn,Bn.current),j(di,s),Di===null&&(Di=s)):Yo()}function Yo(){j(Bn,Bn.current),j(di,di.current)}function hi(s){X(di),Di===s&&(Di=null),X(Bn)}var Bn=B(0);function yf(s){for(var a=s;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Pb(u)||Ib(u)))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===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var no=0,gt=null,sn=null,qn=null,xf=!1,cc=!1,Ja=!1,wf=0,qu=0,uc=null,B3=0;function Dn(){throw Error(r(321))}function Av(s,a){if(a===null)return!1;for(var u=0;u<a.length&&u<s.length;u++)if(!ci(s[u],a[u]))return!1;return!0}function Dv(s,a,u,m,_,x){return no=x,gt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,D.H=s===null||s.memoizedState===null?VS:Gv,Ja=!1,x=u(m,_),Ja=!1,cc&&(x=cS(a,u,m,_)),lS(s),x}function lS(s){D.H=Yu;var a=sn!==null&&sn.next!==null;if(no=0,qn=sn=gt=null,xf=!1,qu=0,uc=null,a)throw Error(r(300));s===null||Kn||(s=s.dependencies,s!==null&&hf(s)&&(Kn=!0))}function cS(s,a,u,m){gt=s;var _=0;do{if(cc&&(uc=null),qu=0,cc=!1,25<=_)throw Error(r(301));if(_+=1,qn=sn=null,s.updateQueue!=null){var x=s.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}D.H=WS,x=a(u,m)}while(cc);return x}function F3(){var s=D.H,a=s.useState()[0];return a=typeof a.then=="function"?Ku(a):a,s=s.useState()[0],(sn!==null?sn.memoizedState:null)!==s&&(gt.flags|=1024),a}function Ov(){var s=wf!==0;return wf=0,s}function Lv(s,a,u){a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~u}function zv(s){if(xf){for(s=s.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}xf=!1}no=0,qn=sn=gt=null,cc=!1,qu=wf=0,uc=null}function Br(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qn===null?gt.memoizedState=qn=s:qn=qn.next=s,qn}function Fn(){if(sn===null){var s=gt.alternate;s=s!==null?s.memoizedState:null}else s=sn.next;var a=qn===null?gt.memoizedState:qn.next;if(a!==null)qn=a,sn=s;else{if(s===null)throw gt.alternate===null?Error(r(467)):Error(r(310));sn=s,s={memoizedState:sn.memoizedState,baseState:sn.baseState,baseQueue:sn.baseQueue,queue:sn.queue,next:null},qn===null?gt.memoizedState=qn=s:qn=qn.next=s}return qn}function Sf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ku(s){var a=qu;return qu+=1,uc===null&&(uc=[]),s=J1(uc,s,a),a=gt,(qn===null?a.memoizedState:qn.next)===null&&(a=a.alternate,D.H=a===null||a.memoizedState===null?VS:Gv),s}function Cf(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Ku(s);if(s.$$typeof===E)return Er(s)}throw Error(r(438,String(s)))}function Pv(s){var a=null,u=gt.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var m=gt.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}),u===null&&(u=Sf(),gt.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(s),m=0;m<s;m++)u[m]=I;return a.index++,u}function ro(s,a){return typeof a=="function"?a(s):a}function kf(s){var a=Fn();return Iv(a,sn,s)}function Iv(s,a,u){var m=s.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=u;var _=s.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=s.baseState,_===null)s.memoizedState=x;else{a=_.next;var P=T=null,Q=null,le=a,ve=!1;do{var _e=le.lane&-536870913;if(_e!==le.lane?(Lt&_e)===_e:(no&_e)===_e){var ce=le.revertLane;if(ce===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),_e===ic&&(ve=!0);else if((no&ce)===ce){le=le.next,ce===ic&&(ve=!0);continue}else _e={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Q===null?(P=Q=_e,T=x):Q=Q.next=_e,gt.lanes|=ce,Qo|=ce;_e=le.action,Ja&&u(x,_e),x=le.hasEagerState?le.eagerState:u(x,_e)}else ce={lane:_e,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Q===null?(P=Q=ce,T=x):Q=Q.next=ce,gt.lanes|=_e,Qo|=_e;le=le.next}while(le!==null&&le!==a);if(Q===null?T=x:Q.next=P,!ci(x,s.memoizedState)&&(Kn=!0,ve&&(u=sc,u!==null)))throw u;s.memoizedState=x,s.baseState=T,s.baseQueue=Q,m.lastRenderedState=x}return _===null&&(m.lanes=0),[s.memoizedState,m.dispatch]}function Bv(s){var a=Fn(),u=a.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var m=u.dispatch,_=u.pending,x=a.memoizedState;if(_!==null){u.pending=null;var T=_=_.next;do x=s(x,T.action),T=T.next;while(T!==_);ci(x,a.memoizedState)||(Kn=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),u.lastRenderedState=x}return[x,m]}function uS(s,a,u){var m=gt,_=Fn(),x=Pt;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=a();var T=!ci((sn||_).memoizedState,u);if(T&&(_.memoizedState=u,Kn=!0),_=_.queue,$v(fS.bind(null,m,_,s),[s]),_.getSnapshot!==a||T||qn!==null&&qn.memoizedState.tag&1){if(m.flags|=2048,dc(9,{destroy:void 0},hS.bind(null,m,_,u,a),null),pn===null)throw Error(r(349));x||(no&127)!==0||dS(m,a,u)}return u}function dS(s,a,u){s.flags|=16384,s={getSnapshot:a,value:u},a=gt.updateQueue,a===null?(a=Sf(),gt.updateQueue=a,a.stores=[s]):(u=a.stores,u===null?a.stores=[s]:u.push(s))}function hS(s,a,u,m){a.value=u,a.getSnapshot=m,mS(a)&&pS(s)}function fS(s,a,u){return u(function(){mS(a)&&pS(s)})}function mS(s){var a=s.getSnapshot;s=s.value;try{var u=a();return!ci(s,u)}catch{return!0}}function pS(s){var a=Va(s,2);a!==null&&ei(a,s,2)}function Fv(s){var a=Br();if(typeof s=="function"){var u=s;if(s=u(),Ja){lt(!0);try{u()}finally{lt(!1)}}}return a.memoizedState=a.baseState=s,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:s},a}function gS(s,a,u,m){return s.baseState=u,Iv(s,sn,typeof m=="function"?m:ro)}function H3(s,a,u,m,_){if(Tf(s))throw Error(r(485));if(s=a.action,s!==null){var x={payload:_,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){x.listeners.push(T)}};D.T!==null?u(!0):x.isTransition=!1,m(x),u=a.pending,u===null?(x.next=a.pending=x,vS(a,x)):(x.next=u.next,a.pending=u.next=x)}}function vS(s,a){var u=a.action,m=a.payload,_=s.state;if(a.isTransition){var x=D.T,T={};D.T=T;try{var P=u(_,m),Q=D.S;Q!==null&&Q(T,P),bS(s,a,P)}catch(le){Hv(s,a,le)}finally{x!==null&&T.types!==null&&(x.types=T.types),D.T=x}}else try{x=u(_,m),bS(s,a,x)}catch(le){Hv(s,a,le)}}function bS(s,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){_S(s,a,m)},function(m){return Hv(s,a,m)}):_S(s,a,u)}function _S(s,a,u){a.status="fulfilled",a.value=u,yS(a),s.state=u,a=s.pending,a!==null&&(u=a.next,u===a?s.pending=null:(u=u.next,a.next=u,vS(s,u)))}function Hv(s,a,u){var m=s.pending;if(s.pending=null,m!==null){m=m.next;do a.status="rejected",a.reason=u,yS(a),a=a.next;while(a!==m)}s.action=null}function yS(s){s=s.listeners;for(var a=0;a<s.length;a++)(0,s[a])()}function xS(s,a){return a}function wS(s,a){if(Pt){var u=pn.formState;if(u!==null){e:{var m=gt;if(Pt){if(Sn){t:{for(var _=Sn,x=Ai;_.nodeType!==8;){if(!x){_=null;break t}if(_=Oi(_.nextSibling),_===null){_=null;break t}}x=_.data,_=x==="F!"||x==="F"?_:null}if(_){Sn=Oi(_.nextSibling),m=_.data==="F!";break e}}Uo(m)}m=!1}m&&(a=u[0])}}return u=Br(),u.memoizedState=u.baseState=a,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xS,lastRenderedState:a},u.queue=m,u=HS.bind(null,gt,m),m.dispatch=u,m=Fv(!1),x=Kv.bind(null,gt,!1,m.queue),m=Br(),_={state:a,dispatch:null,action:s,pending:null},m.queue=_,u=H3.bind(null,gt,_,x,u),_.dispatch=u,m.memoizedState=s,[a,u,!1]}function SS(s){var a=Fn();return CS(a,sn,s)}function CS(s,a,u){if(a=Iv(s,a,xS)[0],s=kf(ro)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var m=Ku(a)}catch(T){throw T===oc?pf:T}else m=a;a=Fn();var _=a.queue,x=_.dispatch;return u!==a.memoizedState&&(gt.flags|=2048,dc(9,{destroy:void 0},$3.bind(null,_,u),null)),[m,x,s]}function $3(s,a){s.action=a}function kS(s){var a=Fn(),u=sn;if(u!==null)return CS(a,u,s);Fn(),a=a.memoizedState,u=Fn();var m=u.queue.dispatch;return u.memoizedState=s,[a,m,!1]}function dc(s,a,u,m){return s={tag:s,create:u,deps:m,inst:a,next:null},a=gt.updateQueue,a===null&&(a=Sf(),gt.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=s.next=s:(m=u.next,u.next=s,s.next=m,a.lastEffect=s),s}function ES(){return Fn().memoizedState}function Ef(s,a,u,m){var _=Br();gt.flags|=s,_.memoizedState=dc(1|a,{destroy:void 0},u,m===void 0?null:m)}function Rf(s,a,u,m){var _=Fn();m=m===void 0?null:m;var x=_.memoizedState.inst;sn!==null&&m!==null&&Av(m,sn.memoizedState.deps)?_.memoizedState=dc(a,x,u,m):(gt.flags|=s,_.memoizedState=dc(1|a,x,u,m))}function RS(s,a){Ef(8390656,8,s,a)}function $v(s,a){Rf(2048,8,s,a)}function U3(s){gt.flags|=4;var a=gt.updateQueue;if(a===null)a=Sf(),gt.updateQueue=a,a.events=[s];else{var u=a.events;u===null?a.events=[s]:u.push(s)}}function TS(s){var a=Fn().memoizedState;return U3({ref:a,nextImpl:s}),function(){if((Yt&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function NS(s,a){return Rf(4,2,s,a)}function MS(s,a){return Rf(4,4,s,a)}function jS(s,a){if(typeof a=="function"){s=s();var u=a(s);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function AS(s,a,u){u=u!=null?u.concat([s]):null,Rf(4,4,jS.bind(null,a,s),u)}function Uv(){}function DS(s,a){var u=Fn();a=a===void 0?null:a;var m=u.memoizedState;return a!==null&&Av(a,m[1])?m[0]:(u.memoizedState=[s,a],s)}function OS(s,a){var u=Fn();a=a===void 0?null:a;var m=u.memoizedState;if(a!==null&&Av(a,m[1]))return m[0];if(m=s(),Ja){lt(!0);try{s()}finally{lt(!1)}}return u.memoizedState=[m,a],m}function Vv(s,a,u){return u===void 0||(no&1073741824)!==0&&(Lt&261930)===0?s.memoizedState=a:(s.memoizedState=u,s=LC(),gt.lanes|=s,Qo|=s,u)}function LS(s,a,u,m){return ci(u,a)?u:lc.current!==null?(s=Vv(s,u,m),ci(s,a)||(Kn=!0),s):(no&42)===0||(no&1073741824)!==0&&(Lt&261930)===0?(Kn=!0,s.memoizedState=u):(s=LC(),gt.lanes|=s,Qo|=s,a)}function zS(s,a,u,m,_){var x=U.p;U.p=x!==0&&8>x?x:8;var T=D.T,P={};D.T=P,Kv(s,!1,a,u);try{var Q=_(),le=D.S;if(le!==null&&le(P,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var ve=I3(Q,m);Gu(s,a,ve,pi(s))}else Gu(s,a,m,pi(s))}catch(_e){Gu(s,a,{then:function(){},status:"rejected",reason:_e},pi())}finally{U.p=x,T!==null&&P.types!==null&&(T.types=P.types),D.T=T}}function V3(){}function Wv(s,a,u,m){if(s.tag!==5)throw Error(r(476));var _=PS(s).queue;zS(s,_,a,z,u===null?V3:function(){return IS(s),u(m)})}function PS(s){var a=s.memoizedState;if(a!==null)return a;a={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:z},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:u},next:null},s.memoizedState=a,s=s.alternate,s!==null&&(s.memoizedState=a),a}function IS(s){var a=PS(s);a.next===null&&(a=s.alternate.memoizedState),Gu(s,a.next.queue,{},pi())}function qv(){return Er(dd)}function BS(){return Fn().memoizedState}function FS(){return Fn().memoizedState}function W3(s){for(var a=s.return;a!==null;){switch(a.tag){case 24:case 3:var u=pi();s=qo(u);var m=Ko(a,s,u);m!==null&&(ei(m,a,u),Uu(m,a,u)),a={cache:xv()},s.payload=a;return}a=a.return}}function q3(s,a,u){var m=pi();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Tf(s)?$S(a,u):(u=uv(s,a,u,m),u!==null&&(ei(u,s,m),US(u,a,m)))}function HS(s,a,u){var m=pi();Gu(s,a,u,m)}function Gu(s,a,u,m){var _={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Tf(s))$S(a,_);else{var x=s.alternate;if(s.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var T=a.lastRenderedState,P=x(T,u);if(_.hasEagerState=!0,_.eagerState=P,ci(P,T))return lf(s,a,_,0),pn===null&&af(),!1}catch{}finally{}if(u=uv(s,a,_,m),u!==null)return ei(u,s,m),US(u,a,m),!0}return!1}function Kv(s,a,u,m){if(m={lane:2,revertLane:kb(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Tf(s)){if(a)throw Error(r(479))}else a=uv(s,u,m,2),a!==null&&ei(a,s,2)}function Tf(s){var a=s.alternate;return s===gt||a!==null&&a===gt}function $S(s,a){cc=xf=!0;var u=s.pending;u===null?a.next=a:(a.next=u.next,u.next=a),s.pending=a}function US(s,a,u){if((u&4194048)!==0){var m=a.lanes;m&=s.pendingLanes,u|=m,a.lanes=u,Te(s,u)}}var Yu={readContext:Er,use:Cf,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useLayoutEffect:Dn,useInsertionEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useSyncExternalStore:Dn,useId:Dn,useHostTransitionStatus:Dn,useFormState:Dn,useActionState:Dn,useOptimistic:Dn,useMemoCache:Dn,useCacheRefresh:Dn};Yu.useEffectEvent=Dn;var VS={readContext:Er,use:Cf,useCallback:function(s,a){return Br().memoizedState=[s,a===void 0?null:a],s},useContext:Er,useEffect:RS,useImperativeHandle:function(s,a,u){u=u!=null?u.concat([s]):null,Ef(4194308,4,jS.bind(null,a,s),u)},useLayoutEffect:function(s,a){return Ef(4194308,4,s,a)},useInsertionEffect:function(s,a){Ef(4,2,s,a)},useMemo:function(s,a){var u=Br();a=a===void 0?null:a;var m=s();if(Ja){lt(!0);try{s()}finally{lt(!1)}}return u.memoizedState=[m,a],m},useReducer:function(s,a,u){var m=Br();if(u!==void 0){var _=u(a);if(Ja){lt(!0);try{u(a)}finally{lt(!1)}}}else _=a;return m.memoizedState=m.baseState=_,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:_},m.queue=s,s=s.dispatch=q3.bind(null,gt,s),[m.memoizedState,s]},useRef:function(s){var a=Br();return s={current:s},a.memoizedState=s},useState:function(s){s=Fv(s);var a=s.queue,u=HS.bind(null,gt,a);return a.dispatch=u,[s.memoizedState,u]},useDebugValue:Uv,useDeferredValue:function(s,a){var u=Br();return Vv(u,s,a)},useTransition:function(){var s=Fv(!1);return s=zS.bind(null,gt,s.queue,!0,!1),Br().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,a,u){var m=gt,_=Br();if(Pt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=a(),pn===null)throw Error(r(349));(Lt&127)!==0||dS(m,a,u)}_.memoizedState=u;var x={value:u,getSnapshot:a};return _.queue=x,RS(fS.bind(null,m,x,s),[s]),m.flags|=2048,dc(9,{destroy:void 0},hS.bind(null,m,x,u,a),null),u},useId:function(){var s=Br(),a=pn.identifierPrefix;if(Pt){var u=_s,m=bs;u=(m&~(1<<32-Fe(m)-1)).toString(32)+u,a="_"+a+"R_"+u,u=wf++,0<u&&(a+="H"+u.toString(32)),a+="_"}else u=B3++,a="_"+a+"r_"+u.toString(32)+"_";return s.memoizedState=a},useHostTransitionStatus:qv,useFormState:wS,useActionState:wS,useOptimistic:function(s){var a=Br();a.memoizedState=a.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=Kv.bind(null,gt,!0,u),u.dispatch=a,[s,a]},useMemoCache:Pv,useCacheRefresh:function(){return Br().memoizedState=W3.bind(null,gt)},useEffectEvent:function(s){var a=Br(),u={impl:s};return a.memoizedState=u,function(){if((Yt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Gv={readContext:Er,use:Cf,useCallback:DS,useContext:Er,useEffect:$v,useImperativeHandle:AS,useInsertionEffect:NS,useLayoutEffect:MS,useMemo:OS,useReducer:kf,useRef:ES,useState:function(){return kf(ro)},useDebugValue:Uv,useDeferredValue:function(s,a){var u=Fn();return LS(u,sn.memoizedState,s,a)},useTransition:function(){var s=kf(ro)[0],a=Fn().memoizedState;return[typeof s=="boolean"?s:Ku(s),a]},useSyncExternalStore:uS,useId:BS,useHostTransitionStatus:qv,useFormState:SS,useActionState:SS,useOptimistic:function(s,a){var u=Fn();return gS(u,sn,s,a)},useMemoCache:Pv,useCacheRefresh:FS};Gv.useEffectEvent=TS;var WS={readContext:Er,use:Cf,useCallback:DS,useContext:Er,useEffect:$v,useImperativeHandle:AS,useInsertionEffect:NS,useLayoutEffect:MS,useMemo:OS,useReducer:Bv,useRef:ES,useState:function(){return Bv(ro)},useDebugValue:Uv,useDeferredValue:function(s,a){var u=Fn();return sn===null?Vv(u,s,a):LS(u,sn.memoizedState,s,a)},useTransition:function(){var s=Bv(ro)[0],a=Fn().memoizedState;return[typeof s=="boolean"?s:Ku(s),a]},useSyncExternalStore:uS,useId:BS,useHostTransitionStatus:qv,useFormState:kS,useActionState:kS,useOptimistic:function(s,a){var u=Fn();return sn!==null?gS(u,sn,s,a):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Pv,useCacheRefresh:FS};WS.useEffectEvent=TS;function Yv(s,a,u,m){a=s.memoizedState,u=u(m,a),u=u==null?a:p({},a,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var Xv={enqueueSetState:function(s,a,u){s=s._reactInternals;var m=pi(),_=qo(m);_.payload=a,u!=null&&(_.callback=u),a=Ko(s,_,m),a!==null&&(ei(a,s,m),Uu(a,s,m))},enqueueReplaceState:function(s,a,u){s=s._reactInternals;var m=pi(),_=qo(m);_.tag=1,_.payload=a,u!=null&&(_.callback=u),a=Ko(s,_,m),a!==null&&(ei(a,s,m),Uu(a,s,m))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var u=pi(),m=qo(u);m.tag=2,a!=null&&(m.callback=a),a=Ko(s,m,u),a!==null&&(ei(a,s,u),Uu(a,s,u))}};function qS(s,a,u,m,_,x,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,x,T):a.prototype&&a.prototype.isPureReactComponent?!Lu(u,m)||!Lu(_,x):!0}function KS(s,a,u,m){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,m),a.state!==s&&Xv.enqueueReplaceState(a,a.state,null)}function el(s,a){var u=a;if("ref"in a){u={};for(var m in a)m!=="ref"&&(u[m]=a[m])}if(s=s.defaultProps){u===a&&(u=p({},u));for(var _ in s)u[_]===void 0&&(u[_]=s[_])}return u}function GS(s){of(s)}function YS(s){console.error(s)}function XS(s){of(s)}function Nf(s,a){try{var u=s.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(m){setTimeout(function(){throw m})}}function ZS(s,a,u){try{var m=s.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Zv(s,a,u){return u=qo(u),u.tag=3,u.payload={element:null},u.callback=function(){Nf(s,a)},u}function QS(s){return s=qo(s),s.tag=3,s}function JS(s,a,u,m){var _=u.type.getDerivedStateFromError;if(typeof _=="function"){var x=m.value;s.payload=function(){return _(x)},s.callback=function(){ZS(a,u,m)}}var T=u.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(s.callback=function(){ZS(a,u,m),typeof _!="function"&&(Jo===null?Jo=new Set([this]):Jo.add(this));var P=m.stack;this.componentDidCatch(m.value,{componentStack:P!==null?P:""})})}function K3(s,a,u,m,_){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(a=u.alternate,a!==null&&rc(a,u,_,!0),u=di.current,u!==null){switch(u.tag){case 31:case 13:return Di===null?Hf():u.alternate===null&&On===0&&(On=3),u.flags&=-257,u.flags|=65536,u.lanes=_,m===gf?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([m]):a.add(m),wb(s,m,_)),!1;case 22:return u.flags|=65536,m===gf?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([m]):u.add(m)),wb(s,m,_)),!1}throw Error(r(435,u.tag))}return wb(s,m,_),Hf(),!1}if(Pt)return a=di.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=_,m!==gv&&(s=Error(r(422),{cause:m}),Iu(Ni(s,u)))):(m!==gv&&(a=Error(r(423),{cause:m}),Iu(Ni(a,u))),s=s.current.alternate,s.flags|=65536,_&=-_,s.lanes|=_,m=Ni(m,u),_=Zv(s.stateNode,m,_),Rv(s,_),On!==4&&(On=2)),!1;var x=Error(r(520),{cause:m});if(x=Ni(x,u),rd===null?rd=[x]:rd.push(x),On!==4&&(On=2),a===null)return!0;m=Ni(m,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,s=_&-_,u.lanes|=s,s=Zv(u.stateNode,m,s),Rv(u,s),!1;case 1:if(a=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Jo===null||!Jo.has(x))))return u.flags|=65536,_&=-_,u.lanes|=_,_=QS(_),JS(_,s,u,m),Rv(u,_),!1}u=u.return}while(u!==null);return!1}var Qv=Error(r(461)),Kn=!1;function Rr(s,a,u,m){a.child=s===null?rS(a,null,u,m):Qa(a,s.child,u,m)}function eC(s,a,u,m,_){u=u.render;var x=a.ref;if("ref"in m){var T={};for(var P in m)P!=="ref"&&(T[P]=m[P])}else T=m;return Ga(a),m=Dv(s,a,u,T,x,_),P=Ov(),s!==null&&!Kn?(Lv(s,a,_),io(s,a,_)):(Pt&&P&&mv(a),a.flags|=1,Rr(s,a,m,_),a.child)}function tC(s,a,u,m,_){if(s===null){var x=u.type;return typeof x=="function"&&!dv(x)&&x.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=x,nC(s,a,x,m,_)):(s=uf(u.type,null,m,a,a.mode,_),s.ref=a.ref,s.return=a,a.child=s)}if(x=s.child,!ob(s,_)){var T=x.memoizedProps;if(u=u.compare,u=u!==null?u:Lu,u(T,m)&&s.ref===a.ref)return io(s,a,_)}return a.flags|=1,s=Qs(x,m),s.ref=a.ref,s.return=a,a.child=s}function nC(s,a,u,m,_){if(s!==null){var x=s.memoizedProps;if(Lu(x,m)&&s.ref===a.ref)if(Kn=!1,a.pendingProps=m=x,ob(s,_))(s.flags&131072)!==0&&(Kn=!0);else return a.lanes=s.lanes,io(s,a,_)}return Jv(s,a,u,m,_)}function rC(s,a,u,m){var _=m.children,x=s!==null?s.memoizedState:null;if(s===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|u:u,s!==null){for(m=a.child=s.child,_=0;m!==null;)_=_|m.lanes|m.childLanes,m=m.sibling;m=_&~x}else m=0,a.child=null;return iC(s,a,x,u,m)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},s!==null&&mf(a,x!==null?x.cachePool:null),x!==null?oS(a,x):Nv(),aS(a);else return m=a.lanes=536870912,iC(s,a,x!==null?x.baseLanes|u:u,u,m)}else x!==null?(mf(a,x.cachePool),oS(a,x),Yo(),a.memoizedState=null):(s!==null&&mf(a,null),Nv(),Yo());return Rr(s,a,_,u),a.child}function Xu(s,a){return s!==null&&s.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function iC(s,a,u,m,_){var x=Sv();return x=x===null?null:{parent:Wn._currentValue,pool:x},a.memoizedState={baseLanes:u,cachePool:x},s!==null&&mf(a,null),Nv(),aS(a),s!==null&&rc(s,a,m,!0),a.childLanes=_,null}function Mf(s,a){return a=Af({mode:a.mode,children:a.children},s.mode),a.ref=s.ref,s.child=a,a.return=s,a}function sC(s,a,u){return Qa(a,s.child,null,u),s=Mf(a,a.pendingProps),s.flags|=2,hi(a),a.memoizedState=null,s}function G3(s,a,u){var m=a.pendingProps,_=(a.flags&128)!==0;if(a.flags&=-129,s===null){if(Pt){if(m.mode==="hidden")return s=Mf(a,m),a.lanes=536870912,Xu(null,s);if(jv(a),(s=Sn)?(s=vk(s,Ai),s=s!==null&&s.data==="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:Ho!==null?{id:bs,overflow:_s}:null,retryLane:536870912,hydrationErrors:null},u=$1(s),u.return=a,a.child=u,kr=a,Sn=null)):s=null,s===null)throw Uo(a);return a.lanes=536870912,null}return Mf(a,m)}var x=s.memoizedState;if(x!==null){var T=x.dehydrated;if(jv(a),_)if(a.flags&256)a.flags&=-257,a=sC(s,a,u);else if(a.memoizedState!==null)a.child=s.child,a.flags|=128,a=null;else throw Error(r(558));else if(Kn||rc(s,a,u,!1),_=(u&s.childLanes)!==0,Kn||_){if(m=pn,m!==null&&(T=Le(m,u),T!==0&&T!==x.retryLane))throw x.retryLane=T,Va(s,T),ei(m,s,T),Qv;Hf(),a=sC(s,a,u)}else s=x.treeContext,Sn=Oi(T.nextSibling),kr=a,Pt=!0,$o=null,Ai=!1,s!==null&&W1(a,s),a=Mf(a,m),a.flags|=4096;return a}return s=Qs(s.child,{mode:m.mode,children:m.children}),s.ref=a.ref,a.child=s,s.return=a,s}function jf(s,a){var u=a.ref;if(u===null)s!==null&&s.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(s===null||s.ref!==u)&&(a.flags|=4194816)}}function Jv(s,a,u,m,_){return Ga(a),u=Dv(s,a,u,m,void 0,_),m=Ov(),s!==null&&!Kn?(Lv(s,a,_),io(s,a,_)):(Pt&&m&&mv(a),a.flags|=1,Rr(s,a,u,_),a.child)}function oC(s,a,u,m,_,x){return Ga(a),a.updateQueue=null,u=cS(a,m,u,_),lS(s),m=Ov(),s!==null&&!Kn?(Lv(s,a,x),io(s,a,x)):(Pt&&m&&mv(a),a.flags|=1,Rr(s,a,u,x),a.child)}function aC(s,a,u,m,_){if(Ga(a),a.stateNode===null){var x=Jl,T=u.contextType;typeof T=="object"&&T!==null&&(x=Er(T)),x=new u(m,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Xv,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=m,x.state=a.memoizedState,x.refs={},kv(a),T=u.contextType,x.context=typeof T=="object"&&T!==null?Er(T):Jl,x.state=a.memoizedState,T=u.getDerivedStateFromProps,typeof T=="function"&&(Yv(a,u,T,m),x.state=a.memoizedState),typeof u.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&&Xv.enqueueReplaceState(x,x.state,null),Wu(a,m,x,_),Vu(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),m=!0}else if(s===null){x=a.stateNode;var P=a.memoizedProps,Q=el(u,P);x.props=Q;var le=x.context,ve=u.contextType;T=Jl,typeof ve=="object"&&ve!==null&&(T=Er(ve));var _e=u.getDerivedStateFromProps;ve=typeof _e=="function"||typeof x.getSnapshotBeforeUpdate=="function",P=a.pendingProps!==P,ve||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(P||le!==T)&&KS(a,x,m,T),Wo=!1;var ce=a.memoizedState;x.state=ce,Wu(a,m,x,_),Vu(),le=a.memoizedState,P||ce!==le||Wo?(typeof _e=="function"&&(Yv(a,u,_e,m),le=a.memoizedState),(Q=Wo||qS(a,u,Q,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=Q):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{x=a.stateNode,Ev(s,a),T=a.memoizedProps,ve=el(u,T),x.props=ve,_e=a.pendingProps,ce=x.context,le=u.contextType,Q=Jl,typeof le=="object"&&le!==null&&(Q=Er(le)),P=u.getDerivedStateFromProps,(le=typeof P=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T!==_e||ce!==Q)&&KS(a,x,m,Q),Wo=!1,ce=a.memoizedState,x.state=ce,Wu(a,m,x,_),Vu();var he=a.memoizedState;T!==_e||ce!==he||Wo||s!==null&&s.dependencies!==null&&hf(s.dependencies)?(typeof P=="function"&&(Yv(a,u,P,m),he=a.memoizedState),(ve=Wo||qS(a,u,ve,m,ce,he,Q)||s!==null&&s.dependencies!==null&&hf(s.dependencies))?(le||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(m,he,Q),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(m,he,Q)),typeof x.componentDidUpdate=="function"&&(a.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof x.componentDidUpdate!="function"||T===s.memoizedProps&&ce===s.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&ce===s.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=he),x.props=m,x.state=he,x.context=Q,m=ve):(typeof x.componentDidUpdate!="function"||T===s.memoizedProps&&ce===s.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&ce===s.memoizedState||(a.flags|=1024),m=!1)}return x=m,jf(s,a),m=(a.flags&128)!==0,x||m?(x=a.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,s!==null&&m?(a.child=Qa(a,s.child,null,_),a.child=Qa(a,null,u,_)):Rr(s,a,u,_),a.memoizedState=x.state,s=a.child):s=io(s,a,_),s}function lC(s,a,u,m){return qa(),a.flags|=256,Rr(s,a,u,m),a.child}var eb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tb(s){return{baseLanes:s,cachePool:Z1()}}function nb(s,a,u){return s=s!==null?s.childLanes&~u:0,a&&(s|=mi),s}function cC(s,a,u){var m=a.pendingProps,_=!1,x=(a.flags&128)!==0,T;if((T=x)||(T=s!==null&&s.memoizedState===null?!1:(Bn.current&2)!==0),T&&(_=!0,a.flags&=-129),T=(a.flags&32)!==0,a.flags&=-33,s===null){if(Pt){if(_?Go(a):Yo(),(s=Sn)?(s=vk(s,Ai),s=s!==null&&s.data!=="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:Ho!==null?{id:bs,overflow:_s}:null,retryLane:536870912,hydrationErrors:null},u=$1(s),u.return=a,a.child=u,kr=a,Sn=null)):s=null,s===null)throw Uo(a);return Ib(s)?a.lanes=32:a.lanes=536870912,null}var P=m.children;return m=m.fallback,_?(Yo(),_=a.mode,P=Af({mode:"hidden",children:P},_),m=Wa(m,_,u,null),P.return=a,m.return=a,P.sibling=m,a.child=P,m=a.child,m.memoizedState=tb(u),m.childLanes=nb(s,T,u),a.memoizedState=eb,Xu(null,m)):(Go(a),rb(a,P))}var Q=s.memoizedState;if(Q!==null&&(P=Q.dehydrated,P!==null)){if(x)a.flags&256?(Go(a),a.flags&=-257,a=ib(s,a,u)):a.memoizedState!==null?(Yo(),a.child=s.child,a.flags|=128,a=null):(Yo(),P=m.fallback,_=a.mode,m=Af({mode:"visible",children:m.children},_),P=Wa(P,_,u,null),P.flags|=2,m.return=a,P.return=a,m.sibling=P,a.child=m,Qa(a,s.child,null,u),m=a.child,m.memoizedState=tb(u),m.childLanes=nb(s,T,u),a.memoizedState=eb,a=Xu(null,m));else if(Go(a),Ib(P)){if(T=P.nextSibling&&P.nextSibling.dataset,T)var le=T.dgst;T=le,m=Error(r(419)),m.stack="",m.digest=T,Iu({value:m,source:null,stack:null}),a=ib(s,a,u)}else if(Kn||rc(s,a,u,!1),T=(u&s.childLanes)!==0,Kn||T){if(T=pn,T!==null&&(m=Le(T,u),m!==0&&m!==Q.retryLane))throw Q.retryLane=m,Va(s,m),ei(T,s,m),Qv;Pb(P)||Hf(),a=ib(s,a,u)}else Pb(P)?(a.flags|=192,a.child=s.child,a=null):(s=Q.treeContext,Sn=Oi(P.nextSibling),kr=a,Pt=!0,$o=null,Ai=!1,s!==null&&W1(a,s),a=rb(a,m.children),a.flags|=4096);return a}return _?(Yo(),P=m.fallback,_=a.mode,Q=s.child,le=Q.sibling,m=Qs(Q,{mode:"hidden",children:m.children}),m.subtreeFlags=Q.subtreeFlags&65011712,le!==null?P=Qs(le,P):(P=Wa(P,_,u,null),P.flags|=2),P.return=a,m.return=a,m.sibling=P,a.child=m,Xu(null,m),m=a.child,P=s.child.memoizedState,P===null?P=tb(u):(_=P.cachePool,_!==null?(Q=Wn._currentValue,_=_.parent!==Q?{parent:Q,pool:Q}:_):_=Z1(),P={baseLanes:P.baseLanes|u,cachePool:_}),m.memoizedState=P,m.childLanes=nb(s,T,u),a.memoizedState=eb,Xu(s.child,m)):(Go(a),u=s.child,s=u.sibling,u=Qs(u,{mode:"visible",children:m.children}),u.return=a,u.sibling=null,s!==null&&(T=a.deletions,T===null?(a.deletions=[s],a.flags|=16):T.push(s)),a.child=u,a.memoizedState=null,u)}function rb(s,a){return a=Af({mode:"visible",children:a},s.mode),a.return=s,s.child=a}function Af(s,a){return s=ui(22,s,null,a),s.lanes=0,s}function ib(s,a,u){return Qa(a,s.child,null,u),s=rb(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function uC(s,a,u){s.lanes|=a;var m=s.alternate;m!==null&&(m.lanes|=a),_v(s.return,a,u)}function sb(s,a,u,m,_,x){var T=s.memoizedState;T===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:_,treeForkCount:x}:(T.isBackwards=a,T.rendering=null,T.renderingStartTime=0,T.last=m,T.tail=u,T.tailMode=_,T.treeForkCount=x)}function dC(s,a,u){var m=a.pendingProps,_=m.revealOrder,x=m.tail;m=m.children;var T=Bn.current,P=(T&2)!==0;if(P?(T=T&1|2,a.flags|=128):T&=1,j(Bn,T),Rr(s,a,m,u),m=Pt?Pu:0,!P&&s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&uC(s,u,a);else if(s.tag===19)uC(s,u,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(_){case"forwards":for(u=a.child,_=null;u!==null;)s=u.alternate,s!==null&&yf(s)===null&&(_=u),u=u.sibling;u=_,u===null?(_=a.child,a.child=null):(_=u.sibling,u.sibling=null),sb(a,!1,_,u,x,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,_=a.child,a.child=null;_!==null;){if(s=_.alternate,s!==null&&yf(s)===null){a.child=_;break}s=_.sibling,_.sibling=u,u=_,_=s}sb(a,!0,u,null,x,m);break;case"together":sb(a,!1,null,null,void 0,m);break;default:a.memoizedState=null}return a.child}function io(s,a,u){if(s!==null&&(a.dependencies=s.dependencies),Qo|=a.lanes,(u&a.childLanes)===0)if(s!==null){if(rc(s,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(s!==null&&a.child!==s.child)throw Error(r(153));if(a.child!==null){for(s=a.child,u=Qs(s,s.pendingProps),a.child=u,u.return=a;s.sibling!==null;)s=s.sibling,u=u.sibling=Qs(s,s.pendingProps),u.return=a;u.sibling=null}return a.child}function ob(s,a){return(s.lanes&a)!==0?!0:(s=s.dependencies,!!(s!==null&&hf(s)))}function Y3(s,a,u){switch(a.tag){case 3:ue(a,a.stateNode.containerInfo),Vo(a,Wn,s.memoizedState.cache),qa();break;case 27:case 5:ge(a);break;case 4:ue(a,a.stateNode.containerInfo);break;case 10:Vo(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,jv(a),null;break;case 13:var m=a.memoizedState;if(m!==null)return m.dehydrated!==null?(Go(a),a.flags|=128,null):(u&a.child.childLanes)!==0?cC(s,a,u):(Go(a),s=io(s,a,u),s!==null?s.sibling:null);Go(a);break;case 19:var _=(s.flags&128)!==0;if(m=(u&a.childLanes)!==0,m||(rc(s,a,u,!1),m=(u&a.childLanes)!==0),_){if(m)return dC(s,a,u);a.flags|=128}if(_=a.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),j(Bn,Bn.current),m)break;return null;case 22:return a.lanes=0,rC(s,a,u,a.pendingProps);case 24:Vo(a,Wn,s.memoizedState.cache)}return io(s,a,u)}function hC(s,a,u){if(s!==null)if(s.memoizedProps!==a.pendingProps)Kn=!0;else{if(!ob(s,u)&&(a.flags&128)===0)return Kn=!1,Y3(s,a,u);Kn=(s.flags&131072)!==0}else Kn=!1,Pt&&(a.flags&1048576)!==0&&V1(a,Pu,a.index);switch(a.lanes=0,a.tag){case 16:e:{var m=a.pendingProps;if(s=Xa(a.elementType),a.type=s,typeof s=="function")dv(s)?(m=el(s,m),a.tag=1,a=aC(null,a,s,m,u)):(a.tag=0,a=Jv(null,a,s,m,u));else{if(s!=null){var _=s.$$typeof;if(_===N){a.tag=11,a=eC(null,a,s,m,u);break e}else if(_===O){a.tag=14,a=tC(null,a,s,m,u);break e}}throw a=W(s)||s,Error(r(306,a,""))}}return a;case 0:return Jv(s,a,a.type,a.pendingProps,u);case 1:return m=a.type,_=el(m,a.pendingProps),aC(s,a,m,_,u);case 3:e:{if(ue(a,a.stateNode.containerInfo),s===null)throw Error(r(387));m=a.pendingProps;var x=a.memoizedState;_=x.element,Ev(s,a),Wu(a,m,null,u);var T=a.memoizedState;if(m=T.cache,Vo(a,Wn,m),m!==x.cache&&yv(a,[Wn],u,!0),Vu(),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=lC(s,a,m,u);break e}else if(m!==_){_=Ni(Error(r(424)),a),Iu(_),a=lC(s,a,m,u);break e}else{switch(s=a.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Sn=Oi(s.firstChild),kr=a,Pt=!0,$o=null,Ai=!0,u=rS(a,null,m,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(qa(),m===_){a=io(s,a,u);break e}Rr(s,a,m,u)}a=a.child}return a;case 26:return jf(s,a),s===null?(u=Sk(a.type,null,a.pendingProps,null))?a.memoizedState=u:Pt||(u=a.type,s=a.pendingProps,m=Gf(ee.current).createElement(u),m[Gt]=a,m[$t]=s,Tr(m,u,s),wn(m),a.stateNode=m):a.memoizedState=Sk(a.type,s.memoizedProps,a.pendingProps,s.memoizedState),null;case 27:return ge(a),s===null&&Pt&&(m=a.stateNode=yk(a.type,a.pendingProps,ee.current),kr=a,Ai=!0,_=Sn,ra(a.type)?(Bb=_,Sn=Oi(m.firstChild)):Sn=_),Rr(s,a,a.pendingProps.children,u),jf(s,a),s===null&&(a.flags|=4194304),a.child;case 5:return s===null&&Pt&&((_=m=Sn)&&(m=kL(m,a.type,a.pendingProps,Ai),m!==null?(a.stateNode=m,kr=a,Sn=Oi(m.firstChild),Ai=!1,_=!0):_=!1),_||Uo(a)),ge(a),_=a.type,x=a.pendingProps,T=s!==null?s.memoizedProps:null,m=x.children,Ob(_,x)?m=null:T!==null&&Ob(_,T)&&(a.flags|=32),a.memoizedState!==null&&(_=Dv(s,a,F3,null,null,u),dd._currentValue=_),jf(s,a),Rr(s,a,m,u),a.child;case 6:return s===null&&Pt&&((s=u=Sn)&&(u=EL(u,a.pendingProps,Ai),u!==null?(a.stateNode=u,kr=a,Sn=null,s=!0):s=!1),s||Uo(a)),null;case 13:return cC(s,a,u);case 4:return ue(a,a.stateNode.containerInfo),m=a.pendingProps,s===null?a.child=Qa(a,null,m,u):Rr(s,a,m,u),a.child;case 11:return eC(s,a,a.type,a.pendingProps,u);case 7:return Rr(s,a,a.pendingProps,u),a.child;case 8:return Rr(s,a,a.pendingProps.children,u),a.child;case 12:return Rr(s,a,a.pendingProps.children,u),a.child;case 10:return m=a.pendingProps,Vo(a,a.type,m.value),Rr(s,a,m.children,u),a.child;case 9:return _=a.type._context,m=a.pendingProps.children,Ga(a),_=Er(_),m=m(_),a.flags|=1,Rr(s,a,m,u),a.child;case 14:return tC(s,a,a.type,a.pendingProps,u);case 15:return nC(s,a,a.type,a.pendingProps,u);case 19:return dC(s,a,u);case 31:return G3(s,a,u);case 22:return rC(s,a,u,a.pendingProps);case 24:return Ga(a),m=Er(Wn),s===null?(_=Sv(),_===null&&(_=pn,x=xv(),_.pooledCache=x,x.refCount++,x!==null&&(_.pooledCacheLanes|=u),_=x),a.memoizedState={parent:m,cache:_},kv(a),Vo(a,Wn,_)):((s.lanes&u)!==0&&(Ev(s,a),Wu(a,null,null,u),Vu()),_=s.memoizedState,x=a.memoizedState,_.parent!==m?(_={parent:m,cache:m},a.memoizedState=_,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=_),Vo(a,Wn,m)):(m=x.cache,Vo(a,Wn,m),m!==_.cache&&yv(a,[Wn],u,!0))),Rr(s,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function so(s){s.flags|=4}function ab(s,a,u,m,_){if((a=(s.mode&32)!==0)&&(a=!1),a){if(s.flags|=16777216,(_&335544128)===_)if(s.stateNode.complete)s.flags|=8192;else if(BC())s.flags|=8192;else throw Za=gf,Cv}else s.flags&=-16777217}function fC(s,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!Tk(a))if(BC())s.flags|=8192;else throw Za=gf,Cv}function Df(s,a){a!==null&&(s.flags|=4),s.flags&16384&&(a=s.tag!==22?Et():536870912,s.lanes|=a,pc|=a)}function Zu(s,a){if(!Pt)switch(s.tailMode){case"hidden":a=s.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function Cn(s){var a=s.alternate!==null&&s.alternate.child===s.child,u=0,m=0;if(a)for(var _=s.child;_!==null;)u|=_.lanes|_.childLanes,m|=_.subtreeFlags&65011712,m|=_.flags&65011712,_.return=s,_=_.sibling;else for(_=s.child;_!==null;)u|=_.lanes|_.childLanes,m|=_.subtreeFlags,m|=_.flags,_.return=s,_=_.sibling;return s.subtreeFlags|=m,s.childLanes=u,a}function X3(s,a,u){var m=a.pendingProps;switch(pv(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 u=a.stateNode,m=null,s!==null&&(m=s.memoizedState.cache),a.memoizedState.cache!==m&&(a.flags|=2048),to(Wn),fe(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(nc(a)?so(a):s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,vv())),Cn(a),null;case 26:var _=a.type,x=a.memoizedState;return s===null?(so(a),x!==null?(Cn(a),fC(a,x)):(Cn(a),ab(a,_,null,m,u))):x?x!==s.memoizedState?(so(a),Cn(a),fC(a,x)):(Cn(a),a.flags&=-16777217):(s=s.memoizedProps,s!==m&&so(a),Cn(a),ab(a,_,s,m,u)),null;case 27:if(Ce(a),u=ee.current,_=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==m&&so(a);else{if(!m){if(a.stateNode===null)throw Error(r(166));return Cn(a),null}s=ie.current,nc(a)?q1(a):(s=yk(_,m,u),a.stateNode=s,so(a))}return Cn(a),null;case 5:if(Ce(a),_=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==m&&so(a);else{if(!m){if(a.stateNode===null)throw Error(r(166));return Cn(a),null}if(x=ie.current,nc(a))q1(a);else{var T=Gf(ee.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[Gt]=a,x[$t]=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(Tr(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&&so(a)}}return Cn(a),ab(a,a.type,s===null?null:s.memoizedProps,a.pendingProps,u),null;case 6:if(s&&a.stateNode!=null)s.memoizedProps!==m&&so(a);else{if(typeof m!="string"&&a.stateNode===null)throw Error(r(166));if(s=ee.current,nc(a)){if(s=a.stateNode,u=a.memoizedProps,m=null,_=kr,_!==null)switch(_.tag){case 27:case 5:m=_.memoizedProps}s[Gt]=a,s=!!(s.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||ck(s.nodeValue,u)),s||Uo(a,!0)}else s=Gf(s).createTextNode(m),s[Gt]=a,a.stateNode=s}return Cn(a),null;case 31:if(u=a.memoizedState,s===null||s.memoizedState!==null){if(m=nc(a),u!==null){if(s===null){if(!m)throw Error(r(318));if(s=a.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Gt]=a}else qa(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Cn(a),s=!1}else u=vv(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return a.flags&256?(hi(a),a):(hi(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Cn(a),null;case 13:if(m=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(_=nc(a),m!==null&&m.dehydrated!==null){if(s===null){if(!_)throw Error(r(318));if(_=a.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[Gt]=a}else qa(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Cn(a),_=!1}else _=vv(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=_),_=!0;if(!_)return a.flags&256?(hi(a),a):(hi(a),null)}return hi(a),(a.flags&128)!==0?(a.lanes=u,a):(u=m!==null,s=s!==null&&s.memoizedState!==null,u&&(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)),u!==s&&u&&(a.child.flags|=8192),Df(a,a.updateQueue),Cn(a),null);case 4:return fe(),s===null&&Nb(a.stateNode.containerInfo),Cn(a),null;case 10:return to(a.type),Cn(a),null;case 19:if(X(Bn),m=a.memoizedState,m===null)return Cn(a),null;if(_=(a.flags&128)!==0,x=m.rendering,x===null)if(_)Zu(m,!1);else{if(On!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(x=yf(s),x!==null){for(a.flags|=128,Zu(m,!1),s=x.updateQueue,a.updateQueue=s,Df(a,s),a.subtreeFlags=0,s=u,u=a.child;u!==null;)H1(u,s),u=u.sibling;return j(Bn,Bn.current&1|2),Pt&&Js(a,m.treeForkCount),a.child}s=s.sibling}m.tail!==null&&Nt()>If&&(a.flags|=128,_=!0,Zu(m,!1),a.lanes=4194304)}else{if(!_)if(s=yf(x),s!==null){if(a.flags|=128,_=!0,s=s.updateQueue,a.updateQueue=s,Df(a,s),Zu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!x.alternate&&!Pt)return Cn(a),null}else 2*Nt()-m.renderingStartTime>If&&u!==536870912&&(a.flags|=128,_=!0,Zu(m,!1),a.lanes=4194304);m.isBackwards?(x.sibling=a.child,a.child=x):(s=m.last,s!==null?s.sibling=x:a.child=x,m.last=x)}return m.tail!==null?(s=m.tail,m.rendering=s,m.tail=s.sibling,m.renderingStartTime=Nt(),s.sibling=null,u=Bn.current,j(Bn,_?u&1|2:u&1),Pt&&Js(a,m.treeForkCount),s):(Cn(a),null);case 22:case 23:return hi(a),Mv(),m=a.memoizedState!==null,s!==null?s.memoizedState!==null!==m&&(a.flags|=8192):m&&(a.flags|=8192),m?(u&536870912)!==0&&(a.flags&128)===0&&(Cn(a),a.subtreeFlags&6&&(a.flags|=8192)):Cn(a),u=a.updateQueue,u!==null&&Df(a,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),m=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(m=a.memoizedState.cachePool.pool),m!==u&&(a.flags|=2048),s!==null&&X(Ya),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),to(Wn),Cn(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function Z3(s,a){switch(pv(a),a.tag){case 1:return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return to(Wn),fe(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 26:case 27:case 5:return Ce(a),null;case 31:if(a.memoizedState!==null){if(hi(a),a.alternate===null)throw Error(r(340));qa()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 13:if(hi(a),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(r(340));qa()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return X(Bn),null;case 4:return fe(),null;case 10:return to(a.type),null;case 22:case 23:return hi(a),Mv(),s!==null&&X(Ya),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 24:return to(Wn),null;case 25:return null;default:return null}}function mC(s,a){switch(pv(a),a.tag){case 3:to(Wn),fe();break;case 26:case 27:case 5:Ce(a);break;case 4:fe();break;case 31:a.memoizedState!==null&&hi(a);break;case 13:hi(a);break;case 19:X(Bn);break;case 10:to(a.type);break;case 22:case 23:hi(a),Mv(),s!==null&&X(Ya);break;case 24:to(Wn)}}function Qu(s,a){try{var u=a.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var _=m.next;u=_;do{if((u.tag&s)===s){m=void 0;var x=u.create,T=u.inst;m=x(),T.destroy=m}u=u.next}while(u!==_)}}catch(P){nn(a,a.return,P)}}function Xo(s,a,u){try{var m=a.updateQueue,_=m!==null?m.lastEffect:null;if(_!==null){var x=_.next;m=x;do{if((m.tag&s)===s){var T=m.inst,P=T.destroy;if(P!==void 0){T.destroy=void 0,_=a;var Q=u,le=P;try{le()}catch(ve){nn(_,Q,ve)}}}m=m.next}while(m!==x)}}catch(ve){nn(a,a.return,ve)}}function pC(s){var a=s.updateQueue;if(a!==null){var u=s.stateNode;try{sS(a,u)}catch(m){nn(s,s.return,m)}}}function gC(s,a,u){u.props=el(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(m){nn(s,a,m)}}function Ju(s,a){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var m=s.stateNode;break;case 30:m=s.stateNode;break;default:m=s.stateNode}typeof u=="function"?s.refCleanup=u(m):u.current=m}}catch(_){nn(s,a,_)}}function ys(s,a){var u=s.ref,m=s.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(_){nn(s,a,_)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(_){nn(s,a,_)}else u.current=null}function vC(s){var a=s.type,u=s.memoizedProps,m=s.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&m.focus();break e;case"img":u.src?m.src=u.src:u.srcSet&&(m.srcset=u.srcSet)}}catch(_){nn(s,s.return,_)}}function lb(s,a,u){try{var m=s.stateNode;_L(m,s.type,u,a),m[$t]=a}catch(_){nn(s,s.return,_)}}function bC(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ra(s.type)||s.tag===4}function cb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||bC(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ra(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function ub(s,a,u){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(s),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=Xs));else if(m!==4&&(m===27&&ra(s.type)&&(u=s.stateNode,a=null),s=s.child,s!==null))for(ub(s,a,u),s=s.sibling;s!==null;)ub(s,a,u),s=s.sibling}function Of(s,a,u){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?u.insertBefore(s,a):u.appendChild(s);else if(m!==4&&(m===27&&ra(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Of(s,a,u),s=s.sibling;s!==null;)Of(s,a,u),s=s.sibling}function _C(s){var a=s.stateNode,u=s.memoizedProps;try{for(var m=s.type,_=a.attributes;_.length;)a.removeAttributeNode(_[0]);Tr(a,m,u),a[Gt]=s,a[$t]=u}catch(x){nn(s,s.return,x)}}var oo=!1,Gn=!1,db=!1,yC=typeof WeakSet=="function"?WeakSet:Set,fr=null;function Q3(s,a){if(s=s.containerInfo,Ab=tm,s=A1(s),iv(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var _=m.anchorOffset,x=m.focusNode;m=m.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var T=0,P=-1,Q=-1,le=0,ve=0,_e=s,ce=null;t:for(;;){for(var he;_e!==u||_!==0&&_e.nodeType!==3||(P=T+_),_e!==x||m!==0&&_e.nodeType!==3||(Q=T+m),_e.nodeType===3&&(T+=_e.nodeValue.length),(he=_e.firstChild)!==null;)ce=_e,_e=he;for(;;){if(_e===s)break t;if(ce===u&&++le===_&&(P=T),ce===x&&++ve===m&&(Q=T),(he=_e.nextSibling)!==null)break;_e=ce,ce=_e.parentNode}_e=he}u=P===-1||Q===-1?null:{start:P,end:Q}}else u=null}u=u||{start:0,end:0}}else u=null;for(Db={focusedElem:s,selectionRange:u},tm=!1,fr=a;fr!==null;)if(a=fr,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,fr=s;else for(;fr!==null;){switch(a=fr,x=a.alternate,s=a.flags,a.tag){case 0:if((s&4)!==0&&(s=a.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)_=s[u],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&x!==null){s=void 0,u=a,_=x.memoizedProps,x=x.memoizedState,m=u.stateNode;try{var We=el(u.type,_);s=m.getSnapshotBeforeUpdate(We,x),m.__reactInternalSnapshotBeforeUpdate=s}catch(st){nn(u,u.return,st)}}break;case 3:if((s&1024)!==0){if(s=a.stateNode.containerInfo,u=s.nodeType,u===9)zb(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":zb(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=a.sibling,s!==null){s.return=a.return,fr=s;break}fr=a.return}}function xC(s,a,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:lo(s,u),m&4&&Qu(5,u);break;case 1:if(lo(s,u),m&4)if(s=u.stateNode,a===null)try{s.componentDidMount()}catch(T){nn(u,u.return,T)}else{var _=el(u.type,a.memoizedProps);a=a.memoizedState;try{s.componentDidUpdate(_,a,s.__reactInternalSnapshotBeforeUpdate)}catch(T){nn(u,u.return,T)}}m&64&&pC(u),m&512&&Ju(u,u.return);break;case 3:if(lo(s,u),m&64&&(s=u.updateQueue,s!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{sS(s,a)}catch(T){nn(u,u.return,T)}}break;case 27:a===null&&m&4&&_C(u);case 26:case 5:lo(s,u),a===null&&m&4&&vC(u),m&512&&Ju(u,u.return);break;case 12:lo(s,u);break;case 31:lo(s,u),m&4&&CC(s,u);break;case 13:lo(s,u),m&4&&kC(s,u),m&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=aL.bind(null,u),RL(s,u))));break;case 22:if(m=u.memoizedState!==null||oo,!m){a=a!==null&&a.memoizedState!==null||Gn,_=oo;var x=Gn;oo=m,(Gn=a)&&!x?co(s,u,(u.subtreeFlags&8772)!==0):lo(s,u),oo=_,Gn=x}break;case 30:break;default:lo(s,u)}}function wC(s){var a=s.alternate;a!==null&&(s.alternate=null,wC(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&Bo(a)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Rn=null,Xr=!1;function ao(s,a,u){for(u=u.child;u!==null;)SC(s,a,u),u=u.sibling}function SC(s,a,u){if($e&&typeof $e.onCommitFiberUnmount=="function")try{$e.onCommitFiberUnmount(Ae,u)}catch{}switch(u.tag){case 26:Gn||ys(u,a),ao(s,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Gn||ys(u,a);var m=Rn,_=Xr;ra(u.type)&&(Rn=u.stateNode,Xr=!1),ao(s,a,u),ld(u.stateNode),Rn=m,Xr=_;break;case 5:Gn||ys(u,a);case 6:if(m=Rn,_=Xr,Rn=null,ao(s,a,u),Rn=m,Xr=_,Rn!==null)if(Xr)try{(Rn.nodeType===9?Rn.body:Rn.nodeName==="HTML"?Rn.ownerDocument.body:Rn).removeChild(u.stateNode)}catch(x){nn(u,a,x)}else try{Rn.removeChild(u.stateNode)}catch(x){nn(u,a,x)}break;case 18:Rn!==null&&(Xr?(s=Rn,pk(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),Sc(s)):pk(Rn,u.stateNode));break;case 4:m=Rn,_=Xr,Rn=u.stateNode.containerInfo,Xr=!0,ao(s,a,u),Rn=m,Xr=_;break;case 0:case 11:case 14:case 15:Xo(2,u,a),Gn||Xo(4,u,a),ao(s,a,u);break;case 1:Gn||(ys(u,a),m=u.stateNode,typeof m.componentWillUnmount=="function"&&gC(u,a,m)),ao(s,a,u);break;case 21:ao(s,a,u);break;case 22:Gn=(m=Gn)||u.memoizedState!==null,ao(s,a,u),Gn=m;break;default:ao(s,a,u)}}function CC(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Sc(s)}catch(u){nn(a,a.return,u)}}}function kC(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Sc(s)}catch(u){nn(a,a.return,u)}}function J3(s){switch(s.tag){case 31:case 13:case 19:var a=s.stateNode;return a===null&&(a=s.stateNode=new yC),a;case 22:return s=s.stateNode,a=s._retryCache,a===null&&(a=s._retryCache=new yC),a;default:throw Error(r(435,s.tag))}}function Lf(s,a){var u=J3(s);a.forEach(function(m){if(!u.has(m)){u.add(m);var _=lL.bind(null,s,m);m.then(_,_)}})}function Zr(s,a){var u=a.deletions;if(u!==null)for(var m=0;m<u.length;m++){var _=u[m],x=s,T=a,P=T;e:for(;P!==null;){switch(P.tag){case 27:if(ra(P.type)){Rn=P.stateNode,Xr=!1;break e}break;case 5:Rn=P.stateNode,Xr=!1;break e;case 3:case 4:Rn=P.stateNode.containerInfo,Xr=!0;break e}P=P.return}if(Rn===null)throw Error(r(160));SC(x,T,_),Rn=null,Xr=!1,x=_.alternate,x!==null&&(x.return=null),_.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)EC(a,s),a=a.sibling}var es=null;function EC(s,a){var u=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Zr(a,s),Qr(s),m&4&&(Xo(3,s,s.return),Qu(3,s),Xo(5,s,s.return));break;case 1:Zr(a,s),Qr(s),m&512&&(Gn||u===null||ys(u,u.return)),m&64&&oo&&(s=s.updateQueue,s!==null&&(m=s.callbacks,m!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?m:u.concat(m))));break;case 26:var _=es;if(Zr(a,s),Qr(s),m&512&&(Gn||u===null||ys(u,u.return)),m&4){var x=u!==null?u.memoizedState:null;if(m=s.memoizedState,u===null)if(m===null)if(s.stateNode===null){e:{m=s.type,u=s.memoizedProps,_=_.ownerDocument||_;t:switch(m){case"title":x=_.getElementsByTagName("title")[0],(!x||x[ps]||x[Gt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=_.createElement(m),_.head.insertBefore(x,_.querySelector("head > title"))),Tr(x,m,u),x[Gt]=s,wn(x),m=x;break e;case"link":var T=Ek("link","href",_).get(m+(u.href||""));if(T){for(var P=0;P<T.length;P++)if(x=T[P],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){T.splice(P,1);break t}}x=_.createElement(m),Tr(x,m,u),_.head.appendChild(x);break;case"meta":if(T=Ek("meta","content",_).get(m+(u.content||""))){for(P=0;P<T.length;P++)if(x=T[P],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){T.splice(P,1);break t}}x=_.createElement(m),Tr(x,m,u),_.head.appendChild(x);break;default:throw Error(r(468,m))}x[Gt]=s,wn(x),m=x}s.stateNode=m}else Rk(_,s.type,s.stateNode);else s.stateNode=kk(_,m,s.memoizedProps);else x!==m?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,m===null?Rk(_,s.type,s.stateNode):kk(_,m,s.memoizedProps)):m===null&&s.stateNode!==null&&lb(s,s.memoizedProps,u.memoizedProps)}break;case 27:Zr(a,s),Qr(s),m&512&&(Gn||u===null||ys(u,u.return)),u!==null&&m&4&&lb(s,s.memoizedProps,u.memoizedProps);break;case 5:if(Zr(a,s),Qr(s),m&512&&(Gn||u===null||ys(u,u.return)),s.flags&32){_=s.stateNode;try{Gr(_,"")}catch(We){nn(s,s.return,We)}}m&4&&s.stateNode!=null&&(_=s.memoizedProps,lb(s,_,u!==null?u.memoizedProps:_)),m&1024&&(db=!0);break;case 6:if(Zr(a,s),Qr(s),m&4){if(s.stateNode===null)throw Error(r(162));m=s.memoizedProps,u=s.stateNode;try{u.nodeValue=m}catch(We){nn(s,s.return,We)}}break;case 3:if(Zf=null,_=es,es=Yf(a.containerInfo),Zr(a,s),es=_,Qr(s),m&4&&u!==null&&u.memoizedState.isDehydrated)try{Sc(a.containerInfo)}catch(We){nn(s,s.return,We)}db&&(db=!1,RC(s));break;case 4:m=es,es=Yf(s.stateNode.containerInfo),Zr(a,s),Qr(s),es=m;break;case 12:Zr(a,s),Qr(s);break;case 31:Zr(a,s),Qr(s),m&4&&(m=s.updateQueue,m!==null&&(s.updateQueue=null,Lf(s,m)));break;case 13:Zr(a,s),Qr(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Pf=Nt()),m&4&&(m=s.updateQueue,m!==null&&(s.updateQueue=null,Lf(s,m)));break;case 22:_=s.memoizedState!==null;var Q=u!==null&&u.memoizedState!==null,le=oo,ve=Gn;if(oo=le||_,Gn=ve||Q,Zr(a,s),Gn=ve,oo=le,Qr(s),m&8192)e:for(a=s.stateNode,a._visibility=_?a._visibility&-2:a._visibility|1,_&&(u===null||Q||oo||Gn||tl(s)),u=null,a=s;;){if(a.tag===5||a.tag===26){if(u===null){Q=u=a;try{if(x=Q.stateNode,_)T=x.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{P=Q.stateNode;var _e=Q.memoizedProps.style,ce=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;P.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(We){nn(Q,Q.return,We)}}}else if(a.tag===6){if(u===null){Q=a;try{Q.stateNode.nodeValue=_?"":Q.memoizedProps}catch(We){nn(Q,Q.return,We)}}}else if(a.tag===18){if(u===null){Q=a;try{var he=Q.stateNode;_?gk(he,!0):gk(Q.stateNode,!1)}catch(We){nn(Q,Q.return,We)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===s)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}m&4&&(m=s.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,Lf(s,u))));break;case 19:Zr(a,s),Qr(s),m&4&&(m=s.updateQueue,m!==null&&(s.updateQueue=null,Lf(s,m)));break;case 30:break;case 21:break;default:Zr(a,s),Qr(s)}}function Qr(s){var a=s.flags;if(a&2){try{for(var u,m=s.return;m!==null;){if(bC(m)){u=m;break}m=m.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var _=u.stateNode,x=cb(s);Of(s,x,_);break;case 5:var T=u.stateNode;u.flags&32&&(Gr(T,""),u.flags&=-33);var P=cb(s);Of(s,P,T);break;case 3:case 4:var Q=u.stateNode.containerInfo,le=cb(s);ub(s,le,Q);break;default:throw Error(r(161))}}catch(ve){nn(s,s.return,ve)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function RC(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var a=s;RC(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),s=s.sibling}}function lo(s,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)xC(s,a.alternate,a),a=a.sibling}function tl(s){for(s=s.child;s!==null;){var a=s;switch(a.tag){case 0:case 11:case 14:case 15:Xo(4,a,a.return),tl(a);break;case 1:ys(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&gC(a,a.return,u),tl(a);break;case 27:ld(a.stateNode);case 26:case 5:ys(a,a.return),tl(a);break;case 22:a.memoizedState===null&&tl(a);break;case 30:tl(a);break;default:tl(a)}s=s.sibling}}function co(s,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var m=a.alternate,_=s,x=a,T=x.flags;switch(x.tag){case 0:case 11:case 15:co(_,x,u),Qu(4,x);break;case 1:if(co(_,x,u),m=x,_=m.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(le){nn(m,m.return,le)}if(m=x,_=m.updateQueue,_!==null){var P=m.stateNode;try{var Q=_.shared.hiddenCallbacks;if(Q!==null)for(_.shared.hiddenCallbacks=null,_=0;_<Q.length;_++)iS(Q[_],P)}catch(le){nn(m,m.return,le)}}u&&T&64&&pC(x),Ju(x,x.return);break;case 27:_C(x);case 26:case 5:co(_,x,u),u&&m===null&&T&4&&vC(x),Ju(x,x.return);break;case 12:co(_,x,u);break;case 31:co(_,x,u),u&&T&4&&CC(_,x);break;case 13:co(_,x,u),u&&T&4&&kC(_,x);break;case 22:x.memoizedState===null&&co(_,x,u),Ju(x,x.return);break;case 30:break;default:co(_,x,u)}a=a.sibling}}function hb(s,a){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&Bu(u))}function fb(s,a){s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&Bu(s))}function ts(s,a,u,m){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)TC(s,a,u,m),a=a.sibling}function TC(s,a,u,m){var _=a.flags;switch(a.tag){case 0:case 11:case 15:ts(s,a,u,m),_&2048&&Qu(9,a);break;case 1:ts(s,a,u,m);break;case 3:ts(s,a,u,m),_&2048&&(s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&Bu(s)));break;case 12:if(_&2048){ts(s,a,u,m),s=a.stateNode;try{var x=a.memoizedProps,T=x.id,P=x.onPostCommit;typeof P=="function"&&P(T,a.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Q){nn(a,a.return,Q)}}else ts(s,a,u,m);break;case 31:ts(s,a,u,m);break;case 13:ts(s,a,u,m);break;case 23:break;case 22:x=a.stateNode,T=a.alternate,a.memoizedState!==null?x._visibility&2?ts(s,a,u,m):ed(s,a):x._visibility&2?ts(s,a,u,m):(x._visibility|=2,hc(s,a,u,m,(a.subtreeFlags&10256)!==0||!1)),_&2048&&hb(T,a);break;case 24:ts(s,a,u,m),_&2048&&fb(a.alternate,a);break;default:ts(s,a,u,m)}}function hc(s,a,u,m,_){for(_=_&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var x=s,T=a,P=u,Q=m,le=T.flags;switch(T.tag){case 0:case 11:case 15:hc(x,T,P,Q,_),Qu(8,T);break;case 23:break;case 22:var ve=T.stateNode;T.memoizedState!==null?ve._visibility&2?hc(x,T,P,Q,_):ed(x,T):(ve._visibility|=2,hc(x,T,P,Q,_)),_&&le&2048&&hb(T.alternate,T);break;case 24:hc(x,T,P,Q,_),_&&le&2048&&fb(T.alternate,T);break;default:hc(x,T,P,Q,_)}a=a.sibling}}function ed(s,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=s,m=a,_=m.flags;switch(m.tag){case 22:ed(u,m),_&2048&&hb(m.alternate,m);break;case 24:ed(u,m),_&2048&&fb(m.alternate,m);break;default:ed(u,m)}a=a.sibling}}var td=8192;function fc(s,a,u){if(s.subtreeFlags&td)for(s=s.child;s!==null;)NC(s,a,u),s=s.sibling}function NC(s,a,u){switch(s.tag){case 26:fc(s,a,u),s.flags&td&&s.memoizedState!==null&&BL(u,es,s.memoizedState,s.memoizedProps);break;case 5:fc(s,a,u);break;case 3:case 4:var m=es;es=Yf(s.stateNode.containerInfo),fc(s,a,u),es=m;break;case 22:s.memoizedState===null&&(m=s.alternate,m!==null&&m.memoizedState!==null?(m=td,td=16777216,fc(s,a,u),td=m):fc(s,a,u));break;default:fc(s,a,u)}}function MC(s){var a=s.alternate;if(a!==null&&(s=a.child,s!==null)){a.child=null;do a=s.sibling,s.sibling=null,s=a;while(s!==null)}}function nd(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var m=a[u];fr=m,AC(m,s)}MC(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)jC(s),s=s.sibling}function jC(s){switch(s.tag){case 0:case 11:case 15:nd(s),s.flags&2048&&Xo(9,s,s.return);break;case 3:nd(s);break;case 12:nd(s);break;case 22:var a=s.stateNode;s.memoizedState!==null&&a._visibility&2&&(s.return===null||s.return.tag!==13)?(a._visibility&=-3,zf(s)):nd(s);break;default:nd(s)}}function zf(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var m=a[u];fr=m,AC(m,s)}MC(s)}for(s=s.child;s!==null;){switch(a=s,a.tag){case 0:case 11:case 15:Xo(8,a,a.return),zf(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,zf(a));break;default:zf(a)}s=s.sibling}}function AC(s,a){for(;fr!==null;){var u=fr;switch(u.tag){case 0:case 11:case 15:Xo(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var m=u.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Bu(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,fr=m;else e:for(u=s;fr!==null;){m=fr;var _=m.sibling,x=m.return;if(wC(m),m===u){fr=null;break e}if(_!==null){_.return=x,fr=_;break e}fr=x}}}var eL={getCacheForType:function(s){var a=Er(Wn),u=a.data.get(s);return u===void 0&&(u=s(),a.data.set(s,u)),u},cacheSignal:function(){return Er(Wn).controller.signal}},tL=typeof WeakMap=="function"?WeakMap:Map,Yt=0,pn=null,Mt=null,Lt=0,tn=0,fi=null,Zo=!1,mc=!1,mb=!1,uo=0,On=0,Qo=0,nl=0,pb=0,mi=0,pc=0,rd=null,Jr=null,gb=!1,Pf=0,DC=0,If=1/0,Bf=null,Jo=null,nr=0,ea=null,gc=null,ho=0,vb=0,bb=null,OC=null,id=0,_b=null;function pi(){return(Yt&2)!==0&&Lt!==0?Lt&-Lt:D.T!==null?kb():mn()}function LC(){if(mi===0)if((Lt&536870912)===0||Pt){var s=er;er<<=1,(er&3932160)===0&&(er=262144),mi=s}else mi=536870912;return s=di.current,s!==null&&(s.flags|=32),mi}function ei(s,a,u){(s===pn&&(tn===2||tn===9)||s.cancelPendingCommit!==null)&&(vc(s,0),ta(s,Lt,mi,!1)),ze(s,u),((Yt&2)===0||s!==pn)&&(s===pn&&((Yt&2)===0&&(nl|=u),On===4&&ta(s,Lt,mi,!1)),xs(s))}function zC(s,a,u){if((Yt&6)!==0)throw Error(r(327));var m=!u&&(a&127)===0&&(a&s.expiredLanes)===0||vt(s,a),_=m?iL(s,a):xb(s,a,!0),x=m;do{if(_===0){mc&&!m&&ta(s,a,0,!1);break}else{if(u=s.current.alternate,x&&!nL(u)){_=xb(s,a,!1),x=!1;continue}if(_===2){if(x=a,s.errorRecoveryDisabledLanes&x)var T=0;else T=s.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){a=T;e:{var P=s;_=rd;var Q=P.current.memoizedState.isDehydrated;if(Q&&(vc(P,T).flags|=256),T=xb(P,T,!1),T!==2){if(mb&&!Q){P.errorRecoveryDisabledLanes|=x,nl|=x,_=4;break e}x=Jr,Jr=_,x!==null&&(Jr===null?Jr=x:Jr.push.apply(Jr,x))}_=T}if(x=!1,_!==2)continue}}if(_===1){vc(s,0),ta(s,a,0,!0);break}e:{switch(m=s,x=_,x){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:ta(m,a,mi,!Zo);break e;case 2:Jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(_=Pf+300-Nt(),10<_)){if(ta(m,a,mi,!Zo),Pe(m,0,!0)!==0)break e;ho=a,m.timeoutHandle=fk(PC.bind(null,m,u,Jr,Bf,gb,a,mi,nl,pc,Zo,x,"Throttled",-0,0),_);break e}PC(m,u,Jr,Bf,gb,a,mi,nl,pc,Zo,x,null,-0,0)}}break}while(!0);xs(s)}function PC(s,a,u,m,_,x,T,P,Q,le,ve,_e,ce,he){if(s.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:Xs},NC(a,x,_e);var We=(x&62914560)===x?Pf-Nt():(x&4194048)===x?DC-Nt():0;if(We=FL(_e,We),We!==null){ho=x,s.cancelPendingCommit=We(WC.bind(null,s,a,x,u,m,_,T,P,Q,ve,_e,null,ce,he)),ta(s,x,T,!le);return}}WC(s,a,x,u,m,_,T,P,Q)}function nL(s){for(var a=s;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var m=0;m<u.length;m++){var _=u[m],x=_.getSnapshot;_=_.value;try{if(!ci(x(),_))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function ta(s,a,u,m){a&=~pb,a&=~nl,s.suspendedLanes|=a,s.pingedLanes&=~a,m&&(s.warmLanes|=a),m=s.expirationTimes;for(var _=a;0<_;){var x=31-Fe(_),T=1<<x;m[x]=-1,_&=~T}u!==0&&xn(s,u,a)}function Ff(){return(Yt&6)===0?(sd(0),!1):!0}function yb(){if(Mt!==null){if(tn===0)var s=Mt.return;else s=Mt,eo=Ka=null,zv(s),ac=null,Hu=0,s=Mt;for(;s!==null;)mC(s.alternate,s),s=s.return;Mt=null}}function vc(s,a){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,wL(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),ho=0,yb(),pn=s,Mt=u=Qs(s.current,null),Lt=a,tn=0,fi=null,Zo=!1,mc=vt(s,a),mb=!1,pc=mi=pb=nl=Qo=On=0,Jr=rd=null,gb=!1,(a&8)!==0&&(a|=a&32);var m=s.entangledLanes;if(m!==0)for(s=s.entanglements,m&=a;0<m;){var _=31-Fe(m),x=1<<_;a|=s[_],m&=~x}return uo=a,af(),u}function IC(s,a){gt=null,D.H=Yu,a===oc||a===pf?(a=eS(),tn=3):a===Cv?(a=eS(),tn=4):tn=a===Qv?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,fi=a,Mt===null&&(On=1,Nf(s,Ni(a,s.current)))}function BC(){var s=di.current;return s===null?!0:(Lt&4194048)===Lt?Di===null:(Lt&62914560)===Lt||(Lt&536870912)!==0?s===Di:!1}function FC(){var s=D.H;return D.H=Yu,s===null?Yu:s}function HC(){var s=D.A;return D.A=eL,s}function Hf(){On=4,Zo||(Lt&4194048)!==Lt&&di.current!==null||(mc=!0),(Qo&134217727)===0&&(nl&134217727)===0||pn===null||ta(pn,Lt,mi,!1)}function xb(s,a,u){var m=Yt;Yt|=2;var _=FC(),x=HC();(pn!==s||Lt!==a)&&(Bf=null,vc(s,a)),a=!1;var T=On;e:do try{if(tn!==0&&Mt!==null){var P=Mt,Q=fi;switch(tn){case 8:yb(),T=6;break e;case 3:case 2:case 9:case 6:di.current===null&&(a=!0);var le=tn;if(tn=0,fi=null,bc(s,P,Q,le),u&&mc){T=0;break e}break;default:le=tn,tn=0,fi=null,bc(s,P,Q,le)}}rL(),T=On;break}catch(ve){IC(s,ve)}while(!0);return a&&s.shellSuspendCounter++,eo=Ka=null,Yt=m,D.H=_,D.A=x,Mt===null&&(pn=null,Lt=0,af()),T}function rL(){for(;Mt!==null;)$C(Mt)}function iL(s,a){var u=Yt;Yt|=2;var m=FC(),_=HC();pn!==s||Lt!==a?(Bf=null,If=Nt()+500,vc(s,a)):mc=vt(s,a);e:do try{if(tn!==0&&Mt!==null){a=Mt;var x=fi;t:switch(tn){case 1:tn=0,fi=null,bc(s,a,x,1);break;case 2:case 9:if(Q1(x)){tn=0,fi=null,UC(a);break}a=function(){tn!==2&&tn!==9||pn!==s||(tn=7),xs(s)},x.then(a,a);break e;case 3:tn=7;break e;case 4:tn=5;break e;case 7:Q1(x)?(tn=0,fi=null,UC(a)):(tn=0,fi=null,bc(s,a,x,7));break;case 5:var T=null;switch(Mt.tag){case 26:T=Mt.memoizedState;case 5:case 27:var P=Mt;if(T?Tk(T):P.stateNode.complete){tn=0,fi=null;var Q=P.sibling;if(Q!==null)Mt=Q;else{var le=P.return;le!==null?(Mt=le,$f(le)):Mt=null}break t}}tn=0,fi=null,bc(s,a,x,5);break;case 6:tn=0,fi=null,bc(s,a,x,6);break;case 8:yb(),On=6;break e;default:throw Error(r(462))}}sL();break}catch(ve){IC(s,ve)}while(!0);return eo=Ka=null,D.H=m,D.A=_,Yt=u,Mt!==null?0:(pn=null,Lt=0,af(),On)}function sL(){for(;Mt!==null&&!ot();)$C(Mt)}function $C(s){var a=hC(s.alternate,s,uo);s.memoizedProps=s.pendingProps,a===null?$f(s):Mt=a}function UC(s){var a=s,u=a.alternate;switch(a.tag){case 15:case 0:a=oC(u,a,a.pendingProps,a.type,void 0,Lt);break;case 11:a=oC(u,a,a.pendingProps,a.type.render,a.ref,Lt);break;case 5:zv(a);default:mC(u,a),a=Mt=H1(a,uo),a=hC(u,a,uo)}s.memoizedProps=s.pendingProps,a===null?$f(s):Mt=a}function bc(s,a,u,m){eo=Ka=null,zv(a),ac=null,Hu=0;var _=a.return;try{if(K3(s,_,a,u,Lt)){On=1,Nf(s,Ni(u,s.current)),Mt=null;return}}catch(x){if(_!==null)throw Mt=_,x;On=1,Nf(s,Ni(u,s.current)),Mt=null;return}a.flags&32768?(Pt||m===1?s=!0:mc||(Lt&536870912)!==0?s=!1:(Zo=s=!0,(m===2||m===9||m===3||m===6)&&(m=di.current,m!==null&&m.tag===13&&(m.flags|=16384))),VC(a,s)):$f(a)}function $f(s){var a=s;do{if((a.flags&32768)!==0){VC(a,Zo);return}s=a.return;var u=X3(a.alternate,a,uo);if(u!==null){Mt=u;return}if(a=a.sibling,a!==null){Mt=a;return}Mt=a=s}while(a!==null);On===0&&(On=5)}function VC(s,a){do{var u=Z3(s.alternate,s);if(u!==null){u.flags&=32767,Mt=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(s=s.sibling,s!==null)){Mt=s;return}Mt=s=u}while(s!==null);On=6,Mt=null}function WC(s,a,u,m,_,x,T,P,Q){s.cancelPendingCommit=null;do Uf();while(nr!==0);if((Yt&6)!==0)throw Error(r(327));if(a!==null){if(a===s.current)throw Error(r(177));if(x=a.lanes|a.childLanes,x|=cv,rt(s,u,x,T,P,Q),s===pn&&(Mt=pn=null,Lt=0),gc=a,ea=s,ho=u,vb=x,bb=_,OC=m,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,cL(xe,function(){return XC(),null})):(s.callbackNode=null,s.callbackPriority=0),m=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||m){m=D.T,D.T=null,_=U.p,U.p=2,T=Yt,Yt|=4;try{Q3(s,a,u)}finally{Yt=T,U.p=_,D.T=m}}nr=1,qC(),KC(),GC()}}function qC(){if(nr===1){nr=0;var s=ea,a=gc,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=D.T,D.T=null;var m=U.p;U.p=2;var _=Yt;Yt|=4;try{EC(a,s);var x=Db,T=A1(s.containerInfo),P=x.focusedElem,Q=x.selectionRange;if(T!==P&&P&&P.ownerDocument&&j1(P.ownerDocument.documentElement,P)){if(Q!==null&&iv(P)){var le=Q.start,ve=Q.end;if(ve===void 0&&(ve=le),"selectionStart"in P)P.selectionStart=le,P.selectionEnd=Math.min(ve,P.value.length);else{var _e=P.ownerDocument||document,ce=_e&&_e.defaultView||window;if(ce.getSelection){var he=ce.getSelection(),We=P.textContent.length,st=Math.min(Q.start,We),an=Q.end===void 0?st:Math.min(Q.end,We);!he.extend&&st>an&&(T=an,an=st,st=T);var se=M1(P,st),te=M1(P,an);if(se&&te&&(he.rangeCount!==1||he.anchorNode!==se.node||he.anchorOffset!==se.offset||he.focusNode!==te.node||he.focusOffset!==te.offset)){var ae=_e.createRange();ae.setStart(se.node,se.offset),he.removeAllRanges(),st>an?(he.addRange(ae),he.extend(te.node,te.offset)):(ae.setEnd(te.node,te.offset),he.addRange(ae))}}}}for(_e=[],he=P;he=he.parentNode;)he.nodeType===1&&_e.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<_e.length;P++){var be=_e[P];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}tm=!!Ab,Db=Ab=null}finally{Yt=_,U.p=m,D.T=u}}s.current=a,nr=2}}function KC(){if(nr===2){nr=0;var s=ea,a=gc,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=D.T,D.T=null;var m=U.p;U.p=2;var _=Yt;Yt|=4;try{xC(s,a.alternate,a)}finally{Yt=_,U.p=m,D.T=u}}nr=3}}function GC(){if(nr===4||nr===3){nr=0,dn();var s=ea,a=gc,u=ho,m=OC;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?nr=5:(nr=0,gc=ea=null,YC(s,s.pendingLanes));var _=s.pendingLanes;if(_===0&&(Jo=null),ut(u),a=a.stateNode,$e&&typeof $e.onCommitFiberRoot=="function")try{$e.onCommitFiberRoot(Ae,a,void 0,(a.current.flags&128)===128)}catch{}if(m!==null){a=D.T,_=U.p,U.p=2,D.T=null;try{for(var x=s.onRecoverableError,T=0;T<m.length;T++){var P=m[T];x(P.value,{componentStack:P.stack})}}finally{D.T=a,U.p=_}}(ho&3)!==0&&Uf(),xs(s),_=s.pendingLanes,(u&261930)!==0&&(_&42)!==0?s===_b?id++:(id=0,_b=s):id=0,sd(0)}}function YC(s,a){(s.pooledCacheLanes&=a)===0&&(a=s.pooledCache,a!=null&&(s.pooledCache=null,Bu(a)))}function Uf(){return qC(),KC(),GC(),XC()}function XC(){if(nr!==5)return!1;var s=ea,a=vb;vb=0;var u=ut(ho),m=D.T,_=U.p;try{U.p=32>u?32:u,D.T=null,u=bb,bb=null;var x=ea,T=ho;if(nr=0,gc=ea=null,ho=0,(Yt&6)!==0)throw Error(r(331));var P=Yt;if(Yt|=4,jC(x.current),TC(x,x.current,T,u),Yt=P,sd(0,!1),$e&&typeof $e.onPostCommitFiberRoot=="function")try{$e.onPostCommitFiberRoot(Ae,x)}catch{}return!0}finally{U.p=_,D.T=m,YC(s,a)}}function ZC(s,a,u){a=Ni(u,a),a=Zv(s.stateNode,a,2),s=Ko(s,a,2),s!==null&&(ze(s,2),xs(s))}function nn(s,a,u){if(s.tag===3)ZC(s,s,u);else for(;a!==null;){if(a.tag===3){ZC(a,s,u);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Jo===null||!Jo.has(m))){s=Ni(u,s),u=QS(2),m=Ko(a,u,2),m!==null&&(JS(u,m,a,s),ze(m,2),xs(m));break}}a=a.return}}function wb(s,a,u){var m=s.pingCache;if(m===null){m=s.pingCache=new tL;var _=new Set;m.set(a,_)}else _=m.get(a),_===void 0&&(_=new Set,m.set(a,_));_.has(u)||(mb=!0,_.add(u),s=oL.bind(null,s,a,u),a.then(s,s))}function oL(s,a,u){var m=s.pingCache;m!==null&&m.delete(a),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,pn===s&&(Lt&u)===u&&(On===4||On===3&&(Lt&62914560)===Lt&&300>Nt()-Pf?(Yt&2)===0&&vc(s,0):pb|=u,pc===Lt&&(pc=0)),xs(s)}function QC(s,a){a===0&&(a=Et()),s=Va(s,a),s!==null&&(ze(s,a),xs(s))}function aL(s){var a=s.memoizedState,u=0;a!==null&&(u=a.retryLane),QC(s,u)}function lL(s,a){var u=0;switch(s.tag){case 31:case 13:var m=s.stateNode,_=s.memoizedState;_!==null&&(u=_.retryLane);break;case 19:m=s.stateNode;break;case 22:m=s.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(a),QC(s,u)}function cL(s,a){return mt(s,a)}var Vf=null,_c=null,Sb=!1,Wf=!1,Cb=!1,na=0;function xs(s){s!==_c&&s.next===null&&(_c===null?Vf=_c=s:_c=_c.next=s),Wf=!0,Sb||(Sb=!0,dL())}function sd(s,a){if(!Cb&&Wf){Cb=!0;do for(var u=!1,m=Vf;m!==null;){if(s!==0){var _=m.pendingLanes;if(_===0)var x=0;else{var T=m.suspendedLanes,P=m.pingedLanes;x=(1<<31-Fe(42|s)+1)-1,x&=_&~(T&~P),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,nk(m,x))}else x=Lt,x=Pe(m,m===pn?x:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(x&3)===0||vt(m,x)||(u=!0,nk(m,x));m=m.next}while(u);Cb=!1}}function uL(){JC()}function JC(){Wf=Sb=!1;var s=0;na!==0&&xL()&&(s=na);for(var a=Nt(),u=null,m=Vf;m!==null;){var _=m.next,x=ek(m,a);x===0?(m.next=null,u===null?Vf=_:u.next=_,_===null&&(_c=u)):(u=m,(s!==0||(x&3)!==0)&&(Wf=!0)),m=_}nr!==0&&nr!==5||sd(s),na!==0&&(na=0)}function ek(s,a){for(var u=s.suspendedLanes,m=s.pingedLanes,_=s.expirationTimes,x=s.pendingLanes&-62914561;0<x;){var T=31-Fe(x),P=1<<T,Q=_[T];Q===-1?((P&u)===0||(P&m)!==0)&&(_[T]=kt(P,a)):Q<=a&&(s.expiredLanes|=P),x&=~P}if(a=pn,u=Lt,u=Pe(s,s===a?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),m=s.callbackNode,u===0||s===a&&(tn===2||tn===9)||s.cancelPendingCommit!==null)return m!==null&&m!==null&&pt(m),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||vt(s,u)){if(a=u&-u,a===s.callbackPriority)return a;switch(m!==null&&pt(m),ut(u)){case 2:case 8:u=oe;break;case 32:u=xe;break;case 268435456:u=Ke;break;default:u=xe}return m=tk.bind(null,s),u=mt(u,m),s.callbackPriority=a,s.callbackNode=u,a}return m!==null&&m!==null&&pt(m),s.callbackPriority=2,s.callbackNode=null,2}function tk(s,a){if(nr!==0&&nr!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(Uf()&&s.callbackNode!==u)return null;var m=Lt;return m=Pe(s,s===pn?m:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),m===0?null:(zC(s,m,a),ek(s,Nt()),s.callbackNode!=null&&s.callbackNode===u?tk.bind(null,s):null)}function nk(s,a){if(Uf())return null;zC(s,a,!0)}function dL(){SL(function(){(Yt&6)!==0?mt(de,uL):JC()})}function kb(){if(na===0){var s=ic;s===0&&(s=dr,dr<<=1,(dr&261888)===0&&(dr=256)),na=s}return na}function rk(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Qh(""+s)}function ik(s,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,s.id&&u.setAttribute("form",s.id),a.parentNode.insertBefore(u,a),s=new FormData(s),u.parentNode.removeChild(u),s}function hL(s,a,u,m,_){if(a==="submit"&&u&&u.stateNode===_){var x=rk((_[$t]||null).action),T=m.submitter;T&&(a=(a=T[$t]||null)?rk(a.formAction):T.getAttribute("formAction"),a!==null&&(x=a,T=null));var P=new nf("action","action",null,m,_);s.push({event:P,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(na!==0){var Q=T?ik(_,T):new FormData(_);Wv(u,{pending:!0,data:Q,method:_.method,action:x},null,Q)}}else typeof x=="function"&&(P.preventDefault(),Q=T?ik(_,T):new FormData(_),Wv(u,{pending:!0,data:Q,method:_.method,action:x},x,Q))},currentTarget:_}]})}}for(var Eb=0;Eb<lv.length;Eb++){var Rb=lv[Eb],fL=Rb.toLowerCase(),mL=Rb[0].toUpperCase()+Rb.slice(1);Ji(fL,"on"+mL)}Ji(L1,"onAnimationEnd"),Ji(z1,"onAnimationIteration"),Ji(P1,"onAnimationStart"),Ji("dblclick","onDoubleClick"),Ji("focusin","onFocus"),Ji("focusout","onBlur"),Ji(M3,"onTransitionRun"),Ji(j3,"onTransitionStart"),Ji(A3,"onTransitionCancel"),Ji(I1,"onTransitionEnd"),vs("onMouseEnter",["mouseout","mouseover"]),vs("onMouseLeave",["mouseout","mouseover"]),vs("onPointerEnter",["pointerout","pointerover"]),vs("onPointerLeave",["pointerout","pointerover"]),Ri("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ri("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ri("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ri("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ri("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ri("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var od="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(" "),pL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(od));function sk(s,a){a=(a&4)!==0;for(var u=0;u<s.length;u++){var m=s[u],_=m.event;m=m.listeners;e:{var x=void 0;if(a)for(var T=m.length-1;0<=T;T--){var P=m[T],Q=P.instance,le=P.currentTarget;if(P=P.listener,Q!==x&&_.isPropagationStopped())break e;x=P,_.currentTarget=le;try{x(_)}catch(ve){of(ve)}_.currentTarget=null,x=Q}else for(T=0;T<m.length;T++){if(P=m[T],Q=P.instance,le=P.currentTarget,P=P.listener,Q!==x&&_.isPropagationStopped())break e;x=P,_.currentTarget=le;try{x(_)}catch(ve){of(ve)}_.currentTarget=null,x=Q}}}}function jt(s,a){var u=a[ms];u===void 0&&(u=a[ms]=new Set);var m=s+"__bubble";u.has(m)||(ok(a,s,2,!1),u.add(m))}function Tb(s,a,u){var m=0;a&&(m|=4),ok(u,s,m,a)}var qf="_reactListening"+Math.random().toString(36).slice(2);function Nb(s){if(!s[qf]){s[qf]=!0,$l.forEach(function(u){u!=="selectionchange"&&(pL.has(u)||Tb(u,!1,s),Tb(u,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[qf]||(a[qf]=!0,Tb("selectionchange",!1,a))}}function ok(s,a,u,m){switch(Lk(a)){case 2:var _=UL;break;case 8:_=VL;break;default:_=Vb}u=_.bind(null,a,u,s),_=void 0,!Yg||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(_=!0),m?_!==void 0?s.addEventListener(a,u,{capture:!0,passive:_}):s.addEventListener(a,u,!0):_!==void 0?s.addEventListener(a,u,{passive:_}):s.addEventListener(a,u,!1)}function Mb(s,a,u,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 P=m.stateNode.containerInfo;if(P===_)break;if(T===4)for(T=m.return;T!==null;){var Q=T.tag;if((Q===3||Q===4)&&T.stateNode.containerInfo===_)return;T=T.return}for(;P!==null;){if(T=hr(P),T===null)return;if(Q=T.tag,Q===5||Q===6||Q===26||Q===27){m=x=T;continue e}P=P.parentNode}}m=m.return}d1(function(){var le=x,ve=Kg(u),_e=[];e:{var ce=B1.get(s);if(ce!==void 0){var he=nf,We=s;switch(s){case"keypress":if(ef(u)===0)break e;case"keydown":case"keyup":he=l3;break;case"focusin":We="focus",he=Jg;break;case"focusout":We="blur",he=Jg;break;case"beforeblur":case"afterblur":he=Jg;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=m1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=XO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=d3;break;case L1:case z1:case P1:he=JO;break;case I1:he=f3;break;case"scroll":case"scrollend":he=GO;break;case"wheel":he=p3;break;case"copy":case"cut":case"paste":he=t3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=g1;break;case"toggle":case"beforetoggle":he=v3}var st=(a&4)!==0,an=!st&&(s==="scroll"||s==="scrollend"),se=st?ce!==null?ce+"Capture":null:ce;st=[];for(var te=le,ae;te!==null;){var be=te;if(ae=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ae===null||se===null||(be=Tu(te,se),be!=null&&st.push(ad(te,be,ae))),an)break;te=te.return}0<st.length&&(ce=new he(ce,We,null,u,ve),_e.push({event:ce,listeners:st}))}}if((a&7)===0){e:{if(ce=s==="mouseover"||s==="pointerover",he=s==="mouseout"||s==="pointerout",ce&&u!==qg&&(We=u.relatedTarget||u.fromElement)&&(hr(We)||We[Ar]))break e;if((he||ce)&&(ce=ve.window===ve?ve:(ce=ve.ownerDocument)?ce.defaultView||ce.parentWindow:window,he?(We=u.relatedTarget||u.toElement,he=le,We=We?hr(We):null,We!==null&&(an=o(We),st=We.tag,We!==an||st!==5&&st!==27&&st!==6)&&(We=null)):(he=null,We=le),he!==We)){if(st=m1,be="onMouseLeave",se="onMouseEnter",te="mouse",(s==="pointerout"||s==="pointerover")&&(st=g1,be="onPointerLeave",se="onPointerEnter",te="pointer"),an=he==null?ce:qs(he),ae=We==null?ce:qs(We),ce=new st(be,te+"leave",he,u,ve),ce.target=an,ce.relatedTarget=ae,be=null,hr(ve)===le&&(st=new st(se,te+"enter",We,u,ve),st.target=ae,st.relatedTarget=an,be=st),an=be,he&&We)t:{for(st=gL,se=he,te=We,ae=0,be=se;be;be=st(be))ae++;be=0;for(var tt=te;tt;tt=st(tt))be++;for(;0<ae-be;)se=st(se),ae--;for(;0<be-ae;)te=st(te),be--;for(;ae--;){if(se===te||te!==null&&se===te.alternate){st=se;break t}se=st(se),te=st(te)}st=null}else st=null;he!==null&&ak(_e,ce,he,st,!1),We!==null&&an!==null&&ak(_e,an,We,st,!0)}}e:{if(ce=le?qs(le):window,he=ce.nodeName&&ce.nodeName.toLowerCase(),he==="select"||he==="input"&&ce.type==="file")var Ut=C1;else if(w1(ce))if(k1)Ut=R3;else{Ut=k3;var Ze=C3}else he=ce.nodeName,!he||he.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&Wg(le.elementType)&&(Ut=C1):Ut=E3;if(Ut&&(Ut=Ut(s,le))){S1(_e,Ut,u,ve);break e}Ze&&Ze(s,ce,le),s==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&Ve(ce,"number",ce.value)}switch(Ze=le?qs(le):window,s){case"focusin":(w1(Ze)||Ze.contentEditable==="true")&&(Xl=Ze,sv=le,zu=null);break;case"focusout":zu=sv=Xl=null;break;case"mousedown":ov=!0;break;case"contextmenu":case"mouseup":case"dragend":ov=!1,D1(_e,u,ve);break;case"selectionchange":if(N3)break;case"keydown":case"keyup":D1(_e,u,ve)}var bt;if(tv)e:{switch(s){case"compositionstart":var zt="onCompositionStart";break e;case"compositionend":zt="onCompositionEnd";break e;case"compositionupdate":zt="onCompositionUpdate";break e}zt=void 0}else Yl?y1(s,u)&&(zt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(zt="onCompositionStart");zt&&(v1&&u.locale!=="ko"&&(Yl||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&Yl&&(bt=h1()):(Fo=ve,Xg="value"in Fo?Fo.value:Fo.textContent,Yl=!0)),Ze=Kf(le,zt),0<Ze.length&&(zt=new p1(zt,s,null,u,ve),_e.push({event:zt,listeners:Ze}),bt?zt.data=bt:(bt=x1(u),bt!==null&&(zt.data=bt)))),(bt=_3?y3(s,u):x3(s,u))&&(zt=Kf(le,"onBeforeInput"),0<zt.length&&(Ze=new p1("onBeforeInput","beforeinput",null,u,ve),_e.push({event:Ze,listeners:zt}),Ze.data=bt)),hL(_e,s,le,u,ve)}sk(_e,a)})}function ad(s,a,u){return{instance:s,listener:a,currentTarget:u}}function Kf(s,a){for(var u=a+"Capture",m=[];s!==null;){var _=s,x=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||x===null||(_=Tu(s,u),_!=null&&m.unshift(ad(s,_,x)),_=Tu(s,a),_!=null&&m.push(ad(s,_,x))),s.tag===3)return m;s=s.return}return[]}function gL(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function ak(s,a,u,m,_){for(var x=a._reactName,T=[];u!==null&&u!==m;){var P=u,Q=P.alternate,le=P.stateNode;if(P=P.tag,Q!==null&&Q===m)break;P!==5&&P!==26&&P!==27||le===null||(Q=le,_?(le=Tu(u,x),le!=null&&T.unshift(ad(u,le,Q))):_||(le=Tu(u,x),le!=null&&T.push(ad(u,le,Q)))),u=u.return}T.length!==0&&s.push({event:a,listeners:T})}var vL=/\r\n?/g,bL=/\u0000|\uFFFD/g;function lk(s){return(typeof s=="string"?s:""+s).replace(vL,`
|
|
49
|
+
`).replace(bL,"")}function ck(s,a){return a=lk(a),lk(s)===a}function on(s,a,u,m,_,x){switch(u){case"children":typeof m=="string"?a==="body"||a==="textarea"&&m===""||Gr(s,m):(typeof m=="number"||typeof m=="bigint")&&a!=="body"&&Gr(s,""+m);break;case"className":V(s,"class",m);break;case"tabIndex":V(s,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":V(s,u,m);break;case"style":c1(s,m,x);break;case"data":if(a!=="object"){V(s,"data",m);break}case"src":case"href":if(m===""&&(a!=="a"||u!=="href")){s.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){s.removeAttribute(u);break}m=Qh(""+m),s.setAttribute(u,m);break;case"action":case"formAction":if(typeof m=="function"){s.setAttribute(u,"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"&&(u==="formAction"?(a!=="input"&&on(s,a,"name",_.name,_,null),on(s,a,"formEncType",_.formEncType,_,null),on(s,a,"formMethod",_.formMethod,_,null),on(s,a,"formTarget",_.formTarget,_,null)):(on(s,a,"encType",_.encType,_,null),on(s,a,"method",_.method,_,null),on(s,a,"target",_.target,_,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){s.removeAttribute(u);break}m=Qh(""+m),s.setAttribute(u,m);break;case"onClick":m!=null&&(s.onclick=Xs);break;case"onScroll":m!=null&&jt("scroll",s);break;case"onScrollEnd":m!=null&&jt("scrollend",s);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(u=m.__html,u!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"multiple":s.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":s.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"){s.removeAttribute("xlink:href");break}u=Qh(""+m),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);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"?s.setAttribute(u,""+m):s.removeAttribute(u);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"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":m===!0?s.setAttribute(u,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?s.setAttribute(u,m):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?s.setAttribute(u,m):s.removeAttribute(u);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?s.removeAttribute(u):s.setAttribute(u,m);break;case"popover":jt("beforetoggle",s),jt("toggle",s),Ks(s,"popover",m);break;case"xlinkActuate":nt(s,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":nt(s,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":nt(s,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":nt(s,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":nt(s,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":nt(s,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":nt(s,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":nt(s,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":nt(s,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Ks(s,"is",m);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=qO.get(u)||u,Ks(s,u,m))}}function jb(s,a,u,m,_,x){switch(u){case"style":c1(s,m,x);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(u=m.__html,u!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"children":typeof m=="string"?Gr(s,m):(typeof m=="number"||typeof m=="bigint")&&Gr(s,""+m);break;case"onScroll":m!=null&&jt("scroll",s);break;case"onScrollEnd":m!=null&&jt("scrollend",s);break;case"onClick":m!=null&&(s.onclick=Xs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ul.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(_=u.endsWith("Capture"),a=u.slice(2,_?u.length-7:void 0),x=s[$t]||null,x=x!=null?x[u]:null,typeof x=="function"&&s.removeEventListener(a,x,_),typeof m=="function")){typeof x!="function"&&x!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(a,m,_);break e}u in s?s[u]=m:m===!0?s.setAttribute(u,""):Ks(s,u,m)}}}function Tr(s,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",s),jt("load",s);var m=!1,_=!1,x;for(x in u)if(u.hasOwnProperty(x)){var T=u[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:on(s,a,x,T,u,null)}}_&&on(s,a,"srcSet",u.srcSet,u,null),m&&on(s,a,"src",u.src,u,null);return;case"input":jt("invalid",s);var P=x=T=_=null,Q=null,le=null;for(m in u)if(u.hasOwnProperty(m)){var ve=u[m];if(ve!=null)switch(m){case"name":_=ve;break;case"type":T=ve;break;case"checked":Q=ve;break;case"defaultChecked":le=ve;break;case"value":x=ve;break;case"defaultValue":P=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,a));break;default:on(s,a,m,ve,u,null)}}Se(s,x,P,Q,le,T,_,!1);return;case"select":jt("invalid",s),m=T=x=null;for(_ in u)if(u.hasOwnProperty(_)&&(P=u[_],P!=null))switch(_){case"value":x=P;break;case"defaultValue":T=P;break;case"multiple":m=P;default:on(s,a,_,P,u,null)}a=x,u=T,s.multiple=!!m,a!=null?It(s,!!m,a,!1):u!=null&&It(s,!!m,u,!0);return;case"textarea":jt("invalid",s),x=_=m=null;for(T in u)if(u.hasOwnProperty(T)&&(P=u[T],P!=null))switch(T){case"value":m=P;break;case"defaultValue":_=P;break;case"children":x=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(91));break;default:on(s,a,T,P,u,null)}Cr(s,m,_,x);return;case"option":for(Q in u)if(u.hasOwnProperty(Q)&&(m=u[Q],m!=null))switch(Q){case"selected":s.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:on(s,a,Q,m,u,null)}return;case"dialog":jt("beforetoggle",s),jt("toggle",s),jt("cancel",s),jt("close",s);break;case"iframe":case"object":jt("load",s);break;case"video":case"audio":for(m=0;m<od.length;m++)jt(od[m],s);break;case"image":jt("error",s),jt("load",s);break;case"details":jt("toggle",s);break;case"embed":case"source":case"link":jt("error",s),jt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in u)if(u.hasOwnProperty(le)&&(m=u[le],m!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:on(s,a,le,m,u,null)}return;default:if(Wg(a)){for(ve in u)u.hasOwnProperty(ve)&&(m=u[ve],m!==void 0&&jb(s,a,ve,m,u,void 0));return}}for(P in u)u.hasOwnProperty(P)&&(m=u[P],m!=null&&on(s,a,P,m,u,null))}function _L(s,a,u,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,P=null,Q=null,le=null,ve=null;for(he in u){var _e=u[he];if(u.hasOwnProperty(he)&&_e!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Q=_e;default:m.hasOwnProperty(he)||on(s,a,he,null,m,_e)}}for(var ce in m){var he=m[ce];if(_e=u[ce],m.hasOwnProperty(ce)&&(he!=null||_e!=null))switch(ce){case"type":x=he;break;case"name":_=he;break;case"checked":le=he;break;case"defaultChecked":ve=he;break;case"value":T=he;break;case"defaultValue":P=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,a));break;default:he!==_e&&on(s,a,ce,he,m,_e)}}ne(s,T,P,Q,le,ve,x,_);return;case"select":he=T=P=ce=null;for(x in u)if(Q=u[x],u.hasOwnProperty(x)&&Q!=null)switch(x){case"value":break;case"multiple":he=Q;default:m.hasOwnProperty(x)||on(s,a,x,null,m,Q)}for(_ in m)if(x=m[_],Q=u[_],m.hasOwnProperty(_)&&(x!=null||Q!=null))switch(_){case"value":ce=x;break;case"defaultValue":P=x;break;case"multiple":T=x;default:x!==Q&&on(s,a,_,x,m,Q)}a=P,u=T,m=he,ce!=null?It(s,!!u,ce,!1):!!m!=!!u&&(a!=null?It(s,!!u,a,!0):It(s,!!u,u?[]:"",!1));return;case"textarea":he=ce=null;for(P in u)if(_=u[P],u.hasOwnProperty(P)&&_!=null&&!m.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:on(s,a,P,null,m,_)}for(T in m)if(_=m[T],x=u[T],m.hasOwnProperty(T)&&(_!=null||x!=null))switch(T){case"value":ce=_;break;case"defaultValue":he=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==x&&on(s,a,T,_,m,x)}En(s,ce,he);return;case"option":for(var We in u)if(ce=u[We],u.hasOwnProperty(We)&&ce!=null&&!m.hasOwnProperty(We))switch(We){case"selected":s.selected=!1;break;default:on(s,a,We,null,m,ce)}for(Q in m)if(ce=m[Q],he=u[Q],m.hasOwnProperty(Q)&&ce!==he&&(ce!=null||he!=null))switch(Q){case"selected":s.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:on(s,a,Q,ce,m,he)}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 st in u)ce=u[st],u.hasOwnProperty(st)&&ce!=null&&!m.hasOwnProperty(st)&&on(s,a,st,null,m,ce);for(le in m)if(ce=m[le],he=u[le],m.hasOwnProperty(le)&&ce!==he&&(ce!=null||he!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,a));break;default:on(s,a,le,ce,m,he)}return;default:if(Wg(a)){for(var an in u)ce=u[an],u.hasOwnProperty(an)&&ce!==void 0&&!m.hasOwnProperty(an)&&jb(s,a,an,void 0,m,ce);for(ve in m)ce=m[ve],he=u[ve],!m.hasOwnProperty(ve)||ce===he||ce===void 0&&he===void 0||jb(s,a,ve,ce,m,he);return}}for(var se in u)ce=u[se],u.hasOwnProperty(se)&&ce!=null&&!m.hasOwnProperty(se)&&on(s,a,se,null,m,ce);for(_e in m)ce=m[_e],he=u[_e],!m.hasOwnProperty(_e)||ce===he||ce==null&&he==null||on(s,a,_e,ce,m,he)}function uk(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yL(){if(typeof performance.getEntriesByType=="function"){for(var s=0,a=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var _=u[m],x=_.transferSize,T=_.initiatorType,P=_.duration;if(x&&P&&uk(T)){for(T=0,P=_.responseEnd,m+=1;m<u.length;m++){var Q=u[m],le=Q.startTime;if(le>P)break;var ve=Q.transferSize,_e=Q.initiatorType;ve&&uk(_e)&&(Q=Q.responseEnd,T+=ve*(Q<P?1:(P-le)/(Q-le)))}if(--m,a+=8*(x+T)/(_.duration/1e3),s++,10<s)break}}if(0<s)return a/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Ab=null,Db=null;function Gf(s){return s.nodeType===9?s:s.ownerDocument}function dk(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hk(s,a){if(s===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&a==="foreignObject"?0:s}function Ob(s,a){return s==="textarea"||s==="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 Lb=null;function xL(){var s=window.event;return s&&s.type==="popstate"?s===Lb?!1:(Lb=s,!0):(Lb=null,!1)}var fk=typeof setTimeout=="function"?setTimeout:void 0,wL=typeof clearTimeout=="function"?clearTimeout:void 0,mk=typeof Promise=="function"?Promise:void 0,SL=typeof queueMicrotask=="function"?queueMicrotask:typeof mk<"u"?function(s){return mk.resolve(null).then(s).catch(CL)}:fk;function CL(s){setTimeout(function(){throw s})}function ra(s){return s==="head"}function pk(s,a){var u=a,m=0;do{var _=u.nextSibling;if(s.removeChild(u),_&&_.nodeType===8)if(u=_.data,u==="/$"||u==="/&"){if(m===0){s.removeChild(_),Sc(a);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")ld(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,ld(u);for(var x=u.firstChild;x;){var T=x.nextSibling,P=x.nodeName;x[ps]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=T}}else u==="body"&&ld(s.ownerDocument.body);u=_}while(u);Sc(a)}function gk(s,a){var u=s;s=0;do{var m=u.nextSibling;if(u.nodeType===1?a?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(a?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),m&&m.nodeType===8)if(u=m.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=m}while(u)}function zb(s){var a=s.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":zb(u),Bo(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function kL(s,a,u,m){for(;s.nodeType===1;){var _=u;if(s.nodeName.toLowerCase()!==a.toLowerCase()){if(!m&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(m){if(!s[ps])switch(a){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(x=s.getAttribute("rel"),x==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(x!==_.rel||s.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||s.getAttribute("title")!==(_.title==null?null:_.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(x=s.getAttribute("src"),(x!==(_.src==null?null:_.src)||s.getAttribute("type")!==(_.type==null?null:_.type)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&x&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(a==="input"&&s.type==="hidden"){var x=_.name==null?null:""+_.name;if(_.type==="hidden"&&s.getAttribute("name")===x)return s}else return s;if(s=Oi(s.nextSibling),s===null)break}return null}function EL(s,a,u){if(a==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Oi(s.nextSibling),s===null))return null;return s}function vk(s,a){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!a||(s=Oi(s.nextSibling),s===null))return null;return s}function Pb(s){return s.data==="$?"||s.data==="$~"}function Ib(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function RL(s,a){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=a;else if(s.data!=="$?"||u.readyState!=="loading")a();else{var m=function(){a(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),s._reactRetry=m}}function Oi(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return s}var Bb=null;function bk(s){s=s.nextSibling;for(var a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(a===0)return Oi(s.nextSibling);a--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||a++}s=s.nextSibling}return null}function _k(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(a===0)return s;a--}else u!=="/$"&&u!=="/&"||a++}s=s.previousSibling}return null}function yk(s,a,u){switch(a=Gf(u),s){case"html":if(s=a.documentElement,!s)throw Error(r(452));return s;case"head":if(s=a.head,!s)throw Error(r(453));return s;case"body":if(s=a.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function ld(s){for(var a=s.attributes;a.length;)s.removeAttributeNode(a[0]);Bo(s)}var Li=new Map,xk=new Set;function Yf(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var fo=U.d;U.d={f:TL,r:NL,D:ML,C:jL,L:AL,m:DL,X:LL,S:OL,M:zL};function TL(){var s=fo.f(),a=Ff();return s||a}function NL(s){var a=Ei(s);a!==null&&a.tag===5&&a.type==="form"?IS(a):fo.r(s)}var yc=typeof document>"u"?null:document;function wk(s,a,u){var m=yc;if(m&&typeof a=="string"&&a){var _=Y(a);_='link[rel="'+s+'"][href="'+_+'"]',typeof u=="string"&&(_+='[crossorigin="'+u+'"]'),xk.has(_)||(xk.add(_),s={rel:s,crossOrigin:u,href:a},m.querySelector(_)===null&&(a=m.createElement("link"),Tr(a,"link",s),wn(a),m.head.appendChild(a)))}}function ML(s){fo.D(s),wk("dns-prefetch",s,null)}function jL(s,a){fo.C(s,a),wk("preconnect",s,a)}function AL(s,a,u){fo.L(s,a,u);var m=yc;if(m&&s&&a){var _='link[rel="preload"][as="'+Y(a)+'"]';a==="image"&&u&&u.imageSrcSet?(_+='[imagesrcset="'+Y(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(_+='[imagesizes="'+Y(u.imageSizes)+'"]')):_+='[href="'+Y(s)+'"]';var x=_;switch(a){case"style":x=xc(s);break;case"script":x=wc(s)}Li.has(x)||(s=p({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:s,as:a},u),Li.set(x,s),m.querySelector(_)!==null||a==="style"&&m.querySelector(cd(x))||a==="script"&&m.querySelector(ud(x))||(a=m.createElement("link"),Tr(a,"link",s),wn(a),m.head.appendChild(a)))}}function DL(s,a){fo.m(s,a);var u=yc;if(u&&s){var m=a&&typeof a.as=="string"?a.as:"script",_='link[rel="modulepreload"][as="'+Y(m)+'"][href="'+Y(s)+'"]',x=_;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=wc(s)}if(!Li.has(x)&&(s=p({rel:"modulepreload",href:s},a),Li.set(x,s),u.querySelector(_)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(ud(x)))return}m=u.createElement("link"),Tr(m,"link",s),wn(m),u.head.appendChild(m)}}}function OL(s,a,u){fo.S(s,a,u);var m=yc;if(m&&s){var _=gs(m).hoistableStyles,x=xc(s);a=a||"default";var T=_.get(x);if(!T){var P={loading:0,preload:null};if(T=m.querySelector(cd(x)))P.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":a},u),(u=Li.get(x))&&Fb(s,u);var Q=T=m.createElement("link");wn(Q),Tr(Q,"link",s),Q._p=new Promise(function(le,ve){Q.onload=le,Q.onerror=ve}),Q.addEventListener("load",function(){P.loading|=1}),Q.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Xf(T,a,m)}T={type:"stylesheet",instance:T,count:1,state:P},_.set(x,T)}}}function LL(s,a){fo.X(s,a);var u=yc;if(u&&s){var m=gs(u).hoistableScripts,_=wc(s),x=m.get(_);x||(x=u.querySelector(ud(_)),x||(s=p({src:s,async:!0},a),(a=Li.get(_))&&Hb(s,a),x=u.createElement("script"),wn(x),Tr(x,"link",s),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},m.set(_,x))}}function zL(s,a){fo.M(s,a);var u=yc;if(u&&s){var m=gs(u).hoistableScripts,_=wc(s),x=m.get(_);x||(x=u.querySelector(ud(_)),x||(s=p({src:s,async:!0,type:"module"},a),(a=Li.get(_))&&Hb(s,a),x=u.createElement("script"),wn(x),Tr(x,"link",s),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},m.set(_,x))}}function Sk(s,a,u,m){var _=(_=ee.current)?Yf(_):null;if(!_)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=xc(u.href),u=gs(_).hoistableStyles,m=u.get(a),m||(m={type:"style",instance:null,count:0,state:null},u.set(a,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=xc(u.href);var x=gs(_).hoistableStyles,T=x.get(s);if(T||(_=_.ownerDocument||_,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(s,T),(x=_.querySelector(cd(s)))&&!x._p&&(T.instance=x,T.state.loading=5),Li.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Li.set(s,u),x||PL(_,s,u,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=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=wc(u),u=gs(_).hoistableScripts,m=u.get(a),m||(m={type:"script",instance:null,count:0,state:null},u.set(a,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function xc(s){return'href="'+Y(s)+'"'}function cd(s){return'link[rel="stylesheet"]['+s+"]"}function Ck(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function PL(s,a,u,m){s.querySelector('link[rel="preload"][as="style"]['+a+"]")?m.loading=1:(a=s.createElement("link"),m.preload=a,a.addEventListener("load",function(){return m.loading|=1}),a.addEventListener("error",function(){return m.loading|=2}),Tr(a,"link",u),wn(a),s.head.appendChild(a))}function wc(s){return'[src="'+Y(s)+'"]'}function ud(s){return"script[async]"+s}function kk(s,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var m=s.querySelector('style[data-href~="'+Y(u.href)+'"]');if(m)return a.instance=m,wn(m),m;var _=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(s.ownerDocument||s).createElement("style"),wn(m),Tr(m,"style",_),Xf(m,u.precedence,s),a.instance=m;case"stylesheet":_=xc(u.href);var x=s.querySelector(cd(_));if(x)return a.state.loading|=4,a.instance=x,wn(x),x;m=Ck(u),(_=Li.get(_))&&Fb(m,_),x=(s.ownerDocument||s).createElement("link"),wn(x);var T=x;return T._p=new Promise(function(P,Q){T.onload=P,T.onerror=Q}),Tr(x,"link",m),a.state.loading|=4,Xf(x,u.precedence,s),a.instance=x;case"script":return x=wc(u.src),(_=s.querySelector(ud(x)))?(a.instance=_,wn(_),_):(m=u,(_=Li.get(x))&&(m=p({},u),Hb(m,_)),s=s.ownerDocument||s,_=s.createElement("script"),wn(_),Tr(_,"link",m),s.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,Xf(m,u.precedence,s));return a.instance}function Xf(s,a,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=m.length?m[m.length-1]:null,x=_,T=0;T<m.length;T++){var P=m[T];if(P.dataset.precedence===a)x=P;else if(x!==_)break}x?x.parentNode.insertBefore(s,x.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(s,a.firstChild))}function Fb(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.title==null&&(s.title=a.title)}function Hb(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.integrity==null&&(s.integrity=a.integrity)}var Zf=null;function Ek(s,a,u){if(Zf===null){var m=new Map,_=Zf=new Map;_.set(u,m)}else _=Zf,m=_.get(u),m||(m=new Map,_.set(u,m));if(m.has(s))return m;for(m.set(s,null),u=u.getElementsByTagName(s),_=0;_<u.length;_++){var x=u[_];if(!(x[ps]||x[Gt]||s==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var T=x.getAttribute(a)||"";T=s+T;var P=m.get(T);P?P.push(x):m.set(T,[x])}}return m}function Rk(s,a,u){s=s.ownerDocument||s,s.head.insertBefore(u,a==="title"?s.querySelector("head > title"):null)}function IL(s,a,u){if(u===1||a.itemProp!=null)return!1;switch(s){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 s=a.disabled,typeof a.precedence=="string"&&s==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 Tk(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function BL(s,a,u,m){if(u.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var _=xc(m.href),x=a.querySelector(cd(_));if(x){a=x._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(s.count++,s=Qf.bind(s),a.then(s,s)),u.state.loading|=4,u.instance=x,wn(x);return}x=a.ownerDocument||a,m=Ck(m),(_=Li.get(_))&&Fb(m,_),x=x.createElement("link"),wn(x);var T=x;T._p=new Promise(function(P,Q){T.onload=P,T.onerror=Q}),Tr(x,"link",m),u.instance=x}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,a),(a=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=Qf.bind(s),a.addEventListener("load",u),a.addEventListener("error",u))}}var $b=0;function FL(s,a){return s.stylesheets&&s.count===0&&em(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var m=setTimeout(function(){if(s.stylesheets&&em(s,s.stylesheets),s.unsuspend){var x=s.unsuspend;s.unsuspend=null,x()}},6e4+a);0<s.imgBytes&&$b===0&&($b=62500*yL());var _=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&em(s,s.stylesheets),s.unsuspend)){var x=s.unsuspend;s.unsuspend=null,x()}},(s.imgBytes>$b?50:800)+a);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(m),clearTimeout(_)}}:null}function Qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)em(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Jf=null;function em(s,a){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Jf=new Map,a.forEach(HL,s),Jf=null,Qf.call(s))}function HL(s,a){if(!(a.state.loading&4)){var u=Jf.get(s);if(u)var m=u.get(null);else{u=new Map,Jf.set(s,u);for(var _=s.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<_.length;x++){var T=_[x];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(u.set(T.dataset.precedence,T),m=T)}m&&u.set(null,m)}_=a.instance,T=_.getAttribute("data-precedence"),x=u.get(T)||m,x===m&&u.set(null,_),u.set(T,_),this.count++,m=Qf.bind(this),_.addEventListener("load",m),_.addEventListener("error",m),x?x.parentNode.insertBefore(_,x.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(_,s.firstChild)),a.state.loading|=4}}var dd={$$typeof:E,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function $L(s,a,u,m,_,x,T,P,Q){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fn(0),this.hiddenUpdates=fn(null),this.identifierPrefix=m,this.onUncaughtError=_,this.onCaughtError=x,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function Nk(s,a,u,m,_,x,T,P,Q,le,ve,_e){return s=new $L(s,a,u,T,Q,le,ve,_e,P),a=1,x===!0&&(a|=24),x=ui(3,null,null,a),s.current=x,x.stateNode=s,a=xv(),a.refCount++,s.pooledCache=a,a.refCount++,x.memoizedState={element:m,isDehydrated:u,cache:a},kv(x),s}function Mk(s){return s?(s=Jl,s):Jl}function jk(s,a,u,m,_,x){_=Mk(_),m.context===null?m.context=_:m.pendingContext=_,m=qo(a),m.payload={element:u},x=x===void 0?null:x,x!==null&&(m.callback=x),u=Ko(s,m,a),u!==null&&(ei(u,s,a),Uu(u,s,a))}function Ak(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<a?u:a}}function Ub(s,a){Ak(s,a),(s=s.alternate)&&Ak(s,a)}function Dk(s){if(s.tag===13||s.tag===31){var a=Va(s,67108864);a!==null&&ei(a,s,67108864),Ub(s,67108864)}}function Ok(s){if(s.tag===13||s.tag===31){var a=pi();a=Ot(a);var u=Va(s,a);u!==null&&ei(u,s,a),Ub(s,a)}}var tm=!0;function UL(s,a,u,m){var _=D.T;D.T=null;var x=U.p;try{U.p=2,Vb(s,a,u,m)}finally{U.p=x,D.T=_}}function VL(s,a,u,m){var _=D.T;D.T=null;var x=U.p;try{U.p=8,Vb(s,a,u,m)}finally{U.p=x,D.T=_}}function Vb(s,a,u,m){if(tm){var _=Wb(m);if(_===null)Mb(s,a,m,nm,u),zk(s,m);else if(qL(_,s,a,u,m))m.stopPropagation();else if(zk(s,m),a&4&&-1<WL.indexOf(s)){for(;_!==null;){var x=Ei(_);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var T=Ft(x.pendingLanes);if(T!==0){var P=x;for(P.pendingLanes|=2,P.entangledLanes|=2;T;){var Q=1<<31-Fe(T);P.entanglements[1]|=Q,T&=~Q}xs(x),(Yt&6)===0&&(If=Nt()+500,sd(0))}}break;case 31:case 13:P=Va(x,2),P!==null&&ei(P,x,2),Ff(),Ub(x,2)}if(x=Wb(m),x===null&&Mb(s,a,m,nm,u),x===_)break;_=x}_!==null&&m.stopPropagation()}else Mb(s,a,m,null,u)}}function Wb(s){return s=Kg(s),qb(s)}var nm=null;function qb(s){if(nm=null,s=hr(s),s!==null){var a=o(s);if(a===null)s=null;else{var u=a.tag;if(u===13){if(s=l(a),s!==null)return s;s=null}else if(u===31){if(s=c(a),s!==null)return s;s=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null)}}return nm=s,null}function Lk(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(In()){case de:return 2;case oe:return 8;case xe:case ke:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var Kb=!1,ia=null,sa=null,oa=null,hd=new Map,fd=new Map,aa=[],WL="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 zk(s,a){switch(s){case"focusin":case"focusout":ia=null;break;case"dragenter":case"dragleave":sa=null;break;case"mouseover":case"mouseout":oa=null;break;case"pointerover":case"pointerout":hd.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":fd.delete(a.pointerId)}}function md(s,a,u,m,_,x){return s===null||s.nativeEvent!==x?(s={blockedOn:a,domEventName:u,eventSystemFlags:m,nativeEvent:x,targetContainers:[_]},a!==null&&(a=Ei(a),a!==null&&Dk(a)),s):(s.eventSystemFlags|=m,a=s.targetContainers,_!==null&&a.indexOf(_)===-1&&a.push(_),s)}function qL(s,a,u,m,_){switch(a){case"focusin":return ia=md(ia,s,a,u,m,_),!0;case"dragenter":return sa=md(sa,s,a,u,m,_),!0;case"mouseover":return oa=md(oa,s,a,u,m,_),!0;case"pointerover":var x=_.pointerId;return hd.set(x,md(hd.get(x)||null,s,a,u,m,_)),!0;case"gotpointercapture":return x=_.pointerId,fd.set(x,md(fd.get(x)||null,s,a,u,m,_)),!0}return!1}function Pk(s){var a=hr(s.target);if(a!==null){var u=o(a);if(u!==null){if(a=u.tag,a===13){if(a=l(u),a!==null){s.blockedOn=a,Qt(s.priority,function(){Ok(u)});return}}else if(a===31){if(a=c(u),a!==null){s.blockedOn=a,Qt(s.priority,function(){Ok(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function rm(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var u=Wb(s.nativeEvent);if(u===null){u=s.nativeEvent;var m=new u.constructor(u.type,u);qg=m,u.target.dispatchEvent(m),qg=null}else return a=Ei(u),a!==null&&Dk(a),s.blockedOn=u,!1;a.shift()}return!0}function Ik(s,a,u){rm(s)&&u.delete(a)}function KL(){Kb=!1,ia!==null&&rm(ia)&&(ia=null),sa!==null&&rm(sa)&&(sa=null),oa!==null&&rm(oa)&&(oa=null),hd.forEach(Ik),fd.forEach(Ik)}function im(s,a){s.blockedOn===a&&(s.blockedOn=null,Kb||(Kb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,KL)))}var sm=null;function Bk(s){sm!==s&&(sm=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){sm===s&&(sm=null);for(var a=0;a<s.length;a+=3){var u=s[a],m=s[a+1],_=s[a+2];if(typeof m!="function"){if(qb(m||u)===null)continue;break}var x=Ei(u);x!==null&&(s.splice(a,3),a-=3,Wv(x,{pending:!0,data:_,method:u.method,action:m},m,_))}}))}function Sc(s){function a(Q){return im(Q,s)}ia!==null&&im(ia,s),sa!==null&&im(sa,s),oa!==null&&im(oa,s),hd.forEach(a),fd.forEach(a);for(var u=0;u<aa.length;u++){var m=aa[u];m.blockedOn===s&&(m.blockedOn=null)}for(;0<aa.length&&(u=aa[0],u.blockedOn===null);)Pk(u),u.blockedOn===null&&aa.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var _=u[m],x=u[m+1],T=_[$t]||null;if(typeof x=="function")T||Bk(u);else if(T){var P=null;if(x&&x.hasAttribute("formAction")){if(_=x,T=x[$t]||null)P=T.formAction;else if(qb(_)!==null)continue}else P=T.action;typeof P=="function"?u[m+1]=P:(u.splice(m,3),m-=3),Bk(u)}}}function Fk(){function s(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(u,20)}function u(){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",s),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),_!==null&&(_(),_=null)}}}function Gb(s){this._internalRoot=s}om.prototype.render=Gb.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(r(409));var u=a.current,m=pi();jk(u,m,s,a,null,null)},om.prototype.unmount=Gb.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;jk(s.current,2,null,s,null,null),Ff(),a[Ar]=null}};function om(s){this._internalRoot=s}om.prototype.unstable_scheduleHydration=function(s){if(s){var a=mn();s={blockedOn:null,target:s,priority:a};for(var u=0;u<aa.length&&a!==0&&a<aa[u].priority;u++);aa.splice(u,0,s),u===0&&Pk(s)}};var Hk=t.version;if(Hk!=="19.2.1")throw Error(r(527,Hk,"19.2.1"));U.findDOMNode=function(s){var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=d(a),s=s!==null?g(s):null,s=s===null?null:s.stateNode,s};var GL={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var am=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!am.isDisabled&&am.supportsFiber)try{Ae=am.inject(GL),$e=am}catch{}}return vd.createRoot=function(s,a){if(!i(s))throw Error(r(299));var u=!1,m="",_=GS,x=YS,T=XS;return a!=null&&(a.unstable_strictMode===!0&&(u=!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=Nk(s,1,!1,null,null,u,m,null,_,x,T,Fk),s[Ar]=a.current,Nb(s),new Gb(a)},vd.hydrateRoot=function(s,a,u){if(!i(s))throw Error(r(299));var m=!1,_="",x=GS,T=YS,P=XS,Q=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(_=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(T=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError),u.formState!==void 0&&(Q=u.formState)),a=Nk(s,1,!0,a,u??null,m,_,Q,x,T,P,Fk),a.context=Mk(null),u=a.current,m=pi(),m=Ot(m),_=qo(m),_.callback=null,Ko(u,_,m),u=m,a.current.lanes=u,ze(a,u),xs(a),s[Ar]=a.current,Nb(s),new om(a)},vd.version="19.2.1",vd}var t2;function oz(){if(t2)return Zb.exports;t2=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(),Zb.exports=sz(),Zb.exports}var az=oz();/**
|
|
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 n2="popstate";function r2(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function lz(e={}){function t(r,i){var d;let o=(d=i.state)==null?void 0:d.masked,{pathname:l,search:c,hash:h}=o||r.location;return yy("",{pathname:l,search:c,hash:h},i.state&&i.state.usr||null,i.state&&i.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:rh(i)}return uz(t,n,null,e)}function Nn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Yi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function cz(){return Math.random().toString(36).substring(2,10)}function i2(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 yy(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?au(t):t,state:n,key:t&&t.key||r||cz(),unstable_mask:i}}function rh({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 au(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 uz(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,c="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(){c="POP";let C=g(),k=C==null?null:C-d;d=C,h&&h({action:c,location:S.location,delta:k})}function b(C,k){c="PUSH";let R=r2(C)?C:yy(S.location,C,k);d=g()+1;let E=i2(R,d),N=S.createHref(R.unstable_mask||R);try{l.pushState(E,"",N)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;i.location.assign(N)}o&&h&&h({action:c,location:S.location,delta:1})}function y(C,k){c="REPLACE";let R=r2(C)?C:yy(S.location,C,k);d=g();let E=i2(R,d),N=S.createHref(R.unstable_mask||R);l.replaceState(E,"",N),o&&h&&h({action:c,location:S.location,delta:0})}function w(C){return dz(C)}let S={get action(){return c},get location(){return e(i,l)},listen(C){if(h)throw new Error("A history only accepts one active listener");return i.addEventListener(n2,p),h=C,()=>{i.removeEventListener(n2,p),h=null}},createHref(C){return t(i,C)},createURL:w,encodeLocation(C){let k=w(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:b,replace:y,go(C){return l.go(C)}};return S}function dz(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Nn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:rh(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function MN(e,t,n="/"){return hz(e,t,n,!1)}function hz(e,t,n,r){let i=typeof t=="string"?au(t):t,o=Co(i.pathname||"/",n);if(o==null)return null;let l=jN(e);fz(l);let c=null;for(let h=0;c==null&&h<l.length;++h){let d=Cz(o);c=wz(l[h],d,r)}return c}function jN(e,t=[],n=[],r="",i=!1){let o=(l,c,h=i,d)=>{let g={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&h)return;Nn(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=zs([r,g.relativePath]),b=n.concat(g);l.children&&l.children.length>0&&(Nn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),jN(l.children,t,b,p,h)),!(l.path==null&&!l.index)&&t.push({path:p,score:yz(p,l.index),routesMeta:b})};return e.forEach((l,c)=>{var h;if(l.path===""||!((h=l.path)!=null&&h.includes("?")))o(l,c);else for(let d of AN(l.path))o(l,c,!0,d)}),t}function AN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=AN(r.join("/")),c=[];return c.push(...l.map(h=>h===""?o:[o,h].join("/"))),i&&c.push(...l),c.map(h=>e.startsWith("/")&&h===""?"/":h)}function fz(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xz(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var mz=/^:[\w-]+$/,pz=3,gz=2,vz=1,bz=10,_z=-2,s2=e=>e==="*";function yz(e,t){let n=e.split("/"),r=n.length;return n.some(s2)&&(r+=_z),t&&(r+=gz),n.filter(i=>!s2(i)).reduce((i,o)=>i+(mz.test(o)?pz:o===""?vz:bz),r)}function xz(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function wz(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",l=[];for(let c=0;c<r.length;++c){let h=r[c],d=c===r.length-1,g=o==="/"?t:t.slice(o.length)||"/",p=ap({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},g),b=h.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=ap({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!p)return null;Object.assign(i,p.params),l.push({params:i,pathname:zs([o,p.pathname]),pathnameBase:Tz(zs([o,p.pathnameBase])),route:b}),p.pathnameBase!=="/"&&(o=zs([o,p.pathnameBase]))}return l}function ap(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Sz(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],l=o.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:r.reduce((d,{paramName:g,isOptional:p},b)=>{if(g==="*"){let w=c[b]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const y=c[b];return p&&!y?d[g]=void 0:d[g]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:l,pattern:e}}function Sz(e,t=!1,n=!0){Yi(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,h,d,g)=>{if(r.push({paramName:c,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:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Cz(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Yi(!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 Co(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 kz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Ez(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?au(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=o2(n.substring(1),"/"):o=o2(n,t)):o=t,{pathname:o,search:Nz(r),hash:Mz(i)}}function o2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function t_(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 Rz(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function p0(e){let t=Rz(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Qp(e,t,n,r=!1){let i;typeof e=="string"?i=au(e):(i={...e},Nn(!i.pathname||!i.pathname.includes("?"),t_("?","pathname","search",i)),Nn(!i.pathname||!i.pathname.includes("#"),t_("#","pathname","hash",i)),Nn(!i.search||!i.search.includes("#"),t_("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,c;if(l==null)c=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let b=l.split("/");for(;b[0]==="..";)b.shift(),p-=1;i.pathname=b.join("/")}c=p>=0?t[p]:"/"}let h=Ez(i,c),d=l&&l!=="/"&&l.endsWith("/"),g=(o||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(d||g)&&(h.pathname+="/"),h}var zs=e=>e.join("/").replace(/\/\/+/g,"/"),Tz=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Nz=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mz=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,jz=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 Az(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Dz(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var DN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ON(e,t){let n=e;if(typeof n!="string"||!kz.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(DN)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),c=Co(l.pathname,t);l.origin===o.origin&&c!=null?n=c+l.search+l.hash:i=!0}catch{Yi(!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:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var LN=["POST","PUT","PATCH","DELETE"];new Set(LN);var Oz=["GET",...LN];new Set(Oz);var lu=v.createContext(null);lu.displayName="DataRouter";var Jp=v.createContext(null);Jp.displayName="DataRouterState";var Lz=v.createContext(!1),zN=v.createContext({isTransitioning:!1});zN.displayName="ViewTransition";var zz=v.createContext(new Map);zz.displayName="Fetchers";var Pz=v.createContext(null);Pz.displayName="Await";var ki=v.createContext(null);ki.displayName="Navigation";var Ch=v.createContext(null);Ch.displayName="Location";var Xi=v.createContext({outlet:null,matches:[],isDataRoute:!1});Xi.displayName="Route";var g0=v.createContext(null);g0.displayName="RouteError";var PN="REACT_ROUTER_ERROR",Iz="REDIRECT",Bz="ROUTE_ERROR_RESPONSE";function Fz(e){if(e.startsWith(`${PN}:${Iz}:{`))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 Hz(e){if(e.startsWith(`${PN}:${Bz}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new jz(t.status,t.statusText,t.data)}catch{}}function $z(e,{relative:t}={}){Nn(cu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(ki),{hash:i,pathname:o,search:l}=kh(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:zs([n,o])),r.createHref({pathname:c,search:l,hash:i})}function cu(){return v.useContext(Ch)!=null}function oi(){return Nn(cu(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Ch).location}var IN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function BN(e){v.useContext(ki).static||v.useLayoutEffect(e)}function Aa(){let{isDataRoute:e}=v.useContext(Xi);return e?nP():Uz()}function Uz(){Nn(cu(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(lu),{basename:t,navigator:n}=v.useContext(ki),{matches:r}=v.useContext(Xi),{pathname:i}=oi(),o=JSON.stringify(p0(r)),l=v.useRef(!1);return BN(()=>{l.current=!0}),v.useCallback((h,d={})=>{if(Yi(l.current,IN),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=Qp(h,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:zs([t,g.pathname])),(d.replace?n.replace:n.push)(g,d.state,d)},[t,n,o,i,e])}var FN=v.createContext(null);function eg(){return v.useContext(FN)}function Vz(e){let t=v.useContext(Xi).outlet;return v.useMemo(()=>t&&v.createElement(FN.Provider,{value:e},t),[t,e])}function HN(){let{matches:e}=v.useContext(Xi),t=e[e.length-1];return t?t.params:{}}function kh(e,{relative:t}={}){let{matches:n}=v.useContext(Xi),{pathname:r}=oi(),i=JSON.stringify(p0(n));return v.useMemo(()=>Qp(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function Wz(e,t){return $N(e,t)}function $N(e,t,n){var C;Nn(cu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=v.useContext(ki),{matches:i}=v.useContext(Xi),o=i[i.length-1],l=o?o.params:{},c=o?o.pathname:"/",h=o?o.pathnameBase:"/",d=o&&o.route;{let k=d&&d.path||"";VN(c,!d||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (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"?au(t):t;Nn(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 b=p.pathname||"/",y=b;if(h!=="/"){let k=h.replace(/^\//,"").split("/");y="/"+b.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=MN(e,{pathname:y});Yi(d||w!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Yi(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=Xz(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:zs([h,r.encodeLocation?r.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:zs([h,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),i,n);return t&&S?v.createElement(Ch.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},S):S}function qz(){let e=tP(),t=Az(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)",i={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=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:i},n):null,l)}var Kz=v.createElement(qz,null),UN=class extends v.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=Hz(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(Xi.Provider,{value:this.props.routeContext},v.createElement(g0.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(Gz,{error:e},t):t}};UN.contextType=Lz;var n_=new WeakMap;function Gz({children:e,error:t}){let{basename:n}=v.useContext(ki);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Fz(t.digest);if(r){let i=n_.get(t);if(i)throw i;let o=ON(r.location,n);if(DN&&!n_.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 n_.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Yz({routeContext:e,match:t,children:n}){let r=v.useContext(lu);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Xi.Provider,{value:e},n)}function Xz(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 i=e,o=r==null?void 0:r.errors;if(o!=null){let g=i.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);Nn(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,g+1))}let l=!1,c=-1;if(n&&r){l=r.renderFallback;for(let g=0;g<i.length;g++){let p=i[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=g),p.route.id){let{loaderData:b,errors:y}=r,w=p.route.loader&&!b.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||w){n.isStatic&&(l=!0),c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let h=n==null?void 0:n.onError,d=r&&h?(g,p)=>{var b,y;h(g,{location:r.location,params:((y=(b=r.matches)==null?void 0:b[0])==null?void 0:y.params)??{},unstable_pattern:Dz(r.matches),errorInfo:p})}:void 0;return i.reduceRight((g,p,b)=>{let y,w=!1,S=null,C=null;r&&(y=o&&p.route.id?o[p.route.id]:void 0,S=p.route.errorElement||Kz,l&&(c<0&&b===0?(VN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):c===b&&(w=!0,C=p.route.hydrateFallbackElement||null)));let k=t.concat(i.slice(0,b+1)),R=()=>{let E;return y?E=S:w?E=C:p.route.Component?E=v.createElement(p.route.Component,null):p.route.element?E=p.route.element:E=g,v.createElement(Yz,{match:p,routeContext:{outlet:g,matches:k,isDataRoute:r!=null},children:E})};return r&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?v.createElement(UN,{location:r.location,revalidation:r.revalidation,component:S,error:y,children:R(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):R()},null)}function v0(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zz(e){let t=v.useContext(lu);return Nn(t,v0(e)),t}function Qz(e){let t=v.useContext(Jp);return Nn(t,v0(e)),t}function Jz(e){let t=v.useContext(Xi);return Nn(t,v0(e)),t}function b0(e){let t=Jz(e),n=t.matches[t.matches.length-1];return Nn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function eP(){return b0("useRouteId")}function tP(){var r;let e=v.useContext(g0),t=Qz("useRouteError"),n=b0("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function nP(){let{router:e}=Zz("useNavigate"),t=b0("useNavigate"),n=v.useRef(!1);return BN(()=>{n.current=!0}),v.useCallback(async(i,o={})=>{Yi(n.current,IN),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var a2={};function VN(e,t,n){!t&&!a2[e]&&(a2[e]=!0,Yi(!1,n))}v.memo(rP);function rP({routes:e,future:t,state:n,isStatic:r,onError:i}){return $N(e,void 0,{state:n,isStatic:r,onError:i})}function iP({to:e,replace:t,state:n,relative:r}){Nn(cu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=v.useContext(ki);Yi(!i,"<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}=v.useContext(Xi),{pathname:l}=oi(),c=Aa(),h=Qp(e,p0(o),l,r==="path"),d=JSON.stringify(h);return v.useEffect(()=>{c(JSON.parse(d),{replace:t,state:n,relative:r})},[c,d,r,t,n]),null}function sP(e){return Vz(e.context)}function bo(e){Nn(!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 oP({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1,unstable_useTransitions:l}){Nn(!cu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),h=v.useMemo(()=>({basename:c,navigator:i,static:o,unstable_useTransitions:l,future:{}}),[c,i,o,l]);typeof n=="string"&&(n=au(n));let{pathname:d="/",search:g="",hash:p="",state:b=null,key:y="default",unstable_mask:w}=n,S=v.useMemo(()=>{let C=Co(d,c);return C==null?null:{location:{pathname:C,search:g,hash:p,state:b,key:y,unstable_mask:w},navigationType:r}},[c,d,g,p,b,y,r,w]);return Yi(S!=null,`<Router basename="${c}"> 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:v.createElement(ki.Provider,{value:h},v.createElement(Ch.Provider,{children:t,value:S}))}function aP({children:e,location:t}){return Wz(xy(e),t)}function xy(e,t=[]){let n=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let o=[...t,i];if(r.type===v.Fragment){n.push.apply(n,xy(r.props.children,o));return}Nn(r.type===bo,`[${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>`),Nn(!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=xy(r.props.children,o)),n.push(l)}),n}var Vm="get",Wm="application/x-www-form-urlencoded";function tg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function lP(e){return tg(e)&&e.tagName.toLowerCase()==="button"}function cP(e){return tg(e)&&e.tagName.toLowerCase()==="form"}function uP(e){return tg(e)&&e.tagName.toLowerCase()==="input"}function dP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hP(e,t){return e.button===0&&(!t||t==="_self")&&!dP(e)}function wy(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(i=>[n,i]):[[n,r]])},[]))}function fP(e,t){let n=wy(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var lm=null;function mP(){if(lm===null)try{new FormData(document.createElement("form"),0),lm=!1}catch{lm=!0}return lm}var pP=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function r_(e){return e!=null&&!pP.has(e)?(Yi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Wm}"`),null):e}function gP(e,t){let n,r,i,o,l;if(cP(e)){let c=e.getAttribute("action");r=c?Co(c,t):null,n=e.getAttribute("method")||Vm,i=r_(e.getAttribute("enctype"))||Wm,o=new FormData(e)}else if(lP(e)||uP(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||c.getAttribute("action");if(r=h?Co(h,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Vm,i=r_(e.getAttribute("formenctype"))||r_(c.getAttribute("enctype"))||Wm,o=new FormData(c,e),!mP()){let{name:d,type:g,value:p}=e;if(g==="image"){let b=d?`${d}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else d&&o.append(d,p)}}else{if(tg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Vm,r=null,i=Wm,l=e}return o&&i==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _0(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vP(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&Co(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function bP(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 _P(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 yP(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let l=await bP(o,n);return l.links?l.links():[]}return[]}));return CP(r.flat(1).filter(_P).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function l2(e,t,n,r,i,o){let l=(h,d)=>n[d]?h.route.id!==n[d].route.id:!0,c=(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)||c(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)||c(h,d))return!0;if(h.route.shouldRevalidate){let b=h.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.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 b=="boolean")return b}return!0}):[]}function xP(e,t,{includeHydrateFallback:n}={}){return wP(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function wP(e){return[...new Set(e)]}function SP(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function CP(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(SP(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function WN(){let e=v.useContext(lu);return _0(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function kP(){let e=v.useContext(Jp);return _0(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var y0=v.createContext(void 0);y0.displayName="FrameworkContext";function qN(){let e=v.useContext(y0);return _0(e,"You must render this element inside a <HydratedRouter> element"),e}function EP(e,t){let n=v.useContext(y0),[r,i]=v.useState(!1),[o,l]=v.useState(!1),{onFocus:c,onBlur:h,onMouseEnter:d,onMouseLeave:g,onTouchStart:p}=t,b=v.useRef(null);v.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=k=>{k.forEach(R=>{l(R.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(r){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[r]);let y=()=>{i(!0)},w=()=>{i(!1),l(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:bd(c,y),onBlur:bd(h,w),onMouseEnter:bd(d,y),onMouseLeave:bd(g,w),onTouchStart:bd(p,y)}]:[!1,b,{}]}function bd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function RP({page:e,...t}){let{router:n}=WN(),r=v.useMemo(()=>MN(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(NP,{page:e,matches:r,...t}):null}function TP(e){let{manifest:t,routeModules:n}=qN(),[r,i]=v.useState([]);return v.useEffect(()=>{let o=!1;return yP(e,t,n).then(l=>{o||i(l)}),()=>{o=!0}},[e,t,n]),r}function NP({page:e,matches:t,...n}){let r=oi(),{future:i,manifest:o,routeModules:l}=qN(),{basename:c}=WN(),{loaderData:h,matches:d}=kP(),g=v.useMemo(()=>l2(e,t,d,o,r,"data"),[e,t,d,o,r]),p=v.useMemo(()=>l2(e,t,d,o,r,"assets"),[e,t,d,o,r]),b=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,C=!1;if(t.forEach(R=>{var N;let E=o.routes[R.route.id];!E||!E.hasLoader||(!g.some(L=>L.route.id===R.route.id)&&R.route.id in h&&((N=l[R.route.id])!=null&&N.shouldRevalidate)||E.hasClientLoader?C=!0:S.add(R.route.id))}),S.size===0)return[];let k=vP(e,c,i.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]},[c,i.unstable_trailingSlashAwareDataRequests,h,r,o,g,t,e,l]),y=v.useMemo(()=>xP(p,o),[p,o]),w=TP(p);return v.createElement(v.Fragment,null,b.map(S=>v.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),y.map(S=>v.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),w.map(({key:S,link:C})=>v.createElement("link",{key:S,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function MP(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var jP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{jP&&(window.__reactRouterVersion="7.13.2")}catch{}function AP({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=v.useRef();i.current==null&&(i.current=lz({window:r,v5Compat:!0}));let o=i.current,[l,c]=v.useState({action:o.action,location:o.location}),h=v.useCallback(d=>{n===!1?c(d):v.startTransition(()=>c(d))},[n]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.createElement(oP,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var KN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ng=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:l,unstable_mask:c,state:h,target:d,to:g,preventScrollReset:p,viewTransition:b,unstable_defaultShouldRevalidate:y,...w},S){let{basename:C,navigator:k,unstable_useTransitions:R}=v.useContext(ki),E=typeof g=="string"&&KN.test(g),N=ON(g,C);g=N.to;let L=$z(g,{relative:i}),A=oi(),O=null;if(c){let K=Qp(c,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);C!=="/"&&(K.pathname=K.pathname==="/"?C:zs([C,K.pathname])),O=k.createHref(K)}let[H,Z,I]=EP(r,w),q=zP(g,{replace:l,unstable_mask:c,state:h,target:d,preventScrollReset:p,relative:i,viewTransition:b,unstable_defaultShouldRevalidate:y,unstable_useTransitions:R});function F(K){t&&t(K),K.defaultPrevented||q(K)}let $=!(N.isExternal||o),W=v.createElement("a",{...w,...I,href:($?O:void 0)||N.absoluteURL||L,onClick:$?F:t,ref:MP(S,Z),target:d,"data-discover":!E&&n==="render"?"true":void 0});return H&&!E?v.createElement(v.Fragment,null,W,v.createElement(RP,{page:L})):W});ng.displayName="Link";var DP=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:l,viewTransition:c,children:h,...d},g){let p=kh(l,{relative:d.relative}),b=oi(),y=v.useContext(Jp),{navigator:w,basename:S}=v.useContext(ki),C=y!=null&&$P(p)&&c===!0,k=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,R=b.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=Co(E,S)||E);const N=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let L=R===k||!i&&R.startsWith(k)&&R.charAt(N)==="/",A=E!=null&&(E===k||!i&&E.startsWith(k)&&E.charAt(k.length)==="/"),O={isActive:L,isPending:A,isTransitioning:C},H=L?t:void 0,Z;typeof r=="function"?Z=r(O):Z=[r,L?"active":null,A?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let I=typeof o=="function"?o(O):o;return v.createElement(ng,{...d,"aria-current":H,className:Z,ref:g,style:I,to:l,viewTransition:c},typeof h=="function"?h(O):h)});DP.displayName="NavLink";var OP=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:l=Vm,action:c,onSubmit:h,relative:d,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:b,...y},w)=>{let{unstable_useTransitions:S}=v.useContext(ki),C=FP(),k=HP(c,{relative:d}),R=l.toLowerCase()==="get"?"get":"post",E=typeof c=="string"&&KN.test(c),N=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let A=L.nativeEvent.submitter,O=(A==null?void 0:A.getAttribute("formmethod"))||l,H=()=>C(A||L.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:i,state:o,relative:d,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:b});S&&n!==!1?v.startTransition(()=>H()):H()};return v.createElement("form",{ref:w,method:R,action:k,onSubmit:r?h:N,...y,"data-discover":!E&&e==="render"?"true":void 0})});OP.displayName="Form";function LP(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function GN(e){let t=v.useContext(lu);return Nn(t,LP(e)),t}function zP(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:o,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:h,unstable_useTransitions:d}={}){let g=Aa(),p=oi(),b=kh(e,{relative:l});return v.useCallback(y=>{if(hP(y,t)){y.preventDefault();let w=n!==void 0?n:rh(p)===rh(b),S=()=>g(e,{replace:w,unstable_mask:r,state:i,preventScrollReset:o,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:h});d?v.startTransition(()=>S()):S()}},[p,g,b,n,r,i,t,e,o,l,c,h,d])}function PP(e){Yi(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=v.useRef(wy(e)),n=v.useRef(!1),r=oi(),i=v.useMemo(()=>fP(r.search,n.current?null:t.current),[r.search]),o=Aa(),l=v.useCallback((c,h)=>{const d=wy(typeof c=="function"?c(new URLSearchParams(i)):c);n.current=!0,o("?"+d,h)},[o,i]);return[i,l]}var IP=0,BP=()=>`__${String(++IP)}__`;function FP(){let{router:e}=GN("useSubmit"),{basename:t}=v.useContext(ki),n=eP(),r=e.fetch,i=e.navigate;return v.useCallback(async(o,l={})=>{let{action:c,method:h,encType:d,formData:g,body:p}=gP(o,t);if(l.navigate===!1){let b=l.fetcherKey||BP();await r(b,n,l.action||c,{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 i(l.action||c,{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,i,t,n])}function HP(e,{relative:t}={}){let{basename:n}=v.useContext(ki),r=v.useContext(Xi);Nn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...kh(e||".",{relative:t})},l=oi();if(e==null){o.search=l.search;let c=new URLSearchParams(o.search),h=c.getAll("index");if(h.some(g=>g==="")){c.delete("index"),h.filter(p=>p).forEach(p=>c.append("index",p));let g=c.toString();o.search=g?`?${g}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:zs([n,o.pathname])),rh(o)}function $P(e,{relative:t}={}){let n=v.useContext(zN);Nn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=GN("useViewTransitionState"),i=kh(e,{relative:t});if(!n.isTransitioning)return!1;let o=Co(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Co(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ap(i.pathname,l)!=null||ap(i.pathname,o)!=null}var os=NN();const YN=Zp(os);function UP(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 VP=e=>{switch(e){case"success":return KP;case"info":return YP;case"warning":return GP;case"error":return XP;default:return null}},WP=Array(12).fill(0),qP=({visible:e,className:t})=>we.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},we.createElement("div",{className:"sonner-spinner"},WP.map((n,r)=>we.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),KP=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},we.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"})),GP=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},we.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"})),YP=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},we.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"})),XP=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},we.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"})),ZP=we.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"},we.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),we.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),QP=()=>{const[e,t]=we.useState(document.hidden);return we.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Sy=1;class JP{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,...i}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Sy++,l=this.toasts.find(h=>h.id===o),c=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:c,title:r}):h):this.addToast({title:r,...i,dismissible:c,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 i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const c=i.then(async d=>{if(l=["resolve",d],we.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if(tI(d)&&!d.ok){o=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:b,...w})}else if(d instanceof Error){o=!1;const p=typeof n.error=="function"?await n.error(d):n.error,b=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:b,...w})}else if(n.success!==void 0){o=!1;const p=typeof n.success=="function"?await n.success(d):n.success,b=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:b,...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"&&!we.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)=>c.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)||Sy++;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 ii=new JP,eI=(e,t)=>{const n=(t==null?void 0:t.id)||Sy++;return ii.addToast({title:e,...t,id:n}),n},tI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",nI=eI,rI=()=>ii.toasts,iI=()=>ii.getActiveToasts(),Pc=Object.assign(nI,{success:ii.success,info:ii.info,warning:ii.warning,error:ii.error,custom:ii.custom,message:ii.message,promise:ii.promise,dismiss:ii.dismiss,loading:ii.loading},{getHistory:rI,getToasts:iI});UP("[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 cm(e){return e.label!==void 0}const sI=3,oI="24px",aI="16px",c2=4e3,lI=356,cI=14,uI=45,dI=200;function ws(...e){return e.filter(Boolean).join(" ")}function hI(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const fI=e=>{var t,n,r,i,o,l,c,h,d;const{invert:g,toast:p,unstyled:b,interacting:y,setHeights:w,visibleToasts:S,heights:C,index:k,toasts:R,expanded:E,removeToast:N,defaultRichColors:L,closeButton:A,style:O,cancelButtonStyle:H,actionButtonStyle:Z,className:I="",descriptionClassName:q="",duration:F,position:$,gap:W,expandByDefault:K,classNames:D,icons:U,closeButtonAriaLabel:z="Close toast"}=e,[G,M]=we.useState(null),[B,X]=we.useState(null),[j,ie]=we.useState(!1),[J,ee]=we.useState(!1),[re,ue]=we.useState(!1),[fe,ge]=we.useState(!1),[Ce,Re]=we.useState(!1),[je,Qe]=we.useState(0),[yt,Tt]=we.useState(0),me=we.useRef(p.duration||F||c2),Ue=we.useRef(null),Oe=we.useRef(null),mt=k===0,pt=k+1<=S,ot=p.type,dn=p.dismissible!==!1,Nt=p.className||"",In=p.descriptionClassName||"",de=we.useMemo(()=>C.findIndex(Pe=>Pe.toastId===p.id)||0,[C,p.id]),oe=we.useMemo(()=>{var Pe;return(Pe=p.closeButton)!=null?Pe:A},[p.closeButton,A]),xe=we.useMemo(()=>p.duration||F||c2,[p.duration,F]),ke=we.useRef(0),Ke=we.useRef(0),ct=we.useRef(0),Je=we.useRef(null),[Ae,$e]=$.split("-"),lt=we.useMemo(()=>C.reduce((Pe,vt,kt)=>kt>=de?Pe:Pe+vt.height,0),[C,de]),Fe=QP(),hn=p.invert||g,qt=ot==="loading";Ke.current=we.useMemo(()=>de*W+lt,[de,lt]),we.useEffect(()=>{me.current=xe},[xe]),we.useEffect(()=>{ie(!0)},[]),we.useEffect(()=>{const Pe=Oe.current;if(Pe){const vt=Pe.getBoundingClientRect().height;return Tt(vt),w(kt=>[{toastId:p.id,height:vt,position:p.position},...kt]),()=>w(kt=>kt.filter(Et=>Et.toastId!==p.id))}},[w,p.id]),we.useLayoutEffect(()=>{if(!j)return;const Pe=Oe.current,vt=Pe.style.height;Pe.style.height="auto";const kt=Pe.getBoundingClientRect().height;Pe.style.height=vt,Tt(kt),w(Et=>Et.find(ze=>ze.toastId===p.id)?Et.map(ze=>ze.toastId===p.id?{...ze,height:kt}:ze):[{toastId:p.id,height:kt,position:p.position},...Et])},[j,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const bn=we.useCallback(()=>{ee(!0),Qe(Ke.current),w(Pe=>Pe.filter(vt=>vt.toastId!==p.id)),setTimeout(()=>{N(p)},dI)},[p,N,w,Ke]);we.useEffect(()=>{if(p.promise&&ot==="loading"||p.duration===1/0||p.type==="loading")return;let Pe;return E||y||Fe?(()=>{if(ct.current<ke.current){const Et=new Date().getTime()-ke.current;me.current=me.current-Et}ct.current=new Date().getTime()})():(()=>{me.current!==1/0&&(ke.current=new Date().getTime(),Pe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),bn()},me.current))})(),()=>clearTimeout(Pe)},[E,y,p,ot,Fe,bn]),we.useEffect(()=>{p.delete&&(bn(),p.onDismiss==null||p.onDismiss.call(p,p))},[bn,p.delete]);function dr(){var Pe;if(U!=null&&U.loading){var vt;return we.createElement("div",{className:ws(D==null?void 0:D.loader,p==null||(vt=p.classNames)==null?void 0:vt.loader,"sonner-loader"),"data-visible":ot==="loading"},U.loading)}return we.createElement(qP,{className:ws(D==null?void 0:D.loader,p==null||(Pe=p.classNames)==null?void 0:Pe.loader),visible:ot==="loading"})}const er=p.icon||(U==null?void 0:U[ot])||VP(ot);var Kt,Ft;return we.createElement("li",{tabIndex:0,ref:Oe,className:ws(I,Nt,D==null?void 0:D.toast,p==null||(t=p.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[ot],p==null||(n=p.classNames)==null?void 0:n[ot]),"data-sonner-toast":"","data-rich-colors":(Kt=p.richColors)!=null?Kt:L,"data-styled":!(p.jsx||p.unstyled||b),"data-mounted":j,"data-promise":!!p.promise,"data-swiped":Ce,"data-removed":J,"data-visible":pt,"data-y-position":Ae,"data-x-position":$e,"data-index":k,"data-front":mt,"data-swiping":re,"data-dismissible":dn,"data-type":ot,"data-invert":hn,"data-swipe-out":fe,"data-swipe-direction":B,"data-expanded":!!(E||K&&j),"data-testid":p.testId,style:{"--index":k,"--toasts-before":k,"--z-index":R.length-k,"--offset":`${J?je:Ke.current}px`,"--initial-height":K?"auto":`${yt}px`,...O,...p.style},onDragEnd:()=>{ue(!1),M(null),Je.current=null},onPointerDown:Pe=>{Pe.button!==2&&(qt||!dn||(Ue.current=new Date,Qe(Ke.current),Pe.target.setPointerCapture(Pe.pointerId),Pe.target.tagName!=="BUTTON"&&(ue(!0),Je.current={x:Pe.clientX,y:Pe.clientY})))},onPointerUp:()=>{var Pe,vt,kt;if(fe||!dn)return;Je.current=null;const Et=Number(((Pe=Oe.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),fn=Number(((vt=Oe.current)==null?void 0:vt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ze=new Date().getTime()-((kt=Ue.current)==null?void 0:kt.getTime()),rt=G==="x"?Et:fn,xn=Math.abs(rt)/ze;if(Math.abs(rt)>=uI||xn>.11){Qe(Ke.current),p.onDismiss==null||p.onDismiss.call(p,p),X(G==="x"?Et>0?"right":"left":fn>0?"down":"up"),bn(),ge(!0);return}else{var Te,Le;(Te=Oe.current)==null||Te.style.setProperty("--swipe-amount-x","0px"),(Le=Oe.current)==null||Le.style.setProperty("--swipe-amount-y","0px")}Re(!1),ue(!1),M(null)},onPointerMove:Pe=>{var vt,kt,Et;if(!Je.current||!dn||((vt=window.getSelection())==null?void 0:vt.toString().length)>0)return;const ze=Pe.clientY-Je.current.y,rt=Pe.clientX-Je.current.x;var xn;const Te=(xn=e.swipeDirections)!=null?xn:hI($);!G&&(Math.abs(rt)>1||Math.abs(ze)>1)&&M(Math.abs(rt)>Math.abs(ze)?"x":"y");let Le={x:0,y:0};const Ot=ut=>1/(1.5+Math.abs(ut)/20);if(G==="y"){if(Te.includes("top")||Te.includes("bottom"))if(Te.includes("top")&&ze<0||Te.includes("bottom")&&ze>0)Le.y=ze;else{const ut=ze*Ot(ze);Le.y=Math.abs(ut)<Math.abs(ze)?ut:ze}}else if(G==="x"&&(Te.includes("left")||Te.includes("right")))if(Te.includes("left")&&rt<0||Te.includes("right")&&rt>0)Le.x=rt;else{const ut=rt*Ot(rt);Le.x=Math.abs(ut)<Math.abs(rt)?ut:rt}(Math.abs(Le.x)>0||Math.abs(Le.y)>0)&&Re(!0),(kt=Oe.current)==null||kt.style.setProperty("--swipe-amount-x",`${Le.x}px`),(Et=Oe.current)==null||Et.style.setProperty("--swipe-amount-y",`${Le.y}px`)}},oe&&!p.jsx&&ot!=="loading"?we.createElement("button",{"aria-label":z,"data-disabled":qt,"data-close-button":!0,onClick:qt||!dn?()=>{}:()=>{bn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ws(D==null?void 0:D.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Ft=U==null?void 0:U.close)!=null?Ft:ZP):null,(ot||p.icon||p.promise)&&p.icon!==null&&((U==null?void 0:U[ot])!==null||p.icon)?we.createElement("div",{"data-icon":"",className:ws(D==null?void 0:D.icon,p==null||(i=p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||dr():null,p.type!=="loading"?er:null):null,we.createElement("div",{"data-content":"",className:ws(D==null?void 0:D.content,p==null||(o=p.classNames)==null?void 0:o.content)},we.createElement("div",{"data-title":"",className:ws(D==null?void 0:D.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?we.createElement("div",{"data-description":"",className:ws(q,In,D==null?void 0:D.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),we.isValidElement(p.cancel)?p.cancel:p.cancel&&cm(p.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||H,onClick:Pe=>{cm(p.cancel)&&dn&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Pe),bn())},className:ws(D==null?void 0:D.cancelButton,p==null||(h=p.classNames)==null?void 0:h.cancelButton)},p.cancel.label):null,we.isValidElement(p.action)?p.action:p.action&&cm(p.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||Z,onClick:Pe=>{cm(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Pe),!Pe.defaultPrevented&&bn())},className:ws(D==null?void 0:D.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function u2(){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 mI(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,l=o?"--mobile-offset":"--offset",c=o?aI:oI;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}`]=c:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):h(c)}),n}const pI=we.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:h,className:d,offset:g,mobileOffset:p,theme:b="light",richColors:y,duration:w,style:S,visibleToasts:C=sI,toastOptions:k,dir:R=u2(),gap:E=cI,icons:N,containerAriaLabel:L="Notifications"}=t,[A,O]=we.useState([]),H=we.useMemo(()=>r?A.filter(j=>j.toasterId===r):A.filter(j=>!j.toasterId),[A,r]),Z=we.useMemo(()=>Array.from(new Set([o].concat(H.filter(j=>j.position).map(j=>j.position)))),[H,o]),[I,q]=we.useState([]),[F,$]=we.useState(!1),[W,K]=we.useState(!1),[D,U]=we.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=we.useRef(null),G=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=we.useRef(null),B=we.useRef(!1),X=we.useCallback(j=>{O(ie=>{var J;return(J=ie.find(ee=>ee.id===j.id))!=null&&J.delete||ii.dismiss(j.id),ie.filter(({id:ee})=>ee!==j.id)})},[]);return we.useEffect(()=>ii.subscribe(j=>{if(j.dismiss){requestAnimationFrame(()=>{O(ie=>ie.map(J=>J.id===j.id?{...J,delete:!0}:J))});return}setTimeout(()=>{YN.flushSync(()=>{O(ie=>{const J=ie.findIndex(ee=>ee.id===j.id);return J!==-1?[...ie.slice(0,J),{...ie[J],...j},...ie.slice(J+1)]:[j,...ie]})})})}),[A]),we.useEffect(()=>{if(b!=="system"){U(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const j=window.matchMedia("(prefers-color-scheme: dark)");try{j.addEventListener("change",({matches:ie})=>{U(ie?"dark":"light")})}catch{j.addListener(({matches:J})=>{try{U(J?"dark":"light")}catch(ee){console.error(ee)}})}},[b]),we.useEffect(()=>{A.length<=1&&$(!1)},[A]),we.useEffect(()=>{const j=ie=>{var J;if(l.every(ue=>ie[ue]||ie.code===ue)){var re;$(!0),(re=z.current)==null||re.focus()}ie.code==="Escape"&&(document.activeElement===z.current||(J=z.current)!=null&&J.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[l]),we.useEffect(()=>{if(z.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,B.current=!1)}},[z.current]),we.createElement("section",{ref:n,"aria-label":`${L} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Z.map((j,ie)=>{var J;const[ee,re]=j.split("-");return H.length?we.createElement("ol",{key:j,dir:R==="auto"?u2():R,tabIndex:-1,ref:z,className:d,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ee,"data-x-position":re,style:{"--front-toast-height":`${((J=I[0])==null?void 0:J.height)||0}px`,"--width":`${lI}px`,"--gap":`${E}px`,...S,...mI(g,p)},onBlur:ue=>{B.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(B.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||B.current||(B.current=!0,M.current=ue.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{W||$(!1)},onDragEnd:()=>$(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},H.filter(ue=>!ue.position&&ie===0||ue.position===j).map((ue,fe)=>{var ge,Ce;return we.createElement(fI,{key:ue.id,icons:N,index:fe,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:i,visibleToasts:C,closeButton:(Ce=k==null?void 0:k.closeButton)!=null?Ce:h,interacting:W,position:j,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(Re=>Re.position==ue.position),heights:I.filter(Re=>Re.position==ue.position),setHeights:q,expandByDefault:c,gap:E,expanded:F,swipeDirections:t.swipeDirections})})):null}))});function XN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=XN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ZN(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=XN(e))&&(r&&(r+=" "),r+=t);return r}const d2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,h2=ZN,gI=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return h2(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(d=>{const g=n==null?void 0:n[d],p=o==null?void 0:o[d];if(g===null)return null;const b=d2(g)||d2(p);return i[d][b]}),c=n&&Object.entries(n).reduce((d,g)=>{let[p,b]=g;return b===void 0||(d[p]=b),d},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,g)=>{let{class:p,className:b,...y}=g;return Object.entries(y).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...o,...c}[S]):{...o,...c}[S]===C})?[...d,p,b]:d},[]);return h2(e,l,h,n==null?void 0:n.class,n==null?void 0:n.className)},vI=(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},bI=(e,t)=>({classGroupId:e,validator:t}),QN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),lp="-",f2=[],_I="arbitrary..",yI=e=>{const t=wI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return xI(l);const c=l.split(lp),h=c[0]===""&&c.length>1?1:0;return JN(c,h,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const h=r[l],d=n[l];return h?d?vI(d,h):h:d||f2}return n[l]||f2}}},JN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const d=JN(e,t+1,o);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(lp):e.slice(t).join(lp),h=l.length;for(let d=0;d<h;d++){const g=l[d];if(g.validator(c))return g.classGroupId}},xI=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?_I+r:void 0})(),wI=e=>{const{theme:t,classGroups:n}=e;return SI(n,t)},SI=(e,t)=>{const n=QN();for(const r in e){const i=e[r];x0(i,n,r,t)}return n},x0=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const l=e[o];CI(l,t,n,r)}},CI=(e,t,n,r)=>{if(typeof e=="string"){kI(e,t,n);return}if(typeof e=="function"){EI(e,t,n,r);return}RI(e,t,n,r)},kI=(e,t,n)=>{const r=e===""?t:e5(t,e);r.classGroupId=n},EI=(e,t,n,r)=>{if(TI(e)){x0(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(bI(n,e))},RI=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let l=0;l<o;l++){const[c,h]=i[l];x0(h,e5(t,c),n,r)}},e5=(e,t)=>{let n=e;const r=t.split(lp),i=r.length;for(let o=0;o<i;o++){const l=r[o];let c=n.nextPart.get(l);c||(c=QN(),n.nextPart.set(l,c)),n=c}return n},TI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,NI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(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 i(o,l),l},set(o,l){o in n?n[o]=l:i(o,l)}}},Cy="!",m2=":",MI=[],p2=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),jI=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let l=0,c=0,h=0,d;const g=i.length;for(let S=0;S<g;S++){const C=i[S];if(l===0&&c===0){if(C===m2){o.push(i.slice(h,S)),h=S+1;continue}if(C==="/"){d=S;continue}}C==="["?l++:C==="]"?l--:C==="("?c++:C===")"&&c--}const p=o.length===0?i:i.slice(h);let b=p,y=!1;p.endsWith(Cy)?(b=p.slice(0,-1),y=!0):p.startsWith(Cy)&&(b=p.slice(1),y=!0);const w=d&&d>h?d-h:void 0;return p2(o,y,b,w)};if(t){const i=t+m2,o=r;r=l=>l.startsWith(i)?o(l.slice(i.length)):p2(MI,!1,l,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},AI=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const l=n[o],c=l[0]==="[",h=t.has(l);c||h?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},DI=e=>({cache:NI(e.cacheSize),parseClassName:jI(e),sortModifiers:AI(e),...yI(e)}),OI=/\s+/,LI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,l=[],c=e.trim().split(OI);let h="";for(let d=c.length-1;d>=0;d-=1){const g=c[d],{isExternal:p,modifiers:b,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=b.length===0?"":b.length===1?b[0]:o(b).join(":"),E=y?R+Cy:R,N=E+k;if(l.indexOf(N)>-1)continue;l.push(N);const L=i(k,C);for(let A=0;A<L.length;++A){const O=L[A];l.push(E+O)}h=g+(h.length>0?" "+h:h)}return h},zI=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=t5(n))&&(i&&(i+=" "),i+=r);return i},t5=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=t5(e[r]))&&(n&&(n+=" "),n+=t);return n},PI=(e,...t)=>{let n,r,i,o;const l=h=>{const d=t.reduce((g,p)=>p(g),e());return n=DI(d),r=n.cache.get,i=n.cache.set,o=c,c(h)},c=h=>{const d=r(h);if(d)return d;const g=LI(h,n);return i(h,g),g};return o=l,(...h)=>o(zI(...h))},II=[],ir=e=>{const t=n=>n[e]||II;return t.isThemeGetter=!0,t},n5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,r5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,BI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,FI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HI=/\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$/,$I=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,UI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ca=e=>BI.test(e),wt=e=>!!e&&!Number.isNaN(Number(e)),ua=e=>!!e&&Number.isInteger(Number(e)),i_=e=>e.endsWith("%")&&wt(e.slice(0,-1)),mo=e=>FI.test(e),i5=()=>!0,WI=e=>HI.test(e)&&!$I.test(e),w0=()=>!1,qI=e=>UI.test(e),KI=e=>VI.test(e),GI=e=>!qe(e)&&!Ge(e),YI=e=>Da(e,a5,w0),qe=e=>n5.test(e),rl=e=>Da(e,l5,WI),g2=e=>Da(e,r6,wt),XI=e=>Da(e,u5,i5),ZI=e=>Da(e,c5,w0),v2=e=>Da(e,s5,w0),QI=e=>Da(e,o5,KI),um=e=>Da(e,d5,qI),Ge=e=>r5.test(e),_d=e=>Ol(e,l5),JI=e=>Ol(e,c5),b2=e=>Ol(e,s5),e6=e=>Ol(e,a5),t6=e=>Ol(e,o5),dm=e=>Ol(e,d5,!0),n6=e=>Ol(e,u5,!0),Da=(e,t,n)=>{const r=n5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ol=(e,t,n=!1)=>{const r=r5.exec(e);return r?r[1]?t(r[1]):n:!1},s5=e=>e==="position"||e==="percentage",o5=e=>e==="image"||e==="url",a5=e=>e==="length"||e==="size"||e==="bg-size",l5=e=>e==="length",r6=e=>e==="number",c5=e=>e==="family-name",u5=e=>e==="number"||e==="weight",d5=e=>e==="shadow",i6=()=>{const e=ir("color"),t=ir("font"),n=ir("text"),r=ir("font-weight"),i=ir("tracking"),o=ir("leading"),l=ir("breakpoint"),c=ir("container"),h=ir("spacing"),d=ir("radius"),g=ir("shadow"),p=ir("inset-shadow"),b=ir("text-shadow"),y=ir("drop-shadow"),w=ir("blur"),S=ir("perspective"),C=ir("aspect"),k=ir("ease"),R=ir("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...N(),Ge,qe],A=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],H=()=>[Ge,qe,h],Z=()=>[ca,"full","auto",...H()],I=()=>[ua,"none","subgrid",Ge,qe],q=()=>["auto",{span:["full",ua,Ge,qe]},ua,Ge,qe],F=()=>[ua,"auto",Ge,qe],$=()=>["auto","min","max","fr",Ge,qe],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...H()],U=()=>[ca,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],z=()=>[ca,"screen","full","dvw","lvw","svw","min","max","fit",...H()],G=()=>[ca,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],M=()=>[e,Ge,qe],B=()=>[...N(),b2,v2,{position:[Ge,qe]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",e6,YI,{size:[Ge,qe]}],ie=()=>[i_,_d,rl],J=()=>["","none","full",d,Ge,qe],ee=()=>["",wt,_d,rl],re=()=>["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"],fe=()=>[wt,i_,b2,v2],ge=()=>["","none",w,Ge,qe],Ce=()=>["none",wt,Ge,qe],Re=()=>["none",wt,Ge,qe],je=()=>[wt,Ge,qe],Qe=()=>[ca,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mo],breakpoint:[mo],color:[i5],container:[mo],"drop-shadow":[mo],ease:["in","out","in-out"],font:[GI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mo],shadow:[mo],spacing:["px",wt],text:[mo],"text-shadow":[mo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ca,qe,Ge,C]}],container:["container"],columns:[{columns:[wt,qe,Ge,c]}],"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:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[ua,"auto",Ge,qe]}],basis:[{basis:[ca,"full","auto",c,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[wt,ca,"auto","initial","none",qe]}],grow:[{grow:["",wt,Ge,qe]}],shrink:[{shrink:["",wt,Ge,qe]}],order:[{order:[ua,"first","last","none",Ge,qe]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],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:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],"inline-size":[{inline:["auto",...z()]}],"min-inline-size":[{"min-inline":["auto",...z()]}],"max-inline-size":[{"max-inline":["none",...z()]}],"block-size":[{block:["auto",...G()]}],"min-block-size":[{"min-block":["auto",...G()]}],"max-block-size":[{"max-block":["none",...G()]}],w:[{w:[c,"screen",...U()]}],"min-w":[{"min-w":[c,"screen","none",...U()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",n,_d,rl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,n6,XI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",i_,qe]}],"font-family":[{font:[JI,ZI,t]}],"font-features":[{"font-features":[qe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ge,qe]}],"line-clamp":[{"line-clamp":[wt,"none",Ge,g2]}],leading:[{leading:[o,...H()]}],"list-image":[{"list-image":["none",Ge,qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[wt,"from-font","auto",Ge,rl]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[wt,"auto",Ge,qe]}],"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,qe]}],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,qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ua,Ge,qe],radial:["",Ge,qe],conic:[ua,Ge,qe]},t6,QI]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[wt,Ge,qe]}],"outline-w":[{outline:["",wt,_d,rl]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",g,dm,um]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",p,dm,um]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[wt,rl]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",b,dm,um]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[wt,Ge,qe]}],"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":[wt]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Ge,qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[wt]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,qe]}],filter:[{filter:["","none",Ge,qe]}],blur:[{blur:ge()}],brightness:[{brightness:[wt,Ge,qe]}],contrast:[{contrast:[wt,Ge,qe]}],"drop-shadow":[{"drop-shadow":["","none",y,dm,um]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",wt,Ge,qe]}],"hue-rotate":[{"hue-rotate":[wt,Ge,qe]}],invert:[{invert:["",wt,Ge,qe]}],saturate:[{saturate:[wt,Ge,qe]}],sepia:[{sepia:["",wt,Ge,qe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,qe]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[wt,Ge,qe]}],"backdrop-contrast":[{"backdrop-contrast":[wt,Ge,qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",wt,Ge,qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[wt,Ge,qe]}],"backdrop-invert":[{"backdrop-invert":["",wt,Ge,qe]}],"backdrop-opacity":[{"backdrop-opacity":[wt,Ge,qe]}],"backdrop-saturate":[{"backdrop-saturate":[wt,Ge,qe]}],"backdrop-sepia":[{"backdrop-sepia":["",wt,Ge,qe]}],"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,qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[wt,"initial",Ge,qe]}],ease:[{ease:["linear","initial",k,Ge,qe]}],delay:[{delay:[wt,Ge,qe]}],animate:[{animate:["none",R,Ge,qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ge,qe]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:Re()}],"scale-x":[{"scale-x":Re()}],"scale-y":[{"scale-y":Re()}],"scale-z":[{"scale-z":Re()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[Ge,qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ge,qe]}],"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,qe]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[wt,_d,rl,g2]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},s6=PI(i6);function pe(...e){return s6(ZN(e))}function Vd(){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 _2(e){return e.startsWith("chatId:")?e.slice(7):e}const h5=gI("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"}}),Xe=v.forwardRef(({className:e,variant:t,size:n,...r},i)=>f.jsx("button",{className:pe(h5({variant:t,size:n,className:e})),ref:i,...r}));Xe.displayName="Button";function He(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function y2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function S0(...e){return t=>{let n=!1;const r=e.map(i=>{const o=y2(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():y2(e[i],null)}}}}function Zt(...e){return v.useCallback(S0(...e),e)}function o6(e,t){const n=v.createContext(t),r=o=>{const{children:l,...c}=o,h=v.useMemo(()=>c,Object.values(c));return f.jsx(n.Provider,{value:h,children:l})};r.displayName=e+"Provider";function i(o){const l=v.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function jo(e,t=[]){let n=[];function r(o,l){const c=v.createContext(l),h=n.length;n=[...n,l];const d=p=>{var k;const{scope:b,children:y,...w}=p,S=((k=b==null?void 0:b[e])==null?void 0:k[h])||c,C=v.useMemo(()=>w,Object.values(w));return f.jsx(S.Provider,{value:C,children:y})};d.displayName=o+"Provider";function g(p,b){var S;const y=((S=b==null?void 0:b[e])==null?void 0:S[h])||c,w=v.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 i=()=>{const o=n.map(l=>v.createContext(l));return function(c){const h=(c==null?void 0:c[e])||o;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:h}}),[c,h])}};return i.scopeName=e,[r,a6(i,...t)]}function a6(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((c,{useScope:h,scopeName:d})=>{const p=h(o)[`__scope${d}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Pr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},l6=TN[" useId ".trim().toString()]||(()=>{}),c6=0;function So(e){const[t,n]=v.useState(l6());return Pr(()=>{n(r=>r??String(c6++))},[e]),t?`radix-${t}`:""}var u6=TN[" useInsertionEffect ".trim().toString()]||Pr;function Yc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=d6({defaultProp:t,onChange:n}),c=e!==void 0,h=c?e:i;{const g=v.useRef(e!==void 0);v.useEffect(()=>{const p=g.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"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=c},[c,r])}const d=v.useCallback(g=>{var p;if(c){const b=h6(g)?g(e):g;b!==e&&((p=l.current)==null||p.call(l,b))}else o(g)},[c,e,o,l]);return[h,d]}function d6({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),i=v.useRef(n),o=v.useRef(t);return u6(()=>{o.current=t},[t]),v.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function h6(e){return typeof e=="function"}function wl(e){const t=f6(e),n=v.forwardRef((r,i)=>{const{children:o,...l}=r,c=v.Children.toArray(o),h=c.find(p6);if(h){const d=h.props.children,g=c.map(p=>p===h?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return f.jsx(t,{...l,ref:i,children:v.isValidElement(d)?v.cloneElement(d,void 0,g):null})}return f.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function f6(e){const t=v.forwardRef((n,r)=>{const{children:i,...o}=n;if(v.isValidElement(i)){const l=v6(i),c=g6(o,i.props);return i.type!==v.Fragment&&(c.ref=r?S0(r,l):l),v.cloneElement(i,c)}return v.Children.count(i)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var f5=Symbol("radix.slottable");function m6(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=f5,t}function p6(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===f5}function g6(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...c)=>{const h=o(...c);return i(...c),h}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function v6(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var b6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dt=b6.reduce((e,t)=>{const n=wl(`Primitive.${t}`),r=v.forwardRef((i,o)=>{const{asChild:l,...c}=i,h=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(h,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function m5(e,t){e&&os.flushSync(()=>e.dispatchEvent(t))}function cs(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function _6(e,t=globalThis==null?void 0:globalThis.document){const n=cs(e);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var y6="DismissableLayer",ky="dismissableLayer.update",x6="dismissableLayer.pointerDownOutside",w6="dismissableLayer.focusOutside",x2,p5=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),uu=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:c,...h}=e,d=v.useContext(p5),[g,p]=v.useState(null),b=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=v.useState({}),w=Zt(t,O=>p(O)),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,N=R>=k,L=k6(O=>{const H=O.target,Z=[...d.branches].some(I=>I.contains(H));!N||Z||(i==null||i(O),l==null||l(O),O.defaultPrevented||c==null||c())},b),A=E6(O=>{const H=O.target;[...d.branches].some(I=>I.contains(H))||(o==null||o(O),l==null||l(O),O.defaultPrevented||c==null||c())},b);return _6(O=>{R===d.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},b),v.useEffect(()=>{if(g)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(x2=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(g)),d.layers.add(g),w2(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=x2)}},[g,b,n,d]),v.useEffect(()=>()=>{g&&(d.layers.delete(g),d.layersWithOutsidePointerEventsDisabled.delete(g),w2())},[g,d]),v.useEffect(()=>{const O=()=>y({});return document.addEventListener(ky,O),()=>document.removeEventListener(ky,O)},[]),f.jsx(Dt.div,{...h,ref:w,style:{pointerEvents:E?N?"auto":"none":void 0,...e.style},onFocusCapture:He(e.onFocusCapture,A.onFocusCapture),onBlurCapture:He(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:He(e.onPointerDownCapture,L.onPointerDownCapture)})});uu.displayName=y6;var S6="DismissableLayerBranch",C6=v.forwardRef((e,t)=>{const n=v.useContext(p5),r=v.useRef(null),i=Zt(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),f.jsx(Dt.div,{...e,ref:i})});C6.displayName=S6;function k6(e,t=globalThis==null?void 0:globalThis.document){const n=cs(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let h=function(){g5(x6,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=h,t.addEventListener("click",i.current,{once:!0})):h()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function E6(e,t=globalThis==null?void 0:globalThis.document){const n=cs(e),r=v.useRef(!1);return v.useEffect(()=>{const i=o=>{o.target&&!r.current&&g5(w6,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function w2(){const e=new CustomEvent(ky);document.dispatchEvent(e)}function g5(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?m5(i,o):i.dispatchEvent(o)}var s_="focusScope.autoFocusOnMount",o_="focusScope.autoFocusOnUnmount",S2={bubbles:!1,cancelable:!0},R6="FocusScope",Eh=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[c,h]=v.useState(null),d=cs(i),g=cs(o),p=v.useRef(null),b=Zt(t,S=>h(S)),y=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let S=function(E){if(y.paused||!c)return;const N=E.target;c.contains(N)?p.current=N:ga(p.current,{select:!0})},C=function(E){if(y.paused||!c)return;const N=E.relatedTarget;N!==null&&(c.contains(N)||ga(p.current,{select:!0}))},k=function(E){if(document.activeElement===document.body)for(const L of E)L.removedNodes.length>0&&ga(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const R=new MutationObserver(k);return c&&R.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),R.disconnect()}}},[r,c,y.paused]),v.useEffect(()=>{if(c){k2.add(y);const S=document.activeElement;if(!c.contains(S)){const k=new CustomEvent(s_,S2);c.addEventListener(s_,d),c.dispatchEvent(k),k.defaultPrevented||(T6(D6(v5(c)),{select:!0}),document.activeElement===S&&ga(c))}return()=>{c.removeEventListener(s_,d),setTimeout(()=>{const k=new CustomEvent(o_,S2);c.addEventListener(o_,g),c.dispatchEvent(k),k.defaultPrevented||ga(S??document.body,{select:!0}),c.removeEventListener(o_,g),k2.remove(y)},0)}}},[c,d,g,y]);const w=v.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,N]=N6(R);E&&N?!S.shiftKey&&k===N?(S.preventDefault(),n&&ga(E,{select:!0})):S.shiftKey&&k===E&&(S.preventDefault(),n&&ga(N,{select:!0})):k===R&&S.preventDefault()}},[n,r,y.paused]);return f.jsx(Dt.div,{tabIndex:-1,...l,ref:b,onKeyDown:w})});Eh.displayName=R6;function T6(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ga(r,{select:t}),document.activeElement!==n)return}function N6(e){const t=v5(e),n=C2(t,e),r=C2(t.reverse(),e);return[n,r]}function v5(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function C2(e,t){for(const n of e)if(!M6(n,{upTo:t}))return n}function M6(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 j6(e){return e instanceof HTMLInputElement&&"select"in e}function ga(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&j6(e)&&t&&e.select()}}var k2=A6();function A6(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=E2(e,t),e.unshift(t)},remove(t){var n;e=E2(e,t),(n=e[0])==null||n.resume()}}}function E2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function D6(e){return e.filter(t=>t.tagName!=="A")}var O6="Portal",du=v.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[i,o]=v.useState(!1);Pr(()=>o(!0),[]);const l=n||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?YN.createPortal(f.jsx(Dt.div,{...r,ref:t}),l):null});du.displayName=O6;function L6(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Zi=e=>{const{present:t,children:n}=e,r=z6(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Zt(r.ref,P6(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};Zi.displayName="Presence";function z6(e){const[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),o=v.useRef("none"),l=e?"mounted":"unmounted",[c,h]=L6(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const d=hm(r.current);o.current=c==="mounted"?d:"none"},[c]),Pr(()=>{const d=r.current,g=i.current;if(g!==e){const b=o.current,y=hm(d);e?h("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?h("UNMOUNT"):h(g&&b!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,h]),Pr(()=>{if(t){let d;const g=t.ownerDocument.defaultView??window,p=y=>{const S=hm(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(h("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},b=y=>{y.target===t&&(o.current=hm(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{g.clearTimeout(d),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function hm(e){return(e==null?void 0:e.animationName)||"none"}function P6(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var a_=0;function rg(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??R2()),document.body.insertAdjacentElement("beforeend",e[1]??R2()),a_++,()=>{a_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),a_--}},[])}function R2(){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 Ms=function(){return Ms=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ms.apply(this,arguments)};function b5(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function I6(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;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 qm="right-scroll-bar-position",Km="width-before-scroll-bar",B6="with-scroll-bars-hidden",F6="--removed-body-scroll-bar-size";function l_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function H6(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var $6=typeof window<"u"?v.useLayoutEffect:v.useEffect,T2=new WeakMap;function U6(e,t){var n=H6(null,function(r){return e.forEach(function(i){return l_(i,r)})});return $6(function(){var r=T2.get(n);if(r){var i=new Set(r),o=new Set(e),l=n.current;i.forEach(function(c){o.has(c)||l_(c,null)}),o.forEach(function(c){i.has(c)||l_(c,l)})}T2.set(n,e)},[e]),n}function V6(e){return e}function W6(e,t){t===void 0&&(t=V6);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var c=n;n=[],c.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 i}function q6(e){e===void 0&&(e={});var t=W6(null);return t.options=Ms({async:!0,ssr:!1},e),t}var _5=function(e){var t=e.sideCar,n=b5(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 v.createElement(r,Ms({},n))};_5.isSideCarExport=!0;function K6(e,t){return e.useMedium(t),_5}var y5=q6(),c_=function(){},ig=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:c_,onWheelCapture:c_,onTouchMoveCapture:c_}),i=r[0],o=r[1],l=e.forwardProps,c=e.children,h=e.className,d=e.removeScrollBar,g=e.enabled,p=e.shards,b=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,N=b5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=b,A=U6([n,t]),O=Ms(Ms({},N),i);return v.createElement(v.Fragment,null,g&&v.createElement(L,{sideCar:y5,removeScrollBar:d,shards:p,noRelative:y,noIsolation:w,inert:S,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:E}),l?v.cloneElement(v.Children.only(c),Ms(Ms({},O),{ref:A})):v.createElement(R,Ms({},O,{className:h,ref:A}),c))});ig.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ig.classNames={fullWidth:Km,zeroRight:qm};var G6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Y6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=G6();return t&&e.setAttribute("nonce",t),e}function X6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Z6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Q6=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Y6())&&(X6(t,n),Z6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},J6=function(){var e=Q6();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},x5=function(){var e=J6(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},eB={left:0,top:0,right:0,gap:0},u_=function(e){return parseInt(e||"",10)||0},tB=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[u_(n),u_(r),u_(i)]},nB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eB;var t=tB(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])}},rB=x5(),Uc="data-scroll-locked",iB=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
+
.`.concat(B6,` {
|
|
62
|
+
overflow: hidden `).concat(r,`;
|
|
63
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
64
|
+
}
|
|
65
|
+
body[`).concat(Uc,`] {
|
|
66
|
+
overflow: hidden `).concat(r,`;
|
|
67
|
+
overscroll-behavior: contain;
|
|
68
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
69
|
+
padding-left: `.concat(i,`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(c,"px ").concat(r,`;
|
|
75
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.`).concat(qm,` {
|
|
79
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(Km,` {
|
|
83
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.`).concat(qm," .").concat(qm,` {
|
|
87
|
+
right: 0 `).concat(r,`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.`).concat(Km," .").concat(Km,` {
|
|
91
|
+
margin-right: 0 `).concat(r,`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
body[`).concat(Uc,`] {
|
|
95
|
+
`).concat(F6,": ").concat(c,`px;
|
|
96
|
+
}
|
|
97
|
+
`)},N2=function(){var e=parseInt(document.body.getAttribute(Uc)||"0",10);return isFinite(e)?e:0},sB=function(){v.useEffect(function(){return document.body.setAttribute(Uc,(N2()+1).toString()),function(){var e=N2()-1;e<=0?document.body.removeAttribute(Uc):document.body.setAttribute(Uc,e.toString())}},[])},oB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;sB();var o=v.useMemo(function(){return nB(i)},[i]);return v.createElement(rB,{styles:iB(o,!t,i,n?"":"!important")})},Ey=!1;if(typeof window<"u")try{var fm=Object.defineProperty({},"passive",{get:function(){return Ey=!0,!0}});window.addEventListener("test",fm,fm),window.removeEventListener("test",fm,fm)}catch{Ey=!1}var Cc=Ey?{passive:!1}:!1,aB=function(e){return e.tagName==="TEXTAREA"},w5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!aB(e)&&n[t]==="visible")},lB=function(e){return w5(e,"overflowY")},cB=function(e){return w5(e,"overflowX")},M2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=S5(e,r);if(i){var o=C5(e,r),l=o[1],c=o[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},dB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},S5=function(e,t){return e==="v"?lB(t):cB(t)},C5=function(e,t){return e==="v"?uB(t):dB(t)},hB=function(e,t){return e==="h"&&t==="rtl"?-1:1},fB=function(e,t,n,r,i){var o=hB(e,window.getComputedStyle(t).direction),l=o*r,c=n.target,h=t.contains(c),d=!1,g=l>0,p=0,b=0;do{if(!c)break;var y=C5(e,c),w=y[0],S=y[1],C=y[2],k=S-C-o*w;(w||k)&&S5(e,c)&&(p+=k,b+=w);var R=c.parentNode;c=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!h&&c!==document.body||h&&(t.contains(c)||t===c));return(g&&Math.abs(p)<1||!g&&Math.abs(b)<1)&&(d=!0),d},mm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},j2=function(e){return[e.deltaX,e.deltaY]},A2=function(e){return e&&"current"in e?e.current:e},mB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pB=function(e){return`
|
|
98
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
99
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
100
|
+
`)},gB=0,kc=[];function vB(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(gB++)[0],o=v.useState(x5)[0],l=v.useRef(e);v.useEffect(function(){l.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=I6([e.lockRef.current],(e.shards||[]).map(A2),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var k=mm(S),R=n.current,E="deltaX"in S?S.deltaX:R[0]-k[0],N="deltaY"in S?S.deltaY:R[1]-k[1],L,A=S.target,O=Math.abs(E)>Math.abs(N)?"h":"v";if("touches"in S&&O==="h"&&A.type==="range")return!1;var H=window.getSelection(),Z=H&&H.anchorNode,I=Z?Z===A||Z.contains(A):!1;if(I)return!1;var q=M2(O,A);if(!q)return!0;if(q?L=O:(L=O==="v"?"h":"v",q=M2(O,A)),!q)return!1;if(!r.current&&"changedTouches"in S&&(E||N)&&(r.current=L),!L)return!0;var F=r.current||L;return fB(F,C,S,F==="h"?E:N)},[]),h=v.useCallback(function(S){var C=S;if(!(!kc.length||kc[kc.length-1]!==o)){var k="deltaY"in C?j2(C):mm(C),R=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&mB(L.delta,k)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var E=(l.current.shards||[]).map(A2).filter(Boolean).filter(function(L){return L.contains(C.target)}),N=E.length>0?c(C,E[0]):!l.current.noIsolation;N&&C.cancelable&&C.preventDefault()}}},[]),d=v.useCallback(function(S,C,k,R){var E={name:S,delta:C,target:k,should:R,shadowParent:bB(k)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(N){return N!==E})},1)},[]),g=v.useCallback(function(S){n.current=mm(S),r.current=void 0},[]),p=v.useCallback(function(S){d(S.type,j2(S),S.target,c(S,e.lockRef.current))},[]),b=v.useCallback(function(S){d(S.type,mm(S),S.target,c(S,e.lockRef.current))},[]);v.useEffect(function(){return kc.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:b}),document.addEventListener("wheel",h,Cc),document.addEventListener("touchmove",h,Cc),document.addEventListener("touchstart",g,Cc),function(){kc=kc.filter(function(S){return S!==o}),document.removeEventListener("wheel",h,Cc),document.removeEventListener("touchmove",h,Cc),document.removeEventListener("touchstart",g,Cc)}},[]);var y=e.removeScrollBar,w=e.inert;return v.createElement(v.Fragment,null,w?v.createElement(o,{styles:pB(i)}):null,y?v.createElement(oB,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bB(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _B=K6(y5,vB);var Rh=v.forwardRef(function(e,t){return v.createElement(ig,Ms({},e,{ref:t,sideCar:_B}))});Rh.classNames=ig.classNames;var yB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ec=new WeakMap,pm=new WeakMap,gm={},d_=0,k5=function(e){return e&&(e.host||k5(e.parentNode))},xB=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=k5(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})},wB=function(e,t,n,r){var i=xB(t,Array.isArray(e)?e:[e]);gm[n]||(gm[n]=new WeakMap);var o=gm[n],l=[],c=new Set,h=new Set(i),d=function(p){!p||c.has(p)||(c.add(p),d(p.parentNode))};i.forEach(d);var g=function(p){!p||h.has(p)||Array.prototype.forEach.call(p.children,function(b){if(c.has(b))g(b);else try{var y=b.getAttribute(r),w=y!==null&&y!=="false",S=(Ec.get(b)||0)+1,C=(o.get(b)||0)+1;Ec.set(b,S),o.set(b,C),l.push(b),S===1&&w&&pm.set(b,!0),C===1&&b.setAttribute(n,"true"),w||b.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",b,k)}})};return g(t),c.clear(),d_++,function(){l.forEach(function(p){var b=Ec.get(p)-1,y=o.get(p)-1;Ec.set(p,b),o.set(p,y),b||(pm.has(p)||p.removeAttribute(r),pm.delete(p)),y||p.removeAttribute(n)}),d_--,d_||(Ec=new WeakMap,Ec=new WeakMap,pm=new WeakMap,gm={})}},sg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=yB(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),wB(r,i,n,"aria-hidden")):function(){return null}},og="Dialog",[E5,Soe]=jo(og),[SB,fs]=E5(og),R5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=v.useRef(null),h=v.useRef(null),[d,g]=Yc({prop:r,defaultProp:i??!1,onChange:o,caller:og});return f.jsx(SB,{scope:t,triggerRef:c,contentRef:h,contentId:So(),titleId:So(),descriptionId:So(),open:d,onOpenChange:g,onOpenToggle:v.useCallback(()=>g(p=>!p),[g]),modal:l,children:n})};R5.displayName=og;var T5="DialogTrigger",CB=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=fs(T5,n),o=Zt(t,i.triggerRef);return f.jsx(Dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":E0(i.open),...r,ref:o,onClick:He(e.onClick,i.onOpenToggle)})});CB.displayName=T5;var C0="DialogPortal",[kB,N5]=E5(C0,{forceMount:void 0}),M5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=fs(C0,t);return f.jsx(kB,{scope:t,forceMount:n,children:v.Children.map(r,l=>f.jsx(Zi,{present:n||o.open,children:f.jsx(du,{asChild:!0,container:i,children:l})}))})};M5.displayName=C0;var cp="DialogOverlay",j5=v.forwardRef((e,t)=>{const n=N5(cp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=fs(cp,e.__scopeDialog);return o.modal?f.jsx(Zi,{present:r||o.open,children:f.jsx(RB,{...i,ref:t})}):null});j5.displayName=cp;var EB=wl("DialogOverlay.RemoveScroll"),RB=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=fs(cp,n);return f.jsx(Rh,{as:EB,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(Dt.div,{"data-state":E0(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Sl="DialogContent",A5=v.forwardRef((e,t)=>{const n=N5(Sl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=fs(Sl,e.__scopeDialog);return f.jsx(Zi,{present:r||o.open,children:o.modal?f.jsx(TB,{...i,ref:t}):f.jsx(NB,{...i,ref:t})})});A5.displayName=Sl;var TB=v.forwardRef((e,t)=>{const n=fs(Sl,e.__scopeDialog),r=v.useRef(null),i=Zt(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return sg(o)},[]),f.jsx(D5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:He(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&o.preventDefault()}),onFocusOutside:He(e.onFocusOutside,o=>o.preventDefault())})}),NB=v.forwardRef((e,t)=>{const n=fs(Sl,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return f.jsx(D5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,i.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"&&(i.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),D5=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,c=fs(Sl,n),h=v.useRef(null),d=Zt(t,h);return rg(),f.jsxs(f.Fragment,{children:[f.jsx(Eh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:f.jsx(uu,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":E0(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(MB,{titleId:c.titleId}),f.jsx(AB,{contentRef:h,descriptionId:c.descriptionId})]})]})}),k0="DialogTitle",O5=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=fs(k0,n);return f.jsx(Dt.h2,{id:i.titleId,...r,ref:t})});O5.displayName=k0;var L5="DialogDescription",z5=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=fs(L5,n);return f.jsx(Dt.p,{id:i.descriptionId,...r,ref:t})});z5.displayName=L5;var P5="DialogClose",I5=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=fs(P5,n);return f.jsx(Dt.button,{type:"button",...r,ref:t,onClick:He(e.onClick,()=>i.onOpenChange(!1))})});I5.displayName=P5;function E0(e){return e?"open":"closed"}var B5="DialogTitleWarning",[Coe,F5]=o6(B5,{contentName:Sl,titleName:k0,docsSlug:"dialog"}),MB=({titleId:e})=>{const t=F5(B5),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 v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jB="DialogDescriptionWarning",AB=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${F5(jB).contentName}}.`;return v.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},DB=R5,OB=M5,H5=j5,$5=A5,LB=O5,zB=z5,PB=I5;/**
|
|
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 IB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),BB=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),D2=e=>{const t=BB(e);return t.charAt(0).toUpperCase()+t.slice(1)},U5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),FB=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 HB={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 $B=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...c},h)=>v.createElement("svg",{ref:h,...HB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:U5("lucide",i),...!o&&!FB(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,g])=>v.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 De=(e,t)=>{const n=v.forwardRef(({className:r,...i},o)=>v.createElement($B,{ref:o,iconNode:t,className:U5(`lucide-${IB(D2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=D2(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 UB=[["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"}]],VB=De("archive",UB);/**
|
|
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 WB=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],qB=De("arrow-down-to-line",WB);/**
|
|
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 KB=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],GB=De("arrow-down",KB);/**
|
|
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 YB=[["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"}]],XB=De("arrow-left-right",YB);/**
|
|
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 ZB=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],QB=De("arrow-left",ZB);/**
|
|
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 JB=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],e8=De("arrow-up",JB);/**
|
|
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 t8=[["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"}]],n8=De("asterisk",t8);/**
|
|
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 r8=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],i8=De("bell",r8);/**
|
|
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 s8=[["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"}]],bi=De("brain",s8);/**
|
|
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 o8=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],a8=De("check-check",o8);/**
|
|
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 l8=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],c8=De("check-line",l8);/**
|
|
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 u8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qi=De("check",u8);/**
|
|
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 d8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ag=De("chevron-down",d8);/**
|
|
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 h8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],V5=De("chevron-left",h8);/**
|
|
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 f8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vr=De("chevron-right",f8);/**
|
|
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 m8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],p8=De("chevron-up",m8);/**
|
|
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 g8=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],v8=De("chevrons-up",g8);/**
|
|
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 b8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],_8=De("circle-slash",b8);/**
|
|
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 y8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],x8=De("circle",y8);/**
|
|
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 w8=[["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"}]],W5=De("cloud-download",w8);/**
|
|
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 S8=[["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"}]],O2=De("code-xml",S8);/**
|
|
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 C8=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Ry=De("code",C8);/**
|
|
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 k8=[["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"}]],E8=De("command",k8);/**
|
|
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 R8=[["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"}]],_l=De("copy",R8);/**
|
|
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 T8=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],N8=De("corner-down-left",T8);/**
|
|
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 M8=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],L2=De("download",M8);/**
|
|
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 j8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],A8=De("ellipsis",j8);/**
|
|
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 D8=[["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"}]],O8=De("eraser",D8);/**
|
|
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 L8=[["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"}]],z8=De("external-link",L8);/**
|
|
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 P8=[["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"}]],z2=De("eye",P8);/**
|
|
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 I8=[["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"}]],B8=De("file-pen",I8);/**
|
|
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 F8=[["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"}]],H8=De("file-plus-corner",F8);/**
|
|
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 $8=[["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"}]],U8=De("file-text",$8);/**
|
|
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 V8=[["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"}]],W8=De("file",V8);/**
|
|
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 q8=[["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"}]],h_=De("folder-git-2",q8);/**
|
|
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 K8=[["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"}]],q5=De("folder-open",K8);/**
|
|
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 G8=[["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"}]],K5=De("folder-plus",G8);/**
|
|
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 Y8=[["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"}]],G5=De("folder",Y8);/**
|
|
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 X8=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],po=De("gauge",X8);/**
|
|
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 Z8=[["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"}]],Q8=De("git-branch",Z8);/**
|
|
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 J8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],e9=De("info",J8);/**
|
|
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 t9=[["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"}]],n9=De("layout-panel-left",t9);/**
|
|
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 r9=[["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"}]],i9=De("list-checks",r9);/**
|
|
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 s9=[["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"}]],up=De("list-todo",s9);/**
|
|
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 o9=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],wr=De("loader-circle",o9);/**
|
|
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 a9=[["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"}]],P2=De("lock-open",a9);/**
|
|
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 l9=[["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"}]],I2=De("map",l9);/**
|
|
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 c9=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],u9=De("maximize-2",c9);/**
|
|
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 d9=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Ty=De("menu",d9);/**
|
|
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 h9=[["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"}]],Y5=De("message-circle-question-mark",h9);/**
|
|
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 f9=[["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"}]],m9=De("message-square-quote",f9);/**
|
|
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 p9=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],g9=De("minimize-2",p9);/**
|
|
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 v9=[["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"}]],X5=De("minimize",v9);/**
|
|
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 b9=[["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"}]],Z5=De("monitor",b9);/**
|
|
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 _9=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],y9=De("palette",_9);/**
|
|
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 x9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Ny=De("panel-left",x9);/**
|
|
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 w9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],S9=De("panel-right",w9);/**
|
|
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 C9=[["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"}]],Q5=De("paperclip",C9);/**
|
|
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 k9=[["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"}]],Xc=De("pencil",k9);/**
|
|
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 E9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],R0=De("plus",E9);/**
|
|
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 R9=[["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"}]],dp=De("refresh-cw",R9);/**
|
|
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 T9=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],f_=De("search",T9);/**
|
|
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 N9=[["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"}]],M9=De("send",N9);/**
|
|
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 j9=[["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"}]],A9=De("settings",j9);/**
|
|
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 D9=[["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"}]],O9=De("settings-2",D9);/**
|
|
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 L9=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],z9=De("slash",L9);/**
|
|
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 P9=[["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"}]],Vn=De("sparkles",P9);/**
|
|
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 I9=[["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"}]],B2=De("square-menu",I9);/**
|
|
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 B9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]],F2=De("square-minus",B9);/**
|
|
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 F9=[["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"}]],J5=De("square-pen",F9);/**
|
|
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 H9=[["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"}]],$9=De("square-x",H9);/**
|
|
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 U9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],V9=De("square",U9);/**
|
|
485
|
+
* @license lucide-react v0.562.0 - ISC
|
|
486
|
+
*
|
|
487
|
+
* This source code is licensed under the ISC license.
|
|
488
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
489
|
+
*/const W9=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],T0=De("terminal",W9);/**
|
|
490
|
+
* @license lucide-react v0.562.0 - ISC
|
|
491
|
+
*
|
|
492
|
+
* This source code is licensed under the ISC license.
|
|
493
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
494
|
+
*/const q9=[["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"}]],K9=De("toy-brick",q9);/**
|
|
495
|
+
* @license lucide-react v0.562.0 - ISC
|
|
496
|
+
*
|
|
497
|
+
* This source code is licensed under the ISC license.
|
|
498
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
499
|
+
*/const G9=[["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"}]],ih=De("trash-2",G9);/**
|
|
500
|
+
* @license lucide-react v0.562.0 - ISC
|
|
501
|
+
*
|
|
502
|
+
* This source code is licensed under the ISC license.
|
|
503
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
504
|
+
*/const Y9=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],N0=De("user-round",Y9);/**
|
|
505
|
+
* @license lucide-react v0.562.0 - ISC
|
|
506
|
+
*
|
|
507
|
+
* This source code is licensed under the ISC license.
|
|
508
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
509
|
+
*/const X9=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ko=De("x",X9);/**
|
|
510
|
+
* @license lucide-react v0.562.0 - ISC
|
|
511
|
+
*
|
|
512
|
+
* This source code is licensed under the ISC license.
|
|
513
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
514
|
+
*/const Z9=[["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"}]],Ns=De("zap",Z9),sh="data-focus-fallback-ignore",eM="data-allow-focus-retain",hp="kaizen:restore-chat-input-focus",M0="data-chat-input",fp="data-chat-selection-zone";function hl(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function My(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:hl(e,eM):!1}function Q9(e){const t=e;return t!=null&&t.matches?My(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:hl(e,eM):!1}function H2(e){return!!e.querySelector(`[${sh}][data-state='open']`)}function J9(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function e7(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${M0}]`)).filter(l=>!l.disabled);if(n.length===0)return!1;const r=n.indexOf(e),i=r>=0?(r+1)%n.length:0,o=n[i];return o?(o.focus({preventScroll:!0}),!0):!1}function $2(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||hl(t,M0)||e.canCancel?"none":"escape-focus";const{pointerStartTarget:i,pointerEndTarget:o,root:l,hasActiveSelection:c}=e,h=o??i;return!l||!h||!l.contains(h)||hl(h,sh)||hl(t,sh)||My(h)||c&&(hl(i,fp)||hl(h,fp))||My(t)?"none":t&&t===h?"restore":Q9(t)?"none":"restore"}const lg=DB,t7=OB,tM=v.forwardRef(({className:e,...t},n)=>f.jsx(H5,{ref:n,className:pe("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}));tM.displayName=H5.displayName;const n7={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},Th=v.forwardRef(({className:e,children:t,size:n="md",...r},i)=>f.jsxs(t7,{children:[f.jsx(tM,{}),f.jsxs($5,{ref:i,[sh]:"",onCloseAutoFocus:o=>{var l;o.preventDefault(),window.dispatchEvent(new Event(hp)),(l=r.onCloseAutoFocus)==null||l.call(r,o)},className:pe("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",n7[n],e),...r,children:[t,f.jsxs(PB,{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(ko,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Th.displayName=$5.displayName;function cg({className:e,...t}){return f.jsx(LB,{className:pe("text-lg font-medium leading-none tracking-tight",e),...t})}function j0({className:e,...t}){return f.jsx(zB,{className:pe("text-sm text-muted-foreground",e),...t})}function ug({className:e,...t}){return f.jsx("div",{className:pe("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function dg({className:e,...t}){return f.jsx("div",{className:pe("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",e),...t})}const Hi=v.forwardRef(({className:e,type:t,...n},r)=>f.jsx("input",{ref:r,type:t,className:pe("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}));Hi.displayName="Input";const nM=v.createContext(null);function r7({children:e}){const[t,n]=v.useState(null),[r,i]=v.useState(""),o=v.useRef(null);v.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(i(t.options.initialValue??""),setTimeout(()=>{var y,w;(y=o.current)==null||y.focus(),(w=o.current)==null||w.select()},0))},[t]);const l=v.useCallback(()=>{n(null),i("")},[]),c=v.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!1):t.kind==="prompt"?t.resolve(null):t.resolve(),l())},[l,t]),h=v.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!0):t.kind==="prompt"?t.resolve(r.trim()||null):t.resolve(),l())},[l,t,r]),d=v.useCallback(y=>new Promise(w=>{n({kind:"confirm",options:y,resolve:w})}),[]),g=v.useCallback(y=>new Promise(w=>{n({kind:"prompt",options:y,resolve:w})}),[]),p=v.useCallback(y=>new Promise(w=>{n({kind:"alert",options:y,resolve:w})}),[]),b=v.useMemo(()=>({confirm:d,prompt:g,alert:p}),[p,d,g]);return f.jsxs(nM.Provider,{value:b,children:[e,f.jsx(lg,{open:t!==null,onOpenChange:y=>{y||!t||c()},children:f.jsx(Th,{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(ug,{className:"space-y-4",children:[f.jsx(cg,{children:t.options.title}),t.options.description?f.jsx(j0,{children:t.options.description}):null,t.kind==="prompt"?f.jsx(Hi,{ref:o,type:"text",value:r,onChange:y=>i(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),h())},placeholder:t.options.placeholder}):null]}),f.jsxs(dg,{children:[f.jsx(Xe,{variant:"ghost",size:"sm",onClick:c,className:t.kind==="alert"?"hidden":void 0,children:"cancelLabel"in t.options?t.options.cancelLabel??"Cancel":"Cancel"}),f.jsx(Xe,{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 i7(){const e=v.useContext(nM);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const Nh=v.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:pe("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}));Nh.displayName="Textarea";function s7(e){return e.trim().length>0}function o7({open:e,onOpenChange:t,onConfirm:n}){const[r,i]=v.useState(""),[o,l]=v.useState(""),c=v.useRef(null);v.useEffect(()=>{e&&(i(""),l(""),setTimeout(()=>{var g;return(g=c.current)==null?void 0:g.focus()},0))},[e]);const h=s7(r),d=()=>{h&&n({title:r.trim(),description:o.trim()})};return f.jsx(lg,{open:e,onOpenChange:t,children:f.jsx(Th,{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(ug,{className:"space-y-4",children:[f.jsx(cg,{children:"Create Feature"}),f.jsx(j0,{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(Hi,{id:"feature-title",ref:c,type:"text",value:r,onChange:g=>i(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(Nh,{id:"feature-description",value:o,onChange:g=>l(g.target.value),rows:5,placeholder:"Leave blank to add it later"})]})]}),f.jsxs(dg,{children:[f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),f.jsx(Xe,{type:"submit",variant:"secondary",size:"sm",disabled:!h,children:"Create"})]})]})})})}const U2=`1. Sign in on the opened Cursor spending page.
|
|
515
|
+
2. Open DevTools > Network.
|
|
516
|
+
3. Refresh the page.
|
|
517
|
+
4. Right-click the get-current-period-usage request.
|
|
518
|
+
5. Copy > Copy as cURL.
|
|
519
|
+
6. Paste it here.`;function a7({open:e,onOpenChange:t,onSubmit:n}){const r=v.useRef(null),[i,o]=v.useState(""),[l,c]=v.useState(!1);v.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(U2),c(!0),setTimeout(()=>c(!1),2e3)}const g=i.trim().length>0;return f.jsx(lg,{open:e,onOpenChange:t,children:f.jsx(Th,{size:"lg",children:f.jsxs("form",{onSubmit:p=>{p.preventDefault(),g&&n(i.trim())},children:[f.jsxs(ug,{className:"space-y-4",children:[f.jsx(cg,{children:"Import Cursor Session"}),f.jsxs(j0,{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:U2}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>void h(),children:"Paste Clipboard"}),f.jsxs(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>void d(),children:[l?f.jsx(qi,{className:"h-4 w-4"}):f.jsx(_l,{className:"h-4 w-4"}),f.jsx("span",{className:"ml-1",children:l?"Copied":"Copy Steps"})]})]}),f.jsx(Nh,{ref:r,value:i,onChange:p=>o(p.target.value),rows:10,placeholder:"Paste the copied curl command here",className:"font-mono text-xs"})]}),f.jsxs(dg,{children:[f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),f.jsx(Xe,{type:"submit",variant:"secondary",size:"sm",disabled:!g,children:"Import Session"})]})]})})})}const l7=["top","right","bottom","left"],Ta=Math.min,xi=Math.max,mp=Math.round,vm=Math.floor,Ps=e=>({x:e,y:e}),c7={left:"right",right:"left",bottom:"top",top:"bottom"};function jy(e,t,n){return xi(e,Ta(t,n))}function Eo(e,t){return typeof e=="function"?e(t):e}function Ro(e){return e.split("-")[0]}function hu(e){return e.split("-")[1]}function A0(e){return e==="x"?"y":"x"}function D0(e){return e==="y"?"height":"width"}function js(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function O0(e){return A0(js(e))}function u7(e,t,n){n===void 0&&(n=!1);const r=hu(e),i=O0(e),o=D0(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=pp(l)),[l,pp(l)]}function d7(e){const t=pp(e);return[Ay(e),t,Ay(t)]}function Ay(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const V2=["left","right"],W2=["right","left"],h7=["top","bottom"],f7=["bottom","top"];function m7(e,t,n){switch(e){case"top":case"bottom":return n?t?W2:V2:t?V2:W2;case"left":case"right":return t?h7:f7;default:return[]}}function p7(e,t,n,r){const i=hu(e);let o=m7(Ro(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Ay)))),o}function pp(e){const t=Ro(e);return c7[t]+e.slice(t.length)}function g7(e){return{top:0,right:0,bottom:0,left:0,...e}}function rM(e){return typeof e!="number"?g7(e):{top:e,right:e,bottom:e,left:e}}function gp(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function q2(e,t,n){let{reference:r,floating:i}=e;const o=js(t),l=O0(t),c=D0(l),h=Ro(t),d=o==="y",g=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,b=r[c]/2-i[c]/2;let y;switch(h){case"top":y={x:g,y:r.y-i.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-i.width,y:p};break;default:y={x:r.x,y:r.y}}switch(hu(t)){case"start":y[l]-=b*(n&&d?-1:1);break;case"end":y[l]+=b*(n&&d?-1:1);break}return y}async function v7(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:l,elements:c,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:g="viewport",elementContext:p="floating",altBoundary:b=!1,padding:y=0}=Eo(t,e),w=rM(y),C=c[b?p==="floating"?"reference":"floating":p],k=gp(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(c.floating)),boundary:d,rootBoundary:g,strategy:h})),R=p==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),N=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=gp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:E,strategy:h}):R);return{top:(k.top-L.top+w.top)/N.y,bottom:(L.bottom-k.bottom+w.bottom)/N.y,left:(k.left-L.left+w.left)/N.x,right:(L.right-k.right+w.right)/N.x}}const b7=50,_7=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:v7},h=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y:p}=q2(d,r,h),b=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:N,data:L,reset:A}=await R({x:g,y:p,initialPlacement:r,placement:b,strategy:i,middlewareData:w,rects:d,platform:c,elements:{reference:e,floating:t}});g=E??g,p=N??p,w[k]={...w[k],...L},A&&y<b7&&(y++,typeof A=="object"&&(A.placement&&(b=A.placement),A.rects&&(d=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:g,y:p}=q2(d,b,h)),S=-1)}return{x:g,y:p,placement:b,strategy:i,middlewareData:w}},y7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:c,middlewareData:h}=t,{element:d,padding:g=0}=Eo(e,t)||{};if(d==null)return{};const p=rM(g),b={x:n,y:r},y=O0(i),w=D0(y),S=await l.getDimensions(d),C=y==="y",k=C?"top":"left",R=C?"bottom":"right",E=C?"clientHeight":"clientWidth",N=o.reference[w]+o.reference[y]-b[y]-o.floating[w],L=b[y]-o.reference[y],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let O=A?A[E]:0;(!O||!await(l.isElement==null?void 0:l.isElement(A)))&&(O=c.floating[E]||o.floating[w]);const H=N/2-L/2,Z=O/2-S[w]/2-1,I=Ta(p[k],Z),q=Ta(p[R],Z),F=I,$=O-S[w]-q,W=O/2-S[w]/2+H,K=jy(F,W,$),D=!h.arrow&&hu(i)!=null&&W!==K&&o.reference[w]/2-(W<F?I:q)-S[w]/2<0,U=D?W<F?W-F:W-$:0;return{[y]:b[y]+U,data:{[y]:K,centerOffset:W-K-U,...D&&{alignmentOffset:U}},reset:D}}}),x7=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:c,platform:h,elements:d}=t,{mainAxis:g=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...C}=Eo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=Ro(i),R=js(c),E=Ro(c)===c,N=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=b||(E||!S?[pp(c)]:d7(c)),A=w!=="none";!b&&A&&L.push(...p7(c,S,w,N));const O=[c,...L],H=await h.detectOverflow(t,C),Z=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(g&&Z.push(H[k]),p){const W=u7(i,l,N);Z.push(H[W[0]],H[W[1]])}if(I=[...I,{placement:i,overflows:Z}],!Z.every(W=>W<=0)){var q,F;const W=(((q=o.flip)==null?void 0:q.index)||0)+1,K=O[W];if(K&&(!(p==="alignment"?R!==js(K):!1)||I.every(z=>js(z.placement)===R?z.overflows[0]>0:!0)))return{data:{index:W,overflows:I},reset:{placement:K}};let D=(F=I.filter(U=>U.overflows[0]<=0).sort((U,z)=>U.overflows[1]-z.overflows[1])[0])==null?void 0:F.placement;if(!D)switch(y){case"bestFit":{var $;const U=($=I.filter(z=>{if(A){const G=js(z.placement);return G===R||G==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(G=>G>0).reduce((G,M)=>G+M,0)]).sort((z,G)=>z[1]-G[1])[0])==null?void 0:$[0];U&&(D=U);break}case"initialPlacement":D=c;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function K2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function G2(e){return l7.some(t=>e[t]>=0)}const w7=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=Eo(e,t);switch(i){case"referenceHidden":{const l=await r.detectOverflow(t,{...o,elementContext:"reference"}),c=K2(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:G2(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...o,altBoundary:!0}),c=K2(l,n.floating);return{data:{escapedOffsets:c,escaped:G2(c)}}}default:return{}}}}},iM=new Set(["left","top"]);async function S7(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Ro(n),c=hu(n),h=js(n)==="y",d=iM.has(l)?-1:1,g=o&&h?-1:1,p=Eo(t,e);let{mainAxis:b,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 c&&typeof w=="number"&&(y=c==="end"?w*-1:w),h?{x:y*g,y:b*d}:{x:b*d,y:y*g}}const C7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:c}=t,h=await S7(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+h.x,y:o+h.y,data:{...h,placement:l}}}}},k7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:l=!0,crossAxis:c=!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),b=js(Ro(i)),y=A0(b);let w=g[y],S=g[b];if(l){const k=y==="y"?"top":"left",R=y==="y"?"bottom":"right",E=w+p[k],N=w-p[R];w=jy(E,w,N)}if(c){const k=b==="y"?"top":"left",R=b==="y"?"bottom":"right",E=S+p[k],N=S-p[R];S=jy(E,S,N)}const C=h.fn({...t,[y]:w,[b]:S});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:l,[b]:c}}}}}},E7=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:c=0,mainAxis:h=!0,crossAxis:d=!0}=Eo(e,t),g={x:n,y:r},p=js(i),b=A0(p);let y=g[b],w=g[p];const S=Eo(c,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const E=b==="y"?"height":"width",N=o.reference[b]-o.floating[E]+C.mainAxis,L=o.reference[b]+o.reference[E]-C.mainAxis;y<N?y=N:y>L&&(y=L)}if(d){var k,R;const E=b==="y"?"width":"height",N=iM.has(Ro(i)),L=o.reference[p]-o.floating[E]+(N&&((k=l.offset)==null?void 0:k[p])||0)+(N?0:C.crossAxis),A=o.reference[p]+o.reference[E]+(N?0:((R=l.offset)==null?void 0:R[p])||0)-(N?C.crossAxis:0);w<L?w=L:w>A&&(w=A)}return{[b]:y,[p]:w}}}},R7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:c}=t,{apply:h=()=>{},...d}=Eo(e,t),g=await l.detectOverflow(t,d),p=Ro(i),b=hu(i),y=js(i)==="y",{width:w,height:S}=o.floating;let C,k;p==="top"||p==="bottom"?(C=p,k=b===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(k=p,C=b==="end"?"top":"bottom");const R=S-g.top-g.bottom,E=w-g.left-g.right,N=Ta(S-g[C],R),L=Ta(w-g[k],E),A=!t.middlewareData.shift;let O=N,H=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(H=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=R),A&&!b){const I=xi(g.left,0),q=xi(g.right,0),F=xi(g.top,0),$=xi(g.bottom,0);y?H=w-2*(I!==0||q!==0?I+q:xi(g.left,g.right)):O=S-2*(F!==0||$!==0?F+$:xi(g.top,g.bottom))}await h({...t,availableWidth:H,availableHeight:O});const Z=await l.getDimensions(c.floating);return w!==Z.width||S!==Z.height?{reset:{rects:!0}}:{}}}};function hg(){return typeof window<"u"}function fu(e){return sM(e)?(e.nodeName||"").toLowerCase():"#document"}function wi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $s(e){var t;return(t=(sM(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sM(e){return hg()?e instanceof Node||e instanceof wi(e).Node:!1}function us(e){return hg()?e instanceof Element||e instanceof wi(e).Element:!1}function Ao(e){return hg()?e instanceof HTMLElement||e instanceof wi(e).HTMLElement:!1}function Y2(e){return!hg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wi(e).ShadowRoot}function Mh(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ds(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function T7(e){return/^(table|td|th)$/.test(fu(e))}function fg(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const N7=/transform|translate|scale|rotate|perspective|filter/,M7=/paint|layout|strict|content/,il=e=>!!e&&e!=="none";let m_;function L0(e){const t=us(e)?ds(e):e;return il(t.transform)||il(t.translate)||il(t.scale)||il(t.rotate)||il(t.perspective)||!z0()&&(il(t.backdropFilter)||il(t.filter))||N7.test(t.willChange||"")||M7.test(t.contain||"")}function j7(e){let t=Na(e);for(;Ao(t)&&!Zc(t);){if(L0(t))return t;if(fg(t))return null;t=Na(t)}return null}function z0(){return m_==null&&(m_=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),m_}function Zc(e){return/^(html|body|#document)$/.test(fu(e))}function ds(e){return wi(e).getComputedStyle(e)}function mg(e){return us(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Na(e){if(fu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Y2(e)&&e.host||$s(e);return Y2(t)?t.host:t}function oM(e){const t=Na(e);return Zc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ao(t)&&Mh(t)?t:oM(t)}function oh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=oM(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=wi(i);if(o){const c=Dy(l);return t.concat(l,l.visualViewport||[],Mh(i)?i:[],c&&n?oh(c):[])}else return t.concat(i,oh(i,[],n))}function Dy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function aM(e){const t=ds(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ao(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,c=mp(n)!==o||mp(r)!==l;return c&&(n=o,r=l),{width:n,height:r,$:c}}function P0(e){return us(e)?e:e.contextElement}function Vc(e){const t=P0(e);if(!Ao(t))return Ps(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=aM(t);let l=(o?mp(n.width):n.width)/r,c=(o?mp(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const A7=Ps(0);function lM(e){const t=wi(e);return!z0()||!t.visualViewport?A7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function D7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wi(e)?!1:t}function Cl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=P0(e);let l=Ps(1);t&&(r?us(r)&&(l=Vc(r)):l=Vc(e));const c=D7(o,n,r)?lM(o):Ps(0);let h=(i.left+c.x)/l.x,d=(i.top+c.y)/l.y,g=i.width/l.x,p=i.height/l.y;if(o){const b=wi(o),y=r&&us(r)?wi(r):r;let w=b,S=Dy(w);for(;S&&r&&y!==w;){const C=Vc(S),k=S.getBoundingClientRect(),R=ds(S),E=k.left+(S.clientLeft+parseFloat(R.paddingLeft))*C.x,N=k.top+(S.clientTop+parseFloat(R.paddingTop))*C.y;h*=C.x,d*=C.y,g*=C.x,p*=C.y,h+=E,d+=N,w=wi(S),S=Dy(w)}}return gp({width:g,height:p,x:h,y:d})}function pg(e,t){const n=mg(e).scrollLeft;return t?t.left+n:Cl($s(e)).left+n}function cM(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pg(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function O7(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=$s(r),c=t?fg(t.floating):!1;if(r===l||c&&o)return n;let h={scrollLeft:0,scrollTop:0},d=Ps(1);const g=Ps(0),p=Ao(r);if((p||!p&&!o)&&((fu(r)!=="body"||Mh(l))&&(h=mg(r)),p)){const y=Cl(r);d=Vc(r),g.x=y.x+r.clientLeft,g.y=y.y+r.clientTop}const b=l&&!p&&!o?cM(l,h):Ps(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-h.scrollLeft*d.x+g.x+b.x,y:n.y*d.y-h.scrollTop*d.y+g.y+b.y}}function L7(e){return Array.from(e.getClientRects())}function z7(e){const t=$s(e),n=mg(e),r=e.ownerDocument.body,i=xi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=xi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+pg(e);const c=-n.scrollTop;return ds(r).direction==="rtl"&&(l+=xi(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:c}}const X2=25;function P7(e,t){const n=wi(e),r=$s(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,c=0,h=0;if(i){o=i.width,l=i.height;const g=z0();(!g||g&&t==="fixed")&&(c=i.offsetLeft,h=i.offsetTop)}const d=pg(r);if(d<=0){const g=r.ownerDocument,p=g.body,b=getComputedStyle(p),y=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,w=Math.abs(r.clientWidth-p.clientWidth-y);w<=X2&&(o-=w)}else d<=X2&&(o+=d);return{width:o,height:l,x:c,y:h}}function I7(e,t){const n=Cl(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Ao(e)?Vc(e):Ps(1),l=e.clientWidth*o.x,c=e.clientHeight*o.y,h=i*o.x,d=r*o.y;return{width:l,height:c,x:h,y:d}}function Z2(e,t,n){let r;if(t==="viewport")r=P7(e,n);else if(t==="document")r=z7($s(e));else if(us(t))r=I7(t,n);else{const i=lM(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return gp(r)}function uM(e,t){const n=Na(e);return n===t||!us(n)||Zc(n)?!1:ds(n).position==="fixed"||uM(n,t)}function B7(e,t){const n=t.get(e);if(n)return n;let r=oh(e,[],!1).filter(c=>us(c)&&fu(c)!=="body"),i=null;const o=ds(e).position==="fixed";let l=o?Na(e):e;for(;us(l)&&!Zc(l);){const c=ds(l),h=L0(l);!h&&c.position==="fixed"&&(i=null),(o?!h&&!i:!h&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Mh(l)&&!h&&uM(e,l))?r=r.filter(g=>g!==l):i=c,l=Na(l)}return t.set(e,r),r}function F7(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?fg(t)?[]:B7(t,this._c):[].concat(n),r],c=Z2(t,l[0],i);let h=c.top,d=c.right,g=c.bottom,p=c.left;for(let b=1;b<l.length;b++){const y=Z2(t,l[b],i);h=xi(y.top,h),d=Ta(y.right,d),g=Ta(y.bottom,g),p=xi(y.left,p)}return{width:d-p,height:g-h,x:p,y:h}}function H7(e){const{width:t,height:n}=aM(e);return{width:t,height:n}}function $7(e,t,n){const r=Ao(t),i=$s(t),o=n==="fixed",l=Cl(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const h=Ps(0);function d(){h.x=pg(i)}if(r||!r&&!o)if((fu(t)!=="body"||Mh(i))&&(c=mg(t)),r){const y=Cl(t,!0,o,t);h.x=y.x+t.clientLeft,h.y=y.y+t.clientTop}else i&&d();o&&!r&&i&&d();const g=i&&!r&&!o?cM(i,c):Ps(0),p=l.left+c.scrollLeft-h.x-g.x,b=l.top+c.scrollTop-h.y-g.y;return{x:p,y:b,width:l.width,height:l.height}}function p_(e){return ds(e).position==="static"}function Q2(e,t){if(!Ao(e)||ds(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $s(e)===n&&(n=n.ownerDocument.body),n}function dM(e,t){const n=wi(e);if(fg(e))return n;if(!Ao(e)){let i=Na(e);for(;i&&!Zc(i);){if(us(i)&&!p_(i))return i;i=Na(i)}return n}let r=Q2(e,t);for(;r&&T7(r)&&p_(r);)r=Q2(r,t);return r&&Zc(r)&&p_(r)&&!L0(r)?n:r||j7(e)||n}const U7=async function(e){const t=this.getOffsetParent||dM,n=this.getDimensions,r=await n(e.floating);return{reference:$7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function V7(e){return ds(e).direction==="rtl"}const W7={convertOffsetParentRelativeRectToViewportRelativeRect:O7,getDocumentElement:$s,getClippingRect:F7,getOffsetParent:dM,getElementRects:U7,getClientRects:L7,getDimensions:H7,getScale:Vc,isElement:us,isRTL:V7};function hM(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function q7(e,t){let n=null,r;const i=$s(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function l(c,h){c===void 0&&(c=!1),h===void 0&&(h=1),o();const d=e.getBoundingClientRect(),{left:g,top:p,width:b,height:y}=d;if(c||t(),!b||!y)return;const w=vm(p),S=vm(i.clientWidth-(g+b)),C=vm(i.clientHeight-(p+y)),k=vm(g),E={rootMargin:-w+"px "+-S+"px "+-C+"px "+-k+"px",threshold:xi(0,Ta(1,h))||1};let N=!0;function L(A){const O=A[0].intersectionRatio;if(O!==h){if(!N)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!hM(d,e.getBoundingClientRect())&&l(),N=!1}try{n=new IntersectionObserver(L,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(L,E)}n.observe(e)}return l(!0),o}function K7(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,d=P0(e),g=i||o?[...d?oh(d):[],...t?oh(t):[]]:[];g.forEach(k=>{i&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const p=d&&c?q7(d,n):null;let b=-1,y=null;l&&(y=new ResizeObserver(k=>{let[R]=k;R&&R.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var E;(E=y)==null||E.observe(t)})),n()}),d&&!h&&y.observe(d),t&&y.observe(t));let w,S=h?Cl(e):null;h&&C();function C(){const k=Cl(e);S&&!hM(S,k)&&n(),S=k,w=requestAnimationFrame(C)}return n(),()=>{var k;g.forEach(R=>{i&&R.removeEventListener("scroll",n),o&&R.removeEventListener("resize",n)}),p==null||p(),(k=y)==null||k.disconnect(),y=null,h&&cancelAnimationFrame(w)}}const G7=C7,Y7=k7,X7=x7,Z7=R7,Q7=w7,J2=y7,J7=E7,eF=(e,t,n)=>{const r=new Map,i={platform:W7,...n},o={...i.platform,_c:r};return _7(e,t,{...i,platform:o})};var tF=typeof document<"u",nF=function(){},Gm=tF?v.useLayoutEffect:nF;function vp(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,i;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(!vp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!vp(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function fM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eE(e,t){const n=fM(e);return Math.round(t*n)/n}function g_(e){const t=v.useRef(e);return Gm(()=>{t.current=e}),t}function rF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:c=!0,whileElementsMounted:h,open:d}=e,[g,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,y]=v.useState(r);vp(b,r)||y(r);const[w,S]=v.useState(null),[C,k]=v.useState(null),R=v.useCallback(z=>{z!==A.current&&(A.current=z,S(z))},[]),E=v.useCallback(z=>{z!==O.current&&(O.current=z,k(z))},[]),N=o||w,L=l||C,A=v.useRef(null),O=v.useRef(null),H=v.useRef(g),Z=h!=null,I=g_(h),q=g_(i),F=g_(d),$=v.useCallback(()=>{if(!A.current||!O.current)return;const z={placement:t,strategy:n,middleware:b};q.current&&(z.platform=q.current),eF(A.current,O.current,z).then(G=>{const M={...G,isPositioned:F.current!==!1};W.current&&!vp(H.current,M)&&(H.current=M,os.flushSync(()=>{p(M)}))})},[b,t,n,q,F]);Gm(()=>{d===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[d]);const W=v.useRef(!1);Gm(()=>(W.current=!0,()=>{W.current=!1}),[]),Gm(()=>{if(N&&(A.current=N),L&&(O.current=L),N&&L){if(I.current)return I.current(N,L,$);$()}},[N,L,$,I,Z]);const K=v.useMemo(()=>({reference:A,floating:O,setReference:R,setFloating:E}),[R,E]),D=v.useMemo(()=>({reference:N,floating:L}),[N,L]),U=v.useMemo(()=>{const z={position:n,left:0,top:0};if(!D.floating)return z;const G=eE(D.floating,g.x),M=eE(D.floating,g.y);return c?{...z,transform:"translate("+G+"px, "+M+"px)",...fM(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:M}},[n,c,D.floating,g.x,g.y]);return v.useMemo(()=>({...g,update:$,refs:K,elements:D,floatingStyles:U}),[g,$,K,D,U])}const iF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?J2({element:r.current,padding:i}).fn(n):{}:r?J2({element:r,padding:i}).fn(n):{}}}},sF=(e,t)=>{const n=G7(e);return{name:n.name,fn:n.fn,options:[e,t]}},oF=(e,t)=>{const n=Y7(e);return{name:n.name,fn:n.fn,options:[e,t]}},aF=(e,t)=>({fn:J7(e).fn,options:[e,t]}),lF=(e,t)=>{const n=X7(e);return{name:n.name,fn:n.fn,options:[e,t]}},cF=(e,t)=>{const n=Z7(e);return{name:n.name,fn:n.fn,options:[e,t]}},uF=(e,t)=>{const n=Q7(e);return{name:n.name,fn:n.fn,options:[e,t]}},dF=(e,t)=>{const n=iF(e);return{name:n.name,fn:n.fn,options:[e,t]}};var hF="Arrow",mM=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return f.jsx(Dt.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});mM.displayName=hF;var fF=mM;function mF(e){const[t,n]=v.useState(void 0);return Pr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,c;if("borderBoxSize"in o){const h=o.borderBoxSize,d=Array.isArray(h)?h[0]:h;l=d.inlineSize,c=d.blockSize}else l=e.offsetWidth,c=e.offsetHeight;n({width:l,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var I0="Popper",[pM,Oa]=jo(I0),[pF,gM]=pM(I0),vM=e=>{const{__scopePopper:t,children:n}=e,[r,i]=v.useState(null);return f.jsx(pF,{scope:t,anchor:r,onAnchorChange:i,children:n})};vM.displayName=I0;var bM="PopperAnchor",_M=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=gM(bM,n),l=v.useRef(null),c=Zt(t,l),h=v.useRef(null);return v.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(Dt.div,{...i,ref:c})});_M.displayName=bM;var B0="PopperContent",[gF,vF]=pM(B0),yM=v.forwardRef((e,t)=>{var re,ue,fe,ge,Ce,Re;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:g=0,sticky:p="partial",hideWhenDetached:b=!1,updatePositionStrategy:y="optimized",onPlaced:w,...S}=e,C=gM(B0,n),[k,R]=v.useState(null),E=Zt(t,je=>R(je)),[N,L]=v.useState(null),A=mF(N),O=(A==null?void 0:A.width)??0,H=(A==null?void 0:A.height)??0,Z=r+(o!=="center"?"-"+o:""),I=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},q=Array.isArray(d)?d:[d],F=q.length>0,$={padding:I,boundary:q.filter(_F),altBoundary:F},{refs:W,floatingStyles:K,placement:D,isPositioned:U,middlewareData:z}=rF({strategy:"fixed",placement:Z,whileElementsMounted:(...je)=>K7(...je,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[sF({mainAxis:i+H,alignmentAxis:l}),h&&oF({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?aF():void 0,...$}),h&&lF({...$}),cF({...$,apply:({elements:je,rects:Qe,availableWidth:yt,availableHeight:Tt})=>{const{width:me,height:Ue}=Qe.reference,Oe=je.floating.style;Oe.setProperty("--radix-popper-available-width",`${yt}px`),Oe.setProperty("--radix-popper-available-height",`${Tt}px`),Oe.setProperty("--radix-popper-anchor-width",`${me}px`),Oe.setProperty("--radix-popper-anchor-height",`${Ue}px`)}}),N&&dF({element:N,padding:c}),yF({arrowWidth:O,arrowHeight:H}),b&&uF({strategy:"referenceHidden",...$})]}),[G,M]=SM(D),B=cs(w);Pr(()=>{U&&(B==null||B())},[U,B]);const X=(re=z.arrow)==null?void 0:re.x,j=(ue=z.arrow)==null?void 0:ue.y,ie=((fe=z.arrow)==null?void 0:fe.centerOffset)!==0,[J,ee]=v.useState();return Pr(()=>{k&&ee(window.getComputedStyle(k).zIndex)},[k]),f.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:U?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(ge=z.transformOrigin)==null?void 0:ge.x,(Ce=z.transformOrigin)==null?void 0:Ce.y].join(" "),...((Re=z.hide)==null?void 0:Re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(gF,{scope:n,placedSide:G,onArrowChange:L,arrowX:X,arrowY:j,shouldHideArrow:ie,children:f.jsx(Dt.div,{"data-side":G,"data-align":M,...S,ref:E,style:{...S.style,animation:U?void 0:"none"}})})})});yM.displayName=B0;var xM="PopperArrow",bF={top:"bottom",right:"left",bottom:"top",left:"right"},wM=v.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=vF(xM,r),l=bF[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(fF,{...i,ref:n,style:{...i.style,display:"block"}})})});wM.displayName=xM;function _F(e){return e!==null}var yF=e=>({name:"transformOrigin",options:e,fn(t){var C,k,R;const{placement:n,rects:r,middlewareData:i}=t,l=((C=i.arrow)==null?void 0:C.centerOffset)!==0,c=l?0:e.arrowWidth,h=l?0:e.arrowHeight,[d,g]=SM(n),p={start:"0%",center:"50%",end:"100%"}[g],b=(((k=i.arrow)==null?void 0:k.x)??0)+c/2,y=(((R=i.arrow)==null?void 0:R.y)??0)+h/2;let w="",S="";return d==="bottom"?(w=l?p:`${b}px`,S=`${-h}px`):d==="top"?(w=l?p:`${b}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 SM(e){const[t,n="center"]=e.split("-");return[t,n]}var gg=vM,jh=_M,vg=yM,bg=wM,CM=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"}),xF="VisuallyHidden",kM=v.forwardRef((e,t)=>f.jsx(Dt.span,{...e,ref:t,style:{...CM,...e.style}}));kM.displayName=xF;var wF=kM,[_g,koe]=jo("Tooltip",[Oa]),yg=Oa(),EM="TooltipProvider",SF=700,Oy="tooltip.open",[CF,F0]=_g(EM),RM=e=>{const{__scopeTooltip:t,delayDuration:n=SF,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,l=v.useRef(!0),c=v.useRef(!1),h=v.useRef(0);return v.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),f.jsx(CF,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(h.current),l.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(d=>{c.current=d},[]),disableHoverableContent:i,children:o})};RM.displayName=EM;var ah="Tooltip",[kF,Ah]=_g(ah),TM=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:l,delayDuration:c}=e,h=F0(ah,e.__scopeTooltip),d=yg(t),[g,p]=v.useState(null),b=So(),y=v.useRef(0),w=l??h.disableHoverableContent,S=c??h.delayDuration,C=v.useRef(!1),[k,R]=Yc({prop:r,defaultProp:i??!1,onChange:O=>{O?(h.onOpen(),document.dispatchEvent(new CustomEvent(Oy))):h.onClose(),o==null||o(O)},caller:ah}),E=v.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),N=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,R(!0)},[R]),L=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,R(!1)},[R]),A=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,R(!0),y.current=0},S)},[S,R]);return v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),f.jsx(gg,{...d,children:f.jsx(kF,{scope:t,contentId:b,open:k,stateAttribute:E,trigger:g,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{h.isOpenDelayedRef.current?A():N()},[h.isOpenDelayedRef,A,N]),onTriggerLeave:v.useCallback(()=>{w?L():(window.clearTimeout(y.current),y.current=0)},[L,w]),onOpen:N,onClose:L,disableHoverableContent:w,children:n})})};TM.displayName=ah;var Ly="TooltipTrigger",NM=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Ah(Ly,n),o=F0(Ly,n),l=yg(n),c=v.useRef(null),h=Zt(t,c,i.onTriggerChange),d=v.useRef(!1),g=v.useRef(!1),p=v.useCallback(()=>d.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),f.jsx(jh,{asChild:!0,...l,children:f.jsx(Dt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:h,onPointerMove:He(e.onPointerMove,b=>{b.pointerType!=="touch"&&!g.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),g.current=!0)}),onPointerLeave:He(e.onPointerLeave,()=>{i.onTriggerLeave(),g.current=!1}),onPointerDown:He(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:He(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:He(e.onBlur,i.onClose),onClick:He(e.onClick,i.onClose)})})});NM.displayName=Ly;var H0="TooltipPortal",[EF,RF]=_g(H0,{forceMount:void 0}),MM=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Ah(H0,t);return f.jsx(EF,{scope:t,forceMount:n,children:f.jsx(Zi,{present:n||o.open,children:f.jsx(du,{asChild:!0,container:i,children:r})})})};MM.displayName=H0;var Qc="TooltipContent",jM=v.forwardRef((e,t)=>{const n=RF(Qc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,l=Ah(Qc,e.__scopeTooltip);return f.jsx(Zi,{present:r||l.open,children:l.disableHoverableContent?f.jsx(AM,{side:i,...o,ref:t}):f.jsx(TF,{side:i,...o,ref:t})})}),TF=v.forwardRef((e,t)=>{const n=Ah(Qc,e.__scopeTooltip),r=F0(Qc,e.__scopeTooltip),i=v.useRef(null),o=Zt(t,i),[l,c]=v.useState(null),{trigger:h,onClose:d}=n,g=i.current,{onPointerInTransitChange:p}=r,b=v.useCallback(()=>{c(null),p(!1)},[p]),y=v.useCallback((w,S)=>{const C=w.currentTarget,k={x:w.clientX,y:w.clientY},R=DF(k,C.getBoundingClientRect()),E=OF(k,R),N=LF(S.getBoundingClientRect()),L=PF([...E,...N]);c(L),p(!0)},[p]);return v.useEffect(()=>()=>b(),[b]),v.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,b]),v.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=!zF(k,l);R?b():E&&(b(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[h,g,l,d,b]),f.jsx(AM,{...e,ref:o})}),[NF,MF]=_g(ah,{isInside:!1}),jF=m6("TooltipContent"),AM=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:l,...c}=e,h=Ah(Qc,n),d=yg(n),{onClose:g}=h;return v.useEffect(()=>(document.addEventListener(Oy,g),()=>document.removeEventListener(Oy,g)),[g]),v.useEffect(()=>{if(h.trigger){const p=b=>{const y=b.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(uu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:g,children:f.jsxs(vg,{"data-state":h.stateAttribute,...d,...c,ref:t,style:{...c.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(jF,{children:r}),f.jsx(NF,{scope:n,isInside:!0,children:f.jsx(wF,{id:h.contentId,role:"tooltip",children:i||r})})]})})});jM.displayName=Qc;var DM="TooltipArrow",AF=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=yg(n);return MF(DM,n).isInside?null:f.jsx(bg,{...i,...r,ref:t})});AF.displayName=DM;function DF(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function OF(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 LF(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function zF(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const c=t[o],h=t[l],d=c.x,g=c.y,p=h.x,b=h.y;g>r!=b>r&&n<(p-d)*(r-g)/(b-g)+d&&(i=!i)}return i}function PF(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),IF(t)}function IF(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}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 BF=RM,OM=TM,LM=NM,zM=MM,$0=jM;function FF({className:e,...t}){return f.jsx("kbd",{className:pe("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 HF({className:e,...t}){return f.jsx("span",{className:pe("inline-flex items-center gap-0.5",e),...t})}const $F="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",UF=BF,As=OM,Ds=LM,as=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>f.jsx(zM,{children:f.jsx($0,{ref:r,sideOffset:t,className:pe("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})}));as.displayName=$0.displayName;const Md=OM,jd=LM;function PM(e){return e.toUpperCase()}function VF(e){const t=e.split("+");return f.jsx(HF,{children:t.map((n,r)=>f.jsx(FF,{children:PM(n)},`${n}-${r}`))})}const Ic=v.forwardRef(({className:e,sideOffset:t=4,children:n,shortcut:r,...i},o)=>{const l=r===void 0?null:Array.isArray(r)?r[0]??null:r;return f.jsx(zM,{children:f.jsx($0,{ref:o,sideOffset:t,className:pe($F,e),...i,children:l?VF(l):f.jsx("span",{children:typeof n=="string"?PM(n):n})})})});Ic.displayName="HotkeyTooltipContent";const WF="0.6.1",qF={version:WF},Tn="Kaizen",tE="kaizen",KF=".kaizen",GF=".kaizen-dev",v_=".kaizen",YF="KAIZEN_RUNTIME_PROFILE",U0=`kaizen/${qF.version}`,XF="[kaizen]",ZF=`~/${Tn}`,xg="kaizen:";function mu(){var t;return(t=globalThis.process)==null?void 0:t.env}function QF(e=mu()){const t=e==null?void 0:e[YF];return(t==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function JF(e=mu()){return QF(e)==="dev"?GF:KF}function IM(e=mu()){return`~/${JF(e)}`}function eH(e=mu()){return`${IM(e)}/keybindings.json`}function tH(e=mu()){return`${IM(e)}/themes`}function nH(e=mu()){return`${tH(e)}/THEME_README.md`}function bm(e){return e?`${tE} ${e}`:tE}const bp=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],zy=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],Py=[{id:"off",label:"Off"},{id:"standard",label:"Standard"},{id:"high",label:"High"}],Iy="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}],rH={"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 iH(e){return e?BM.some(t=>t.id===e)?e:rH[e]??Iy:Iy}function nE(e){const t=e.indexOf("[");return t>=0?e.slice(0,t):e}function Oc(e){const t=e.match(/\bfast=(true|false)\b/);return t?t[1]==="true"?"fast":"standard":null}function rE(e){return bp.some(t=>t.id===e)}function iE(e){return zy.some(t=>t.id===e)}const By=[{id:"200k",label:"200k"},{id:"1m",label:"1M"}];function sH(e){return Py.some(t=>t.id===e)}const wa=[{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:[...By]},{id:"sonnet",label:"Sonnet",supportsEffort:!0,contextWindowOptions:[...By]},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...bp]},{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:Iy,defaultModelOptions:{},supportsPlanMode:!0,models:[...BM],efforts:[]}],lr={claude:{active:!0},codex:{active:!0},gemini:{active:!0},cursor:{active:!0}};function cn(e){const t=wa.find(n=>n.id===e);if(!t)throw new Error(`Unknown provider: ${e}`);return t}function V0(e,t){const n=lr[t],r=e==null?void 0:e[t];return{active:(r==null?void 0:r.active)??n.active}}function oH(e,t){const n=cn(e),r=V0(t,e);return n.systemActive&&r.active?null:`Provider ${n.label} is currently not active.`}function sE(e,t){const n=cn(e),r=V0(t,e);return n.systemActive&&r.active}function aH(e){return wa.map(t=>{const n=V0(e,t.id),r=t.systemActive&&n.active;return{...t,active:n.active,isSelectable:r,isUsageEnabled:r,isInactive:!r,inactiveMessage:oH(t.id,e)}})}function W0(e){return aH(e).filter(t=>t.isSelectable).map(({active:t,isSelectable:n,isUsageEnabled:r,isInactive:i,inactiveMessage:o,...l})=>l)}function Wi(e){return cn(e).defaultModelOptions}const FM=Wi("claude");Wi("codex");Wi("gemini");Wi("cursor");function lH(e){return cn("claude").models.find(t=>t.id===e)}function cH(e){var t;return((t=lH(e))==null?void 0:t.contextWindowOptions)??[]}function uH(e,t){const n=cH(e);if(n.length!==0)return n.some(r=>r.id===t)?t:FM.contextWindow}const dH=["idea","todo","progress","testing","done"],oE={idea:"IDEA",todo:"TODO",progress:"PROGRESS",testing:"TESTING",done:"DONE"},Rs={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+/"]},_p=8,HM=10*1024*1024,yp=["image/png","image/jpeg","image/webp","image/gif"],hH="/assets/icon-4rSnra9R.svg";function Wd({alt:e="",className:t,...n}){return f.jsx("img",{alt:e,src:hH,className:pe("shrink-0 object-contain",t),...n})}var wg="Popover",[$M,Eoe]=jo(wg,[Oa]),Dh=Oa(),[fH,La]=$M(wg),UM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!1}=e,c=Dh(t),h=v.useRef(null),[d,g]=v.useState(!1),[p,b]=Yc({prop:r,defaultProp:i??!1,onChange:o,caller:wg});return f.jsx(gg,{...c,children:f.jsx(fH,{scope:t,contentId:So(),triggerRef:h,open:p,onOpenChange:b,onOpenToggle:v.useCallback(()=>b(y=>!y),[b]),hasCustomAnchor:d,onCustomAnchorAdd:v.useCallback(()=>g(!0),[]),onCustomAnchorRemove:v.useCallback(()=>g(!1),[]),modal:l,children:n})})};UM.displayName=wg;var VM="PopoverAnchor",WM=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=La(VM,n),o=Dh(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=i;return v.useEffect(()=>(l(),()=>c()),[l,c]),f.jsx(jh,{...o,...r,ref:t})});WM.displayName=VM;var qM="PopoverTrigger",KM=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=La(qM,n),o=Dh(n),l=Zt(t,i.triggerRef),c=f.jsx(Dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":QM(i.open),...r,ref:l,onClick:He(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:f.jsx(jh,{asChild:!0,...o,children:c})});KM.displayName=qM;var q0="PopoverPortal",[mH,pH]=$M(q0,{forceMount:void 0}),GM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=La(q0,t);return f.jsx(mH,{scope:t,forceMount:n,children:f.jsx(Zi,{present:n||o.open,children:f.jsx(du,{asChild:!0,container:i,children:r})})})};GM.displayName=q0;var Jc="PopoverContent",YM=v.forwardRef((e,t)=>{const n=pH(Jc,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=La(Jc,e.__scopePopover);return f.jsx(Zi,{present:r||o.open,children:o.modal?f.jsx(vH,{...i,ref:t}):f.jsx(bH,{...i,ref:t})})});YM.displayName=Jc;var gH=wl("PopoverContent.RemoveScroll"),vH=v.forwardRef((e,t)=>{const n=La(Jc,e.__scopePopover),r=v.useRef(null),i=Zt(t,r),o=v.useRef(!1);return v.useEffect(()=>{const l=r.current;if(l)return sg(l)},[]),f.jsx(Rh,{as:gH,allowPinchZoom:!0,children:f.jsx(XM,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),o.current||(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:He(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,h=c.button===0&&c.ctrlKey===!0,d=c.button===2||h;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:He(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),bH=v.forwardRef((e,t)=>{const n=La(Jc,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return f.jsx(XM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,i.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"&&(i.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),XM=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:g,...p}=e,b=La(Jc,n),y=Dh(n);return rg(),f.jsx(Eh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:f.jsx(uu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:g,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onDismiss:()=>b.onOpenChange(!1),children:f.jsx(vg,{"data-state":QM(b.open),role:"dialog",id:b.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)"}})})})}),ZM="PopoverClose",_H=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=La(ZM,n);return f.jsx(Dt.button,{type:"button",...r,ref:t,onClick:He(e.onClick,()=>i.onOpenChange(!1))})});_H.displayName=ZM;var yH="PopoverArrow",xH=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Dh(n);return f.jsx(bg,{...i,...r,ref:t})});xH.displayName=yH;function QM(e){return e?"open":"closed"}var JM=UM,wH=WM,SH=KM,ej=GM,K0=YM;const tj=JM,nj=SH,G0=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>f.jsx(ej,{children:f.jsx(K0,{ref:i,align:t,sideOffset:n,[sh]:"",onCloseAutoFocus:o=>{var l;o.preventDefault(),window.dispatchEvent(new Event(hp)),(l=r.onCloseAutoFocus)==null||l.call(r,o)},className:pe("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})}));G0.displayName=K0.displayName;function CH({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:pe("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 kH({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:pe("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 EH({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:pe("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 RH({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:pe("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 TH(e){return!(e.startsWith("gemini-3")||e==="auto-gemini-3")}const NH=["Composer","GPT","Claude","Gemini","Grok","Kimi"];function MH(e){return e.startsWith("composer-")?"Composer":e.startsWith("gpt-")?"GPT":e.startsWith("claude-")?"Claude":e.startsWith("gemini-")?"Gemini":e.startsWith("grok-")?"Grok":"Kimi"}function b_(e,t){const n=Oc(t);return!n||n==="standard"?e:`${e} (${n==="fast"?"Fast":"Standard"})`}const xp={claude:CH,codex:kH,gemini:EH,cursor:RH},_m={auto:Vn,opus:bi,sonnet:Vn,haiku:Ns,"gpt-5.4":bi,"gpt-5.4[reasoning=medium,context=272k,fast=false]":bi,"gpt-5.4-mini[reasoning=medium]":Vn,"gpt-5.4-nano[reasoning=medium]":Ns,"gpt-5.3-codex":Vn,"gpt-5.3-codex[reasoning=medium,fast=false]":Vn,"gpt-5.3-codex-spark[reasoning=medium]":Ns,"gpt-5.2[reasoning=medium,fast=false]":Vn,"gpt-5.2-codex[reasoning=medium,fast=false]":Vn,"gpt-5.3-codex-spark":Ns,"gemini-2.5-pro":bi,"gemini-2.5-flash":Vn,"gemini-2.5-flash-lite":Ns,"auto-gemini-3":bi,"auto-gemini-2.5":Vn,"gemini-3.1-pro-preview":bi,"gemini-3.1-pro[]":bi,"gemini-3-flash[]":Vn,"gemini-3-pro-preview":bi,"gemini-3-flash-preview":Vn,"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]":bi,"claude-opus-4-5[thinking=true]":bi,"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]":Vn,"claude-sonnet-4-5[thinking=true,context=200k]":Vn,"claude-sonnet-4[thinking=false,context=200k]":Vn,"claude-haiku-4-5[thinking=true]":Ns,"grok-4-20[thinking=true]":bi,"kimi-k2.5[]":Vn,"composer-2[fast=true]":bi,"composer-1.5[]":Vn};function ti({onClick:e,selected:t,icon:n,label:r,description:i,disabled:o}){return f.jsxs("button",{onClick:e,disabled:o,className:pe("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}),i?f.jsx("div",{className:"text-xs text-muted-foreground",children:i}):null]})]})}function da({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[i,o]=v.useState(!1);return n?f.jsx("button",{disabled:!0,className:pe("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(tj,{open:i,onOpenChange:o,children:[f.jsx(nj,{asChild:!0,children:f.jsx("button",{className:pe("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(G0,{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 Ad({availableProviders:e,selectedProvider:t,disabled:n=!1,showProviderPicker:r=!0,providerLocked:i=!1,model:o,modelOptions:l,onProviderChange:c,onModelChange:h,onClaudeReasoningEffortChange:d,onClaudeContextWindowChange:g,onCodexReasoningEffortChange:p,onGeminiThinkingModeChange:b,onCodexFastModeChange:y,planMode:w=!1,onPlanModeChange:S,includePlanMode:C=!0,className:k}){var G,M,B,X,j,ie,J;const[R,E]=v.useState(null),N=e.find(ee=>ee.id===t)??cn(t),L=xp[t],A=_m[o]??Vn,O=C&&(N==null?void 0:N.supportsPlanMode)&&S,H=t==="claude"?l:null,Z=t==="codex"?l:null,I=t==="gemini"?l:null,q=((G=N.models.find(ee=>ee.id===o))==null?void 0:G.contextWindowOptions)??[],F=(H==null?void 0:H.contextWindow)??By[0].id,$=F==="1m"?B2:F2,W=t==="claude"||t==="codex",K=t==="cursor"?Oc(o):null,D=N.id==="cursor"?N.models.filter(ee=>nE(ee.id)===nE(o)):[],U=t==="cursor"&&D.some(ee=>Oc(ee.id)==="fast")&&D.some(ee=>Oc(ee.id)==="standard"),z=N.id==="cursor"?NH.map(ee=>({family:ee,models:N.models.filter(re=>MH(re.id)===ee)})).filter(ee=>ee.models.length>0):[];return v.useEffect(()=>{E(null)},[t]),f.jsx("div",{className:pe("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(da,{disabled:i||!c,trigger:f.jsxs(f.Fragment,{children:[f.jsx(L,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"hidden md:inline",children:(N==null?void 0:N.label)??t})]}),children:ee=>e.map(re=>{const ue=xp[re.id];return f.jsx(ti,{onClick:()=>{c==null||c(re.id),ee()},selected:t===re.id,icon:f.jsx(ue,{className:"h-4 w-4 text-muted-foreground"}),label:re.label},re.id)})}):null,f.jsx(da,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(A,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:N.id==="cursor"?b_(((M=N.models.find(ee=>ee.id===o))==null?void 0:M.label)??o,o):((B=N.models.find(ee=>ee.id===o))==null?void 0:B.label)??o})]}),children:ee=>{var re;return N.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(V5,{className:"h-4 w-4"}),f.jsx("span",{children:R})]}),(re=z.find(ue=>ue.family===R))==null?void 0:re.models.map(ue=>{const fe=_m[ue.id]??Vn;return f.jsx(ti,{onClick:()=>{h(t,ue.id),E(null),ee()},selected:o===ue.id,icon:f.jsx(fe,{className:"h-4 w-4 text-muted-foreground"}),label:b_(ue.label,ue.id)},ue.id)})]}):z.map(ue=>{var Ce;const fe=ue.models.some(Re=>Re.id===o),ge=_m[((Ce=ue.models[0])==null?void 0:Ce.id)??""]??Vn;return f.jsxs("div",{className:"relative",children:[f.jsx(ti,{onClick:()=>E(ue.family),selected:fe,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(Vr,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"})]},ue.family)}):N.models.map(ue=>{const fe=_m[ue.id]??Vn;return f.jsx(ti,{onClick:()=>{h(t,ue.id),ee()},selected:o===ue.id,icon:f.jsx(fe,{className:"h-4 w-4 text-muted-foreground"}),label:N.id==="cursor"?b_(ue.label,ue.id):ue.label},ue.id)})}}),U?f.jsx(da,{trigger:f.jsxs(f.Fragment,{children:[K==="fast"?f.jsx(Ns,{className:"h-3.5 w-3.5"}):f.jsx(po,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:K==="fast"?"Fast":"Standard"})]}),triggerClassName:K==="fast"?"text-emerald-500 dark:text-emerald-400":void 0,children:ee=>f.jsxs(f.Fragment,{children:[D.filter(re=>Oc(re.id)==="standard").map(re=>f.jsx(ti,{onClick:()=>{h(t,re.id),ee()},selected:o===re.id,icon:f.jsx(po,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"},re.id)),D.filter(re=>Oc(re.id)==="fast").map(re=>f.jsx(ti,{onClick:()=>{h(t,re.id),ee()},selected:o===re.id,icon:f.jsx(Ns,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast"},re.id))]})}):null,W?f.jsx(da,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(po,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:t==="claude"?((X=bp.find(ee=>ee.id===l.reasoningEffort))==null?void 0:X.label)??l.reasoningEffort:((j=zy.find(ee=>ee.id===l.reasoningEffort))==null?void 0:j.label)??l.reasoningEffort})]}),children:ee=>t==="claude"?bp.map(re=>f.jsx(ti,{onClick:()=>{d(re.id),ee()},selected:l.reasoningEffort===re.id,icon:f.jsx(po,{className:"h-4 w-4 text-muted-foreground"}),label:re.label,disabled:re.id==="max"&&o!=="opus"},re.id)):zy.map(re=>f.jsx(ti,{onClick:()=>{p(re.id),ee()},selected:l.reasoningEffort===re.id,icon:f.jsx(po,{className:"h-4 w-4 text-muted-foreground"}),label:re.label},re.id))}):null,t==="claude"&&q.length>1?f.jsx(da,{trigger:f.jsxs(f.Fragment,{children:[f.jsx($,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:((ie=q.find(ee=>ee.id===F))==null?void 0:ie.label)??F})]}),children:ee=>q.map(re=>f.jsx(ti,{onClick:()=>{g(re.id),ee()},selected:F===re.id,icon:re.id==="1m"?f.jsx(B2,{className:"h-4 w-4 text-muted-foreground"}):f.jsx(F2,{className:"h-4 w-4 text-muted-foreground"}),label:re.label,description:re.id==="1m"?"Expanded context window":"Standard context window"},re.id))}):null,t==="gemini"?f.jsx(da,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(po,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:((J=Py.find(ee=>ee.id===(I==null?void 0:I.thinkingMode)))==null?void 0:J.label)??(I==null?void 0:I.thinkingMode)??"Standard"})]}),children:ee=>Py.map(re=>f.jsx(ti,{onClick:()=>{b(re.id),ee()},selected:(I==null?void 0:I.thinkingMode)===re.id,icon:f.jsx(po,{className:"h-4 w-4 text-muted-foreground"}),label:re.label,disabled:re.id==="off"&&!TH(o)},re.id))}):null,t==="codex"?f.jsx(da,{trigger:f.jsxs(f.Fragment,{children:[Z!=null&&Z.fastMode?f.jsx(Ns,{className:"h-3.5 w-3.5"}):f.jsx(po,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:Z!=null&&Z.fastMode?"Fast Mode":"Standard"})]}),triggerClassName:Z!=null&&Z.fastMode?"text-emerald-500 dark:text-emerald-400":void 0,children:ee=>f.jsxs(f.Fragment,{children:[f.jsx(ti,{onClick:()=>{y(!1),ee()},selected:!(Z!=null&&Z.fastMode),icon:f.jsx(po,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"}),f.jsx(ti,{onClick:()=>{y(!0),ee()},selected:!!(Z!=null&&Z.fastMode),icon:f.jsx(Ns,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,O?f.jsx(da,{trigger:f.jsxs(f.Fragment,{children:[w?f.jsx(up,{className:"h-3.5 w-3.5"}):f.jsx(P2,{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:ee=>f.jsxs(f.Fragment,{children:[f.jsx(ti,{onClick:()=>{S(!1),ee()},selected:!w,icon:f.jsx(P2,{className:"h-4 w-4 text-muted-foreground"}),label:"Implement",description:"Start execution"}),f.jsx(ti,{onClick:()=>{S(!0),ee()},selected:w,icon:f.jsx(up,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan",description:"Review a plan before execution"})]})}):null]})})}const Sg=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...i})=>f.jsx("span",{style:{"--shiny-width":`${Math.min(n,100)}px`},className:pe("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),...i,children:e});function Fy(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const jH=[/^(?:\/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 AH(e){const t=e.trim();for(const n of jH){const r=t.match(n);if(!r)continue;const i=(r[2]??r[1]??"").trim();if(i)return i}return t}function wp(e){return e.split("/").pop()||e}function DH(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,i=60*r,o=24*i,l=7*o;return n<r?"now":n<i?`${Math.floor(n/r)}m`:n<o?`${Math.floor(n/i)}h`:n<l?`${Math.floor(n/o)}d`:`${Math.floor(n/l)}w`}const OH='button, select, input, textarea, [role="combobox"], [role="listbox"], [data-no-touch-drag]';function aE(e){var t;try{(t=navigator.vibrate)==null||t.call(navigator,e)}catch{}}function Y0({enabled:e,visualElementRef:t,onTap:n,onContextMenu:r,onDragStart:i,onDragMove:o,onDragEnd:l,holdDelay:c=300,contextMenuDelay:h=2500,scrollThreshold:d=8,dragMoveThreshold:g=5}){const[p,b]=v.useState(!1),[y,w]=v.useState(!1),[S,C]=v.useState(null),[k,R]=v.useState(null),E=v.useCallback(D=>{R(D)},[]),N=v.useRef("idle"),L=v.useRef({x:0,y:0}),A=v.useRef(null),O=v.useRef(null),H=v.useRef(n),Z=v.useRef(r),I=v.useRef(i),q=v.useRef(o),F=v.useRef(l);H.current=n,Z.current=r,I.current=i,q.current=o,F.current=l;const $=v.useCallback((D,U)=>{const z=(t==null?void 0:t.current)??k;if(!z)return document.elementFromPoint(D,U);const G=z.style.pointerEvents;z.style.pointerEvents="none";const M=document.elementFromPoint(D,U);return z.style.pointerEvents=G,M},[t,k]),W=v.useCallback(()=>{A.current&&(clearTimeout(A.current),A.current=null),O.current&&(clearTimeout(O.current),O.current=null)},[]),K=v.useCallback(()=>{W(),N.current="idle",w(!1),b(!1),C(null)},[W]);return v.useEffect(()=>{if(!k||!e)return;const D=M=>{if(M.target.closest(OH))return;const B=M.touches[0];B&&(L.current={x:B.clientX,y:B.clientY},N.current="holding",A.current=setTimeout(()=>{A.current=null,N.current==="holding"&&(N.current="armed",w(!0),aE(30),O.current=setTimeout(()=>{var j;if(O.current=null,N.current!=="armed")return;aE(100);const X={...L.current};N.current="idle",w(!1),(j=Z.current)==null||j.call(Z,X)},h))},c))},U=M=>{var ee,re;const B=N.current;if(B==="idle")return;const X=M.touches[0];if(!X)return;const j=X.clientX-L.current.x,ie=X.clientY-L.current.y,J=Math.sqrt(j*j+ie*ie);if(B==="holding"){J>d&&(W(),N.current="idle");return}if(B==="armed"){J>g&&(O.current&&(clearTimeout(O.current),O.current=null),N.current="dragging",w(!1),b(!0),C({x:X.clientX,y:X.clientY}),M.preventDefault(),(ee=I.current)==null||ee.call(I,{x:X.clientX,y:X.clientY}));return}if(B==="dragging"){M.preventDefault(),C({x:X.clientX,y:X.clientY});const ue=$(X.clientX,X.clientY);(re=q.current)==null||re.call(q,{x:X.clientX,y:X.clientY,elementBelow:ue})}},z=M=>{var X,j;const B=N.current;if(B==="holding"){W(),N.current="idle",w(!1),b(!1),M.preventDefault(),(X=H.current)==null||X.call(H);return}if(B==="armed"){K();return}if(B==="dragging"){const ie=M.changedTouches[0];if(ie){const J=$(ie.clientX,ie.clientY);(j=F.current)==null||j.call(F,{x:ie.clientX,y:ie.clientY,elementBelow:J})}K()}},G=()=>{var M;N.current==="dragging"&&((M=F.current)==null||M.call(F,{x:0,y:0,elementBelow:null})),K()};return k.addEventListener("touchstart",D,{passive:!1}),k.addEventListener("touchmove",U,{passive:!1}),k.addEventListener("touchend",z),k.addEventListener("touchcancel",G),()=>{k.removeEventListener("touchstart",D),k.removeEventListener("touchmove",U),k.removeEventListener("touchend",z),k.removeEventListener("touchcancel",G),W(),N.current="idle"}},[k,e,c,h,d,g,W,K,$]),{touchRef:E,isDragging:p,isArmed:y,dragPosition:S}}function rj({position:e,children:t,className:n}){return e?os.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:pe("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 LH=new Set(["starting","running"]);function zH({chat:e,activeChatId:t,nowMs:n,showProviderIcon:r=!1,isCompleted:i=!1,onSelectChat:o,onDeleteChat:l,draggable:c=!1,onDragStart:h,onDragEnd:d,isTouchDevice:g=!1,onTouchDragMove:p,onTouchDragEnd:b}){const y=DH(e.lastMessageAt,n),w=g&&c,S=e.provider?xp[e.provider]:null,{touchRef:C,isArmed:k,isDragging:R,dragPosition:E}=Y0({enabled:w,onTap:()=>o(e.chatId),onDragStart:()=>h==null?void 0:h(e),onDragMove:({x:N,y:L,elementBelow:A})=>p==null?void 0:p(N,L,A),onDragEnd:({x:N,y:L,elementBelow:A})=>{b==null||b(N,L,A),d==null||d()}});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{ref:w?C:void 0,"data-chat-id":_2(e.chatId),className:pe("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===_2(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:c&&!g,onDragStart:c&&!g?()=>h==null?void 0:h(e):void 0,onDragEnd:c&&!g?d:void 0,onClick:g?void 0:()=>o(e.chatId),children:[LH.has(e.status)?f.jsx(wr,{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"})]})}):i?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(Sg,{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(Xe,{variant:"ghost",size:"icon",className:pe("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:N=>{N.stopPropagation(),l(e.chatId)},title:"Delete chat",children:f.jsx(VB,{className:"size-3.5"})})]})]},e._id),f.jsx(rj,{position:E,children:f.jsx("span",{className:"text-sm font-medium truncate",children:e.title})})]})}function PH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const Cg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pu(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function X0(e){return"nodeType"in e}function ai(e){var t,n;return e?pu(e)?e:X0(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Z0(e){const{Document:t}=ai(e);return e instanceof t}function Oh(e){return pu(e)?!1:e instanceof ai(e).HTMLElement}function ij(e){return e instanceof ai(e).SVGElement}function gu(e){return e?pu(e)?e.document:X0(e)?Z0(e)?e:Oh(e)||ij(e)?e.ownerDocument:document:document:document}const Fs=Cg?v.useLayoutEffect:v.useEffect;function Q0(e){const t=v.useRef(e);return Fs(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function IH(){const e=v.useRef(null),t=v.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function lh(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return Fs(()=>{n.current!==e&&(n.current=e)},t),n}function Lh(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Sp(e){const t=Q0(e),n=v.useRef(null),r=v.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function Hy(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let __={};function zh(e,t){return v.useMemo(()=>{if(t)return t;const n=__[e]==null?0:__[e]+1;return __[e]=n,e+"-"+n},[e,t])}function sj(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,l)=>{const c=Object.entries(l);for(const[h,d]of c){const g=o[h];g!=null&&(o[h]=g+e*d)}return o},{...t})}}const Wc=sj(1),Cp=sj(-1);function BH(e){return"clientX"in e&&"clientY"in e}function J0(e){if(!e)return!1;const{KeyboardEvent:t}=ai(e.target);return t&&e instanceof t}function FH(e){if(!e)return!1;const{TouchEvent:t}=ai(e.target);return t&&e instanceof t}function $y(e){if(FH(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 BH(e)?{x:e.clientX,y:e.clientY}:null}const ch=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[ch.Translate.toString(e),ch.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),lE="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function HH(e){return e.matches(lE)?e:e.querySelector(lE)}const $H={display:"none"};function UH(e){let{id:t,value:n}=e;return we.createElement("div",{id:t,style:$H},n)}function VH(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={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 we.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function WH(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const oj=v.createContext(null);function qH(e){const t=v.useContext(oj);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function KH(){const[e]=v.useState(()=>new Set),t=v.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[v.useCallback(r=>{let{type:i,event:o}=r;e.forEach(l=>{var c;return(c=l[i])==null?void 0:c.call(l,o)})},[e]),t]}const GH={draggable:`
|
|
520
|
+
To pick up a draggable item, press the space bar.
|
|
521
|
+
While dragging, use the arrow keys to move the item.
|
|
522
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
523
|
+
`},YH={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 XH(e){let{announcements:t=YH,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=GH}=e;const{announce:o,announcement:l}=WH(),c=zh("DndLiveRegion"),[h,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),qH(v.useMemo(()=>({onDragStart(p){let{active:b}=p;o(t.onDragStart({active:b}))},onDragMove(p){let{active:b,over:y}=p;t.onDragMove&&o(t.onDragMove({active:b,over:y}))},onDragOver(p){let{active:b,over:y}=p;o(t.onDragOver({active:b,over:y}))},onDragEnd(p){let{active:b,over:y}=p;o(t.onDragEnd({active:b,over:y}))},onDragCancel(p){let{active:b,over:y}=p;o(t.onDragCancel({active:b,over:y}))}}),[o,t])),!h)return null;const g=we.createElement(we.Fragment,null,we.createElement(UH,{id:r,value:i.draggable}),we.createElement(VH,{id:c,announcement:l}));return n?os.createPortal(g,n):g}var cr;(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"})(cr||(cr={}));function kp(){}function y_(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ZH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const hs=Object.freeze({x:0,y:0});function QH(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function JH(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function e$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function t$(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function cE(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 n$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=cE(t,t.left,t.top),o=[];for(const l of r){const{id:c}=l,h=n.get(c);if(h){const d=QH(cE(h),i);o.push({id:c,data:{droppableContainer:l,value:d}})}}return o.sort(JH)};function r$(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),l=i-r,c=o-n;if(r<i&&n<o){const h=t.width*t.height,d=e.width*e.height,g=l*c,p=g/(h+d-g);return Number(p.toFixed(4))}return 0}const i$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:l}=o,c=n.get(l);if(c){const h=r$(c,t);h>0&&i.push({id:l,data:{droppableContainer:o,value:h}})}}return i.sort(e$)};function s$(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function aj(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:hs}function o$(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const a$=o$(1);function l$(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 c$(e,t,n){const r=l$(t);if(!r)return e;const{scaleX:i,scaleY:o,x:l,y:c}=r,h=e.left-l-(1-i)*parseFloat(n),d=e.top-c-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),g=i?e.width/i: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 u$={ignoreTransform:!1};function vu(e,t){t===void 0&&(t=u$);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=ai(e).getComputedStyle(e);d&&(n=c$(n,d,g))}const{top:r,left:i,width:o,height:l,bottom:c,right:h}=n;return{top:r,left:i,width:o,height:l,bottom:c,right:h}}function uE(e){return vu(e,{ignoreTransform:!0})}function d$(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function h$(e,t){return t===void 0&&(t=ai(e).getComputedStyle(e)),t.position==="fixed"}function f$(e,t){t===void 0&&(t=ai(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function ew(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Z0(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Oh(i)||ij(i)||n.includes(i))return n;const o=ai(e).getComputedStyle(i);return i!==e&&f$(i,o)&&n.push(i),h$(i,o)?n:r(i.parentNode)}return e?r(e):n}function lj(e){const[t]=ew(e,1);return t??null}function x_(e){return!Cg||!e?null:pu(e)?e:X0(e)?Z0(e)||e===gu(e).scrollingElement?window:Oh(e)?e:null:null}function cj(e){return pu(e)?e.scrollX:e.scrollLeft}function uj(e){return pu(e)?e.scrollY:e.scrollTop}function Uy(e){return{x:cj(e),y:uj(e)}}var pr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(pr||(pr={}));function dj(e){return!Cg||!e?!1:e===document.scrollingElement}function hj(e){const t={x:0,y:0},n=dj(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const m$={x:.2,y:.2};function p$(e,t,n,r,i){let{top:o,left:l,right:c,bottom:h}=n;r===void 0&&(r=10),i===void 0&&(i=m$);const{isTop:d,isBottom:g,isLeft:p,isRight:b}=hj(e),y={x:0,y:0},w={x:0,y:0},S={height:t.height*i.y,width:t.width*i.x};return!d&&o<=t.top+S.height?(y.y=pr.Backward,w.y=r*Math.abs((t.top+S.height-o)/S.height)):!g&&h>=t.bottom-S.height&&(y.y=pr.Forward,w.y=r*Math.abs((t.bottom-S.height-h)/S.height)),!b&&c>=t.right-S.width?(y.x=pr.Forward,w.x=r*Math.abs((t.right-S.width-c)/S.width)):!p&&l<=t.left+S.width&&(y.x=pr.Backward,w.x=r*Math.abs((t.left+S.width-l)/S.width)),{direction:y,speed:w}}function g$(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:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function fj(e){return e.reduce((t,n)=>Wc(t,Uy(n)),hs)}function v$(e){return e.reduce((t,n)=>t+cj(n),0)}function b$(e){return e.reduce((t,n)=>t+uj(n),0)}function _$(e,t){if(t===void 0&&(t=vu),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);lj(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const y$=[["x",["left","right"],v$],["y",["top","bottom"],b$]];class tw{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=ew(n),i=fj(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,l,c]of y$)for(const h of l)Object.defineProperty(this,h,{get:()=>{const d=c(r),g=i[o]-d;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class qd{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 i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function x$(e){const{EventTarget:t}=ai(e);return e instanceof t?e:gu(e)}function w_(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 $i;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})($i||($i={}));function dE(e){e.preventDefault()}function w$(e){e.stopPropagation()}var Xt;(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"})(Xt||(Xt={}));const mj={start:[Xt.Space,Xt.Enter],cancel:[Xt.Esc],end:[Xt.Space,Xt.Enter,Xt.Tab]},S$=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Xt.Right:return{...n,x:n.x+25};case Xt.Left:return{...n,x:n.x-25};case Xt.Down:return{...n,y:n.y+25};case Xt.Up:return{...n,y:n.y-25}}};class nw{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 qd(gu(n)),this.windowListeners=new qd(ai(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add($i.Resize,this.handleCancel),this.windowListeners.add($i.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($i.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&_$(r),n(hs)}handleKeyDown(t){if(J0(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=mj,coordinateGetter:l=S$,scrollBehavior:c="smooth"}=i,{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}:hs;this.referenceCoordinates||(this.referenceCoordinates=g);const p=l(t,{active:n,context:r.current,currentCoordinates:g});if(p){const b=Cp(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:N,maxScroll:L,minScroll:A}=hj(S),O=g$(S),H={x:Math.min(C===Xt.Right?O.right-O.width/2:O.right,Math.max(C===Xt.Right?O.left:O.left+O.width/2,p.x)),y:Math.min(C===Xt.Down?O.bottom-O.height/2:O.bottom,Math.max(C===Xt.Down?O.top:O.top+O.height/2,p.y))},Z=C===Xt.Right&&!R||C===Xt.Left&&!E,I=C===Xt.Down&&!N||C===Xt.Up&&!k;if(Z&&H.x!==p.x){const q=S.scrollLeft+b.x,F=C===Xt.Right&&q<=L.x||C===Xt.Left&&q>=A.x;if(F&&!b.y){S.scrollTo({left:q,behavior:c});return}F?y.x=S.scrollLeft-q:y.x=C===Xt.Right?S.scrollLeft-L.x:S.scrollLeft-A.x,y.x&&S.scrollBy({left:-y.x,behavior:c});break}else if(I&&H.y!==p.y){const q=S.scrollTop+b.y,F=C===Xt.Down&&q<=L.y||C===Xt.Up&&q>=A.y;if(F&&!b.x){S.scrollTo({top:q,behavior:c});return}F?y.y=S.scrollTop-q:y.y=C===Xt.Down?S.scrollTop-L.y:S.scrollTop-A.y,y.y&&S.scrollBy({top:-y.y,behavior:c});break}}this.handleMove(t,Wc(Cp(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()}}nw.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=mj,onActivation:i}=t,{active:o}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=o.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function hE(e){return!!(e&&"distance"in e)}function fE(e){return!!(e&&"delay"in e)}class rw{constructor(t,n,r){var i;r===void 0&&(r=x$(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=gu(l),this.documentListeners=new qd(this.document),this.listeners=new qd(r),this.windowListeners=new qd(ai(l)),this.initialCoordinates=(i=$y(o))!=null?i:hs,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($i.Resize,this.handleCancel),this.windowListeners.add($i.DragStart,dE),this.windowListeners.add($i.VisibilityChange,this.handleCancel),this.windowListeners.add($i.ContextMenu,dE),this.documentListeners.add($i.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fE(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(hE(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:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add($i.Click,w$,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($i.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:l,options:{activationConstraint:c}}=o;if(!i)return;const h=(n=$y(t))!=null?n:hs,d=Cp(i,h);if(!r&&c){if(hE(c)){if(c.tolerance!=null&&w_(d,c.tolerance))return this.handleCancel();if(w_(d,c.distance))return this.handleStart()}if(fE(c)&&w_(d,c.tolerance))return this.handleCancel();this.handlePending(c,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===Xt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const C$={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class iw extends rw{constructor(t){const{event:n}=t,r=gu(n.target);super(t,C$,r)}}iw.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 k$={move:{name:"mousemove"},end:{name:"mouseup"}};var Vy;(function(e){e[e.RightClick=2]="RightClick"})(Vy||(Vy={}));class E$ extends rw{constructor(t){super(t,k$,gu(t.event.target))}}E$.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Vy.RightClick?!1:(r==null||r({event:n}),!0)}}];const S_={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pj extends rw{constructor(t){super(t,S_)}static setup(){return window.addEventListener(S_.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(S_.move.name,t)};function t(){}}}pj.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Kd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Kd||(Kd={}));var Ep;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ep||(Ep={}));function R$(e){let{acceleration:t,activator:n=Kd.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:l=5,order:c=Ep.TreeOrder,pointerCoordinates:h,scrollableAncestors:d,scrollableAncestorRects:g,delta:p,threshold:b}=e;const y=N$({delta:p,disabled:!o}),[w,S]=IH(),C=v.useRef({x:0,y:0}),k=v.useRef({x:0,y:0}),R=v.useMemo(()=>{switch(n){case Kd.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case Kd.DraggableRect:return i}},[n,i,h]),E=v.useRef(null),N=v.useCallback(()=>{const A=E.current;if(!A)return;const O=C.current.x*k.current.x,H=C.current.y*k.current.y;A.scrollBy(O,H)},[]),L=v.useMemo(()=>c===Ep.TreeOrder?[...d].reverse():d,[c,d]);v.useEffect(()=>{if(!o||!d.length||!R){S();return}for(const A of L){if((r==null?void 0:r(A))===!1)continue;const O=d.indexOf(A),H=g[O];if(!H)continue;const{direction:Z,speed:I}=p$(A,H,R,t,b);for(const q of["x","y"])y[q][Z[q]]||(I[q]=0,Z[q]=0);if(I.x>0||I.y>0){S(),E.current=A,w(N,l),C.current=I,k.current=Z;return}}C.current={x:0,y:0},k.current={x:0,y:0},S()},[t,N,r,S,o,l,JSON.stringify(R),JSON.stringify(y),w,d,L,g,JSON.stringify(b)])}const T$={x:{[pr.Backward]:!1,[pr.Forward]:!1},y:{[pr.Backward]:!1,[pr.Forward]:!1}};function N$(e){let{delta:t,disabled:n}=e;const r=Hy(t);return Lh(i=>{if(n||!r||!i)return T$;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[pr.Backward]:i.x[pr.Backward]||o.x===-1,[pr.Forward]:i.x[pr.Forward]||o.x===1},y:{[pr.Backward]:i.y[pr.Backward]||o.y===-1,[pr.Forward]:i.y[pr.Forward]||o.y===1}}},[n,t,r])}function M$(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Lh(i=>{var o;return t==null?null:(o=r??i)!=null?o:null},[r,t])}function j$(e,t){return v.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...o]},[]),[e,t])}var uh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(uh||(uh={}));var Wy;(function(e){e.Optimized="optimized"})(Wy||(Wy={}));const mE=new Map;function A$(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,l]=v.useState(null),{frequency:c,measure:h,strategy:d}=i,g=v.useRef(e),p=C(),b=lh(p),y=v.useCallback(function(k){k===void 0&&(k=[]),!b.current&&l(R=>R===null?k:R.concat(k.filter(E=>!R.includes(E))))},[b]),w=v.useRef(null),S=Lh(k=>{if(p&&!n)return mE;if(!k||k===mE||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 N=E.node.current,L=N?new tw(h(N),N):null;E.rect.current=L,L&&R.set(E.id,L)}return R}return k},[e,o,n,p,h]);return v.useEffect(()=>{g.current=e},[e]),v.useEffect(()=>{p||y()},[n,p]),v.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),v.useEffect(()=>{p||typeof c!="number"||w.current!==null||(w.current=setTimeout(()=>{y(),w.current=null},c))},[c,p,y,...r]),{droppableRects:S,measureDroppableContainers:y,measuringScheduled:o!=null};function C(){switch(d){case uh.Always:return!1;case uh.BeforeDragging:return n;default:return!n}}}function gj(e,t){return Lh(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function D$(e,t){return gj(e,t)}function O$(e){let{callback:t,disabled:n}=e;const r=Q0(t),i=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function kg(e){let{callback:t,disabled:n}=e;const r=Q0(t),i=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function L$(e){return new tw(vu(e),e)}function pE(e,t,n){t===void 0&&(t=L$);const[r,i]=v.useState(null);function o(){i(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=O$({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}}}}),c=kg({callback:o});return Fs(()=>{o(),e?(c==null||c.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),l==null||l.disconnect())},[e]),r}function z$(e){const t=gj(e);return aj(e,t)}const gE=[];function P$(e){const t=v.useRef(e),n=Lh(r=>e?r&&r!==gE&&e&&t.current&&e.parentNode===t.current.parentNode?r:ew(e):gE,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function I$(e){const[t,n]=v.useState(null),r=v.useRef(e),i=v.useCallback(o=>{const l=x_(o.target);l&&n(c=>c?(c.set(l,Uy(l)),new Map(c)):null)},[]);return v.useEffect(()=>{const o=r.current;if(e!==o){l(o);const c=e.map(h=>{const d=x_(h);return d?(d.addEventListener("scroll",i,{passive:!0}),[d,Uy(d)]):null}).filter(h=>h!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(o)};function l(c){c.forEach(h=>{const d=x_(h);d==null||d.removeEventListener("scroll",i)})}},[i,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,l)=>Wc(o,l),hs):fj(e):hs,[e,t])}function vE(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==hs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Cp(e,n.current):hs}function B$(e){v.useEffect(()=>{if(!Cg)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 F$(e,t){return v.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=l=>{o(l,t)},n},{}),[e,t])}function vj(e){return v.useMemo(()=>e?d$(e):null,[e])}const bE=[];function H$(e,t){t===void 0&&(t=vu);const[n]=e,r=vj(n?ai(n):null),[i,o]=v.useState(bE);function l(){o(()=>e.length?e.map(h=>dj(h)?r:new tw(t(h),h)):bE)}const c=kg({callback:l});return Fs(()=>{c==null||c.disconnect(),l(),e.forEach(h=>c==null?void 0:c.observe(h))},[e]),i}function $$(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Oh(t)?t:e}function U$(e){let{measure:t}=e;const[n,r]=v.useState(null),i=v.useCallback(d=>{for(const{target:g}of d)if(Oh(g)){r(p=>{const b=t(g);return p?{...p,width:b.width,height:b.height}:b});break}},[t]),o=kg({callback:i}),l=v.useCallback(d=>{const g=$$(d);o==null||o.disconnect(),g&&(o==null||o.observe(g)),r(g?t(g):null)},[t,o]),[c,h]=Sp(l);return v.useMemo(()=>({nodeRef:c,rect:n,setRef:h}),[n,c,h])}const V$=[{sensor:iw,options:{}},{sensor:nw,options:{}}],W$={current:{}},Ym={draggable:{measure:uE},droppable:{measure:uE,strategy:uh.WhileDragging,frequency:Wy.Optimized},dragOverlay:{measure:vu}};class Gd 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 q$={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Gd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:kp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ym,measureDroppableContainers:kp,windowRect:null,measuringScheduled:!1},K$={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:kp,draggableNodes:new Map,over:null,measureDroppableContainers:kp},Eg=v.createContext(K$),bj=v.createContext(q$);function G$(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Gd}}}function Y$(e,t){switch(t.type){case cr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case cr.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 cr.DragEnd:case cr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case cr.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Gd(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case cr.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new Gd(e.droppable.containers);return l.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:l}}}case cr.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Gd(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function X$(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=v.useContext(Eg),o=Hy(r),l=Hy(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&o&&l!=null){if(!J0(o)||document.activeElement===o.target)return;const c=i.get(l);if(!c)return;const{activatorNode:h,node:d}=c;if(!h.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[h.current,d.current]){if(!g)continue;const p=HH(g);if(p){p.focus();break}}})}},[r,t,i,l,o]),null}function Z$(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function Q$(e){return v.useMemo(()=>({draggable:{...Ym.draggable,...e==null?void 0:e.draggable},droppable:{...Ym.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ym.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 J$(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=v.useRef(!1),{x:l,y:c}=typeof i=="boolean"?{x:i,y:i}:i;Fs(()=>{if(!l&&!c||!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=aj(g,r);if(l||(p.x=0),c||(p.y=0),o.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const b=lj(d);b&&b.scrollBy({top:p.y,left:p.x})}},[t,l,c,r,n])}const _j=v.createContext({...hs,scaleX:1,scaleY:1});var ba;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ba||(ba={}));const eU=v.memo(function(t){var n,r,i,o;let{id:l,accessibility:c,autoScroll:h=!0,children:d,sensors:g=V$,collisionDetection:p=i$,measuring:b,modifiers:y,...w}=t;const S=v.useReducer(Y$,void 0,G$),[C,k]=S,[R,E]=KH(),[N,L]=v.useState(ba.Uninitialized),A=N===ba.Initialized,{draggable:{active:O,nodes:H,translate:Z},droppable:{containers:I}}=C,q=O!=null?H.get(O):null,F=v.useRef({initial:null,translated:null}),$=v.useMemo(()=>{var Kt;return O!=null?{id:O,data:(Kt=q==null?void 0:q.data)!=null?Kt:W$,rect:F}:null},[O,q]),W=v.useRef(null),[K,D]=v.useState(null),[U,z]=v.useState(null),G=lh(w,Object.values(w)),M=zh("DndDescribedBy",l),B=v.useMemo(()=>I.getEnabled(),[I]),X=Q$(b),{droppableRects:j,measureDroppableContainers:ie,measuringScheduled:J}=A$(B,{dragging:A,dependencies:[Z.x,Z.y],config:X.droppable}),ee=M$(H,O),re=v.useMemo(()=>U?$y(U):null,[U]),ue=er(),fe=D$(ee,X.draggable.measure);J$({activeNode:O!=null?H.get(O):null,config:ue.layoutShiftCompensation,initialRect:fe,measure:X.draggable.measure});const ge=pE(ee,X.draggable.measure,fe),Ce=pE(ee?ee.parentElement:null),Re=v.useRef({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),je=I.getNodeFor((n=Re.current.over)==null?void 0:n.id),Qe=U$({measure:X.dragOverlay.measure}),yt=(r=Qe.nodeRef.current)!=null?r:ee,Tt=A?(i=Qe.rect)!=null?i:ge:null,me=!!(Qe.nodeRef.current&&Qe.rect),Ue=z$(me?null:ge),Oe=vj(yt?ai(yt):null),mt=P$(A?je??ee:null),pt=H$(mt),ot=Z$(y,{transform:{x:Z.x-Ue.x,y:Z.y-Ue.y,scaleX:1,scaleY:1},activatorEvent:U,active:$,activeNodeRect:ge,containerNodeRect:Ce,draggingNodeRect:Tt,over:Re.current.over,overlayNodeRect:Qe.rect,scrollableAncestors:mt,scrollableAncestorRects:pt,windowRect:Oe}),dn=re?Wc(re,Z):null,Nt=I$(mt),In=vE(Nt),de=vE(Nt,[ge]),oe=Wc(ot,In),xe=Tt?a$(Tt,ot):null,ke=$&&xe?p({active:$,collisionRect:xe,droppableRects:j,droppableContainers:B,pointerCoordinates:dn}):null,Ke=t$(ke,"id"),[ct,Je]=v.useState(null),Ae=me?ot:Wc(ot,de),$e=s$(Ae,(o=ct==null?void 0:ct.rect)!=null?o:null,ge),lt=v.useRef(null),Fe=v.useCallback((Kt,Ft)=>{let{sensor:Pe,options:vt}=Ft;if(W.current==null)return;const kt=H.get(W.current);if(!kt)return;const Et=Kt.nativeEvent,fn=new Pe({active:W.current,activeNode:kt,event:Et,options:vt,context:Re,onAbort(rt){if(!H.get(rt))return;const{onDragAbort:Te}=G.current,Le={id:rt};Te==null||Te(Le),R({type:"onDragAbort",event:Le})},onPending(rt,xn,Te,Le){if(!H.get(rt))return;const{onDragPending:ut}=G.current,mn={id:rt,constraint:xn,initialCoordinates:Te,offset:Le};ut==null||ut(mn),R({type:"onDragPending",event:mn})},onStart(rt){const xn=W.current;if(xn==null)return;const Te=H.get(xn);if(!Te)return;const{onDragStart:Le}=G.current,Ot={activatorEvent:Et,active:{id:xn,data:Te.data,rect:F}};os.unstable_batchedUpdates(()=>{Le==null||Le(Ot),L(ba.Initializing),k({type:cr.DragStart,initialCoordinates:rt,active:xn}),R({type:"onDragStart",event:Ot}),D(lt.current),z(Et)})},onMove(rt){k({type:cr.DragMove,coordinates:rt})},onEnd:ze(cr.DragEnd),onCancel:ze(cr.DragCancel)});lt.current=fn;function ze(rt){return async function(){const{active:Te,collisions:Le,over:Ot,scrollAdjustedTranslate:ut}=Re.current;let mn=null;if(Te&&ut){const{cancelDrop:Qt}=G.current;mn={activatorEvent:Et,active:Te,collisions:Le,delta:ut,over:Ot},rt===cr.DragEnd&&typeof Qt=="function"&&await Promise.resolve(Qt(mn))&&(rt=cr.DragCancel)}W.current=null,os.unstable_batchedUpdates(()=>{k({type:rt}),L(ba.Uninitialized),Je(null),D(null),z(null),lt.current=null;const Qt=rt===cr.DragEnd?"onDragEnd":"onDragCancel";if(mn){const rn=G.current[Qt];rn==null||rn(mn),R({type:Qt,event:mn})}})}}},[H]),hn=v.useCallback((Kt,Ft)=>(Pe,vt)=>{const kt=Pe.nativeEvent,Et=H.get(vt);if(W.current!==null||!Et||kt.dndKit||kt.defaultPrevented)return;const fn={active:Et};Kt(Pe,Ft.options,fn)===!0&&(kt.dndKit={capturedBy:Ft.sensor},W.current=vt,Fe(Pe,Ft))},[H,Fe]),qt=j$(g,hn);B$(g),Fs(()=>{ge&&N===ba.Initializing&&L(ba.Initialized)},[ge,N]),v.useEffect(()=>{const{onDragMove:Kt}=G.current,{active:Ft,activatorEvent:Pe,collisions:vt,over:kt}=Re.current;if(!Ft||!Pe)return;const Et={active:Ft,activatorEvent:Pe,collisions:vt,delta:{x:oe.x,y:oe.y},over:kt};os.unstable_batchedUpdates(()=>{Kt==null||Kt(Et),R({type:"onDragMove",event:Et})})},[oe.x,oe.y]),v.useEffect(()=>{const{active:Kt,activatorEvent:Ft,collisions:Pe,droppableContainers:vt,scrollAdjustedTranslate:kt}=Re.current;if(!Kt||W.current==null||!Ft||!kt)return;const{onDragOver:Et}=G.current,fn=vt.get(Ke),ze=fn&&fn.rect.current?{id:fn.id,rect:fn.rect.current,data:fn.data,disabled:fn.disabled}:null,rt={active:Kt,activatorEvent:Ft,collisions:Pe,delta:{x:kt.x,y:kt.y},over:ze};os.unstable_batchedUpdates(()=>{Je(ze),Et==null||Et(rt),R({type:"onDragOver",event:rt})})},[Ke]),Fs(()=>{Re.current={activatorEvent:U,active:$,activeNode:ee,collisionRect:xe,collisions:ke,droppableRects:j,draggableNodes:H,draggingNode:yt,draggingNodeRect:Tt,droppableContainers:I,over:ct,scrollableAncestors:mt,scrollAdjustedTranslate:oe},F.current={initial:Tt,translated:xe}},[$,ee,ke,xe,H,yt,Tt,j,I,ct,mt,oe]),R$({...ue,delta:Z,draggingRect:xe,pointerCoordinates:dn,scrollableAncestors:mt,scrollableAncestorRects:pt});const bn=v.useMemo(()=>({active:$,activeNode:ee,activeNodeRect:ge,activatorEvent:U,collisions:ke,containerNodeRect:Ce,dragOverlay:Qe,draggableNodes:H,droppableContainers:I,droppableRects:j,over:ct,measureDroppableContainers:ie,scrollableAncestors:mt,scrollableAncestorRects:pt,measuringConfiguration:X,measuringScheduled:J,windowRect:Oe}),[$,ee,ge,U,ke,Ce,Qe,H,I,j,ct,ie,mt,pt,X,J,Oe]),dr=v.useMemo(()=>({activatorEvent:U,activators:qt,active:$,activeNodeRect:ge,ariaDescribedById:{draggable:M},dispatch:k,draggableNodes:H,over:ct,measureDroppableContainers:ie}),[U,qt,$,ge,k,M,H,ct,ie]);return we.createElement(oj.Provider,{value:E},we.createElement(Eg.Provider,{value:dr},we.createElement(bj.Provider,{value:bn},we.createElement(_j.Provider,{value:$e},d)),we.createElement(X$,{disabled:(c==null?void 0:c.restoreFocus)===!1})),we.createElement(XH,{...c,hiddenTextDescribedById:M}));function er(){const Kt=(K==null?void 0:K.autoScrollEnabled)===!1,Ft=typeof h=="object"?h.enabled===!1:h===!1,Pe=A&&!Kt&&!Ft;return typeof h=="object"?{...h,enabled:Pe}:{enabled:Pe}}}),tU=v.createContext(null),_E="button",nU="Draggable";function rU(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=zh(nU),{activators:l,activatorEvent:c,active:h,activeNodeRect:d,ariaDescribedById:g,draggableNodes:p,over:b}=v.useContext(Eg),{role:y=_E,roleDescription:w="draggable",tabIndex:S=0}=i??{},C=(h==null?void 0:h.id)===t,k=v.useContext(C?_j:tU),[R,E]=Sp(),[N,L]=Sp(),A=F$(l,t),O=lh(n);Fs(()=>(p.set(t,{id:t,key:o,node:R,activatorNode:N,data:O}),()=>{const Z=p.get(t);Z&&Z.key===o&&p.delete(t)}),[p,t]);const H=v.useMemo(()=>({role:y,tabIndex:S,"aria-disabled":r,"aria-pressed":C&&y===_E?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,y,S,C,w,g.draggable]);return{active:h,activatorEvent:c,activeNodeRect:d,attributes:H,isDragging:C,listeners:r?void 0:A,node:R,over:b,setNodeRef:E,setActivatorNodeRef:L,transform:k}}function iU(){return v.useContext(bj)}const sU="Droppable",oU={timeout:25};function aU(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=zh(sU),{active:l,dispatch:c,over:h,measureDroppableContainers:d}=v.useContext(Eg),g=v.useRef({disabled:n}),p=v.useRef(!1),b=v.useRef(null),y=v.useRef(null),{disabled:w,updateMeasurementsFor:S,timeout:C}={...oU,...i},k=lh(S??r),R=v.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=kg({callback:R,disabled:w||!l}),N=v.useCallback((H,Z)=>{E&&(Z&&(E.unobserve(Z),p.current=!1),H&&E.observe(H))},[E]),[L,A]=Sp(N),O=lh(t);return v.useEffect(()=>{!E||!L.current||(E.disconnect(),p.current=!1,E.observe(L.current))},[L,E]),v.useEffect(()=>(c({type:cr.RegisterDroppable,element:{id:r,key:o,disabled:n,node:L,rect:b,data:O}}),()=>c({type:cr.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==g.current.disabled&&(c({type:cr.SetDroppableDisabled,id:r,key:o,disabled:n}),g.current.disabled=n)},[r,o,n,c]),{active:l,rect:b,isOver:(h==null?void 0:h.id)===r,node:L,over:h,setNodeRef:A}}function Rg(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function lU(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function ym(e){return e!==null&&e>=0}function cU(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 uU(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const yj=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=Rg(t,r,n),l=t[i],c=o[i];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},xm={scaleX:1,scaleY:1},dU=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:l}=e;const c=(t=o[n])!=null?t:r;if(!c)return null;if(i===n){const d=o[l];return d?{x:0,y:n<l?d.top+d.height-(c.top+c.height):d.top-c.top,...xm}:null}const h=hU(o,i,n);return i>n&&i<=l?{x:0,y:-c.height-h,...xm}:i<n&&i>=l?{x:0,y:c.height+h,...xm}:{x:0,y:0,...xm}};function hU(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?n<t?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const xj="Sortable",wj=we.createContext({activeIndex:-1,containerId:xj,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:yj,disabled:{draggable:!1,droppable:!1}});function fU(e){let{children:t,id:n,items:r,strategy:i=yj,disabled:o=!1}=e;const{active:l,dragOverlay:c,droppableRects:h,over:d,measureDroppableContainers:g}=iU(),p=zh(xj,n),b=c.rect!==null,y=v.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),w=l!=null,S=l?y.indexOf(l.id):-1,C=d?y.indexOf(d.id):-1,k=v.useRef(y),R=!cU(y,k.current),E=C!==-1&&S===-1||R,N=uU(o);Fs(()=>{R&&w&&g(y)},[R,y,w,g]),v.useEffect(()=>{k.current=y},[y]);const L=v.useMemo(()=>({activeIndex:S,containerId:p,disabled:N,disableTransforms:E,items:y,overIndex:C,useDragOverlay:b,sortedRects:lU(y,h),strategy:i}),[S,p,N.draggable,N.droppable,E,y,C,h,b,i]);return we.createElement(wj.Provider,{value:L},t)}const mU=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Rg(n,r,i).indexOf(t)},pU=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:l,previousItems:c,previousContainerId:h,transition:d}=e;return!d||!r||c!==o&&i===l?!1:n?!0:l!==i&&t===h},gU={duration:200,easing:"ease"},Sj="transform",vU=ch.Transition.toString({property:Sj,duration:0,easing:"linear"}),bU={roleDescription:"sortable"};function _U(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,l]=v.useState(null),c=v.useRef(n);return Fs(()=>{if(!t&&n!==c.current&&r.current){const h=i.current;if(h){const d=vu(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!==c.current&&(c.current=n)},[t,n,r,i]),v.useEffect(()=>{o&&l(null)},[o]),o}function yU(e){let{animateLayoutChanges:t=pU,attributes:n,disabled:r,data:i,getNewIndex:o=mU,id:l,strategy:c,resizeObserverConfig:h,transition:d=gU}=e;const{items:g,containerId:p,activeIndex:b,disabled:y,disableTransforms:w,sortedRects:S,overIndex:C,useDragOverlay:k,strategy:R}=v.useContext(wj),E=xU(r,y),N=g.indexOf(l),L=v.useMemo(()=>({sortable:{containerId:p,index:N,items:g},...i}),[p,i,N,g]),A=v.useMemo(()=>g.slice(g.indexOf(l)),[g,l]),{rect:O,node:H,isOver:Z,setNodeRef:I}=aU({id:l,data:L,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...h}}),{active:q,activatorEvent:F,activeNodeRect:$,attributes:W,setNodeRef:K,listeners:D,isDragging:U,over:z,setActivatorNodeRef:G,transform:M}=rU({id:l,data:L,attributes:{...bU,...n},disabled:E.draggable}),B=PH(I,K),X=!!q,j=X&&!w&&ym(b)&&ym(C),ie=!k&&U,J=ie&&j?M:null,re=j?J??(c??R)({rects:S,activeNodeRect:$,activeIndex:b,overIndex:C,index:N}):null,ue=ym(b)&&ym(C)?o({id:l,items:g,activeIndex:b,overIndex:C}):N,fe=q==null?void 0:q.id,ge=v.useRef({activeId:fe,items:g,newIndex:ue,containerId:p}),Ce=g!==ge.current.items,Re=t({active:q,containerId:p,isDragging:U,isSorting:X,id:l,index:N,items:g,newIndex:ge.current.newIndex,previousItems:ge.current.items,previousContainerId:ge.current.containerId,transition:d,wasDragging:ge.current.activeId!=null}),je=_U({disabled:!Re,index:N,node:H,rect:O});return v.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]),v.useEffect(()=>{if(fe===ge.current.activeId)return;if(fe!=null&&ge.current.activeId==null){ge.current.activeId=fe;return}const yt=setTimeout(()=>{ge.current.activeId=fe},50);return()=>clearTimeout(yt)},[fe]),{active:q,activeIndex:b,attributes:W,data:L,rect:O,index:N,newIndex:ue,items:g,isOver:Z,isSorting:X,isDragging:U,listeners:D,node:H,overIndex:C,over:z,setNodeRef:B,setActivatorNodeRef:G,setDroppableNodeRef:I,setDraggableNodeRef:K,transform:je??re,transition:Qe()};function Qe(){if(je||Ce&&ge.current.newIndex===N)return vU;if(!(ie&&!J0(F)||!d)&&(X||Re))return ch.Transition.toString({...d,property:Sj})}}function xU(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}}Xt.Down,Xt.Right,Xt.Up,Xt.Left;const yE={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 xE(e,[t,n]){return Math.min(n,Math.max(t,e))}function sw(e){const t=e+"CollectionProvider",[n,r]=jo(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:k}=S,R=we.useRef(null),E=we.useRef(new Map).current;return f.jsx(i,{scope:C,itemMap:E,collectionRef:R,children:k})};l.displayName=t;const c=e+"CollectionSlot",h=wl(c),d=we.forwardRef((S,C)=>{const{scope:k,children:R}=S,E=o(c,k),N=Zt(C,E.collectionRef);return f.jsx(h,{ref:N,children:R})});d.displayName=c;const g=e+"CollectionItemSlot",p="data-radix-collection-item",b=wl(g),y=we.forwardRef((S,C)=>{const{scope:k,children:R,...E}=S,N=we.useRef(null),L=Zt(C,N),A=o(g,k);return we.useEffect(()=>(A.itemMap.set(N,{ref:N,...E}),()=>void A.itemMap.delete(N))),f.jsx(b,{[p]:"",ref:L,children:R})});y.displayName=g;function w(S){const C=o(e+"CollectionConsumer",S);return we.useCallback(()=>{const R=C.collectionRef.current;if(!R)return[];const E=Array.from(R.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((A,O)=>E.indexOf(A.ref.current)-E.indexOf(O.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:d,ItemSlot:y},w,r]}var wU=v.createContext(void 0);function ow(e){const t=v.useContext(wU);return e||t||"ltr"}function SU(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var CU=[" ","Enter","ArrowUp","ArrowDown"],kU=[" ","Enter"],kl="Select",[Tg,Ng,EU]=sw(kl),[bu,Roe]=jo(kl,[EU,Oa]),Mg=Oa(),[RU,za]=bu(kl),[TU,NU]=bu(kl),Cj=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:c,onValueChange:h,dir:d,name:g,autoComplete:p,disabled:b,required:y,form:w}=e,S=Mg(t),[C,k]=v.useState(null),[R,E]=v.useState(null),[N,L]=v.useState(!1),A=ow(d),[O,H]=Yc({prop:r,defaultProp:i??!1,onChange:o,caller:kl}),[Z,I]=Yc({prop:l,defaultProp:c,onChange:h,caller:kl}),q=v.useRef(null),F=C?w||!!C.closest("form"):!0,[$,W]=v.useState(new Set),K=Array.from($).map(D=>D.props.value).join(";");return f.jsx(gg,{...S,children:f.jsxs(RU,{required:y,scope:t,trigger:C,onTriggerChange:k,valueNode:R,onValueNodeChange:E,valueNodeHasChildren:N,onValueNodeHasChildrenChange:L,contentId:So(),value:Z,onValueChange:I,open:O,onOpenChange:H,dir:A,triggerPointerDownPosRef:q,disabled:b,children:[f.jsx(Tg.Provider,{scope:t,children:f.jsx(TU,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(D=>{W(U=>new Set(U).add(D))},[]),onNativeOptionRemove:v.useCallback(D=>{W(U=>{const z=new Set(U);return z.delete(D),z})},[]),children:n})}),F?f.jsxs(Yj,{"aria-hidden":!0,required:y,tabIndex:-1,name:g,autoComplete:p,value:Z,onChange:D=>I(D.target.value),disabled:b,form:w,children:[Z===void 0?f.jsx("option",{value:""}):null,Array.from($)]},K):null]})})};Cj.displayName=kl;var kj="SelectTrigger",Ej=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Mg(n),l=za(kj,n),c=l.disabled||r,h=Zt(t,l.onTriggerChange),d=Ng(n),g=v.useRef("touch"),[p,b,y]=Zj(S=>{const C=d().filter(E=>!E.disabled),k=C.find(E=>E.value===l.value),R=Qj(C,S,k);R!==void 0&&l.onValueChange(R.value)}),w=S=>{c||(l.onOpenChange(!0),y()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return f.jsx(jh,{asChild:!0,...o,children:f.jsx(Dt.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:c,"data-disabled":c?"":void 0,"data-placeholder":Xj(l.value)?"":void 0,...i,ref:h,onClick:He(i.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&w(S)}),onPointerDown:He(i.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:He(i.onKeyDown,S=>{const C=p.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&b(S.key),!(C&&S.key===" ")&&CU.includes(S.key)&&(w(),S.preventDefault())})})})});Ej.displayName=kj;var Rj="SelectValue",Tj=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...c}=e,h=za(Rj,n),{onValueNodeHasChildrenChange:d}=h,g=o!==void 0,p=Zt(t,h.onValueNodeChange);return Pr(()=>{d(g)},[d,g]),f.jsx(Dt.span,{...c,ref:p,style:{pointerEvents:"none"},children:Xj(h.value)?f.jsx(f.Fragment,{children:l}):o})});Tj.displayName=Rj;var MU="SelectIcon",Nj=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return f.jsx(Dt.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Nj.displayName=MU;var jU="SelectPortal",Mj=e=>f.jsx(du,{asChild:!0,...e});Mj.displayName=jU;var El="SelectContent",jj=v.forwardRef((e,t)=>{const n=za(El,e.__scopeSelect),[r,i]=v.useState();if(Pr(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?os.createPortal(f.jsx(Aj,{scope:e.__scopeSelect,children:f.jsx(Tg.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),o):null}return f.jsx(Dj,{...e,ref:t})});jj.displayName=El;var is=10,[Aj,Pa]=bu(El),AU="SelectContentImpl",DU=wl("SelectContent.RemoveScroll"),Dj=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:c,sideOffset:h,align:d,alignOffset:g,arrowPadding:p,collisionBoundary:b,collisionPadding:y,sticky:w,hideWhenDetached:S,avoidCollisions:C,...k}=e,R=za(El,n),[E,N]=v.useState(null),[L,A]=v.useState(null),O=Zt(t,re=>N(re)),[H,Z]=v.useState(null),[I,q]=v.useState(null),F=Ng(n),[$,W]=v.useState(!1),K=v.useRef(!1);v.useEffect(()=>{if(E)return sg(E)},[E]),rg();const D=v.useCallback(re=>{const[ue,...fe]=F().map(Re=>Re.ref.current),[ge]=fe.slice(-1),Ce=document.activeElement;for(const Re of re)if(Re===Ce||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===ue&&L&&(L.scrollTop=0),Re===ge&&L&&(L.scrollTop=L.scrollHeight),Re==null||Re.focus(),document.activeElement!==Ce))return},[F,L]),U=v.useCallback(()=>D([H,E]),[D,H,E]);v.useEffect(()=>{$&&U()},[$,U]);const{onOpenChange:z,triggerPointerDownPosRef:G}=R;v.useEffect(()=>{if(E){let re={x:0,y:0};const ue=ge=>{var Ce,Re;re={x:Math.abs(Math.round(ge.pageX)-(((Ce=G.current)==null?void 0:Ce.x)??0)),y:Math.abs(Math.round(ge.pageY)-(((Re=G.current)==null?void 0:Re.y)??0))}},fe=ge=>{re.x<=10&&re.y<=10?ge.preventDefault():E.contains(ge.target)||z(!1),document.removeEventListener("pointermove",ue),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",fe,{capture:!0})}}},[E,z,G]),v.useEffect(()=>{const re=()=>z(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[z]);const[M,B]=Zj(re=>{const ue=F().filter(Ce=>!Ce.disabled),fe=ue.find(Ce=>Ce.ref.current===document.activeElement),ge=Qj(ue,re,fe);ge&&setTimeout(()=>ge.ref.current.focus())}),X=v.useCallback((re,ue,fe)=>{const ge=!K.current&&!fe;(R.value!==void 0&&R.value===ue||ge)&&(Z(re),ge&&(K.current=!0))},[R.value]),j=v.useCallback(()=>E==null?void 0:E.focus(),[E]),ie=v.useCallback((re,ue,fe)=>{const ge=!K.current&&!fe;(R.value!==void 0&&R.value===ue||ge)&&q(re)},[R.value]),J=r==="popper"?qy:Oj,ee=J===qy?{side:c,sideOffset:h,align:d,alignOffset:g,arrowPadding:p,collisionBoundary:b,collisionPadding:y,sticky:w,hideWhenDetached:S,avoidCollisions:C}:{};return f.jsx(Aj,{scope:n,content:E,viewport:L,onViewportChange:A,itemRefCallback:X,selectedItem:H,onItemLeave:j,itemTextRefCallback:ie,focusSelectedItem:U,selectedItemText:I,position:r,isPositioned:$,searchRef:M,children:f.jsx(Rh,{as:DU,allowPinchZoom:!0,children:f.jsx(Eh,{asChild:!0,trapped:R.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:He(i,re=>{var ue;(ue=R.trigger)==null||ue.focus({preventScroll:!0}),re.preventDefault()}),children:f.jsx(uu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:f.jsx(J,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:re=>re.preventDefault(),...k,...ee,onPlaced:()=>W(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:He(k.onKeyDown,re=>{const ue=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!ue&&re.key.length===1&&B(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let ge=F().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(re.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const Ce=re.target,Re=ge.indexOf(Ce);ge=ge.slice(Re+1)}setTimeout(()=>D(ge)),re.preventDefault()}})})})})})})});Dj.displayName=AU;var OU="SelectItemAlignedPosition",Oj=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=za(El,n),l=Pa(El,n),[c,h]=v.useState(null),[d,g]=v.useState(null),p=Zt(t,O=>g(O)),b=Ng(n),y=v.useRef(!1),w=v.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:k,focusSelectedItem:R}=l,E=v.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&d&&S&&C&&k){const O=o.trigger.getBoundingClientRect(),H=d.getBoundingClientRect(),Z=o.valueNode.getBoundingClientRect(),I=k.getBoundingClientRect();if(o.dir!=="rtl"){const Ce=I.left-H.left,Re=Z.left-Ce,je=O.left-Re,Qe=O.width+je,yt=Math.max(Qe,H.width),Tt=window.innerWidth-is,me=xE(Re,[is,Math.max(is,Tt-yt)]);c.style.minWidth=Qe+"px",c.style.left=me+"px"}else{const Ce=H.right-I.right,Re=window.innerWidth-Z.right-Ce,je=window.innerWidth-O.right-Re,Qe=O.width+je,yt=Math.max(Qe,H.width),Tt=window.innerWidth-is,me=xE(Re,[is,Math.max(is,Tt-yt)]);c.style.minWidth=Qe+"px",c.style.right=me+"px"}const q=b(),F=window.innerHeight-is*2,$=S.scrollHeight,W=window.getComputedStyle(d),K=parseInt(W.borderTopWidth,10),D=parseInt(W.paddingTop,10),U=parseInt(W.borderBottomWidth,10),z=parseInt(W.paddingBottom,10),G=K+D+$+z+U,M=Math.min(C.offsetHeight*5,G),B=window.getComputedStyle(S),X=parseInt(B.paddingTop,10),j=parseInt(B.paddingBottom,10),ie=O.top+O.height/2-is,J=F-ie,ee=C.offsetHeight/2,re=C.offsetTop+ee,ue=K+D+re,fe=G-ue;if(ue<=ie){const Ce=q.length>0&&C===q[q.length-1].ref.current;c.style.bottom="0px";const Re=d.clientHeight-S.offsetTop-S.offsetHeight,je=Math.max(J,ee+(Ce?j:0)+Re+U),Qe=ue+je;c.style.height=Qe+"px"}else{const Ce=q.length>0&&C===q[0].ref.current;c.style.top="0px";const je=Math.max(ie,K+S.offsetTop+(Ce?X:0)+ee)+fe;c.style.height=je+"px",S.scrollTop=ue-ie+S.offsetTop}c.style.margin=`${is}px 0`,c.style.minHeight=M+"px",c.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[b,o.trigger,o.valueNode,c,d,S,C,k,o.dir,r]);Pr(()=>E(),[E]);const[N,L]=v.useState();Pr(()=>{d&&L(window.getComputedStyle(d).zIndex)},[d]);const A=v.useCallback(O=>{O&&w.current===!0&&(E(),R==null||R(),w.current=!1)},[E,R]);return f.jsx(zU,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:A,children:f.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:f.jsx(Dt.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Oj.displayName=OU;var LU="SelectPopperPosition",qy=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=is,...o}=e,l=Mg(n);return f.jsx(vg,{...l,...o,ref:t,align:r,collisionPadding:i,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)"}})});qy.displayName=LU;var[zU,aw]=bu(El,{}),Ky="SelectViewport",Lj=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Pa(Ky,n),l=aw(Ky,n),c=Zt(t,o.onViewportChange),h=v.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(Tg.Slot,{scope:n,children:f.jsx(Dt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:He(i.onScroll,d=>{const g=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:b}=l;if(b!=null&&b.current&&p){const y=Math.abs(h.current-g.scrollTop);if(y>0){const w=window.innerHeight-is*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),N=R-E;p.style.height=E+"px",p.style.bottom==="0px"&&(g.scrollTop=N>0?N:0,p.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})});Lj.displayName=Ky;var zj="SelectGroup",[PU,IU]=bu(zj),Pj=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=So();return f.jsx(PU,{scope:n,id:i,children:f.jsx(Dt.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Pj.displayName=zj;var Ij="SelectLabel",Bj=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=IU(Ij,n);return f.jsx(Dt.div,{id:i.id,...r,ref:t})});Bj.displayName=Ij;var Rp="SelectItem",[BU,Fj]=bu(Rp),Hj=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,c=za(Rp,n),h=Pa(Rp,n),d=c.value===r,[g,p]=v.useState(o??""),[b,y]=v.useState(!1),w=Zt(t,R=>{var E;return(E=h.itemRefCallback)==null?void 0:E.call(h,R,r,i)}),S=So(),C=v.useRef("touch"),k=()=>{i||(c.onValueChange(r),c.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(BU,{scope:n,value:r,disabled:i,textId:S,isSelected:d,onItemTextChange:v.useCallback(R=>{p(E=>E||((R==null?void 0:R.textContent)??"").trim())},[]),children:f.jsx(Tg.ItemSlot,{scope:n,value:r,disabled:i,textValue:g,children:f.jsx(Dt.div,{role:"option","aria-labelledby":S,"data-highlighted":b?"":void 0,"aria-selected":d&&b,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:He(l.onFocus,()=>y(!0)),onBlur:He(l.onBlur,()=>y(!1)),onClick:He(l.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:He(l.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:He(l.onPointerDown,R=>{C.current=R.pointerType}),onPointerMove:He(l.onPointerMove,R=>{var E;C.current=R.pointerType,i?(E=h.onItemLeave)==null||E.call(h):C.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:He(l.onPointerLeave,R=>{var E;R.currentTarget===document.activeElement&&((E=h.onItemLeave)==null||E.call(h))}),onKeyDown:He(l.onKeyDown,R=>{var N;((N=h.searchRef)==null?void 0:N.current)!==""&&R.key===" "||(kU.includes(R.key)&&k(),R.key===" "&&R.preventDefault())})})})})});Hj.displayName=Rp;var Dd="SelectItemText",$j=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=za(Dd,n),c=Pa(Dd,n),h=Fj(Dd,n),d=NU(Dd,n),[g,p]=v.useState(null),b=Zt(t,k=>p(k),h.onItemTextChange,k=>{var R;return(R=c.itemTextRefCallback)==null?void 0:R.call(c,k,h.value,h.disabled)}),y=g==null?void 0:g.textContent,w=v.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 Pr(()=>(S(w),()=>C(w)),[S,C,w]),f.jsxs(f.Fragment,{children:[f.jsx(Dt.span,{id:h.textId,...o,ref:b}),h.isSelected&&l.valueNode&&!l.valueNodeHasChildren?os.createPortal(o.children,l.valueNode):null]})});$j.displayName=Dd;var Uj="SelectItemIndicator",Vj=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Fj(Uj,n).isSelected?f.jsx(Dt.span,{"aria-hidden":!0,...r,ref:t}):null});Vj.displayName=Uj;var Gy="SelectScrollUpButton",Wj=v.forwardRef((e,t)=>{const n=Pa(Gy,e.__scopeSelect),r=aw(Gy,e.__scopeSelect),[i,o]=v.useState(!1),l=Zt(t,r.onScrollButtonChange);return Pr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=h.scrollTop>0;o(d)};const h=n.viewport;return c(),h.addEventListener("scroll",c),()=>h.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?f.jsx(Kj,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:h}=n;c&&h&&(c.scrollTop=c.scrollTop-h.offsetHeight)}}):null});Wj.displayName=Gy;var Yy="SelectScrollDownButton",qj=v.forwardRef((e,t)=>{const n=Pa(Yy,e.__scopeSelect),r=aw(Yy,e.__scopeSelect),[i,o]=v.useState(!1),l=Zt(t,r.onScrollButtonChange);return Pr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=h.scrollHeight-h.clientHeight,g=Math.ceil(h.scrollTop)<d;o(g)};const h=n.viewport;return c(),h.addEventListener("scroll",c),()=>h.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?f.jsx(Kj,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:h}=n;c&&h&&(c.scrollTop=c.scrollTop+h.offsetHeight)}}):null});qj.displayName=Yy;var Kj=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Pa("SelectScrollButton",n),l=v.useRef(null),c=Ng(n),h=v.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return v.useEffect(()=>()=>h(),[h]),Pr(()=>{var g;const d=c().find(p=>p.ref.current===document.activeElement);(g=d==null?void 0:d.ref.current)==null||g.scrollIntoView({block:"nearest"})},[c]),f.jsx(Dt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:He(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:He(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:He(i.onPointerLeave,()=>{h()})})}),FU="SelectSeparator",Gj=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(Dt.div,{"aria-hidden":!0,...r,ref:t})});Gj.displayName=FU;var Xy="SelectArrow",HU=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Mg(n),o=za(Xy,n),l=Pa(Xy,n);return o.open&&l.position==="popper"?f.jsx(bg,{...i,...r,ref:t}):null});HU.displayName=Xy;var $U="SelectBubbleInput",Yj=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=v.useRef(null),o=Zt(r,i),l=SU(t);return v.useEffect(()=>{const c=i.current;if(!c)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(c,t),c.dispatchEvent(p)}},[l,t]),f.jsx(Dt.select,{...n,style:{...CM,...n.style},ref:o,defaultValue:t})});Yj.displayName=$U;function Xj(e){return e===""||e===void 0}function Zj(e){const t=cs(e),n=v.useRef(""),r=v.useRef(0),i=v.useCallback(l=>{const c=n.current+l;t(c),function h(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>h(""),1e3))}(c)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Qj(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=UU(e,Math.max(o,0));i.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return h!==n?h:void 0}function UU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var VU=Cj,Jj=Ej,WU=Tj,qU=Nj,KU=Mj,eA=jj,GU=Lj,YU=Pj,tA=Bj,lw=Hj,nA=$j,rA=Vj,iA=Wj,sA=qj,oA=Gj;const Yn=VU,C_=YU,ar=WU,$n=v.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(Jj,{ref:r,className:pe("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(qU,{asChild:!0,children:f.jsx(ag,{className:"h-4 w-4 shrink-0 opacity-50"})})]}));$n.displayName=Jj.displayName;const aA=v.forwardRef(({className:e,...t},n)=>f.jsx(iA,{ref:n,className:pe("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(p8,{className:"h-4 w-4"})}));aA.displayName=iA.displayName;const lA=v.forwardRef(({className:e,...t},n)=>f.jsx(sA,{ref:n,className:pe("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(ag,{className:"h-4 w-4"})}));lA.displayName=sA.displayName;const Un=v.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>f.jsx(KU,{children:f.jsxs(eA,{ref:i,className:pe("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(aA,{}),f.jsx(GU,{className:pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(lA,{})]})}));Un.displayName=eA.displayName;const XU=v.forwardRef(({className:e,...t},n)=>f.jsx(tA,{ref:n,className:pe("px-2 py-1.5 text-sm font-semibold",e),...t}));XU.displayName=tA.displayName;const St=v.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(lw,{ref:r,className:pe("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(rA,{children:f.jsx(qi,{className:"h-4 w-4"})})}),f.jsx(nA,{children:t})]}));St.displayName=lw.displayName;const Xm=v.forwardRef(({className:e,children:t,thumbnail:n,thumbnailAlt:r="",...i},o)=>f.jsxs(lw,{ref:o,className:pe("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),...i,children:[f.jsx("div",{className:"min-w-0 flex-1 truncate",children:f.jsx(nA,{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(rA,{children:f.jsx(qi,{className:"h-4 w-4"})})})]})]}));Xm.displayName="SelectItemWithThumbnail";const ZU=v.forwardRef(({className:e,...t},n)=>f.jsx(oA,{ref:n,className:pe("-mx-1 my-1 h-px bg-border",e),...t}));ZU.displayName=oA.displayName;var k_="rovingFocusGroup.onEntryFocus",QU={bubbles:!1,cancelable:!0},Ph="RovingFocusGroup",[Zy,cA,JU]=sw(Ph),[eV,uA]=jo(Ph,[JU]),[tV,nV]=eV(Ph),dA=v.forwardRef((e,t)=>f.jsx(Zy.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Zy.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(rV,{...e,ref:t})})}));dA.displayName=Ph;var rV=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:g=!1,...p}=e,b=v.useRef(null),y=Zt(t,b),w=ow(o),[S,C]=Yc({prop:l,defaultProp:c??null,onChange:h,caller:Ph}),[k,R]=v.useState(!1),E=cs(d),N=cA(n),L=v.useRef(!1),[A,O]=v.useState(0);return v.useEffect(()=>{const H=b.current;if(H)return H.addEventListener(k_,E),()=>H.removeEventListener(k_,E)},[E]),f.jsx(tV,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:S,onItemFocus:v.useCallback(H=>C(H),[C]),onItemShiftTab:v.useCallback(()=>R(!0),[]),onFocusableItemAdd:v.useCallback(()=>O(H=>H+1),[]),onFocusableItemRemove:v.useCallback(()=>O(H=>H-1),[]),children:f.jsx(Dt.div,{tabIndex:k||A===0?-1:0,"data-orientation":r,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:He(e.onMouseDown,()=>{L.current=!0}),onFocus:He(e.onFocus,H=>{const Z=!L.current;if(H.target===H.currentTarget&&Z&&!k){const I=new CustomEvent(k_,QU);if(H.currentTarget.dispatchEvent(I),!I.defaultPrevented){const q=N().filter(D=>D.focusable),F=q.find(D=>D.active),$=q.find(D=>D.id===S),K=[F,$,...q].filter(Boolean).map(D=>D.ref.current);mA(K,g)}}L.current=!1}),onBlur:He(e.onBlur,()=>R(!1))})})}),hA="RovingFocusGroupItem",fA=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...c}=e,h=So(),d=o||h,g=nV(hA,n),p=g.currentTabStopId===d,b=cA(n),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:S}=g;return v.useEffect(()=>{if(r)return y(),()=>w()},[r,y,w]),f.jsx(Zy.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:f.jsx(Dt.span,{tabIndex:p?0:-1,"data-orientation":g.orientation,...c,ref:t,onMouseDown:He(e.onMouseDown,C=>{r?g.onItemFocus(d):C.preventDefault()}),onFocus:He(e.onFocus,()=>g.onItemFocus(d)),onKeyDown:He(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){g.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=oV(C,g.orientation,g.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let E=b().filter(N=>N.focusable).map(N=>N.ref.current);if(k==="last")E.reverse();else if(k==="prev"||k==="next"){k==="prev"&&E.reverse();const N=E.indexOf(C.currentTarget);E=g.loop?aV(E,N+1):E.slice(N+1)}setTimeout(()=>mA(E))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:S!=null}):l})})});fA.displayName=hA;var iV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sV(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function oV(e,t,n){const r=sV(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return iV[r]}function mA(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function aV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var lV=dA,cV=fA,Qy=["Enter"," "],uV=["ArrowDown","PageUp","Home"],pA=["ArrowUp","PageDown","End"],dV=[...uV,...pA],hV={ltr:[...Qy,"ArrowRight"],rtl:[...Qy,"ArrowLeft"]},fV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ih="Menu",[dh,mV,pV]=sw(Ih),[Ll,gA]=jo(Ih,[pV,Oa,uA]),jg=Oa(),vA=uA(),[gV,zl]=Ll(Ih),[vV,Bh]=Ll(Ih),bA=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:l=!0}=e,c=jg(t),[h,d]=v.useState(null),g=v.useRef(!1),p=cs(o),b=ow(i);return v.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(gg,{...c,children:f.jsx(gV,{scope:t,open:n,onOpenChange:p,content:h,onContentChange:d,children:f.jsx(vV,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:g,dir:b,modal:l,children:r})})})};bA.displayName=Ih;var bV="MenuAnchor",cw=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=jg(n);return f.jsx(jh,{...i,...r,ref:t})});cw.displayName=bV;var uw="MenuPortal",[_V,_A]=Ll(uw,{forceMount:void 0}),yA=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=zl(uw,t);return f.jsx(_V,{scope:t,forceMount:n,children:f.jsx(Zi,{present:n||o.open,children:f.jsx(du,{asChild:!0,container:i,children:r})})})};yA.displayName=uw;var Ki="MenuContent",[yV,dw]=Ll(Ki),xA=v.forwardRef((e,t)=>{const n=_A(Ki,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=zl(Ki,e.__scopeMenu),l=Bh(Ki,e.__scopeMenu);return f.jsx(dh.Provider,{scope:e.__scopeMenu,children:f.jsx(Zi,{present:r||o.open,children:f.jsx(dh.Slot,{scope:e.__scopeMenu,children:l.modal?f.jsx(xV,{...i,ref:t}):f.jsx(wV,{...i,ref:t})})})})}),xV=v.forwardRef((e,t)=>{const n=zl(Ki,e.__scopeMenu),r=v.useRef(null),i=Zt(t,r);return v.useEffect(()=>{const o=r.current;if(o)return sg(o)},[]),f.jsx(hw,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:He(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),wV=v.forwardRef((e,t)=>{const n=zl(Ki,e.__scopeMenu);return f.jsx(hw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),SV=wl("MenuContent.ScrollLock"),hw=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:h,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:p,onInteractOutside:b,onDismiss:y,disableOutsideScroll:w,...S}=e,C=zl(Ki,n),k=Bh(Ki,n),R=jg(n),E=vA(n),N=mV(n),[L,A]=v.useState(null),O=v.useRef(null),H=Zt(t,O,C.onContentChange),Z=v.useRef(0),I=v.useRef(""),q=v.useRef(0),F=v.useRef(null),$=v.useRef("right"),W=v.useRef(0),K=w?Rh:v.Fragment,D=w?{as:SV,allowPinchZoom:!0}:void 0,U=G=>{var re,ue;const M=I.current+G,B=N().filter(fe=>!fe.disabled),X=document.activeElement,j=(re=B.find(fe=>fe.ref.current===X))==null?void 0:re.textValue,ie=B.map(fe=>fe.textValue),J=LV(ie,M,j),ee=(ue=B.find(fe=>fe.textValue===J))==null?void 0:ue.ref.current;(function fe(ge){I.current=ge,window.clearTimeout(Z.current),ge!==""&&(Z.current=window.setTimeout(()=>fe(""),1e3))})(M),ee&&setTimeout(()=>ee.focus())};v.useEffect(()=>()=>window.clearTimeout(Z.current),[]),rg();const z=v.useCallback(G=>{var B,X;return $.current===((B=F.current)==null?void 0:B.side)&&PV(G,(X=F.current)==null?void 0:X.area)},[]);return f.jsx(yV,{scope:n,searchRef:I,onItemEnter:v.useCallback(G=>{z(G)&&G.preventDefault()},[z]),onItemLeave:v.useCallback(G=>{var M;z(G)||((M=O.current)==null||M.focus(),A(null))},[z]),onTriggerLeave:v.useCallback(G=>{z(G)&&G.preventDefault()},[z]),pointerGraceTimerRef:q,onPointerGraceIntentChange:v.useCallback(G=>{F.current=G},[]),children:f.jsx(K,{...D,children:f.jsx(Eh,{asChild:!0,trapped:i,onMountAutoFocus:He(o,G=>{var M;G.preventDefault(),(M=O.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:f.jsx(uu,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:p,onInteractOutside:b,onDismiss:y,children:f.jsx(lV,{asChild:!0,...E,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:L,onCurrentTabStopIdChange:A,onEntryFocus:He(h,G=>{k.isUsingKeyboardRef.current||G.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(vg,{role:"menu","aria-orientation":"vertical","data-state":PA(C.open),"data-radix-menu-content":"",dir:k.dir,...R,...S,ref:H,style:{outline:"none",...S.style},onKeyDown:He(S.onKeyDown,G=>{const B=G.target.closest("[data-radix-menu-content]")===G.currentTarget,X=G.ctrlKey||G.altKey||G.metaKey,j=G.key.length===1;B&&(G.key==="Tab"&&G.preventDefault(),!X&&j&&U(G.key));const ie=O.current;if(G.target!==ie||!dV.includes(G.key))return;G.preventDefault();const ee=N().filter(re=>!re.disabled).map(re=>re.ref.current);pA.includes(G.key)&&ee.reverse(),DV(ee)}),onBlur:He(e.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(Z.current),I.current="")}),onPointerMove:He(e.onPointerMove,hh(G=>{const M=G.target,B=W.current!==G.clientX;if(G.currentTarget.contains(M)&&B){const X=G.clientX>W.current?"right":"left";$.current=X,W.current=G.clientX}}))})})})})})})});xA.displayName=Ki;var CV="MenuGroup",fw=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Dt.div,{role:"group",...r,ref:t})});fw.displayName=CV;var kV="MenuLabel",wA=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Dt.div,{...r,ref:t})});wA.displayName=kV;var Tp="MenuItem",wE="menu.itemSelect",Ag=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=v.useRef(null),l=Bh(Tp,e.__scopeMenu),c=dw(Tp,e.__scopeMenu),h=Zt(t,o),d=v.useRef(!1),g=()=>{const p=o.current;if(!n&&p){const b=new CustomEvent(wE,{bubbles:!0,cancelable:!0});p.addEventListener(wE,y=>r==null?void 0:r(y),{once:!0}),m5(p,b),b.defaultPrevented?d.current=!1:l.onClose()}};return f.jsx(SA,{...i,ref:h,disabled:n,onClick:He(e.onClick,g),onPointerDown:p=>{var b;(b=e.onPointerDown)==null||b.call(e,p),d.current=!0},onPointerUp:He(e.onPointerUp,p=>{var b;d.current||(b=p.currentTarget)==null||b.click()}),onKeyDown:He(e.onKeyDown,p=>{const b=c.searchRef.current!=="";n||b&&p.key===" "||Qy.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Ag.displayName=Tp;var SA=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,l=dw(Tp,n),c=vA(n),h=v.useRef(null),d=Zt(t,h),[g,p]=v.useState(!1),[b,y]=v.useState("");return v.useEffect(()=>{const w=h.current;w&&y((w.textContent??"").trim())},[o.children]),f.jsx(dh.ItemSlot,{scope:n,disabled:r,textValue:i??b,children:f.jsx(cV,{asChild:!0,...c,focusable:!r,children:f.jsx(Dt.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:He(e.onPointerMove,hh(w=>{r?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:He(e.onPointerLeave,hh(w=>l.onItemLeave(w))),onFocus:He(e.onFocus,()=>p(!0)),onBlur:He(e.onBlur,()=>p(!1))})})})}),EV="MenuCheckboxItem",CA=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return f.jsx(NA,{scope:e.__scopeMenu,checked:n,children:f.jsx(Ag,{role:"menuitemcheckbox","aria-checked":Np(n)?"mixed":n,...i,ref:t,"data-state":pw(n),onSelect:He(i.onSelect,()=>r==null?void 0:r(Np(n)?!0:!n),{checkForDefaultPrevented:!1})})})});CA.displayName=EV;var kA="MenuRadioGroup",[RV,TV]=Ll(kA,{value:void 0,onValueChange:()=>{}}),EA=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=cs(r);return f.jsx(RV,{scope:e.__scopeMenu,value:n,onValueChange:o,children:f.jsx(fw,{...i,ref:t})})});EA.displayName=kA;var RA="MenuRadioItem",TA=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=TV(RA,e.__scopeMenu),o=n===i.value;return f.jsx(NA,{scope:e.__scopeMenu,checked:o,children:f.jsx(Ag,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":pw(o),onSelect:He(r.onSelect,()=>{var l;return(l=i.onValueChange)==null?void 0:l.call(i,n)},{checkForDefaultPrevented:!1})})})});TA.displayName=RA;var mw="MenuItemIndicator",[NA,NV]=Ll(mw,{checked:!1}),MA=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=NV(mw,n);return f.jsx(Zi,{present:r||Np(o.checked)||o.checked===!0,children:f.jsx(Dt.span,{...i,ref:t,"data-state":pw(o.checked)})})});MA.displayName=mw;var MV="MenuSeparator",jA=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Dt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});jA.displayName=MV;var jV="MenuArrow",AA=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=jg(n);return f.jsx(bg,{...i,...r,ref:t})});AA.displayName=jV;var AV="MenuSub",[Toe,DA]=Ll(AV),Od="MenuSubTrigger",OA=v.forwardRef((e,t)=>{const n=zl(Od,e.__scopeMenu),r=Bh(Od,e.__scopeMenu),i=DA(Od,e.__scopeMenu),o=dw(Od,e.__scopeMenu),l=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:h}=o,d={__scopeMenu:e.__scopeMenu},g=v.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return v.useEffect(()=>g,[g]),v.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),h(null)}},[c,h]),f.jsx(cw,{asChild:!0,...d,children:f.jsx(SA,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":PA(n.open),...e,ref:S0(t,i.onTriggerChange),onClick:p=>{var b;(b=e.onClick)==null||b.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:He(e.onPointerMove,hh(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:He(e.onPointerLeave,hh(p=>{var y,w;g();const b=(y=n.content)==null?void 0:y.getBoundingClientRect();if(b){const S=(w=n.content)==null?void 0:w.dataset.side,C=S==="right",k=C?-5:5,R=b[C?"left":"right"],E=b[C?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+k,y:p.clientY},{x:R,y:b.top},{x:E,y:b.top},{x:E,y:b.bottom},{x:R,y:b.bottom}],side:S}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:He(e.onKeyDown,p=>{var y;const b=o.searchRef.current!=="";e.disabled||b&&p.key===" "||hV[r.dir].includes(p.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),p.preventDefault())})})})});OA.displayName=Od;var LA="MenuSubContent",zA=v.forwardRef((e,t)=>{const n=_A(Ki,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=zl(Ki,e.__scopeMenu),l=Bh(Ki,e.__scopeMenu),c=DA(LA,e.__scopeMenu),h=v.useRef(null),d=Zt(t,h);return f.jsx(dh.Provider,{scope:e.__scopeMenu,children:f.jsx(Zi,{present:r||o.open,children:f.jsx(dh.Slot,{scope:e.__scopeMenu,children:f.jsx(hw,{id:c.contentId,"aria-labelledby":c.triggerId,...i,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:He(e.onFocusOutside,g=>{g.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:He(e.onEscapeKeyDown,g=>{l.onClose(),g.preventDefault()}),onKeyDown:He(e.onKeyDown,g=>{var y;const p=g.currentTarget.contains(g.target),b=fV[l.dir].includes(g.key);p&&b&&(o.onOpenChange(!1),(y=c.trigger)==null||y.focus(),g.preventDefault())})})})})})});zA.displayName=LA;function PA(e){return e?"open":"closed"}function Np(e){return e==="indeterminate"}function pw(e){return Np(e)?"indeterminate":e?"checked":"unchecked"}function DV(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function OV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function LV(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=OV(e,Math.max(o,0));i.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return h!==n?h:void 0}function zV(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const c=t[o],h=t[l],d=c.x,g=c.y,p=h.x,b=h.y;g>r!=b>r&&n<(p-d)*(r-g)/(b-g)+d&&(i=!i)}return i}function PV(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return zV(n,t)}function hh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var IV=bA,BV=cw,FV=yA,HV=xA,$V=fw,UV=wA,VV=Ag,WV=CA,qV=EA,KV=TA,GV=MA,YV=jA,XV=AA,ZV=OA,QV=zA,gw="ContextMenu",[JV,Noe]=jo(gw,[gA]),Wr=gA(),[eW,IA]=JV(gw),BA=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[l,c]=v.useState(!1),h=Wr(t),d=cs(r),g=v.useCallback(p=>{c(p),d(p)},[d]);return f.jsx(eW,{scope:t,open:l,onOpenChange:g,modal:o,children:f.jsx(IV,{...h,dir:i,open:l,onOpenChange:g,modal:o,children:n})})};BA.displayName=gw;var FA="ContextMenuTrigger",HA=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=e,o=IA(FA,n),l=Wr(n),c=v.useRef({x:0,y:0}),h=v.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=v.useRef(0),g=v.useCallback(()=>window.clearTimeout(d.current),[]),p=b=>{c.current={x:b.clientX,y:b.clientY},o.onOpenChange(!0)};return v.useEffect(()=>g,[g]),v.useEffect(()=>void(r&&g()),[r,g]),f.jsxs(f.Fragment,{children:[f.jsx(BV,{...l,virtualRef:h}),f.jsx(Dt.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:He(e.onContextMenu,b=>{g(),p(b),b.preventDefault()}),onPointerDown:r?e.onPointerDown:He(e.onPointerDown,wm(b=>{g(),d.current=window.setTimeout(()=>p(b),700)})),onPointerMove:r?e.onPointerMove:He(e.onPointerMove,wm(g)),onPointerCancel:r?e.onPointerCancel:He(e.onPointerCancel,wm(g)),onPointerUp:r?e.onPointerUp:He(e.onPointerUp,wm(g))})]})});HA.displayName=FA;var tW="ContextMenuPortal",$A=e=>{const{__scopeContextMenu:t,...n}=e,r=Wr(t);return f.jsx(FV,{...r,...n})};$A.displayName=tW;var UA="ContextMenuContent",VA=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=IA(UA,n),o=Wr(n),l=v.useRef(!1);return f.jsx(HV,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var h;(h=e.onCloseAutoFocus)==null||h.call(e,c),!c.defaultPrevented&&l.current&&c.preventDefault(),l.current=!1},onInteractOutside:c=>{var h;(h=e.onInteractOutside)==null||h.call(e,c),!c.defaultPrevented&&!i.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)"}})});VA.displayName=UA;var nW="ContextMenuGroup",rW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx($V,{...i,...r,ref:t})});rW.displayName=nW;var iW="ContextMenuLabel",sW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(UV,{...i,...r,ref:t})});sW.displayName=iW;var oW="ContextMenuItem",WA=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(VV,{...i,...r,ref:t})});WA.displayName=oW;var aW="ContextMenuCheckboxItem",lW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(WV,{...i,...r,ref:t})});lW.displayName=aW;var cW="ContextMenuRadioGroup",uW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(qV,{...i,...r,ref:t})});uW.displayName=cW;var dW="ContextMenuRadioItem",hW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(KV,{...i,...r,ref:t})});hW.displayName=dW;var fW="ContextMenuItemIndicator",mW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(GV,{...i,...r,ref:t})});mW.displayName=fW;var pW="ContextMenuSeparator",gW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(YV,{...i,...r,ref:t})});gW.displayName=pW;var vW="ContextMenuArrow",bW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(XV,{...i,...r,ref:t})});bW.displayName=vW;var _W="ContextMenuSubTrigger",yW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(ZV,{...i,...r,ref:t})});yW.displayName=_W;var xW="ContextMenuSubContent",wW=v.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Wr(n);return f.jsx(QV,{...i,...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)"}})});wW.displayName=xW;function wm(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var SW=BA,CW=HA,kW=$A,qA=VA,KA=WA;const GA=SW,YA=CW,vw=v.forwardRef(({className:e,...t},n)=>f.jsx(kW,{children:f.jsx(qA,{ref:n,className:pe("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})}));vw.displayName=qA.displayName;const Mp=v.forwardRef(({className:e,...t},n)=>f.jsx(KA,{ref:n,className:pe("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}));Mp.displayName=KA.displayName;function bw({open:e,onOpenChange:t,position:n,children:r}){return f.jsxs(JM,{open:e,onOpenChange:t,children:[f.jsx(wH,{style:n?{position:"fixed",left:n.x,top:n.y,width:0,height:0}:void 0}),f.jsx(ej,{children:f.jsx(K0,{side:"bottom",align:"start",sideOffset:4,onOpenAutoFocus:i=>i.preventDefault(),className:pe("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 fh({onSelect:e,className:t,children:n}){return f.jsx("button",{type:"button",className:pe("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 EW({onRemove:e,children:t,mobileMenuPosition:n,onMobileMenuClose:r,skipContextMenu:i}){return f.jsxs(f.Fragment,{children:[i?t:f.jsxs(GA,{children:[f.jsx(YA,{asChild:!0,children:t}),f.jsx(vw,{children:f.jsxs(Mp,{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(ih,{className:"h-4 w-4"}),f.jsx("span",{className:"text-xs font-medium",children:"Hide"})]})})]}),f.jsx(bw,{open:!!n,onOpenChange:o=>{o||r==null||r()},position:n??null,children:f.jsxs(fh,{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(ih,{className:"h-4 w-4"}),f.jsx("span",{children:"Hide"})]})})]})}function RW({onRename:e,onDelete:t,children:n,mobileMenuPosition:r,onMobileMenuClose:i,skipContextMenu:o}){return f.jsxs(f.Fragment,{children:[o?n:f.jsxs(GA,{children:[f.jsx(YA,{asChild:!0,children:n}),f.jsxs(vw,{children:[f.jsxs(Mp,{onSelect:l=>{l.stopPropagation(),e()},children:[f.jsx(Xc,{className:"h-4 w-4"}),f.jsx("span",{className:"text-xs font-medium",children:"Rename Feature"})]}),f.jsxs(Mp,{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(ih,{className:"h-4 w-4"}),f.jsx("span",{className:"text-xs font-medium",children:"Delete Feature"})]})]})]}),f.jsxs(bw,{open:!!r,onOpenChange:l=>{l||i==null||i()},position:r??null,children:[f.jsxs(fh,{onSelect:()=>{i==null||i(),e()},children:[f.jsx(Xc,{className:"h-4 w-4"}),f.jsx("span",{children:"Rename Feature"})]}),f.jsxs(fh,{onSelect:()=>{i==null||i(),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(ih,{className:"h-4 w-4"}),f.jsx("span",{children:"Delete Feature"})]})]})]})}function Fh(e){const[t,n]=v.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return v.useEffect(()=>{const r=window.matchMedia(e),i=()=>n(r.matches);return i(),r.addEventListener?(r.addEventListener("change",i),()=>r.removeEventListener("change",i)):(r.addListener(i),()=>r.removeListener(i))},[e]),t}function XA({iconDataUrl:e,alt:t,className:n,fallback:r=null}){return e?f.jsx("img",{src:e,alt:t,className:pe("shrink-0 object-contain",n)}):f.jsx(f.Fragment,{children:r})}const SE=e=>{let t;const n=new Set,r=(d,g)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const b=t;t=g??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,b))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>h,subscribe:d=>(n.add(d),()=>n.delete(d))},h=t=e(r,i,c);return c},TW=e=>e?SE(e):SE,NW=e=>e;function MW(e,t=NW){const n=we.useSyncExternalStore(e.subscribe,we.useCallback(()=>t(e.getState()),[e,t]),we.useCallback(()=>t(e.getInitialState()),[e,t]));return we.useDebugValue(n),n}const jW=e=>{const t=TW(e),n=r=>MW(t,r);return Object.assign(n,t),n},Us=e=>jW;function AW(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const l=h=>h===null?null:JSON.parse(h,void 0),c=(o=n.getItem(i))!=null?o:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Jy=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Jy(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Jy(r)(n)}}}},DW=(e,t)=>(n,r,i)=>{let o={storage:AW(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},l=!1,c=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,i);const p=()=>{const C=o.partialize({...r()});return g.setItem(o.name,{state:C,version:o.version})},b=i.setState;i.setState=(C,k)=>(b(C,k),p());const y=e((...C)=>(n(...C),p()),r,i);i.getInitialState=()=>y;let w;const S=()=>{var C,k;if(!g)return;const R=++c;l=!1,h.forEach(N=>{var L;return N((L=r())!=null?L:y)});const E=((k=o.onRehydrateStorage)==null?void 0:k.call(o,(C=r())!=null?C:y))||void 0;return Jy(g.getItem.bind(g))(o.name).then(N=>{if(N)if(typeof N.version=="number"&&N.version!==o.version){if(o.migrate){const L=o.migrate(N.state,N.version);return L instanceof Promise?L.then(A=>[!0,A]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,N.state];return[!1,void 0]}).then(N=>{var L;if(R!==c)return;const[A,O]=N;if(w=o.merge(O,(L=r())!=null?L:y),n(w,!0),A)return p()}).then(()=>{R===c&&(E==null||E(r(),void 0),w=r(),l=!0,d.forEach(N=>N(w)))}).catch(N=>{R===c&&(E==null||E(void 0,N))})};return i.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},Vs=DW,yn=Us()(Vs(e=>({themePreference:"system",themeId:"default",customAppearance:"system",backgroundImage:null,backgroundOpacity:1,backgroundBlur:0,showProjectIconsInSidebar:!0,availableThemes:[],themeCssText:"",setThemePreference:t=>e({themePreference:t}),setThemeId:t=>e({themeId: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}),setAvailableThemes:t=>e({availableThemes:t}),setThemeCssText:t=>e({themeCssText:t})}),{name:"theme-settings"})),ZA=8;function ex(e,t){return!e.has(t)}function E_(e,t,n){const r=e.map(l=>l.featureId),i=r.indexOf(t),o=r.indexOf(n);return i===-1||o===-1||i===o?null:Rg(r,i,o)}function OW(e){return{activeFeatures:e.filter(t=>t.stage!=="done"),completedFeatures:e.filter(t=>t.stage==="done")}}function LW(e,t){return t?e:e.slice(0,ZA)}function zW(e,t){return e.map(n=>`feature:${n.featureId}`).filter(n=>!t.has(n))}function CE({feature:e,groupKey:t,collapsedSections:n,onToggleSection:r,renderChatRow:i,onNewLocalChat:o,onRenameFeature:l,onDeleteFeature:c,onSetFeatureBrowserState:h,onSetFeatureStage:d,kanbanStatusesEnabled:g=!0,showFeatureOverviewInSidebar:p=!1,activeOverviewFeatureId:b=null,onOpenFeatureOverview:y,showAllChats:w,onToggleShowAllChats:S,draggedFeatureId:C,draggedChatId:k,hoveredDropTarget:R,isTouchDevice:E,onFeatureDragStart:N,onFeatureDragEnd:L,onFeatureDrop:A,onChatDrop:O,onTouchDragMove:H,onTouchDragEnd:Z,onChatDragStart:I,onChatDragEnd:q}){const F=`feature:${e.featureId}`,$=ex(n,F),W=k!==null,K=LW(e.chats,w),D=Math.max(0,e.chats.length-ZA),U=D>0,z=b===e.featureId,[G,M]=v.useState(null);function B(){r(F),h==null||h(e.featureId,$?"CLOSED":"OPEN")}const X=v.useRef(null),{touchRef:j,isDragging:ie,isArmed:J,dragPosition:ee}=Y0({enabled:E,visualElementRef:X,onTap:B,onContextMenu:ge=>M(ge),onDragStart:()=>N(e.featureId),onDragMove:({x:ge,y:Ce,elementBelow:Re})=>H(ge,Ce,Re),onDragEnd:({x:ge,y:Ce,elementBelow:Re})=>Z(ge,Ce,Re)}),re=C===e.featureId||ie,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}W&&ge.preventDefault()},onDrop:E?void 0:ge=>{if(ge.preventDefault(),C&&C!==e.featureId){A(C,e.featureId);return}k&&O(k,e.featureId)},className:pe("rounded-lg border border-border/60 bg-muted/10 transition-all duration-150 select-none",W&&!E&&"border-dashed hover:border-primary/60 hover:bg-primary/5",R===e.featureId&&"border-primary/60 bg-primary/5",J&&"scale-[1.03] shadow-md ring-2 ring-primary/50 bg-card",re&&!J&&"opacity-20 scale-[0.98]"),children:[f.jsxs("div",{ref:E?j: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:B,className:"flex shrink-0 items-center",children:f.jsx(Vr,{className:pe("size-3 transition-transform",$&&"rotate-90")})}),f.jsx(h_,{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:B,draggable:!0,"data-feature-drag-handle":e.featureId,onDragStart:()=>N(e.featureId),onDragEnd:L,className:"flex min-w-0 flex-1 basis-0 items-center gap-2 text-left",children:[f.jsx(Vr,{className:pe("size-3 transition-transform",$&&"rotate-90")}),f.jsx(h_,{className:"size-3.5 text-muted-foreground"}),f.jsxs(As,{children:[f.jsx(Ds,{asChild:!0,children:f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.title})}),f.jsx(as,{side:"right",sideOffset:4,children:e.title})]})]}),g?f.jsxs(Yn,{value:e.stage,onValueChange:ge=>d==null?void 0:d(e.featureId,ge),children:[f.jsx($n,{"data-no-touch-drag":!0,className:pe("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",yE[e.stage]),children:f.jsx(ar,{children:oE[e.stage]})}),f.jsx(Un,{children:dH.map(ge=>f.jsx(St,{value:ge,className:pe("text-[11px] font-medium",ge===e.stage&&yE[ge]),children:oE[ge]},ge))})]}):null,o?f.jsx(Xe,{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(J5,{className:"size-3.5"})}):null]}),$?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:pe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors",z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"),children:[f.jsx(U8,{className:"size-3.5 shrink-0"}),f.jsx("span",{className:"truncate",children:"overview.md"})]}):null,K.map(ge=>i(ge,{draggable:!0,onDragStart:Ce=>I(Ce.chatId),onDragEnd:q,isTouchDevice:E,onTouchDragMove:H,onTouchDragEnd:Z})),U?f.jsx("div",{className:"pt-1",children:f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:S,children:w?"Show less":`Show ${D} more`})}):null]}):null]}),fe=f.jsxs(rj,{position:ee,children:[f.jsx(h_,{className:"size-3.5 shrink-0 text-primary"}),f.jsx("span",{className:"text-sm font-medium truncate",children:e.title})]});return c?f.jsxs(f.Fragment,{children:[f.jsx(RW,{onRename:()=>l==null?void 0:l(e.featureId),onDelete:()=>c(e.featureId),mobileMenuPosition:G,onMobileMenuClose:()=>M(null),skipContextMenu:E,children:ue}),fe]}):f.jsxs(f.Fragment,{children:[ue,fe]})}function PW({group:e,collapsedSections:t,onToggleSection:n,renderChatRow:r,onNewLocalChat:i,onCreateFeature:o,onRenameFeature:l,onDeleteFeature:c,onSetProjectBrowserState:h,onSetProjectGeneralChatsBrowserState:d,onSetFeatureBrowserState:g,onSetFeatureStage:p,onSetChatFeature:b,onReorderFeatures:y,onRemoveProject:w,isConnected:S,startingLocalPath:C,folderGroupsEnabled:k=!0,showFeatureOverviewInSidebar:R=!1,kanbanStatusesEnabled:E=!0,activeOverviewFeatureId:N=null,onOpenFeatureOverview:L}){const A=yn(Ae=>Ae.showProjectIconsInSidebar),{groupKey:O,localPath:H,features:Z,generalChats:I}=e,{activeFeatures:q,completedFeatures:F}=v.useMemo(()=>OW(Z),[Z]),$=`project:${O}`,W=`general:${O}`,K=ex(t,$),D=Z.length===0||ex(t,W),[U,z]=v.useState(null),[G,M]=v.useState(null),[B,X]=v.useState(null),[j,ie]=v.useState(!1),[J,ee]=v.useState(!1),[re,ue]=v.useState({}),[fe,ge]=v.useState(null),Ce=Fh("(pointer: coarse)"),Re=k&&!j?I.slice(0,10):I,je=k&&I.length>10,{attributes:Qe,listeners:yt,setNodeRef:Tt,setActivatorNodeRef:me,transform:Ue,transition:Oe,isDragging:mt}=yU({id:O}),pt=v.useRef(null),ot={transform:ch.Translate.toString(Ue),transition:Oe};function dn(){n($),h==null||h(O,K?"CLOSED":"OPEN")}function Nt(){n(W),d==null||d(O,D?"CLOSED":"OPEN")}function In(Ae){ue($e=>({...$e,[Ae]:!$e[Ae]}))}function de(Ae){Ae.stopPropagation();for(const $e of zW(Z,t))n($e);for(const $e of Z)g==null||g($e.featureId,"CLOSED")}function oe(Ae){if(!Ae)return null;const $e=Ae.closest("[data-feature-drop-target]");return $e?{type:"feature",featureId:$e.getAttribute("data-feature-drop-target")}:Ae.closest(`[data-general-chats-drop-target="${O}"]`)?{type:"general"}:null}function xe(Ae,$e,lt){const Fe=pt.current;if(Fe){const qt=Fe.getBoundingClientRect(),bn=60;$e<qt.top+bn?Fe.scrollBy(0,-6):$e>qt.bottom-bn&&Fe.scrollBy(0,6)}const hn=oe(lt);X((hn==null?void 0:hn.type)==="feature"?hn.featureId:null)}function ke(Ae,$e,lt){const Fe=oe(lt);if(G){if((Fe==null?void 0:Fe.type)==="feature"&&Fe.featureId!==G&&y){const hn=E_(Z,G,Fe.featureId);hn&&y(O,hn)}M(null)}else U&&b&&((Fe==null?void 0:Fe.type)==="feature"?b(U,Fe.featureId):(Fe==null?void 0:Fe.type)==="general"&&b(U,null),z(null));X(null)}const Ke=v.useRef(null),{touchRef:ct}=Y0({enabled:Ce&&!!w,onTap:dn,onContextMenu:Ae=>ge(Ae)}),Je=f.jsxs("div",{ref:Ae=>{me(Ae),Ke.current=Ae,Ce&&w&&ct(Ae)},className:pe("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",mt&&"cursor-grabbing"),onClick:Ce?void 0:dn,...yt,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(Vr,{className:pe("translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-transform duration-200",K&&"rotate-90")})}),A?f.jsx(XA,{iconDataUrl:e.iconDataUrl,alt:`${e.title||wp(H)} icon`,className:"size-5",fallback:f.jsx("span",{className:"size-5 shrink-0","aria-hidden":"true"})}):null,f.jsxs(As,{children:[f.jsx(Ds,{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||wp(H)})}),f.jsx(as,{side:"right",sideOffset:4,children:H})]})]}),f.jsxs("div",{className:"absolute right-2 flex items-center gap-1",children:[o?f.jsxs(As,{children:[f.jsx(Ds,{asChild:!0,children:f.jsx(Xe,{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:Ae=>{Ae.stopPropagation(),o(O)},children:f.jsx(K5,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),f.jsx(as,{side:"right",sideOffset:4,children:"New feature"})]}):null,Z.length>0?f.jsxs(As,{children:[f.jsx(Ds,{asChild:!0,children:f.jsx(Xe,{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:de,children:f.jsx(v8,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),f.jsx(as,{side:"right",sideOffset:4,children:"Close all feature folders"})]}):null,i?f.jsxs(As,{children:[f.jsx(Ds,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",className:pe("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:Ae=>{Ae.stopPropagation(),i(O)},children:C===H?f.jsx(wr,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):f.jsx(J5,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),f.jsx(as,{side:"right",sideOffset:4,children:S?"New general chat":`Start ${Tn} to connect`})]}):null]})]});return f.jsxs("div",{ref:Ae=>{Tt(Ae),pt.current=(Ae==null?void 0:Ae.closest("[data-sidebar-scroll]"))??null},style:ot,className:pe("group/section",mt&&"opacity-50 shadow-lg z-50 relative"),...Qe,children:[w?f.jsx(EW,{onRemove:()=>w(O),mobileMenuPosition:fe,onMobileMenuClose:()=>ge(null),skipContextMenu:Ce,children:Je}):Je,K?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(Ae=>f.jsx(CE,{feature:Ae,groupKey:O,collapsedSections:t,onToggleSection:n,renderChatRow:r,onNewLocalChat:i,onRenameFeature:l,onDeleteFeature:c,onSetFeatureBrowserState:g,onSetFeatureStage:p,kanbanStatusesEnabled:E,showFeatureOverviewInSidebar:R,activeOverviewFeatureId:N,onOpenFeatureOverview:L,showAllChats:!!re[Ae.featureId],onToggleShowAllChats:()=>In(Ae.featureId),draggedFeatureId:G,draggedChatId:U,hoveredDropTarget:B,isTouchDevice:Ce,onFeatureDragStart:$e=>M($e),onFeatureDragEnd:()=>M(null),onFeatureDrop:($e,lt)=>{const Fe=E_(Z,$e,lt);M(null),Fe&&(y==null||y(O,Fe))},onChatDrop:($e,lt)=>{b==null||b($e,lt),z(null)},onTouchDragMove:xe,onTouchDragEnd:ke,onChatDragStart:$e=>z($e),onChatDragEnd:()=>z(null)},Ae.featureId))}):null,k&&F.length>0?f.jsxs("section",{className:"pl-6",children:[f.jsxs("button",{type:"button",onClick:()=>ee(Ae=>!Ae),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(Vr,{className:pe("size-3 transition-transform",J&&"rotate-90")}),f.jsx("span",{children:J?"Hide completed":"Show completed"}),f.jsx("span",{className:"ml-auto",children:F.length})]}),J?f.jsx("div",{className:"space-y-2 pt-1",children:F.map(Ae=>f.jsx(CE,{feature:Ae,groupKey:O,collapsedSections:t,onToggleSection:n,renderChatRow:r,onNewLocalChat:i,onRenameFeature:l,onDeleteFeature:c,onSetFeatureBrowserState:g,onSetFeatureStage:p,kanbanStatusesEnabled:E,showFeatureOverviewInSidebar:R,activeOverviewFeatureId:N,onOpenFeatureOverview:L,showAllChats:!!re[Ae.featureId],onToggleShowAllChats:()=>In(Ae.featureId),draggedFeatureId:G,draggedChatId:U,hoveredDropTarget:B,isTouchDevice:Ce,onFeatureDragStart:$e=>M($e),onFeatureDragEnd:()=>M(null),onFeatureDrop:($e,lt)=>{const Fe=E_(Z,$e,lt);M(null),Fe&&(y==null||y(O,Fe))},onChatDrop:($e,lt)=>{b==null||b($e,lt),z(null)},onTouchDragMove:xe,onTouchDragEnd:ke,onChatDragStart:$e=>z($e),onChatDragEnd:()=>z(null)},Ae.featureId))}):null]}):null,I.length>0?f.jsxs("section",{"data-general-chats-drop-target":O,onDragOver:U&&!Ce?Ae=>Ae.preventDefault():void 0,onDrop:U&&!Ce&&b?Ae=>{Ae.preventDefault(),b(U,null),z(null)}:void 0,children:[k?f.jsxs("button",{type:"button",onClick:Nt,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(Vr,{className:pe("size-3 transition-transform",D&&"rotate-90")}),f.jsx("span",{children:"General Chats"}),f.jsx("span",{className:"ml-auto",children:I.length})]}):null,!k||D?f.jsxs("div",{className:pe("space-y-[2px]",k?"pl-7":"pl-4"),children:[Re.map(Ae=>r(Ae,{draggable:!0,onDragStart:$e=>z($e.chatId),onDragEnd:()=>z(null),isTouchDevice:Ce,onTouchDragMove:xe,onTouchDragEnd:ke})),je?f.jsx("div",{className:"pt-1",children:f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:()=>ie(Ae=>!Ae),children:j?"Show less":`Show ${I.length-10} more`})}):null]}):null]}):null]}):null]})}function IW({projectGroups:e,collapsedSections:t,onToggleSection:n,onSetProjectBrowserState:r,onSetProjectGeneralChatsBrowserState:i,renderChatRow:o,onNewLocalChat:l,onCreateFeature:c,onRenameFeature:h,onDeleteFeature:d,onSetFeatureBrowserState:g,onSetFeatureStage:p,onSetChatFeature:b,onReorderFeatures:y,onRemoveProject:w,onReorderGroups:S,isConnected:C,startingLocalPath:k,folderGroupsEnabled:R=!0,showFeatureOverviewInSidebar:E=!1,kanbanStatusesEnabled:N=!0,activeOverviewFeatureId:L=null,onOpenFeatureOverview:A}){const O=ZH(y_(iw,{activationConstraint:{distance:8}}),y_(pj,{activationConstraint:{delay:250,tolerance:5}}),y_(nw)),H=v.useMemo(()=>e.map(F=>F.groupKey),[e]),Z=v.useRef(null);function I(F){const $=F.active.id;t.has($)?Z.current=null:(Z.current=$,n($))}function q(F){const{active:$,over:W}=F;if(W&&$.id!==W.id&&S){const K=H.indexOf($.id),D=H.indexOf(W.id);K!==-1&&D!==-1&&S(Rg(H,K,D))}if(Z.current){const K=Z.current;Z.current=null,requestAnimationFrame(()=>n(K))}}return f.jsx(eU,{sensors:O,collisionDetection:n$,onDragStart:I,onDragEnd:q,children:f.jsx(fU,{items:H,strategy:dU,children:e.map(F=>f.jsx(PW,{group:F,collapsedSections:t,onToggleSection:n,onSetProjectBrowserState:r,onSetProjectGeneralChatsBrowserState:i,renderChatRow:o,onNewLocalChat:l,onCreateFeature:c,onRenameFeature:h,onDeleteFeature:d,onSetFeatureBrowserState:g,onSetFeatureStage:p,onSetChatFeature:b,onReorderFeatures:y,onRemoveProject:w,onReorderGroups:S,isConnected:C,startingLocalPath:k,folderGroupsEnabled:R,showFeatureOverviewInSidebar:E,kanbanStatusesEnabled:N,activeOverviewFeatureId:L,onOpenFeatureOverview:A},F.groupKey))})})}const QA=`${xg}provider-usage-collapsed`,JA=`${xg}provider-usage-mode`,BW=wa.map(e=>e.id),FW=["claude","codex"],tx=Object.fromEntries(wa.map(e=>[e.id,e.label]));function kE(e){return e===null?"bg-muted":e>=90?"bg-red-500":e>=75?"bg-amber-500":"bg-emerald-500"}function R_(e){return e===null?"N/A":`${e.toFixed(1)}%`}function EE(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,i=Math.ceil(r/6e4);return i<60?`Resets in ${i} min`:`Resets at ${new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`}function HW(){try{return localStorage.getItem(QA)==="true"}catch{return!1}}function $W(){try{return localStorage.getItem(JA)==="weekly"?"weekly":"session"}catch{return"session"}}function UW(e){try{localStorage.setItem(QA,String(e))}catch{}}function VW(e){try{localStorage.setItem(JA,e)}catch{}}function RE(e){const{entry:t,mode:n,isPending:r,onRefreshProviderUsage:i,onOpenProviderLogin:o}=e,l=xp[t.provider],c=e.labelOverride??tx[t.provider],h=t.availability==="unavailable",d=t.availability==="login_required",g=t.availability==="stale",p=t.provider==="cursor",b=e.percentOverride!==void 0?e.percentOverride:n==="weekly"?t.weeklyLimitUsedPercent??null:t.sessionLimitUsedPercent,y=b,w=p?null:n==="weekly"?EE(t.weeklyRateLimitResetAt??null,t.weeklyRateLimitResetLabel??null):EE(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"):b!==null&&S.push(`${R_(b)} 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(As,{children:[f.jsx(Ds,{asChild:!0,children:f.jsxs("div",{className:pe("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:c}),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:pe("h-full rounded-full transition-all",kE(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:R_(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(),i==null||i("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(dp,{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:pe("h-full rounded-full transition-all",kE(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:R_(R.percent)})]})]},E))})]})}),f.jsx(as,{side:"right",className:"max-w-48",children:S.map((R,E)=>f.jsx("div",{className:"text-xs",children:R},E))})]})}function WW({providerUsage:e,visibleProviders:t=BW,onRefreshProviderUsage:n,onOpenProviderLogin:r}){const[i,o]=v.useState(HW),[l,c]=v.useState($W),[h,d]=v.useState(null),g=()=>{o(b=>{const y=!b;return UW(y),y})},p=async()=>{d("all");try{await(n==null?void 0:n()),Pc("Usage checked successfully.")}catch{Pc("Failed to check usage.")}finally{d(b=>b==="all"?null:b)}};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:[i?f.jsx(Vr,{className:"h-3 w-3 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors"}):f.jsx(ag,{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"})]}),!i&&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(dp,{className:pe("h-3 w-3",h==="all"&&"animate-spin")})}),f.jsx("button",{type:"button",onClick:()=>{c(b=>{const y=b==="session"?"weekly":"session";return VW(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"})]})]}),!i&&(l==="weekly"?FW:t).flatMap(b=>{const y=(e==null?void 0:e[b])??{provider:b,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)),Pc(`${tx[C]??"Provider"} usage checked successfully.`)}catch{Pc(`Failed to check ${tx[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 b==="cursor"&&l==="session"?[f.jsx(RE,{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(RE,{entry:y,mode:l,isPending:h===b||h==="all",onRefreshProviderUsage:w,onOpenProviderLogin:S},b)]})]})}function qW(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function KW(e){return e==="claude"||e==="codex"||e==="gemini"||e==="cursor"?e:"last_used"}function pl(e){var o,l;const t=(o=e==null?void 0:e.modelOptions)==null?void 0:o.reasoningEffort,n=rE(t)?t:rE(e==null?void 0:e.effort)?e.effort:FM.reasoningEffort,r=(e==null?void 0:e.model)??cn("claude").defaultModel,i=uH(r,(l=e==null?void 0:e.modelOptions)==null?void 0:l.contextWindow);return{model:r,modelOptions:{reasoningEffort:r!=="opus"&&n==="max"?"high":n,...i?{contextWindow:i}:{}},planMode:!!(e!=null&&e.planMode)}}function gl(e){var r,i;const t=Wi("codex"),n=(r=e==null?void 0:e.modelOptions)==null?void 0:r.reasoningEffort;return{model:qW((e==null?void 0:e.model)??cn("codex").defaultModel),modelOptions:{reasoningEffort:iE(n)?n:iE(e==null?void 0:e.effort)?e.effort:t.reasoningEffort,fastMode:typeof((i=e==null?void 0:e.modelOptions)==null?void 0:i.fastMode)=="boolean"?e.modelOptions.fastMode:t.fastMode},planMode:!!(e!=null&&e.planMode)}}function Bc(e){var n;const t=Wi("gemini");return{model:(e==null?void 0:e.model)??cn("gemini").defaultModel,modelOptions:{thinkingMode:sH((n=e==null?void 0:e.modelOptions)==null?void 0:n.thinkingMode)?e.modelOptions.thinkingMode:t.thinkingMode},planMode:!!(e!=null&&e.planMode)}}function vl(e){return e==null||e.modelOptions,{model:iH((e==null?void 0:e.model)??cn("cursor").defaultModel),modelOptions:{...Wi("cursor")},planMode:!!(e!=null&&e.planMode)}}function GW(){return{claude:{model:cn("claude").defaultModel,modelOptions:{...Wi("claude")},planMode:!1},codex:{model:cn("codex").defaultModel,modelOptions:{...Wi("codex")},planMode:!1},gemini:{model:cn("gemini").defaultModel,modelOptions:{...Wi("gemini")},planMode:!1},cursor:{model:cn("cursor").defaultModel,modelOptions:{...Wi("cursor")},planMode:!1}}}function YW(e){return{claude:pl(e==null?void 0:e.claude),codex:gl(e==null?void 0:e.codex),gemini:Bc(e==null?void 0:e.gemini),cursor:vl(e==null?void 0:e.cursor)}}function TE(e,t){if(t===void 0){console.info(`[chat-preferences] ${e}`);return}console.info(`[chat-preferences] ${e}`,t)}function nx(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 XW(e,t,n,r){if((e==null?void 0:e.provider)==="claude"){const i=pl(e);return{provider:"claude",model:i.model,modelOptions:i.modelOptions,planMode:i.planMode}}if((e==null?void 0:e.provider)==="codex"){const i=gl(e);return{provider:"codex",model:i.model,modelOptions:i.modelOptions,planMode:i.planMode}}if((e==null?void 0:e.provider)==="gemini"){const i=Bc(e);return{provider:"gemini",model:i.model,modelOptions:i.modelOptions,planMode:i.planMode}}if((e==null?void 0:e.provider)==="cursor"){const i=vl(e);return{provider:"cursor",model:i.model,modelOptions:i.modelOptions,planMode:i.planMode}}if(n==="claude"){const i=pl(r==null?void 0:r.claude);return{provider:"claude",model:i.model,modelOptions:i.modelOptions,planMode:i.planMode}}if(n==="codex"){const i=gl(r==null?void 0:r.codex);return{provider:"codex",model:i.model,modelOptions:i.modelOptions,planMode:i.planMode}}if(n==="cursor"){const i=vl(r==null?void 0:r.cursor);return{provider:"cursor",model:i.model,modelOptions:i.modelOptions,planMode:i.planMode}}return nx("claude",t)}function ZW(e){const t=YW(e==null?void 0:e.providerDefaults);return{defaultProvider:KW(e==null?void 0:e.defaultProvider),providerDefaults:t,showProviderIconsInSideTray:(e==null?void 0:e.showProviderIconsInSideTray)===!0,composerState:XW(e==null?void 0:e.composerState,t,e==null?void 0:e.liveProvider,e==null?void 0:e.livePreferences)}}const Bi=Us()(Vs(e=>({defaultProvider:"last_used",providerDefaults:GW(),showProviderIconsInSideTray:!1,composerState:{provider:"claude",model:cn("claude").defaultModel,modelOptions:{...Wi("claude")},planMode:!1},setDefaultProvider:t=>e({defaultProvider:t}),setShowProviderIconsInSideTray:t=>e({showProviderIconsInSideTray:t}),setProviderDefaultModel:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?pl({...r.providerDefaults.claude,model:n}):t==="gemini"?Bc({...r.providerDefaults.gemini,model:n}):t==="cursor"?vl({...r.providerDefaults.cursor,model:n}):gl({...r.providerDefaults.codex,model:n})}})),setProviderDefaultModelOptions:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?pl({...r.providerDefaults.claude,modelOptions:{...r.providerDefaults.claude.modelOptions,...n}}):t==="gemini"?Bc({...r.providerDefaults.gemini,modelOptions:{...r.providerDefaults.gemini.modelOptions,...n}}):t==="cursor"?vl({...r.providerDefaults.cursor,modelOptions:{...r.providerDefaults.cursor.modelOptions,...n}}):gl({...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:pl({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="gemini"?{composerState:{provider:"gemini",model:t,modelOptions:Bc({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="cursor"?{composerState:{provider:"cursor",model:t,modelOptions:vl({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:t,modelOptions:gl({...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:pl({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="gemini"?{composerState:{provider:"gemini",model:n.composerState.model,modelOptions:Bc({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="cursor"?{composerState:{provider:"cursor",model:n.composerState.model,modelOptions:vl({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:n.composerState.model,modelOptions:gl({...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:nx(t,n.providerDefaults)})),initializeComposerForNewChat:()=>e(t=>{if(t.defaultProvider==="last_used")return TE("initializeComposerForNewChat:last_used",{defaultProvider:t.defaultProvider,composerState:t.composerState,providerDefaults:t.providerDefaults}),{composerState:{...t.composerState}};const n=nx(t.defaultProvider,t.providerDefaults);return TE("initializeComposerForNewChat:explicit_default",{defaultProvider:t.defaultProvider,composerState:n,providerDefaults:t.providerDefaults}),{composerState:n}})}),{name:"chat-preferences",version:5,migrate:e=>ZW(e)})),NE=Us()(Vs(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"})),jp=315,QW=240,JW=520;function eq(e){return typeof e=="object"&&e!==null}function Dg(e){return Number.isFinite(e)?Math.min(JW,Math.max(QW,Math.round(e))):jp}function tq(e){return eq(e)?{widthPx:Dg(typeof e.widthPx=="number"?e.widthPx:jp)}:{widthPx:jp}}const ME=Us()(Vs(e=>({widthPx:jp,setWidth:t=>e({widthPx:Dg(t)})}),{name:"left-sidebar-layout",version:1,migrate:tq}));function eD(e,t){return e&&!t}function nq(e,t,n){if(eD(e,t))return{width:`${Dg(n)}px`}}function rq({data:e,completedChatIds:t,activeChatId:n,activeOverviewFeatureId:r,connectionStatus:i,ready:o,open:l,collapsed:c,isDesktopViewport:h,showMobileOpenButton:d,desktopWidth:g,onOpen:p,onClose:b,onToggle:y,onExpand:w,toggleShortcut:S,onResizeDesktopWidth:C,onCreateChat:k,onCreateFeature:R,onRenameFeature:E,onDeleteFeature:N,onSetProjectBrowserState:L,onSetProjectGeneralChatsBrowserState:A,onSetFeatureBrowserState:O,onSetFeatureStage:H,onSetChatFeature:Z,onReorderFeatures:I,folderGroupsEnabled:q,showFeatureOverviewInSidebar:F,kanbanStatusesEnabled:$,onOpenFeatureOverview:W,onDeleteChat:K,onRemoveProject:D,onRefreshProviderUsage:U,onOpenProviderLogin:z,providerSettings:G,startingLocalPath:M,updateSnapshot:B,onInstallUpdate:X}){const j=oi(),ie=Aa(),J=v.useRef(null),ee=v.useRef(null),re=v.useRef(0),ue=v.useRef(null),fe=v.useRef(null),ge=v.useRef({}),Ce=v.useRef({}),Re=v.useRef({}),[je,Qe]=v.useState(new Set),[yt,Tt]=v.useState(!1),[me,Ue]=v.useState(null),[Oe,mt]=v.useState(()=>Date.now()),pt=NE(Te=>Te.order),ot=NE(Te=>Te.setOrder),dn=v.useMemo(()=>W0((G==null?void 0:G.settings)??lr).map(Te=>Te.id),[G==null?void 0:G.settings]),Nt=v.useMemo(()=>{if(pt.length===0)return e.projectGroups;const Te=new Map(e.projectGroups.map(ut=>[ut.groupKey,ut])),Le=pt.filter(ut=>Te.has(ut)).map(ut=>Te.get(ut)),Ot=new Set(pt);for(const ut of e.projectGroups)Ot.has(ut.groupKey)||Le.push(ut);return Le},[e.projectGroups,pt]),In=v.useCallback(()=>{ie({pathname:"/",search:"?newProject=1"}),b()},[ie,b]),de=v.useMemo(()=>q?Nt:Nt.map(Te=>({...Te,features:[],generalChats:jE(Te)})),[q,Nt]),oe=v.useCallback(Te=>ot(Te),[ot]),xe=v.useMemo(()=>de.reduce((Te,Le)=>Te+jE(Le).length,0),[de]),ke=v.useCallback(Te=>{Qe(Le=>{const Ot=new Set(Le);return Ot.has(Te)?Ot.delete(Te):Ot.add(Te),Ot})},[]);v.useEffect(()=>{const Te=ge.current,Le=Ce.current,Ot=Re.current;Qe(rn=>{const Gt=new Set([...rn].filter($t=>!$t.startsWith("project:")&&!$t.startsWith("general:")&&!$t.startsWith("feature:")));for(const $t of de)(Te[$t.groupKey]??$t.browserState)==="CLOSED"&&Gt.add(`project:${$t.groupKey}`),(Le[$t.groupKey]??$t.generalChatsBrowserState)==="CLOSED"&&Gt.add(`general:${$t.groupKey}`);for(const $t of de)for(const Ar of $t.features)(Ot[Ar.featureId]??Ar.browserState)==="CLOSED"&&Gt.add(`feature:${Ar.featureId}`);return Gt});const ut={...Te};for(const rn of de)ut[rn.groupKey]===rn.browserState&&delete ut[rn.groupKey];ge.current=ut;const mn={...Le};for(const rn of de)mn[rn.groupKey]===rn.generalChatsBrowserState&&delete mn[rn.groupKey];Ce.current=mn;const Qt={...Ot};for(const rn of de)for(const Gt of rn.features)Qt[Gt.featureId]===Gt.browserState&&delete Qt[Gt.featureId];Re.current=Qt},[de]);const Ke=v.useCallback((Te,Le)=>{ge.current={...ge.current,[Te]:Le},L(Te,Le)},[L]),ct=v.useCallback((Te,Le)=>{Ce.current={...Ce.current,[Te]:Le},A(Te,Le)},[A]),Je=v.useCallback((Te,Le)=>{Re.current={...Re.current,[Te]:Le},O(Te,Le)},[O]),Ae=v.useCallback(Te=>{ie(`/chat/${Te}`),l&&b()},[ie,b,l]),$e=Bi(Te=>Te.showProviderIconsInSideTray),lt=v.useCallback((Te,Le)=>f.jsx(zH,{chat:Te,activeChatId:n,nowMs:Oe,showProviderIcon:$e,isCompleted:t.has(Te.chatId),onSelectChat:Ae,onDeleteChat:()=>K(Te),draggable:Le==null?void 0:Le.draggable,onDragStart:Le==null?void 0:Le.onDragStart,onDragEnd:Le==null?void 0:Le.onDragEnd,isTouchDevice:Le==null?void 0:Le.isTouchDevice,onTouchDragMove:Le==null?void 0:Le.onTouchDragMove,onTouchDragEnd:Le==null?void 0:Le.onTouchDragEnd},Te._id),[n,t,Ae,Oe,K,$e]);v.useEffect(()=>{const Te=window.setInterval(()=>{mt(Date.now())},3e4);return()=>window.clearInterval(Te)},[]),v.useEffect(()=>{if(yt)return document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.body.style.cursor="",document.body.style.userSelect=""}},[yt]),v.useEffect(()=>()=>{fe.current!==null&&window.cancelAnimationFrame(fe.current)},[]),v.useEffect(()=>{!n||!ee.current||requestAnimationFrame(()=>{const Te=ee.current,Le=Te==null?void 0:Te.querySelector(`[data-chat-id="${n}"]`);if(!Le||!Te)return;const Ot=Le.getBoundingClientRect(),ut=Te.getBoundingClientRect();if(Ot.top<ut.top+38){const mn=Ot.top-ut.top+Te.scrollTop;Te.scrollTo({top:mn-38,behavior:"smooth"})}else if(Ot.bottom>ut.bottom){const mn=Ot.top+Ot.height/2-ut.top+Te.scrollTop,Qt=Te.clientHeight/2;Te.scrollTo({top:mn-Qt,behavior:"smooth"})}})},[n,xe]);const Fe=xe>0,hn=j.pathname==="/",qt=j.pathname.startsWith("/settings"),bn=hn||qt,dr=i==="connecting"||!o,er=dr?"Connecting":i==="connected"?"Connected":"Disconnected",Kt=i==="connected"?"bg-emerald-500":"bg-amber-500",Ft=(B==null?void 0:B.updateAvailable)===!0,Pe=B?B.latestVersion===`${B.currentVersion}-dev`:!1,vt=(B==null?void 0:B.status)==="updating"||(B==null?void 0:B.status)==="restart_pending",Et=nq(h,c,me??g),fn=eD(h,c),ze=S&&S.length>0?`Toggle sidebar (${S[0]})`:"Toggle sidebar",rt=t.size>0,xn=v.useCallback(Te=>{var mn;if(!fn)return;Te.preventDefault(),Tt(!0),re.current=((mn=J.current)==null?void 0:mn.getBoundingClientRect().left)??0,Ue(g);const Le=Qt=>{ue.current=Dg(Qt-re.current),fe.current===null&&(fe.current=window.requestAnimationFrame(()=>{fe.current=null,ue.current!==null&&Ue(ue.current)}))};Le(Te.clientX);const Ot=Qt=>{Le(Qt.clientX)},ut=()=>{Tt(!1),fe.current!==null&&(window.cancelAnimationFrame(fe.current),fe.current=null);const Qt=ue.current??g;ue.current=null,Ue(null),C(Qt),window.removeEventListener("pointermove",Ot),window.removeEventListener("pointerup",ut),window.removeEventListener("pointercancel",ut)};window.addEventListener("pointermove",Ot),window.addEventListener("pointerup",ut),window.addEventListener("pointercancel",ut)},[g,C,fn]);return f.jsxs(f.Fragment,{children:[!l&&d&&f.jsx("div",{className:pe("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(Xe,{variant:"ghost",size:"icon",className:"relative",onClick:p,children:[f.jsx(Ty,{className:"h-5 w-5"}),rt&&f.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]})}),c&&bn&&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(Wd,{className:"size-6 text-logo"}),rt&&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(Xe,{variant:"ghost",size:"icon",onClick:w,title:"Expand sidebar",children:f.jsx(Ny,{className:"h-5 w-5"})})]})}),f.jsxs("div",{ref:J,"data-sidebar":"open",className:pe("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",c&&"md:hidden"),style:Et,children:[fn?f.jsx("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical",className:pe("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",yt&&"after:bg-logo/70"),onPointerDown:xn,children:f.jsx("span",{className:pe("h-14 w-px rounded-full bg-border/80 opacity-0 transition-opacity group-hover/sidebar-resize:opacity-100",yt&&"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:pe("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(Xe,{variant:"ghost",size:"icon",className:"relative md:hidden",onClick:()=>y(h),children:[f.jsx(Ty,{className:"h-5 w-5"}),rt&&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:ze,"aria-label":ze,className:"group/sidebar-collapse hidden md:flex relative items-center justify-center h-5 w-5",children:[f.jsx(Wd,{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(Ny,{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(Wd,{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"}):Ft?f.jsxs(Xe,{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:vt,title:B!=null&&B.latestVersion?`Update to ${B.latestVersion}`:"Update Kaizen",children:[vt?f.jsx(wr,{className:"mr-1.5 h-3 w-3 animate-spin"}):null,"UPDATE"]}):null,f.jsx(Xe,{variant:"ghost",size:"icon",onClick:In,className:"size-10 rounded-lg",title:"Add project",children:f.jsx(K5,{className:"size-5"})})]})]}),f.jsx("div",{ref:ee,"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:[!Fe&&dr?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(Le=>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:pe("h-3.5 rounded bg-muted",Le===0?"w-32":Le===1?"w-40":"w-28")})]},Le))})]},Te))}):null,!Fe&&!dr&&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(IW,{projectGroups:de,onReorderGroups:oe,collapsedSections:je,onToggleSection:ke,onSetProjectBrowserState:Ke,onSetProjectGeneralChatsBrowserState:ct,onSetFeatureBrowserState:Je,renderChatRow:lt,onNewLocalChat:k,onCreateFeature:q?R:void 0,onRenameFeature:E,onDeleteFeature:N,onSetFeatureStage:$?H:void 0,onSetChatFeature:Z,onReorderFeatures:I,onRemoveProject:D,isConnected:i==="connected",startingLocalPath:M,folderGroupsEnabled:q,showFeatureOverviewInSidebar:F,kanbanStatusesEnabled:$,activeOverviewFeatureId:r,onOpenFeatureOverview:W})]})}),f.jsxs("div",{className:"border-t border-border p-2",children:[f.jsx(WW,{providerUsage:e.providerUsage,visibleProviders:dn,onRefreshProviderUsage:U,onOpenProviderLogin:z}),f.jsx("button",{type:"button",onClick:()=>{ie("/settings/general"),b()},className:pe("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",qt?"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(A9,{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:er}),dr?f.jsx(wr,{className:"h-2 w-2 animate-spin"}):f.jsx("span",{className:pe("h-2 w-2 rounded-full",Kt)})]})]})})]})]})]})}function jE(e){return[...e.features.flatMap(t=>t.chats),...e.generalChats]}const tD={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 T_(e){return(e??[]).join(", ")}function sl(e){return e.split(",").map(t=>t.trim()).map(t=>t.toLowerCase()).filter(Boolean)}const iq=new Map([["cmd","meta"],["meta","meta"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["option","alt"],["shift","shift"]]);function sq(e,t){const n=oq(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 fl(e,t,n){return((e==null?void 0:e.bindings[t])??Rs[t]).some(i=>sq(i,n))}function _w(e){return{bindings:{submitChatMessage:(e==null?void 0:e.bindings.submitChatMessage)??Rs.submitChatMessage,toggleProjectsSidebar:(e==null?void 0:e.bindings.toggleProjectsSidebar)??Rs.toggleProjectsSidebar,toggleEmbeddedTerminal:(e==null?void 0:e.bindings.toggleEmbeddedTerminal)??Rs.toggleEmbeddedTerminal,toggleRightSidebar:(e==null?void 0:e.bindings.toggleRightSidebar)??Rs.toggleRightSidebar,openInFinder:(e==null?void 0:e.bindings.openInFinder)??Rs.openInFinder,openInEditor:(e==null?void 0:e.bindings.openInEditor)??Rs.openInEditor,addSplitTerminal:(e==null?void 0:e.bindings.addSplitTerminal)??Rs.addSplitTerminal},warning:(e==null?void 0:e.warning)??null,filePathDisplay:(e==null?void 0:e.filePathDisplay)??""}}function oq(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 i=r.toLowerCase(),o=iq.get(i);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=i}return n.key?n:null}function aq(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 nD(){const[e,t]=v.useState(()=>{if(typeof window>"u")return!1;const n=navigator.standalone===!0,r=window.matchMedia("(display-mode: standalone)").matches;return n||r});return v.useEffect(()=>{const n=window.matchMedia("(display-mode: standalone)"),r=i=>{t(i.matches||navigator.standalone===!0)};return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const lq=Us()(Vs((e,t)=>({drafts:{},setDraft:(n,r)=>e(i=>{if(!r){const{[n]:o,...l}=i.drafts;return{drafts:l}}return{drafts:{...i.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:i,...o}=r.drafts;return{drafts:o}}),getDraft:n=>t().drafts[n]??""}),{name:"chat-input-drafts"}));async function cq(e){const t=await new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{if(typeof i.result=="string"){n(i.result);return}r(new Error("Failed to read image attachment"))},i.onerror=()=>r(i.error??new Error("Failed to read image attachment")),i.readAsDataURL(e)});return{type:"image",name:e.name,mimeType:e.type,sizeBytes:e.size,dataUrl:t}}function AE(e,t){if(t===void 0){console.info(`[ChatInput] ${e}`);return}console.info(`[ChatInput] ${e}`,t)}function _o(e,t,n,r,i){return e==="claude"?t.provider==="claude"?{provider:"claude",model:r??t.model,modelOptions:{...t.modelOptions},planMode:i??t.planMode}:{provider:"claude",model:r??n.claude.model,modelOptions:{...n.claude.modelOptions},planMode:i??n.claude.planMode}:e==="gemini"?t.provider==="gemini"?{provider:"gemini",model:r??t.model,modelOptions:{...t.modelOptions},planMode:i??t.planMode}:{provider:"gemini",model:r??n.gemini.model,modelOptions:{...n.gemini.modelOptions},planMode:i??n.gemini.planMode}:e==="cursor"?t.provider==="cursor"?{provider:"cursor",model:r??t.model,modelOptions:{...t.modelOptions},planMode:i??t.planMode}:{provider:"cursor",model:r??n.cursor.model,modelOptions:{...n.cursor.modelOptions},planMode:i??n.cursor.planMode}:t.provider==="codex"?{provider:"codex",model:r??t.model,modelOptions:{...t.modelOptions},planMode:i??t.planMode}:{provider:"codex",model:r??n.codex.model,modelOptions:{...n.codex.modelOptions},planMode:i??n.codex.planMode}}function uq(e,t,n,r){return r&&e.key==="Enter"?!1:fl(t,"submitChatMessage",e)&&!n&&!e.isComposing}function dq(e){if(!e.providerLocked)return{composerPlanMode:e.planMode,lockedComposerState:e.lockedComposerState};const t=e.lockedComposerState??_o(e.selectedProvider,e.composerState,e.providerDefaults);return{composerPlanMode:e.composerState.planMode,lockedComposerState:{...t,planMode:e.planMode}}}const hq=v.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:i,chatId:o,activeProvider:l,activeModel:c,activePlanMode:h,availableProviders:d,keybindings:g},p){const{getDraft:b,setDraft:y,clearDraft:w}=lq(),{composerState:S,providerDefaults:C,setComposerModel:k,setComposerModelOptions:R,setComposerPlanMode:E,resetComposerFromProvider:N}=Bi(),[L,A]=v.useState(()=>o?b(o):""),[O,H]=v.useState([]),[Z,I]=v.useState(null),[q,F]=v.useState(!1),$=v.useRef(null),W=v.useRef(null),K=nD(),D=Fh("(pointer: coarse)"),[U,z]=v.useState(()=>l?_o(l,S,C,c,h):null),G=l!==null,M=!G&&d.length===0,B=G?U??_o(l,S,C,c,h):S,X=G?l:S.provider,j=d.find(me=>me.id===X)??cn(X),ie=(j==null?void 0:j.supportsPlanMode)??!1,J=r||M,ee=v.useCallback(()=>{const me=$.current;me&&(me.style.height="auto",me.style.height=`${me.scrollHeight}px`)},[]),re=v.useCallback(me=>{if($.current=me,!!p){if(typeof p=="function"){p(me);return}p.current=me}},[p]);v.useEffect(()=>{ee()},[L,ee]),v.useEffect(()=>(window.addEventListener("resize",ee),()=>window.removeEventListener("resize",ee)),[ee]),v.useEffect(()=>{var me;(me=$.current)==null||me.focus()},[o]),v.useEffect(()=>()=>{for(const me of O)URL.revokeObjectURL(me.previewUrl)},[O]),v.useEffect(()=>{if(l===null){z(null);return}z(_o(l,S,C,c,h))},[c,h,l,o,S,C]),v.useEffect(()=>{G||d.length!==0&&(d.some(me=>me.id===S.provider)||N(d[0].id))},[d,S.provider,G,N]),v.useEffect(()=>{AE("resolved provider state",{chatId:o??null,activeProvider:l,composerProvider:S.provider,composerModel:S.model,effectiveProvider:B.provider,effectiveModel:B.model,selectedProvider:X,providerLocked:G,lockedComposerProvider:(U==null?void 0:U.provider)??null})},[l,o,S.model,S.provider,U==null?void 0:U.provider,G,B.model,B.provider,X]);function ue(me){if(G){z(Ue=>{const Oe=Ue??_o(X,S,C);return Oe.provider==="claude"?{...Oe,modelOptions:{...Oe.modelOptions,reasoningEffort:me}}:Oe.provider==="gemini"?Oe:{...Oe,modelOptions:{...Oe.modelOptions,reasoningEffort:me}}});return}if(X==="claude"){R({reasoningEffort:me});return}R({reasoningEffort:me})}function fe(me){if(G){z(Ue=>{const Oe=Ue??_o(X,S,C);return Oe.provider!=="gemini"?Oe:{...Oe,modelOptions:{...Oe.modelOptions,thinkingMode:me}}});return}X==="gemini"&&R({thinkingMode:me})}function ge(me){if(G){z(Ue=>{const Oe=Ue??_o(X,S,C);return Oe.provider!=="claude"?Oe:{...Oe,modelOptions:{...Oe.modelOptions,contextWindow:me}}});return}X==="claude"&&R({contextWindow:me})}function Ce(me){const Ue=dq({providerLocked:G,planMode:me,selectedProvider:X,composerState:S,providerDefaults:C,lockedComposerState:U});Ue.lockedComposerState!==U&&z(Ue.lockedComposerState),Ue.composerPlanMode!==S.planMode&&E(Ue.composerPlanMode)}function Re(){Ce(!B.planMode)}async function je(){if(J||!L.trim()&&O.length===0)return;const me=L,Ue=O;let Oe;B.provider==="claude"?Oe={claude:{...B.modelOptions}}:B.provider==="gemini"?Oe={gemini:{...B.modelOptions}}:Oe={codex:{...B.modelOptions}};const mt={provider:X,model:B.model,modelOptions:Oe,planMode:ie?B.planMode:!1};AE("submit settings",{chatId:o??null,activeProvider:l,composerProvider:B.provider,submitOptions:mt}),A(""),I(null),o&&w(o),$.current&&($.current.style.height="auto");try{await t({text:me.trim(),attachments:Ue.length?await Promise.all(Ue.map(pt=>cq(pt.file))):void 0},mt);for(const pt of Ue)URL.revokeObjectURL(pt.previewUrl);H([])}catch(pt){console.error("[ChatInput] Submit failed:",pt),A(me),o&&y(o,me)}}const Qe=v.useCallback(me=>{if(J)return;const Ue=me.filter(Oe=>Oe.type.startsWith("image/"));if(Ue.length===0){I("Only PNG, JPEG, WEBP, and GIF images are supported.");return}H(Oe=>{const mt=[...Oe];let pt=null;for(const ot of Ue){if(!yp.includes(ot.type)){pt=`Unsupported image type: ${ot.type||"unknown"}`;continue}if(ot.size<=0||ot.size>HM){pt=`${ot.name} is empty or larger than 10 MB.`;continue}if(mt.length>=_p){pt=`You can attach up to ${_p} images per message.`;break}mt.push({id:Vd(),file:ot,name:ot.name||"image",mimeType:ot.type,sizeBytes:ot.size,previewUrl:URL.createObjectURL(ot)})}return I(pt),mt})},[J]),yt=v.useCallback(me=>{H(Ue=>{const Oe=Ue.find(mt=>mt.id===me);return Oe&&URL.revokeObjectURL(Oe.previewUrl),Ue.filter(mt=>mt.id!==me)}),I(null)},[]);function Tt(me){if(me.key==="Tab"&&!me.shiftKey){me.preventDefault(),e7($.current,document);return}if(me.key==="Tab"&&me.shiftKey&&ie){me.preventDefault(),Re();return}if(me.key==="Escape"&&i){me.preventDefault(),n==null||n();return}uq(me.nativeEvent,g,i,D)&&(me.preventDefault(),je())}return f.jsxs("div",{className:pe("p-3 pt-0 px-2 md:px-3 md:pb-2 flex flex-col items-center",K&&"px-3"),style:K?{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:pe("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:me=>{r||!me.dataTransfer.types.includes("Files")||(me.preventDefault(),F(!0))},onDragOver:me=>{r||!me.dataTransfer.types.includes("Files")||(me.preventDefault(),me.dataTransfer.dropEffect="copy",F(!0))},onDragLeave:me=>{if(!me.dataTransfer.types.includes("Files"))return;me.preventDefault();const Ue=me.relatedTarget;Ue instanceof Node&&me.currentTarget.contains(Ue)||F(!1)},onDrop:me=>{var Ue;r||!me.dataTransfer.types.includes("Files")||(me.preventDefault(),F(!1),Qe(Array.from(me.dataTransfer.files)),(Ue=$.current)==null||Ue.focus())},children:[f.jsx("input",{ref:W,type:"file",accept:yp.join(","),multiple:!0,className:"hidden",onChange:me=>{Qe(Array.from(me.target.files??[])),me.target.value=""}}),O.length?f.jsx("div",{className:"grid grid-cols-2 gap-2 px-2 pt-2 sm:grid-cols-3",children:O.map(me=>f.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/80 bg-background/80",children:[f.jsx("img",{src:me.previewUrl,alt:me.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:me.name}),f.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[Math.max(1,Math.round(me.sizeBytes/1024))," KB"]})]}),f.jsx(Xe,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>yt(me.id),disabled:J,children:f.jsx(ko,{className:"h-3.5 w-3.5"})})]})]},me.id))}):null,f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsx(Xe,{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:J||i,onClick:()=>{var me;return(me=W.current)==null?void 0:me.click()},children:f.jsx(Q5,{className:"h-4.5 w-4.5"})}),f.jsx(Nh,{ref:re,placeholder:"Build something...",value:L,autoFocus:!0,[M0]:"",rows:1,onChange:me=>{A(me.target.value),o&&y(o,me.target.value),ee()},onPaste:me=>{const Ue=Array.from(me.clipboardData.files);Ue.some(Oe=>Oe.type.startsWith("image/"))&&(me.preventDefault(),Qe(Ue))},onKeyDown:Tt,disabled:J,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(Xe,{type:"button",onPointerDown:me=>{me.preventDefault(),i?n==null||n():!J&&(L.trim()||O.length>0)&&je()},disabled:!i&&(J||!L.trim()&&O.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:i?f.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):f.jsx(e8,{className:"h-5 w-5 md:h-6 md:w-6"})})]})]}),f.jsxs("div",{className:pe("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(Ad,{availableProviders:d,selectedProvider:X,disabled:J,providerLocked:G,model:B.model,modelOptions:B.modelOptions,onProviderChange:me=>{G||N(me)},onModelChange:(me,Ue)=>{if(G){z(Oe=>({...Oe??_o(X,S,C),model:Ue}));return}k(Ue)},onClaudeReasoningEffortChange:me=>ue(me),onClaudeContextWindowChange:me=>ge(me),onCodexReasoningEffortChange:me=>ue(me),onGeminiThinkingModeChange:me=>fe(me),onCodexFastModeChange:me=>{if(G){z(Ue=>{const Oe=Ue??_o(X,S,C);return Oe.provider!=="codex"?Oe:{...Oe,modelOptions:{...Oe.modelOptions,fastMode:me}}});return}R({fastMode:me})},planMode:B.planMode,onPlanModeChange:Ce,includePlanMode:ie,className:"w-full relative z-10"}),M?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]})]}),Z?f.jsx("div",{className:"max-w-[840px] mx-auto mt-2 px-2 text-xs text-destructive relative z-10",children:Z}):null]})}),fq=v.memo(hq);function DE({label:e,isCurrent:t,icon:n,onClick:r,className:i}){return f.jsxs("button",{onClick:r,className:pe("w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left text-sm transition-colors hover:bg-muted",i),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 mq({projectId:e,socket:t}){const[n,r]=v.useState({phase:"loading"}),[i,o]=v.useState(!1),[l,c]=v.useState(""),h=v.useDeferredValue(l),[d,g]=v.useTransition(),p=v.useRef(null),b=v.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]);v.useEffect(()=>{b()},[b]),v.useEffect(()=>{i&&(c(""),b())},[i,b]),v.useEffect(()=>{if(i&&n.phase==="ready"){const R=setTimeout(()=>{var E;return(E=p.current)==null?void 0:E.focus()},50);return()=>clearTimeout(R)}},[i,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 b()}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 b()}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(tj,{open:i,onOpenChange:o,children:[f.jsx(nj,{asChild:!0,children:f.jsxs(Xe,{variant:"ghost",size:"icon",className:pe("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(wr,{className:"h-4.5 w-4.5 flex-shrink-0 animate-spin"}):f.jsx(Q8,{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(G0,{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=>c(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(wr,{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(DE,{label:R,isCurrent:R===n.currentBranch,onClick:()=>y(R)},R)),k&&f.jsx(DE,{label:`Create branch "${h.trim()}"`,icon:f.jsx(R0,{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 yw=v.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:pe("bg-card text-card-foreground",e),...t}));yw.displayName="Card";const rD=v.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:pe("flex flex-col space-y-1.5 p-2",e),...t}));rD.displayName="CardHeader";const pq=v.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:pe("text-2xl font-semibold leading-none tracking-tight",e),...t}));pq.displayName="CardTitle";const gq=v.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:pe("text-sm text-muted-foreground",e),...t}));gq.displayName="CardDescription";const xw=v.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:pe("p-6 pt-0",e),...t}));xw.displayName="CardContent";const vq=v.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:pe("flex items-center p-6 pt-0",e),...t}));vq.displayName="CardFooter";function bq({sidebarCollapsed:e,hasCompletedChats:t=!1,onOpenSidebar:n,onExpandSidebar:r,usage:i,localPath:o,embeddedTerminalVisible:l=!1,onToggleEmbeddedTerminal:c,rightSidebarVisible:h=!1,onToggleRightSidebar:d,onOpenExternal:g,editorLabel:p="Editor",projectId:b,socket:y,finderShortcut:w,editorShortcut:S,terminalShortcut:C,rightSidebarShortcut:k}){const R=N=>N==null?"Unavailable":`${Math.round(N)}%`,E=i!=null&&i.warnings.includes("context_critical")||i!=null&&i.warnings.includes("rate_critical")?"text-amber-300 bg-amber-500/10":i!=null&&i.warnings.includes("context_warning")||i!=null&&i.warnings.includes("rate_warning")?"text-amber-100 bg-amber-500/5":"text-muted-foreground bg-background/70";return f.jsx(rD,{className:pe("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:pe("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(Xe,{variant:"ghost",size:"icon",className:"relative md:hidden",onClick:n,children:[f.jsx(Ty,{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(Wd,{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(Xe,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:r,title:"Expand sidebar",children:f.jsx(Ny,{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:[b?f.jsxs("div",{className:"hidden md:flex items-center gap-1 mr-1",children:[f.jsxs(As,{children:[(i==null?void 0:i.contextUsedPercent)!==null&&(i==null?void 0:i.contextUsedPercent)!==void 0?f.jsx(Ds,{asChild:!0,children:f.jsxs("div",{className:pe("px-2.5 py-1 rounded-lg text-[14px] font-medium",E),children:["Context: ",R(i.contextUsedPercent)]})}):null,f.jsx(as,{side:"bottom",children:(i==null?void 0:i.contextWindowTokens)!==null&&(i==null?void 0:i.contextWindowTokens)!==void 0&&(i==null?void 0:i.threadTokens)!==null&&(i==null?void 0:i.threadTokens)!==void 0?`${Math.round(i.threadTokens).toLocaleString()} of ${Math.round(i.contextWindowTokens).toLocaleString()} tokens`:"Context window unavailable for this chat yet"})]}),((i==null?void 0:i.sessionLimitUsedPercent)??0)>=75?f.jsxs(As,{children:[f.jsx(Ds,{asChild:!0,children:f.jsxs("div",{className:pe("px-2.5 py-1 rounded-lg border text-[11px] font-medium",E),children:["Session: ",R(i==null?void 0:i.sessionLimitUsedPercent)]})}),f.jsx(as,{side:"bottom",children:i!=null&&i.rateLimitResetAt?`Resets ${new Date(i.rateLimitResetAt).toLocaleString()}`:"No reset time available yet"})]}):null]}):null,b?f.jsx(mq,{projectId:b,socket:y}):null,o&&(g||c)&&f.jsxs(f.Fragment,{children:[g?f.jsxs(Md,{children:[f.jsx(jd,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",onClick:()=>g("open_finder"),title:"Open in Finder",className:"border border-border/0",children:f.jsx(q5,{className:"h-4.5 w-4.5"})})}),f.jsx(Ic,{side:"bottom",shortcut:w})]}):null,c?f.jsxs(Md,{children:[f.jsx(jd,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",onClick:c,className:pe("border border-border/0",l&&"text-white"),children:f.jsx(T0,{className:"h-4.5 w-4.5"})})}),f.jsx(Ic,{side:"bottom",shortcut:C})]}):null,g?f.jsxs(Md,{children:[f.jsx(jd,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",onClick:()=>g("open_editor"),title:`Open in ${p}`,className:"border border-border/0",children:f.jsx(Ry,{className:"h-4.5 w-4.5"})})}),f.jsx(Ic,{side:"bottom",shortcut:S})]}):null]}),d?f.jsxs(Md,{children:[f.jsx(jd,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",onClick:d,className:pe("border border-border/0",h&&"text-white"),children:f.jsx(S9,{className:"h-4.5 w-4.5"})})}),f.jsx(Ic,{side:"bottom",shortcut:k})]}):null]})]})})}function OE({onClose:e,className:t}){return f.jsx("div",{className:pe("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(ko,{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 _q(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function yq(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function xq(e){return e/100*window.innerHeight}function wq(e){return e/100*window.innerWidth}function Sq(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 Ld({groupSize:e,panelElement:t,styleProp:n}){let r;const[i,o]=Sq(n);switch(o){case"%":{r=i/100*e;break}case"px":{r=i;break}case"rem":{r=yq(t,i);break}case"em":{r=_q(t,i);break}case"vh":{r=xq(i);break}case"vw":{r=wq(i);break}}return r}function si(e){return parseFloat(e.toFixed(3))}function eu({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,i)=>(r+=t==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function rx(e){const{panels:t}=e,n=eu({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:i,panelConstraints:o}=r;let l=0;if(o.collapsedSize!==void 0){const g=Ld({groupSize:n,panelElement:i,styleProp:o.collapsedSize});l=si(g/n*100)}let c;if(o.defaultSize!==void 0){const g=Ld({groupSize:n,panelElement:i,styleProp:o.defaultSize});c=si(g/n*100)}let h=0;if(o.minSize!==void 0){const g=Ld({groupSize:n,panelElement:i,styleProp:o.minSize});h=si(g/n*100)}let d=100;if(o.maxSize!==void 0){const g=Ld({groupSize:n,panelElement:i,styleProp:o.maxSize});d=si(g/n*100)}return{groupResizeBehavior:o.groupResizeBehavior,collapsedSize:l,collapsible:o.collapsible===!0,defaultSize:c,disabled:o.disabled,minSize:h,maxSize:d,panelId:r.id}})}function un(e,t="Assertion error"){if(!e)throw Error(t)}function ix(e,t){return Array.from(t).sort(e==="horizontal"?Cq:kq)}function Cq(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function kq(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function iD(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function sD(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 Eq({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let i,o=Number.MAX_VALUE;for(const l of t){const{x:c,y:h}=sD(r,l),d=e==="horizontal"?c:h;d<o&&(o=d,i=l)}return un(i,"No rect found"),i}let Sm;function Rq(){return Sm===void 0&&(typeof matchMedia=="function"?Sm=!!matchMedia("(pointer:coarse)").matches:Sm=!1),Sm}function oD(e){const{element:t,orientation:n,panels:r,separators:i}=e,o=ix(n,Array.from(t.children).filter(iD).map(w=>({element:w}))).map(({element:w})=>w),l=[];let c=!1,h=!1,d=-1,g=-1,p=0,b,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(b){const k=b.element.getBoundingClientRect(),R=S.getBoundingClientRect();let E;if(h){const N=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=[N,L];break}case 1:{const A=y[0],O=Eq({orientation:n,rects:[k,R],targetRect:A.element.getBoundingClientRect()});E=[A,O===k?L:N];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 N of E){let L="width"in N?N:N.element.getBoundingClientRect();const A=Rq()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<A){const H=A-L.width;L=new DOMRect(L.x-H/2,L.y,L.width+H,L.height)}if(L.height<A){const H=A-L.height;L=new DOMRect(L.x,L.y-H/2,L.width,L.height+H)}const O=w<=d||w>g;!c&&!O&&l.push({group:e,groupSize:eu({group:e}),panels:[b,C],separator:"width"in N?void 0:N,rect:L}),c=!1}}h=!1,b=C,y=[]}}else if(S.hasAttribute("data-separator")){S.ariaDisabled!==null&&(c=!0);const C=i.find(k=>k.element===S);C?y.push(C):(b=void 0,y=[])}else h=!0}return l}var xa,CN;let aD=(CN=class{constructor(){Vk(this,xa,{})}addListener(t,n){const r=pd(this,xa)[t];return r===void 0?pd(this,xa)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=pd(this,xa)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let i=!1,o=null;const l=Array.from(r);for(let c=0;c<l.length;c++){const h=l[c];try{h.call(null,n)}catch(d){o===null&&(i=!0,o=d)}}if(i)throw o}}removeAllListeners(){Wk(this,xa,{})}removeListener(t,n){const r=pd(this,xa)[t];if(r!==void 0){const i=r.indexOf(n);i>=0&&r.splice(i,1)}}},xa=new WeakMap,CN),Os=new Map;const lD=new aD;function Tq(e){Os=new Map(Os),Os.delete(e)}function LE(e,t){for(const[n]of Os)if(n.id===e)return n}function ka(e,t){for(const[n,r]of Os)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Pl(){return Os}function ww(e,t){return lD.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function To(e,t){const n=Os.get(e);Os=new Map(Os),Os.set(e,t),lD.emit("groupChange",{group:e,prev:n,next:t})}function Nq(e,t,n){let r,i={x:1/0,y:1/0};for(const o of t){const l=sD(n,o.rect);switch(e){case"horizontal":{l.x<=i.x&&(r=o,i=l);break}case"vertical":{l.y<=i.y&&(r=o,i=l);break}}}return r?{distance:i,hitRegion:r}:void 0}function Mq(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function jq(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:IE(e),b:IE(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();un(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:PE(zE(n.a)),b:PE(zE(n.b))};if(i.a===i.b){const o=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let c=o.length;for(;c--;){const h=o[c];if(h===l.a)return 1;if(h===l.b)return-1}}return Math.sign(i.a-i.b)}const Aq=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Dq(e){const t=getComputedStyle(cD(e)??e).display;return t==="flex"||t==="inline-flex"}function Oq(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Dq(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"||Aq.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function zE(e){let t=e.length;for(;t--;){const n=e[t];if(un(n,"Missing node"),Oq(n))return n}return null}function PE(e){return e&&Number(getComputedStyle(e).zIndex)||0}function IE(e){const t=[];for(;e;)t.push(e),e=cD(e);return t}function cD(e){const{parentNode:t}=e;return Mq(t)?t.host:t}function Lq(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 zq({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!iD(n)||n.contains(e)||e.contains(n))return!0;if(jq(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Lq(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Sw(e,t){const n=[];return t.forEach((r,i)=>{if(i.disabled)return;const o=oD(i),l=Nq(i.orientation,o,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&zq({groupElement:i.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function Pq(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 $r(e,t,n=0){return Math.abs(si(e)-si(t))<=n}function Ts(e,t){return $r(e,t)?0:e>t?1:-1}function Fc({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:i=0,collapsible:o,disabled:l,maxSize:c=100,minSize:h=0}=t;if(l&&!e)return n;if(Ts(r,h)<0)if(o){const d=(i+h)/2;Ts(r,d)<0?r=i:r=h}else r=h;return r=Math.min(c,r),r=si(r),r}function mh({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if($r(e,0))return t;const l=o==="imperative-api",c=Object.values(t),h=Object.values(i),d=[...c],[g,p]=r;un(g!=null,"Invalid first pivot index"),un(p!=null,"Invalid second pivot index");let b=0;switch(o){case"keyboard":{{const S=e<0?p:g,C=n[S];un(C,`Panel constraints not found for index ${S}`);const{collapsedSize:k=0,collapsible:R,minSize:E=0}=C;if(R){const N=c[S];if(un(N!=null,`Previous layout not found for panel index ${S}`),$r(N,k)){const L=E-N;Ts(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const S=e<0?g:p,C=n[S];un(C,`No panel constraints found for index ${S}`);const{collapsedSize:k=0,collapsible:R,minSize:E=0}=C;if(R){const N=c[S];if(un(N!=null,`Previous layout not found for panel index ${S}`),$r(N,E)){const L=N-k;Ts(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const S=e<0?p:g,C=n[S];un(C,`Panel constraints not found for index ${S}`);const k=c[S],{collapsible:R,collapsedSize:E,minSize:N}=C;if(R&&Ts(k,N)<0)if(e>0){const L=N-E,A=L/2,O=k+e;Ts(O,N)<0&&(e=Ts(e,A)<=0?0:L)}else{const L=N-E,A=100-L/2,O=k-e;Ts(O,N)<0&&(e=Ts(100+e,A)>0?0:-L)}break}}{const S=e<0?1:-1;let C=e<0?p:g,k=0;for(;;){const E=c[C];un(E!=null,`Previous layout not found for panel index ${C}`);const N=Fc({overrideDisabledPanels:l,panelConstraints:n[C],prevSize:E,size:100})-E;if(k+=N,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(b),k=c[S];un(k!=null,`Previous layout not found for panel index ${S}`);const R=k-C,E=Fc({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:k,size:R});if(!$r(k,E)&&(b+=k-E,d[S]=E,b.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?S--:S++}}if(Pq(h,d))return i;{const S=e<0?p:g,C=c[S];un(C!=null,`Previous layout not found for panel index ${S}`);const k=C+b,R=Fc({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:C,size:k});if(d[S]=R,!$r(R,k)){let E=k-R,N=e<0?p:g;for(;N>=0&&N<n.length;){const L=d[N];un(L!=null,`Previous layout not found for panel index ${N}`);const A=L+E,O=Fc({overrideDisabledPanels:l,panelConstraints:n[N],prevSize:L,size:A});if($r(L,O)||(E-=O-L,d[N]=O),$r(E,0))break;e>0?N--:N++}}}const y=Object.values(d).reduce((S,C)=>C+S,0);if(!$r(y,100,.1))return i;const w=Object.keys(i);return d.reduce((S,C,k)=>(S[w[k]]=C,S),{})}function Rl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||Ts(e[n],t[n])!==0)return!1;return!0}function Tl({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],i=r.reduce((c,h)=>c+h,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(c=>`${c}%`).join(", ")}`);if(!$r(i,100)&&r.length>0)for(let c=0;c<t.length;c++){const h=r[c];un(h!=null,`No layout data found for index ${c}`);const d=100/i*h;r[c]=d}let o=0;for(let c=0;c<t.length;c++){const h=n[c];un(h!=null,`No layout data found for index ${c}`);const d=r[c];un(d!=null,`No layout data found for index ${c}`);const g=Fc({overrideDisabledPanels:!0,panelConstraints:t[c],prevSize:h,size:d});d!=g&&(o+=d-g,r[c]=g)}if(!$r(o,0))for(let c=0;c<t.length;c++){const h=r[c];un(h!=null,`No layout data found for index ${c}`);const d=h+o,g=Fc({overrideDisabledPanels:!0,panelConstraints:t[c],prevSize:h,size:d});if(h!==g&&(o-=g-h,r[c]=g,$r(o,0)))break}const l=Object.keys(e);return r.reduce((c,h,d)=>(c[l[d]]=h,c),{})}function uD({groupId:e,panelId:t}){const n=()=>{const c=Pl();for(const[h,{defaultLayoutDeferred:d,derivedPanelConstraints:g,layout:p,groupSize:b,separatorToPanels:y}]of c)if(h.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:g,group:h,groupSize:b,layout:p,separatorToPanels:y};throw Error(`Group ${e} not found`)},r=()=>{const c=n().derivedPanelConstraints.find(h=>h.panelId===t);if(c!==void 0)return c;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{const c=n().group.panels.find(h=>h.id===t);if(c!==void 0)return c;throw Error(`Layout not found for Panel ${t}`)},o=()=>{const c=n().layout[t];if(c!==void 0)return c;throw Error(`Layout not found for Panel ${t}`)},l=c=>{const h=o();if(c===h)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:g,group:p,groupSize:b,layout:y,separatorToPanels:w}=n(),S=p.panels.findIndex(E=>E.id===t),C=S===p.panels.length-1,k=mh({delta:C?h-c:c-h,initialLayout:y,panelConstraints:g,pivotIndices:C?[S-1,S]:[S,S+1],prevLayout:y,trigger:"imperative-api"}),R=Tl({layout:k,panelConstraints:g});Rl(y,R)||To(p,{defaultLayoutDeferred:d,derivedPanelConstraints:g,groupSize:b,layout:R,separatorToPanels:w})};return{collapse:()=>{const{collapsible:c,collapsedSize:h}=r(),{mutableValues:d}=i(),g=o();c&&g!==h&&(d.expandToSize=g,l(h))},expand:()=>{const{collapsible:c,collapsedSize:h,minSize:d}=r(),{mutableValues:g}=i(),p=o();if(c&&p===h){let b=g.expandToSize??d;b===0&&(b=1),l(b)}},getSize:()=>{const{group:c}=n(),h=o(),{element:d}=i(),g=c.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:h,inPixels:g}},isCollapsed:()=>{const{collapsible:c,collapsedSize:h}=r(),d=o();return c&&$r(h,d)},resize:c=>{const{group:h}=n(),{element:d}=i(),g=eu({group:h}),p=Ld({groupSize:g,panelElement:d,styleProp:c}),b=si(p/g*100);l(b)}}}function BE(e){if(e.defaultPrevented)return;const t=Pl();Sw(e,t).forEach(n=>{if(n.separator){const r=n.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(r){const i=r.panelConstraints.defaultSize,o=uD({groupId:n.group.id,panelId:r.id});o&&i!==void 0&&(o.resize(i),e.preventDefault())}}})}function Zm(e){const t=Pl();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 dD({groupId:e}){const t=()=>{const n=Pl();for(const[r,i]of n)if(r.id===e)return{group:r,...i};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:i,group:o,groupSize:l,layout:c,separatorToPanels:h}=t(),d=Tl({layout:n,panelConstraints:i});return r?c:(Rl(c,d)||To(o,{defaultLayoutDeferred:r,derivedPanelConstraints:i,groupSize:l,layout:d,separatorToPanels:h}),d)}}}function ol(e,t){const n=Zm(e),r=ka(n.id,!0),i=n.separators.find(g=>g.element===e);un(i,"Matching separator not found");const o=r.separatorToPanels.get(i);un(o,"Matching panels not found");const l=o.map(g=>n.panels.indexOf(g)),c=dD({groupId:n.id}).getLayout(),h=mh({delta:t,initialLayout:c,panelConstraints:r.derivedPanelConstraints,pivotIndices:l,prevLayout:c,trigger:"keyboard"}),d=Tl({layout:h,panelConstraints:r.derivedPanelConstraints});Rl(c,d)||To(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels})}function FE(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Zm(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&ol(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&ol(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&ol(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&ol(t,-5);break}case"End":{e.preventDefault(),ol(t,100);break}case"Enter":{e.preventDefault();const r=Zm(t),i=ka(r.id,!0),{derivedPanelConstraints:o,layout:l,separatorToPanels:c}=i,h=r.separators.find(b=>b.element===t);un(h,"Matching separator not found");const d=c.get(h);un(d,"Matching panels not found");const g=d[0],p=o.find(b=>b.panelId===g.id);if(un(p,"Panel metadata not found"),p.collapsible){const b=l[g.id],y=p.collapsedSize===b?r.mutableState.expandedPanelSizes[g.id]??p.minSize:p.collapsedSize;ol(t,y-b)}break}case"F6":{e.preventDefault();const r=Zm(t).separators.map(l=>l.element),i=Array.from(r).findIndex(l=>l===e.currentTarget);un(i!==null,"Index not found");const o=e.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[o].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),ol(t,-100);break}}}let qc={cursorFlags:0,state:"inactive"};const Cw=new aD;function Nl(){return qc}function Iq(e){return Cw.addListener("change",e)}function Bq(e){const t=qc,n={...qc};n.cursorFlags=e,qc=n,Cw.emit("change",{prev:t,next:n})}function Kc(e){const t=qc;qc=e,Cw.emit("change",{prev:t,next:e})}function HE(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Pl(),n=Sw(e,t),r=new Map;let i=!1;n.forEach(o=>{o.separator&&(i||(i=!0,o.separator.element.focus({preventScroll:!0})));const l=t.get(o.group);l&&r.set(o.group,l.layout)}),Kc({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const Fq=e=>e,N_=()=>{},hD=1,fD=2,mD=4,pD=8,$E=3,UE=12;let Cm;function VE(){return Cm===void 0&&(Cm=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Cm=!0)),Cm}function Hq({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case"active":case"hover":t.forEach(o=>{if(!o.mutableState.disableCursor)switch(o.orientation){case"horizontal":{r++;break}case"vertical":{i++;break}}})}if(!(r===0&&i===0)){switch(n){case"active":{if(e&&VE()){const o=(e&hD)!==0,l=(e&fD)!==0,c=(e&mD)!==0,h=(e&pD)!==0;if(o)return c?"se-resize":h?"ne-resize":"e-resize";if(l)return c?"sw-resize":h?"nw-resize":"w-resize";if(c)return"s-resize";if(h)return"n-resize"}break}}return VE()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const WE=new WeakMap;function kw(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=WE.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=Nl();switch(r.state){case"active":case"hover":{const i=Hq({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(l=>l.group),state:r.state}),o=`*, *:hover {cursor: ${i} !important; }`;if(t===o)return;t=o,i?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}}WE.set(e,{prevStyle:t,styleSheet:n})}function gD({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:o,prevCursorFlags:l}){let c=0;n.forEach(d=>{const{group:g,groupSize:p}=d,{orientation:b,panels:y}=g,{disableCursor:w}=g.mutableState;let S=0;o?b==="horizontal"?S=(t.clientX-o.x)/p*100:S=(t.clientY-o.y)/p*100:b==="horizontal"?S=t.clientX<0?-100:100:S=t.clientY<0?-100:100;const C=r.get(g),k=i.get(g);if(!C||!k)return;const{defaultLayoutDeferred:R,derivedPanelConstraints:E,groupSize:N,layout:L,separatorToPanels:A}=k;if(E&&L&&A){const O=mh({delta:S,initialLayout:C,panelConstraints:E,pivotIndices:d.panels.map(H=>y.indexOf(H)),prevLayout:L,trigger:"mouse-or-touch"});if(Rl(O,L)){if(S!==0&&!w)switch(b){case"horizontal":{c|=S<0?hD:fD;break}case"vertical":{c|=S<0?mD:pD;break}}}else To(d.group,{defaultLayoutDeferred:R,derivedPanelConstraints:E,groupSize:N,layout:O,separatorToPanels:A})}});let h=0;t.movementX===0?h|=l&$E:h|=c&$E,t.movementY===0?h|=l&UE:h|=c&UE,Bq(h),kw(e)}function qE(e){const t=Pl(),n=Nl();switch(n.state){case"active":gD({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function KE(e){var r,i;if(e.defaultPrevented)return;const t=Nl(),n=Pl();switch(t.state){case"active":{if(e.buttons===0){Kc({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{const l=ka(o.group.id,!0);To(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)||((i=l.setPointerCapture)==null||i.call(l,e.pointerId))}gD({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const o=Sw(e,n);o.length===0?t.state!=="inactive"&&Kc({cursorFlags:0,state:"inactive"}):Kc({cursorFlags:0,hitRegions:o,state:"hover"}),kw(e.currentTarget);break}}}function GE(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Nl().state){case"hover":Kc({cursorFlags:0,state:"inactive"})}}function YE(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Nl();switch(t.state){case"active":Kc({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(kw(e.currentTarget),t.hitRegions.forEach(n=>{const r=ka(n.group.id,!0);To(n.group,r)}),e.preventDefault())}}function XE(e){let t=0,n=0;const r={};for(const o of e)if(o.defaultSize!==void 0){t++;const l=si(o.defaultSize);n+=l,r[o.panelId]=l}else r[o.panelId]=void 0;const i=e.length-t;if(i!==0){const o=si((100-n)/i);for(const l of e)l.defaultSize===void 0&&(r[l.panelId]=o)}return r}function $q(e,t,n){if(!n[0])return;const r=e.panels.find(h=>h.element===t);if(!r||!r.onResize)return;const i=eu({group:e}),o=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,l=r.mutableValues.prevSize,c={asPercentage:si(o/i*100),inPixels:o};r.mutableValues.prevSize=c,r.onResize(c,r.id,l)}function Uq(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 Vq({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,o=0,l=!1;const c=new Map,h=[];for(const p of e.panels){const b=r[p.id]??0;switch(p.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{l=!0;const y=b/100*n,w=si(y/t*100);c.set(p.id,w),i+=w;break}case"preserve-relative-size":default:{h.push(p.id),o+=b;break}}}if(!l||h.length===0)return r;const d=100-i,g={...r};if(c.forEach((p,b)=>{g[b]=p}),o>0)for(const p of h){const b=r[p]??0;g[p]=si(b/o*d)}else{const p=si(d/h.length);for(const b of h)g[b]=p}return g}function Wq(e,t){const n=e.map(i=>i.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i))return!1;return!0}const Rc=new Map;function qq(e){let t=!0;un(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=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=eu({group:e});if(R===0)return;const E=ka(e.id);if(!E)return;const N=rx(e),L=E.defaultLayoutDeferred?XE(N):E.layout,A=Vq({group:e,nextGroupSize:R,prevGroupSize:E.groupSize,prevLayout:L}),O=Tl({layout:A,panelConstraints:N});if(!E.defaultLayoutDeferred&&Rl(E.layout,O)&&Uq(E.derivedPanelConstraints,N)&&E.groupSize===R)return;To(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:N,groupSize:R,layout:O,separatorToPanels:E.separatorToPanels})}}else $q(e,k,C)}});o.observe(e.element),e.panels.forEach(w=>{un(!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=eu({group:e}),c=rx(e),h=e.panels.map(({id:w})=>w).join(",");let d=e.mutableState.defaultLayout;d&&(Wq(e.panels,d)||(d=void 0));const g=e.mutableState.layouts[h]??d??XE(c),p=Tl({layout:g,panelConstraints:c}),b=e.element.ownerDocument;Rc.set(b,(Rc.get(b)??0)+1);const y=new Map;return oD(e).forEach(w=>{w.separator&&y.set(w.separator,w.panels)}),To(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:c,groupSize:l,layout:p,separatorToPanels:y}),e.separators.forEach(w=>{un(!i.has(w.id),`Separator ids must be unique; id "${w.id}" was used more than once`),i.add(w.id),w.element.addEventListener("keydown",FE)}),Rc.get(b)===1&&(b.addEventListener("dblclick",BE,!0),b.addEventListener("pointerdown",HE,!0),b.addEventListener("pointerleave",qE),b.addEventListener("pointermove",KE),b.addEventListener("pointerout",GE),b.addEventListener("pointerup",YE,!0)),function(){t=!1,Rc.set(b,Math.max(0,(Rc.get(b)??0)-1)),Tq(e),e.separators.forEach(w=>{w.element.removeEventListener("keydown",FE)}),Rc.get(b)||(b.removeEventListener("dblclick",BE,!0),b.removeEventListener("pointerdown",HE,!0),b.removeEventListener("pointerleave",qE),b.removeEventListener("pointermove",KE),b.removeEventListener("pointerout",GE),b.removeEventListener("pointerup",YE,!0)),o.disconnect()}}function Kq(){const[e,t]=v.useState({}),n=v.useCallback(()=>t({}),[]);return[e,n]}function Ew(e){const t=v.useId();return`${e??t}`}const Il=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Yd(e){const t=v.useRef(e);return Il(()=>{t.current=e},[e]),v.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function Rw(...e){return Yd(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function Tw(e){const t=v.useRef({...e});return Il(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const vD=v.createContext(null);function Gq(e,t){const n=v.useRef({getLayout:()=>({}),setLayout:Fq});v.useImperativeHandle(t,()=>n.current,[]),Il(()=>{Object.assign(n.current,dD({groupId:e}))})}function bD({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:o,groupRef:l,id:c,onLayoutChange:h,onLayoutChanged:d,orientation:g="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:b,...y}){const w=v.useRef({onLayoutChange:{},onLayoutChanged:{}}),S=Yd(q=>{Rl(w.current.onLayoutChange,q)||(w.current.onLayoutChange=q,h==null||h(q))}),C=Yd(q=>{Rl(w.current.onLayoutChanged,q)||(w.current.onLayoutChanged=q,d==null||d(q))}),k=Ew(c),R=v.useRef(null),[E,N]=Kq(),L=v.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),A=Rw(R,o);Gq(k,l);const O=Yd((q,F)=>{const $=Nl(),W=LE(q),K=ka(q);if(K){let D=!1;switch($.state){case"active":{D=$.hitRegions.some(U=>U.group===W);break}}return{flexGrow:K.layout[F]??1,pointerEvents:D?"none":void 0}}if(n!=null&&n[F])return{flexGrow:n==null?void 0:n[F]}}),H=Tw({defaultLayout:n,disableCursor:r}),Z=v.useMemo(()=>({get disableCursor(){return!!H.disableCursor},getPanelStyles:O,id:k,orientation:g,registerPanel:q=>{const F=L.current;return F.panels=ix(g,[...F.panels,q]),N(),()=>{F.panels=F.panels.filter($=>$!==q),N()}},registerSeparator:q=>{const F=L.current;return F.separators=ix(g,[...F.separators,q]),N(),()=>{F.separators=F.separators.filter($=>$!==q),N()}},togglePanelDisabled:(q,F)=>{const $=L.current.panels.find(D=>D.id===q);$&&($.panelConstraints.disabled=F);const W=LE(k),K=ka(k);W&&K&&To(W,{...K,derivedPanelConstraints:rx(W)})},toggleSeparatorDisabled:(q,F)=>{const $=L.current.separators.find(W=>W.id===q);$&&($.disabled=F)}}),[O,k,N,g,H]),I=v.useRef(null);return Il(()=>{const q=R.current;if(q===null)return;const F=L.current;let $;if(H.defaultLayout!==void 0&&Object.keys(H.defaultLayout).length===F.panels.length){$={};for(const M of F.panels){const B=H.defaultLayout[M.id];B!==void 0&&($[M.id]=B)}}const W={disabled:!!i,element:q,id:k,mutableState:{defaultLayout:$,disableCursor:!!H.disableCursor,expandedPanelSizes:L.current.lastExpandedPanelSizes,layouts:L.current.layouts},orientation:g,panels:F.panels,resizeTargetMinimumSize:F.resizeTargetMinimumSize,separators:F.separators};I.current=W;const K=qq(W),{defaultLayoutDeferred:D,derivedPanelConstraints:U,layout:z}=ka(W.id,!0);!D&&U.length>0&&(S(z),C(z));const G=ww(k,M=>{const{defaultLayoutDeferred:B,derivedPanelConstraints:X,layout:j}=M.next;if(B||X.length===0)return;const ie=W.panels.map(({id:ee})=>ee).join(",");W.mutableState.layouts[ie]=j,X.forEach(ee=>{if(ee.collapsible){const{layout:re}=M.prev??{};if(re){const ue=$r(ee.collapsedSize,j[ee.panelId]),fe=$r(ee.collapsedSize,re[ee.panelId]);ue&&!fe&&(W.mutableState.expandedPanelSizes[ee.panelId]=re[ee.panelId])}}});const J=Nl().state!=="active";S(j),J&&C(j)});return()=>{I.current=null,K(),G()}},[i,k,C,S,g,E,H]),v.useEffect(()=>{const q=I.current;q&&(q.mutableState.defaultLayout=n,q.mutableState.disableCursor=!!r)}),f.jsx(vD.Provider,{value:Z,children:f.jsx("div",{...y,className:t,"data-group":!0,"data-testid":k,id:k,ref:A,style:{height:"100%",width:"100%",overflow:"hidden",...b,display:"flex",flexDirection:g==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:g==="horizontal"?"pan-y":"pan-x"},children:e})})}bD.displayName="Group";function Nw(){const e=v.useContext(vD);return un(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Yq(e,t){const{id:n}=Nw(),r=v.useRef({collapse:N_,expand:N_,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:N_});v.useImperativeHandle(t,()=>r.current,[]),Il(()=>{Object.assign(r.current,uD({groupId:n,panelId:e}))})}function _D({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:i,disabled:o,elementRef:l,groupResizeBehavior:c="preserve-relative-size",id:h,maxSize:d="100%",minSize:g="0%",onResize:p,panelRef:b,style:y,...w}){const S=!!h,C=Ew(h),k=Tw({disabled:o}),R=v.useRef(null),E=Rw(R,l),{getPanelStyles:N,id:L,orientation:A,registerPanel:O,togglePanelDisabled:H}=Nw(),Z=p!==null,I=Yd((W,K,D)=>{p==null||p(W,h,D)});Il(()=>{const W=R.current;if(W!==null){const K={element:W,id:C,idIsStable:S,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:Z?I:void 0,panelConstraints:{groupResizeBehavior:c,collapsedSize:n,collapsible:r,defaultSize:i,disabled:k.disabled,maxSize:d,minSize:g}};return O(K)}},[c,n,r,i,Z,C,S,d,g,I,O,k]),v.useEffect(()=>{H(C,!!o)},[o,C,H]),Yq(C,b);const q=()=>{const W=N(L,C);if(W)return JSON.stringify(W)},F=v.useSyncExternalStore(W=>ww(L,W),q,q);let $;return F?$=JSON.parse(F):i?$={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:$={flexGrow:1},f.jsx("div",{...w,"data-disabled":o||void 0,"data-panel":!0,"data-testid":C,id:C,ref:E,style:{...Xq,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...$},children:f.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:A==="horizontal"?"pan-y":"pan-x"},children:e})})}_D.displayName="Panel";const Xq={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Zq({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,o;const l=e[n],c=t.find(h=>h.panelId===n);if(c){const h=c.maxSize,d=c.collapsible?c.collapsedSize:c.minSize,g=[r,r+1];o=Tl({layout:mh({delta:d-l,initialLayout:e,panelConstraints:t,pivotIndices:g,prevLayout:e}),panelConstraints:t})[n],i=Tl({layout:mh({delta:h-l,initialLayout:e,panelConstraints:t,pivotIndices:g,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:o,valueNow:l}}function yD({children:e,className:t,disabled:n,elementRef:r,id:i,style:o,...l}){const c=Ew(i),h=Tw({disabled:n}),[d,g]=v.useState({}),[p,b]=v.useState("inactive"),y=v.useRef(null),w=Rw(y,r),{disableCursor:S,id:C,orientation:k,registerSeparator:R,toggleSeparatorDisabled:E}=Nw(),N=k==="horizontal"?"vertical":"horizontal";Il(()=>{const A=y.current;if(A!==null){const O={disabled:h.disabled,element:A,id:c},H=R(O),Z=Iq(q=>{b(q.next.state!=="inactive"&&q.next.hitRegions.some(F=>F.separator===O)?q.next.state:"inactive")}),I=ww(C,q=>{const{derivedPanelConstraints:F,layout:$,separatorToPanels:W}=q.next,K=W.get(O);if(K){const D=K[0],U=K.indexOf(D);g(Zq({layout:$,panelConstraints:F,panelId:D.id,panelIndex:U}))}});return()=>{Z(),I(),H()}}},[C,c,R,h]),v.useEffect(()=>{E(c,!!n)},[n,c,E]);let L;return n&&!S&&(L="not-allowed"),f.jsx("div",{...l,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":N,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":n?"disabled":p,"data-testid":c,id:c,ref:w,role:"separator",style:{flexBasis:"auto",cursor:L,...o,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}yD.displayName="Separator";const Xd=({className:e,...t})=>f.jsx(bD,{className:pe("flex h-full w-full",e),...t}),xo=e=>f.jsx(_D,{...e}),Zd=({withHandle:e,orientation:t,disabled:n,className:r,...i})=>f.jsx(yD,{disabled:n,className:pe("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),...i,children:f.jsx("span",{className:"sr-only",children:t==="vertical"?"Resize rows":"Resize columns"})});/**
|
|
524
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
525
|
+
* @license MIT
|
|
526
|
+
*
|
|
527
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
528
|
+
* @license MIT
|
|
529
|
+
*
|
|
530
|
+
* Originally forked from (with the author's permission):
|
|
531
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
532
|
+
* http://bellard.org/jslinux/
|
|
533
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
534
|
+
*/var gr=0,vr=0,br=0,Ln=0,Lr;(e=>{function t(i,o,l,c){return c!==void 0?`#${al(i)}${al(o)}${al(l)}${al(c)}`:`#${al(i)}${al(o)}${al(l)}`}e.toCss=t;function n(i,o,l,c=255){return(i<<24|o<<16|l<<8|c)>>>0}e.toRgba=n;function r(i,o,l,c){return{css:e.toCss(i,o,l,c),rgba:e.toRgba(i,o,l,c)}}e.toColor=r})(Lr||(Lr={}));var Qq;(e=>{function t(h,d){if(Ln=(d.rgba&255)/255,Ln===1)return{css:d.css,rgba:d.rgba};let g=d.rgba>>24&255,p=d.rgba>>16&255,b=d.rgba>>8&255,y=h.rgba>>24&255,w=h.rgba>>16&255,S=h.rgba>>8&255;gr=y+Math.round((g-y)*Ln),vr=w+Math.round((p-w)*Ln),br=S+Math.round((b-S)*Ln);let C=Lr.toCss(gr,vr,br),k=Lr.toRgba(gr,vr,br);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=Qm.ensureContrastRatio(h.rgba,d.rgba,g);if(p)return Lr.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function i(h){let d=(h.rgba|255)>>>0;return[gr,vr,br]=Qm.toChannels(d),{css:Lr.toCss(gr,vr,br),rgba:d}}e.opaque=i;function o(h,d){return Ln=Math.round(d*255),[gr,vr,br]=Qm.toChannels(h.rgba),{css:Lr.toCss(gr,vr,br,Ln),rgba:Lr.toRgba(gr,vr,br,Ln)}}e.opacity=o;function l(h,d){return Ln=h.rgba&255,o(h,Ln*d/255)}e.multiplyOpacity=l;function c(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=c})(Qq||(Qq={}));var Nr;(e=>{let t,n;try{let i=document.createElement("canvas");i.width=1,i.height=1;let o=i.getContext("2d",{willReadFrequently:!0});o&&(t=o,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return gr=parseInt(i.slice(1,2).repeat(2),16),vr=parseInt(i.slice(2,3).repeat(2),16),br=parseInt(i.slice(3,4).repeat(2),16),Lr.toColor(gr,vr,br);case 5:return gr=parseInt(i.slice(1,2).repeat(2),16),vr=parseInt(i.slice(2,3).repeat(2),16),br=parseInt(i.slice(3,4).repeat(2),16),Ln=parseInt(i.slice(4,5).repeat(2),16),Lr.toColor(gr,vr,br,Ln);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let o=i.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 gr=parseInt(o[1]),vr=parseInt(o[2]),br=parseInt(o[3]),Ln=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),Lr.toColor(gr,vr,br,Ln);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=i,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[gr,vr,br,Ln]=t.getImageData(0,0,1,1).data,Ln!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Lr.toRgba(gr,vr,br,Ln),css:i}}e.toColor=r})(Nr||(Nr={}));var Fr;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,i,o){let l=r/255,c=i/255,h=o/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),g=c<=.03928?c/12.92:Math.pow((c+.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})(Fr||(Fr={}));var Qm;(e=>{function t(l,c){if(Ln=(c&255)/255,Ln===1)return c;let h=c>>24&255,d=c>>16&255,g=c>>8&255,p=l>>24&255,b=l>>16&255,y=l>>8&255;return gr=p+Math.round((h-p)*Ln),vr=b+Math.round((d-b)*Ln),br=y+Math.round((g-y)*Ln),Lr.toRgba(gr,vr,br)}e.blend=t;function n(l,c,h){let d=Fr.relativeLuminance(l>>8),g=Fr.relativeLuminance(c>>8);if(go(d,g)<h){if(g<d){let y=r(l,c,h),w=go(d,Fr.relativeLuminance(y>>8));if(w<h){let S=i(l,c,h),C=go(d,Fr.relativeLuminance(S>>8));return w>C?y:S}return y}let p=i(l,c,h),b=go(d,Fr.relativeLuminance(p>>8));if(b<h){let y=r(l,c,h),w=go(d,Fr.relativeLuminance(y>>8));return b>w?p:y}return p}}e.ensureContrastRatio=n;function r(l,c,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,b=c>>24&255,y=c>>16&255,w=c>>8&255,S=go(Fr.relativeLuminance2(b,y,w),Fr.relativeLuminance2(d,g,p));for(;S<h&&(b>0||y>0||w>0);)b-=Math.max(0,Math.ceil(b*.1)),y-=Math.max(0,Math.ceil(y*.1)),w-=Math.max(0,Math.ceil(w*.1)),S=go(Fr.relativeLuminance2(b,y,w),Fr.relativeLuminance2(d,g,p));return(b<<24|y<<16|w<<8|255)>>>0}e.reduceLuminance=r;function i(l,c,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,b=c>>24&255,y=c>>16&255,w=c>>8&255,S=go(Fr.relativeLuminance2(b,y,w),Fr.relativeLuminance2(d,g,p));for(;S<h&&(b<255||y<255||w<255);)b=Math.min(255,b+Math.ceil((255-b)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),S=go(Fr.relativeLuminance2(b,y,w),Fr.relativeLuminance2(d,g,p));return(b<<24|y<<16|w<<8|255)>>>0}e.increaseLuminance=i;function o(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=o})(Qm||(Qm={}));function al(e){let t=e.toString(16);return t.length<2?"0"+t:t}function go(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var Jq=Object.freeze((()=>{let e=[Nr.toColor("#2e3436"),Nr.toColor("#cc0000"),Nr.toColor("#4e9a06"),Nr.toColor("#c4a000"),Nr.toColor("#3465a4"),Nr.toColor("#75507b"),Nr.toColor("#06989a"),Nr.toColor("#d3d7cf"),Nr.toColor("#555753"),Nr.toColor("#ef2929"),Nr.toColor("#8ae234"),Nr.toColor("#fce94f"),Nr.toColor("#729fcf"),Nr.toColor("#ad7fa8"),Nr.toColor("#34e2e2"),Nr.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],o=t[n%6];e.push({css:Lr.toCss(r,i,o),rgba:Lr.toRgba(r,i,o)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Lr.toCss(r,r,r),rgba:Lr.toRgba(r,r,r)})}return e})());function ZE(e,t,n){return Math.max(t,Math.min(e,n))}function eK(e){switch(e){case"&":return"&";case"<":return"<"}return e}var xD=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),i=this._buffer.getNullCell(),o=r,l=t.start.y,c=t.end.y,h=t.start.x,d=t.end.x;this._beforeSerialize(c-l,l,c);for(let g=l;g<=c;g++){let p=this._buffer.getLine(g);if(p){let b=g===t.start.y?h:0,y=g===t.end.y?d:p.length;for(let w=b;w<y;w++){let S=p.getCell(w,o===r?i: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===c)}return this._afterSerialize(),this._serializeString(n)}_nextCell(t,n,r,i){}_rowEnd(t,n){}_beforeSerialize(t,n,r){}_afterSerialize(){}_serializeString(t){return""}};function wD(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function yo(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function SD(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 tK=class extends xD{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 i;this._nullCellCount>0&&!yo(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!n){t-this._firstRow>=this._terminal.rows&&((i=this._buffer.getLine(this._cursorStyleRow))==null||i.getCell(this._cursorStyleCol,this._backgroundCell));let o=this._buffer.getLine(t),l=this._buffer.getLine(t+1);if(!l.isWrapped)r=`\r
|
|
535
|
+
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{r="";let c=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)&&((c.getChars()||c.getWidth()===0)&&yo(c,d)&&(p=!0),g&&(h.getChars()||h.getWidth()===0)&&yo(c,d)&&yo(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=[],i=!wD(t,n),o=!yo(t,n),l=!SD(t,n);if(i||o||l)if(t.isAttributeDefault())n.isAttributeDefault()||r.push(0);else{if(i){let c=t.getFgColor();t.isFgRGB()?r.push(38,2,c>>>16&255,c>>>8&255,c&255):t.isFgPalette()?c>=16?r.push(38,5,c):r.push(c&8?90+(c&7):30+(c&7)):r.push(39)}if(o){let c=t.getBgColor();t.isBgRGB()?r.push(48,2,c>>>16&255,c>>>8&255,c&255):t.isBgPalette()?c>=16?r.push(48,5,c):r.push(c&8?100+(c&7):40+(c&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,i){if(t.getWidth()===0)return;let o=t.getChars()==="",l=this._diffStyle(t,this._cursorStyle);if(o?!yo(this._cursorStyle,t):l.length>0){this._nullCellCount>0&&(yo(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=i,this._currentRow+=`\x1B[${l.join(";")}m`;let c=this._buffer.getLine(r);c!==void 0&&(c.getCell(i,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=i)}o?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(yo(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=i+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,c=this._buffer.cursorX,h=l!==this._lastCursorRow||c!==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(c-this._lastCursorCol))}let i=this._terminal._core._inputHandler._curAttrData,o=this._diffStyle(i,this._cursorStyle);return o.length>0&&(r+=`\x1B[${o.join(";")}m`),r}},nK=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let i=n.length,o=r===void 0?i:ZE(r+t.rows,0,i);return this._serializeBufferByRange(t,n,{start:i-o,end:i-1},!1)}_serializeBufferByRange(t,n,r,i){return new tK(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}},i)}_serializeBufferAsHTML(t,n){var h;let r=t.buffer.active,i=new rK(r,t,n),o=n.onlySelection??!1,l=n.range;if(l)return i.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:ZE(g+t.rows,0,d);return i.serialize({start:{x:0,y:d-p},end:{x:t.cols,y:d-1}})}let c=(h=this._terminal)==null?void 0:h.getSelectionPosition();return c!==void 0?i.serialize({start:{x:c.start.x,y:c.start.y},end:{x:c.end.x,y:c.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(){}},rK=class extends xD{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=Jq}_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 c,h;this._htmlContent+="<html><body><!--StartFragment--><pre>";let i="#000000",o="#ffffff";(this._options.includeGlobalBackground??!1)&&(i=((c=this._terminal.options.theme)==null?void 0:c.foreground)??"#ffffff",o=((h=this._terminal.options.theme)==null?void 0:h.background)??"#000000");let l=[];l.push("color: "+i+";"),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(i=>this._padStart(i.toString(16),2,"0")).join("");if(n?t.isFgPalette():t.isBgPalette())return this._ansiColors[r].css}_diffStyle(t,n){let r=[],i=!wD(t,n),o=!yo(t,n),l=!SD(t,n);if(i||o||l){let c=this._getHexColor(t,!0);c&&r.push("color: "+c+";");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,i){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+=eK(t.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
536
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
537
|
+
* @license MIT
|
|
538
|
+
*
|
|
539
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
540
|
+
* @license MIT
|
|
541
|
+
*
|
|
542
|
+
* Originally forked from (with the author's permission):
|
|
543
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
544
|
+
* http://bellard.org/jslinux/
|
|
545
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
546
|
+
*/var iK=class{constructor(t,n,r,i={}){this._terminal=t,this._regex=n,this._handler=r,this._options=i}provideLinks(t,n){let r=oK.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,i)=>{if(this._options.hover){let{range:o}=n;this._options.hover(r,i,o)}},n))}};function sK(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 oK=class Jm{static computeLink(t,n,r,i){let o=new RegExp(n.source,(n.flags||"")+"g"),[l,c]=Jm._getWindowedLineStrings(t-1,r),h=l.join(""),d,g=[];for(;d=o.exec(h);){let p=d[0];if(!sK(p))continue;let[b,y]=Jm._mapStrIdx(r,c,0,d.index),[w,S]=Jm._mapStrIdx(r,b,y,p.length);if(b===-1||y===-1||w===-1||S===-1)continue;let C={start:{x:y+1,y:b+1},end:{x:S,y:w+1}};g.push({range:C,text:p,activate:i})}return g}static _getWindowedLineStrings(t,n){let r,i=t,o=t,l=0,c="",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(--i))&&l<2048&&(c=r.translateToString(!0),l+=c.length,h.push(c),!(!r.isWrapped||c.indexOf(" ")!==-1)););h.reverse()}for(h.push(d),l=0;(r=n.buffer.active.getLine(++o))&&r.isWrapped&&l<2048&&(c=r.translateToString(!0),l+=c.length,h.push(c),c.indexOf(" ")===-1););}return[h,i]}static _mapStrIdx(t,n,r,i){let o=t.buffer.active,l=o.getNullCell(),c=r;for(;i;){let h=o.getLine(n);if(!h)return[-1,-1];for(let d=c;d<h.length;++d){h.getCell(d,l);let g=l.getChars();if(l.getWidth()&&(i-=g.length||1,d===h.length-1&&g==="")){let p=o.getLine(n+1);p&&p.isWrapped&&(p.getCell(0,l),l.getWidth()===2&&(i+=1))}if(i<0)return[n,d]}n++,c=0}return[n,c]}},aK=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function lK(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 cK=class{constructor(t=lK,n={}){this._handler=t,this._options=n}activate(t){this._terminal=t;let n=this._options,r=n.urlRegex||aK;this._linkProvider=this._terminal.registerLinkProvider(new iK(this._terminal,r,this._handler,n))}dispose(){var t;(t=this._linkProvider)==null||t.dispose()}};/**
|
|
547
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
548
|
+
* @license MIT
|
|
549
|
+
*
|
|
550
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
551
|
+
* @license MIT
|
|
552
|
+
*
|
|
553
|
+
* Originally forked from (with the author's permission):
|
|
554
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
555
|
+
* http://bellard.org/jslinux/
|
|
556
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
557
|
+
*/var CD=Object.defineProperty,uK=Object.getOwnPropertyDescriptor,dK=(e,t)=>{for(var n in t)CD(e,n,{get:t[n],enumerable:!0})},Pn=(e,t,n,r)=>{for(var i=r>1?void 0:r?uK(t,n):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(r?l(t,n,i):l(i))||i);return r&&i&&CD(t,n,i),i},Ie=(e,t)=>(n,r)=>t(n,r,e),QE="Terminal input",sx={get:()=>QE,set:e=>QE=e},JE="Too much output to announce, navigate to rows manually to read",ox={get:()=>JE,set:e=>JE=e};function hK(e){return e.replace(/\r?\n/g,"\r")}function fK(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function mK(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function pK(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let i=e.clipboardData.getData("text/plain");kD(i,t,n,r)}}function kD(e,t,n,r){e=hK(e),e=fK(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function ED(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,o=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${i}px`,t.style.top=`${o}px`,t.style.zIndex="1000",t.focus()}function eR(e,t,n,r,i){ED(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function _a(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Og(e,t=0,n=e.length){let r="";for(let i=t;i<n;++i){let o=e[i];o>65535?(o-=65536,r+=String.fromCharCode((o>>10)+55296)+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r}var gK=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let o=e.charCodeAt(i++);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=i;o<n;++o){let l=e.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=n)return this._interim=l,r;let c=e.charCodeAt(o);56320<=c&&c<=57343?t[r++]=(l-55296)*1024+c-56320+65536:(t[r++]=l,t[r++]=c);continue}l!==65279&&(t[r++]=l)}return r}},vK=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,i,o,l,c,h=0,d=0;if(this.interim[0]){let b=!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--,b=!0;break}else this.interim[w++]=S,y<<=6,y|=S&63}b||(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&&!((i=e[p])&128)&&!((o=e[p+1])&128)&&!((l=e[p+2])&128)&&!((c=e[p+3])&128);)t[r++]=i,t[r++]=o,t[r++]=l,t[r++]=c,p+=4;if(i=e[p++],i<128)t[r++]=i;else if((i&224)===192){if(p>=n)return this.interim[0]=i,r;if(o=e[p++],(o&192)!==128){p--;continue}if(h=(i&31)<<6|o&63,h<128){p--;continue}t[r++]=h}else if((i&240)===224){if(p>=n)return this.interim[0]=i,r;if(o=e[p++],(o&192)!==128){p--;continue}if(p>=n)return this.interim[0]=i,this.interim[1]=o,r;if(l=e[p++],(l&192)!==128){p--;continue}if(h=(i&15)<<12|(o&63)<<6|l&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[r++]=h}else if((i&248)===240){if(p>=n)return this.interim[0]=i,r;if(o=e[p++],(o&192)!==128){p--;continue}if(p>=n)return this.interim[0]=i,this.interim[1]=o,r;if(l=e[p++],(l&192)!==128){p--;continue}if(p>=n)return this.interim[0]=i,this.interim[1]=o,this.interim[2]=l,r;if(c=e[p++],(c&192)!==128){p--;continue}if(h=(i&7)<<18|(o&63)<<12|(l&63)<<6|c&63,h<65536||h>1114111)continue;t[r++]=h}}return r}},RD="",Sa=" ",Hh=class TD{constructor(){this.fg=0,this.bg=0,this.extended=new Ap}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 TD;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}},Ap=class ND{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 ND(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Gi=class MD extends Hh{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ap,this.combinedData=""}static fromCharData(t){let n=new MD;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?_a(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 i=t[1].charCodeAt(1);56320<=i&&i<=57343?this.content=(r-55296)*1024+i-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()]}},tR="di$target",ax="di$dependencies",M_=new Map;function bK(e){return e[ax]||[]}function Sr(e){if(M_.has(e))return M_.get(e);let t=function(n,r,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");_K(t,n,i)};return t._id=e,M_.set(e,t),t}function _K(e,t,n){t[tR]===t?t[ax].push({id:e,index:n}):(t[ax]=[{id:e,index:n}],t[tR]=t)}var qr=Sr("BufferService"),jD=Sr("CoreMouseService"),Bl=Sr("CoreService"),yK=Sr("CharsetService"),Mw=Sr("InstantiationService"),AD=Sr("LogService"),Kr=Sr("OptionsService"),DD=Sr("OscLinkService"),xK=Sr("UnicodeService"),$h=Sr("DecorationService"),lx=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=[],i=this._optionsService.rawOptions.linkHandler,o=new Gi,l=n.getTrimmedLength(),c=-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,c=o.extended.urlId;continue}else d=o.extended.urlId!==c;else h!==-1&&(d=!0);if(d||h!==-1&&p===l-1){let b=(g=this._oscLinkService.getLinkData(c))==null?void 0:g.uri;if(b){let y={start:{x:h+1,y:e},end:{x:p+(!d&&p===l-1?1:0),y:e}},w=!1;if(!(i!=null&&i.allowNonHttpProtocols))try{let S=new URL(b);["http:","https:"].includes(S.protocol)||(w=!0)}catch{w=!0}w||r.push({text:b,range:y,activate:(S,C)=>i?i.activate(S,C,y):wK(S,C),hover:(S,C)=>{var k;return(k=i==null?void 0:i.hover)==null?void 0:k.call(i,S,C,y)},leave:(S,C)=>{var k;return(k=i==null?void 0:i.leave)==null?void 0:k.call(i,S,C,y)}})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(h=p,c=o.extended.urlId):(h=-1,c=-1)}}t(r)}};lx=Pn([Ie(0,qr),Ie(1,Kr),Ie(2,DD)],lx);function wK(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
558
|
+
|
|
559
|
+
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 Lg=Sr("CharSizeService"),Do=Sr("CoreBrowserService"),jw=Sr("MouseService"),Oo=Sr("RenderService"),SK=Sr("SelectionService"),OD=Sr("CharacterJoinerService"),_u=Sr("ThemeService"),LD=Sr("LinkProviderService"),CK=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?nR.isErrorNoTelemetry(e)?new nR(e.message+`
|
|
560
|
+
|
|
561
|
+
`+e.stack):new Error(e.message+`
|
|
562
|
+
|
|
563
|
+
`+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)}},kK=new CK;function ep(e){EK(e)||kK.onUnexpectedError(e)}var cx="Canceled";function EK(e){return e instanceof RK?!0:e instanceof Error&&e.name===cx&&e.message===cx}var RK=class extends Error{constructor(){super(cx),this.name=this.message}};function TK(e){return new Error(`Illegal argument: ${e}`)}var nR=class ux extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof ux)return t;let n=new ux;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},dx=class zD extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,zD.prototype)}};function gi(e,t=0){return e[e.length-(1+t)]}var NK;(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 i(o){return o===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(NK||(NK={}));function MK(e,t){let n=this,r=!1,i;return function(){return r||(r=!0,t||(i=e.apply(n,arguments))),i}}var PD;(e=>{function t(N){return N&&typeof N=="object"&&typeof N[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(N){yield N}e.single=i;function o(N){return t(N)?N:i(N)}e.wrap=o;function l(N){return N||n}e.from=l;function*c(N){for(let L=N.length-1;L>=0;L--)yield N[L]}e.reverse=c;function h(N){return!N||N[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(N){return N[Symbol.iterator]().next().value}e.first=d;function g(N,L){let A=0;for(let O of N)if(L(O,A++))return!0;return!1}e.some=g;function p(N,L){for(let A of N)if(L(A))return A}e.find=p;function*b(N,L){for(let A of N)L(A)&&(yield A)}e.filter=b;function*y(N,L){let A=0;for(let O of N)yield L(O,A++)}e.map=y;function*w(N,L){let A=0;for(let O of N)yield*L(O,A++)}e.flatMap=w;function*S(...N){for(let L of N)yield*L}e.concat=S;function C(N,L,A){let O=A;for(let H of N)O=L(O,H);return O}e.reduce=C;function*k(N,L,A=N.length){for(L<0&&(L+=N.length),A<0?A+=N.length:A>N.length&&(A=N.length);L<A;L++)yield N[L]}e.slice=k;function R(N,L=Number.POSITIVE_INFINITY){let A=[];if(L===0)return[A,N];let O=N[Symbol.iterator]();for(let H=0;H<L;H++){let Z=O.next();if(Z.done)return[A,e.empty()];A.push(Z.value)}return[A,{[Symbol.iterator](){return O}}]}e.consume=R;async function E(N){let L=[];for await(let A of N)L.push(A);return Promise.resolve(L)}e.asyncToArray=E})(PD||(PD={}));function Ml(e){if(PD.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 jK(...e){return Mn(()=>Ml(e))}function Mn(e){return{dispose:MK(()=>{e()})}}var ID=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{Ml(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)}};ID.DISABLE_DISPOSED_WARNING=!1;var Ea=ID,Ct=class{constructor(){this._store=new Ea,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)}};Ct.None=Object.freeze({dispose(){}});var tu=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}},wo=typeof window=="object"?window:globalThis,hx=class fx{constructor(t){this.element=t,this.next=fx.Undefined,this.prev=fx.Undefined}};hx.Undefined=new hx(void 0);var jn=hx,rR=class{constructor(){this._first=jn.Undefined,this._last=jn.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===jn.Undefined}clear(){let e=this._first;for(;e!==jn.Undefined;){let t=e.next;e.prev=jn.Undefined,e.next=jn.Undefined,e=t}this._first=jn.Undefined,this._last=jn.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new jn(e);if(this._first===jn.Undefined)this._first=n,this._last=n;else if(t){let i=this._last;this._last=n,n.prev=i,i.next=n}else{let i=this._first;this._first=n,n.next=i,i.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==jn.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==jn.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==jn.Undefined&&e.next!==jn.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===jn.Undefined&&e.next===jn.Undefined?(this._first=jn.Undefined,this._last=jn.Undefined):e.next===jn.Undefined?(this._last=this._last.prev,this._last.next=jn.Undefined):e.prev===jn.Undefined&&(this._first=this._first.next,this._first.prev=jn.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==jn.Undefined;)yield e.element,e=e.next}},AK=globalThis.performance&&typeof globalThis.performance.now=="function",DK=class FD{static create(t){return new FD(t)}constructor(t){this._now=AK&&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}},jr;(e=>{e.None=()=>Ct.None;function t(F,$){return p(F,()=>{},0,void 0,!0,void 0,$)}e.defer=t;function n(F){return($,W=null,K)=>{let D=!1,U;return U=F(z=>{if(!D)return U?U.dispose():D=!0,$.call(W,z)},null,K),D&&U.dispose(),U}}e.once=n;function r(F,$,W){return d((K,D=null,U)=>F(z=>K.call(D,$(z)),null,U),W)}e.map=r;function i(F,$,W){return d((K,D=null,U)=>F(z=>{$(z),K.call(D,z)},null,U),W)}e.forEach=i;function o(F,$,W){return d((K,D=null,U)=>F(z=>$(z)&&K.call(D,z),null,U),W)}e.filter=o;function l(F){return F}e.signal=l;function c(...F){return($,W=null,K)=>{let D=jK(...F.map(U=>U(z=>$.call(W,z))));return g(D,K)}}e.any=c;function h(F,$,W,K){let D=W;return r(F,U=>(D=$(D,U),D),K)}e.reduce=h;function d(F,$){let W,K={onWillAddFirstListener(){W=F(D.fire,D)},onDidRemoveLastListener(){W==null||W.dispose()}},D=new Me(K);return $==null||$.add(D),D.event}function g(F,$){return $ instanceof Array?$.push(F):$&&$.add(F),F}function p(F,$,W=100,K=!1,D=!1,U,z){let G,M,B,X=0,j,ie={leakWarningThreshold:U,onWillAddFirstListener(){G=F(ee=>{X++,M=$(M,ee),K&&!B&&(J.fire(M),M=void 0),j=()=>{let re=M;M=void 0,B=void 0,(!K||X>1)&&J.fire(re),X=0},typeof W=="number"?(clearTimeout(B),B=setTimeout(j,W)):B===void 0&&(B=0,queueMicrotask(j))})},onWillRemoveListener(){D&&X>0&&(j==null||j())},onDidRemoveLastListener(){j=void 0,G.dispose()}},J=new Me(ie);return z==null||z.add(J),J.event}e.debounce=p;function b(F,$=0,W){return e.debounce(F,(K,D)=>K?(K.push(D),K):[D],$,void 0,!0,void 0,W)}e.accumulate=b;function y(F,$=(K,D)=>K===D,W){let K=!0,D;return o(F,U=>{let z=K||!$(U,D);return K=!1,D=U,z},W)}e.latch=y;function w(F,$,W){return[e.filter(F,$,W),e.filter(F,K=>!$(K),W)]}e.split=w;function S(F,$=!1,W=[],K){let D=W.slice(),U=F(M=>{D?D.push(M):G.fire(M)});K&&K.add(U);let z=()=>{D==null||D.forEach(M=>G.fire(M)),D=null},G=new Me({onWillAddFirstListener(){U||(U=F(M=>G.fire(M)),K&&K.add(U))},onDidAddFirstListener(){D&&($?setTimeout(z):z())},onDidRemoveLastListener(){U&&U.dispose(),U=null}});return K&&K.add(G),G.event}e.buffer=S;function C(F,$){return(W,K,D)=>{let U=$(new R);return F(function(z){let G=U.evaluate(z);G!==k&&W.call(K,G)},void 0,D)}}e.chain=C;let k=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map($){return this.steps.push($),this}forEach($){return this.steps.push(W=>($(W),W)),this}filter($){return this.steps.push(W=>$(W)?W:k),this}reduce($,W){let K=W;return this.steps.push(D=>(K=$(K,D),K)),this}latch($=(W,K)=>W===K){let W=!0,K;return this.steps.push(D=>{let U=W||!$(D,K);return W=!1,K=D,U?D:k}),this}evaluate($){for(let W of this.steps)if($=W($),$===k)break;return $}}function E(F,$,W=K=>K){let K=(...G)=>z.fire(W(...G)),D=()=>F.on($,K),U=()=>F.removeListener($,K),z=new Me({onWillAddFirstListener:D,onDidRemoveLastListener:U});return z.event}e.fromNodeEventEmitter=E;function N(F,$,W=K=>K){let K=(...G)=>z.fire(W(...G)),D=()=>F.addEventListener($,K),U=()=>F.removeEventListener($,K),z=new Me({onWillAddFirstListener:D,onDidRemoveLastListener:U});return z.event}e.fromDOMEventEmitter=N;function L(F){return new Promise($=>n(F)($))}e.toPromise=L;function A(F){let $=new Me;return F.then(W=>{$.fire(W)},()=>{$.fire(void 0)}).finally(()=>{$.dispose()}),$.event}e.fromPromise=A;function O(F,$){return F(W=>$.fire(W))}e.forward=O;function H(F,$,W){return $(W),F(K=>$(K))}e.runAndSubscribe=H;class Z{constructor($,W){this._observable=$,this._counter=0,this._hasChanged=!1;let K={onWillAddFirstListener:()=>{$.addObserver(this)},onDidRemoveLastListener:()=>{$.removeObserver(this)}};this.emitter=new Me(K),W&&W.add(this.emitter)}beginUpdate($){this._counter++}handlePossibleChange($){}handleChange($,W){this._hasChanged=!0}endUpdate($){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function I(F,$){return new Z(F,$).emitter.event}e.fromObservable=I;function q(F){return($,W,K)=>{let D=0,U=!1,z={beginUpdate(){D++},endUpdate(){D--,D===0&&(F.reportChanges(),U&&(U=!1,$.call(W)))},handlePossibleChange(){},handleChange(){U=!0}};F.addObserver(z),F.reportChanges();let G={dispose(){F.removeObserver(z)}};return K instanceof Ea?K.add(G):Array.isArray(K)&&K.push(G),G}}e.fromObservableLight=q})(jr||(jr={}));var mx=class px{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${px._idPool++}`,px.all.add(this)}start(t){this._stopWatch=new DK,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}}};mx.all=new Set,mx._idPool=0;var OK=mx,LK=-1,HD=class $D{constructor(t,n,r=($D._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 i=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[o,l]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${l}):`;console.warn(c),console.warn(o);let h=new IK(c,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,i]of this._stacks)(!t||n<i)&&(t=[r,i],n=i);return t}};HD._idPool=1;var zK=HD,PK=class UD{constructor(t){this.value=t}static create(){let t=new Error;return new UD(t.stack??"")}print(){console.warn(this.value.split(`
|
|
564
|
+
`).slice(2).join(`
|
|
565
|
+
`))}},IK=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},BK=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},FK=0,j_=class{constructor(e){this.value=e,this.id=FK++}},HK=2,$K,Me=class{constructor(e){var t,n,r,i;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new zK((e==null?void 0:e.onListenerError)??ep,((n=this._options)==null?void 0:n.leakWarningThreshold)??LK):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new OK(this._options._profName):void 0,this._deliveryQueue=(i=this._options)==null?void 0:i.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,c,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 b=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new BK(`${p}. HINT: Stack shows most frequent listener (${b[1]}-times)`,b[0]);return(((l=this._options)==null?void 0:l.onListenerError)||ep)(y),Ct.None}if(this._disposed)return Ct.None;t&&(e=e.bind(t));let r=new j_(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=PK.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof j_?(this._deliveryQueue??(this._deliveryQueue=new UK),this._listeners=[this._listeners,r]):this._listeners.push(r):((h=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||h.call(c,this),this._listeners=r,(g=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||g.call(d,this)),this._size++;let o=Mn(()=>{i==null||i(),this._removeListener(r)});return n instanceof Ea?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var i,o,l,c;if((o=(i=this._options)==null?void 0:i.onWillRemoveListener)==null||o.call(i,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||c.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*HK<=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)||ep;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}_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,i;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 j_)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(i=this._perfMon)==null||i.stop()}hasListeners(){return this._size>0}},UK=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}},gx=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}};gx.INSTANCE=new gx;var Aw=gx;function VK(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}Aw.INSTANCE.onDidChangeZoomLevel;function WK(e){return Aw.INSTANCE.getZoomFactor(e)}Aw.INSTANCE.onDidChangeFullscreen;var yu=typeof navigator=="object"?navigator.userAgent:"",vx=yu.indexOf("Firefox")>=0,qK=yu.indexOf("AppleWebKit")>=0,Dw=yu.indexOf("Chrome")>=0,KK=!Dw&&yu.indexOf("Safari")>=0;yu.indexOf("Electron/")>=0;yu.indexOf("Android")>=0;var A_=!1;if(typeof wo.matchMedia=="function"){let e=wo.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=wo.matchMedia("(display-mode: fullscreen)");A_=e.matches,VK(wo,e,({matches:n})=>{A_&&t.matches||(A_=n)})}var Hc="en",bx=!1,_x=!1,tp=!1,VD=!1,km,np=Hc,iR=Hc,GK,rs,yl=globalThis,Mr,kN;typeof yl.vscode<"u"&&typeof yl.vscode.process<"u"?Mr=yl.vscode.process:typeof process<"u"&&typeof((kN=process==null?void 0:process.versions)==null?void 0:kN.node)=="string"&&(Mr=process);var EN,YK=typeof((EN=Mr==null?void 0:Mr.versions)==null?void 0:EN.electron)=="string",XK=YK&&(Mr==null?void 0:Mr.type)==="renderer",RN;if(typeof Mr=="object"){bx=Mr.platform==="win32",_x=Mr.platform==="darwin",tp=Mr.platform==="linux",tp&&Mr.env.SNAP&&Mr.env.SNAP_REVISION,Mr.env.CI||Mr.env.BUILD_ARTIFACTSTAGINGDIRECTORY,km=Hc,np=Hc;let e=Mr.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);km=t.userLocale,iR=t.osLocale,np=t.resolvedLanguage||Hc,GK=(RN=t.languagePack)==null?void 0:RN.translationsConfigFile}catch{}VD=!0}else typeof navigator=="object"&&!XK?(rs=navigator.userAgent,bx=rs.indexOf("Windows")>=0,_x=rs.indexOf("Macintosh")>=0,(rs.indexOf("Macintosh")>=0||rs.indexOf("iPad")>=0||rs.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,tp=rs.indexOf("Linux")>=0,(rs==null?void 0:rs.indexOf("Mobi"))>=0,np=globalThis._VSCODE_NLS_LANGUAGE||Hc,km=navigator.language.toLowerCase(),iR=km):console.error("Unable to resolve platform.");var WD=bx,Is=_x,ZK=tp,sR=VD,Hs=rs,ha=np,QK;(e=>{function t(){return ha}e.value=t;function n(){return ha.length===2?ha==="en":ha.length>=3?ha[0]==="e"&&ha[1]==="n"&&ha[2]==="-":!1}e.isDefaultVariant=n;function r(){return ha==="en"}e.isDefault=r})(QK||(QK={}));var JK=typeof yl.postMessage=="function"&&!yl.importScripts;(()=>{if(JK){let e=[];yl.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,i=e.length;r<i;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}),yl.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var eG=!!(Hs&&Hs.indexOf("Chrome")>=0);Hs&&Hs.indexOf("Firefox")>=0;!eG&&Hs&&Hs.indexOf("Safari")>=0;Hs&&Hs.indexOf("Edg/")>=0;Hs&&Hs.indexOf("Android")>=0;var Tc=typeof navigator=="object"?navigator:{};sR||document.queryCommandSupported&&document.queryCommandSupported("copy")||Tc&&Tc.clipboard&&Tc.clipboard.writeText,sR||Tc&&Tc.clipboard&&Tc.clipboard.readText;var Ow=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}},D_=new Ow,oR=new Ow,aR=new Ow,tG=new Array(230),qD;(e=>{function t(c){return D_.keyCodeToStr(c)}e.toString=t;function n(c){return D_.strToKeyCode(c)}e.fromString=n;function r(c){return oR.keyCodeToStr(c)}e.toUserSettingsUS=r;function i(c){return aR.keyCodeToStr(c)}e.toUserSettingsGeneral=i;function o(c){return oR.strToKeyCode(c)||aR.strToKeyCode(c)}e.fromUserSettings=o;function l(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return D_.keyCodeToStr(c)}e.toElectronAccelerator=l})(qD||(qD={}));var nG=class KD{constructor(t,n,r,i,o){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=i,this.keyCode=o}equals(t){return t instanceof KD&&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",i=this.metaKey?"1":"0";return`K${t}${n}${r}${i}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new rG([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},rG=class{constructor(e){if(e.length===0)throw TK("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 iG(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return qD.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(vx)switch(t){case 59:return 85;case 60:if(ZK)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Is)return 57;break}else if(qK&&(Is&&t===93||!Is&&t===92))return 57;return tG[t]||0}var sG=Is?256:2048,oG=512,aG=1024,lG=Is?2048:256,lR=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=iG(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|=sG),this.altKey&&(t|=oG),this.shiftKey&&(t|=aG),this.metaKey&&(t|=lG),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new nG(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},cR=new WeakMap;function cG(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 uG=class{static getSameOriginWindowChain(e){let t=cR.get(e);if(!t){t=[],cR.set(e,t);let n=e,r;do r=cG(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,i=this.getSameOriginWindowChain(e);for(let o of i){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 c=o.iframeElement.getBoundingClientRect();n+=c.top,r+=c.left}return{top:n,left:r}}},Em=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=uG.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},uR=class{constructor(e,t=0,n=0){var i;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(Dw){let o=navigator.userAgent.match(/Chrome\/(\d+)/);r=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,c=((i=e.view)==null?void 0:i.devicePixelRatio)||1;if(typeof o.wheelDeltaY<"u")r?this.deltaY=o.wheelDeltaY/(120*c):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?vx&&!Is?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")KK&&WD?this.deltaX=-(o.wheelDeltaX/120):r?this.deltaX=o.wheelDeltaX/(120*c):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?vx&&!Is?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*c):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},GD=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),dG;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof hG?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:jr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:GD})})(dG||(dG={}));var hG=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?GD:(this._emitter||(this._emitter=new Me),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Lw=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 dx("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new dx("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},fG=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 dx("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=Mn(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},mG;(e=>{async function t(r){let i,o=await Promise.all(r.map(l=>l.then(c=>c,c=>{i||(i=c)})));if(typeof i<"u")throw i;return o}e.settled=t;function n(r){return new Promise(async(i,o)=>{try{await r(i,o)}catch(l){o(l)}})}e.withAsyncBody=n})(mG||(mG={}));var dR=class Ii{static fromArray(t){return new Ii(n=>{n.emitMany(t)})}static fromPromise(t){return new Ii(async n=>{n.emitMany(await t)})}static fromPromises(t){return new Ii(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new Ii(async n=>{await Promise.all(t.map(async r=>{for await(let i of r)n.emitOne(i)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new Me,queueMicrotask(async()=>{let r={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{await Promise.resolve(t(r)),this.resolve()}catch(i){this.reject(i)}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 jr.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 Ii(async r=>{for await(let i of t)r.emitOne(n(i))})}map(t){return Ii.map(this,t)}static filter(t,n){return new Ii(async r=>{for await(let i of t)n(i)&&r.emitOne(i)})}filter(t){return Ii.filter(this,t)}static coalesce(t){return Ii.filter(t,n=>!!n)}coalesce(){return Ii.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return Ii.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())}};dR.EMPTY=dR.fromArray([]);var{getWindow:Ls,getWindowId:pG,onDidRegisterWindow:gG}=function(){let e=new Map,t={window:wo,disposables:new Ea};e.set(wo.vscodeWindowId,t);let n=new Me,r=new Me,i=new Me;function o(l,c){return(typeof l=="number"?e.get(l):void 0)??(c?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(l){if(e.has(l.vscodeWindowId))return Ct.None;let c=new Ea,h={window:l,disposables:c.add(new Ea)};return e.set(l.vscodeWindowId,h),c.add(Mn(()=>{e.delete(l.vscodeWindowId),r.fire(l)})),c.add(at(l,mr.BEFORE_UNLOAD,()=>{i.fire(l)})),n.fire(h),c},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 c=l;if((d=c==null?void 0:c.ownerDocument)!=null&&d.defaultView)return c.ownerDocument.defaultView.window;let h=l;return h!=null&&h.view?h.view.window:wo},getDocument(l){return Ls(l).document}}}(),vG=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 at(e,t,n,r){return new vG(e,t,n,r)}var hR=function(e,t,n,r){return at(e,t,n,r)},zw,bG=class extends fG{constructor(e){super(),this.defaultTarget=e&&Ls(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},fR=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){ep(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=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(fR.sort),l.shift().execute();r.set(o,!1)};zw=(o,l,c=0)=>{let h=pG(o),d=new fR(l,c),g=e.get(h);return g||(g=[],e.set(h,g)),g.push(d),n.get(h)||(n.set(h,!0),o.requestAnimationFrame(()=>i(h))),d}})();function _G(e){let t=e.getBoundingClientRect(),n=Ls(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var mr={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"},yG=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=ni(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ni(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ni(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ni(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ni(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ni(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ni(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ni(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ni(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ni(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ni(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=ni(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=ni(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ni(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 ni(e){return typeof e=="number"?`${e}px`:e}function Qd(e){return new yG(e)}var YD=class{constructor(){this._hooks=new Ea,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,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let o=e;try{e.setPointerCapture(t),this._hooks.add(Mn(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=Ls(e)}this._hooks.add(at(o,mr.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(at(o,mr.POINTER_UP,l=>this.stopMonitoring(!0)))}};function xG(e,t,n){let r=null,i=null;if(typeof n.value=="function"?(r="value",i=n.value,i.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",i=n.get),!i)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:i.apply(this,l)}),this[o]}}var ks;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(ks||(ks={}));var zd=class Or extends Ct{constructor(){super(),this.dispatched=!1,this.targets=new rR,this.ignoreTargets=new rR,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(jr.runAndSubscribe(gG,({window:t,disposables:n})=>{n.add(at(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(at(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(at(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:wo,disposables:this._store}))}static addTarget(t){if(!Or.isTouchDevice())return Ct.None;Or.INSTANCE||(Or.INSTANCE=new Or);let n=Or.INSTANCE.targets.push(t);return Mn(n)}static ignoreTarget(t){if(!Or.isTouchDevice())return Ct.None;Or.INSTANCE||(Or.INSTANCE=new Or);let n=Or.INSTANCE.ignoreTargets.push(t);return Mn(n)}static isTouchDevice(){return"ontouchstart"in wo||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,i=t.targetTouches.length;r<i;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(ks.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(),i=Object.keys(this.activeTouches).length;for(let o=0,l=n.changedTouches.length;o<l;o++){let c=n.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(c.identifier))){console.warn("move of an UNKNOWN touch",c);continue}let h=this.activeTouches[c.identifier],d=Date.now()-h.initialTimeStamp;if(d<Or.HOLD_DELAY&&Math.abs(h.initialPageX-gi(h.rollingPageX))<30&&Math.abs(h.initialPageY-gi(h.rollingPageY))<30){let g=this.newGestureEvent(ks.Tap,h.initialTarget);g.pageX=gi(h.rollingPageX),g.pageY=gi(h.rollingPageY),this.dispatchEvent(g)}else if(d>=Or.HOLD_DELAY&&Math.abs(h.initialPageX-gi(h.rollingPageX))<30&&Math.abs(h.initialPageY-gi(h.rollingPageY))<30){let g=this.newGestureEvent(ks.Contextmenu,h.initialTarget);g.pageX=gi(h.rollingPageX),g.pageY=gi(h.rollingPageY),this.dispatchEvent(g)}else if(i===1){let g=gi(h.rollingPageX),p=gi(h.rollingPageY),b=gi(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)/b,y>0?1:-1,g,Math.abs(w)/b,w>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(ks.End,h.initialTarget)),delete this.activeTouches[c.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===ks.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>Or.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===ks.Change||t.type===ks.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 i=0,o=t.initialTarget;for(;o&&o!==r;)i++,o=o.parentElement;n.push([i,r])}n.sort((r,i)=>r[0]-i[0]);for(let[r,i]of n)i.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,o,l,c,h,d){this.handle=zw(t,()=>{let g=Date.now(),p=g-r,b=0,y=0,w=!0;i+=Or.SCROLL_FRICTION*p,c+=Or.SCROLL_FRICTION*p,i>0&&(w=!1,b=o*i*p),c>0&&(w=!1,y=h*c*p);let S=this.newGestureEvent(ks.Change);S.translationX=b,S.translationY=y,n.forEach(C=>C.dispatchEvent(S)),w||this.inertia(t,n,g,i,o,l+b,c,h,d+y)})}onTouchMove(t){let n=Date.now();for(let r=0,i=t.changedTouches.length;r<i;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],c=this.newGestureEvent(ks.Change,l.initialTarget);c.translationX=o.pageX-gi(l.rollingPageX),c.translationY=o.pageY-gi(l.rollingPageY),c.pageX=o.pageX,c.pageY=o.pageY,this.dispatchEvent(c),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)}};zd.SCROLL_FRICTION=-.005,zd.HOLD_DELAY=700,zd.CLEAR_TAP_COUNT_TIME=400,Pn([xG],zd,"isTouchDevice",1);var wG=zd,Pw=class extends Ct{onclick(e,t){this._register(at(e,mr.CLICK,n=>t(new Em(Ls(e),n))))}onmousedown(e,t){this._register(at(e,mr.MOUSE_DOWN,n=>t(new Em(Ls(e),n))))}onmouseover(e,t){this._register(at(e,mr.MOUSE_OVER,n=>t(new Em(Ls(e),n))))}onmouseleave(e,t){this._register(at(e,mr.MOUSE_LEAVE,n=>t(new Em(Ls(e),n))))}onkeydown(e,t){this._register(at(e,mr.KEY_DOWN,n=>t(new lR(n))))}onkeyup(e,t){this._register(at(e,mr.KEY_UP,n=>t(new lR(n))))}oninput(e,t){this._register(at(e,mr.INPUT,t))}onblur(e,t){this._register(at(e,mr.BLUR,t))}onfocus(e,t){this._register(at(e,mr.FOCUS,t))}onchange(e,t){this._register(at(e,mr.CHANGE,t))}ignoreGesture(e){return wG.ignoreTarget(e)}},mR=11,SG=class extends Pw{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=mR+"px",this.domNode.style.height=mR+"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 YD),this._register(hR(this.bgDomNode,mr.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(hR(this.domNode,mr.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new bG),this._pointerdownScheduleRepeatTimer=this._register(new Lw)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ls(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()}},CG=class yx{constructor(t,n,r,i,o,l,c){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,i=i|0,o=o|0,l=l|0,c=c|0),this.rawScrollLeft=i,this.rawScrollTop=c,n<0&&(n=0),i+n>r&&(i=r-n),i<0&&(i=0),o<0&&(o=0),c+o>l&&(c=l-o),c<0&&(c=0),this.width=n,this.scrollWidth=r,this.scrollLeft=i,this.height=o,this.scrollHeight=l,this.scrollTop=c}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 yx(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 yx(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,i=this.scrollWidth!==t.scrollWidth,o=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,c=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:i,scrollLeftChanged:o,heightChanged:l,scrollHeightChanged:c,scrollTopChanged:h}}},kG=class extends Ct{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 CG(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 gR(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=gR.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)))}},pR=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function O_(e,t){let n=t-e;return function(r){return e+n*TG(r)}}function EG(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var gR=class xx{constructor(t,n,r,i){this.from=t,this.to=n,this.duration=i,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 i,o;return t<n?(i=t+.75*r,o=n-.75*r):(i=t-.75*r,o=n+.75*r),EG(O_(t,i),O_(o,n),.33)}return O_(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),i=this.scrollTop(n);return new pR(r,i,!1)}return new pR(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return xx.start(t,n,r)}static start(t,n,r){r=r+10;let i=Date.now()-10;return new xx(t,n,i,r)}};function RG(e){return Math.pow(e,3)}function TG(e){return 1-RG(1-e)}var NG=class extends Ct{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 Lw)}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":"")))}},MG=140,XD=class extends Pw{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 NG(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new YD),this._shouldRender=!0,this.domNode=Qd(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(at(this.domNode.domNode,mr.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new SG(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Qd(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(at(this.slider.domNode,mr.POINTER_DOWN,i=>{i.button===0&&(i.preventDefault(),this._sliderPointerDown(i))})),this.onclick(this.slider.domNode,i=>{i.leftButton&&i.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(),i=this._sliderPointerPosition(e);n<=i&&i<=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 i=_G(this.domNode.domNode);t=e.pageX-i.left,n=e.pageY-i.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,i=>{let o=this._sliderOrthogonalPointerPosition(i),l=Math.abs(o-n);if(WD&&l>MG){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let c=this._sliderPointerPosition(i)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c))},()=>{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()}},ZD=class wx{constructor(t,n,r,i,o,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=i,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 wx(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,i,o){let l=Math.max(0,r-t),c=Math.max(0,l-2*n),h=i>0&&i>r;if(!h)return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(c),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*c/i))),g=(c-d)/(i-r),p=o*g;return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(d),computedSliderRatio:g,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let t=wx._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)}},jG=class extends XD{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ZD(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.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}},AG=class extends XD{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ZD(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.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}},DG=500,vR=50,OG=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},Sx=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,i=this._rear;do{let o=i===this._front?t:Math.pow(2,-r);if(t-=o,n+=this._memory[i].score*o,i===this._front)break;i=(this._capacity+i-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(Dw){let n=Ls(t.browserEvent),r=WK(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 i=null,o=new OG(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(i=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,i)}_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 i=Math.abs(t.deltaX),o=Math.abs(t.deltaY),l=Math.abs(n.deltaX),c=Math.abs(n.deltaY),h=Math.max(Math.min(i,l),1),d=Math.max(Math.min(o,c),1),g=Math.max(i,l),p=Math.max(o,c);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}};Sx.INSTANCE=new Sx;var LG=Sx,zG=class extends Pw{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=IG(t),this._scrollable=n,this._register(this._scrollable.onScroll(i=>{this._onWillScroll.fire(i),this._onDidScroll(i),this._onScroll.fire(i)}));let r={onMouseWheel:i=>this._onMouseWheel(i),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new AG(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new jG(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=Qd(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Qd(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Qd(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,i=>this._onMouseOver(i)),this.onmouseleave(this._listenOnDomNode,i=>this._onMouseLeave(i)),this._hideTimeout=this._register(new Lw),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ml(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,Is&&(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 uR(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ml(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new uR(n))};this._mouseWheelToDispose.push(at(this._listenOnDomNode,mr.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var i;if((i=e.browserEvent)!=null&&i.defaultPrevented)return;let t=LG.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 c=!Is&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||c)&&!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=vR*o,p=h.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(d,p)}if(l){let g=vR*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":"",i=t?" top":"",o=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${i}${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(),DG)}},PG=class extends zG{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 IG(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,Is&&(t.className+=" mac"),t}var Cx=class extends Ct{constructor(e,t,n,r,i,o,l,c){super(),this._bufferService=n,this._optionsService=l,this._renderService=c,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 kG({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>zw(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new PG(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(i.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(jr.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Mn(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Mn(()=>this._styleElement.remove())),this._register(jr.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(`
|
|
566
|
+
`)})),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}};Cx=Pn([Ie(2,qr),Ie(3,Do),Ie(4,jD),Ie(5,_u),Ie(6,Kr),Ie(7,Oo)],Cx);var kx=class extends Ct{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,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(Mn(()=>{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()}};kx=Pn([Ie(1,qr),Ie(2,Do),Ie(3,$h),Ie(4,Oo)],kx);var BG=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)}},Ss={full:0,left:0,center:0,right:0},fa={full:0,left:0,center:0,right:0},yd={full:0,left:0,center:0,right:0},Dp=class extends Ct{constructor(e,t,n,r,i,o,l,c){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=o,this._themeService=l,this._coreBrowserService=c,this._colorZoneStore=new BG,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(Mn(()=>{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);fa.full=this._canvas.width,fa.left=e,fa.center=t,fa.right=e,this._refreshDrawHeightConstants(),yd.full=1,yd.left=1,yd.center=1+fa.left,yd.right=1+fa.left+fa.center}_refreshDrawHeightConstants(){Ss.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);Ss.left=t,Ss.center=t,Ss.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ss.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ss.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ss.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ss.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(yd[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ss[e.position||"full"]/2),fa[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ss[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}))}};Dp=Pn([Ie(2,qr),Ie(3,$h),Ie(4,Oo),Ie(5,Kr),Ie(6,_u),Ie(7,Do)],Dp);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=`
|
|
567
|
+
`,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 rp;(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=""))(rp||(rp={}));var QD;(e=>e.ST=`${ye.ESC}\\`)(QD||(QD={}));var Ex=class{constructor(e,t,n,r,i,o){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,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,i=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"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=i+"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)}}};Ex=Pn([Ie(2,qr),Ie(3,Kr),Ie(4,Bl),Ie(5,Oo)],Ex);var _r=0,yr=0,xr=0,zn=0,bR={css:"#00000000",rgba:0},Jn;(e=>{function t(i,o,l,c){return c!==void 0?`#${ll(i)}${ll(o)}${ll(l)}${ll(c)}`:`#${ll(i)}${ll(o)}${ll(l)}`}e.toCss=t;function n(i,o,l,c=255){return(i<<24|o<<16|l<<8|c)>>>0}e.toRgba=n;function r(i,o,l,c){return{css:e.toCss(i,o,l,c),rgba:e.toRgba(i,o,l,c)}}e.toColor=r})(Jn||(Jn={}));var kn;(e=>{function t(h,d){if(zn=(d.rgba&255)/255,zn===1)return{css:d.css,rgba:d.rgba};let g=d.rgba>>24&255,p=d.rgba>>16&255,b=d.rgba>>8&255,y=h.rgba>>24&255,w=h.rgba>>16&255,S=h.rgba>>8&255;_r=y+Math.round((g-y)*zn),yr=w+Math.round((p-w)*zn),xr=S+Math.round((b-S)*zn);let C=Jn.toCss(_r,yr,xr),k=Jn.toRgba(_r,yr,xr);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=ip.ensureContrastRatio(h.rgba,d.rgba,g);if(p)return Jn.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function i(h){let d=(h.rgba|255)>>>0;return[_r,yr,xr]=ip.toChannels(d),{css:Jn.toCss(_r,yr,xr),rgba:d}}e.opaque=i;function o(h,d){return zn=Math.round(d*255),[_r,yr,xr]=ip.toChannels(h.rgba),{css:Jn.toCss(_r,yr,xr,zn),rgba:Jn.toRgba(_r,yr,xr,zn)}}e.opacity=o;function l(h,d){return zn=h.rgba&255,o(h,zn*d/255)}e.multiplyOpacity=l;function c(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=c})(kn||(kn={}));var An;(e=>{let t,n;try{let i=document.createElement("canvas");i.width=1,i.height=1;let o=i.getContext("2d",{willReadFrequently:!0});o&&(t=o,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return _r=parseInt(i.slice(1,2).repeat(2),16),yr=parseInt(i.slice(2,3).repeat(2),16),xr=parseInt(i.slice(3,4).repeat(2),16),Jn.toColor(_r,yr,xr);case 5:return _r=parseInt(i.slice(1,2).repeat(2),16),yr=parseInt(i.slice(2,3).repeat(2),16),xr=parseInt(i.slice(3,4).repeat(2),16),zn=parseInt(i.slice(4,5).repeat(2),16),Jn.toColor(_r,yr,xr,zn);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let o=i.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 _r=parseInt(o[1]),yr=parseInt(o[2]),xr=parseInt(o[3]),zn=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),Jn.toColor(_r,yr,xr,zn);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=i,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[_r,yr,xr,zn]=t.getImageData(0,0,1,1).data,zn!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Jn.toRgba(_r,yr,xr,zn),css:i}}e.toColor=r})(An||(An={}));var Hr;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,i,o){let l=r/255,c=i/255,h=o/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),g=c<=.03928?c/12.92:Math.pow((c+.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})(Hr||(Hr={}));var ip;(e=>{function t(l,c){if(zn=(c&255)/255,zn===1)return c;let h=c>>24&255,d=c>>16&255,g=c>>8&255,p=l>>24&255,b=l>>16&255,y=l>>8&255;return _r=p+Math.round((h-p)*zn),yr=b+Math.round((d-b)*zn),xr=y+Math.round((g-y)*zn),Jn.toRgba(_r,yr,xr)}e.blend=t;function n(l,c,h){let d=Hr.relativeLuminance(l>>8),g=Hr.relativeLuminance(c>>8);if(vo(d,g)<h){if(g<d){let y=r(l,c,h),w=vo(d,Hr.relativeLuminance(y>>8));if(w<h){let S=i(l,c,h),C=vo(d,Hr.relativeLuminance(S>>8));return w>C?y:S}return y}let p=i(l,c,h),b=vo(d,Hr.relativeLuminance(p>>8));if(b<h){let y=r(l,c,h),w=vo(d,Hr.relativeLuminance(y>>8));return b>w?p:y}return p}}e.ensureContrastRatio=n;function r(l,c,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,b=c>>24&255,y=c>>16&255,w=c>>8&255,S=vo(Hr.relativeLuminance2(b,y,w),Hr.relativeLuminance2(d,g,p));for(;S<h&&(b>0||y>0||w>0);)b-=Math.max(0,Math.ceil(b*.1)),y-=Math.max(0,Math.ceil(y*.1)),w-=Math.max(0,Math.ceil(w*.1)),S=vo(Hr.relativeLuminance2(b,y,w),Hr.relativeLuminance2(d,g,p));return(b<<24|y<<16|w<<8|255)>>>0}e.reduceLuminance=r;function i(l,c,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,b=c>>24&255,y=c>>16&255,w=c>>8&255,S=vo(Hr.relativeLuminance2(b,y,w),Hr.relativeLuminance2(d,g,p));for(;S<h&&(b<255||y<255||w<255);)b=Math.min(255,b+Math.ceil((255-b)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),S=vo(Hr.relativeLuminance2(b,y,w),Hr.relativeLuminance2(d,g,p));return(b<<24|y<<16|w<<8|255)>>>0}e.increaseLuminance=i;function o(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=o})(ip||(ip={}));function ll(e){let t=e.toString(16);return t.length<2?"0"+t:t}function vo(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var FG=class extends Hh{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()]}},Op=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Gi}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),i=0,o=0,l=0,c=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!==c||this._workCell.bg!==h){if(d-i>1){let g=this._getJoinedRanges(r,l,o,t,i);for(let p=0;p<g.length;p++)n.push(g[p])}i=d,l=o,c=this._workCell.fg,h=this._workCell.bg}o+=this._workCell.getChars().length||Sa.length}if(this._bufferService.cols-i>1){let d=this._getJoinedRanges(r,l,o,t,i);for(let g=0;g<d.length;g++)n.push(d[g])}return n}_getJoinedRanges(e,t,n,r,i){let o=e.substring(t,n),l=[];try{l=this._characterJoiners[0].handler(o)}catch(c){console.error(c)}for(let c=1;c<this._characterJoiners.length;c++)try{let h=this._characterJoiners[c].handler(o);for(let d=0;d<h.length;d++)Op._mergeRanges(l,h[d])}catch(h){console.error(h)}return this._stringRangesToCellRanges(l,r,i),l}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,o=0,l=e[r];if(l){for(let c=n;c<this._bufferService.cols;c++){let h=t.getWidth(c),d=t.getString(c).length||Sa.length;if(h!==0){if(!i&&l[0]<=o&&(l[0]=c,i=!0),l[1]<=o){if(l[1]=c,l=e[++r],!l)break;l[0]<=o?(l[0]=c,i=!0):i=!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 i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};Op=Pn([Ie(0,qr)],Op);function HG(e){return 57508<=e&&e<=57558}function $G(e){return 9472<=e&&e<=9631}function UG(e){return HG(e)||$G(e)}function VG(){return{css:{canvas:Rm(),cell:Rm()},device:{canvas:Rm(),cell:Rm(),char:{width:0,height:0,left:0,top:0}}}}function Rm(){return{width:0,height:0}}var Rx=class{constructor(e,t,n,r,i,o,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=o,this._themeService=l,this._workCell=new Gi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,o,l,c,h,d,g){let p=[],b=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,N=0,L=0,A=!1,O=0,H=!1,Z=0,I=0,q=[],F=d!==-1&&g!==-1;for(let $=0;$<w;$++){e.loadCell($,this._workCell);let W=this._workCell.getWidth();if(W===0)continue;let K=!1,D=$>=I,U=$,z=this._workCell;if(b.length>0&&$===b[0][0]&&D){let je=b.shift(),Qe=this._isCellInSelection(je[0],t);for(R=je[0]+1;R<je[1];R++)D&&(D=Qe===this._isCellInSelection(R,t));D&&(D=!n||o<je[0]||o>=je[1]),D?(K=!0,z=new FG(this._workCell,e.translateToString(!0,je[0],je[1]),je[1]-je[0]),U=je[1]-1,W=z.getWidth()):I=je[1]}let G=this._isCellInSelection($,t),M=n&&$===o,B=F&&$>=d&&$<=g,X=!1;this._decorationService.forEachDecorationAtCell($,t,void 0,je=>{X=!0});let j=z.getChars()||Sa;if(j===" "&&(z.isUnderline()||z.isOverline())&&(j=" "),Z=W*c-h.get(j,z.isBold(),z.isItalic()),!S)S=this._document.createElement("span");else if(C&&(G&&H||!G&&!H&&z.bg===E)&&(G&&H&&y.selectionForeground||z.fg===N)&&z.extended.ext===L&&B===A&&Z===O&&!M&&!K&&!X&&D){z.isInvisible()?k+=Sa:k+=j,C++;continue}else C&&(S.textContent=k),S=this._document.createElement("span"),C=0,k="";if(E=z.bg,N=z.fg,L=z.extended.ext,A=B,O=Z,H=G,K&&o>=$&&o<=U&&(o=$),!this._coreService.isCursorHidden&&M&&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(i)switch(i){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(z.isBold()&&q.push("xterm-bold"),z.isItalic()&&q.push("xterm-italic"),z.isDim()&&q.push("xterm-dim"),z.isInvisible()?k=Sa:k=z.getChars()||Sa,z.isUnderline()&&(q.push(`xterm-underline-${z.extended.underlineStyle}`),k===" "&&(k=" "),!z.isUnderlineColorDefault()))if(z.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${Hh.toColorRGB(z.getUnderlineColor()).join(",")})`;else{let je=z.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&z.isBold()&&je<8&&(je+=8),S.style.textDecorationColor=y.ansi[je].css}z.isOverline()&&(q.push("xterm-overline"),k===" "&&(k=" ")),z.isStrikethrough()&&q.push("xterm-strikethrough"),B&&(S.style.textDecoration="underline");let ie=z.getFgColor(),J=z.getFgColorMode(),ee=z.getBgColor(),re=z.getBgColorMode(),ue=!!z.isInverse();if(ue){let je=ie;ie=ee,ee=je;let Qe=J;J=re,re=Qe}let fe,ge,Ce=!1;this._decorationService.forEachDecorationAtCell($,t,void 0,je=>{je.options.layer!=="top"&&Ce||(je.backgroundColorRGB&&(re=50331648,ee=je.backgroundColorRGB.rgba>>8&16777215,fe=je.backgroundColorRGB),je.foregroundColorRGB&&(J=50331648,ie=je.foregroundColorRGB.rgba>>8&16777215,ge=je.foregroundColorRGB),Ce=je.options.layer==="top")}),!Ce&&G&&(fe=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,ee=fe.rgba>>8&16777215,re=50331648,Ce=!0,y.selectionForeground&&(J=50331648,ie=y.selectionForeground.rgba>>8&16777215,ge=y.selectionForeground)),Ce&&q.push("xterm-decoration-top");let Re;switch(re){case 16777216:case 33554432:Re=y.ansi[ee],q.push(`xterm-bg-${ee}`);break;case 50331648:Re=Jn.toColor(ee>>16,ee>>8&255,ee&255),this._addStyle(S,`background-color:#${_R((ee>>>0).toString(16),"0",6)}`);break;case 0:default:ue?(Re=y.foreground,q.push("xterm-bg-257")):Re=y.background}switch(fe||z.isDim()&&(fe=kn.multiplyOpacity(Re,.5)),J){case 16777216:case 33554432:z.isBold()&&ie<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ie+=8),this._applyMinimumContrast(S,Re,y.ansi[ie],z,fe,void 0)||q.push(`xterm-fg-${ie}`);break;case 50331648:let je=Jn.toColor(ie>>16&255,ie>>8&255,ie&255);this._applyMinimumContrast(S,Re,je,z,fe,ge)||this._addStyle(S,`color:#${_R(ie.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(S,Re,y.foreground,z,fe,ge)||ue&&q.push("xterm-fg-257")}q.length&&(S.className=q.join(" "),q.length=0),!M&&!K&&!X&&D?C++:S.textContent=k,Z!==this.defaultSpacing&&(S.style.letterSpacing=`${Z}px`),p.push(S),$=U}return S&&C&&(S.textContent=k),p}_applyMinimumContrast(e,t,n,r,i,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||UG(r.getCode()))return!1;let l=this._getContrastCache(r),c;if(!i&&!o&&(c=l.getColor(t.rgba,n.rgba)),c===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);c=kn.ensureContrastRatio(i||t,o||n,h),l.setColor((i||t).rgba,(o||n).rgba,c??null)}return c?(this._addStyle(e,`color:${c.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]}};Rx=Pn([Ie(1,OD),Ie(2,Kr),Ie(3,Do),Ie(4,Bl),Ie(5,$h),Ie(6,_u)],Rx);function _R(e,t,n){for(;e.length<n;)e=t+e;return e}var WG=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 i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.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,i,o],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),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 i=e;t&&(i+="B"),n&&(i+="I");let o=this._holey.get(i);if(o===void 0){let l=0;t&&(l|=1),n&&(l|=2),o=this._measure(e,l),o>0&&this._holey.set(i,o)}return o}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},qG=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 i=e.buffers.active.ydisp,o=t[1]-i,l=n[1]-i,c=Math.max(o,0),h=Math.min(l,e.rows-1);if(c>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=o,this.viewportEndRow=l,this.viewportCappedStartRow=c,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 KG(){return new qG}var L_="xterm-dom-renderer-owner-",zi="xterm-rows",Tm="xterm-fg-",yR="xterm-bg-",xd="xterm-focus",Nm="xterm-selection",GG=1,Tx=class extends Ct{constructor(e,t,n,r,i,o,l,c,h,d,g,p,b,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=o,this._linkifier2=l,this._charSizeService=h,this._optionsService=d,this._bufferService=g,this._coreService=p,this._coreBrowserService=b,this._themeService=y,this._terminalClass=GG++,this._rowElements=[],this._selectionRenderModel=KG(),this.onRequestRedraw=this._register(new Me).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(zi),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(Nm),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=VG(),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=c.createInstance(Rx,document),this._element.classList.add(L_+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(Mn(()=>{this._element.classList.remove(L_+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new WG(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} .${zi} 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} .${zi} { 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} .${zi} .xterm-dim { color: ${kn.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}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${zi}.${xd} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${zi}.${xd} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${zi}.${xd} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Nm} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Nm} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Nm} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,l]of e.ansi.entries())t+=`${this._terminalSelector} .${Tm}${o} { color: ${l.css}; }${this._terminalSelector} .${Tm}${o}.xterm-dim { color: ${kn.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${yR}${o} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${Tm}257 { color: ${kn.opaque(e.background).css}; }${this._terminalSelector} .${Tm}257.xterm-dim { color: ${kn.multiplyOpacity(kn.opaque(e.background),.5).css}; }${this._terminalSelector} .${yR}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(xd),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(xd),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,i=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,c=this._document.createDocumentFragment();if(n){let h=e[0]>t[0];c.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===i?t[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(o,h,d));let g=l-o-1;if(c.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,g)),o!==l){let p=i===l?t[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(l,0,p))}}this._selectionContainer.appendChild(c)}_createSelectionElement(e,t,n,r=1){let i=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),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${o}px`,i.style.width=`${l}px`,i}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,i=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,c=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,c,i,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L_}${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,i,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),i=Math.min(i,this._bufferService.cols);let c=this._bufferService.buffer,h=c.ybase+c.y,d=Math.min(c.x,i-1),g=this._optionsService.rawOptions.cursorBlink,p=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=r;++y){let w=y+c.ydisp,S=this._rowElements[y],C=c.lines.get(w);if(!S||!C)break;S.replaceChildren(...this._rowFactory.createRow(C,w,w===h,p,b,d,g,this.dimensions.css.cell.width,this._widthCache,o?y===n?e:0:-1,o?(y===r?t:i)-1:-1))}}};Tx=Pn([Ie(7,Mw),Ie(8,Lg),Ie(9,Kr),Ie(10,qr),Ie(11,Bl),Ie(12,Do),Ie(13,_u)],Tx);var Nx=class extends Ct{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 XG(this._optionsService))}catch{this._measureStrategy=this._register(new YG(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())}};Nx=Pn([Ie(2,Kr)],Nx);var JD=class extends Ct{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)}},YG=class extends JD{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}},XG=class extends JD{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}},ZG=class extends Ct{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 QG(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(jr.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(at(this._textarea,"focus",()=>this._isFocused=!0)),this._register(at(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}},QG=class extends Ct{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new tu),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(Mn(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=at(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)}},JG=class extends Ct{constructor(){super(),this.linkProviders=[],this._register(Mn(()=>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 Iw(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),o=parseInt(i.getPropertyValue("padding-left")),l=parseInt(i.getPropertyValue("padding-top"));return[t.clientX-r.left-o,t.clientY-r.top-l]}function eY(e,t,n,r,i,o,l,c,h){if(!o)return;let d=Iw(e,t,n);if(d)return d[0]=Math.ceil((d[0]+(h?l/2:0))/l),d[1]=Math.ceil(d[1]/c),d[0]=Math.min(Math.max(d[0],1),r+(h?1:0)),d[1]=Math.min(Math.max(d[1],1),i),d}var Mx=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return eY(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=Iw(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])}}};Mx=Pn([Ie(0,Oo),Ie(1,Lg)],Mx);var tY=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=[]}},e4={};dK(e4,{getSafariVersion:()=>rY,isChromeOS:()=>i4,isFirefox:()=>t4,isIpad:()=>iY,isIphone:()=>sY,isLegacyEdge:()=>nY,isLinux:()=>Bw,isMac:()=>Lp,isNode:()=>zg,isSafari:()=>n4,isWindows:()=>r4});var zg=typeof process<"u"&&"title"in process,Uh=zg?"node":navigator.userAgent,Vh=zg?"node":navigator.platform,t4=Uh.includes("Firefox"),nY=Uh.includes("Edge"),n4=/^((?!chrome|android).)*safari/i.test(Uh);function rY(){if(!n4)return 0;let e=Uh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Lp=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Vh),iY=Vh==="iPad",sY=Vh==="iPhone",r4=["Windows","Win16","Win32","WinCE"].includes(Vh),Bw=Vh.indexOf("Linux")>=0,i4=/\bCrOS\b/.test(Uh),s4=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(),i=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),i=e.timeRemaining(),n*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},oY=class extends s4{_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())}}},aY=class extends s4{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},zp=!zg&&"requestIdleCallback"in window?aY:oY,lY=class{constructor(){this._queue=new zp}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},jx=class extends Ct{constructor(e,t,n,r,i,o,l,c,h){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=c,this._renderer=this._register(new tu),this._pausedResizeTask=new lY,this._observerDisposable=this._register(new tu),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 tY((d,g)=>this._renderRows(d,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new cY(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Mn(()=>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=Mn(()=>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()}};jx=Pn([Ie(2,Kr),Ie(3,Lg),Ie(4,Bl),Ie(5,$h),Ie(6,qr),Ie(7,Do),Ie(8,_u)],jx);var cY=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 uY(e,t,n,r){let i=n.buffer.x,o=n.buffer.y;if(!n.buffer.hasScrollback)return fY(i,o,e,t,n,r)+Pg(o,t,n,r)+mY(i,o,e,t,n,r);let l;if(o===t)return l=i>e?"D":"C",gh(Math.abs(i-e),ph(l,r));l=o>t?"D":"C";let c=Math.abs(o-t),h=hY(o>t?e:i,n)+(c-1)*n.cols+1+dY(o>t?i:e);return gh(h,ph(l,r))}function dY(e,t){return e-1}function hY(e,t){return t.cols-e}function fY(e,t,n,r,i,o){return Pg(t,r,i,o).length===0?"":gh(a4(e,t,e,t-jl(t,i),!1,i).length,ph("D",o))}function Pg(e,t,n,r){let i=e-jl(e,n),o=t-jl(t,n),l=Math.abs(i-o)-pY(e,t,n);return gh(l,ph(o4(e,t),r))}function mY(e,t,n,r,i,o){let l;Pg(t,r,i,o).length>0?l=r-jl(r,i):l=t;let c=r,h=gY(e,t,n,r,i,o);return gh(a4(e,l,n,c,h==="C",i).length,ph(h,o))}function pY(e,t,n){var l;let r=0,i=e-jl(e,n),o=t-jl(t,n);for(let c=0;c<Math.abs(i-o);c++){let h=o4(e,t)==="A"?-1:1;(l=n.buffer.lines.get(i+h*c))!=null&&l.isWrapped&&r++}return r}function jl(e,t){let n=0,r=t.buffer.lines.get(e),i=r==null?void 0:r.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r==null?void 0:r.isWrapped;return n}function gY(e,t,n,r,i,o){let l;return Pg(n,r,i,o).length>0?l=r-jl(r,i):l=t,e<n&&l<=r||e>=n&&l<r?"C":"D"}function o4(e,t){return e>t?"A":"B"}function a4(e,t,n,r,i,o){let l=e,c=t,h="";for(;(l!==n||c!==r)&&c>=0&&c<o.buffer.lines.length;)l+=i?1:-1,i&&l>o.cols-1?(h+=o.buffer.translateBufferLineToString(c,!1,e,l),l=0,e=0,c++):!i&&l<0&&(h+=o.buffer.translateBufferLineToString(c,!1,0,e+1),l=o.cols-1,e=l,c--);return h+o.buffer.translateBufferLineToString(c,!1,e,l)}function ph(e,t){let n=t?"O":"[";return ye.ESC+n+e}function gh(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var vY=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 xR(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 z_=50,bY=15,_Y=50,yY=500,xY=" ",wY=new RegExp(xY,"g"),Ax=class extends Ct{constructor(e,t,n,r,i,o,l,c,h){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=o,this._optionsService=l,this._renderService=c,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Gi,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 vY(this._bufferService),this._activeSelectionMode=0,this._register(Mn(()=>{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 i=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 c=n.translateBufferLineToString(l,!0,i,o);r.push(c)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let o=e[1]+1;o<=t[1]-1;o++){let l=n.lines.get(o),c=n.translateBufferLineToString(o,!0);l!=null&&l.isWrapped?r[r.length-1]+=c:r.push(c)}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(i=>i.replace(wY," ")).join(r4?`\r
|
|
568
|
+
`:`
|
|
569
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Bw&&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 i,o;let n=(o=(i=this._linkifier.currentLink)==null?void 0:i.link)==null?void 0:o.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=xR(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=Iw(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,-z_),z_),t/=z_,t/Math.abs(t)+Math.round(t*(bY-1)))}shouldForceSelection(e){return Lp?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(),_Y)}_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&&!(Lp&&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<yY&&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=uY(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 i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-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 i=this._bufferService.buffer,o=i.lines.get(e[1]);if(!o)return;let l=i.translateBufferLineToString(e[1],!1),c=this._convertViewportColToCharacterIndex(o,e[0]),h=c,d=e[0]-c,g=0,p=0,b=0,y=0;if(l.charAt(c)===" "){for(;c>0&&l.charAt(c-1)===" ";)c--;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&&c>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&&(b+=E-1,c-=E-1),c--,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=c+d-g+b,S=Math.min(this._bufferService.cols,h-c+g+p-b-y);if(!(!t&&l.slice(c,h).trim()==="")){if(n&&w===0&&o.getCodePoint(0)!==32){let C=i.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=i.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=xR(n,this._bufferService.cols)}};Ax=Pn([Ie(3,qr),Ie(4,Bl),Ie(5,jw),Ie(6,Kr),Ie(7,Oo),Ie(8,Do)],Ax);var wR=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={}}},SR=class{constructor(){this._color=new wR,this._css=new wR}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()}},sr=Object.freeze((()=>{let e=[An.toColor("#2e3436"),An.toColor("#cc0000"),An.toColor("#4e9a06"),An.toColor("#c4a000"),An.toColor("#3465a4"),An.toColor("#75507b"),An.toColor("#06989a"),An.toColor("#d3d7cf"),An.toColor("#555753"),An.toColor("#ef2929"),An.toColor("#8ae234"),An.toColor("#fce94f"),An.toColor("#729fcf"),An.toColor("#ad7fa8"),An.toColor("#34e2e2"),An.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],o=t[n%6];e.push({css:Jn.toCss(r,i,o),rgba:Jn.toRgba(r,i,o)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Jn.toCss(r,r,r),rgba:Jn.toRgba(r,r,r)})}return e})()),ul=An.toColor("#ffffff"),Pd=An.toColor("#000000"),CR=An.toColor("#ffffff"),kR=Pd,wd={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},SY=ul,Dx=class extends Ct{constructor(e){super(),this._optionsService=e,this._contrastCache=new SR,this._halfContrastCache=new SR,this._onChangeColors=this._register(new Me),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ul,background:Pd,cursor:CR,cursorAccent:kR,selectionForeground:void 0,selectionBackgroundTransparent:wd,selectionBackgroundOpaque:kn.blend(Pd,wd),selectionInactiveBackgroundTransparent:wd,selectionInactiveBackgroundOpaque:kn.blend(Pd,wd),scrollbarSliderBackground:kn.opacity(ul,.2),scrollbarSliderHoverBackground:kn.opacity(ul,.4),scrollbarSliderActiveBackground:kn.opacity(ul,.5),overviewRulerBorder:ul,ansi:sr.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=ln(e.foreground,ul),t.background=ln(e.background,Pd),t.cursor=kn.blend(t.background,ln(e.cursor,CR)),t.cursorAccent=kn.blend(t.background,ln(e.cursorAccent,kR)),t.selectionBackgroundTransparent=ln(e.selectionBackground,wd),t.selectionBackgroundOpaque=kn.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=ln(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=kn.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?ln(e.selectionForeground,bR):void 0,t.selectionForeground===bR&&(t.selectionForeground=void 0),kn.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=kn.opacity(t.selectionBackgroundTransparent,.3)),kn.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=kn.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=ln(e.scrollbarSliderBackground,kn.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=ln(e.scrollbarSliderHoverBackground,kn.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=ln(e.scrollbarSliderActiveBackground,kn.opacity(t.foreground,.5)),t.overviewRulerBorder=ln(e.overviewRulerBorder,SY),t.ansi=sr.slice(),t.ansi[0]=ln(e.black,sr[0]),t.ansi[1]=ln(e.red,sr[1]),t.ansi[2]=ln(e.green,sr[2]),t.ansi[3]=ln(e.yellow,sr[3]),t.ansi[4]=ln(e.blue,sr[4]),t.ansi[5]=ln(e.magenta,sr[5]),t.ansi[6]=ln(e.cyan,sr[6]),t.ansi[7]=ln(e.white,sr[7]),t.ansi[8]=ln(e.brightBlack,sr[8]),t.ansi[9]=ln(e.brightRed,sr[9]),t.ansi[10]=ln(e.brightGreen,sr[10]),t.ansi[11]=ln(e.brightYellow,sr[11]),t.ansi[12]=ln(e.brightBlue,sr[12]),t.ansi[13]=ln(e.brightMagenta,sr[13]),t.ansi[14]=ln(e.brightCyan,sr[14]),t.ansi[15]=ln(e.brightWhite,sr[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]=ln(e.extendedAnsi[r],sr[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()}}};Dx=Pn([Ie(0,Kr)],Dx);function ln(e,t){if(e!==void 0)try{return An.toColor(e)}catch{}return t}var CY=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)}},kY=class{constructor(){this._services=new CY,this._services.set(Mw,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=bK(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 i=n.length>0?n[0].index:t.length;if(t.length!==i)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},EY={trace:0,debug:1,info:2,warn:3,error:4,off:5},RY="xterm.js: ",Ox=class extends Ct{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=EY[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?"":RY)+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)}};Ox=Pn([Ie(0,Kr)],Ox);var ER=class extends Ct{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 i=t-1;i>=0;i--)this.set(e+i+n,this.get(e+i));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}},xt=3,Zn=Object.freeze(new Hh),Mm=0,P_=2,Id=class l4{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*xt);let i=n||Gi.fromCharData([0,RD,1,0]);for(let o=0;o<t;++o)this.setCell(o,i);this.length=t}get(t){let n=this._data[t*xt+0],r=n&2097151;return[this._data[t*xt+1],n&2097152?this._combined[t]:r?_a(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*xt+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*xt+0]=t|2097152|n[2]<<22):this._data[t*xt+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*xt+0]>>22}hasWidth(t){return this._data[t*xt+0]&12582912}getFg(t){return this._data[t*xt+1]}getBg(t){return this._data[t*xt+2]}hasContent(t){return this._data[t*xt+0]&4194303}getCodePoint(t){let n=this._data[t*xt+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*xt+0]&2097152}getString(t){let n=this._data[t*xt+0];return n&2097152?this._combined[t]:n&2097151?_a(n&2097151):""}isProtected(t){return this._data[t*xt+2]&536870912}loadCell(t,n){return Mm=t*xt,n.content=this._data[Mm+0],n.fg=this._data[Mm+1],n.bg=this._data[Mm+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*xt+0]=n.content,this._data[t*xt+1]=n.fg,this._data[t*xt+2]=n.bg}setCellFromCodepoint(t,n,r,i){i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*xt+0]=n|r<<22,this._data[t*xt+1]=i.fg,this._data[t*xt+2]=i.bg}addCodepointToCell(t,n,r){let i=this._data[t*xt+0];i&2097152?this._combined[t]+=_a(n):i&2097151?(this._combined[t]=_a(i&2097151)+_a(n),i&=-2097152,i|=2097152):i=n|1<<22,r&&(i&=-12582913,i|=r<<22),this._data[t*xt+0]=i}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 i=new Gi;for(let o=this.length-t-n-1;o>=0;--o)this.setCell(t+n+o,this.loadCell(t+o,i));for(let o=0;o<n;++o)this.setCell(t+o,r)}else for(let i=t;i<this.length;++i)this.setCell(i,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 i=new Gi;for(let o=0;o<this.length-t-n;++o)this.setCell(t+o,this.loadCell(t+n+o,i));for(let o=this.length-n;o<this.length;++o)this.setCell(o,r)}else for(let i=t;i<this.length;++i)this.setCell(i,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,i=!1){if(i){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*P_<this._data.buffer.byteLength;let r=t*xt;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let i=new Uint32Array(r);i.set(this._data),this._data=i}for(let i=this.length;i<t;++i)this.setCell(i,n)}else{this._data=this._data.subarray(0,r);let i=Object.keys(this._combined);for(let l=0;l<i.length;l++){let c=parseInt(i[l],10);c>=t&&delete this._combined[c]}let o=Object.keys(this._extendedAttrs);for(let l=0;l<o.length;l++){let c=parseInt(o[l],10);c>=t&&delete this._extendedAttrs[c]}}return this.length=t,r*4*P_<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*P_<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 l4(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*xt+0]&4194303)return t+(this._data[t*xt+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*xt+0]&4194303||this._data[t*xt+2]&50331648)return t+(this._data[t*xt+0]>>22);return 0}copyCellsFrom(t,n,r,i,o){let l=t._data;if(o)for(let h=i-1;h>=0;h--){for(let d=0;d<xt;d++)this._data[(r+h)*xt+d]=l[(n+h)*xt+d];l[(n+h)*xt+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}else for(let h=0;h<i;h++){for(let d=0;d<xt;d++)this._data[(r+h)*xt+d]=l[(n+h)*xt+d];l[(n+h)*xt+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}let c=Object.keys(t._combined);for(let h=0;h<c.length;h++){let d=parseInt(c[h],10);d>=n&&(this._combined[d-n+r]=t._combined[d])}}translateToString(t,n,r,i){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),i&&(i.length=0);let o="";for(;n<r;){let l=this._data[n*xt+0],c=l&2097151,h=l&2097152?this._combined[n]:c?_a(c):Sa;if(o+=h,i)for(let d=0;d<h.length;++d)i.push(n);n+=l>>22||1}return i&&i.push(n),o}};function TY(e,t,n,r,i,o){let l=[];for(let c=0;c<e.length-1;c++){let h=c,d=e.get(++h);if(!d.isWrapped)continue;let g=[e.get(c)];for(;h<e.length&&d.isWrapped;)g.push(d),d=e.get(++h);if(!o&&r>=c&&r<h){c+=g.length-1;continue}let p=0,b=vh(g,p,t),y=1,w=0;for(;y<g.length;){let C=vh(g,y,t),k=C-w,R=n-b,E=Math.min(k,R);g[p].copyCellsFrom(g[y],w,b,E,!1),b+=E,b===n&&(p++,b=0),w+=E,w===C&&(y++,w=0),b===0&&p!==0&&g[p-1].getWidth(n-1)===2&&(g[p].copyCellsFrom(g[p-1],n-1,b++,1,!1),g[p-1].setCell(n-1,i))}g[p].replaceCells(b,n,i);let S=0;for(let C=g.length-1;C>0&&(C>p||g[C].getTrimmedLength()===0);C--)S++;S>0&&(l.push(c+g.length-S),l.push(S)),c+=g.length-1}return l}function NY(e,t){let n=[],r=0,i=t[r],o=0;for(let l=0;l<e.length;l++)if(i===l){let c=t[++r];e.onDeleteEmitter.fire({index:l-o,amount:c}),l+=c-1,o+=c,i=t[++r]}else n.push(l);return{layout:n,countRemoved:o}}function MY(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 jY(e,t,n){let r=[],i=e.map((h,d)=>vh(e,d,t)).reduce((h,d)=>h+d),o=0,l=0,c=0;for(;c<i;){if(i-c<n){r.push(i-c);break}o+=n;let h=vh(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),c+=g}return r}function vh(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,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var c4=class u4{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=u4._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(),Ml(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};c4._nextId=1;var AY=c4,ur={},dl=ur.B;ur[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ur.A={"#":"£"};ur.B=void 0;ur[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ur.C=ur[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ur.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ur.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ur.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ur.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ur.E=ur[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ur.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ur.H=ur[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ur["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var RR=4294967295,TR=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=dl,this.markers=[],this._nullCell=Gi.fromCharData([0,RD,1,0]),this._whitespaceCell=Gi.fromCharData([0,Sa,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new zp,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new ER(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 Ap),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 Ap),this._whitespaceCell}getBlankLine(e,t){return new Id(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>RR?RR: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 ER(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Zn),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),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 Id(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 Id(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(i<this.lines.maxLength){let l=this.lines.length-i;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=i}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=TY(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Zn),n);if(r.length>0){let i=NY(this.lines,r);MY(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(Zn),i=n;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Id(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),i=[],o=0;for(let l=this.lines.length-1;l>=0;l--){let c=this.lines.get(l);if(!c||!c.isWrapped&&c.getTrimmedLength()<=e)continue;let h=[c];for(;c.isWrapped&&l>0;)c=this.lines.get(--l),h.unshift(c);if(!n){let E=this.ybase+this.y;if(E>=l&&E<l+h.length)continue}let d=h[h.length-1].getTrimmedLength(),g=jY(h,this._cols,e),p=g.length-h.length,b;this.ybase===0&&this.y!==this.lines.length-1?b=Math.max(0,this.y-this.lines.maxLength+p):b=Math.max(0,this.lines.length-this.lines.maxLength+p);let y=[];for(let E=0;E<p;E++){let N=this.getBlankLine(Zn,!0);y.push(N)}y.length>0&&(i.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 N=Math.max(C,0);k=vh(h,N,this._cols)}}for(let E=0;E<h.length;E++)g[E]<e&&h[E].setCell(g[E],r);let R=p-b;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(i.length>0){let l=[],c=[];for(let S=0;S<this.lines.length;S++)c.push(this.lines.get(S));let h=this.lines.length,d=h-1,g=0,p=i[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let b=0;for(let S=Math.min(this.lines.maxLength-1,h+o-1);S>=0;S--)if(p&&p.start>d+b){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}),b+=p.newLines.length,p=i[++g]}else this.lines.set(S,c[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 i=this.lines.get(e);return i?i.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 AY(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)}},DY=class extends Ct{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 TR(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new TR(!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)}},d4=2,h4=1,Lx=class extends Ct{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,d4),this.rows=Math.max(e.rawOptions.rows||0,h4),this.buffers=this._register(new DY(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 i=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-i+1;n.lines.shiftElements(i+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))}};Lx=Pn([Ie(0,Kr)],Lx);var Nc={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:Lp,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},OY=["normal","bold","100","200","300","400","500","600","700","800","900"],LY=class extends Ct{constructor(e){super(),this._onOptionChange=this._register(new Me),this.onOptionChange=this._onOptionChange.event;let t={...Nc};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(Mn(()=>{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 Nc))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in Nc))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=Nc[e]),!zY(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Nc[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=OY.includes(t)?t:Nc[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 zY(e){return e==="block"||e==="underline"||e==="bar"}function Bd(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]&&Bd(e[r],t-1);return n}var NR=Object.freeze({insertMode:!1}),MR=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),zx=class extends Ct{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=Bd(NR),this.decPrivateModes=Bd(MR)}reset(){this.modes=Bd(NR),this.decPrivateModes=Bd(MR)}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))}};zx=Pn([Ie(0,qr),Ie(1,AD),Ie(2,Kr)],zx);var jR={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 I_(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 B_=String.fromCharCode,AR={DEFAULT:e=>{let t=[I_(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${B_(t[0])}${B_(t[1])}${B_(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${I_(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${I_(e,!0)};${e.x};${e.y}${t}`}},Px=class extends Ct{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(jR))this.addProtocol(r,jR[r]);for(let r of Object.keys(AR))this.addEncoding(r,AR[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,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_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)}};Px=Pn([Ie(0,qr),Ie(1,Bl),Ie(2,Kr)],Px);var F_=[[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]],PY=[[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]],or;function IY(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var BY=class{constructor(){if(this.version="6",!or){or=new Uint8Array(65536),or.fill(1),or[0]=0,or.fill(0,1,32),or.fill(0,127,160),or.fill(2,4352,4448),or[9001]=2,or[9002]=2,or.fill(2,11904,42192),or[12351]=1,or.fill(2,44032,55204),or.fill(2,63744,64256),or.fill(2,65040,65050),or.fill(2,65072,65136),or.fill(2,65280,65377),or.fill(2,65504,65511);for(let e=0;e<F_.length;++e)or.fill(0,F_[e][0],F_[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?or[e]:IY(e,PY)?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 i=bl.extractWidth(t);i===0?r=!1:i>n&&(n=i)}return bl.createPropertyValue(0,n,r)}},bl=class sp{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Me,this.onChange=this._onChange.event;let t=new BY;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,i=t.length;for(let o=0;o<i;++o){let l=t.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=i)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 c=this.charProperties(l,r),h=sp.extractWidth(c);sp.extractShouldJoin(c)&&(h-=sp.extractWidth(r)),n+=h,r=c}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},FY=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 DR(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 Sd=2147483647,HY=256,f4=class Ix{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>HY)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 Ix;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let i=t[r];if(Array.isArray(i))for(let o=0;o<i.length;++o)n.addSubParam(i[o]);else n.addParam(i)}return n}clone(){let t=new Ix(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,i=this._subParamsIdx[n]&255;i-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,i))}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>Sd?Sd: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>Sd?Sd: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,i=this._subParamsIdx[n]&255;i-r>0&&(t[n]=this._subParams.slice(r,i))}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,i=r[n-1];r[n-1]=~i?Math.min(i*10+t,Sd):t}},Cd=[],$Y=class{constructor(){this._state=0,this._active=Cd,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=Cd}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=Cd,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Cd,!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",Og(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,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&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=Cd,this._id=-1,this._state=0}}},vi=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+=Og(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}},kd=[],UY=class{constructor(){this._handlers=Object.create(null),this._active=kd,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=kd}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=kd,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||kd,!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",Og(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,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&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=kd,this._ident=0}},Fd=new f4;Fd.addParam(0);var OR=class{constructor(e){this._handler=e,this._data="",this._params=Fd,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Fd,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Og(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=Fd,this._data="",this._hitLimit=!1,n));return this._params=Fd,this._data="",this._hitLimit=!1,t}},VY=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 i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}},Ui=160,WY=function(){let e=new VY(4095),t=Array.apply(null,Array(256)).map((c,h)=>h),n=(c,h)=>t.slice(c,h),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,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(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,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(i,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(i,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(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,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(i,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(i,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(Ui,0,2,0),e.add(Ui,8,5,8),e.add(Ui,6,0,6),e.add(Ui,11,0,11),e.add(Ui,13,13,13),e}(),qY=class extends Ct{constructor(e=WY){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 f4,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(Mn(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new $Y),this._dcsParser=this._register(new UY),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 i=0;i<e.intermediates.length;++i){let o=e.intermediates.charCodeAt(i);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 i=r.indexOf(t);i!==-1&&r.splice(i,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 i=r.indexOf(t);i!==-1&&r.splice(i,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,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=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 c=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&h>-1){for(;h>=0&&(l=c[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=c[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 c=o;c<t;++c){switch(r=e[c],i=this._transitions.table[this.currentState<<8|(r<160?r:Ui)],i>>4){case 2:for(let b=c+1;;++b){if(b>=t||(r=e[b])<32||r>126&&r<Ui){this._printHandler(e,c,b),c=b-1;break}if(++b>=t||(r=e[b])<32||r>126&&r<Ui){this._printHandler(e,c,b),c=b-1;break}if(++b>=t||(r=e[b])<32||r>126&&r<Ui){this._printHandler(e,c,b),c=b-1;break}if(++b>=t||(r=e[b])<32||r>126&&r<Ui){this._printHandler(e,c,b),c=b-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:c,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,i,c),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(++c<t&&(r=e[c])>47&&r<60);c--;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,i,c),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 b=c+1;;++b)if(b>=t||(r=e[b])===24||r===26||r===27||r>127&&r<Ui){this._dcsParser.put(e,c,b),c=b-1;break}break;case 14:if(l=this._dcsParser.unhook(r!==24&&r!==26),l)return this._preserveStack(6,[],0,i,c),l;r===27&&(i|=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 b=c+1;;b++)if(b>=t||(r=e[b])<32||r>127&&r<Ui){this._oscParser.put(e,c,b),c=b-1;break}break;case 6:if(l=this._oscParser.end(r!==24&&r!==26),l)return this._preserveStack(5,[],0,i,c),l;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=i&15}}},KY=/^([\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})$/,GY=/^[\da-f]+$/;function LR(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=KY.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),GY.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let i=0;i<3;++i){let o=parseInt(t.slice(n*i,n*i+n),16);r[i]=n===1?o<<4:n===2?o:n===3?o>>4:o>>8}return r}}function H_(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 YY(e,t=16){let[n,r,i]=e;return`rgb:${H_(n,t)}/${H_(r,t)}/${H_(i,t)}`}var XY={"(":0,")":1,"*":2,"+":3,"-":1,".":2},ma=131072,zR=10;function PR(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 IR=5e3,BR=0,ZY=class extends Ct{constructor(e,t,n,r,i,o,l,c,h=new qY){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=o,this._coreMouseService=l,this._unicodeService=c,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new gK,this._utf8Decoder=new vK,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 Bx(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(rp.IND,()=>this.index()),this._parser.setExecuteHandler(rp.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(rp.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new vi(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new vi(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new vi(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new vi(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new vi(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new vi(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new vi(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new vi(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new vi(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new vi(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new vi(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new vi(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 ur)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 OR((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"),IR))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${IR} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=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,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>ma&&(o=this._parseStack.position+ma)}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<ma&&(this._parseBuffer=new Uint32Array(Math.min(e.length,ma))),l||this._dirtyRowTracker.clearRange(),e.length>ma)for(let d=o;d<e.length;d+=ma){let g=d+ma<e.length?d+ma: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,i,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,i,d,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let c=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(c,this._bufferService.rows-1)})}print(e,t,n){let r,i,o=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,c=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 b=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,b);i=bl.extractWidth(w);let S=bl.extractShouldJoin(w),C=S?bl.extractWidth(b):0;if(b=w,l&&this._onA11yChar.fire(_a(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-C>c){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 Id&&p.copyCellsFrom(k,R,0,C,!1);R<c;)k.setCellFromCodepoint(R++,0,1,g)}else if(this._activeBuffer.x=c-1,i===2)continue}if(S&&this._activeBuffer.x){let k=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-k,r,i);for(let R=i-C;--R>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(d&&(p.insertCells(this._activeBuffer.x,i-C,this._activeBuffer.getNullCell(g)),p.getWidth(c-1)===2&&p.setCellFromCodepoint(c-1,0,1,g)),p.setCellFromCodepoint(this._activeBuffer.x++,r,i,g),i>0)for(;--i;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=b,this._activeBuffer.x<c&&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=>PR(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new OR(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new vi(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,i=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),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 i=this._activeBuffer.lines.length-this._bufferService.rows;i>0&&(this._activeBuffer.lines.trimStart(i),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-i,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-i,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,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-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=bl.extractWidth(t),i=this._activeBuffer.x-r,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),l=new Uint32Array(o.length*n),c=0;for(let d=0;d<o.length;){let g=o.codePointAt(d)||0;l[c++]=g,d+=g>65535?2:1}let h=c;for(let d=1;d<n;++d)l.copyWithin(h,0,c),h+=c;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,dl),this._charsetService.setgCharset(1,dl),this._charsetService.setgCharset(2,dl),this._charsetService.setgCharset(3,dl);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:i,activeEncoding:o}=this._coreMouseService,l=this._coreService,{buffers:c,cols:h}=this._bufferService,{active:d,alt:g}=c,p=this._optionsService.rawOptions,b=(S,C)=>(l.triggerDataEvent(`${ye.ESC}[${t?"":"?"}${S};${C}$y`),!0),y=S=>S?1:2,w=e.params[0];return t?w===2?b(w,4):w===4?b(w,y(l.modes.insertMode)):w===12?b(w,3):w===20?b(w,y(p.convertEol)):b(w,0):w===1?b(w,y(r.applicationCursorKeys)):w===3?b(w,p.windowOptions.setWinLines?h===80?2:h===132?1:0:0):w===6?b(w,y(r.origin)):w===7?b(w,y(r.wraparound)):w===8?b(w,3):w===9?b(w,y(i==="X10")):w===12?b(w,y(p.cursorBlink)):w===25?b(w,y(!l.isCursorHidden)):w===45?b(w,y(r.reverseWraparound)):w===66?b(w,y(r.applicationKeypad)):w===67?b(w,4):w===1e3?b(w,y(i==="VT200")):w===1002?b(w,y(i==="DRAG")):w===1003?b(w,y(i==="ANY")):w===1004?b(w,y(r.sendFocus)):w===1005?b(w,4):w===1006?b(w,y(o==="SGR")):w===1015?b(w,4):w===1016?b(w,y(o==="SGR_PIXELS")):w===1048?b(w,1):w===47||w===1047||w===1049?b(w,y(d===g)):w===2004?b(w,y(r.bracketedPasteMode)):w===2026?b(w,y(r.synchronizedOutput)):b(w,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=Hh.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,o=0;do{if(r[o+i]=e.params[t+o],e.hasSubParams(t+o)){let l=e.getSubParams(t+o),c=0;do r[1]===5&&(i=1),r[o+c+1+i]=l[c];while(++c<l.length&&c+o+1+i<r.length);break}if(r[1]===5&&o+i>=2||r[1]===2&&o+i>=5)break;r[1]&&(i=1)}while(++o+t<e.length&&o+i<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 i=0;i<t;i++)n=e.params[i],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(i)?e.getSubParams(i)[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?i+=this._extractColor(e,i,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(!PR(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>zR&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>zR&&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(),i=n.shift();if(/^\d+$/.exec(r)){let o=parseInt(r);if(FR(o))if(i==="?")t.push({type:0,index:o});else{let l=LR(i);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,i=n.findIndex(o=>o.startsWith("id="));return i!==-1&&(r=n[i].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 i=LR(n[r]);i&&this._onColor.fire([{type:1,index:this._specialColors[t],color:i}])}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 i=parseInt(n[r]);FR(i)&&t.push({type:2,index:i})}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,dl),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(XY[e[0]],ur[e[1]]||dl),!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 Gi;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,i=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}[i.cursorStyle]-(i.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Bx=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&&(BR=e,e=t,t=BR),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Bx=Pn([Ie(0,qr)],Bx);function FR(e){return 0<=e&&e<256}var QY=5e7,HR=12,JY=50,eX=class extends Ct{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>QY)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],i=this._action(r,t);if(i){let l=c=>performance.now()-n>=HR?setTimeout(()=>this._innerWrite(0,c)):this._innerWrite(n,c);i.catch(c=>(queueMicrotask(()=>{throw c}),Promise.resolve(!1))).then(l);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=HR)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>JY&&(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()}},Fx=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 c=t.addMarker(t.ybase+t.y),h={data:e,id:this._nextId++,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(h,c)),this._dataByLinkId.set(h.id,h),h.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.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)))}};Fx=Pn([Ie(0,qr)],Fx);var $R=!1,tX=class extends Ct{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new tu),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 kY,this.optionsService=this._register(new LY(e)),this._instantiationService.setService(Kr,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Lx)),this._instantiationService.setService(qr,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Ox)),this._instantiationService.setService(AD,this._logService),this.coreService=this._register(this._instantiationService.createInstance(zx)),this._instantiationService.setService(Bl,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Px)),this._instantiationService.setService(jD,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(bl)),this._instantiationService.setService(xK,this.unicodeService),this._charsetService=this._instantiationService.createInstance(FY),this._instantiationService.setService(yK,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Fx),this._instantiationService.setService(DD,this._oscLinkService),this._inputHandler=this._register(new ZY(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(jr.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(jr.forward(this._bufferService.onResize,this._onResize)),this._register(jr.forward(this.coreService.onData,this._onData)),this._register(jr.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 eX((t,n)=>this._inputHandler.parse(t,n))),this._register(jr.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&&!$R&&(this._logService.warn("writeSync is unreliable and will be removed soon."),$R=!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,d4),t=Math.max(t,h4),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(DR.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(DR(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Mn(()=>{for(let t of e)t.dispose()})}}},nX={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 rX(e,t,n,r){var l;let i={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?i.key=ye.ESC+"OA":i.key=ye.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?i.key=ye.ESC+"OD":i.key=ye.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?i.key=ye.ESC+"OC":i.key=ye.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?i.key=ye.ESC+"OB":i.key=ye.ESC+"[B");break;case 8:i.key=e.ctrlKey?"\b":ye.DEL,e.altKey&&(i.key=ye.ESC+i.key);break;case 9:if(e.shiftKey){i.key=ye.ESC+"[Z";break}i.key=ye.HT,i.cancel=!0;break;case 13:i.key=e.altKey?ye.ESC+ye.CR:ye.CR,i.cancel=!0;break;case 27:i.key=ye.ESC,e.altKey&&(i.key=ye.ESC+ye.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;o?i.key=ye.ESC+"[1;"+(o+1)+"D":t?i.key=ye.ESC+"OD":i.key=ye.ESC+"[D";break;case 39:if(e.metaKey)break;o?i.key=ye.ESC+"[1;"+(o+1)+"C":t?i.key=ye.ESC+"OC":i.key=ye.ESC+"[C";break;case 38:if(e.metaKey)break;o?i.key=ye.ESC+"[1;"+(o+1)+"A":t?i.key=ye.ESC+"OA":i.key=ye.ESC+"[A";break;case 40:if(e.metaKey)break;o?i.key=ye.ESC+"[1;"+(o+1)+"B":t?i.key=ye.ESC+"OB":i.key=ye.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=ye.ESC+"[2~");break;case 46:o?i.key=ye.ESC+"[3;"+(o+1)+"~":i.key=ye.ESC+"[3~";break;case 36:o?i.key=ye.ESC+"[1;"+(o+1)+"H":t?i.key=ye.ESC+"OH":i.key=ye.ESC+"[H";break;case 35:o?i.key=ye.ESC+"[1;"+(o+1)+"F":t?i.key=ye.ESC+"OF":i.key=ye.ESC+"[F";break;case 33:e.shiftKey?i.type=2:e.ctrlKey?i.key=ye.ESC+"[5;"+(o+1)+"~":i.key=ye.ESC+"[5~";break;case 34:e.shiftKey?i.type=3:e.ctrlKey?i.key=ye.ESC+"[6;"+(o+1)+"~":i.key=ye.ESC+"[6~";break;case 112:o?i.key=ye.ESC+"[1;"+(o+1)+"P":i.key=ye.ESC+"OP";break;case 113:o?i.key=ye.ESC+"[1;"+(o+1)+"Q":i.key=ye.ESC+"OQ";break;case 114:o?i.key=ye.ESC+"[1;"+(o+1)+"R":i.key=ye.ESC+"OR";break;case 115:o?i.key=ye.ESC+"[1;"+(o+1)+"S":i.key=ye.ESC+"OS";break;case 116:o?i.key=ye.ESC+"[15;"+(o+1)+"~":i.key=ye.ESC+"[15~";break;case 117:o?i.key=ye.ESC+"[17;"+(o+1)+"~":i.key=ye.ESC+"[17~";break;case 118:o?i.key=ye.ESC+"[18;"+(o+1)+"~":i.key=ye.ESC+"[18~";break;case 119:o?i.key=ye.ESC+"[19;"+(o+1)+"~":i.key=ye.ESC+"[19~";break;case 120:o?i.key=ye.ESC+"[20;"+(o+1)+"~":i.key=ye.ESC+"[20~";break;case 121:o?i.key=ye.ESC+"[21;"+(o+1)+"~":i.key=ye.ESC+"[21~";break;case 122:o?i.key=ye.ESC+"[23;"+(o+1)+"~":i.key=ye.ESC+"[23~";break;case 123:o?i.key=ye.ESC+"[24;"+(o+1)+"~":i.key=ye.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=ye.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=ye.DEL:e.keyCode===219?i.key=ye.ESC:e.keyCode===220?i.key=ye.FS:e.keyCode===221&&(i.key=ye.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let c=(l=nX[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(c)i.key=ye.ESC+c;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()),i.key=ye.ESC+d}else if(e.keyCode===32)i.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()),i.key=ye.ESC+h,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(i.key=ye.US),e.key==="@"&&(i.key=ye.NUL));break}return i}var Hn=0,iX=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new zp,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new zp,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((i,o)=>this._getKey(i)-this._getKey(o)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=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||(Hn=this._search(t),Hn===-1)||this._getKey(this._array[Hn])!==t)return!1;do if(this._array[Hn]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Hn),!0;while(++Hn<this._array.length&&this._getKey(this._array[Hn])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((i,o)=>i-o),t=0,n=new Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:n[r++]=this._array[i];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&&(Hn=this._search(e),!(Hn<0||Hn>=this._array.length)&&this._getKey(this._array[Hn])===e))do yield this._array[Hn];while(++Hn<this._array.length&&this._getKey(this._array[Hn])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Hn=this._search(e),!(Hn<0||Hn>=this._array.length)&&this._getKey(this._array[Hn])===e))do t(this._array[Hn]);while(++Hn<this._array.length&&this._getKey(this._array[Hn])===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,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},$_=0,UR=0,sX=class extends Ct{constructor(){super(),this._decorations=new iX(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(Mn(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new oX(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,i=0;for(let o of this._decorations.getKeyIterator(t))r=o.options.x??0,i=r+(o.options.width??1),e>=r&&e<i&&(!n||(o.options.layer??"bottom")===n)&&(yield o)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,i=>{$_=i.options.x??0,UR=$_+(i.options.width??1),e>=$_&&e<UR&&(!n||(i.options.layer??"bottom")===n)&&r(i)})}},oX=class extends Ea{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=An.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=An.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},aX=1e3,lX=class{constructor(e,t=aX){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 i=r-this._lastRefreshMs,o=this._debounceThresholdMS-i;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)}},VR=20,Pp=class extends Ct{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 i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=i.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=i.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new lX(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(`
|
|
570
|
+
`))),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(at(i,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Mn(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<VR+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
571
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===VR+1&&(this._liveRegion.textContent+=ox.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 i=e;i<=t;i++){let o=n.lines.get(n.ydisp+i),l=[],c=(o==null?void 0:o.translateToString(!0,void 0,void 0,l))||"",h=(n.ydisp+i+1).toString(),d=this._rowElements[i];d&&(c.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=c,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],i=n.getAttribute("aria-posinset"),o=t===0?"1":`${this._terminal.buffer.lines.length}`;if(i===o||e.relatedTarget!==r)return;let l,c;if(t===0?(l=n,c=this._rowElements.pop(),this._rowContainer.removeChild(c)):(l=this._rowElements.shift(),c=n,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),c.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 c;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:((c=r.textContent)==null?void 0:c.length)??0}),!this._rowContainer.contains(n.node))return;let i=({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 b=this._rowColumns.get(g);if(!b)return console.warn("columns is null. Race condition?"),null;let y=d<b.length?b[d]:b.slice(-1)[0]+1;return y>=this._terminal.cols&&(++p,y=0),{row:p,column:y}},o=i(t),l=i(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 i,o;e.style.transform="";let t=e.getBoundingClientRect().width,n=(o=(i=this._rowColumns.get(e))==null?void 0:i.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})`}};Pp=Pn([Ie(1,Mw),Ie(2,Do),Ie(3,Oo)],Pp);var Hx=class extends Ct{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,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(Mn(()=>{var o;Ml(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(at(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(at(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(at(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(at(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 i=n[r];if(i.classList.contains("xterm"))break;if(i.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,i;(!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?(i=this._activeProviderReplies)!=null&&i.get(o)&&(n=this._checkLinkProviderResult(o,e,n)):l.provideLinks(e.y,c=>{var d,g;if(this._isMouseOut)return;let h=c==null?void 0:c.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 i=t.get(r);if(i)for(let o=0;o<i.length;o++){let l=i[o],c=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=c;d<=h;d++){if(n.has(d)){i.splice(o--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,t,n){var o;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(i=!0);if(!i&&r){let l=r.find(c=>this._linkAtPosition(c.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 c=(o=this._activeProviderReplies.get(l))==null?void 0:o.find(h=>this._linkAtPosition(h.link,t));if(c){n=!0,this._handleNewLink(c);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&&cX(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,Ml(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,i,o;(r=this._currentLink)!=null&&r.state&&((o=(i=this._currentLink)==null?void 0:i.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,i=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(r,i),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,i=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(i)}_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,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=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,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};Hx=Pn([Ie(1,jw),Ie(2,Oo),Ie(3,qr),Ie(4,LD)],Hx);function cX(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 uX=class extends tX{constructor(e={}){super(e),this._linkifier=this._register(new tu),this.browser=e4,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new tu),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(sX),this._instantiationService.setService($h,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(JG),this._instantiationService.setService(LD,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(lx)),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(jr.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(jr.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(jr.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(jr.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Mn(()=>{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 i=kn.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ye.ESC}]${r};${YY(i)}${QD.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(o=>o.ansi[t.index]=Jn.toColor(...t.color));else{let o=n;this._themeService.modifyColors(l=>l[o]=Jn.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(Pp,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,i=t.getWidth(n),o=this._renderService.dimensions.css.cell.width*i,l=this.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=c+"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(at(this.element,"copy",t=>{this.hasSelection()&&mK(t,this._selectionService)}));let e=t=>pK(t,this.textarea,this.coreService,this.optionsService);this._register(at(this.textarea,"paste",e)),this._register(at(this.element,"paste",e)),t4?this._register(at(this.element,"mousedown",t=>{t.button===2&&eR(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(at(this.element,"contextmenu",t=>{eR(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Bw&&this._register(at(this.element,"auxclick",t=>{t.button===1&&ED(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(at(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(at(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(at(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(at(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(at(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(at(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(at(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var i;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"),((i=this.element)==null?void 0:i.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(at(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",sx.get()),i4||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(ZG,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Do,this._coreBrowserService),this._register(at(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(at(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Nx,this._document,this._helperContainer),this._instantiationService.setService(Lg,this._charSizeService),this._themeService=this._instantiationService.createInstance(Dx),this._instantiationService.setService(_u,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Op),this._instantiationService.setService(OD,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(jx,this.rows,this.screenElement)),this._instantiationService.setService(Oo,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(Ex,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Mx),this._instantiationService.setService(jw,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Hx,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(Cx,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(Ax,this.element,this.screenElement,r)),this._instantiationService.setService(SK,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(jr.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var o;this._selectionService.refresh(),(o=this._viewport)==null||o.queueSync()})),this._register(this._instantiationService.createInstance(kx,this.screenElement)),this._register(at(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(Pp,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Dp,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Dp,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Tx,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,b,y;let l=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!l)return!1;let c,h;switch(o.overrideType||o.type){case"mousemove":h=32,o.buttons===void 0?(c=3,o.button!==void 0&&(c=o.button<3?o.button:3)):c=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":h=0,c=o.button<3?o.button:3;break;case"mousedown":h=1,c=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,(b=(p=(g=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:g.device)==null?void 0:p.cell)==null?void 0:b.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;h=w<0?0:1,c=4;break;default:return!1}return h===void 0||c===void 0||c>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:c,action:h,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={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",i.mousemove),r.mousemove=i.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),o&16?r.wheel||(t.addEventListener("wheel",i.wheel,{passive:!1}),r.wheel=i.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),o&2?r.mouseup||(r.mouseup=i.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),o&4?r.mousedrag||(r.mousedrag=i.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(at(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(at(t,"wheel",o=>{var l,c,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=(c=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:c.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){kD(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=rX(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)&&(dX(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),i=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ye.ESC}[6;${i};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function dX(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var hX=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)}},fX=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 Gi)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},WR=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 fX(t)}getNullCell(){return new Gi}},mX=class extends Ct{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Me),this.onBufferChange=this._onBufferChange.event,this._normal=new WR(this._core.buffers.normal,"normal"),this._alternate=new WR(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)}},pX=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)}},gX=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}},vX=["cols","rows"],Cs=0,bX=class extends Ct{constructor(e){super(),this._core=this._register(new uX(e)),this._addonManager=this._register(new hX),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],n=(r,i)=>{this._checkReadonlyOptions(r),this._core.options[r]=i};for(let r in this._core.options){let i={get:t.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,i)}}_checkReadonlyOptions(e){if(vX.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 pX(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new gX(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 mX(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
|
|
572
|
+
`,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 sx.get()},set promptLabel(e){sx.set(e)},get tooMuchOutput(){return ox.get()},set tooMuchOutput(e){ox.set(e)}}}_verifyIntegers(...e){for(Cs of e)if(Cs===1/0||isNaN(Cs)||Cs%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Cs of e)if(Cs&&(Cs===1/0||isNaN(Cs)||Cs%1!==0||Cs<0))throw new Error("This API only accepts positive integers")}};const qR="lever-theme",U_="20260329-handoff",_X={light:`/manifest.webmanifest?v=${U_}`,dark:`/manifest-dark.webmanifest?v=${U_}`,custom:`/manifest-dark.webmanifest?v=${U_}`},m4=v.createContext(void 0),yX=e=>e==="light"||e==="dark"||e==="system"||e==="custom",ml=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",KR=(e,t)=>{if(typeof document>"u")return;let n;e==="custom"?n=t==="system"||!t?ml():t:n=e==="system"?ml():e,document.documentElement.classList.toggle("dark",n==="dark")},GR=e=>{if(typeof document>"u")return;document.documentElement.style.colorScheme=e;const t=document.querySelector('meta[name="theme-color"]');if(t){const i=getComputedStyle(document.body).backgroundColor;i&&i!=="rgba(0, 0, 0, 0)"&&i!=="transparent"&&t.setAttribute("content",i)}const n=document.querySelector('link[rel="manifest"]#app-manifest'),r=_X[e];n&&n.getAttribute("href")!==r&&n.setAttribute("href",r)};function xX({children:e}){const t=yn(p=>p.themePreference),n=yn(p=>p.setThemePreference),r=yn(p=>p.themeId),i=yn(p=>p.customAppearance),o=yn(p=>p.backgroundImage),l=yn(p=>p.backgroundOpacity),c=yn(p=>p.backgroundBlur),h=yn(p=>p.themeCssText);v.useEffect(()=>{if(typeof window>"u")return;const p=window.localStorage.getItem(qR);yX(p)&&(yn.getState().themePreference==="system"&&p!=="system"&&n(p),window.localStorage.removeItem(qR))},[]),v.useEffect(()=>{KR(t,i);const p=t==="custom"?i==="system"?ml():i:t==="system"?ml():t;GR(p)},[t,i]),v.useEffect(()=>{if(t!=="system"&&(t!=="custom"||i!=="system"))return;const p=window.matchMedia("(prefers-color-scheme: dark)"),b=()=>{KR(t,i),GR(ml())};return p.addEventListener?(p.addEventListener("change",b),()=>p.removeEventListener("change",b)):(p.addListener(b),()=>p.removeListener(b))},[t,i]),v.useEffect(()=>{if(typeof document>"u")return;let p=document.getElementById("kaizen-theme-registry-styles");p||(p=document.createElement("style"),p.id="kaizen-theme-registry-styles",document.head.appendChild(p)),p.textContent=h},[h]),v.useEffect(()=>{typeof document>"u"||(t==="custom"?document.documentElement.setAttribute("data-theme",r):document.documentElement.removeAttribute("data-theme"))},[t,r]),v.useEffect(()=>{if(typeof document>"u")return;let p=document.getElementById("kaizen-custom-theme-styles");p||(p=document.createElement("style"),p.id="kaizen-custom-theme-styles",document.head.appendChild(p));const b=t==="custom"&&o&&o.trim()!=="",y=[];if(b){const w=c?c*2:0;y.push(`
|
|
573
|
+
body {
|
|
574
|
+
background-image: none !important;
|
|
575
|
+
background-color: transparent !important;
|
|
576
|
+
}
|
|
577
|
+
body::before {
|
|
578
|
+
content: "";
|
|
579
|
+
position: fixed;
|
|
580
|
+
top: -${w}px;
|
|
581
|
+
left: -${w}px;
|
|
582
|
+
right: -${w}px;
|
|
583
|
+
bottom: -${w}px;
|
|
584
|
+
background-image: url("${o}");
|
|
585
|
+
background-size: cover;
|
|
586
|
+
background-position: center;
|
|
587
|
+
filter: blur(${c}px);
|
|
588
|
+
z-index: -2;
|
|
589
|
+
pointer-events: none;
|
|
590
|
+
}
|
|
591
|
+
body::after {
|
|
592
|
+
content: "";
|
|
593
|
+
position: fixed;
|
|
594
|
+
inset: 0;
|
|
595
|
+
background-color: hsl(var(--background) / ${l});
|
|
596
|
+
z-index: -1;
|
|
597
|
+
pointer-events: none;
|
|
598
|
+
}
|
|
599
|
+
#root {
|
|
600
|
+
background-color: transparent !important;
|
|
601
|
+
}
|
|
602
|
+
:root {
|
|
603
|
+
--color-background: transparent !important;
|
|
604
|
+
--color-card: hsl(var(--card) / 0.15) !important;
|
|
605
|
+
--color-popover: hsl(var(--popover) / 0.8) !important;
|
|
606
|
+
--color-muted: hsl(var(--muted) / 0.25) !important;
|
|
607
|
+
}
|
|
608
|
+
.kaizen-terminal, .xterm-viewport, .xterm-screen {
|
|
609
|
+
background-color: transparent !important;
|
|
610
|
+
}
|
|
611
|
+
`)}else y.push(`
|
|
612
|
+
body {
|
|
613
|
+
background-image: none !important;
|
|
614
|
+
}
|
|
615
|
+
body::before {
|
|
616
|
+
display: none;
|
|
617
|
+
}
|
|
618
|
+
#root {
|
|
619
|
+
background-color: transparent;
|
|
620
|
+
}
|
|
621
|
+
`);p.textContent=y.join(`
|
|
622
|
+
`)},[t,o,l,c]);const d=p=>{n(p)},g=v.useMemo(()=>{const p=t==="custom"?i==="system"?ml():i:t==="system"?ml():t;return{theme:t,resolvedTheme:p,setTheme:d}},[t,i,n]);return f.jsx(m4.Provider,{value:g,children:e})}function p4(){const e=v.useContext(m4);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const wX={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"},SX={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 g4(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function v4(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,i=(r==null?void 0:r.width)??0,o=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(i)||!Number.isFinite(o)||i<=0||o<=0)return null;const l=t.getBoundingClientRect(),c=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(c.paddingLeft)+parseFloat(c.paddingRight)+parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),p=parseFloat(c.paddingTop)+parseFloat(c.paddingBottom)+parseFloat(h.paddingTop)+parseFloat(h.paddingBottom),b=Math.max(0,l.width-g-d-1),y=Math.max(0,l.height-p);return{cols:Math.max(2,Math.floor(b/i)),rows:Math.max(1,Math.floor(y/o))}}function jm(e){e.refresh(0,Math.max(0,e.rows-1))}function Am(e,t,n,r,i){const o=v4(e,t)??g4(e);return n.current&&n.current.cols===o.cols&&n.current.rows===o.rows||(e.resize(o.cols,o.rows),n.current=o,r&&i(o.cols,o.rows)),o}function CX({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:i,clearVersion:o=0,focusRequestVersion:l=0,onPathChange:c}){const{resolvedTheme:h}=p4(),d=v.useRef(null),g=v.useRef(null),p=v.useRef(null),b=v.useRef(!1),y=v.useRef(0),w=v.useRef(null),S=v.useRef(null),[C,k]=v.useState(null),[R,E]=v.useState(null),N=h==="dark"?SX:wX,L=(O,H)=>{n.command({type:"terminal.resize",terminalId:t,cols:O,rows:H}).catch(()=>{})},A=()=>{const O=()=>{const H=g.current,Z=d.current;!H||!Z||!b.current||Am(H,Z,S,!0,L)};requestAnimationFrame(()=>{O(),setTimeout(O,0)})};return v.useEffect(()=>{const O=new bX({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:N}),H=new nK;O.loadAddon(H),O.loadAddon(new cK),g.current=O;const Z=d.current;Z&&(O.open(Z),p.current&&O.write(p.current),Am(O,Z,S,!1,()=>{}),jm(O),A());const I=O.onData($=>{n.command({type:"terminal.input",terminalId:t,data:$}).catch(W=>{E(W instanceof Error?W.message:String(W))})}),q=O.onResize(({cols:$,rows:W})=>{if(!b.current)return;const K={cols:$,rows:W};S.current&&S.current.cols===$&&S.current.rows===W||(S.current=K,L($,W))}),F=new ResizeObserver(()=>{const $=g.current,W=d.current;!$||!W||Am($,W,S,b.current,(K,D)=>{n.command({type:"terminal.resize",terminalId:t,cols:K,rows:D}).catch(()=>{})})});return Z&&F.observe(Z),()=>{F.disconnect(),q.dispose(),I.dispose(),p.current=H.serialize(),O.dispose(),g.current=null}},[r,n,t,N]),v.useEffect(()=>{const O=g.current;O&&(O.options.scrollback=r)},[r]),v.useEffect(()=>{const O=g.current;O&&(O.options.theme=N,jm(O))},[N]),v.useEffect(()=>{if(l===0)return;const O=g.current;O&&requestAnimationFrame(()=>{O.focus()})},[l]),v.useEffect(()=>{if(o===0)return;const O=g.current;O&&(b.current=!1,y.current+=1,w.current=null,p.current=null,k(null),E(null),O.reset(),jm(O),n.command({type:"terminal.close",terminalId:t}).catch(H=>{E(H instanceof Error?H.message:String(H))}))},[o,n,t]),v.useEffect(()=>{c==null||c((C==null?void 0:C.cwd)??null)},[C==null?void 0:C.cwd,c]),v.useEffect(()=>{const O=I=>{const q=g.current;if(!q)return;const F=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===F){k({cwd:I.cwd,shell:I.shell,status:I.status,exitCode:I.exitCode}),p.current=I.serializedState||null;return}w.current=F,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),jm(q)},H=()=>{const I=g.current,q=d.current;if(!I||!q)return;const F=v4(I,q)??g4(I);I.resize(F.cols,F.rows),S.current=F,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:F.cols,rows:F.rows,scrollback:r}).then($=>{b.current=!0,E(null),$&&O($),A()}).catch($=>{E($ instanceof Error?$.message:String($))})},Z=()=>{const I=++y.current,q=()=>{if(y.current!==I)return;const F=g.current,$=d.current;if(!F||!$)return;Am(F,$,S,!1,()=>{});const W=$.getBoundingClientRect();if(W.width<=0||W.height<=0){requestAnimationFrame(q);return}H()};requestAnimationFrame(()=>{requestAnimationFrame(q)})};return Z(),n.subscribeTerminal(t,{onSnapshot:I=>{if(!I){b.current=!1,w.current=null,i==="connected"&&Z();return}b.current=!0,E(null),O(I),A()},onEvent:I=>{const q=g.current;if(q){if(I.type==="terminal.output"){q.write(I.data);return}I.type==="terminal.exit"&&k(F=>({cwd:(F==null?void 0:F.cwd)??"",shell:(F==null?void 0:F.shell)??"",status:"exited",exitCode:I.exitCode}))}}})},[i,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 kX=24;function b4(e){return e+kX}function EX(e,t){return Math.max(1,e)*b4(t)}function V_({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:i,minColumnWidth:o,maximized:l=!1,focusRequestVersion:c=0,splitTerminalShortcut:h,onToggleMaximized:d,onAddTerminal:g,onRemoveTerminal:p,onTerminalLayout:b}){const y=v.useRef(null),w=v.useRef({}),S=v.useRef([]),[C,k]=v.useState(0),[R,E]=v.useState({}),[N,L]=v.useState({});v.useLayoutEffect(()=>{const q=y.current;if(!q)return;const F=()=>{k(q.getBoundingClientRect().width)},$=new ResizeObserver(F);return $.observe(q),F(),()=>$.disconnect()},[]);const A=t.terminals.length,O=b4(o),H=EX(A,o),Z=Math.max(C,H),I=v.useMemo(()=>t.terminals.map(q=>q.id).join(":"),[t.terminals]);return v.useLayoutEffect(()=>{const q=S.current,F=t.terminals.map(K=>K.id),$=F.find(K=>!q.includes(K));if(S.current=F,!$||q.length===0)return;const W=w.current[$];W&&W.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:y,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:f.jsx("div",{className:"h-full min-h-0",style:{width:Z||"100%"},children:f.jsx(Xd,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:q=>b(e,t.terminals.map(F=>q[F.id]??F.size)),children:t.terminals.map((q,F)=>f.jsxs(v.Fragment,{children:[f.jsx(xo,{id:q.id,defaultSize:`${q.size}%`,minSize:`${O}px`,className:"min-h-0 overflow-hidden",style:{minWidth:O},children:f.jsxs("div",{ref:$=>{w.current[q.id]=$},className:"flex h-full min-h-0 min-w-0 flex-col border-r border-border bg-transparent last:border-r-0",style:{minWidth:O},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:R[q.id]??""})]})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Xe,{variant:"ghost",size:"icon-sm",className:"md:hidden","aria-label":"Send Ctrl+C",onClick:()=>{n.command({type:"terminal.input",terminalId:q.id,data:""}).catch(()=>{})},title:"Send Ctrl+C",children:f.jsx(V9,{className:"size-3.5"})}),f.jsx(Xe,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>L($=>({...$,[q.id]:($[q.id]??0)+1})),children:f.jsx(O8,{className:"size-3.5"})}),f.jsxs(Md,{children:[f.jsx(jd,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>g(e,q.id),children:f.jsx(R0,{className:"size-3.5"})})}),f.jsx(Ic,{side:"bottom",shortcut:h})]}),d?f.jsx(Xe,{variant:"ghost",size:"icon-sm","aria-label":l?"Restore terminal size":"Maximize terminal",onClick:d,children:l?f.jsx(g9,{className:"size-3.5"}):f.jsx(u9,{className:"size-3.5"})}):null,f.jsx(Xe,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>p(e,q.id),children:f.jsx(ko,{className:"size-3.5"})})]})]}),f.jsx(CX,{projectId:e,terminalId:q.id,socket:n,scrollback:i,connectionStatus:r,clearVersion:N[q.id]??0,focusRequestVersion:F===0?c:0,onPathChange:$=>E(W=>W[q.id]===$?W:{...W,[q.id]:$})})]})}),F<t.terminals.length-1?f.jsx(Zd,{withHandle:!0,orientation:"horizontal"}):null]},q.id))},I)})})})}function YR(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function RX(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:YR(n.groups.line),column:YR(n.groups.column)}:{path:t}}function W_(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 Fw=()=>{},_4=v.createContext(Fw);function TX({children:e,onOpenLocalLink:t}){return f.jsx(_4.Provider,{value:t??Fw,children:e})}const $x={Task:up,TaskOutput:up,Bash:T0,Glob:f_,Grep:f_,ExitPlanMode:I2,Read:W8,Edit:B8,Write:H8,NotebookEdit:Xc,WebFetch:qB,TodoWrite:c8,WebSearch:f_,KillShell:$9,AskUserQuestion:Y5,Skill:Vn,EnterPlanMode:I2},y4=K9;function x4(e){return $x[e]?$x[e]:y4}function Lo({children:e,className:t}){return f.jsx("div",{className:pe("flex gap-3 justify-start items-center",t),children:e})}function NX({children:e,className:t}){return f.jsx("div",{className:pe("flex items-center gap-1.5 text-xs",t),children:e})}function No({children:e,className:t}){return f.jsx("span",{className:pe("font-medium text-foreground/80",t),children:e})}function MX({children:e}){return f.jsx("span",{className:"text-muted-foreground",children:e})}function Wh({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,i]=v.useState(n);return f.jsxs("div",{className:"flex flex-col w-full",children:[f.jsxs("button",{onClick:()=>i(!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(Vr,{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 q_({label:e,children:t,copyText:n}){const[r,i]=v.useState(!1),o=n??Ip(t),l=v.useCallback(async()=>{await navigator.clipboard.writeText(o),i(!0),setTimeout(()=>i(!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(Xe,{variant:"ghost",size:"icon",className:pe("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(_l,{className:"h-4 w-4"})})]})]})}function w4({children:e,icon:t,className:n}){return f.jsxs("span",{className:pe("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 qh({children:e,className:t}){return f.jsxs("div",{className:pe("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 Ip(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(Ip).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return Ip(t.children)}return""}function XR(e,t){return v.isValidElement(e)?v.cloneElement(e,{className:pe(e.props.className,t)}):e}const jX={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]=v.useState(!1),i=Ip(e),o=async()=>{await navigator.clipboard.writeText(i),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(Xe,{variant:"ghost",size:"icon",className:pe("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(_l,{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=v.Children.toArray(e),r=n[0];r!==void 0&&(n[0]=XR(r,"mt-0"));const i=n.length-1,o=n[i];return o!==void 0&&(n[i]=XR(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 xu(e){return{...jX,a:({children:t,href:n,onClick:r,...i})=>{const o=(e==null?void 0:e.onOpenLocalLink)??v.useContext(_4),l=RX(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:c=>{r==null||r(c),!(c.defaultPrevented||!l||o===Fw)&&(c.preventDefault(),o(l))},...i,children:t})}}}const AX={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function DX({status:e}){const t=(e?AX[e]:void 0)||"Processing...",n=e==="failed";return f.jsx(Lo,{className:"ml-[1px]",children:f.jsxs(NX,{children:[n?f.jsx(ko,{className:"size-4.5 text-red-500"}):f.jsx(wr,{className:"size-4.5 animate-spin text-muted-icon"}),f.jsx(Sg,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const Ig=v.forwardRef(({className:e,children:t,...n},r)=>f.jsx("div",{ref:r,className:pe("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));Ig.displayName="ScrollArea";function S4(e){return e==="localhost"||e==="127.0.0.1"||e==="::1"}const Bg=20,Ux=50,C4=30;function k4(e){return Number.isFinite(e)?Math.min(Ux,Math.max(Bg,e)):C4}function OX(){return{isVisible:!1,size:Bg}}function Dm(e,t){return e[t]??OX()}function LX(e){return!e||typeof e!="object"?{projects:{}}:{projects:Object.fromEntries(Object.entries(e.projects??{}).map(([r,i])=>[r,{isVisible:!1,size:k4(i.size??C4)}]))}}const Jd=Us()(Vs(e=>({projects:{},toggleVisibility:t=>e(n=>({projects:{...n.projects,[t]:{...Dm(n.projects,t),isVisible:!Dm(n.projects,t).isVisible}}})),setVisibility:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...Dm(r.projects,t),isVisible:n}}})),setSize:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...Dm(r.projects,t),size:k4(n)}}})),clearProject:t=>e(n=>{const{[t]:r,...i}=n.projects;return{projects:i}})}),{name:"right-sidebar-layouts",version:2,migrate:LX})),zX={isVisible:!1,size:Bg},Hw=[60,40];function PX(){return{isVisible:!1,mainSizes:[...Hw],terminals:[],nextTerminalIndex:0}}function IX(e,t){return e[t]??PX()}function K_(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 BX(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 FX(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function Mc(e,t,n){return{...e,[t]:n(IX(e,t))}}const va=Us()(Vs(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:Mc(r.projects,t,i=>{var h,d;const o=FX(i.terminals),l={id:((d=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:d.call(h))??`terminal-${Date.now()}-${i.nextTerminalIndex}`,title:BX(i.nextTerminalIndex),size:100/(o.length+1)},c=n?Math.max(o.findIndex(g=>g.id===n)+1,0):o.length;return{...i,isVisible:!0,nextTerminalIndex:i.nextTerminalIndex+1,terminals:[...o.slice(0,c),l,...o.slice(c)]}})})),removeTerminal:(t,n)=>e(r=>({projects:Mc(r.projects,t,i=>{const o=i.terminals.filter(c=>c.id!==n);if(o.length===0)return{...i,isVisible:!1,terminals:[]};const l=K_(o.map(c=>c.size));return{...i,terminals:o.map((c,h)=>({...c,size:l[h]??100/o.length}))}})})),toggleVisibility:t=>e(n=>({projects:Mc(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),resetMainSizes:t=>e(n=>({projects:Mc(n.projects,t,r=>({...r,mainSizes:[...Hw]}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const i=K_(n);return{projects:Mc(r.projects,t,o=>({...o,mainSizes:i}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:Mc(r.projects,t,i=>{if(n.length!==i.terminals.length)return i;const o=K_(n);return{...i,terminals:i.terminals.map((l,c)=>({...l,size:o[c]??l.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...i}=n.projects;return{projects:i}})}),{name:"terminal-layouts",version:1})),HX={isVisible:!1,mainSizes:[...Hw],terminals:[],nextTerminalIndex:0},Bp=1e4,Vx=500,Wx=5e4,Fp=450,qx=250,Kx=900,Gx="cursor";function Yx(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 $X(e){switch(e){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function ZR(e){return Number.isFinite(e)?Math.min(Wx,Math.max(Vx,Math.round(e))):Bp}function QR(e){return Number.isFinite(e)?Math.min(Kx,Math.max(qx,Math.round(e))):Fp}function JR(e){switch(e){case"vscode":case"windsurf":case"custom":case"cursor":return e;default:return Gx}}function G_(e,t){const n=e==null?void 0:e.trim();return n&&n.length>0?n:Yx(t)}const Fi=Us()(Vs(e=>({scrollbackLines:Bp,minColumnWidth:Fp,editorPreset:Gx,editorCommandTemplate:Yx(Gx),setScrollbackLines:t=>e({scrollbackLines:ZR(t)}),setMinColumnWidth:t=>e({minColumnWidth:QR(t)}),setEditorPreset:t=>e(n=>{const r=JR(t);return{editorPreset:r,editorCommandTemplate:r==="custom"?G_(n.editorCommandTemplate,r):Yx(r)}}),setEditorCommandTemplate:t=>e(n=>({editorCommandTemplate:G_(t,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:e=>{const t=e,n=JR(t==null?void 0:t.editorPreset);return{scrollbackLines:ZR((t==null?void 0:t.scrollbackLines)??Bp),minColumnWidth:QR((t==null?void 0:t.minColumnWidth)??Fp),editorPreset:n,editorCommandTemplate:G_(t==null?void 0:t.editorCommandTemplate,n)}}})),UX=35;function VX(e,t){return!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0?0:e*(t/100)}function WX(e,t){const n=VX(e,t);return n>=0&&n<UX}const $c=350,qX=[.4,0,.2,1],KX=8,eT=1e-6;function GX(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function YX(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function XX(e,t,n){const r=1-e;return 3*r*r*t+6*r*e*(n-t)+3*e*e*(1-n)}function ZX(e,t,n){let r=e;for(let i=0;i<KX;i+=1){const o=GX(r,t,n)-e;if(Math.abs(o)<eT)return r;const l=XX(r,t,n);if(Math.abs(l)<eT)break;r-=o/l}return r}function QX(e){if(e<=0)return 0;if(e>=1)return 1;const[t,n,r,i]=qX,o=ZX(e,t,r);return YX(o,n,i)}function E4(e,t,n){const r=QX(n);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function JX({projectId:e,shouldRenderRightSidebarLayout:t,showRightSidebar:n,rightSidebarSize:r}){const i=v.useRef(null),o=v.useRef(null),l=v.useRef(null),c=v.useRef(null),h=v.useRef(null),d=v.useRef(!1),g=v.useRef(null),p=v.useRef(!1),b=v.useRef(!1);return v.useEffect(()=>()=>{c.current!==null&&window.cancelAnimationFrame(c.current),h.current!==null&&window.clearTimeout(h.current)},[]),v.useLayoutEffect(()=>{var O,H,Z,I,q,F;if(!t){c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null),d.current=!1;return}const y=i.current;if(!y)return;c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null);const w=g.current,S=w!==null&&w!==e,C=n&&!b.current,k=!p.current,R=n?[100-r,r]:[100,0],E=S||k&&n,N=C||k?[100,0]:[y.getLayout().workspace??R[0],y.getLayout().rightSidebar??R[1]];if(g.current=e,p.current=t,b.current=n,E||Math.abs(N[0]-R[0])<.1&&Math.abs(N[1]-R[1])<.1){y.setLayout({workspace:R[0],rightSidebar:R[1]}),(O=o.current)==null||O.setAttribute("data-right-sidebar-open",n?"true":"false"),(H=l.current)==null||H.setAttribute("data-right-sidebar-open",n?"true":"false"),(Z=l.current)==null||Z.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"),(F=l.current)==null||F.setAttribute("data-right-sidebar-animated","true"),y.setLayout({workspace:N[0],rightSidebar:N[1]});const L=performance.now(),A=$=>{const W=Math.min(1,($-L)/$c),K=E4(N,R,W);if(y.setLayout({workspace:K[0],rightSidebar:K[1]}),W<1){c.current=window.requestAnimationFrame(A);return}y.setLayout({workspace:R[0],rightSidebar:R[1]}),c.current=null,h.current=window.setTimeout(()=>{d.current=!1,h.current=null},0)};c.current=window.requestAnimationFrame(A)},[e,r,t,n]),v.useEffect(()=>{t||(p.current=!1,b.current=!1)},[t]),{isAnimating:d,panelGroupRef:i,sidebarPanelRef:o,sidebarVisualRef:l}}function eZ(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 tZ({previousProjectId:e,projectId:t,previousShouldRenderTerminalLayout:n,previousShowTerminalPane:r,showTerminalPane:i,terminalLayout:o,liveLayout:l}){const c=e!==null&&e!==t,h=i&&!r,d=!n,g=e===null&&t!==null,p=i?o.mainSizes:[100,0];return{currentLayout:h||d?[100,0]:l,shouldSkipAnimation:c||g&&d,targetLayout:p}}function nZ({chatInputRef:e,projectId:t,shouldRenderTerminalLayout:n,showTerminalPane:r,terminalLayout:i}){const o=v.useRef(null),l=v.useRef(null),c=v.useRef(null),h=v.useRef(null),d=v.useRef(null),g=v.useRef(!1),p=v.useRef(null),b=v.useRef(!1),y=v.useRef(!1),w=v.useRef(!1),[S,C]=v.useState(0);return v.useEffect(()=>{var E;const k=p.current,R=w.current;eZ({previousProjectId:k,projectId:t,showTerminalPane:r,wasTerminalVisible:R})&&C(N=>N+1),k!==null&&k===t&&!r&&R&&((E=e.current)==null||E.focus({preventScroll:!0})),w.current=r,p.current=t},[e,t,r]),v.useEffect(()=>()=>{h.current!==null&&window.cancelAnimationFrame(h.current),d.current!==null&&window.clearTimeout(d.current)},[]),v.useLayoutEffect(()=>{var H,Z,I,q,F,$;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:N,targetLayout:L}=tZ({previousProjectId:R,projectId:t,previousShouldRenderTerminalLayout:b.current,previousShowTerminalPane:y.current,showTerminalPane:r,terminalLayout:i,liveLayout:[k.getLayout().chat??i.mainSizes[0],k.getLayout().terminal??i.mainSizes[1]]});if(b.current=n,y.current=r,N||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"),(Z=c.current)==null||Z.setAttribute("data-terminal-open",r?"true":"false"),(I=c.current)==null||I.setAttribute("data-terminal-animated","false");return}g.current=!0,(q=l.current)==null||q.setAttribute("data-terminal-open",r?"true":"false"),(F=c.current)==null||F.setAttribute("data-terminal-open",r?"true":"false"),($=c.current)==null||$.setAttribute("data-terminal-animated","true"),k.setLayout({chat:E[0],terminal:E[1]});const A=performance.now(),O=W=>{const K=Math.min(1,(W-A)/$c),D=E4(E,L,K);if(k.setLayout({chat:D[0],terminal:D[1]}),K<1){h.current=window.requestAnimationFrame(O);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(O)},[t,n,r,i.mainSizes]),v.useEffect(()=>{n||(b.current=!1,y.current=!1)},[n]),{isAnimating:g,mainPanelGroupRef:o,terminalFocusRequestVersion:S,terminalPanelRef:l,terminalVisualRef:c}}const yi=Us()(Vs(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 Om(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function rZ(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function iZ(e,t){const n=rZ(t);switch(e.toolKind){case"ask_user_question":{const i=Om(n),o=Om(i==null?void 0:i.answers)??(i||{});return{answers:Object.fromEntries(Object.entries(o).map(([l,c])=>Array.isArray(c)?[l,c.map(h=>String(h))]:c&&typeof c=="object"&&Array.isArray(c.answers)?[l,c.answers.map(h=>String(h))]:c==null||c===""?[l,[]]:[l,[String(c)]])),...(i==null?void 0:i.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const i=Om(n);return{confirmed:typeof(i==null?void 0:i.confirmed)=="boolean"?i.confirmed:void 0,clearContext:typeof(i==null?void 0:i.clearContext)=="boolean"?i.clearContext:void 0,message:typeof(i==null?void 0:i.message)=="string"?i.message:void 0,...(i==null?void 0:i.discarded)===!0?{discarded:!0}:{}}}case"read_file":if(typeof n=="string")return n;const r=Om(n);return{content:typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(n,null,2)};default:return n}}function R4(e){return new Date(e).toISOString()}function Pi(e){return{id:e._id,messageId:e.messageId,timestamp:R4(e.createdAt),hidden:e.hidden}}function sZ(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:R4(e.createdAt)}}function oZ(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function aZ(e){if(e!=null&&e.length)return e.map(t=>({...t,previewUrl:`/attachments/${t.relativePath.split("/").map(encodeURIComponent).join("/")}`}))}function tT(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 lZ(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...Pi(r),kind:"user_prompt",content:r.content,attachments:aZ(r.attachments)});break;case"system_init":n.push({...Pi(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({...Pi(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":tT(n,{...Pi(r),kind:"assistant_text",text:r.text});break;case"assistant_thought":tT(n,{...Pi(r),kind:"assistant_thought",text:r.text});break;case"tool_call":{const i=sZ(r);t.set(r.tool.toolId,{hydrated:i,normalized:r.tool}),n.push(i);break}case"tool_result":{const i=t.get(r.toolId);if(i){const o=i.normalized.toolKind==="ask_user_question"||i.normalized.toolKind==="exit_plan_mode"?oZ(r)??r.content:r.content;i.hydrated.result=iZ(i.normalized,o),i.hydrated.rawResult=o,i.hydrated.isError=r.isError}break}case"result":n.push({...Pi(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...Pi(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...Pi(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...Pi(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...Pi(r),kind:"context_cleared"});break;case"interrupted":n.push({...Pi(r),kind:"interrupted"});break;default:n.push({...Pi(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const cZ=["AskUserQuestion","ExitPlanMode","TodoWrite"],uZ=new Set(["TodoWrite"]);function dZ(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const i=r;if(i.toolName===t&&!i.result)return i.id}return null}function hZ(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const i=r;if(i.toolName===t)return i.id}return null}function fZ(e){const t={};for(const n of cZ)t[n]=uZ.has(n)?hZ(e,n):dZ(e,n);return t}function mZ(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function Y_(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const pZ=25e3,gZ=15e3,vZ=4e3;class bZ{constructor(t){rr(this,"url");rr(this,"ws",null);rr(this,"started",!1);rr(this,"reconnectTimer",null);rr(this,"reconnectDelayMs",750);rr(this,"subscriptions",new Map);rr(this,"pending",new Map);rr(this,"outboundQueue",[]);rr(this,"statusListeners",new Set);rr(this,"heartbeatTimer",null);rr(this,"pingTimeoutTimer",null);rr(this,"pingPromise",null);rr(this,"lastOpenAt",0);rr(this,"lastMessageAt",0);rr(this,"reconnectImmediatelyOnClose",!1);rr(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});rr(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});rr(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 i=Vd();return this.subscriptions.set(i,{topic:t,listener:n,eventListener:r}),this.enqueue({v:1,type:"subscribe",id:i,topic:t}),()=>{this.subscriptions.delete(i),this.enqueue({v:1,type:"unsubscribe",id:i})}}subscribeTerminal(t,n){const r=Vd(),i={type:"terminal",terminalId:t};return this.subscriptions.set(r,{topic:i,listener:n.onSnapshot,eventListener:n.onEvent}),this.enqueue({v:1,type:"subscribe",id:r,topic:i}),()=>{this.subscriptions.delete(r),this.enqueue({v:1,type:"unsubscribe",id:r})}}command(t){const n=Vd(),r={v:1,type:"command",id:n,command:t};return new Promise((i,o)=>{this.pending.set(n,{resolve:i,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 i;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);(i=o==null?void 0:o.eventListener)==null||i.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(XF,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>=pZ}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()},vZ),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()},gZ))}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 _Z(e,t){var r;const n=e.find(i=>bh(i).some(o=>o.chatId===t));return n?((r=bh(n).find(i=>i.chatId!==t))==null?void 0:r.chatId)??null:null}function nT(e,t){var n;return((n=e.find(r=>bh(r).some(i=>i.chatId===t)))==null?void 0:n.groupKey)??null}function yZ(e,t){for(const n of e){const r=bh(n).find(i=>i.chatId===t);if(r)return r}return null}function xZ(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function wZ(){const e=v.useRef(null);return e.current||(e.current=new bZ(xZ())),v.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function Hd(e,t){if(t===void 0){console.info(`[useKaizenState] ${e}`);return}console.info(`[useKaizenState] ${e}`,t)}function T4(e){return e<24}function SZ(e){return Math.max(136,Math.round(e+24))}function CZ(e,t){return e==="awaiting_disconnect"&&t==="disconnected"?"awaiting_reconnect":e==="awaiting_reconnect"&&t==="connected"?"clear_phase":"none"}const N4=8e3;function kZ(e,t,n){return e==="awaiting_reconnect"&&t==="disconnected"&&n>=N4}const $w=`${xg}ui-update-restart`;function X_(){return window.sessionStorage.getItem($w)}function rT(e){window.sessionStorage.setItem($w,e)}function Lm(){window.sessionStorage.removeItem($w)}function EZ(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 RZ(e,t){return!e||!t?null:e.runtime.chatId!==t?(Hd("stale snapshot masked",{routeChatId:t,snapshotChatId:e.runtime.chatId,snapshotProvider:e.runtime.provider}),null):e}function TZ(e){var tr,Ys,Xh;const{activeChatId:t,activeOverviewFeatureId:n}=e,r=Aa(),i=wZ(),o=i7(),[l,c]=v.useState({projectGroups:[]}),[h,d]=v.useState(null),[g,p]=v.useState(null),[b,y]=v.useState(null),[w,S]=v.useState(null),[C,k]=v.useState(null),[R,E]=v.useState(null),[N,L]=v.useState(null),[A,O]=v.useState("connecting"),[H,Z]=v.useState(!1),[I,q]=v.useState(!1),[F,$]=v.useState(!1),[W,K]=v.useState(null),[D,U]=v.useState(!1),[z,G]=v.useState(!1),[M,B]=v.useState(148),[X,j]=v.useState(!0),[ie,J]=v.useState(null),[ee,re]=v.useState(null),[ue,fe]=v.useState(null),[ge,Ce]=v.useState(null),[Re,je]=v.useState(!1),Qe=yi(Y=>Y.folderGroupsEnabled),yt=yi(Y=>Y.showFeatureOverviewInSidebar),Tt=yi(Y=>Y.kanbanStatusesEnabled),me=$X(Fi(Y=>Y.editorPreset)),Ue=v.useRef(null),Oe=v.useRef(null),mt=Jd(Y=>Y.setVisibility),[pt,ot]=v.useState(new Set),dn=v.useRef(new Map),Nt=v.useRef(t),In=v.useRef(typeof document<"u"?document.visibilityState==="visible":!0),de=v.useRef(!1),oe=v.useRef(null),xe=v.useRef(new Map);v.useEffect(()=>i.onStatus(O),[i]),v.useEffect(()=>{Nt.current=t},[t]),v.useEffect(()=>{function Y(){const ne=document.visibilityState==="visible";if(In.current=ne,ne){const Se=Nt.current;Se&&ot(Ve=>{if(!Ve.has(Se))return Ve;const It=new Set(Ve);return It.delete(Se),It})}}return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)},[]),v.useEffect(()=>i.subscribe({type:"sidebar"},Y=>{const ne=new Map;for(const En of Y.projectGroups)for(const Cr of[...En.generalChats,...En.features.flatMap(Gr=>Gr.chats)])ne.set(Cr.chatId,Cr.status);const Se=dn.current,Ve=Nt.current,It=In.current;ot(En=>{let Cr=En;for(const[Gr,Zh]of ne){const Ru=Se.get(Gr);Y_(Zh)&&Cr.has(Gr)&&(Cr===En&&(Cr=new Set(En)),Cr.delete(Gr)),Ru&&Y_(Ru)&&Zh==="idle"&&(Gr!==Ve||!It)&&(Cr===En&&(Cr=new Set(En)),Cr.add(Gr))}return Cr}),dn.current=ne,c(Y),Z(!0),J(null)}),[i]),v.useEffect(()=>i.subscribe({type:"local-projects"},Y=>{d(Y),q(!0),J(null)}),[i]),v.useEffect(()=>i.subscribe({type:"update"},Y=>{p(Y),J(null)}),[i]),v.useEffect(()=>{A==="connected"&&i.command({type:"update.check",force:!0}).catch(Y=>{J(Y instanceof Error?Y.message:String(Y))})},[A,i]),v.useEffect(()=>{const Y=X_(),ne=CZ(Y,A);if(ne==="awaiting_reconnect"){rT("awaiting_reconnect");return}ne==="clear_phase"&&Lm()},[A,r]),v.useEffect(()=>{if(X_()!=="awaiting_reconnect"||A!=="disconnected")return;const ne=Date.now(),Se=window.setTimeout(()=>{kZ(X_(),A,Date.now()-ne)&&Lm()},N4);return()=>{window.clearTimeout(Se)}},[A]),v.useEffect(()=>{function Y(){g!=null&&g.lastCheckedAt&&(Date.now()-g.lastCheckedAt<=3600*1e3||i.command({type:"update.check"}).catch(ne=>{J(ne instanceof Error?ne.message:String(ne))}))}return window.addEventListener("focus",Y),()=>{window.removeEventListener("focus",Y)}},[i,g==null?void 0:g.lastCheckedAt]),v.useEffect(()=>i.subscribe({type:"keybindings"},Y=>{k(Y),J(null)}),[i]),v.useEffect(()=>i.subscribe({type:"theme-settings"},Y=>{E(Y),yn.setState({themePreference:Y.settings.themePreference,themeId:Y.settings.themeId,customAppearance:Y.settings.customAppearance,backgroundImage:Y.settings.backgroundImage,backgroundOpacity:Y.settings.backgroundOpacity,backgroundBlur:Y.settings.backgroundBlur,showProjectIconsInSidebar:Y.settings.showProjectIconsInSidebar,availableThemes:Y.availableThemes,themeCssText:Y.themeCssText})}),[i]),v.useEffect(()=>i.subscribe({type:"provider-settings"},Y=>{L(Y),J(null)}),[i]),v.useEffect(()=>{if(!t){Hd("clearing chat snapshot for non-chat route"),y(null),$(!0);return}return Hd("subscribing to chat",{activeChatId:t}),y(null),$(!1),i.subscribe({type:"chat",chatId:t},Y=>{Hd("chat snapshot received",{activeChatId:t,snapshotChatId:(Y==null?void 0:Y.runtime.chatId)??null,snapshotProvider:(Y==null?void 0:Y.runtime.provider)??null,snapshotStatus:(Y==null?void 0:Y.runtime.status)??null}),y(Y),$(!0),J(null)})},[t,i]),v.useEffect(()=>{if(!n){S(null);return}return S(null),i.subscribe({type:"feature-overview",featureId:n},Y=>{S(Y),J(null)})},[n,i]),v.useEffect(()=>{t&&ot(Y=>{if(!Y.has(t))return Y;const ne=new Set(Y);return ne.delete(t),ne})},[t]),v.useEffect(()=>{if(!t)return;const Y=nT(l.projectGroups,t);Y&&mt(Y,!1)},[t,mt,l.projectGroups]),v.useEffect(()=>{n&&w&&K(w.projectId)},[n,w]),v.useEffect(()=>{if(W)return;const Y=l.projectGroups[0];Y&&K(Y.groupKey)},[W,l.projectGroups]),v.useEffect(()=>{if(!t||!H||!F)return;if(l.projectGroups.some(ne=>bh(ne).some(Se=>Se.chatId===t))){ue===t&&fe(null);return}ue!==t&&r("/")},[t,F,r,ue,l.projectGroups,H]),v.useEffect(()=>{b&&(K(b.runtime.projectId),ue===b.runtime.chatId&&fe(null))},[b,ue]),v.useEffect(()=>{de.current=!1,oe.current!==null&&(window.cancelAnimationFrame(oe.current),oe.current=null),j(!0)},[t]),v.useEffect(()=>()=>{oe.current!==null&&window.cancelAnimationFrame(oe.current)},[]),v.useLayoutEffect(()=>{const Y=Oe.current;if(!Y)return;const ne=new ResizeObserver(()=>{B(Y.getBoundingClientRect().height)});return ne.observe(Y),B(Y.getBoundingClientRect().height),()=>ne.disconnect()},[]);const ke=v.useMemo(()=>RZ(b,t),[t,b]);v.useEffect(()=>{Hd("active snapshot resolved",{routeChatId:t,rawSnapshotChatId:(b==null?void 0:b.runtime.chatId)??null,rawSnapshotProvider:(b==null?void 0:b.runtime.provider)??null,activeSnapshotChatId:(ke==null?void 0:ke.runtime.chatId)??null,activeSnapshotProvider:(ke==null?void 0:ke.runtime.provider)??null,pendingChatId:ue})},[t,ke,b,ue]);const Ke=v.useMemo(()=>{const Y=ke;if(!Y)return[];const ne=Y.messages,Se=Y.runtime.chatId,Ve=ne.at(-1),It=`${ne.length}:${(Ve==null?void 0:Ve._id)??""}:${(Ve==null?void 0:Ve.createdAt)??0}`,En=xe.current.get(Se);if((En==null?void 0:En.signature)===It)return En.messages;const Cr=lZ(ne);return xe.current.set(Se,{signature:It,messages:Cr}),Cr},[ke]),ct=v.useMemo(()=>fZ(Ke),[Ke]),Je=(ke==null?void 0:ke.runtime)??null,Ae=(ke==null?void 0:ke.usage)??null,$e=(ke==null?void 0:ke.availableProviders)??W0((N==null?void 0:N.settings)??lr),lt=Y_(Je==null?void 0:Je.status),Fe=mZ(Je==null?void 0:Je.status),hn=SZ(M),qt=!X&&Ke.length>0,bn=((tr=h==null?void 0:h.projects[0])==null?void 0:tr.localPath)??null,dr=(w==null?void 0:w.localPath)??(Je==null?void 0:Je.localPath)??bn??((Ys=l.projectGroups[0])==null?void 0:Ys.localPath),er=(w==null?void 0:w.projectId)??(Je==null?void 0:Je.projectId)??null,Kt=!!(W??er??((Xh=l.projectGroups[0])==null?void 0:Xh.groupKey)??bn);v.useLayoutEffect(()=>{if(de.current)return;const Y=Ue.current;Y&&(t&&!Je||(Y.scrollTo({top:Y.scrollHeight,behavior:"auto"}),oe.current!==null&&window.cancelAnimationFrame(oe.current),oe.current=window.requestAnimationFrame(()=>{const ne=Ue.current;ne&&(ne.scrollTo({top:ne.scrollHeight,behavior:"auto"}),oe.current=null)}),de.current=!0))},[t,M,Ke.length,Je]),v.useEffect(()=>{if(!de.current||!X)return;const Y=window.requestAnimationFrame(()=>{const ne=Ue.current;!ne||!X||ne.scrollTo({top:ne.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(Y)},[t,M,X,Ke.length,Je==null?void 0:Je.status]);function Ft(){const Y=Ue.current;if(!Y)return;const ne=Y.scrollHeight-Y.scrollTop-Y.clientHeight;j(T4(ne))}function Pe(Y){const ne=Ue.current;j(!0),ne&&ne.scrollTo({top:ne.scrollHeight,behavior:Y})}function vt(){Pe("smooth")}async function kt(Y,ne){Bi.getState().initializeComposerForNewChat();const Se=await i.command({type:"chat.create",projectId:Y,featureId:ne});K(Y),fe(Se.chatId),r(`/chat/${Se.chatId}`),U(!1),J(null)}async function Et(Y,ne=yi.getState().commitProjectMetadataDirectory){await i.command({type:"project.setProjectMetadataDirectoryCommitMode",projectId:Y.projectId,localPath:Y.localPath,commitProjectMetadata:ne})}async function fn(Y){return Y.kind==="project_id"?{projectId:Y.projectId}:Y.kind==="local_path"?{projectId:(await i.command({type:"project.open",localPath:Y.localPath})).projectId,localPath:Y.localPath}:{projectId:(await i.command(Y.project.mode==="new"?{type:"project.create",localPath:Y.project.localPath,title:Y.project.title}:{type:"project.open",localPath:Y.project.localPath})).projectId,localPath:Y.project.localPath}}async function ze(Y){try{const ne=Y.kind==="project_id"?null:Y.kind==="local_path"?Y.localPath:Y.project.localPath;ne&&re(ne);const{projectId:Se}=await fn(Y);await Et({projectId:Se}),await kt(Se)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}finally{re(null)}}async function rt(Y){const ne=Y.split("/").filter(Boolean).pop()??Y;if(await o.confirm({title:"Hide Project",description:`Hide "${ne}" from ${Tn}? This only removes it from ${Tn} until you re-add it or reset local state.`,confirmLabel:"Hide",confirmVariant:"destructive"}))try{await i.command({type:"project.hide",localPath:Y}),J(null)}catch(Ve){J(Ve instanceof Error?Ve.message:String(Ve))}}async function xn(Y,ne){try{await kt(Y,ne)}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}function Te(Y){Ce(Y)}function Le(Y){r(`/overview/${Y}`),U(!1),J(null)}function Ot(){Ce(null)}async function ut(Y){const ne=ge;if(ne)try{const Se=await i.command({type:"feature.create",projectId:ne,title:Y.title,description:Y.description,generateOverview:yi.getState().showFeatureOverviewInSidebar});Ce(null),await kt(ne,Se.featureId)}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}async function mn(Y){const ne=l.projectGroups.flatMap(Ve=>Ve.features).find(Ve=>Ve.featureId===Y);if(!ne)return;const Se=await o.prompt({title:"Rename Feature",placeholder:"Feature name",initialValue:ne.title,confirmLabel:"Rename"});if(!(!Se||Se===ne.title))try{await i.command({type:"feature.rename",featureId:Y,title:Se}),J(null)}catch(Ve){J(Ve instanceof Error?Ve.message:String(Ve))}}async function Qt(Y){const ne=l.projectGroups.flatMap(Ve=>Ve.features).find(Ve=>Ve.featureId===Y);if(!(!ne||!await o.confirm({title:"Delete Feature",description:`Delete "${ne.title}"? Its chats will move to General and the feature folder will be removed.`,confirmLabel:"Delete",confirmVariant:"destructive"})))try{await i.command({type:"feature.delete",featureId:Y}),n===Y&&r("/"),J(null)}catch(Ve){J(Ve instanceof Error?Ve.message:String(Ve))}}async function rn(Y,ne){try{await i.command({type:"feature.setBrowserState",featureId:Y,browserState:ne}),J(null)}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}async function Gt(Y,ne){try{await i.command({type:"project.setBrowserState",projectId:Y,browserState:ne}),J(null)}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}async function $t(Y,ne){try{await i.command({type:"project.setGeneralChatsBrowserState",projectId:Y,browserState:ne}),J(null)}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}async function Ar(Y,ne){try{await i.command({type:"feature.setStage",featureId:Y,stage:ne}),J(null)}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}async function ms(Y,ne){try{const Se=await i.command({type:"feature.updateOverview",featureId:Y,content:ne});return J(null),Se}catch(Se){const Ve=Se instanceof Error?Se.message:String(Se);throw J(Ve),Se}}async function Hl(Y){try{await i.command({type:"provider.refreshUsage",provider:Y}),J(null)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function Po(Y){if(Y==="cursor")try{const ne=await i.command({type:"provider.browserLogin",provider:Y});if(ne.availability==="login_required"){ne.statusDetail==="browser_launch_failed"&&je(!0),J(ne.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}J(null)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function Io(Y){try{const ne=await i.command({type:"provider.importUsageCurl",provider:"cursor",curlCommand:Y});if(ne.availability==="login_required"&&ne.statusDetail==="invalid_curl_import"){J("Could not import that cURL command. Copy the get-current-period-usage request as cURL and paste it here.");return}je(!1),J(null)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function ps(Y,ne){try{await i.command({type:"chat.setFeature",chatId:Y,featureId:ne}),J(null)}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}async function Bo(Y,ne){try{await i.command({type:"feature.reorder",projectId:Y,orderedFeatureIds:ne}),J(null)}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}async function hr(Y){await ze({kind:"local_path",localPath:Y})}async function Ei(Y){await ze({kind:"project_request",project:Y})}async function qs(Y){try{await Promise.all(NZ((h==null?void 0:h.projects.map(ne=>({localPath:ne.localPath})))??l.projectGroups.map(ne=>({projectId:ne.groupKey,localPath:ne.localPath}))).map(ne=>Et(ne,Y))),J(null)}catch(ne){throw J(ne instanceof Error?ne.message:String(ne)),ne}}async function gs(Y){const ne=new URL("/api/directories",window.location.origin);Y&&ne.searchParams.set("path",Y);const Se=await fetch(ne.toString());if(!Se.ok){let It="Failed to load directories";try{const En=await Se.json();En.error&&(It=En.error)}catch{}throw new Error(It)}const Ve=await Se.json();return J(null),Ve}async function wn(Y){try{await i.command({type:"update.check",force:Y==null?void 0:Y.force}),J(null)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function $l(){try{const Y=await i.command({type:"update.install"});if(!Y.ok){Lm(),J(null),await o.alert({title:Y.userTitle??"Update failed",description:Y.userMessage??`${Tn} could not install the update. Try again later.`,closeLabel:"OK"});return}if(Y.ok&&Y.action==="reload"){window.location.reload();return}Y.ok&&Y.action==="restart"&&rT("awaiting_disconnect"),J(null)}catch(Y){Lm(),J(Y instanceof Error?Y.message:String(Y))}}async function Ul(Y,ne){var Se;try{let Ve=W??((Se=l.projectGroups[0])==null?void 0:Se.groupKey)??null;if(!t&&!Ve&&bn&&(Ve=(await i.command({type:"project.open",localPath:bn})).projectId,K(Ve)),!t&&!Ve)throw new Error("Open a project first");if(ne!=null&&ne.provider&&!sE(ne.provider,(N==null?void 0:N.settings)??lr))throw new Error(`${ne.provider} is inactive.`);if(Pe("auto"),ne!=null&&ne.provider&&!sE(ne.provider,(N==null?void 0:N.settings)??lr))throw new Error(`${ne.provider} is inactive.`);Pe("auto");const It=await i.command({type:"chat.send",chatId:t??void 0,projectId:t?void 0:Ve??void 0,provider:ne==null?void 0:ne.provider,message:Y,model:ne==null?void 0:ne.model,modelOptions:ne==null?void 0:ne.modelOptions,planMode:ne==null?void 0:ne.planMode});!t&&It.chatId&&(fe(It.chatId),r(`/chat/${It.chatId}`)),J(null)}catch(Ve){throw J(Ve instanceof Error?Ve.message:String(Ve)),Ve}}async function Ri(){if(t)try{await i.command({type:"chat.cancel",chatId:t})}catch(Y){J(Y instanceof Error?Y.message:String(Y))}}async function vs(Y){if(await o.confirm({title:"Delete Chat",description:`Delete "${Y.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await i.command({type:"chat.delete",chatId:Y.chatId}),Y.chatId===t){const Se=_Z(l.projectGroups,Y.chatId);r(Se?`/chat/${Se}`:"/")}}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}async function Vl(Y){const ne=l.projectGroups.find(It=>It.groupKey===Y);if(!ne)return;const Se=ne.localPath.split("/").filter(Boolean).pop()??ne.localPath;if(await o.confirm({title:"Hide Project",description:`Hide "${Se}" from ${Tn}? Existing chats for this project will be removed from ${Tn}, but the project itself is not deleted.`,confirmLabel:"Hide",confirmVariant:"destructive"}))try{await i.command({type:"project.remove",projectId:Y}),va.getState().clearProject(Y),Jd.getState().clearProject(Y),((Je==null?void 0:Je.projectId)??(w==null?void 0:w.projectId))===Y&&r("/"),J(null)}catch(It){J(It instanceof Error?It.message:String(It))}}async function Wl(Y){var Se,Ve;const ne=(Je==null?void 0:Je.localPath)??((Se=h==null?void 0:h.projects[0])==null?void 0:Se.localPath)??((Ve=l.projectGroups[0])==null?void 0:Ve.localPath);if(ne)try{await Jt({action:Y,localPath:ne})}catch(It){J(It instanceof Error?It.message:String(It))}}async function Ba(Y){try{await Jt({action:"open_editor",localPath:Y.path,line:Y.line,column:Y.column})}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function ql(Y,ne){try{await Jt({action:Y,localPath:ne})}catch(Se){J(Se instanceof Error?Se.message:String(Se))}}async function Ks(){var Y;try{J(null);const ne=await i.command({type:"settings.bootstrapCustomThemes"}),Se=(R==null?void 0:R.themesReadmeFileDisplay)??((Y=ne==null?void 0:ne.localPath)==null?void 0:Y.replace(/[/\\][^/\\]+$/,`${V(ne==null?void 0:ne.localPath)??"/"}THEME_README.md`))??nH();await Jt({action:"open_editor",localPath:Se})}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}function V(Y){return Y?Y.includes("\\")?"\\":"/":null}async function nt(){try{J(null);const Y=await i.command({type:"settings.reloadThemeSettings"});Y&&(E(Y),yn.setState({themePreference:Y.settings.themePreference,themeId:Y.settings.themeId,customAppearance:Y.settings.customAppearance,backgroundImage:Y.settings.backgroundImage,backgroundOpacity:Y.settings.backgroundOpacity,backgroundBlur:Y.settings.backgroundBlur,showProjectIconsInSidebar:Y.settings.showProjectIconsInSidebar,availableThemes:Y.availableThemes,themeCssText:Y.themeCssText}))}catch(Y){J(Y instanceof Error?Y.message:String(Y))}}async function Jt(Y){const ne=Fi.getState();J(null),await i.command({type:"system.openExternal",...Y,editor:Y.action==="open_editor"?{preset:ne.editorPreset,commandTemplate:ne.editorCommandTemplate}:void 0})}function Gs(){var Ve;const Y=t?yZ(l.projectGroups,t):null,ne=t?nT(l.projectGroups,t):null;if(Y&&ne){J(null),xn(ne,Y.featureId??void 0);return}const Se=EZ({selectedProjectId:W,sidebarProjectId:(Ve=l.projectGroups[0])==null?void 0:Ve.groupKey,fallbackLocalProjectPath:bn});if(Se){J(null),ze(Se);return}J("Open a project first")}async function Fa(Y,ne,Se){if(t)try{await i.command({type:"chat.respondTool",chatId:t,toolUseId:Y,result:{questions:ne,answers:Se}})}catch(Ve){J(Ve instanceof Error?Ve.message:String(Ve))}}async function en(Y,ne,Se,Ve,It){if(t){ne&&Bi.getState().setComposerPlanMode(!1);try{await i.command({type:"chat.respondTool",chatId:t,toolUseId:Y,result:{confirmed:ne,...Se?{clearContext:!0}:{},...Ve?{message:Ve}:{},...It?{attachments:It}:{}}})}catch(En){J(En instanceof Error?En.message:String(En))}}}return{socket:i,activeChatId:t,activeOverviewFeatureId:n,sidebarData:l,completedChatIds:pt,localProjects:h,updateSnapshot:g,chatSnapshot:b,featureOverviewSnapshot:w,keybindings:C,themeSettings:R,providerSettings:N,connectionStatus:A,sidebarReady:H,localProjectsReady:I,commandError:ie,startingLocalPath:ee,folderGroupsEnabled:Qe,showFeatureOverviewInSidebar:yt,kanbanStatusesEnabled:Tt,sidebarOpen:D,sidebarCollapsed:z,scrollRef:Ue,inputRef:Oe,messages:Ke,latestToolIds:ct,runtime:Je,usage:Ae,availableProviders:$e,isProcessing:lt,canCancel:Fe,transcriptPaddingBottom:hn,showScrollButton:qt,navbarLocalPath:dr,editorLabel:me,hasSelectedProject:Kt,createFeatureModalProjectId:ge,cursorCurlImportOpen:Re,openSidebar:()=>U(!0),closeSidebar:()=>U(!1),collapseSidebar:()=>G(!0),expandSidebar:()=>G(!1),toggleProjectsSidebar:Y=>{if(Y){U(!1),G(ne=>!ne);return}U(ne=>!ne)},updateScrollState:Ft,scrollToBottom:vt,handleCreateChat:xn,handleCreateFeature:Te,handleOpenFeatureOverview:Le,handleCloseCreateFeatureModal:Ot,handleConfirmCreateFeature:ut,handleRenameFeature:mn,handleDeleteFeature:Qt,handleSetProjectBrowserState:Gt,handleSetProjectGeneralChatsBrowserState:$t,handleSetFeatureBrowserState:rn,handleSetFeatureStage:Ar,handleSetChatFeature:ps,handleReorderFeatures:Bo,handleOpenLocalProject:hr,handleHideLocalProject:rt,handleListDirectories:gs,handleCreateProject:Ei,handleCheckForUpdates:wn,handleInstallUpdate:$l,handleRefreshProviderUsage:Hl,handleOpenProviderLogin:Po,handleCloseCursorCurlImport:()=>je(!1),handleSubmitCursorCurlImport:Io,handleSetCommitProjectMetadataDirectory:qs,handleSend:Ul,handleCancel:Ri,handleDeleteChat:vs,handleRemoveProject:Vl,handleUpdateFeatureOverview:ms,handleOpenExternal:Wl,handleOpenExternalPath:ql,handleOpenCustomThemes:Ks,handleRefreshThemeSettings:nt,handleOpenLocalLink:Ba,handleCompose:Gs,handleAskUserQuestion:Fa,handleExitPlanMode:en}}function bh(e){return[...e.features.flatMap(t=>t.chats),...e.generalChats]}function NZ(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 MZ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jZ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AZ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DZ={};function iT(e,t){return(DZ.jsx?AZ:jZ).test(e)}const OZ=/[ \t\n\f\r]/g;function LZ(e){return typeof e=="object"?e.type==="text"?sT(e.value):!1:sT(e)}function sT(e){return e.replace(OZ,"")===""}class Kh{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Kh.prototype.normal={};Kh.prototype.property={};Kh.prototype.space=void 0;function M4(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Kh(n,r,t)}function Xx(e){return e.toLowerCase()}class li{constructor(t,n){this.attribute=n,this.property=t}}li.prototype.attribute="";li.prototype.booleanish=!1;li.prototype.boolean=!1;li.prototype.commaOrSpaceSeparated=!1;li.prototype.commaSeparated=!1;li.prototype.defined=!1;li.prototype.mustUseProperty=!1;li.prototype.number=!1;li.prototype.overloadedBoolean=!1;li.prototype.property="";li.prototype.spaceSeparated=!1;li.prototype.space=void 0;let zZ=0;const _t=Fl(),Xn=Fl(),Zx=Fl(),Ee=Fl(),_n=Fl(),Gc=Fl(),_i=Fl();function Fl(){return 2**++zZ}const Qx=Object.freeze(Object.defineProperty({__proto__:null,boolean:_t,booleanish:Xn,commaOrSpaceSeparated:_i,commaSeparated:Gc,number:Ee,overloadedBoolean:Zx,spaceSeparated:_n},Symbol.toStringTag,{value:"Module"})),Z_=Object.keys(Qx);class Uw extends li{constructor(t,n,r,i){let o=-1;if(super(t,n),oT(this,"space",i),typeof r=="number")for(;++o<Z_.length;){const l=Z_[o];oT(this,Z_[o],(r&Qx[l])===Qx[l])}}}Uw.prototype.defined=!0;function oT(e,t,n){n&&(e[t]=n)}function wu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Uw(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Xx(r)]=r,n[Xx(o.attribute)]=r}return new Kh(t,n,e.space)}const j4=wu({properties:{ariaActiveDescendant:null,ariaAtomic:Xn,ariaAutoComplete:null,ariaBusy:Xn,ariaChecked:Xn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:_n,ariaCurrent:null,ariaDescribedBy:_n,ariaDetails:null,ariaDisabled:Xn,ariaDropEffect:_n,ariaErrorMessage:null,ariaExpanded:Xn,ariaFlowTo:_n,ariaGrabbed:Xn,ariaHasPopup:null,ariaHidden:Xn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_n,ariaLevel:Ee,ariaLive:null,ariaModal:Xn,ariaMultiLine:Xn,ariaMultiSelectable:Xn,ariaOrientation:null,ariaOwns:_n,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:Xn,ariaReadOnly:Xn,ariaRelevant:null,ariaRequired:Xn,ariaRoleDescription:_n,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:Xn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function A4(e,t){return t in e?e[t]:t}function D4(e,t){return A4(e,t.toLowerCase())}const PZ=wu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gc,acceptCharset:_n,accessKey:_n,action:null,allow:null,allowFullScreen:_t,allowPaymentRequest:_t,allowUserMedia:_t,alt:null,as:null,async:_t,autoCapitalize:null,autoComplete:_n,autoFocus:_t,autoPlay:_t,blocking:_n,capture:null,charSet:null,checked:_t,cite:null,className:_n,cols:Ee,colSpan:null,content:null,contentEditable:Xn,controls:_t,controlsList:_n,coords:Ee|Gc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_t,defer:_t,dir:null,dirName:null,disabled:_t,download:Zx,draggable:Xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_t,formTarget:null,headers:_n,height:Ee,hidden:Zx,high:Ee,href:null,hrefLang:null,htmlFor:_n,httpEquiv:_n,id:null,imageSizes:null,imageSrcSet:null,inert:_t,inputMode:null,integrity:null,is:null,isMap:_t,itemId:null,itemProp:_n,itemRef:_n,itemScope:_t,itemType:_n,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_t,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:_t,muted:_t,name:null,nonce:null,noModule:_t,noValidate:_t,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:_t,optimum:Ee,pattern:null,ping:_n,placeholder:null,playsInline:_t,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_t,referrerPolicy:null,rel:_n,required:_t,reversed:_t,rows:Ee,rowSpan:Ee,sandbox:_n,scope:null,scoped:_t,seamless:_t,selected:_t,shadowRootClonable:_t,shadowRootDelegatesFocus:_t,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:Xn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:_t,useMap:null,value:Xn,width:Ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_n,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_t,declare:_t,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:_t,noHref:_t,noShade:_t,noWrap:_t,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:Xn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:_t,disableRemotePlayback:_t,prefix:null,property:null,results:Ee,security:null,unselectable:null},space:"html",transform:D4}),IZ=wu({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:_i,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:_n,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:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:_t,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,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:Gc,g2:Gc,glyphName:Gc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:_i,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,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:Ee,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:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_n,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_i,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_i,rev:_i,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_i,requiredFeatures:_i,requiredFonts:_i,requiredFormats:_i,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:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:_i,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_i,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_i,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A4}),O4=wu({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()}}),L4=wu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:D4}),z4=wu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),BZ={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"},FZ=/[A-Z]/g,aT=/-[a-z]/g,HZ=/^data[-\w.:]+$/i;function $Z(e,t){const n=Xx(t);let r=t,i=li;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HZ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(aT,VZ);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!aT.test(o)){let l=o.replace(FZ,UZ);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Uw}return new i(r,t)}function UZ(e){return"-"+e.toLowerCase()}function VZ(e){return e.charAt(1).toUpperCase()}const WZ=M4([j4,PZ,O4,L4,z4],"html"),Vw=M4([j4,IZ,O4,L4,z4],"svg");function qZ(e){return e.join(" ").trim()}var jc={},Q_,lT;function KZ(){if(lT)return Q_;lT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,h=`
|
|
623
|
+
`,d="/",g="*",p="",b="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 N(W){var K=W.match(t);K&&(R+=K.length);var D=W.lastIndexOf(h);E=~D?W.length-D:E+W.length}function L(){var W={line:R,column:E};return function(K){return K.position=new A(W),Z(),K}}function A(W){this.start=W,this.end={line:R,column:E},this.source=k.source}A.prototype.content=C;function O(W){var K=new Error(k.source+":"+R+":"+E+": "+W);if(K.reason=W,K.filename=k.source,K.line=R,K.column=E,K.source=C,!k.silent)throw K}function H(W){var K=W.exec(C);if(K){var D=K[0];return N(D),C=C.slice(D.length),K}}function Z(){H(n)}function I(W){var K;for(W=W||[];K=q();)K!==!1&&W.push(K);return W}function q(){var W=L();if(!(d!=C.charAt(0)||g!=C.charAt(1))){for(var K=2;p!=C.charAt(K)&&(g!=C.charAt(K)||d!=C.charAt(K+1));)++K;if(K+=2,p===C.charAt(K-1))return O("End of comment missing");var D=C.slice(2,K-2);return E+=2,N(D),C=C.slice(K),E+=2,W({type:b,comment:D})}}function F(){var W=L(),K=H(r);if(K){if(q(),!H(i))return O("property missing ':'");var D=H(o),U=W({type:y,property:S(K[0].replace(e,p)),value:D?S(D[0].replace(e,p)):p});return H(l),U}}function $(){var W=[];I(W);for(var K;K=F();)K!==!1&&(W.push(K),I(W));return W}return Z(),$()}function S(C){return C?C.replace(c,p):p}return Q_=w,Q_}var cT;function GZ(){if(cT)return jc;cT=1;var e=jc&&jc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(jc,"__esModule",{value:!0}),jc.default=n;const t=e(KZ());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),c=typeof i=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:g}=h;c?i(d,g,h):g&&(o=o||{},o[d]=g)}),o}return jc}var Ed={},uT;function YZ(){if(uT)return Ed;uT=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},l=function(d,g){return g.toUpperCase()},c=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(i,c):d=d.replace(r,c),d.replace(t,l))};return Ed.camelCase=h,Ed}var Rd,dT;function XZ(){if(dT)return Rd;dT=1;var e=Rd&&Rd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(GZ()),n=YZ();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(c,h){c&&h&&(l[(0,n.camelCase)(c,o)]=h)}),l}return r.default=r,Rd=r,Rd}var ZZ=XZ();const QZ=Zp(ZZ),P4=I4("end"),Ww=I4("start");function I4(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 JZ(e){const t=Ww(e),n=P4(e);if(t&&n)return{start:t,end:n}}function eh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?hT(e.position):"start"in e||"end"in e?hT(e):"line"in e||"column"in e?Jx(e):""}function Jx(e){return fT(e&&e.line)+":"+fT(e&&e.column)}function hT(e){return Jx(e&&e.start)+"-"+Jx(e&&e.end)}function fT(e){return e&&typeof e=="number"?e:1}class Ir extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",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"?i=t:!o.cause&&t&&(l=!0,i=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 c=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=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=eh(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}}Ir.prototype.file="";Ir.prototype.name="";Ir.prototype.reason="";Ir.prototype.message="";Ir.prototype.stack="";Ir.prototype.column=void 0;Ir.prototype.line=void 0;Ir.prototype.ancestors=void 0;Ir.prototype.cause=void 0;Ir.prototype.fatal=void 0;Ir.prototype.place=void 0;Ir.prototype.ruleId=void 0;Ir.prototype.source=void 0;const qw={}.hasOwnProperty,eQ=new Map,tQ=/[A-Z]/g,nQ=new Set(["table","tbody","thead","tfoot","tr"]),rQ=new Set(["td","th"]),B4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function iQ(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=hQ(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=dQ(n,t.jsx,t.jsxs)}const i={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"?Vw:WZ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=F4(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function F4(e,t,n){if(t.type==="element")return sQ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return oQ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lQ(e,t,n);if(t.type==="mdxjsEsm")return aQ(e,t);if(t.type==="root")return cQ(e,t,n);if(t.type==="text")return uQ(e,t)}function sQ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vw,e.schema=i),e.ancestors.push(t);const o=$4(e,t.tagName,!1),l=fQ(e,t);let c=Gw(e,t);return nQ.has(t.tagName)&&(c=c.filter(function(h){return typeof h=="string"?!LZ(h):!0})),H4(e,l,o,t),Kw(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function oQ(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)}_h(e,t.position)}function aQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_h(e,t.position)}function lQ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vw,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:$4(e,t.name,!0),l=mQ(e,t),c=Gw(e,t);return H4(e,l,o,t),Kw(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function cQ(e,t,n){const r={};return Kw(r,Gw(e,t)),e.create(t,e.Fragment,r,n)}function uQ(e,t){return t.value}function H4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Kw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dQ(e,t,n){return r;function r(i,o,l,c){const d=Array.isArray(l.children)?n:t;return c?d(o,l,c):d(o,l)}}function hQ(e,t){return n;function n(r,i,o,l){const c=Array.isArray(o.children),h=Ww(r);return t(i,o,l,c,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function fQ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&qw.call(t.properties,i)){const o=pQ(e,i,t.properties[i]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&rQ.has(t.tagName)?r=c:n[l]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mQ(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 c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else _h(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else _h(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Gw(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:eQ;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=i.get(h)||0;l=h+"-"+d,i.set(h,d+1)}}const c=F4(e,o,l);c!==void 0&&n.push(c)}return n}function pQ(e,t,n){const r=$Z(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?MZ(n):qZ(n)),r.property==="style"){let i=typeof n=="object"?n:gQ(e,String(n));return e.stylePropertyNameCase==="css"&&(i=vQ(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?BZ[r.property]||r.property:r.attribute,n]}}function gQ(e,t){try{return QZ(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ir("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=B4+"#cannot-parse-style-attribute",i}}function $4(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const c=iT(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=l}else r=iT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return qw.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);_h(e)}function _h(e,t){const n=new Ir("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=B4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function vQ(e){const t={};let n;for(n in e)qw.call(e,n)&&(t[bQ(n)]=e[n]);return t}function bQ(e){let t=e.replace(tQ,_Q);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function _Q(e){return"-"+e.toLowerCase()}const J_={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"]},yQ={};function Yw(e,t){const n=yQ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return U4(e,r,i)}function U4(e,t,n){if(xQ(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 mT(e.children,t,n)}return Array.isArray(e)?mT(e,t,n):""}function mT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=U4(e[i],t,n);return r.join("")}function xQ(e){return!!(e&&typeof e=="object")}const pT=document.createElement("i");function Xw(e){const t="&"+e+";";pT.innerHTML=t;const n=pT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Si(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i: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 Vi(e,t){return e.length>0?(Si(e,e.length,0,t),e):t}const gT={}.hasOwnProperty;function V4(e){const t={};let n=-1;for(;++n<e.length;)wQ(t,e[n]);return t}function wQ(e,t){let n;for(n in t){const i=(gT.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){gT.call(i,l)||(i[l]=[]);const c=o[l];SQ(i[l],Array.isArray(c)?c:c?[c]:[])}}}function SQ(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Si(e,0,0,r)}function W4(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 ls(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ur=Ia(/[A-Za-z]/),zr=Ia(/[\dA-Za-z]/),CQ=Ia(/[#-'*+\--9=?A-Z^-~]/);function Hp(e){return e!==null&&(e<32||e===127)}const e0=Ia(/\d/),kQ=Ia(/[\dA-Fa-f]/),EQ=Ia(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function vn(e){return e!==null&&(e<0||e===32)}function At(e){return e===-2||e===-1||e===32}const Fg=Ia(new RegExp("\\p{P}|\\p{S}","u")),Al=Ia(/\s/);function Ia(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Su(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&zr(e.charCodeAt(n+1))&&zr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(l=String.fromCharCode(o,c),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Bt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(h){return At(h)?(e.enter(n),c(h)):t(h)}function c(h){return At(h)&&o++<i?(e.consume(h),c):(e.exit(n),t(h))}}const RQ={tokenize:TQ};function TQ(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Bt(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),o(c)}function o(c){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return it(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),l)}}const NQ={tokenize:MQ},vT={tokenize:jQ};function MQ(e){const t=this,n=[];let r=0,i,o,l;return c;function c(E){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,h,d)(E)}return d(E)}function h(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&R();const N=t.events.length;let L=N,A;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){A=t.events[L][1].end;break}k(r);let O=N;for(;O<t.events.length;)t.events[O][1].end={...A},O++;return Si(t.events,L+1,0,t.events.slice(N)),t.events.length=O,d(E)}return c(E)}function d(E){if(r===n.length){if(!i)return b(E);if(i.currentConstruct&&i.currentConstruct.concrete)return w(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(vT,g,p)(E)}function g(E){return i&&R(),k(r),b(E)}function p(E){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(E)}function b(E){return t.containerState={},e.attempt(vT,y,w)(E)}function y(E){return r++,n.push([t.currentConstruct,t.containerState]),b(E)}function w(E){if(E===null){i&&R(),k(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(E)}function S(E){if(E===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(E);return}return it(E)?(e.consume(E),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(E),S)}function C(E,N){const L=t.sliceStream(E);if(N&&L.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(L),t.parser.lazy[E.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<l&&(!i.events[A][1].end||i.events[A][1].end.offset>l))return;const O=t.events.length;let H=O,Z,I;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(Z){I=t.events[H][1].end;break}Z=!0}for(k(r),A=O;A<t.events.length;)t.events[A][1].end={...I},A++;Si(t.events,H+1,0,t.events.slice(O)),t.events.length=A}}function k(E){let N=n.length;for(;N-- >E;){const L=n[N];t.containerState=L[1],L[0].exit.call(t,e)}n.length=E}function R(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function jQ(e,t,n){return Bt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nu(e){if(e===null||vn(e)||Al(e))return 1;if(Fg(e))return 2}function Hg(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const t0={name:"attention",resolveAll:AQ,tokenize:DQ};function AQ(e,t){let n=-1,r,i,o,l,c,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},b={...e[n][1].start};bT(p,-h),bT(b,h),l={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},c={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:h>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Vi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Vi(d,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=Vi(d,Hg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Vi(d,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,d=Vi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Si(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 DQ(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nu(r);let o;return l;function l(h){return o=h,e.enter("attentionSequence"),c(h)}function c(h){if(h===o)return e.consume(h),c;const d=e.exit("attentionSequence"),g=nu(h),p=!g||g===2&&i||n.includes(h),b=!i||i===2&&g||n.includes(r);return d._open=!!(o===42?p:p&&(i||!b)),d._close=!!(o===42?b:b&&(g||!p)),t(h)}}function bT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const OQ={name:"autolink",tokenize:LQ};function LQ(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return Ur(y)?(e.consume(y),l):y===64?n(y):d(y)}function l(y){return y===43||y===45||y===46||zr(y)?(r=1,c(y)):d(y)}function c(y){return y===58?(e.consume(y),r=0,h):(y===43||y===45||y===46||zr(y))&&r++<32?(e.consume(y),c):(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||Hp(y)?n(y):(e.consume(y),h)}function d(y){return y===64?(e.consume(y),g):CQ(y)?(e.consume(y),d):n(y)}function g(y){return zr(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):b(y)}function b(y){if((y===45||zr(y))&&r++<63){const w=y===45?b:p;return e.consume(y),w}return n(y)}}const Gh={partial:!0,tokenize:zQ};function zQ(e,t,n){return r;function r(o){return At(o)?Bt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||it(o)?t(o):n(o)}}const q4={continuation:{tokenize:IQ},exit:BQ,name:"blockQuote",tokenize:PQ};function PQ(e,t,n){const r=this;return i;function i(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return At(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function IQ(e,t,n){const r=this;return i;function i(l){return At(l)?Bt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(q4,t,n)(l)}}function BQ(e){e.exit("blockQuote")}const K4={name:"characterEscape",tokenize:FQ};function FQ(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return EQ(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const G4={name:"characterReference",tokenize:HQ};function HQ(e,t,n){const r=this;let i=0,o,l;return c;function c(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=zr,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=kQ,g):(e.enter("characterReferenceValue"),o=7,l=e0,g(p))}function g(p){if(p===59&&i){const b=e.exit("characterReferenceValue");return l===zr&&!Xw(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&i++<o?(e.consume(p),g):n(p)}}const _T={partial:!0,tokenize:UQ},yT={concrete:!0,name:"codeFenced",tokenize:$Q};function $Q(e,t,n){const r=this,i={partial:!0,tokenize:L};let o=0,l=0,c;return h;function h(A){return d(A)}function d(A){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,c=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(A)}function g(A){return A===c?(l++,e.consume(A),g):l<3?n(A):(e.exit("codeFencedFenceSequence"),At(A)?Bt(e,p,"whitespace")(A):p(A))}function p(A){return A===null||it(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(_T,S,N)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||it(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):At(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Bt(e,y,"whitespace")(A)):A===96&&A===c?n(A):(e.consume(A),b)}function y(A){return A===null||it(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||it(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===c?n(A):(e.consume(A),w)}function S(A){return e.attempt(i,N,C)(A)}function C(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),k}function k(A){return o>0&&At(A)?Bt(e,R,"linePrefix",o+1)(A):R(A)}function R(A){return A===null||it(A)?e.check(_T,S,N)(A):(e.enter("codeFlowValue"),E(A))}function E(A){return A===null||it(A)?(e.exit("codeFlowValue"),R(A)):(e.consume(A),E)}function N(A){return e.exit("codeFenced"),t(A)}function L(A,O,H){let Z=0;return I;function I(K){return A.enter("lineEnding"),A.consume(K),A.exit("lineEnding"),q}function q(K){return A.enter("codeFencedFence"),At(K)?Bt(A,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):F(K)}function F(K){return K===c?(A.enter("codeFencedFenceSequence"),$(K)):H(K)}function $(K){return K===c?(Z++,A.consume(K),$):Z>=l?(A.exit("codeFencedFenceSequence"),At(K)?Bt(A,W,"whitespace")(K):W(K)):H(K)}function W(K){return K===null||it(K)?(A.exit("codeFencedFence"),O(K)):H(K)}}}function UQ(e,t,n){const r=this;return i;function i(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 ey={name:"codeIndented",tokenize:WQ},VQ={partial:!0,tokenize:qQ};function WQ(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Bt(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):it(d)?e.attempt(VQ,l,h)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||it(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function h(d){return e.exit("codeIndented"),t(d)}}function qQ(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):it(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Bt(e,o,"linePrefix",5)(l)}function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):it(l)?i(l):n(l)}}const KQ={name:"codeText",previous:YQ,resolve:GQ,tokenize:XQ};function GQ(e){let t=e.length-4,n=3,r,i;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;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function YQ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function XQ(e,t,n){let r=0,i,o;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),r++,c):(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"),i=0,g(p)):it(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||it(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),d)}function g(p){return p===96?(e.consume(p),i++,g):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(o.type="codeTextData",d(p))}}class ZQ{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 i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Td(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),Td(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Td(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);Td(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Td(this.left,n.reverse())}}}function Td(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 Y4(e){const t={};let n=-1,r,i,o,l,c,h,d;const g=new ZQ(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,QQ(g,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=g.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(g.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...g.get(i)[1].start},c=g.slice(i,n),c.unshift(r),g.splice(i,n-i+1,c))}}return Si(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function QQ(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,h=[],d={};let g,p,b=-1,y=n,w=0,S=0;const C=[S];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),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;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(S=b+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(),b=C.length;b--;){const k=c.slice(C[b],C[b+1]),R=o.pop();h.push([R,R+k.length-1]),e.splice(R,2,k)}for(h.reverse(),b=-1;++b<h.length;)d[w+h[b][0]]=w+h[b][1],w+=h[b][1]-h[b][0]-1;return d}const JQ={resolve:tJ,tokenize:nJ},eJ={partial:!0,tokenize:rJ};function tJ(e){return Y4(e),e}function nJ(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?o(c):it(c)?e.check(eJ,l,o)(c):(e.consume(c),i)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function rJ(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Bt(e,o,"linePrefix")}function o(l){if(l===null||it(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function X4(e,t,n,r,i,o,l,c,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return p;function p(k){return k===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(k),e.exit(o),b):k===null||k===32||k===41||Hp(k)?n(k):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(k))}function b(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===62?(e.exit("chunkString"),e.exit(c),b(k)):k===null||k===60||it(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||vn(k))?(e.exit("chunkString"),e.exit(c),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||Hp(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 Z4(e,t,n,r,i,o){const l=this;let c=0,h;return d;function d(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),g}function g(y){return c>999||y===null||y===91||y===93&&!h||y===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):it(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||it(y)||c++>999?(e.exit("chunkString"),g(y)):(e.consume(y),h||(h=!At(y)),y===92?b:p)}function b(y){return y===91||y===92||y===93?(e.consume(y),c++,p):p(y)}}function Q4(e,t,n,r,i,o){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(r),e.enter(i),e.consume(b),e.exit(i),l=b===40?41:b,h):n(b)}function h(b){return b===l?(e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):(e.enter(o),d(b))}function d(b){return b===l?(e.exit(o),h(l)):b===null?n(b):it(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Bt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===l||b===null||it(b)?(e.exit("chunkString"),d(b)):(e.consume(b),b===92?p:g)}function p(b){return b===l||b===92?(e.consume(b),g):g(b)}}function th(e,t){let n;return r;function r(i){return it(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):At(i)?Bt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const iJ={name:"definition",tokenize:oJ},sJ={partial:!0,tokenize:aJ};function oJ(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),l(y)}function l(y){return Z4.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return i=ls(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 vn(y)?th(e,d)(y):d(y)}function d(y){return X4(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(sJ,p,p)(y)}function p(y){return At(y)?Bt(e,b,"whitespace")(y):b(y)}function b(y){return y===null||it(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function aJ(e,t,n){return r;function r(c){return vn(c)?th(e,i)(c):n(c)}function i(c){return Q4(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return At(c)?Bt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||it(c)?t(c):n(c)}}const lJ={name:"hardBreakEscape",tokenize:cJ};function cJ(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return it(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const uJ={name:"headingAtx",resolve:dJ,tokenize:hJ};function dJ(e,t){let n=e.length-2,r=3,i,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&&(i={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"},Si(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function hJ(e,t,n){let r=0;return i;function i(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||vn(g)?(e.exit("atxHeadingSequence"),c(g)):n(g)}function c(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||it(g)?(e.exit("atxHeading"),t(g)):At(g)?Bt(e,c,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),c(g))}function d(g){return g===null||g===35||vn(g)?(e.exit("atxHeadingText"),c(g)):(e.consume(g),d)}}const fJ=["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"],xT=["pre","script","style","textarea"],mJ={concrete:!0,name:"htmlFlow",resolveTo:vJ,tokenize:bJ},pJ={partial:!0,tokenize:yJ},gJ={partial:!0,tokenize:_J};function vJ(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 bJ(e,t,n){const r=this;let i,o,l,c,h;return d;function d(j){return g(j)}function g(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),p}function p(j){return j===33?(e.consume(j),b):j===47?(e.consume(j),o=!0,S):j===63?(e.consume(j),i=3,r.interrupt?t:M):Ur(j)?(e.consume(j),l=String.fromCharCode(j),C):n(j)}function b(j){return j===45?(e.consume(j),i=2,y):j===91?(e.consume(j),i=5,c=0,w):Ur(j)?(e.consume(j),i=4,r.interrupt?t:M):n(j)}function y(j){return j===45?(e.consume(j),r.interrupt?t:M):n(j)}function w(j){const ie="CDATA[";return j===ie.charCodeAt(c++)?(e.consume(j),c===ie.length?r.interrupt?t:F:w):n(j)}function S(j){return Ur(j)?(e.consume(j),l=String.fromCharCode(j),C):n(j)}function C(j){if(j===null||j===47||j===62||vn(j)){const ie=j===47,J=l.toLowerCase();return!ie&&!o&&xT.includes(J)?(i=1,r.interrupt?t(j):F(j)):fJ.includes(l.toLowerCase())?(i=6,ie?(e.consume(j),k):r.interrupt?t(j):F(j)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):o?R(j):E(j))}return j===45||zr(j)?(e.consume(j),l+=String.fromCharCode(j),C):n(j)}function k(j){return j===62?(e.consume(j),r.interrupt?t:F):n(j)}function R(j){return At(j)?(e.consume(j),R):I(j)}function E(j){return j===47?(e.consume(j),I):j===58||j===95||Ur(j)?(e.consume(j),N):At(j)?(e.consume(j),E):I(j)}function N(j){return j===45||j===46||j===58||j===95||zr(j)?(e.consume(j),N):L(j)}function L(j){return j===61?(e.consume(j),A):At(j)?(e.consume(j),L):E(j)}function A(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),h=j,O):At(j)?(e.consume(j),A):H(j)}function O(j){return j===h?(e.consume(j),h=null,Z):j===null||it(j)?n(j):(e.consume(j),O)}function H(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||vn(j)?L(j):(e.consume(j),H)}function Z(j){return j===47||j===62||At(j)?E(j):n(j)}function I(j){return j===62?(e.consume(j),q):n(j)}function q(j){return j===null||it(j)?F(j):At(j)?(e.consume(j),q):n(j)}function F(j){return j===45&&i===2?(e.consume(j),D):j===60&&i===1?(e.consume(j),U):j===62&&i===4?(e.consume(j),B):j===63&&i===3?(e.consume(j),M):j===93&&i===5?(e.consume(j),G):it(j)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(pJ,X,$)(j)):j===null||it(j)?(e.exit("htmlFlowData"),$(j)):(e.consume(j),F)}function $(j){return e.check(gJ,W,X)(j)}function W(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),K}function K(j){return j===null||it(j)?$(j):(e.enter("htmlFlowData"),F(j))}function D(j){return j===45?(e.consume(j),M):F(j)}function U(j){return j===47?(e.consume(j),l="",z):F(j)}function z(j){if(j===62){const ie=l.toLowerCase();return xT.includes(ie)?(e.consume(j),B):F(j)}return Ur(j)&&l.length<8?(e.consume(j),l+=String.fromCharCode(j),z):F(j)}function G(j){return j===93?(e.consume(j),M):F(j)}function M(j){return j===62?(e.consume(j),B):j===45&&i===2?(e.consume(j),M):F(j)}function B(j){return j===null||it(j)?(e.exit("htmlFlowData"),X(j)):(e.consume(j),B)}function X(j){return e.exit("htmlFlow"),t(j)}}function _J(e,t,n){const r=this;return i;function i(l){return it(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 yJ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Gh,t,n)}}const xJ={name:"htmlText",tokenize:wJ};function wJ(e,t,n){const r=this;let i,o,l;return c;function c(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),h}function h(M){return M===33?(e.consume(M),d):M===47?(e.consume(M),L):M===63?(e.consume(M),E):Ur(M)?(e.consume(M),H):n(M)}function d(M){return M===45?(e.consume(M),g):M===91?(e.consume(M),o=0,w):Ur(M)?(e.consume(M),R):n(M)}function g(M){return M===45?(e.consume(M),y):n(M)}function p(M){return M===null?n(M):M===45?(e.consume(M),b):it(M)?(l=p,U(M)):(e.consume(M),p)}function b(M){return M===45?(e.consume(M),y):p(M)}function y(M){return M===62?D(M):M===45?b(M):p(M)}function w(M){const B="CDATA[";return M===B.charCodeAt(o++)?(e.consume(M),o===B.length?S:w):n(M)}function S(M){return M===null?n(M):M===93?(e.consume(M),C):it(M)?(l=S,U(M)):(e.consume(M),S)}function C(M){return M===93?(e.consume(M),k):S(M)}function k(M){return M===62?D(M):M===93?(e.consume(M),k):S(M)}function R(M){return M===null||M===62?D(M):it(M)?(l=R,U(M)):(e.consume(M),R)}function E(M){return M===null?n(M):M===63?(e.consume(M),N):it(M)?(l=E,U(M)):(e.consume(M),E)}function N(M){return M===62?D(M):E(M)}function L(M){return Ur(M)?(e.consume(M),A):n(M)}function A(M){return M===45||zr(M)?(e.consume(M),A):O(M)}function O(M){return it(M)?(l=O,U(M)):At(M)?(e.consume(M),O):D(M)}function H(M){return M===45||zr(M)?(e.consume(M),H):M===47||M===62||vn(M)?Z(M):n(M)}function Z(M){return M===47?(e.consume(M),D):M===58||M===95||Ur(M)?(e.consume(M),I):it(M)?(l=Z,U(M)):At(M)?(e.consume(M),Z):D(M)}function I(M){return M===45||M===46||M===58||M===95||zr(M)?(e.consume(M),I):q(M)}function q(M){return M===61?(e.consume(M),F):it(M)?(l=q,U(M)):At(M)?(e.consume(M),q):Z(M)}function F(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,$):it(M)?(l=F,U(M)):At(M)?(e.consume(M),F):(e.consume(M),W)}function $(M){return M===i?(e.consume(M),i=void 0,K):M===null?n(M):it(M)?(l=$,U(M)):(e.consume(M),$)}function W(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||vn(M)?Z(M):(e.consume(M),W)}function K(M){return M===47||M===62||vn(M)?Z(M):n(M)}function D(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function U(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),z}function z(M){return At(M)?Bt(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):G(M)}function G(M){return e.enter("htmlTextData"),l(M)}}const Zw={name:"labelEnd",resolveAll:EJ,resolveTo:RJ,tokenize:TJ},SJ={tokenize:NJ},CJ={tokenize:MJ},kJ={tokenize:jJ};function EJ(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 i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Si(e,0,e.length,n),e}function RJ(e,t){let n=e.length,r=0,i,o,l,c;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.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 c=[["enter",h,t],["enter",d,t]],c=Vi(c,e.slice(o+1,o+r+3)),c=Vi(c,[["enter",g,t]]),c=Vi(c,Hg(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=Vi(c,[["exit",g,t],e[l-2],e[l-1],["exit",d,t]]),c=Vi(c,e.slice(l+1)),c=Vi(c,[["exit",h,t]]),Si(e,o,e.length,c),e}function TJ(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return c;function c(b){return o?o._inactive?p(b):(l=r.parser.defined.includes(ls(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):n(b)}function h(b){return b===40?e.attempt(SJ,g,l?g:p)(b):b===91?e.attempt(CJ,g,l?d:p)(b):l?g(b):p(b)}function d(b){return e.attempt(kJ,g,p)(b)}function g(b){return t(b)}function p(b){return o._balanced=!0,n(b)}}function NJ(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return vn(p)?th(e,o)(p):o(p)}function o(p){return p===41?g(p):X4(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return vn(p)?th(e,h)(p):g(p)}function c(p){return n(p)}function h(p){return p===34||p===39||p===40?Q4(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function d(p){return vn(p)?th(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 MJ(e,t,n){const r=this;return i;function i(c){return Z4.call(r,e,o,l,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(ls(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function jJ(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const AJ={name:"labelStartImage",resolveAll:Zw.resolveAll,tokenize:DJ};function DJ(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const OJ={name:"labelStartLink",resolveAll:Zw.resolveAll,tokenize:LJ};function LJ(e,t,n){const r=this;return i;function i(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 ty={name:"lineEnding",tokenize:zJ};function zJ(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Bt(e,t,"linePrefix")}}const op={name:"thematicBreak",tokenize:PJ};function PJ(e,t,n){let r=0,i;return o;function o(d){return e.enter("thematicBreak"),l(d)}function l(d){return i=d,c(d)}function c(d){return d===i?(e.enter("thematicBreakSequence"),h(d)):r>=3&&(d===null||it(d))?(e.exit("thematicBreak"),t(d)):n(d)}function h(d){return d===i?(e.consume(d),r++,h):(e.exit("thematicBreakSequence"),At(d)?Bt(e,c,"whitespace")(d):c(d))}}const ri={continuation:{tokenize:HJ},exit:UJ,name:"list",tokenize:FJ},IJ={partial:!0,tokenize:VJ},BJ={partial:!0,tokenize:$J};function FJ(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return c;function c(y){const w=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:e0(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(op,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 e0(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(Gh,r.interrupt?n:g,e.attempt(IJ,b,p))}function g(y){return r.containerState.initialBlankLine=!0,o++,b(y)}function p(y){return At(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),b):n(y)}function b(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function HJ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Gh,i,o);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Bt(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!At(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(BJ,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Bt(e,e.attempt(ri,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function $J(e,t,n){const r=this;return Bt(e,i,"listItemIndent",r.containerState.size+1);function i(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 UJ(e){e.exit(this.containerState.type)}function VJ(e,t,n){const r=this;return Bt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!At(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const wT={name:"setextUnderline",resolveTo:WJ,tokenize:qJ};function WJ(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=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[i][1].type="setextHeadingText",o?(e.splice(i,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 qJ(e,t,n){const r=this;let i;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"),i=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===i?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),At(d)?Bt(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||it(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const KJ={tokenize:GJ};function GJ(e){const t=this,n=e.attempt(Gh,r,e.attempt(this.parser.constructs.flowInitial,i,Bt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(JQ,i)),"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 i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const YJ={resolveAll:eO()},XJ=J4("string"),ZJ=J4("text");function J4(e){return{resolveAll:eO(e==="text"?QJ:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,c);return l;function l(g){return d(g)?o(g):c(g)}function c(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=i[g];let b=-1;if(p)for(;++b<p.length;){const y=p[b];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function eO(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function QJ(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],i=t.sliceStream(r);let o=i.length,l=-1,c=0,h;for(;o--;){const d=i[o];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)h=!0,c++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||h||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},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 JJ={42:ri,43:ri,45:ri,48:ri,49:ri,50:ri,51:ri,52:ri,53:ri,54:ri,55:ri,56:ri,57:ri,62:q4},eee={91:iJ},tee={[-2]:ey,[-1]:ey,32:ey},nee={35:uJ,42:op,45:[wT,op],60:mJ,61:wT,95:op,96:yT,126:yT},ree={38:G4,92:K4},iee={[-5]:ty,[-4]:ty,[-3]:ty,33:AJ,38:G4,42:t0,60:[OQ,xJ],91:OJ,92:[lJ,K4],93:Zw,95:t0,96:KQ},see={null:[t0,YJ]},oee={null:[42,95]},aee={null:[]},lee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:oee,contentInitial:eee,disable:aee,document:JJ,flow:nee,flowInitial:tee,insideSpan:see,string:ree,text:iee},Symbol.toStringTag,{value:"Module"}));function cee(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 i={},o=[];let l=[],c=[];const h={attempt:O(L),check:O(A),consume:R,enter:E,exit:N,interrupt:O(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:S,events:[],now:w,parser:e,previous:null,sliceSerialize:b,sliceStream:y,write:p};let g=t.tokenize.call(d,h);return t.resolveAll&&o.push(t),d;function p(q){return l=Vi(l,q),C(),l[l.length-1]!==null?[]:(H(t,0),d.events=Hg(o,d.events,d),d.events)}function b(q,F){return dee(y(q),F)}function y(q){return uee(l,q)}function w(){const{_bufferIndex:q,_index:F,line:$,column:W,offset:K}=r;return{_bufferIndex:q,_index:F,line:$,column:W,offset:K}}function S(q){i[q.line]=q.column,I()}function C(){let q;for(;r._index<l.length;){const F=l[r._index];if(typeof F=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<F.length;)k(F.charCodeAt(r._bufferIndex));else k(F)}}function k(q){g=g(q)}function R(q){it(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,F){const $=F||{};return $.type=q,$.start=w(),d.events.push(["enter",$,d]),c.push($),$}function N(q){const F=c.pop();return F.end=w(),d.events.push(["exit",F,d]),F}function L(q,F){H(q,F.from)}function A(q,F){F.restore()}function O(q,F){return $;function $(W,K,D){let U,z,G,M;return Array.isArray(W)?X(W):"tokenize"in W?X([W]):B(W);function B(ee){return re;function re(ue){const fe=ue!==null&&ee[ue],ge=ue!==null&&ee.null,Ce=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return X(Ce)(ue)}}function X(ee){return U=ee,z=0,ee.length===0?D:j(ee[z])}function j(ee){return re;function re(ue){return M=Z(),G=ee,ee.partial||(d.currentConstruct=ee),ee.name&&d.parser.constructs.disable.null.includes(ee.name)?J():ee.tokenize.call(F?Object.assign(Object.create(d),F):d,h,ie,J)(ue)}}function ie(ee){return q(G,M),K}function J(ee){return M.restore(),++z<U.length?j(U[z]):D}}}function H(q,F){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&Si(d.events,F,d.events.length-F,q.resolve(d.events.slice(F),d)),q.resolveTo&&(d.events=q.resolveTo(d.events,d))}function Z(){const q=w(),F=d.previous,$=d.currentConstruct,W=d.events.length,K=Array.from(c);return{from:W,restore:D};function D(){r=q,d.previous=F,d.currentConstruct=$,d.events.length=W,c=K,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function uee(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function dee(e,t){let n=-1;const r=[];let i;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=`
|
|
624
|
+
`;break}case-3:{l=`\r
|
|
625
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function hee(e){const r={constructs:V4([lee,...(e||{}).extensions||[]]),content:i(RQ),defined:[],document:i(NQ),flow:i(KJ),lazy:{},string:i(XJ),text:i(ZJ)};return r;function i(o){return l;function l(c){return cee(r,o,c)}}}function fee(e){for(;!Y4(e););return e}const ST=/[\0\t\n\r]/g;function mee(){let e=1,t="",n=!0,r;return i;function i(o,l,c){const h=[];let d,g,p,b,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(ST.lastIndex=p,d=ST.exec(o),b=d&&d.index!==void 0?d.index:o.length,y=o.charCodeAt(b),!d){t=o.slice(p);break}if(y===10&&p===b&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),p<b&&(h.push(o.slice(p,b)),e+=b-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=b+1}return c&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const pee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gee(e){return e.replace(pee,vee)}function vee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return W4(n.slice(o?2:1),o?16:10)}return Xw(n)||e}const tO={}.hasOwnProperty;function bee(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),_ee(n)(fee(hee(n).document().write(mee()(e,t,!0))))}function _ee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Oe),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:o(yt),blockQuote:o(ge),characterEscape:Z,characterReference:Z,codeFenced:o(Ce),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Ce,l),codeText:o(Re,l),codeTextData:Z,data:Z,codeFlowValue:Z,definition:o(je),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Qe),hardBreakEscape:o(Tt),hardBreakTrailing:o(Tt),htmlFlow:o(me,l),htmlFlowData:Z,htmlText:o(me,l),htmlTextData:Z,image:o(Ue),label:l,link:o(Oe),listItem:o(pt),listItemValue:b,listOrdered:o(mt,p),listUnordered:o(mt),paragraph:o(ot),reference:j,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(yt),strong:o(dn),thematicBreak:o(In)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:fe,autolinkProtocol:ue,blockQuote:h(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ee,characterReference:re,codeFenced:h(C),codeFencedFence:S,codeFencedFenceInfo:y,codeFencedFenceMeta:w,codeFlowValue:I,codeIndented:h(k),codeText:h(K),codeTextData:I,data:I,definition:h(),definitionDestinationString:N,definitionLabelString:R,definitionTitleString:E,emphasis:h(),hardBreakEscape:h(F),hardBreakTrailing:h(F),htmlFlow:h($),htmlFlowData:I,htmlText:h(W),htmlTextData:I,image:h(U),label:G,labelText:z,lineEnding:q,link:h(D),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:M,resourceTitleString:B,resource:X,setextHeading:h(H),setextHeadingLineSequence:O,setextHeadingText:A,strong:h(),thematicBreak:h()}};nO(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(de){let oe={type:"root",children:[]};const xe={stack:[oe],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:g,data:n},ke=[];let Ke=-1;for(;++Ke<de.length;)if(de[Ke][1].type==="listOrdered"||de[Ke][1].type==="listUnordered")if(de[Ke][0]==="enter")ke.push(Ke);else{const ct=ke.pop();Ke=i(de,ct,Ke)}for(Ke=-1;++Ke<de.length;){const ct=t[de[Ke][0]];tO.call(ct,de[Ke][1].type)&&ct[de[Ke][1].type].call(Object.assign({sliceSerialize:de[Ke][2].sliceSerialize},xe),de[Ke][1])}if(xe.tokenStack.length>0){const ct=xe.tokenStack[xe.tokenStack.length-1];(ct[1]||CT).call(xe,void 0,ct[0])}for(oe.position={start:pa(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:pa(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)oe=t.transforms[Ke](oe)||oe;return oe}function i(de,oe,xe){let ke=oe-1,Ke=-1,ct=!1,Je,Ae,$e,lt;for(;++ke<=xe;){const Fe=de[ke];switch(Fe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Fe[0]==="enter"?Ke++:Ke--,lt=void 0;break}case"lineEndingBlank":{Fe[0]==="enter"&&(Je&&!lt&&!Ke&&!$e&&($e=ke),lt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:lt=void 0}if(!Ke&&Fe[0]==="enter"&&Fe[1].type==="listItemPrefix"||Ke===-1&&Fe[0]==="exit"&&(Fe[1].type==="listUnordered"||Fe[1].type==="listOrdered")){if(Je){let hn=ke;for(Ae=void 0;hn--;){const qt=de[hn];if(qt[1].type==="lineEnding"||qt[1].type==="lineEndingBlank"){if(qt[0]==="exit")continue;Ae&&(de[Ae][1].type="lineEndingBlank",ct=!0),qt[1].type="lineEnding",Ae=hn}else if(!(qt[1].type==="linePrefix"||qt[1].type==="blockQuotePrefix"||qt[1].type==="blockQuotePrefixWhitespace"||qt[1].type==="blockQuoteMarker"||qt[1].type==="listItemIndent"))break}$e&&(!Ae||$e<Ae)&&(Je._spread=!0),Je.end=Object.assign({},Ae?de[Ae][1].start:Fe[1].end),de.splice(Ae||ke,0,["exit",Je,Fe[2]]),ke++,xe++}if(Fe[1].type==="listItemPrefix"){const hn={type:"listItem",_spread:!1,start:Object.assign({},Fe[1].start),end:void 0};Je=hn,de.splice(ke,0,["enter",hn,Fe[2]]),ke++,xe++,$e=void 0,lt=!0}}}return de[oe][1]._spread=ct,xe}function o(de,oe){return xe;function xe(ke){c.call(this,de(ke),ke),oe&&oe.call(this,ke)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(de,oe,xe){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([oe,xe||void 0]),de.position={start:pa(oe.start),end:void 0}}function h(de){return oe;function oe(xe){de&&de.call(this,xe),d.call(this,xe)}}function d(de,oe){const xe=this.stack.pop(),ke=this.tokenStack.pop();if(ke)ke[0].type!==de.type&&(oe?oe.call(this,de,ke[0]):(ke[1]||CT).call(this,de,ke[0]));else throw new Error("Cannot close `"+de.type+"` ("+eh({start:de.start,end:de.end})+"): it’s not open");xe.position.end=pa(de.end)}function g(){return Yw(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(de){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function y(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=de}function w(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=de}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.value=de.replace(/(\r?\n|\r)$/g,"")}function R(de){const oe=this.resume(),xe=this.stack[this.stack.length-1];xe.label=oe,xe.identifier=ls(this.sliceSerialize(de)).toLowerCase()}function E(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.title=de}function N(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.url=de}function L(de){const oe=this.stack[this.stack.length-1];if(!oe.depth){const xe=this.sliceSerialize(de).length;oe.depth=xe}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function O(de){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(de){const xe=this.stack[this.stack.length-1].children;let ke=xe[xe.length-1];(!ke||ke.type!=="text")&&(ke=Nt(),ke.position={start:pa(de.start),end:void 0},xe.push(ke)),this.stack.push(ke)}function I(de){const oe=this.stack.pop();oe.value+=this.sliceSerialize(de),oe.position.end=pa(de.end)}function q(de){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const xe=oe.children[oe.children.length-1];xe.position.end=pa(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(oe.type)&&(Z.call(this,de),I.call(this,de))}function F(){this.data.atHardBreak=!0}function $(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.value=de}function W(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.value=de}function K(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.value=de}function D(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=oe,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function U(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=oe,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function z(de){const oe=this.sliceSerialize(de),xe=this.stack[this.stack.length-2];xe.label=gee(oe),xe.identifier=ls(oe).toLowerCase()}function G(){const de=this.stack[this.stack.length-1],oe=this.resume(),xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,xe.type==="link"){const ke=de.children;xe.children=ke}else xe.alt=oe}function M(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.url=de}function B(){const de=this.resume(),oe=this.stack[this.stack.length-1];oe.title=de}function X(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function ie(de){const oe=this.resume(),xe=this.stack[this.stack.length-1];xe.label=oe,xe.identifier=ls(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function J(de){this.data.characterReferenceType=de.type}function ee(de){const oe=this.sliceSerialize(de),xe=this.data.characterReferenceType;let ke;xe?(ke=W4(oe,xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ke=Xw(oe);const Ke=this.stack[this.stack.length-1];Ke.value+=ke}function re(de){const oe=this.stack.pop();oe.position.end=pa(de.end)}function ue(de){I.call(this,de);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(de)}function fe(de){I.call(this,de);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(de)}function ge(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Qe(){return{type:"emphasis",children:[]}}function yt(){return{type:"heading",depth:0,children:[]}}function Tt(){return{type:"break"}}function me(){return{type:"html",value:""}}function Ue(){return{type:"image",title:null,url:"",alt:null}}function Oe(){return{type:"link",title:null,url:"",children:[]}}function mt(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function pt(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function ot(){return{type:"paragraph",children:[]}}function dn(){return{type:"strong",children:[]}}function Nt(){return{type:"text",value:""}}function In(){return{type:"thematicBreak"}}}function pa(e){return{line:e.line,column:e.column,offset:e.offset}}function nO(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?nO(e,r):yee(e,r)}}function yee(e,t){let n;for(n in t)if(tO.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 CT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+eh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+eh({start:t.start,end:t.end})+") is still open")}function xee(e){const t=this;t.parser=n;function n(r){return bee(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function wee(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 See(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
626
|
+
`}]}function Cee(e,t){const n=t.value?t.value+`
|
|
627
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[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 kee(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Eee(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ree(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Su(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,c+=1,e.footnoteCounts.set(r,c);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),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 Tee(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 Nee(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function rO(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 i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function Mee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rO(e,t);const i={src:Su(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function jee(e,t){const n={src:Su(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 Aee(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 Dee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rO(e,t);const i={href:Su(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Oee(e,t){const n={href:Su(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 Lee(e,t,n){const r=e.all(t),i=n?zee(n):iO(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 c=-1;for(;++c<r.length;){const g=r[c];(i||c!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
|
|
628
|
+
`}),g.type==="element"&&g.tagName==="p"&&!i?l.push(...g.children):l.push(g)}const h=r[r.length-1];h&&(i||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
|
629
|
+
`});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function zee(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=iO(n[r])}return t}function iO(e){const t=e.spread;return t??e.children.length>1}function Pee(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];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 Iee(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bee(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Fee(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hee(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Ww(t.children[1]),h=P4(t.children[t.children.length-1]);c&&h&&(l.position={start:c,end:h}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function $ee(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,c=l?l.length:t.children.length;let h=-1;const d=[];for(;++h<c;){const p=t.children[h],b={},y=l?l[h]:void 0;y&&(b.align=y);let w={type:"element",tagName:o,properties:b,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 Uee(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const kT=9,ET=32;function Vee(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(RT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(RT(t.slice(i),i>0,!1)),o.join("")}function RT(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===kT||o===ET;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===kT||o===ET;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Wee(e,t){const n={type:"text",value:Vee(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function qee(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Kee={blockquote:wee,break:See,code:Cee,delete:kee,emphasis:Eee,footnoteReference:Ree,heading:Tee,html:Nee,imageReference:Mee,image:jee,inlineCode:Aee,linkReference:Dee,link:Oee,listItem:Lee,list:Pee,paragraph:Iee,root:Bee,strong:Fee,table:Hee,tableCell:Uee,tableRow:$ee,text:Wee,thematicBreak:qee,toml:zm,yaml:zm,definition:zm,footnoteDefinition:zm};function zm(){}const sO=-1,$g=0,nh=1,$p=2,Qw=3,Jw=4,e1=5,t1=6,oO=7,aO=8,TT=typeof self=="object"?self:globalThis,Gee=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case $g:case sO:return n(l,i);case nh:{const c=n([],i);for(const h of l)c.push(r(h));return c}case $p:{const c=n({},i);for(const[h,d]of l)c[r(h)]=r(d);return c}case Qw:return n(new Date(l),i);case Jw:{const{source:c,flags:h}=l;return n(new RegExp(c,h),i)}case e1:{const c=n(new Map,i);for(const[h,d]of l)c.set(r(h),r(d));return c}case t1:{const c=n(new Set,i);for(const h of l)c.add(r(h));return c}case oO:{const{name:c,message:h}=l;return n(new TT[c](h),i)}case aO:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new TT[o](l),i)};return r},NT=e=>Gee(new Map,e)(0),Ac="",{toString:Yee}={},{keys:Xee}=Object,Nd=e=>{const t=typeof e;if(t!=="object"||!e)return[$g,t];const n=Yee.call(e).slice(8,-1);switch(n){case"Array":return[nh,Ac];case"Object":return[$p,Ac];case"Date":return[Qw,Ac];case"RegExp":return[Jw,Ac];case"Map":return[e1,Ac];case"Set":return[t1,Ac];case"DataView":return[nh,n]}return n.includes("Array")?[nh,n]:n.includes("Error")?[oO,n]:[$p,n]},Pm=([e,t])=>e===$g&&(t==="function"||t==="symbol"),Zee=(e,t,n,r)=>{const i=(l,c)=>{const h=r.push(l)-1;return n.set(c,h),h},o=l=>{if(n.has(l))return n.get(l);let[c,h]=Nd(l);switch(c){case $g:{let g=l;switch(h){case"bigint":c=aO,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return i([sO],l)}return i([c,g],l)}case nh:{if(h){let b=l;return h==="DataView"?b=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(l)),i([h,[...b]],l)}const g=[],p=i([c,g],l);for(const b of l)g.push(o(b));return p}case $p:{if(h)switch(h){case"BigInt":return i([h,l.toString()],l);case"Boolean":case"Number":case"String":return i([h,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const g=[],p=i([c,g],l);for(const b of Xee(l))(e||!Pm(Nd(l[b])))&&g.push([o(b),o(l[b])]);return p}case Qw:return i([c,l.toISOString()],l);case Jw:{const{source:g,flags:p}=l;return i([c,{source:g,flags:p}],l)}case e1:{const g=[],p=i([c,g],l);for(const[b,y]of l)(e||!(Pm(Nd(b))||Pm(Nd(y))))&&g.push([o(b),o(y)]);return p}case t1:{const g=[],p=i([c,g],l);for(const b of l)(e||!Pm(Nd(b)))&&g.push(o(b));return p}}const{message:d}=l;return i([c,{name:h,message:d}],l)};return o},MT=(e,{json:t,lossy:n}={})=>{const r=[];return Zee(!(t||n),!!t,new Map,r)(e),r},Up=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?NT(MT(e,t)):structuredClone(e):(e,t)=>NT(MT(e,t));function Qee(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 Jee(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ete(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Qee,r=e.options.footnoteBackLabel||Jee,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];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(),b=Su(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-"+b+(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-"+b},children:e.wrap(g,!0)};e.patch(d,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Up(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
630
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
631
|
+
`}]}}const Ug=function(e){if(e==null)return ite;if(typeof e=="function")return Vg(e);if(typeof e=="object")return Array.isArray(e)?tte(e):nte(e);if(typeof e=="string")return rte(e);throw new Error("Expected function, string, or object as test")};function tte(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ug(e[n]);return Vg(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function nte(e){const t=e;return Vg(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function rte(e){return Vg(t);function t(n){return n&&n.type===e}}function Vg(e){return t;function t(n,r,i){return!!(ste(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ite(){return!0}function ste(e){return e!==null&&typeof e=="object"&&"type"in e}const lO=[],ote=!0,n0=!1,ate="skip";function cO(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Ug(i),l=r?-1:1;c(e,void 0,[])();function c(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(b,"name",{value:"node ("+(h.type+(y?"<"+y+">":""))+")"})}return b;function b(){let y=lO,w,S,C;if((!t||o(h,d,g[g.length-1]||void 0))&&(y=lte(n(h,g)),y[0]===n0))return y;if("children"in h&&h.children){const k=h;if(k.children&&y[0]!==ate)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=c(R,S,C)(),w[0]===n0)return w;S=typeof w[1]=="number"?w[1]:S+l}}return y}}}function lte(e){return Array.isArray(e)?e:typeof e=="number"?[ote,e]:e==null?lO:[e]}function n1(e,t,n,r){let i,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,i=n):(o=t,l=n,i=r),cO(e,o,c,i);function c(h,d){const g=d[d.length-1],p=g?g.children.indexOf(h):void 0;return l(h,p,g)}}const r0={}.hasOwnProperty,cte={};function ute(e,t){const n=t||cte,r=new Map,i=new Map,o=new Map,l={...Kee,...n.handlers},c={all:d,applyData:hte,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:h,options:n,patch:dte,wrap:mte};return n1(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?r:i,b=String(g.identifier).toUpperCase();p.has(b)||p.set(b,g)}}),c;function h(g,p){const b=g.type,y=c.handlers[b];if(r0.call(c.handlers,b)&&y)return y(c,g,p);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in g){const{children:S,...C}=g,k=Up(C);return k.children=c.all(g),k}return Up(g)}return(c.options.unknownHandler||fte)(c,g,p)}function d(g){const p=[];if("children"in g){const b=g.children;let y=-1;for(;++y<b.length;){const w=c.one(b[y],g);if(w){if(y&&b[y-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=jT(w.value)),!Array.isArray(w)&&w.type==="element")){const S=w.children[0];S&&S.type==="text"&&(S.value=jT(S.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function dte(e,t){e.position&&(t.position=JZ(e))}function hte(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=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,Up(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function fte(e,t){const n=t.data||{},r="value"in t&&!(r0.call(n,"hProperties")||r0.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 mte(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
632
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
633
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
634
|
+
`}),n}function jT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function AT(e,t){const n=ute(e,t),r=n.one(e,void 0),i=ete(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
635
|
+
`},i),o}function pte(e,t){return e&&"run"in e?async function(n,r){const i=AT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return AT(n,{file:r,...e||t})}}function DT(e){if(e)throw e}var ny,OT;function gte(){if(OT)return ny;OT=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=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 b;for(b in d);return typeof b>"u"||e.call(d,b)},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},c=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(r)return r(d,g).value}else return;return d[g]};return ny=function h(){var d,g,p,b,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=c(S,g),b=c(d,g),S!==b&&(R&&b&&(o(b)||(y=i(b)))?(y?(y=!1,w=p&&i(p)?p:[]):w=p&&o(p)?p:{},l(S,{name:g,newValue:h(R,w,b)})):typeof b<"u"&&l(S,{name:g,newValue:b}));return S},ny}var vte=gte();const ry=Zp(vte);function i0(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 bte(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...i);function c(h,...d){const g=e[++o];let p=-1;if(h){l(h);return}for(;++p<i.length;)(d[p]===null||d[p]===void 0)&&(d[p]=i[p]);i=d,g?_te(g,c)(...d):l(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function _te(e,t){let n;return r;function r(...l){const c=e.length>l.length;let h;c&&l.push(i);try{h=e.apply(this,l)}catch(d){const g=d;if(c&&n)throw g;return i(g)}c||(h&&h.then&&typeof h.then=="function"?h.then(o,i):h instanceof Error?i(h):o(h))}function i(l,...c){n||(n=!0,t(l,...c))}function o(l){i(null,l)}}const Es={basename:yte,dirname:xte,extname:wte,join:Ste,sep:"/"};function yte(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Yh(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function xte(e){if(Yh(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 wte(e){Yh(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Ste(...e){let t=-1,n;for(;++t<e.length;)Yh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Cte(n)}function Cte(e){Yh(e);const t=e.codePointAt(0)===47;let n=kte(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kte(e,t){let n="",r=0,i=-1,o=0,l=-1,c,h;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(i===l-1||o===1))if(i!==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("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else c===46&&o>-1?o++:o=-1}return n}function Yh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ete={cwd:Rte};function Rte(){return"/"}function s0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Tte(e){if(typeof e=="string")e=new URL(e);else if(!s0(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 Nte(e)}function Nte(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 i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const iy=["history","path","basename","stem","extname","dirname"];class uO{constructor(t){let n;t?s0(t)?n={path:t}:typeof t=="string"||Mte(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Ete.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<iy.length;){const o=iy[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)iy.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Es.basename(this.path):void 0}set basename(t){oy(t,"basename"),sy(t,"basename"),this.path=Es.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Es.dirname(this.path):void 0}set dirname(t){LT(this.basename,"dirname"),this.path=Es.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Es.extname(this.path):void 0}set extname(t){if(sy(t,"extname"),LT(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=Es.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){s0(t)&&(t=Tte(t)),oy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Es.basename(this.path,this.extname):void 0}set stem(t){oy(t,"stem"),sy(t,"stem"),this.path=Es.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Ir(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function sy(e,t){if(e&&e.includes(Es.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Es.sep+"`")}function oy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function LT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Mte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jte=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},Ate={}.hasOwnProperty;class r1 extends jte{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=bte()}copy(){const t=new r1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ry(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(cy("data",this.frozen),this.namespace[t]=n,this):Ate.call(this.namespace,t)&&this.namespace[t]||void 0:t?(cy("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 i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Im(t),r=this.parser||this.Parser;return ay("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ay("process",this.parser||this.Parser),ly("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,l){const c=Im(t),h=r.parse(c);r.run(h,c,function(g,p,b){if(g||!p||!b)return d(g);const y=p,w=r.stringify(y,b);Lte(w)?b.value=w:b.result=w,d(g,b)});function d(g,p){g||!p?l(g):o?o(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),ay("processSync",this.parser||this.Parser),ly("processSync",this.compiler||this.Compiler),this.process(t,i),PT("processSync","process",n),r;function i(o,l){n=!0,DT(o),r=l}}run(t,n,r){zT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,c){const h=Im(n);i.run(t,h,d);function d(g,p,b){const y=p||t;g?c(g):l?l(y):r(void 0,y,b)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),PT("runSync","run",r),i;function o(l,c){DT(l),i=c,r=!0}}stringify(t,n){this.freeze();const r=Im(n),i=this.compiler||this.Compiler;return ly("stringify",i),zT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(cy("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?c(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");c(d.plugins),d.settings&&(i.settings=ry(!0,i.settings,d.settings))}function c(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,b=-1;for(;++p<r.length;)if(r[p][0]===d){b=p;break}if(b===-1)r.push([d,...g]);else if(g.length>0){let[y,...w]=g;const S=r[b][1];i0(S)&&i0(y)&&(y=ry(!0,S,y)),r[b]=[d,y,...w]}}}}const Dte=new r1().freeze();function ay(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ly(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function cy(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 zT(e){if(!i0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function PT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Im(e){return Ote(e)?e:new uO(e)}function Ote(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Lte(e){return typeof e=="string"||zte(e)}function zte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Pte="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",IT=[],BT={allowDangerousHtml:!0},Ite=/^(https?|ircs?|mailto|xmpp)$/i,Bte=[{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 Cu(e){const t=Fte(e),n=Hte(e);return $te(t.runSync(t.parse(n),n),e)}function Fte(e){const t=e.rehypePlugins||IT,n=e.remarkPlugins||IT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...BT}:BT;return Dte().use(xee).use(n).use(pte,r).use(t)}function Hte(e){const t=e.children||"",n=new uO;return typeof t=="string"&&(n.value=t),n}function $te(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,h=t.urlTransform||Ute;for(const g of Bte)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+Pte+g.id,void 0);return n1(e,d),iQ(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function d(g,p,b){if(g.type==="raw"&&b&&typeof p=="number")return l?b.children.splice(p,1):b.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let y;for(y in J_)if(Object.hasOwn(J_,y)&&Object.hasOwn(g.properties,y)){const w=g.properties[y],S=J_[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,b)),y&&b&&typeof p=="number")return c&&g.children?b.children.splice(p,1,...g.children):b.children.splice(p,1),p}}}function Ute(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Ite.test(e.slice(0,t))?e:""}function FT(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Vte(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Wte(e,t,n){const i=Ug((n||{}).ignore||[]),o=qte(t);let l=-1;for(;++l<o.length;)cO(e,"text",c);function c(d,g){let p=-1,b;for(;++p<g.length;){const y=g[p],w=b?b.children:void 0;if(i(y,w?w.indexOf(y):void 0,b))return;b=y}if(b)return h(d,g)}function h(d,g){const p=g[g.length-1],b=o[l][0],y=o[l][1];let w=0;const C=p.children.indexOf(d);let k=!1,R=[];b.lastIndex=0;let E=b.exec(d.value);for(;E;){const N=E.index,L={index:E.index,input:E.input,stack:[...g,d]};let A=y(...E,L);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?b.lastIndex=N+1:(w!==N&&R.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(A)?R.push(...A):A&&R.push(A),w=N+E[0].length,k=!0),!b.global)break;E=b.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 qte(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 i=n[r];t.push([Kte(i[0]),Gte(i[1])])}return t}function Kte(e){return typeof e=="string"?new RegExp(Vte(e),"g"):e}function Gte(e){return typeof e=="function"?e:function(){return e}}const uy="phrasing",dy=["autolink","link","image","label"];function Yte(){return{transforms:[nne],enter:{literalAutolink:Zte,literalAutolinkEmail:hy,literalAutolinkHttp:hy,literalAutolinkWww:hy},exit:{literalAutolink:tne,literalAutolinkEmail:ene,literalAutolinkHttp:Qte,literalAutolinkWww:Jte}}}function Xte(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:uy,notInConstruct:dy},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:uy,notInConstruct:dy},{character:":",before:"[ps]",after:"\\/",inConstruct:uy,notInConstruct:dy}]}}function Zte(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function hy(e){this.config.enter.autolinkProtocol.call(this,e)}function Qte(e){this.config.exit.autolinkProtocol.call(this,e)}function Jte(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 ene(e){this.config.exit.autolinkEmail.call(this,e)}function tne(e){this.exit(e)}function nne(e){Wte(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rne],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ine]],{ignore:["link","linkReference"]})}function rne(e,t,n,r,i){let o="";if(!dO(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!sne(n)))return!1;const l=one(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function ine(e,t,n,r){return!dO(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function sne(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 one(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 i=FT(e,"(");let o=FT(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function dO(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Al(n)||Fg(n))&&(!t||n!==47)}hO.peek=pne;function ane(){this.buffer()}function lne(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function cne(){this.buffer()}function une(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function dne(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ls(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hne(e){this.exit(e)}function fne(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ls(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mne(e){this.exit(e)}function pne(){return"["}function hO(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),c(),l(),o+=i.move("]"),o}function gne(){return{enter:{gfmFootnoteCallString:ane,gfmFootnoteCall:lne,gfmFootnoteDefinitionLabelString:cne,gfmFootnoteDefinition:une},exit:{gfmFootnoteCallString:dne,gfmFootnoteCall:hne,gfmFootnoteDefinitionLabelString:fne,gfmFootnoteDefinition:mne}}}function vne(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:hO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const c=o.createTracker(l);let h=c.move("[^");const d=o.enter("footnoteDefinition"),g=o.enter("label");return h+=c.move(o.safe(o.associationId(r),{before:h,after:"]"})),g(),h+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),h+=c.move((t?`
|
|
636
|
+
`:" ")+o.indentLines(o.containerFlow(r,c.current()),t?fO:bne))),d(),h}}function bne(e,t,n){return t===0?e:fO(e,t,n)}function fO(e,t,n){return(n?"":" ")+e}const _ne=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mO.peek=Cne;function yne(){return{canContainEols:["delete"],enter:{strikethrough:wne},exit:{strikethrough:Sne}}}function xne(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_ne}],handlers:{delete:mO}}}function wne(e){this.enter({type:"delete",children:[]},e)}function Sne(e){this.exit(e)}function mO(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function Cne(){return"~"}function kne(e){return e.length}function Ene(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||kne,o=[],l=[],c=[],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=Rne(e[g][k]);if(n.alignDelimiters!==!1){const E=i(R);C[k]=E,(h[k]===void 0||E>h[k])&&(h[k]=E)}S.push(R)}l[g]=S,c[g]=C}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)o[p]=HT(r[p]);else{const S=HT(r);for(;++p<d;)o[p]=S}p=-1;const b=[],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),b[p]=E}l.splice(1,0,b),c.splice(1,0,y),g=-1;const w=[];for(;++g<l.length;){const S=l[g],C=c[g];p=-1;const k=[];for(;++p<d;){const R=S[p]||"";let E="",N="";if(n.alignDelimiters!==!1){const L=h[p]-(C[p]||0),A=o[p];A===114?E=" ".repeat(L):A===99?L%2?(E=" ".repeat(L/2+.5),N=" ".repeat(L/2-.5)):(E=" ".repeat(L/2),N=E):N=" ".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(N),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(`
|
|
637
|
+
`)}function Rne(e){return e==null?"":String(e)}function HT(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 Tne(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),Nne);return i(),l}function Nne(e,t,n){return">"+(n?"":" ")+e}function Mne(e,t){return $T(e,t.inConstruct,!0)&&!$T(e,t.notInConstruct,!1)}function $T(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 UT(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
638
|
+
`&&Mne(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
639
|
+
`}function jne(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function Ane(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 Dne(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 One(e,t,n,r){const i=Dne(n),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Ane(e,n)){const p=n.enter("codeIndented"),b=n.indentLines(o,Lne);return p(),b}const c=n.createTracker(r),h=i.repeat(Math.max(jne(o,i)+1,3)),d=n.enter("codeFenced");let g=c.move(h);if(e.lang){const p=n.enter(`codeFencedLang${l}`);g+=c.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);g+=c.move(" "),g+=c.move(n.safe(e.meta,{before:g,after:`
|
|
640
|
+
`,encode:["`"],...c.current()})),p()}return g+=c.move(`
|
|
641
|
+
`),o&&(g+=c.move(o+`
|
|
642
|
+
`)),g+=c.move(h),d(),g}function Lne(e,t,n){return(n?"":" ")+e}function i1(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 zne(e,t,n,r){const i=i1(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=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("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(c=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
643
|
+
`,...h.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=h.move(" "+i),d+=h.move(n.safe(e.title,{before:d,after:i,...h.current()})),d+=h.move(i),c()),l(),d}function Pne(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 yh(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Vp(e,t,n){const r=nu(e),i=nu(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}pO.peek=Ine;function pO(e,t,n,r){const i=Pne(n),o=n.enter("emphasis"),l=n.createTracker(r),c=l.move(i);let h=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const d=h.charCodeAt(0),g=Vp(r.before.charCodeAt(r.before.length-1),d,i);g.inside&&(h=yh(d)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Vp(r.after.charCodeAt(0),p,i);b.inside&&(h=h.slice(0,-1)+yh(p));const y=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},c+h+y}function Ine(e,t,n){return n.options.emphasis||"*"}function Bne(e,t){let n=!1;return n1(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,n0}),!!((!e.depth||e.depth<3)&&Yw(e)&&(t.options.setext||n))}function Fne(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Bne(e,n)){const g=n.enter("headingSetext"),p=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
644
|
+
`,after:`
|
|
645
|
+
`});return p(),g(),b+`
|
|
646
|
+
`+(i===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
647
|
+
`))+1))}const l="#".repeat(i),c=n.enter("headingAtx"),h=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
648
|
+
`,...o.current()});return/^[\t ]/.test(d)&&(d=yh(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),h(),c(),d}gO.peek=Hne;function gO(e){return e.value||""}function Hne(){return"<"}vO.peek=$ne;function vO(e,t,n,r){const i=i1(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=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("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(c=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=h.move(" "+i),d+=h.move(n.safe(e.title,{before:d,after:i,...h.current()})),d+=h.move(i),c()),d+=h.move(")"),l(),d}function $ne(){return"!"}bO.peek=Une;function bO(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let h=c.move("![");const d=n.safe(e.alt,{before:h,after:"]",...c.current()});h+=c.move(d+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...c.current()});return l(),n.stack=g,o(),i==="full"||!d||d!==p?h+=c.move(p+"]"):i==="shortcut"?h=h.slice(0,-1):h+=c.move("]"),h}function Une(){return"!"}_O.peek=Vne;function _O(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],c=n.compilePattern(l);let h;if(l.atBreak)for(;h=c.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 i+r+i}function Vne(){return"`"}function yO(e,t){const n=Yw(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))}xO.peek=Wne;function xO(e,t,n,r){const i=i1(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,h;if(yO(e,n)){const g=n.stack;n.stack=[],c=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),c(),n.stack=g,p}c=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(" "+i),d+=l.move(n.safe(e.title,{before:d,after:i,...l.current()})),d+=l.move(i),h()),d+=l.move(")"),c(),d}function Wne(e,t,n){return yO(e,n)?"<":"["}wO.peek=qne;function wO(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let h=c.move("[");const d=n.containerPhrasing(e,{before:h,after:"]",...c.current()});h+=c.move(d+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...c.current()});return l(),n.stack=g,o(),i==="full"||!d||d!==p?h+=c.move(p+"]"):i==="shortcut"?h=h.slice(0,-1):h+=c.move("]"),h}function qne(){return"["}function s1(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 Kne(e){const t=s1(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 Gne(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 SO(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 Yne(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?Gne(n):s1(n);const c=e.ordered?l==="."?")":".":Kne(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),SO(n)===l&&g){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,i(),d}function Xne(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 Zne(e,t,n,r){const i=Xne(n);let o=n.bulletCurrent||s1(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;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(o+" ".repeat(l-o.length)),c.shift(l);const h=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),g);return h(),d;function g(p,b,y){return b?(y?"":" ".repeat(l))+p:(y?o:o+" ".repeat(l-o.length))+p}}function Qne(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const Jne=Ug(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ere(e,t,n,r){return(e.children.some(function(l){return Jne(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function tre(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}CO.peek=nre;function CO(e,t,n,r){const i=tre(n),o=n.enter("strong"),l=n.createTracker(r),c=l.move(i+i);let h=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const d=h.charCodeAt(0),g=Vp(r.before.charCodeAt(r.before.length-1),d,i);g.inside&&(h=yh(d)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Vp(r.after.charCodeAt(0),p,i);b.inside&&(h=h.slice(0,-1)+yh(p));const y=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},c+h+y}function nre(e,t,n){return n.options.strong||"*"}function rre(e,t,n,r){return n.safe(e.value,r)}function ire(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 sre(e,t,n){const r=(SO(n)+(n.options.ruleSpaces?" ":"")).repeat(ire(n));return n.options.ruleSpaces?r.slice(0,-1):r}const kO={blockquote:Tne,break:UT,code:One,definition:zne,emphasis:pO,hardBreak:UT,heading:Fne,html:gO,image:vO,imageReference:bO,inlineCode:_O,link:xO,linkReference:wO,list:Yne,listItem:Zne,paragraph:Qne,root:ere,strong:CO,text:rre,thematicBreak:sre};function ore(){return{enter:{table:are,tableData:VT,tableHeader:VT,tableRow:cre},exit:{codeText:ure,table:lre,tableData:fy,tableHeader:fy,tableRow:fy}}}function are(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 lre(e){this.exit(e),this.data.inTable=void 0}function cre(e){this.enter({type:"tableRow",children:[]},e)}function fy(e){this.exit(e)}function VT(e){this.enter({type:"tableCell",children:[]},e)}function ure(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,dre));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function dre(e,t){return t==="|"?t:e}function hre(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
649
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:h,tableRow:c}};function l(y,w,S,C){return d(g(y,S,C),y.align)}function c(y,w,S,C){const k=p(y,S,C),R=d([k]);return R.slice(0,R.indexOf(`
|
|
650
|
+
`))}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 Ene(y,{align:w,alignDelimiters:r,padding:n,stringLength:i})}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 b(y,w,S){let C=kO.inlineCode(y,w,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function fre(){return{exit:{taskListCheckValueChecked:WT,taskListCheckValueUnchecked:WT,paragraph:pre}}}function mre(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:gre}}}function WT(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function pre(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 i=t.children;let o=-1,l;for(;++o<i.length;){const c=i[o];if(c.type==="paragraph"){l=c;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 gre(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);o&&c.move(l);let h=kO.listItem(e,t,n,{...r,...c.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+l}}function vre(){return[Yte(),gne(),yne(),ore(),fre()]}function bre(e){return{extensions:[Xte(),vne(e),xne(),hre(e),mre()]}}const _re={tokenize:kre,partial:!0},EO={tokenize:Ere,partial:!0},RO={tokenize:Rre,partial:!0},TO={tokenize:Tre,partial:!0},yre={tokenize:Nre,partial:!0},NO={name:"wwwAutolink",tokenize:Sre,previous:jO},MO={name:"protocolAutolink",tokenize:Cre,previous:AO},zo={name:"emailAutolink",tokenize:wre,previous:DO},Ws={};function xre(){return{text:Ws}}let cl=48;for(;cl<123;)Ws[cl]=zo,cl++,cl===58?cl=65:cl===91&&(cl=97);Ws[43]=zo;Ws[45]=zo;Ws[46]=zo;Ws[95]=zo;Ws[72]=[zo,MO];Ws[104]=[zo,MO];Ws[87]=[zo,NO];Ws[119]=[zo,NO];function wre(e,t,n){const r=this;let i,o;return l;function l(p){return!o0(p)||!DO.call(r,r.previous)||o1(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return o0(p)?(e.consume(p),c):p===64?(e.consume(p),h):n(p)}function h(p){return p===46?e.check(yre,g,d)(p):p===45||p===95||zr(p)?(o=!0,e.consume(p),h):g(p)}function d(p){return e.consume(p),i=!0,h}function g(p){return o&&i&&Ur(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function Sre(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!jO.call(r,r.previous)||o1(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(_re,e.attempt(EO,e.attempt(RO,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Cre(e,t,n){const r=this;let i="",o=!1;return l;function l(p){return(p===72||p===104)&&AO.call(r,r.previous)&&!o1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(Ur(p)&&i.length<5)return i+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const b=i.toLowerCase();if(b==="http"||b==="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||Hp(p)||vn(p)||Al(p)||Fg(p)?n(p):e.attempt(EO,e.attempt(RO,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function kre(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function Ere(e,t,n){let r,i,o;return l;function l(d){return d===46||d===95?e.check(TO,h,c)(d):d===null||vn(d)||Al(d)||d!==45&&Fg(d)?h(d):(o=!0,e.consume(d),l)}function c(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),l}function h(d){return i||r||!o?n(d):t(d)}}function Rre(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):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(TO,t,o)(l):l===null||vn(l)||Al(l)?t(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function Tre(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),i):c===60||c===null||vn(c)||Al(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||vn(c)||Al(c)?t(c):r(c)}function o(c){return Ur(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):Ur(c)?(e.consume(c),l):n(c)}}function Nre(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return zr(o)?n(o):t(o)}}function jO(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||vn(e)}function AO(e){return!Ur(e)}function DO(e){return!(e===47||o0(e))}function o0(e){return e===43||e===45||e===46||e===95||zr(e)}function o1(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 Mre={tokenize:Ire,partial:!0};function jre(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Lre,continuation:{tokenize:zre},exit:Pre}},text:{91:{name:"gfmFootnoteCall",tokenize:Ore},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Are,resolveTo:Dre}}}}function Are(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const h=r.events[i][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 c;function c(h){if(!l||!l._balanced)return n(h);const d=ls(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 Dre(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.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)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,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,...c),e}function Ore(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return c;function c(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||vn(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return i.includes(ls(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return vn(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 Lre(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,c;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&&!c||w===null||w===91||vn(w))return n(w);if(w===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return o=ls(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return vn(w)||(c=!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 b(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),Bt(e,y,"gfmFootnoteDefinitionWhitespace")):n(w)}function y(w){return t(w)}}function zre(e,t,n){return e.check(Gh,t,e.attempt(Mre,t,n))}function Pre(e){e.exit("gfmFootnoteDefinition")}function Ire(e,t,n){const r=this;return Bt(e,i,"gfmFootnoteDefinitionIndent",5);function i(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 Bre(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,c){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)},b=[["enter",g,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",p,c]],y=c.parser.constructs.insideSpan.null;y&&Si(b,b.length,0,Hg(y,l.slice(d+1,h),c)),Si(b,b.length,0,[["exit",p,c],["enter",l[h][1],c],["exit",l[h][1],c],["exit",g,c]]),Si(l,d-1,h-d+3,b),h=d+b.length-2;break}}for(h=-1;++h<l.length;)l[h][1].type==="strikethroughSequenceTemporary"&&(l[h][1].type="data");return l}function o(l,c,h){const d=this.previous,g=this.events;let p=0;return b;function b(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(l.enter("strikethroughSequenceTemporary"),y(w))}function y(w){const S=nu(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=nu(w);return C._open=!k||k===2&&!!S,C._close=!S||S===2&&!!k,c(w)}}}class Fre{constructor(){this.map=[]}add(t,n,r){Hre(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 i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function Hre(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function $re(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Ure(){return{flow:{null:{name:"table",tokenize:Vre,resolveAll:Wre}}}}function Vre(e,t,n){const r=this;let i=0,o=0,l;return c;function c(I){let q=r.events.length-1;for(;q>-1;){const W=r.events[q][1].type;if(W==="lineEnding"||W==="linePrefix")q--;else break}const F=q>-1?r.events[q][1].type:null,$=F==="tableHead"||F==="tableRow"?A:h;return $===A&&r.parser.lazy[r.now().line]?n(I):$(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):it(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),y):n(I):At(I)?Bt(e,g,"whitespace")(I):(o+=1,l&&(l=!1,i+=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||vn(I)?(e.exit("data"),g(I)):(e.consume(I),I===92?b:p)}function b(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,At(I)?Bt(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 At(I)?Bt(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||it(I)?N(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 At(I)?Bt(e,N,"whitespace")(I):N(I)}function N(I){return I===124?w(I):I===null||it(I)?!l||i!==o?L(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):L(I)}function L(I){return n(I)}function A(I){return e.enter("tableRow"),O(I)}function O(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),O):I===null||it(I)?(e.exit("tableRow"),t(I)):At(I)?Bt(e,O,"whitespace")(I):(e.enter("data"),H(I))}function H(I){return I===null||I===124||vn(I)?(e.exit("data"),O(I)):(e.consume(I),I===92?Z:H)}function Z(I){return I===92||I===124?(e.consume(I),H):H(I)}}function Wre(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],c=!1,h=0,d,g,p;const b=new Fre;for(;++n<e.length;){const y=e[n],w=y[1];y[0]==="enter"?w.type==="tableHead"?(c=!1,h!==0&&(qT(b,t,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},b.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],c&&(c=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},b.add(n,0,[["enter",g,t]])),i=w.type==="tableDelimiterRow"?2:g?3:1):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],p=Bm(b,t,o,i,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=Bm(b,t,o,i,void 0,p)),o=l,l=[o[1],n,0,0])):w.type==="tableHead"?(c=!0,h=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=n,o[1]!==0?(l[0]=l[1],p=Bm(b,t,o,i,n,p)):l[1]!==0&&(p=Bm(b,t,l,i,n,p)),i=0):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(h!==0&&qT(b,t,h,d,g),b.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=$re(t.events,n))}return e}function Bm(e,t,n,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},Lc(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const h=Lc(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=Lc(t.events,n[2]),g=Lc(t.events,n[3]),p={type:c,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const b=t.events[n[2]],y=t.events[n[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[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 i!==void 0&&(o.end=Object.assign({},Lc(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function qT(e,t,n,r,i){const o=[],l=Lc(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function Lc(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const qre={name:"tasklistCheck",tokenize:Gre};function Kre(){return{text:{91:qre}}}function Gre(e,t,n){const r=this;return i;function i(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 vn(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"),c):n(h)}function c(h){return it(h)?t(h):At(h)?e.check({tokenize:Yre},t,n)(h):n(h)}}function Yre(e,t,n){return Bt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Xre(e){return V4([xre(),jre(),Bre(e),Ure(),Kre()])}const Zre={};function ku(e){const t=this,n=e||Zre,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Xre(n)),o.push(vre()),l.push(bre(n))}function Qre({content:e,attachments:t}){const[n,r]=v.useState(null),i=(t==null?void 0:t.find(o=>o.id===n))??null;return v.useEffect(()=>{i||r(null)},[i]),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(Cu,{remarkPlugins:[ku],components:xu(),children:e}):null]})}),i?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:i.previewUrl,alt:i.name,className:"max-h-full max-w-full rounded-xl shadow-2xl"})}):null]})}function Jre({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 OO({title:e,count:t,children:n,badge:r}){const[i,o]=v.useState(!1);return t===0?null:f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("button",{onClick:()=>o(!i),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[f.jsx(Vr,{className:pe("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",i&&"rotate-90")}),f.jsx("span",{className:"text-muted-foreground font-medium",children:e}),f.jsx("span",{className:"text-muted-foreground/60",children:t}),r]}),i&&f.jsx("div",{className:"ml-5",children:n})]})}function my({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:f.jsx(OO,{title:e,count:t.length,children:f.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(i=>f.jsx(w4,{icon:r?r(i):n,children:i},i))})})}function eie(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function LO({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return f.jsx("span",{className:pe("inline-block h-2 w-2 rounded-full shrink-0",t)})}function tie(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 KT({server:e}){const[t,n]=v.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:pe("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(Vr,{className:pe("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),f.jsx(LO,{status:e.status}),f.jsx("span",{className:"text-muted-foreground font-medium",children:Fy(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:tie(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(i=>f.jsx(w4,{icon:x4(`mcp__${e.name}__${i}`),children:i},i))})]})}function nie({servers:e}){if(e.length===0)return null;const t=e.filter(i=>i.status==="connected"),n=e.filter(i=>i.status!=="connected"),r=n.length>0?f.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[f.jsx(LO,{status:"failed"}),f.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return f.jsx(OO,{title:"MCP Servers",count:e.length,badge:r,children:f.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(i=>f.jsx(KT,{server:i},i.name)),n.map(i=>f.jsx(KT,{server:i},i.name))]})})}function rie({rawJson:e}){const[t,n]=v.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(Vr,{className:pe("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 iie({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=v.useMemo(()=>{const i=new Map,o=[];for(const c of e.tools){const h=eie(c);if(h){const d=i.get(h.server)||[];d.push(h.tool),i.set(h.server,d)}else o.push(c)}const l=e.mcpServers.map(c=>({name:c.name,status:c.status,error:c.error,tools:i.get(c.name)||[]}));return{coreTools:o,mcpServersWithTools:l}},[e.tools,e.mcpServers]);return f.jsx(Lo,{children:f.jsxs(Wh,{expandedContent:f.jsx(qh,{className:"my-4 text-xs",children:f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx(MX,{children:e.model}),f.jsx(my,{title:"Tools",items:n,getIcon:i=>$x[i]??y4}),f.jsx(my,{title:"Agents",items:e.agents,icon:N0}),f.jsx(my,{title:"Commands",items:e.slashCommands,icon:z9}),f.jsx(nie,{servers:r}),t&&f.jsx(rie,{rawJson:t})]})}),children:[f.jsx(n8,{className:"h-5 w-5 text-logo"}),f.jsx(No,{children:"Session Started"})]})})}function sie({message:e}){return f.jsx(Lo,{className:"hidden",children:f.jsxs(Wh,{expandedContent:f.jsx(qh,{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(N0,{className:"h-4 w-4 text-muted-foreground"})}),f.jsx(No,{children:"Account"})]})})}function oie({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(Cu,{remarkPlugins:[ku],components:xu(),children:e.text})})}function aie({message:e}){return f.jsx(Lo,{className:"w-full",children:f.jsxs(Wh,{expandedContent:f.jsx(qh,{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(Cu,{remarkPlugins:[ku],components:xu(),children:e.text})})}),children:[f.jsx(bi,{className:"h-4 w-4 text-muted-icon"}),f.jsx(No,{className:"text-left text-muted-foreground",children:"Thinking"})]})})}function lie({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:i}){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(V5,{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}%`}})})]}),i]})}function GT({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 zO({selected:e,multiSelect:t,onClick:n}){return f.jsx("button",{type:"button",onClick:n,className:pe("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 cie({option:e,selected:t,multiSelect:n,onClick:r,isLast:i}){const o="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",l=i?"":"border-b border-border";return r?f.jsx("button",{onClick:r,className:pe(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(GT,{label:e.label,description:e.description})}),f.jsx(zO,{selected:t,multiSelect:n})]})}):f.jsx("div",{className:pe(o,l),children:f.jsx(GT,{label:e.label,description:e.description})})}function uie(e){return e==null?void 0:e.answers}function ns(e){return e.id||e.question}function die({message:e,onSubmit:t,isLatest:n}){var D,U;const r=e.input.questions,i=!!e.result,o=uie(e.result),l=((D=e.result)==null?void 0:D.discarded)===!0,[c,h]=v.useState(0),[d,g]=v.useState({}),[p,b]=v.useState({}),[y,w]=v.useState(o??null),[S,C]=v.useState(i),k=(z,G)=>{var ie;const M=(ie=p[z])==null?void 0:ie.trim(),B=d[z]||"",X=G||r.find(J=>ns(J)===z);if(X!=null&&X.multiSelect)return[B,M].filter(Boolean).flatMap(J=>J.split(", ").filter(Boolean));const j=M||B;return j?[j]:[]},R=z=>{const G=d[ns(z)]||"";return z.multiSelect?G.split(", ").filter(Boolean):[G]},E=(z,G)=>{const M=ns(z);if(z.multiSelect){const B=d[M]?d[M].split(", ").filter(Boolean):[],X=B.includes(G)?B.filter(j=>j!==G):[...B,G];g({...d,[M]:X.join(", ")})}else g({...d,[M]:G}),b({...p,[M]:""}),c<r.length-1&&setTimeout(()=>h(c+1),150)},N=(z,G)=>{const M=ns(z);b({...p,[M]:G}),G&&!z.multiSelect&&g({...d,[M]:""})},L=z=>{const G=ns(z);z.multiSelect&&p[G]&&b({...p,[G]:""})},A=r.every(z=>k(ns(z),z).length>0),O=r[c],H=c===r.length-1,Z=O&&k(ns(O),O).length>0,I=()=>{c<r.length-1&&h(c+1)},q=()=>{c>0&&h(c-1)},F=()=>{if(!A)return;const z={};for(const G of r){const M=ns(G);z[M]=k(M,G)}w(z),C(!0),t(e.toolId,r,z)},$=z=>{if(z.key==="Enter"&&!(!O||!Z)){if(z.preventDefault(),H){F();return}I()}};if(S||i){const z=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((G,M)=>{const B=z[ns(G)]||z[G.question]||[],X=M===r.length-1;return f.jsxs("div",{className:pe("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:G.question}),B.length>0&&f.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:B.join(", ")}),B.length===0&&f.jsx("div",{className:"text-sm font-medium text-right italic",children:l?"Discarded":"No Response"})]},ns(G))})]})})}if(!n)return f.jsx("div",{className:"w-full py-2",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Y5,{className:"h-4 w-4 text-muted-foreground"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!O)return null;const W=R(O),K=p[ns(O)]||"";return f.jsxs("div",{className:"w-full space-y-3",children:[f.jsxs(lie,{question:O.question,currentIndex:c,totalQuestions:r.length,onBack:c>0?q:void 0,children:[(U=O.options)==null?void 0:U.map(z=>f.jsx(cie,{option:z,selected:W.includes(z.label),multiSelect:O.multiSelect,onClick:()=>E(O,z.label)},z.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:K,onChange:z=>N(O,z.target.value),onKeyDown:$,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(zO,{selected:!!K,multiSelect:O.multiSelect,onClick:O.multiSelect&&K?()=>L(O):void 0})]})})]}),f.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!H&&Z&&(O.multiSelect||!!K)&&f.jsx(Xe,{size:"sm",onClick:I,children:"Next"}),H&&f.jsx(Xe,{size:"sm",onClick:F,disabled:!A,className:pe(!A&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}async function hie(e){const t=await new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{if(typeof i.result=="string"){n(i.result);return}r(new Error("Failed to read image attachment"))},i.onerror=()=>r(i.error??new Error("Failed to read image attachment")),i.readAsDataURL(e)});return{type:"image",name:e.name,mimeType:e.type,sizeBytes:e.size,dataUrl:t}}function Fm(e){return String(e).padStart(2,"0")}function fie(e,t=new Date){const n=e?new Date(e):null,r=n&&!Number.isNaN(n.getTime())?n:t;return["kaizen-plan",`${r.getFullYear()}-${Fm(r.getMonth()+1)}-${Fm(r.getDate())}`,`${Fm(r.getHours())}-${Fm(r.getMinutes())}.md`].join("-")}function mie(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.focus(),t.select();const n=document.execCommand("copy");return document.body.removeChild(t),n}function pie({message:e,onConfirm:t,isLatest:n,isActionable:r=n}){const i=!!e.result,[o,l]=v.useState(!1),[c,h]=v.useState(!1),[d,g]=v.useState(!1),[p,b]=v.useState(""),[y,w]=v.useState([]),[S,C]=v.useState(null),[k,R]=v.useState(!1),[E,N]=v.useState(!1),[L,A]=v.useState(null),O=v.useRef(null),H=v.useRef(null),Z=v.useRef(null),I=e.input;v.useEffect(()=>{d&&O.current&&O.current.focus()},[d]),v.useEffect(()=>()=>{for(const z of y)URL.revokeObjectURL(z.previewUrl);Z.current&&clearTimeout(Z.current)},[y]);const q=async()=>{var z;if(I!=null&&I.plan)try{if((z=navigator.clipboard)!=null&&z.writeText)await navigator.clipboard.writeText(I.plan);else if(!mie(I.plan))throw new Error("Clipboard copy failed");h(!0),Pc("Plan copied to clipboard."),Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>h(!1),2e3)}catch{Pc("Failed to copy plan.")}},F=v.useCallback(()=>{if(!(I!=null&&I.plan))return;const z=new Blob([I.plan],{type:"text/markdown;charset=utf-8"}),G=URL.createObjectURL(z),M=document.createElement("a");M.href=G,M.download=fie(e.timestamp),M.click(),URL.revokeObjectURL(G)},[I==null?void 0:I.plan,e.timestamp]),$=v.useCallback(z=>{const G=z.filter(M=>M.type.startsWith("image/"));if(G.length===0){C("Only PNG, JPEG, WEBP, and GIF images are supported.");return}w(M=>{const B=[...M];let X=null;for(const j of G){if(!yp.includes(j.type)){X=`Unsupported image type: ${j.type||"unknown"}`;continue}if(j.size<=0||j.size>HM){X=`${j.name} is empty or larger than 10 MB.`;continue}if(B.length>=_p){X=`You can attach up to ${_p} images per message.`;break}B.push({id:Vd(),file:j,name:j.name||"image",mimeType:j.type,sizeBytes:j.size,previewUrl:URL.createObjectURL(j)})}return C(X),B})},[]),W=v.useCallback(z=>{w(G=>{const M=G.find(B=>B.id===z);return M&&URL.revokeObjectURL(M.previewUrl),G.filter(B=>B.id!==z)}),C(null)},[]),K=async()=>{if(!(!p.trim()&&y.length===0)){N(!0);try{const z=y.length?await Promise.all(y.map(G=>hie(G.file))):void 0;t(e.toolId,!1,void 0,p.trim(),z)}finally{N(!1)}}},D=i?e.result:null,U=(D==null?void 0:D.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:[(I==null?void 0:I.plan)&&f.jsx(Xe,{variant:"ghost",size:"icon",className:pe("absolute top-2 right-2 z-10 h-8 w-8 rounded-md text-muted-foreground opacity-100 transition-opacity",!c&&"md:opacity-0 md:group-hover/plan:opacity-100",!c&&"hover:text-foreground",c&&"hover:!bg-transparent hover:!border-transparent"),onClick:q,"aria-label":c?"Plan copied":"Copy plan",title:c?"Plan copied":"Copy plan",children:c?f.jsx(qi,{className:"h-4 w-4 text-green-400"}):f.jsx(_l,{className:"h-4 w-4"})}),f.jsxs("div",{className:pe("!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",i&&!o?"max-h-[min(400px,40vh)] ":"",i?"hover:!pb-[32px]":""),children:[i&&f.jsxs(Xe,{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(ag,{className:`size-3.5 transition-transform ${o?"rotate-180":""}`})]}),I!=null&&I.plan?f.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[f.jsx(Cu,{remarkPlugins:[ku],components:xu(),children:I.plan}),f.jsx("div",{className:"mt-5"})]}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),i?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:U?"Discarded":D!=null&&D.clearContext?"Approved & Cleared Context":D!=null&&D.confirmed?"Approved":D!=null&&D.message?`Adjusted: "${D.message}"`:"Adjusted Plan"}),f.jsx(N8,{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 gap-2 mx-2 md:flex-row md:items-center md:justify-between",children:[f.jsx("div",{className:"flex items-center gap-2",children:I!=null&&I.plan?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"hidden items-center gap-2 md:flex",children:[f.jsxs(Xe,{type:"button",size:"sm",variant:"outline",className:"rounded-full",onClick:()=>void q(),children:[c?f.jsx(qi,{className:"h-4 w-4 mr-1.5 text-green-400"}):f.jsx(_l,{className:"h-4 w-4 mr-1.5"}),c?"Copied":"Copy"]}),f.jsxs(Xe,{type:"button",size:"sm",variant:"outline",className:"rounded-full",onClick:F,children:[f.jsx(L2,{className:"h-4 w-4 mr-1.5"}),"Download .md"]})]}),f.jsxs("div",{className:"md:hidden",children:[f.jsx(Xe,{type:"button",size:"icon",variant:"outline",className:"rounded-full","aria-label":"More plan actions",title:"More plan actions",onClick:z=>{const G=z.currentTarget.getBoundingClientRect();A({x:G.left,y:G.bottom+4})},children:f.jsx(A8,{className:"h-4 w-4"})}),f.jsxs(bw,{open:L!==null,onOpenChange:z=>{z||A(null)},position:L,children:[f.jsxs(fh,{onSelect:()=>{A(null),q()},children:[f.jsx(_l,{className:"h-4 w-4"}),f.jsx("span",{children:"Copy"})]}),f.jsxs(fh,{onSelect:()=>{A(null),F()},children:[f.jsx(L2,{className:"h-4 w-4"}),f.jsx("span",{children:"Download .md"})]})]})]})]}):null}),f.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2",children:[f.jsxs(Xe,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-primary-foreground pr-4 md:order-last",children:[f.jsx(a8,{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(Xe,{size:"sm",variant:"outline",onClick:()=>g(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[f.jsx(Xc,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),f.jsxs(Xe,{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:pe("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:z=>{z.dataTransfer.types.includes("Files")&&(z.preventDefault(),R(!0))},onDragOver:z=>{z.dataTransfer.types.includes("Files")&&(z.preventDefault(),z.dataTransfer.dropEffect="copy",R(!0))},onDragLeave:z=>{if(!z.dataTransfer.types.includes("Files"))return;z.preventDefault();const G=z.relatedTarget;G instanceof Node&&z.currentTarget.contains(G)||R(!1)},onDrop:z=>{var G;z.dataTransfer.types.includes("Files")&&(z.preventDefault(),R(!1),$(Array.from(z.dataTransfer.files)),(G=O.current)==null||G.focus())},children:[f.jsx("input",{ref:H,type:"file",accept:yp.join(","),multiple:!0,className:"hidden",onChange:z=>{$(Array.from(z.target.files??[])),z.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(z=>f.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/80 bg-background/80",children:[f.jsx("img",{src:z.previewUrl,alt:z.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:z.name}),f.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[Math.max(1,Math.round(z.sizeBytes/1024))," KB"]})]}),f.jsx(Xe,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>W(z.id),disabled:E,children:f.jsx(ko,{className:"h-3.5 w-3.5"})})]})]},z.id))}):null,f.jsx("textarea",{ref:O,value:p,onChange:z=>b(z.target.value),onPaste:z=>{const G=Array.from(z.clipboardData.files);G.some(M=>M.type.startsWith("image/"))&&(z.preventDefault(),$(G))},onKeyDown:z=>{z.key==="Enter"&&!z.shiftKey&&(p.trim()||y.length>0)&&(z.preventDefault(),K()),z.key==="Escape"&&(g(!1),b(""),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(Xe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full text-muted-foreground hover:text-foreground",onClick:()=>{var z;return(z=H.current)==null?void 0:z.click()},disabled:E,children:f.jsx(Q5,{className:"h-4 w-4"})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Xe,{size:"sm",variant:"ghost",onClick:()=>{g(!1),b(""),w([]),C(null)},className:"rounded-full text-muted-foreground",disabled:E,children:"Cancel"}),f.jsxs(Xe,{size:"sm",disabled:!p.trim()&&y.length===0||E,onClick:()=>void K(),className:"rounded-full bg-primary text-primary-foreground disabled:opacity-50 disabled:pointer-events-none",children:[f.jsx(M9,{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 gie={completed:{Icon:qi,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:wr,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:x8,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function vie({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(i9,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),f.jsx("div",{children:t.map((n,r)=>{const i=r===t.length-1,{Icon:o,iconClass:l,textClass:c}=gie[n.status];return f.jsxs("div",{className:pe("flex items-center gap-3 px-4 py-2.5 bg-background",!i&&"border-b border-border"),children:[f.jsx(o,{className:pe("h-4 w-4 flex-shrink-0",l)}),f.jsx("span",{className:pe("text-sm",c),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function bie(e){const t=e.split(`
|
|
651
|
+
`),n=/^\s*(\d+)→(.*)$/;return t.map(r=>{const i=r.match(n);return i?{lineNumber:parseInt(i[1],10),content:i[2]}:{lineNumber:null,content:r}})}function _ie(e){return e.replace(/<[^>]+>/g,"")}function yie(e,t){const n=e.split(`
|
|
652
|
+
`),r=t.split(`
|
|
653
|
+
`),i=xie(n,r),o=wie(n,r,i);return Sie(o)}function xie(e,t){const n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let o=1;o<=n;o++)for(let l=1;l<=r;l++)i[o][l]=e[o-1]===t[l-1]?i[o-1][l-1]+1:Math.max(i[o-1][l],i[o][l-1]);return i}function wie(e,t,n){const r=[];let i=e.length,o=t.length;for(;i>0||o>0;)i>0&&o>0&&e[i-1]===t[o-1]?(r.push({type:"context",text:e[i-1],oldIdx:i,newIdx:o}),i--,o--):o>0&&(i===0||n[i][o-1]>=n[i-1][o])?(r.push({type:"added",text:t[o-1],oldIdx:i,newIdx:o}),o--):(r.push({type:"removed",text:e[i-1],oldIdx:i,newIdx:o}),i--);return r.reverse()}function Sie(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function py({content:e,isDiff:t=!1,oldString:n,newString:r}){const i=v.useMemo(()=>t&&n!==void 0&&r!==void 0?yie(n,r):[],[t,n,r]),o=v.useMemo(()=>t?[]:bie(e),[e,t]),l=v.useMemo(()=>o.some(c=>c.lineNumber!==null),[o]);return t&&i.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:i.map((c,h)=>{const d=c.type==="removed"?"bg-red-500/10 dark:bg-red-500/15":c.type==="added"?"bg-green-500/10 dark:bg-green-500/15":"",g=c.type==="removed"?"text-red-700 dark:text-red-400":c.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 ${c.type==="removed"?"text-red-500/50":c.type==="added"?"text-green-500/50":"text-muted-foreground/50"}`,children:c.type==="removed"?"-":c.type==="added"?"+":" "}),f.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${g}`,children:c.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((c,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:c.lineNumber!==null?c.lineNumber:""}),f.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:_ie(c.content)})]},h))})})})})}function PO({message:e,isLoading:t=!1,localPath:n}){var k;const r=e.result!==void 0,i=!r&&t,o=v.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=v.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]),c=v.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?AH(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?l?`Read ${W_(l,n)}`:"Read file":e.toolKind==="write_file"?l?`Write ${W_(l,n)}`:"Write file":e.toolKind==="edit_file"?l?`Edit ${W_(l,n)}`:"Edit file":e.toolKind==="mcp_generic"?`${Fy(e.input.tool)} from ${Fy(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[l,e.input,e.toolKind,e.toolName,n]),h=v.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),d=v.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),g=e.toolKind==="bash",p=e.toolKind==="write_file",b=e.toolKind==="edit_file",y=e.toolKind==="read_file",w=y&&!!o.trim(),S=b&&(!!e.input.oldString.trim()||!!e.input.newString.trim()),C=v.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(Lo,{className:"w-full",children:f.jsxs(Wh,{expandedContent:f.jsx(qh,{className:"my-4 text-sm",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[b?S?f.jsx(py,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):o.trim()?f.jsx(q_,{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(q_,{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(py,{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(py,{content:e.input.content}),r&&!y&&!(p&&!e.isError)&&!(b&&!e.isError)&&f.jsx(q_,{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(ko,{className:"size-4 text-destructive"});if(h)return f.jsx(N0,{className:"size-4 text-muted-icon"});const R=x4(e.toolName);return f.jsx(R,{className:"size-4 text-muted-icon"})})()}),f.jsx(No,{className:"text-left transition-opacity duration-200 truncate",children:f.jsx(Sg,{animate:i,shimmerWidth:Math.max(20,(((k=d||c)==null?void 0:k.length)??33)*3),children:d||c})})]})})}function Cie({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),i=Math.floor(r/3600),o=Math.floor(r%3600/60),l=r%60;return i>0?`${i}h${o>0?` ${o}m`:""}`:o>0?`${o}m${l>0?` ${l}s`:""}`:`${l}s`};return e.success?f.jsxs(Lo,{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(No,{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 kie({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(_8,{className:"h-4 w-4 ml-1.5"}),f.jsx("em",{children:"Interrupted"})]})})}function Wp({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 Eie(){return f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Wp,{}),f.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),f.jsx(Wp,{})]})}function Rie(){return f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Wp,{}),f.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),f.jsx(Wp,{})]})}function Tie({message:e}){return f.jsx(Lo,{children:f.jsxs(Wh,{expandedContent:f.jsx(qh,{className:"my-4 text-xs",children:f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(Cu,{remarkPlugins:[ku],components:xu(),children:e.summary})})}),children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:f.jsx(X5,{className:"h-4.5 w-4.5 text-muted-foreground"})}),f.jsx(No,{children:"Summarized"})]})})}const Nie={compacting:"Compacting..."};function Mie({message:e}){const t=Nie[e.status]||e.status;return f.jsxs(Lo,{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(X5,{className:"h-4.5 w-4.5 text-muted-foreground"})}),f.jsx(No,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const jie={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"}},Aie={key:"other",singular:"tool call",plural:"tool calls"};function Die(e){return jie[e]??Aie}function Oie(e){const t=new Map,n=[];for(const r of e){const i=r.toolKind,o=Die(i),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:i,count:o}=t.get(r);return`${o} ${o===1?i.singular:i.plural}`}).join(", ")}function Lie({messages:e,isLoading:t,localPath:n}){const[r,i]=v.useState(!1),o=v.useMemo(()=>Oie(e),[e]),c=e.some(h=>h.result===void 0)&&t;return f.jsx(Lo,{className:"w-full",children:f.jsxs("div",{className:"flex flex-col w-full",children:[f.jsx("button",{onClick:()=>i(!r),className:`group cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${!r&&!c?"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(Vr,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),f.jsx(No,{className:"text-left",children:f.jsx(Sg,{animate:c,children:o})})]})}),r&&f.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(h=>f.jsx(PO,{message:h,isLoading:t,localPath:n},h.id)),e.length>5&&f.jsx("button",{onClick:()=>i(!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(Vr,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),f.jsx(No,{className:"text-left",children:"Collapse"})]})})]})]})})}const zie=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function YT(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!zie.has(t)}function Pie(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(YT(r)){const i=[r],o=n;for(n+=1;n<e.length&&YT(e[n]);)i.push(e[n]),n+=1;i.length>=2?t.push({type:"tool-group",messages:i,startIndex:o}):t.push({type:"single",message:r,index:o});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function Iie({messages:e,isLoading:t,localPath:n,latestToolIds:r,onOpenLocalLink:i,onAskUserQuestionSubmit:o,onExitPlanModeConfirm:l,pendingTool:c}){const h=v.useMemo(()=>Pie(e),[e]);function d(g,p){if(g.kind==="user_prompt")return f.jsx(Qre,{content:g.content,attachments:g.attachments},g.id);switch(g.kind){case"unknown":return f.jsx(Jre,{json:g.json},g.id);case"system_init":return e.findIndex(y=>y.kind==="system_init")===p?f.jsx(iie,{message:g,rawJson:g.debugRaw},g.id):null;case"account_info":return e.findIndex(y=>y.kind==="account_info")===p?f.jsx(sie,{message:g},g.id):null;case"assistant_text":return f.jsx(oie,{message:g},g.id);case"assistant_thought":return f.jsx(aie,{message:g},g.id);case"tool":return g.toolKind==="ask_user_question"?f.jsx(die,{message:g,onSubmit:o,isLatest:g.id===r.AskUserQuestion},g.id):g.toolKind==="exit_plan_mode"?f.jsx(pie,{message:g,onConfirm:l,isLatest:g.id===r.ExitPlanMode,isActionable:(c==null?void 0:c.toolKind)==="exit_plan_mode"&&c.toolUseId===g.toolId},g.id):g.toolKind==="todo_write"?g.id!==r.TodoWrite?null:f.jsx(vie,{message:g},g.id):f.jsx(PO,{message:g,isLoading:t,localPath:n},g.id);case"result":{const b=e[p+1],y=e[p-1];return(b==null?void 0:b.kind)==="context_cleared"||(y==null?void 0:y.kind)==="context_cleared"?null:f.jsx(Cie,{message:g},g.id)}case"interrupted":return f.jsx(kie,{message:g},g.id);case"compact_boundary":return f.jsx(Eie,{},g.id);case"context_cleared":return f.jsx(Rie,{},g.id);case"compact_summary":return f.jsx(Tie,{message:g},g.id);case"status":return p===e.length-1?f.jsx(Mie,{message:g},g.id):null}}return f.jsx(TX,{onOpenLocalLink:i,children:h.map(g=>{if(g.type==="tool-group")return f.jsx("div",{className:"group relative",[fp]:"",children:f.jsx(Lie,{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",[fp]:"",children:p},g.message.id):null})})}function Bie({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){v.useEffect(()=>{if(!n)return;let i=0,o=null;const l=p=>{const b=p instanceof Element?p:null,y=e.current,w=t.current;if($2({trigger:"pointer",activeElement:document.activeElement,pointerStartTarget:o,pointerEndTarget:b,root:y,fallback:w,hasActiveOverlay:H2(document),hasActiveSelection:J9(window.getSelection())})!=="restore"){o=null;return}w==null||w.focus({preventScroll:!0}),o=null},c=p=>{cancelAnimationFrame(i),o=p.target instanceof Element?p.target:null},h=p=>{cancelAnimationFrame(i),i=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 b=t.current;$2({trigger:"escape",activeElement:document.activeElement,fallback:b,hasActiveOverlay:H2(document),canCancel:r,defaultPrevented:p.defaultPrevented})==="escape-focus"&&(p.preventDefault(),b==null||b.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",c,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("keydown",g,!0),window.addEventListener(hp,d),()=>{cancelAnimationFrame(i),window.removeEventListener("pointerdown",c,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("keydown",g,!0),window.removeEventListener(hp,d)}},[r,n,t,e])}const Hm="How can I help you?",Fie=19,Hie=72,$ie=120;function Uie(){var Tt,me,Ue,Oe,mt,pt,ot,dn,Nt,In,de;const e=eg(),t=v.useRef(null),n=v.useRef(null),r=v.useRef(null),[i,o]=v.useState(""),[l,c]=v.useState(!1),[h,d]=v.useState(0),[g,p]=v.useState(!1),b=Fh("(min-width: 768px)"),y=typeof window>"u"?!0:S4(window.location.hostname),w=((Tt=e.runtime)==null?void 0:Tt.projectId)??null,C=va(oe=>w?oe.projects[w]:void 0)??HX,R=Jd(oe=>w?oe.projects[w]:void 0)??zX,E=va(oe=>oe.addTerminal),N=va(oe=>oe.removeTerminal),L=va(oe=>oe.toggleVisibility),A=va(oe=>oe.resetMainSizes),O=va(oe=>oe.setMainSizes),H=va(oe=>oe.setTerminalSizes),Z=Jd(oe=>oe.toggleVisibility),I=Jd(oe=>oe.setSize),q=Fi(oe=>oe.scrollbackLines),F=Fi(oe=>oe.minColumnWidth),$=e.keybindings,W=v.useMemo(()=>_w($),[$]),K=C.terminals.length>0,D=!!(w&&C.isVisible&&K),U=!!(w&&K),z=!!(w&&R.isVisible),G=!!(w&&!b&&z),M=!!(w&&b),{isAnimating:B,mainPanelGroupRef:X,terminalFocusRequestVersion:j,terminalPanelRef:ie,terminalVisualRef:J}=nZ({showTerminalPane:D,shouldRenderTerminalLayout:U,projectId:w,terminalLayout:C,chatInputRef:r}),{isAnimating:ee,panelGroupRef:re,sidebarPanelRef:ue,sidebarVisualRef:fe}=JX({projectId:w,shouldRenderRightSidebarLayout:M,showRightSidebar:z,rightSidebarSize:R.size});Bie({rootRef:n,fallbackRef:r,enabled:e.hasSelectedProject&&((me=e.runtime)==null?void 0:me.status)!=="waiting_for_user",canCancel:e.canCancel});const ge=()=>{if(w){if(K){p(!1),L(w);return}E(w)}},Ce=()=>{p(oe=>!oe)},Re=oe=>{var ct;if(!w||!D||B.current)return;const xe=oe.chat,ke=oe.terminal;if(!Number.isFinite(xe)||!Number.isFinite(ke))return;const Ke=((ct=t.current)==null?void 0:ct.getBoundingClientRect().height)??0;if(WX(Ke,ke)){A(w),L(w);return}O(w,[xe,ke])};v.useEffect(()=>{if(e.messages.length!==0)return;o(""),c(!1);let oe=0;const xe=window.setInterval(()=>{oe+=1,o(Hm.slice(0,oe)),oe>=Hm.length&&(window.clearInterval(xe),c(!0))},Fie);return()=>window.clearInterval(xe)},[e.activeChatId,e.messages.length]),v.useEffect(()=>{function oe(xe){if(w){if(fl(W,"toggleEmbeddedTerminal",xe)){xe.preventDefault(),ge();return}if(fl(W,"toggleRightSidebar",xe)){xe.preventDefault(),Z(w);return}if(fl(W,"openInFinder",xe)){if(!y)return;xe.preventDefault(),e.handleOpenExternal("open_finder");return}if(fl(W,"openInEditor",xe)){if(!y)return;xe.preventDefault(),e.handleOpenExternal("open_editor");return}fl(W,"addSplitTerminal",xe)&&(xe.preventDefault(),E(w))}}return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[E,y,ge,w,W,Z]),v.useEffect(()=>{D||p(!1)},[D]),v.useEffect(()=>{const oe=window.requestAnimationFrame(()=>{e.updateScrollState()}),xe=window.setTimeout(()=>{e.updateScrollState()},$c);return()=>{window.cancelAnimationFrame(oe),window.clearTimeout(xe)}},[U,D,e.updateScrollState]),v.useEffect(()=>{function oe(){e.updateScrollState()}return window.addEventListener("resize",oe),()=>window.removeEventListener("resize",oe)},[e.updateScrollState]),v.useEffect(()=>{if(b)return;const oe=window.visualViewport;if(!oe)return;const xe=()=>{const ke=e.scrollRef.current;if(!ke)return;const Ke=ke.scrollHeight-ke.scrollTop-ke.clientHeight;if(T4(Ke)){requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.scrollToBottom(),e.updateScrollState()})});return}const ct=document.activeElement;ct&&ke.contains(ct)&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{var $e;const Je=($e=e.inputRef.current)==null?void 0:$e.getBoundingClientRect(),Ae=ct.getBoundingClientRect();if(Je&&Ae.bottom>Je.top){const lt=Ae.bottom-Je.top;ke.scrollBy({top:lt+16,behavior:"auto"})}e.updateScrollState()})})};return oe.addEventListener("resize",xe),oe.addEventListener("scroll",xe),()=>{oe.removeEventListener("resize",xe),oe.removeEventListener("scroll",xe)}},[b,e.scrollRef,e.scrollToBottom,e.updateScrollState]),v.useEffect(()=>{const oe=t.current;if(!oe||!U)return;const xe=()=>{const Ke=oe.getBoundingClientRect().height;if(Ke<=0)return;const ct=Ke*(C.mainSizes[1]/100);ct<=0||d(Je=>Math.abs(Je-ct)<1?Je:ct)},ke=new ResizeObserver(xe);return ke.observe(oe),xe(),()=>ke.disconnect()},[w,U,C.mainSizes]);const je=oe=>Number.isFinite(oe)?Math.min(Ux,Math.max(Bg,oe)):R.size,Qe=()=>{w&&Z(w)},yt=f.jsxs(yw,{ref:n,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",children:[f.jsxs(xw,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[f.jsx(bq,{sidebarCollapsed:e.sidebarCollapsed,hasCompletedChats:e.completedChatIds.size>0,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,usage:e.usage,localPath:e.navbarLocalPath,embeddedTerminalVisible:D,onToggleEmbeddedTerminal:w?ge:void 0,rightSidebarVisible:z,onToggleRightSidebar:w?()=>Z(w):void 0,onOpenExternal:y?oe=>{e.handleOpenExternal(oe)}:void 0,editorLabel:e.editorLabel,projectId:w??void 0,socket:e.socket,finderShortcut:y?W.bindings.openInFinder:void 0,editorShortcut:y?W.bindings.openInEditor:void 0,terminalShortcut:W.bindings.toggleEmbeddedTerminal,rightSidebarShortcut:W.bindings.toggleRightSidebar}),f.jsxs(Ig,{ref:e.scrollRef,onScroll:e.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[(Ue=e.runtime)!=null&&Ue.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(Iie,{messages:e.messages,isLoading:e.isProcessing,localPath:(Oe=e.runtime)==null?void 0:Oe.localPath,latestToolIds:e.latestToolIds,pendingTool:((mt=e.runtime)==null?void 0:mt.pendingTool)??null,onOpenLocalLink:e.handleOpenLocalLink,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?f.jsx(DX,{status:(pt=e.runtime)==null?void 0:pt.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:Hie,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(Wd,{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":Hm,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:Hm}),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:i}),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:$ie},className:pe("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(GB,{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(fq,{ref:r,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((ot=e.runtime)==null?void 0:ot.status)==="waiting_for_user"||!!((dn=e.runtime)!=null&&dn.inactiveProviderMessage),canCancel:e.canCancel,chatId:e.activeChatId,activeProvider:((Nt=e.runtime)==null?void 0:Nt.provider)??null,activeModel:((In=e.runtime)==null?void 0:In.model)??null,activePlanMode:((de=e.runtime)==null?void 0:de.planMode)??!1,availableProviders:e.availableProviders,keybindings:W},e.activeChatId??"new-chat")})})]});return f.jsxs("div",{ref:t,className:"flex-1 flex flex-col min-w-0 relative",children:[M&&w?f.jsxs(Xd,{groupRef:re,orientation:"horizontal",className:"flex-1 min-h-0",onLayoutChange:oe=>{var ke;if(!z||ee.current)return;const xe=je(oe.rightSidebar);Math.abs(xe-oe.rightSidebar)<.1||(ke=re.current)==null||ke.setLayout({workspace:100-xe,rightSidebar:xe})},onLayoutChanged:oe=>{!z||ee.current||I(w,je(oe.rightSidebar))},children:[f.jsx(xo,{id:"workspace",defaultSize:`${100-R.size}%`,minSize:"50%",className:"min-h-0 min-w-0",children:U?f.jsxs(Xd,{groupRef:X,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:Re,children:[f.jsx(xo,{id:"chat",defaultSize:`${C.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:yt}),f.jsx(Zd,{withHandle:!0,orientation:"vertical",disabled:!D,className:pe(!D&&"pointer-events-none opacity-0")}),f.jsx(xo,{id:"terminal",defaultSize:`${C.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:ie,children:f.jsx("div",{ref:J,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":D?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${$c}ms`},children:f.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:g?null:f.jsx(V_,{projectId:w,layout:C,onAddTerminal:E,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:q,minColumnWidth:F,maximized:!1,splitTerminalShortcut:W.bindings.addSplitTerminal,focusRequestVersion:j,onToggleMaximized:Ce,onRemoveTerminal:(oe,xe)=>{e.socket.command({type:"terminal.close",terminalId:xe}).catch(()=>{}),N(oe,xe)},onTerminalLayout:H})})})})]},w):yt}),f.jsx(Zd,{withHandle:!0,orientation:"horizontal",disabled:!z,className:pe(!z&&"pointer-events-none opacity-0")}),f.jsx(xo,{id:"rightSidebar",defaultSize:`${R.size}%`,maxSize:`${Ux}%`,className:"min-h-0 min-w-0",elementRef:ue,children:f.jsx("div",{ref:fe,className:"h-full min-h-0 overflow-hidden","data-right-sidebar-open":z?"true":"false","data-right-sidebar-animated":"false","data-right-sidebar-visual":!0,style:{"--terminal-toggle-duration":`${$c}ms`},children:f.jsx(OE,{onClose:()=>Z(w)})})})]},`${w}-right-sidebar`):U&&w?f.jsxs(Xd,{groupRef:X,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:Re,children:[f.jsx(xo,{id:"chat",defaultSize:`${C.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:yt}),f.jsx(Zd,{withHandle:!0,orientation:"vertical",disabled:!D,className:pe(!D&&"pointer-events-none opacity-0")}),f.jsx(xo,{id:"terminal",defaultSize:`${C.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:ie,children:f.jsx("div",{ref:J,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":D?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${$c}ms`},children:f.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:g?null:f.jsx(V_,{projectId:w,layout:C,onAddTerminal:E,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:q,minColumnWidth:F,maximized:!1,splitTerminalShortcut:W.bindings.addSplitTerminal,focusRequestVersion:j,onToggleMaximized:Ce,onRemoveTerminal:(oe,xe)=>{e.socket.command({type:"terminal.close",terminalId:xe}).catch(()=>{}),N(oe,xe)},onTerminalLayout:H})})})})]},w):yt,g&&w&&D?f.jsx("div",{className:"absolute inset-0 z-30 flex min-h-0 min-w-0 flex-col bg-background/96 backdrop-blur-sm",children:f.jsx(V_,{projectId:w,layout:C,onAddTerminal:E,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:q,minColumnWidth:F,maximized:!0,splitTerminalShortcut:W.bindings.addSplitTerminal,focusRequestVersion:j,onToggleMaximized:Ce,onRemoveTerminal:(oe,xe)=>{e.socket.command({type:"terminal.close",terminalId:xe}).catch(()=>{}),N(oe,xe)},onTerminalLayout:H})}):null,G?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 z-40 bg-black/40 md:hidden",onClick:Qe}),f.jsx("div",{className:"fixed inset-0 z-50 flex flex-col bg-background/95 backdrop-blur-2xl md:hidden",children:f.jsx(OE,{onClose:Qe,className:"h-[var(--app-shell-height)]"})})]}):null]})}const Vie=700,Wie=1500;function qie(){const e=Aa(),t=eg(),n=t.featureOverviewSnapshot,r=Fh("(min-width: 768px)"),i=typeof window>"u"?!0:S4(window.location.hostname),[o,l]=v.useState("view"),[c,h]=v.useState(""),[d,g]=v.useState(!1),[p,b]=v.useState("idle"),[y,w]=v.useState(null),S=v.useRef(""),C=v.useRef(0);if(v.useEffect(()=>{n&&(S.current=n.content,h(n.content),g(!1),b("idle"),w(null))},[n==null?void 0:n.featureId]),v.useEffect(()=>{n&&(S.current=n.content,h(A=>d?A:n.content),d||(b("idle"),w(null)))},[d,n]),v.useEffect(()=>{if(!n||!d)return;const A=C.current+1;C.current=A,b("saving"),w(null);const O=window.setTimeout(()=>{t.socket.command({type:"feature.updateOverview",featureId:n.featureId,content:c}).then(H=>{C.current!==A||!H||(S.current=H.content,g(!1),b("saved"))}).catch(H=>{C.current===A&&(b("error"),w(H instanceof Error?H.message:String(H)))})},Vie);return()=>window.clearTimeout(O)},[c,d,n==null?void 0:n.featureId,t.socket]),v.useEffect(()=>{if(p!=="saved")return;const A=window.setTimeout(()=>{b("idle")},Wie);return()=>window.clearTimeout(A)},[p]),v.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=pe("shrink-0 text-[11px] md:text-xs",p==="error"?"text-destructive":"text-muted-foreground"),N=f.jsx(Ig,{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(Cu,{remarkPlugins:[ku],components:xu({onOpenLocalLink:t.handleOpenLocalLink}),children:c})})})}),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(Nh,{value:c,onChange:A=>{const O=A.target.value;h(O),g(O!==S.current),p!=="saving"&&b("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(yw,{className:"h-full rounded-none border-0 bg-background",children:f.jsxs(xw,{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(Xe,{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(QB,{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:pe(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:z2},{mode:"edit",label:"Edit",icon:Xc},{mode:"split",label:"Split",icon:n9}]:[{mode:"view",label:"View",icon:z2},{mode:"edit",label:"Edit",icon:Xc}]).map(({mode:A,label:O,icon:H})=>{const Z=o===A;return f.jsxs("button",{type:"button",onClick:()=>l(A),className:pe("inline-flex flex-1 items-center justify-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors md:flex-none",Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),children:[f.jsx(H,{className:"size-4"}),f.jsx("span",{children:O})]},A)})}),i?f.jsxs(Xe,{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(z8,{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(Xd,{orientation:"horizontal",className:"h-full",children:[f.jsx(xo,{defaultSize:"50%",minSize:"25%",className:"min-w-0",children:N}),f.jsx(Zd,{orientation:"horizontal",withHandle:!0}),f.jsx(xo,{defaultSize:"50%",minSize:"25%",className:"min-w-0 border-l border-border/60",children:L})]}):k?N:L})]})})})}function XT({narrow:e=!1,title:t,subtitle:n,icon:r=Z5}){return f.jsxs("div",{className:pe("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[f.jsxs("div",{className:pe("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:pe("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const Kie={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function Gie({value:e,onValueChange:t,options:n,size:r="md",className:i,optionClassName:o}){return f.jsx("div",{className:pe("inline-flex items-center rounded-lg border border-border p-[3px] ",i),children:n.map(l=>{const c=l.value===e,h=l.icon,d=h?v.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":c,className:pe("rounded-[4px] border transition-colors",h?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",Kie[r],c?"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(As,{children:[f.jsx(Ds,{asChild:!0,children:g}),f.jsx(as,{children:l.tooltip})]},l.value):g})})}function Yie(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Xie(e){const t=e.split("/").filter(Boolean);return t[t.length-1]||e}function Zie({open:e,onOpenChange:t,initialDirectory:n,onListDirectories:r,onConfirm:i}){var D;const[o,l]=v.useState("new"),[c,h]=v.useState(""),[d,g]=v.useState([]),[p,b]=v.useState({}),[y,w]=v.useState([]),[S,C]=v.useState(null),[k,R]=v.useState(""),[E,N]=v.useState(null),[L,A]=v.useState(null),O=v.useRef(null);v.useEffect(()=>{e&&(l("new"),h(""),g(n?n.roots:[]),b(n?{[n.currentPath]:n.entries}:{}),w(n?[n.currentPath]:[]),C((n==null?void 0:n.currentPath)??null),R(""),N(null),A(null),setTimeout(()=>{var U;return(U=O.current)==null?void 0:U.focus()},0))},[n,e]),v.useEffect(()=>{e&&setTimeout(()=>{var U;o==="new"&&((U=O.current)==null||U.focus())},0)},[o,e]);const H=Yie(c),Z=H?`${ZF}/${H}`:"",I=k.trim(),q=o==="new"?!!H:!!I,F=async U=>{N(null),A(U??"__root__");try{const z=await r(U);if(!U){g(z.roots),C(z.currentPath),b({[z.currentPath]:z.entries}),w([z.currentPath]);return}d.length===0&&(g([{name:Xie(z.currentPath),localPath:z.currentPath}]),C(z.currentPath)),b(G=>({...G,[z.currentPath]:z.entries})),w(G=>G.includes(z.currentPath)?G:[...G,z.currentPath])}catch(z){N(z instanceof Error?z.message:String(z))}finally{A(null)}},$=async U=>{if(y.includes(U)){w(z=>z.filter(G=>G!==U));return}if(p[U]){w(z=>[...z,U]);return}await F(U)},W=(U,z,G)=>{const M=y.includes(U),B=k===U,X=p[U]??[],j=L===U;return f.jsxs("div",{children:[f.jsxs("div",{className:pe("grid grid-cols-[auto_1fr] items-center gap-2 px-3 py-2",B?"bg-muted":"hover:bg-muted/50"),style:{paddingLeft:`${12+G*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 $(U),disabled:j,children:j?f.jsx(wr,{className:"h-4 w-4 animate-spin text-muted-foreground"}):f.jsx(Vr,{className:pe("h-4 w-4 text-muted-foreground transition-transform",M&&"rotate-90")})}),f.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",onClick:()=>R(U),children:[M?f.jsx(q5,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):f.jsx(G5,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"truncate",children:z})]})]}),M&&X.length>0?X.map(ie=>W(ie.localPath,ie.name,G+1)):null]},U)},K=()=>{if(q){if(o==="new")i({mode:"new",localPath:Z,title:c.trim()});else{const U=I.split("/").pop()||I;i({mode:"existing",localPath:I,title:U})}t(!1)}};return f.jsx(lg,{open:e,onOpenChange:t,children:f.jsxs(Th,{size:"sm",children:[f.jsxs(ug,{className:"space-y-4",children:[f.jsx(cg,{children:"Add Project"}),f.jsx(Gie,{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(Hi,{ref:O,type:"text",value:c,onChange:U=>h(U.target.value),onKeyDown:U=>{U.key==="Enter"&&K(),U.key==="Escape"&&t(!1)},placeholder:"Project name"}),Z&&f.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:Z})]}):f.jsxs("div",{className:"space-y-2",children:[f.jsx(Hi,{type:"text",value:k,onChange:U=>R(U.target.value),onKeyDown:U=>{U.key==="Enter"&&F(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(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>void F("~"),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(Ig,{className:"max-h-64 rounded-xl border border-border",children:[d.map(U=>W(U.localPath,U.name,0)),S&&((D=p[S])==null?void 0:D.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(wr,{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(dg,{children:[f.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),f.jsx(Xe,{variant:"secondary",size:"sm",onClick:K,disabled:!q,children:o==="new"?"Create":"Import"})]})]})})}function Qie({text:e}){const[t,n]=v.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return f.jsx(Xe,{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(_l,{className:"h-4 w-4"})})}function ZT({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(Vr,{className:"inline h-4 w-4 opacity-40"}),f.jsx("code",{children:e})]}),f.jsx(Qie,{text:e})]})}function $m({children:e}){return f.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function gy({children:e}){return f.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function vy({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 QT(){return f.jsx(XB,{className:"h-4 w-4 text-muted-foreground"})}function JT({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 Jie({localPath:e,iconDataUrl:t,loading:n,onClick:r,onHide:i}){const o=yn(l=>l.showProjectIconsInSidebar);return f.jsxs("div",{className:"relative group",children:[f.jsxs(As,{children:[f.jsx(Ds,{asChild:!0,children:f.jsxs("button",{className:pe("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(XA,{iconDataUrl:t,alt:`${wp(e)} icon`,className:"h-5.5 w-5.5",fallback:f.jsx(G5,{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:wp(e)}),n?f.jsx(wr,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):null]})}),f.jsx(as,{children:f.jsx("p",{children:e})})]}),f.jsx(Xe,{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(),i()},children:f.jsx(ih,{className:"h-4 w-4"})})]})}function ese({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:i,onOpenProject:o,onHideProject:l,onListDirectories:c,onCreateProject:h}){const[d,g]=PP(),[p,b]=v.useState(!1),y=v.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";v.useEffect(()=>{S&&C&&b(!0)},[S,C]);const k=R=>{if(b(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(XT,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${Tn} 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(Xe,{variant:"default",size:"sm",onClick:()=>b(!0),children:[f.jsx(R0,{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(Jie,{localPath:R.localPath,iconDataUrl:R.iconDataUrl,loading:r===R.localPath,onClick:()=>{o(R.localPath)},onHide:()=>{l(R.localPath)}},R.localPath))}):f.jsx($m,{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."})}),i?f.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3 mt-4",children:i}):null]})]}):f.jsxs(f.Fragment,{children:[f.jsx(XT,{narrow:!0,icon:O2,title:w?`Connecting ${Tn}`:`Connect ${Tn}`,subtitle:w?`${Tn} is starting up and loading your local projects.`:`Run ${Tn} 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(gy,{children:"Status"}),f.jsx("div",{className:"mb-8",children:f.jsx($m,{children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(wr,{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 ${Tn} 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:bm()})," from any terminal on this machine."]})})]})})}),w?null:f.jsxs("div",{className:"mb-10",children:[f.jsx(gy,{children:"How it works"}),f.jsx($m,{children:f.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[f.jsx(vy,{icon:T0,title:`${Tn} CLI`,subtitle:"On Your Machine"}),f.jsx(QT,{}),f.jsx(vy,{icon:Z5,title:`${Tn} Server`,subtitle:"Local WebSocket"}),f.jsx(QT,{}),f.jsx(vy,{icon:O2,title:`${Tn} UI`,subtitle:"Project Chat"})]})})]}),w?null:f.jsxs("div",{className:"mb-10",children:[f.jsx(gy,{children:"Setup"}),f.jsx($m,{children:f.jsxs("div",{className:"space-y-4",children:[f.jsxs(JT,{number:1,title:`Start ${Tn}`,children:[f.jsx("p",{children:"Run this command in your terminal:"}),f.jsx(ZT,{children:bm()})]}),f.jsxs(JT,{number:2,title:"Open the local UI",children:[f.jsxs("p",{children:[Tn," serves the app locally and opens the Local Projects page in an app-style browser window."]}),f.jsx(ZT,{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:bm("").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:bm("--no-open")}),f.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),f.jsx(Zie,{open:p,onOpenChange:k,initialDirectory:(n==null?void 0:n.rootDirectory)??null,onListDirectories:c,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",U0.split("/")[1]]})})]})}function tse(){const e=eg();return f.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:f.jsx(ese,{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})})}const nse="web+kaizen";function a0(e){return!e||!e.startsWith("/")||e.startsWith("//")?"/":e}function rse(e){const t=new URLSearchParams(e),n=a0(t.get("target"));if(n!=="/")return n;const r=t.get("launch");if(!r)return"/";try{const i=new URL(r);return a0(i.searchParams.get("target"))}catch{return"/"}}function ise(e){const t=new URL(`${nse}://open`);return t.searchParams.set("target",a0(e)),t.toString()}function sse(e){return e.innerWidth<=820||e.matchMedia("(pointer: coarse)").matches}function ose(e){return/\b(?:Chrome|CriOS|Edg|EdgA|EdgiOS)\b/i.test(e)}function ase(e){return/iPhone|iPad|iPod/i.test(e)?"In Safari, tap Share, then Add to Home Screen.":/Android/i.test(e)?"Use your browser menu to install Kaizen to the home screen.":"Use your browser install action to save Kaizen as an app, or continue in the browser."}function lse(){const e=oi(),t=nD(),n=v.useMemo(()=>rse(e.search),[e.search]),[r,i]=v.useState(!1),[o,l]=v.useState(null);v.useEffect(()=>{function d(g){g.preventDefault(),l(g)}return window.addEventListener("beforeinstallprompt",d),()=>{window.removeEventListener("beforeinstallprompt",d)}},[]),v.useEffect(()=>{if(t){window.location.replace(n);return}if(new URLSearchParams(e.search).has("launch")){window.location.replace(n);return}if(!sse(window)){window.location.replace(n);return}if(!ose(navigator.userAgent)){i(!0);return}const p=ise(n),b=window.setTimeout(()=>{i(!0)},900),y=()=>{document.visibilityState==="hidden"&&window.clearTimeout(b)};return document.addEventListener("visibilitychange",y),window.location.assign(p),()=>{window.clearTimeout(b),document.removeEventListener("visibilitychange",y)}},[t,e.search,n]);async function c(){o&&(await o.prompt(),await o.userChoice.catch(()=>{}),l(null))}const h=ase(navigator.userAgent);return f.jsxs("main",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-[radial-gradient(circle_at_top,rgba(241,245,249,0.96),rgba(255,255,255,1)_42%),linear-gradient(135deg,#fff8ef_0%,#ffffff_45%,#eef6ff_100%)] px-5 py-8 text-slate-950 dark:bg-[radial-gradient(circle_at_top,rgba(30,41,59,0.92),rgba(15,23,42,1)_46%),linear-gradient(135deg,#0f172a_0%,#111827_45%,#1f2937_100%)] dark:text-slate-50",children:[f.jsx("div",{className:"absolute inset-x-0 top-0 h-40 bg-[radial-gradient(circle_at_center,rgba(249,115,22,0.12),transparent_68%)] dark:bg-[radial-gradient(circle_at_center,rgba(251,146,60,0.14),transparent_68%)]"}),f.jsxs("section",{className:"relative w-full max-w-sm overflow-hidden rounded-[2rem] border border-white/70 bg-white/88 p-6 shadow-[0_30px_120px_-32px_rgba(15,23,42,0.42)] backdrop-blur-xl dark:border-slate-700/70 dark:bg-slate-900/88",children:[f.jsx("div",{className:"mb-6 inline-flex rounded-full border border-orange-200 bg-orange-50 px-3 py-1 text-xs font-semibold uppercase tracking-[0.2em] text-orange-700 dark:border-orange-400/30 dark:bg-orange-400/10 dark:text-orange-200",children:"Remote handoff"}),f.jsxs("h1",{className:"font-logo text-3xl leading-none tracking-tight",children:["Open ",Tn]}),f.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-600 dark:text-slate-300",children:r?"Kaizen could not jump straight into the installed app on this device. You can keep going in the browser or install it for one-tap launches next time.":"Trying to open your installed Kaizen app. If it does not switch automatically, use the browser fallback below."}),f.jsxs("div",{className:"mt-6 space-y-3",children:[f.jsx(ng,{to:n,className:"block rounded-2xl bg-slate-950 px-4 py-3 text-center text-sm font-semibold text-white transition hover:bg-slate-800 dark:bg-white dark:text-slate-950 dark:hover:bg-slate-200",children:"Continue in browser"}),o?f.jsx("button",{type:"button",onClick:()=>{c()},className:"block w-full rounded-2xl border border-orange-300 bg-orange-50 px-4 py-3 text-sm font-semibold text-orange-800 transition hover:bg-orange-100 dark:border-orange-400/40 dark:bg-orange-400/10 dark:text-orange-100 dark:hover:bg-orange-400/20",children:"Install Kaizen"}):null]}),f.jsxs("div",{className:"mt-6 rounded-2xl border border-slate-200/80 bg-slate-50/90 p-4 text-sm leading-6 text-slate-700 dark:border-slate-700 dark:bg-slate-800/80 dark:text-slate-200",children:[f.jsx("p",{className:"font-semibold text-slate-950 dark:text-white",children:"Install hint"}),f.jsx("p",{className:"mt-1",children:h})]})]})]})}const cse=3210;function use(e,t){const n=new URLSearchParams(e),r=Number(n.get("localPort"));if(Number.isFinite(r)&&r>0)return Math.round(r);const i=Number(t);return Number.isFinite(i)&&i>0?Math.round(i):cse}function dse(e){return`tailscale serve --bg --https 443 http://127.0.0.1:${String(e)}`}function hse(e){return new URLSearchParams(e).get("reason")==="serve_permission_denied"?"serve_permission_denied":null}function fse(e){const n=new URLSearchParams(e).get("setupCommand");return n!=null&&n.trim()?n:null}const mse="https://tailscale.com/download",pse="https://tailscale.com/kb/1242/tailscale-serve",gse="https://tailscale.com/docs/how-to/set-up-https-certificates";function vse(){const e=oi(),t=v.useMemo(()=>use(e.search,window.location.port),[e.search]),n=v.useMemo(()=>hse(e.search),[e.search]),r=v.useMemo(()=>fse(e.search),[e.search]),i=v.useMemo(()=>dse(t),[t]);return f.jsxs("main",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-[radial-gradient(circle_at_top,rgba(241,245,249,0.96),rgba(255,255,255,1)_42%),linear-gradient(135deg,#fff8ef_0%,#ffffff_45%,#eef6ff_100%)] px-5 py-8 text-slate-950 dark:bg-[radial-gradient(circle_at_top,rgba(30,41,59,0.92),rgba(15,23,42,1)_46%),linear-gradient(135deg,#0f172a_0%,#111827_45%,#1f2937_100%)] dark:text-slate-50",children:[f.jsx("div",{className:"absolute inset-x-0 top-0 h-40 bg-[radial-gradient(circle_at_center,rgba(249,115,22,0.12),transparent_68%)] dark:bg-[radial-gradient(circle_at_center,rgba(251,146,60,0.14),transparent_68%)]"}),f.jsxs("section",{className:"relative w-full max-w-2xl overflow-hidden rounded-[2rem] border border-white/70 bg-white/88 p-6 shadow-[0_30px_120px_-32px_rgba(15,23,42,0.42)] backdrop-blur-xl dark:border-slate-700/70 dark:bg-slate-900/88",children:[f.jsx("div",{className:"mb-6 inline-flex rounded-full border border-orange-200 bg-orange-50 px-3 py-1 text-xs font-semibold uppercase tracking-[0.2em] text-orange-700 dark:border-orange-400/30 dark:bg-orange-400/10 dark:text-orange-200",children:"Remote setup"}),f.jsxs("h1",{className:"font-logo text-3xl leading-none tracking-tight",children:["Enable remote ",Tn]}),f.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-600 dark:text-slate-300",children:"Kaizen remote mode works best over Tailscale. If HTTPS handoff is not ready yet, use the steps below to install Tailscale, join your tailnet, and expose this local Kaizen session through Tailscale Serve."}),n==="serve_permission_denied"&&r?f.jsxs("section",{className:"mt-6 rounded-2xl border border-orange-300 bg-orange-50/90 p-4 text-sm leading-6 text-orange-950 dark:border-orange-400/40 dark:bg-orange-400/10 dark:text-orange-100",children:[f.jsx("p",{className:"font-semibold",children:"One-time machine setup needed"}),f.jsx("p",{className:"mt-1",children:"Tailscale is connected, but this user is not allowed to change Serve config yet. Run this once on the Kaizen machine:"}),f.jsx("pre",{className:"mt-3 overflow-x-auto rounded-2xl bg-slate-950 p-4 text-xs text-slate-50",children:f.jsx("code",{children:r})})]}):null,f.jsxs("div",{className:"mt-6 space-y-4 text-sm leading-6",children:[f.jsxs("section",{className:"rounded-2xl border border-slate-200/80 bg-slate-50/90 p-4 dark:border-slate-700 dark:bg-slate-800/80",children:[f.jsx("p",{className:"font-semibold text-slate-950 dark:text-white",children:"1. Install and connect Tailscale"}),f.jsx("p",{className:"mt-1 text-slate-700 dark:text-slate-200",children:"Install Tailscale on this machine and on the device you want to open Kaizen from. Then sign in and connect both devices to the same tailnet."}),f.jsxs("div",{className:"mt-3 flex flex-wrap gap-3",children:[f.jsx("a",{href:mse,target:"_blank",rel:"noreferrer",className:"rounded-xl border border-slate-300 px-3 py-2 font-medium text-slate-900 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-100 dark:hover:bg-slate-700",children:"Download Tailscale"}),f.jsx("code",{className:"rounded-xl bg-slate-950 px-3 py-2 text-xs text-slate-50 dark:bg-slate-950",children:"tailscale up"})]})]}),f.jsxs("section",{className:"rounded-2xl border border-slate-200/80 bg-slate-50/90 p-4 dark:border-slate-700 dark:bg-slate-800/80",children:[f.jsx("p",{className:"font-semibold text-slate-950 dark:text-white",children:"2. Turn on HTTPS handoff with Tailscale Serve"}),f.jsx("p",{className:"mt-1 text-slate-700 dark:text-slate-200",children:"Run this on the machine where Kaizen is already running. It tells Tailscale to publish your local Kaizen port behind your tailnet HTTPS URL."}),f.jsx("pre",{className:"mt-3 overflow-x-auto rounded-2xl bg-slate-950 p-4 text-xs text-slate-50",children:f.jsx("code",{children:i})}),f.jsx("p",{className:"mt-3 text-slate-700 dark:text-slate-200",children:"If Tailscale says Serve is not enabled on your tailnet, an admin needs to enable HTTPS certificates and Serve support first."}),f.jsxs("div",{className:"mt-3 flex flex-wrap gap-3",children:[f.jsx("a",{href:pse,target:"_blank",rel:"noreferrer",className:"rounded-xl border border-slate-300 px-3 py-2 font-medium text-slate-900 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-100 dark:hover:bg-slate-700",children:"Tailscale Serve docs"}),f.jsx("a",{href:gse,target:"_blank",rel:"noreferrer",className:"rounded-xl border border-slate-300 px-3 py-2 font-medium text-slate-900 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-100 dark:hover:bg-slate-700",children:"Enable HTTPS certs"})]})]}),f.jsxs("section",{className:"rounded-2xl border border-slate-200/80 bg-slate-50/90 p-4 dark:border-slate-700 dark:bg-slate-800/80",children:[f.jsx("p",{className:"font-semibold text-slate-950 dark:text-white",children:"3. Start Kaizen remote mode again"}),f.jsx("pre",{className:"mt-3 overflow-x-auto rounded-2xl bg-slate-950 p-4 text-xs text-slate-50",children:f.jsx("code",{children:"kaizen --remote"})}),f.jsxs("p",{className:"mt-3 text-slate-700 dark:text-slate-200",children:["Once Serve is ready, Kaizen should print an"," ",f.jsx("span",{className:"font-semibold",children:"https://…ts.net/open"})," QR handoff URL instead of the HTTP fallback."]})]})]}),f.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:f.jsx(ng,{to:"/",className:"rounded-2xl bg-slate-950 px-4 py-3 text-sm font-semibold text-white transition hover:bg-slate-800 dark:bg-white dark:text-slate-950 dark:hover:bg-slate-200",children:"Back to Kaizen"})})]})]})}function Dc({children:e,className:t,icon:n,type:r="button",variant:i="outline",...o}){return f.jsxs("button",{type:r,className:pe(h5({variant:i,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",t),...o,children:[n,e?f.jsx("span",{children:e}):null]})}function bse(e){return{browserNotificationsEnabled:(e==null?void 0:e.browserNotificationsEnabled)===!0,soundEnabled:(e==null?void 0:e.soundEnabled)===!0,vibrationEnabled:(e==null?void 0:e.vibrationEnabled)===!0,lastPermissionState:(e==null?void 0:e.lastPermissionState)==="granted"||(e==null?void 0:e.lastPermissionState)==="denied"||(e==null?void 0:e.lastPermissionState)==="default"||(e==null?void 0:e.lastPermissionState)==="unsupported"?e.lastPermissionState:null}}const ss=Us()(Vs(e=>({browserNotificationsEnabled:!1,soundEnabled:!1,vibrationEnabled:!1,lastPermissionState:null,setBrowserNotificationsEnabled:t=>e({browserNotificationsEnabled:t}),setSoundEnabled:t=>e({soundEnabled:t}),setVibrationEnabled:t=>e({vibrationEnabled:t}),setLastPermissionState:t=>e({lastPermissionState:t})}),{name:"notification-preferences",migrate:e=>bse(e)}));function eN(){return{baselineEstablished:!1,dedupeByChatId:new Map,statusByChatId:new Map}}function _se(e){const t=[];for(const n of e.projectGroups){for(const r of n.generalChats)t.push({chat:r,projectTitle:n.title});for(const r of n.features)for(const i of r.chats)t.push({chat:i,projectTitle:n.title})}return t}function tN(e=null){return Eu()?Notification.permission:e??"unsupported"}function yse(e){return e==="granted"?"Allowed":e==="denied"?"Blocked":e==="default"?"Not requested":"Unsupported"}async function nN(){return Eu()?Notification.requestPermission():"unsupported"}function Eu(){return typeof window<"u"&&window.isSecureContext&&typeof Notification<"u"}function xse({activeChatId:e,chatId:t,documentVisible:n}){return!n||e!==t}function IO(e){return e==="starting"||e==="running"}function wse(e,t){const n=IO(e),r=e==="waiting_for_user";return n&&t==="waiting_for_user"?"needs_input":(n||r)&&t==="idle"?"completed":null}function Sse({activeChatId:e,documentVisible:t,previousState:n,sidebarData:r}){const i=new Map,o=new Map(n.dedupeByChatId),l=[],c=_se(r);for(const{chat:h,projectTitle:d}of c){const g=n.statusByChatId.get(h.chatId);if(i.set(h.chatId,h.status),(IO(h.status)||h.status==="failed")&&o.delete(h.chatId),!n.baselineEstablished)continue;const p=wse(g,h.status);p&&xse({activeChatId:e,chatId:h.chatId,documentVisible:t})&&o.get(h.chatId)!==p&&(o.set(h.chatId,p),l.push({chatId:h.chatId,chatTitle:h.title,eventId:`${h.chatId}:${p}:${Date.now()}`,projectTitle:d,kind:p}))}return{events:l,nextState:{baselineEstablished:!0,dedupeByChatId:o,statusByChatId:i}}}let by=null;function Cse(){if(typeof window>"u")return null;const e=window.AudioContext;return e?(by||(by=Promise.resolve(new e)),by):null}function rN({audioContext:e,startAt:t,duration:n,frequency:r,gainValue:i}){const o=e.createOscillator(),l=e.createGain(),c=t+.012,h=t+Math.max(n-.08,.02),d=t+n;o.type="sine",o.frequency.setValueAtTime(r,t),l.gain.setValueAtTime(1e-4,t),l.gain.exponentialRampToValueAtTime(i,c),l.gain.setValueAtTime(i,h),l.gain.exponentialRampToValueAtTime(1e-4,d),o.connect(l),l.connect(e.destination),o.start(t),o.stop(d)}async function kse(){const e=await Cse();if(!e)return;e.state==="suspended"&&await e.resume();const t=e.currentTime;rN({audioContext:e,startAt:t,duration:.24,frequency:880,gainValue:.14}),rN({audioContext:e,startAt:t+.12,duration:.34,frequency:1318.51,gainValue:.18})}function Ese(e){typeof navigator>"u"||typeof navigator.vibrate!="function"||navigator.vibrate(e==="needs_input"?[180,100,180]:[120])}function Rse(e,t){if(!Eu()||Notification.permission!=="granted")return null;const n=new Notification(e.chatTitle,{body:e.kind==="needs_input"?`${e.projectTitle} needs your input in ${Tn}.`:`${e.projectTitle} finished responding in ${Tn}.`,tag:e.eventId!==void 0?`kaizen:${e.eventId}`:`kaizen:${e.chatId}:${e.kind}:${Date.now()}`,icon:"/app-icon-192.png",badge:"/app-icon-96.png",requireInteraction:e.kind==="needs_input"});return n.onclick=()=>{window.focus(),t(),n.close()},n}async function BO({event:e,onBrowserNotificationClick:t,preferences:n}){if(Eu()){if(n.browserNotificationsEnabled&&Rse(e,t),n.soundEnabled)try{await kse()}catch{}n.vibrationEnabled&&Ese(e.kind)}}var Wt;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const l of i)o[l]=l;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),l={};for(const c of o)l[c]=i[c];return e.objectValues(l)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&o.push(l);return o},e.find=(i,o)=>{for(const l of i)if(o(l))return l},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Wt||(Wt={}));var iN;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(iN||(iN={}));const Ye=Wt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ya=e=>{switch(typeof e){case"undefined":return Ye.undefined;case"string":return Ye.string;case"number":return Number.isNaN(e)?Ye.nan:Ye.number;case"boolean":return Ye.boolean;case"function":return Ye.function;case"bigint":return Ye.bigint;case"symbol":return Ye.symbol;case"object":return Array.isArray(e)?Ye.array:e===null?Ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ye.promise:typeof Map<"u"&&e instanceof Map?Ye.map:typeof Set<"u"&&e instanceof Set?Ye.set:typeof Date<"u"&&e instanceof Date?Ye.date:Ye.object;default:return Ye.unknown}},Ne=Wt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Mo extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const l of o.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let c=r,h=0;for(;h<l.path.length;){const d=l.path[h];h===l.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(l))):c[d]=c[d]||{_errors:[]},c=c[d],h++}}};return i(this),r}static assert(t){if(!(t instanceof Mo))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Wt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Mo.create=e=>new Mo(e);const l0=(e,t)=>{let n;switch(e.code){case Ne.invalid_type:e.received===Ye.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Wt.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${Wt.joinValues(e.keys,", ")}`;break;case Ne.invalid_union:n="Invalid input";break;case Ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Wt.joinValues(e.options)}`;break;case Ne.invalid_enum_value:n=`Invalid enum value. Expected ${Wt.joinValues(e.options)}, received '${e.received}'`;break;case Ne.invalid_arguments:n="Invalid function arguments";break;case Ne.invalid_return_type:n="Invalid function return type";break;case Ne.invalid_date:n="Invalid date";break;case Ne.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Wt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ne.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ne.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ne.custom:n="Invalid input";break;case Ne.invalid_intersection_types:n="Intersection results could not be merged";break;case Ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,Wt.assertNever(e)}return{message:n}};let Tse=l0;function Nse(){return Tse}const Mse=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],l={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let c="";const h=r.filter(d=>!!d).slice().reverse();for(const d of h)c=d(l,{data:t,defaultError:c}).message;return{...i,path:o,message:c}};function Be(e,t){const n=Nse(),r=Mse({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===l0?void 0:l0].filter(i=>!!i)});e.common.issues.push(r)}class Ci{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return ht;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,l=await i.value;r.push({key:o,value:l})}return Ci.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:l}=i;if(o.status==="aborted"||l.status==="aborted")return ht;o.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(r[o.value]=l.value)}return{status:t.value,value:r}}}const ht=Object.freeze({status:"aborted"}),$d=e=>({status:"dirty",value:e}),Qi=e=>({status:"valid",value:e}),sN=e=>e.status==="aborted",oN=e=>e.status==="dirty",ru=e=>e.status==="valid",qp=e=>typeof Promise<"u"&&e instanceof Promise;var et;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(et||(et={}));class Ma{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const aN=(e,t)=>{if(ru(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Mo(e.common.issues);return this._error=n,this._error}}};function Rt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(l,c)=>{const{message:h}=e;return l.code==="invalid_enum_value"?{message:h??c.defaultError}:typeof c.data>"u"?{message:h??r??c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:h??n??c.defaultError}},description:i}}class Ht{get description(){return this._def.description}_getType(t){return ya(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ya(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ci,ctx:{common:t.parent.common,data:t.data,parsedType:ya(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(qp(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ya(t)},i=this._parseSync({data:t,path:r.path,parent:r});return aN(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ya(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:n});return ru(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(i=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>ru(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ya(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(qp(i)?i:Promise.resolve(i));return aN(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const l=t(i),c=()=>o.addIssue({code:Ne.custom,...r(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(h=>h?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new su({schema:this,typeName:ft.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ra.create(this,this._def)}nullable(){return ou.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Bs.create(this)}promise(){return Xp.create(this,this._def)}or(t){return Gp.create([this,t],this._def)}and(t){return Yp.create(this,t,this._def)}transform(t){return new su({...Rt(this._def),schema:this,typeName:ft.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new d0({...Rt(this._def),innerType:this,defaultValue:n,typeName:ft.ZodDefault})}brand(){return new Jse({typeName:ft.ZodBranded,type:this,...Rt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new h0({...Rt(this._def),innerType:this,catchValue:n,typeName:ft.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return a1.create(this,t)}readonly(){return f0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jse=/^c[^\s-]{8,}$/i,Ase=/^[0-9a-z]+$/,Dse=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ose=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Lse=/^[a-z0-9_-]{21}$/i,zse=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Pse=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ise=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bse="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _y;const Fse=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hse=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$se=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Use=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vse=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wse=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,FO="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qse=new RegExp(`^${FO}$`);function HO(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Kse(e){return new RegExp(`^${HO(e)}$`)}function Gse(e){let t=`${FO}T${HO(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Yse(e,t){return!!((t==="v4"||!t)&&Fse.test(e)||(t==="v6"||!t)&&$se.test(e))}function Xse(e,t){if(!zse.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function Zse(e,t){return!!((t==="v4"||!t)&&Hse.test(e)||(t==="v6"||!t)&&Use.test(e))}class Ca extends Ht{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ye.string){const o=this._getOrReturnCtx(t);return Be(o,{code:Ne.invalid_type,expected:Ye.string,received:o.parsedType}),ht}const r=new Ci;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const l=t.data.length>o.value,c=t.data.length<o.value;(l||c)&&(i=this._getOrReturnCtx(t,i),l?Be(i,{code:Ne.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&Be(i,{code:Ne.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Ise.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"email",code:Ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")_y||(_y=new RegExp(Bse,"u")),_y.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"emoji",code:Ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Ose.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"uuid",code:Ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")Lse.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"nanoid",code:Ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")jse.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"cuid",code:Ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Ase.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"cuid2",code:Ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Dse.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"ulid",code:Ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Be(i,{validation:"url",code:Ne.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"regex",code:Ne.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Gse(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?qse.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Kse(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Pse.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"duration",code:Ne.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Yse(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"ip",code:Ne.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Xse(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"jwt",code:Ne.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Zse(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"cidr",code:Ne.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Vse.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"base64",code:Ne.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?Wse.test(t.data)||(i=this._getOrReturnCtx(t,i),Be(i,{validation:"base64url",code:Ne.invalid_string,message:o.message}),r.dirty()):Wt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Ne.invalid_string,...et.errToObj(r)})}_addCheck(t){return new Ca({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...et.errToObj(t)})}url(t){return this._addCheck({kind:"url",...et.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...et.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...et.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...et.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...et.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...et.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...et.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...et.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...et.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...et.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...et.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...et.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...et.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...et.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...et.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...et.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...et.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...et.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...et.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...et.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...et.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...et.errToObj(n)})}nonempty(t){return this.min(1,et.errToObj(t))}trim(){return new Ca({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ca({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ca({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ca.create=e=>new Ca({checks:[],typeName:ft.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Rt(e)});function Qse(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),l=Number.parseInt(t.toFixed(i).replace(".",""));return o%l/10**i}class xh extends Ht{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ye.number){const o=this._getOrReturnCtx(t);return Be(o,{code:Ne.invalid_type,expected:Ye.number,received:o.parsedType}),ht}let r;const i=new Ci;for(const o of this._def.checks)o.kind==="int"?Wt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Be(r,{code:Ne.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:Ne.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:Ne.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Qse(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Be(r,{code:Ne.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Be(r,{code:Ne.not_finite,message:o.message}),i.dirty()):Wt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,i){return new xh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(i)}]})}_addCheck(t){return new xh({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:et.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:et.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Wt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}xh.create=e=>new xh({checks:[],typeName:ft.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Rt(e)});class wh extends Ht{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ye.bigint)return this._getInvalidInput(t);let r;const i=new Ci;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:Ne.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:Ne.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:Ne.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Wt.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Be(n,{code:Ne.invalid_type,expected:Ye.bigint,received:n.parsedType}),ht}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,i){return new wh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(i)}]})}_addCheck(t){return new wh({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}wh.create=e=>new wh({checks:[],typeName:ft.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Rt(e)});class c0 extends Ht{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ye.boolean){const r=this._getOrReturnCtx(t);return Be(r,{code:Ne.invalid_type,expected:Ye.boolean,received:r.parsedType}),ht}return Qi(t.data)}}c0.create=e=>new c0({typeName:ft.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Rt(e)});class Kp extends Ht{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ye.date){const o=this._getOrReturnCtx(t);return Be(o,{code:Ne.invalid_type,expected:Ye.date,received:o.parsedType}),ht}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Be(o,{code:Ne.invalid_date}),ht}const r=new Ci;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Be(i,{code:Ne.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Wt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Kp({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:et.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:et.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Kp.create=e=>new Kp({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ft.ZodDate,...Rt(e)});class lN extends Ht{_parse(t){if(this._getType(t)!==Ye.symbol){const r=this._getOrReturnCtx(t);return Be(r,{code:Ne.invalid_type,expected:Ye.symbol,received:r.parsedType}),ht}return Qi(t.data)}}lN.create=e=>new lN({typeName:ft.ZodSymbol,...Rt(e)});class cN extends Ht{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return Be(r,{code:Ne.invalid_type,expected:Ye.undefined,received:r.parsedType}),ht}return Qi(t.data)}}cN.create=e=>new cN({typeName:ft.ZodUndefined,...Rt(e)});class uN extends Ht{_parse(t){if(this._getType(t)!==Ye.null){const r=this._getOrReturnCtx(t);return Be(r,{code:Ne.invalid_type,expected:Ye.null,received:r.parsedType}),ht}return Qi(t.data)}}uN.create=e=>new uN({typeName:ft.ZodNull,...Rt(e)});class dN extends Ht{constructor(){super(...arguments),this._any=!0}_parse(t){return Qi(t.data)}}dN.create=e=>new dN({typeName:ft.ZodAny,...Rt(e)});class hN extends Ht{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Qi(t.data)}}hN.create=e=>new hN({typeName:ft.ZodUnknown,...Rt(e)});class ja extends Ht{_parse(t){const n=this._getOrReturnCtx(t);return Be(n,{code:Ne.invalid_type,expected:Ye.never,received:n.parsedType}),ht}}ja.create=e=>new ja({typeName:ft.ZodNever,...Rt(e)});class fN extends Ht{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return Be(r,{code:Ne.invalid_type,expected:Ye.void,received:r.parsedType}),ht}return Qi(t.data)}}fN.create=e=>new fN({typeName:ft.ZodVoid,...Rt(e)});class Bs extends Ht{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Ye.array)return Be(n,{code:Ne.invalid_type,expected:Ye.array,received:n.parsedType}),ht;if(i.exactLength!==null){const l=n.data.length>i.exactLength.value,c=n.data.length<i.exactLength.value;(l||c)&&(Be(n,{code:l?Ne.too_big:Ne.too_small,minimum:c?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Be(n,{code:Ne.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Be(n,{code:Ne.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,c)=>i.type._parseAsync(new Ma(n,l,n.path,c)))).then(l=>Ci.mergeArray(r,l));const o=[...n.data].map((l,c)=>i.type._parseSync(new Ma(n,l,n.path,c)));return Ci.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Bs({...this._def,minLength:{value:t,message:et.toString(n)}})}max(t,n){return new Bs({...this._def,maxLength:{value:t,message:et.toString(n)}})}length(t,n){return new Bs({...this._def,exactLength:{value:t,message:et.toString(n)}})}nonempty(t){return this.min(1,t)}}Bs.create=(e,t)=>new Bs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ft.ZodArray,...Rt(t)});function zc(e){if(e instanceof Qn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ra.create(zc(r))}return new Qn({...e._def,shape:()=>t})}else return e instanceof Bs?new Bs({...e._def,type:zc(e.element)}):e instanceof Ra?Ra.create(zc(e.unwrap())):e instanceof ou?ou.create(zc(e.unwrap())):e instanceof Dl?Dl.create(e.items.map(t=>zc(t))):e}class Qn extends Ht{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Wt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ye.object){const d=this._getOrReturnCtx(t);return Be(d,{code:Ne.invalid_type,expected:Ye.object,received:d.parsedType}),ht}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof ja&&this._def.unknownKeys==="strip"))for(const d in i.data)l.includes(d)||c.push(d);const h=[];for(const d of l){const g=o[d],p=i.data[d];h.push({key:{status:"valid",value:d},value:g._parse(new Ma(i,p,i.path,d)),alwaysSet:d in i.data})}if(this._def.catchall instanceof ja){const d=this._def.unknownKeys;if(d==="passthrough")for(const g of c)h.push({key:{status:"valid",value:g},value:{status:"valid",value:i.data[g]}});else if(d==="strict")c.length>0&&(Be(i,{code:Ne.unrecognized_keys,keys:c}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const g of c){const p=i.data[g];h.push({key:{status:"valid",value:g},value:d._parse(new Ma(i,p,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const d=[];for(const g of h){const p=await g.key,b=await g.value;d.push({key:p,value:b,alwaysSet:g.alwaysSet})}return d}).then(d=>Ci.mergeObjectSync(r,d)):Ci.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(t){return et.errToObj,new Qn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,l;const i=((l=(o=this._def).errorMap)==null?void 0:l.call(o,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:et.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new Qn({...this._def,unknownKeys:"strip"})}passthrough(){return new Qn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Qn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Qn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ft.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Qn({...this._def,catchall:t})}pick(t){const n={};for(const r of Wt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Wt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}deepPartial(){return zc(this)}partial(t){const n={};for(const r of Wt.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new Qn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Wt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ra;)o=o._def.innerType;n[r]=o}return new Qn({...this._def,shape:()=>n})}keyof(){return $O(Wt.objectKeys(this.shape))}}Qn.create=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strip",catchall:ja.create(),typeName:ft.ZodObject,...Rt(t)});Qn.strictCreate=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strict",catchall:ja.create(),typeName:ft.ZodObject,...Rt(t)});Qn.lazycreate=(e,t)=>new Qn({shape:e,unknownKeys:"strip",catchall:ja.create(),typeName:ft.ZodObject,...Rt(t)});class Gp extends Ht{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const l=o.map(c=>new Mo(c.ctx.common.issues));return Be(n,{code:Ne.invalid_union,unionErrors:l}),ht}if(n.common.async)return Promise.all(r.map(async o=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(i);{let o;const l=[];for(const h of r){const d={...n,common:{...n.common,issues:[]},parent:null},g=h._parseSync({data:n.data,path:n.path,parent:d});if(g.status==="valid")return g;g.status==="dirty"&&!o&&(o={result:g,ctx:d}),d.common.issues.length&&l.push(d.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const c=l.map(h=>new Mo(h));return Be(n,{code:Ne.invalid_union,unionErrors:c}),ht}}get options(){return this._def.options}}Gp.create=(e,t)=>new Gp({options:e,typeName:ft.ZodUnion,...Rt(t)});function u0(e,t){const n=ya(e),r=ya(t);if(e===t)return{valid:!0,data:e};if(n===Ye.object&&r===Ye.object){const i=Wt.objectKeys(t),o=Wt.objectKeys(e).filter(c=>i.indexOf(c)!==-1),l={...e,...t};for(const c of o){const h=u0(e[c],t[c]);if(!h.valid)return{valid:!1};l[c]=h.data}return{valid:!0,data:l}}else if(n===Ye.array&&r===Ye.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const l=e[o],c=t[o],h=u0(l,c);if(!h.valid)return{valid:!1};i.push(h.data)}return{valid:!0,data:i}}else return n===Ye.date&&r===Ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Yp extends Ht{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,l)=>{if(sN(o)||sN(l))return ht;const c=u0(o.value,l.value);return c.valid?((oN(o)||oN(l))&&n.dirty(),{status:n.value,value:c.data}):(Be(r,{code:Ne.invalid_intersection_types}),ht)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,l])=>i(o,l)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Yp.create=(e,t,n)=>new Yp({left:e,right:t,typeName:ft.ZodIntersection,...Rt(n)});class Dl extends Ht{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.array)return Be(r,{code:Ne.invalid_type,expected:Ye.array,received:r.parsedType}),ht;if(r.data.length<this._def.items.length)return Be(r,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ht;!this._def.rest&&r.data.length>this._def.items.length&&(Be(r,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((l,c)=>{const h=this._def.items[c]||this._def.rest;return h?h._parse(new Ma(r,l,r.path,c)):null}).filter(l=>!!l);return r.common.async?Promise.all(o).then(l=>Ci.mergeArray(n,l)):Ci.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Dl({...this._def,rest:t})}}Dl.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dl({items:e,typeName:ft.ZodTuple,rest:null,...Rt(t)})};class mN extends Ht{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.map)return Be(r,{code:Ne.invalid_type,expected:Ye.map,received:r.parsedType}),ht;const i=this._def.keyType,o=this._def.valueType,l=[...r.data.entries()].map(([c,h],d)=>({key:i._parse(new Ma(r,c,r.path,[d,"key"])),value:o._parse(new Ma(r,h,r.path,[d,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const h of l){const d=await h.key,g=await h.value;if(d.status==="aborted"||g.status==="aborted")return ht;(d.status==="dirty"||g.status==="dirty")&&n.dirty(),c.set(d.value,g.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const h of l){const d=h.key,g=h.value;if(d.status==="aborted"||g.status==="aborted")return ht;(d.status==="dirty"||g.status==="dirty")&&n.dirty(),c.set(d.value,g.value)}return{status:n.value,value:c}}}}mN.create=(e,t,n)=>new mN({valueType:t,keyType:e,typeName:ft.ZodMap,...Rt(n)});class Sh extends Ht{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.set)return Be(r,{code:Ne.invalid_type,expected:Ye.set,received:r.parsedType}),ht;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Be(r,{code:Ne.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Be(r,{code:Ne.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function l(h){const d=new Set;for(const g of h){if(g.status==="aborted")return ht;g.status==="dirty"&&n.dirty(),d.add(g.value)}return{status:n.value,value:d}}const c=[...r.data.values()].map((h,d)=>o._parse(new Ma(r,h,r.path,d)));return r.common.async?Promise.all(c).then(h=>l(h)):l(c)}min(t,n){return new Sh({...this._def,minSize:{value:t,message:et.toString(n)}})}max(t,n){return new Sh({...this._def,maxSize:{value:t,message:et.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Sh.create=(e,t)=>new Sh({valueType:e,minSize:null,maxSize:null,typeName:ft.ZodSet,...Rt(t)});class pN extends Ht{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}pN.create=(e,t)=>new pN({getter:e,typeName:ft.ZodLazy,...Rt(t)});class gN extends Ht{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Be(n,{received:n.data,code:Ne.invalid_literal,expected:this._def.value}),ht}return{status:"valid",value:t.data}}get value(){return this._def.value}}gN.create=(e,t)=>new gN({value:e,typeName:ft.ZodLiteral,...Rt(t)});function $O(e,t){return new iu({values:e,typeName:ft.ZodEnum,...Rt(t)})}class iu extends Ht{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Be(n,{expected:Wt.joinValues(r),received:n.parsedType,code:Ne.invalid_type}),ht}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Be(n,{received:n.data,code:Ne.invalid_enum_value,options:r}),ht}return Qi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return iu.create(t,{...this._def,...n})}exclude(t,n=this._def){return iu.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}iu.create=$O;class vN extends Ht{_parse(t){const n=Wt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ye.string&&r.parsedType!==Ye.number){const i=Wt.objectValues(n);return Be(r,{expected:Wt.joinValues(i),received:r.parsedType,code:Ne.invalid_type}),ht}if(this._cache||(this._cache=new Set(Wt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Wt.objectValues(n);return Be(r,{received:r.data,code:Ne.invalid_enum_value,options:i}),ht}return Qi(t.data)}get enum(){return this._def.values}}vN.create=(e,t)=>new vN({values:e,typeName:ft.ZodNativeEnum,...Rt(t)});class Xp extends Ht{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ye.promise&&n.common.async===!1)return Be(n,{code:Ne.invalid_type,expected:Ye.promise,received:n.parsedType}),ht;const r=n.parsedType===Ye.promise?n.data:Promise.resolve(n.data);return Qi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Xp.create=(e,t)=>new Xp({type:e,typeName:ft.ZodPromise,...Rt(t)});class su extends Ht{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ft.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:l=>{Be(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const l=i.transform(r.data,o);if(r.common.async)return Promise.resolve(l).then(async c=>{if(n.value==="aborted")return ht;const h=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return h.status==="aborted"?ht:h.status==="dirty"||n.value==="dirty"?$d(h.value):h});{if(n.value==="aborted")return ht;const c=this._def.schema._parseSync({data:l,path:r.path,parent:r});return c.status==="aborted"?ht:c.status==="dirty"||n.value==="dirty"?$d(c.value):c}}if(i.type==="refinement"){const l=c=>{const h=i.refinement(c,o);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?ht:(c.status==="dirty"&&n.dirty(),l(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?ht:(c.status==="dirty"&&n.dirty(),l(c.value).then(()=>({status:n.value,value:c.value}))))}if(i.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ru(l))return ht;const c=i.transform(l.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>ru(l)?Promise.resolve(i.transform(l.value,o)).then(c=>({status:n.value,value:c})):ht);Wt.assertNever(i)}}su.create=(e,t,n)=>new su({schema:e,typeName:ft.ZodEffects,effect:t,...Rt(n)});su.createWithPreprocess=(e,t,n)=>new su({schema:t,effect:{type:"preprocess",transform:e},typeName:ft.ZodEffects,...Rt(n)});class Ra extends Ht{_parse(t){return this._getType(t)===Ye.undefined?Qi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ra.create=(e,t)=>new Ra({innerType:e,typeName:ft.ZodOptional,...Rt(t)});class ou extends Ht{_parse(t){return this._getType(t)===Ye.null?Qi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ou.create=(e,t)=>new ou({innerType:e,typeName:ft.ZodNullable,...Rt(t)});class d0 extends Ht{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}d0.create=(e,t)=>new d0({innerType:e,typeName:ft.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Rt(t)});class h0 extends Ht{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return qp(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Mo(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Mo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}h0.create=(e,t)=>new h0({innerType:e,typeName:ft.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Rt(t)});class bN extends Ht{_parse(t){if(this._getType(t)!==Ye.nan){const r=this._getOrReturnCtx(t);return Be(r,{code:Ne.invalid_type,expected:Ye.nan,received:r.parsedType}),ht}return{status:"valid",value:t.data}}}bN.create=e=>new bN({typeName:ft.ZodNaN,...Rt(e)});class Jse extends Ht{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class a1 extends Ht{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ht:o.status==="dirty"?(n.dirty(),$d(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ht:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new a1({in:t,out:n,typeName:ft.ZodPipeline})}}class f0 extends Ht{_parse(t){const n=this._def.innerType._parse(t),r=i=>(ru(i)&&(i.value=Object.freeze(i.value)),i);return qp(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}f0.create=(e,t)=>new f0({innerType:e,typeName:ft.ZodReadonly,...Rt(t)});var ft;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ft||(ft={}));const xl=Ca.create,UO=c0.create;ja.create;const VO=Bs.create,l1=Qn.create;Gp.create;Yp.create;Dl.create;const eoe=iu.create;Xp.create;Ra.create;ou.create;const toe=/^\d{4}-\d{2}-\d{2}$/,noe=l1({title:xl().min(1),items:VO(xl().min(1)).min(1)}),roe=l1({version:xl().min(1),publishedAt:xl().regex(toe,"Expected YYYY-MM-DD"),title:xl().min(1),sections:VO(noe).min(1),prerelease:UO().optional()});l1({changeType:eoe(["feature","improvement","fix","internal","docs"]),title:xl().min(1),summary:xl().min(1),public:UO()});const ioe=[{version:"0.6.1",publishedAt:"2026-03-30",title:"Background notifications and SEO updates",sections:[{title:"Improvements",items:["Background chat notifications: Kaizen can now alert you with browser notifications, sound, and vibration when background chats need input or finish responding.","SEO enhancements: Updated site metadata, robots.txt rules, and sitemap priorities to improve search engine discoverability."]},{title:"Under the Hood",items:["Added a root `tailscale:reset` script to reset local Tailscale serve configuration during setup and support workflows."]}]},{version:"0.6.0",publishedAt:"2026-03-29",title:"Remote handoff setup and QR launches",sections:[{title:"New Features",items:["Add remote handoff flow for Kaizen: Kaizen can now guide remote Tailscale setup and generate handoff links and QR codes for opening sessions on another device."]}]},{version:"0.5.0",publishedAt:"2026-03-29",title:"Bundled release history and stronger session recovery",sections:[{title:"New Features",items:["Bundled release history and stronger session recovery: Kaizen now ships in-app and web release notes while recovering chat usage and session state more reliably after reloads."]}]},{version:"0.4.0",publishedAt:"2026-03-29",title:"Branding refresh and packaged runtime updates",sections:[{title:"Highlights",items:["Refreshed the Kaizen branding and theme system across the product surface.","Published the built Kaizen runtime and added the web start command needed for the packaged flow.","Renamed the `keizen` app paths to `kaizen`, fixed review follow-ups, and aligned web builds on Node 20."]}]},{version:"0.3.0",publishedAt:"2026-03-29",title:"Feature overview workflow and release workflow baseline",sections:[{title:"Highlights",items:["Added the feature overview workflow and plan attachment support for structured project work.","Added the pull-request skill and the first pass of the npm publish and release workflow guidance."]}]},{version:"0.2.2",publishedAt:"2026-03-28",title:"UI and restart regression fixes",sections:[{title:"Highlights",items:["Fixed Kaizen UI regressions and restart issues that were blocking a stable local runtime."]}]}];function _N(e){return new Date(`${e}T00:00:00.000Z`).getTime()}function soe(e,t="en-US"){return new Intl.DateTimeFormat(t,{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${e}T00:00:00.000Z`))}function ooe(e){return[...e].sort((t,n)=>{const r=_N(n.publishedAt)-_N(t.publishedAt);return r!==0?r:n.version.localeCompare(t.version,void 0,{numeric:!0,sensitivity:"base"})})}const aoe=Object.freeze(ooe(ioe.map(e=>roe.parse(e))));function loe({entries:e}){return e.length===0?f.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-card/30 px-6 py-10 text-sm text-muted-foreground",children:"No release notes have been published yet."}):f.jsx("div",{className:"space-y-4",children:e.map(t=>f.jsxs("article",{className:"rounded-2xl border border-border bg-card/60 p-5",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("h3",{className:"text-base font-semibold text-foreground",children:t.title}),f.jsxs("span",{className:"rounded-full border border-border bg-muted/60 px-2.5 py-1 text-xs font-medium text-muted-foreground",children:["v",t.version]}),t.prerelease?f.jsx("span",{className:"rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-xs font-medium text-amber-600 dark:text-amber-300",children:"Prerelease"}):null]}),f.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Published ",soe(t.publishedAt)]}),f.jsx("div",{className:"mt-4 space-y-4 text-sm text-foreground",children:t.sections.map(n=>f.jsxs("section",{className:"space-y-2",children:[f.jsx("h4",{className:"text-sm font-semibold text-foreground",children:n.title}),f.jsx("ul",{className:"list-disc space-y-2 pl-5 text-muted-foreground",children:n.items.map(r=>f.jsx("li",{children:r},r))})]},n.title))})]},`${t.version}-${t.publishedAt}`))})}const Ud=[{id:"general",label:"General",icon:O9,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"changelog",label:"Release Notes",icon:W5,subtitle:"Review shipped changes included in the npm release history."},{id:"providers",label:"Providers",icon:m9,subtitle:"Manage the default chat provider and saved model defaults for Claude, Codex, Gemini, and Cursor."},{id:"keybindings",label:"Keybindings",icon:E8,subtitle:"Edit global app shortcuts stored in the active keybindings file."}];function yN(e){return e&&Ud.some(t=>t.id===e)?e:null}const coe=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],xN=Object.keys(tD);function uoe(e){return`Edit global app shortcuts stored in ${e}.`}function doe(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 Um(e,t){const n=cn(t),r=(e==null?void 0:e.settings[t])??lr[t];return n.systemActive?r.active?"Active.":"Inactive.":"Inactive by server policy."}function hoe(e){return e&&typeof e=="object"&&"idx"in e&&typeof e.idx=="number"&&e.idx>0?"back":"home"}function wN({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:i=!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 ${i?"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 foe(){var ql,Ks;const e=Aa(),{sectionId:t}=HN(),n=eg(),{theme:r,setTheme:i}=p4(),o=yN(t)??"general",l=n.connectionStatus==="connecting"||!n.localProjectsReady,c=((ql=n.localProjects)==null?void 0:ql.machine.displayName)??"Unavailable",h=((Ks=n.localProjects)==null?void 0:Ks.projects.length)??0,d=U0.split("/")[1]??"unknown",g=Fi(V=>V.scrollbackLines),p=Fi(V=>V.minColumnWidth),b=Fi(V=>V.editorPreset),y=Fi(V=>V.editorCommandTemplate),w=Fi(V=>V.setScrollbackLines),S=Fi(V=>V.setMinColumnWidth),C=Fi(V=>V.setEditorPreset),k=Fi(V=>V.setEditorCommandTemplate),R=n.keybindings,E=n.providerSettings,N=Bi(V=>V.defaultProvider),L=Bi(V=>V.providerDefaults),A=Bi(V=>V.showProviderIconsInSideTray),O=Bi(V=>V.setDefaultProvider),H=Bi(V=>V.setProviderDefaultModel),Z=Bi(V=>V.setProviderDefaultModelOptions),I=Bi(V=>V.setProviderDefaultPlanMode),q=Bi(V=>V.setShowProviderIconsInSideTray),F=yi(V=>V.folderGroupsEnabled),$=yi(V=>V.showFeatureOverviewInSidebar),W=yi(V=>V.kanbanStatusesEnabled),K=yi(V=>V.commitProjectMetadataDirectory),D=yi(V=>V.setFolderGroupsEnabled),U=yi(V=>V.setShowFeatureOverviewInSidebar),z=yi(V=>V.setKanbanStatusesEnabled),G=yi(V=>V.setCommitProjectMetadataDirectory),M=yn(V=>V.themeId),B=yn(V=>V.customAppearance),X=yn(V=>V.backgroundImage),j=yn(V=>V.backgroundOpacity),ie=yn(V=>V.backgroundBlur),J=yn(V=>V.showProjectIconsInSidebar),ee=yn(V=>V.availableThemes),re=yn(V=>V.setThemeId),ue=yn(V=>V.setCustomAppearance),fe=yn(V=>V.setBackgroundImage),ge=yn(V=>V.setBackgroundOpacity),Ce=yn(V=>V.setBackgroundBlur),Re=yn(V=>V.setShowProjectIconsInSidebar),je=ss(V=>V.browserNotificationsEnabled),Qe=ss(V=>V.soundEnabled),yt=ss(V=>V.vibrationEnabled),Tt=ss(V=>V.lastPermissionState),me=ss(V=>V.setBrowserNotificationsEnabled),Ue=ss(V=>V.setSoundEnabled),Oe=ss(V=>V.setVibrationEnabled),mt=ss(V=>V.setLastPermissionState),pt=v.useMemo(()=>_w(R),[R]),ot=pt.filePathDisplay||eH(),[dn,Nt]=v.useState(String(g)),[In,de]=v.useState(String(p)),[oe,xe]=v.useState(y),[ke,Ke]=v.useState(X??""),[ct,Je]=v.useState(String(j)),[Ae,$e]=v.useState(String(ie)),[lt,Fe]=v.useState({}),[hn,qt]=v.useState(null),[bn,dr]=v.useState(null),[er,Kt]=v.useState(null),[Ft,Pe]=v.useState(null),vt=v.useMemo(()=>W0((E==null?void 0:E.settings)??lr),[E==null?void 0:E.settings]),kt=N==="last_used"||vt.some(V=>V.id===N)?N:"last_used",[Et,fn]=v.useState([]),ze=n.updateSnapshot,rt=n.themeSettings,xn=tN(Tt),Te=Eu(),Le=yse(xn),Ot=xn!=="unsupported",ut=xn==="granted",mn=typeof navigator<"u"&&typeof navigator.vibrate=="function",Qt=doe(ze),rn=(ze==null?void 0:ze.status)==="checking"?"Checking for updates…":(ze==null?void 0:ze.status)==="updating"?"Installing update…":(ze==null?void 0:ze.status)==="restart_pending"?`Restarting ${Tn}…`:(ze==null?void 0:ze.status)==="available"?`Update available${ze.latestVersion?`: ${ze.latestVersion}`:""}`:(ze==null?void 0:ze.status)==="up_to_date"?"Up to date":(ze==null?void 0:ze.status)==="error"?"Update check failed":"Not checked yet";v.useEffect(()=>{fetch("/api/backgrounds").then(V=>V.json()).then(V=>fn(V)).catch(V=>console.error("Failed to load system backgrounds",V))},[]),v.useEffect(()=>{Nt(String(g))},[g]),v.useEffect(()=>{de(String(p))},[p]),v.useEffect(()=>{xe(y)},[y]),v.useEffect(()=>{Ke(X??"")},[X]),v.useEffect(()=>{Je(String(j))},[j]),v.useEffect(()=>{$e(String(ie))},[ie]),v.useEffect(()=>{Fe(Object.fromEntries(xN.map(V=>[V,T_(pt.bindings[V])])))},[pt]),v.useEffect(()=>{t&&(yN(t)||e("/settings/general",{replace:!0}))},[e,t]);function Gt(){const V=Number(dn);if(!Number.isFinite(V)){Nt(String(g));return}w(V)}function $t(){const V=Number(In);if(!Number.isFinite(V)){de(String(p));return}S(V)}function Ar(){const V=ke.trim()===""?null:ke.trim(),nt=wN({themePreference:r,nextBackgroundImage:V,backgroundOpacity:j});fe(V),nt.backgroundOpacity!==void 0&&ge(nt.backgroundOpacity),nt.backgroundBlur!==void 0&&Ce(nt.backgroundBlur),hr({backgroundImage:V,...nt})}function ms(){const V=Number(ct);if(!Number.isFinite(V)||V<0||V>1){Je(String(j));return}ge(V),hr({backgroundOpacity:V})}function Hl(){const V=Number(Ae);if(!Number.isFinite(V)||V<0){$e(String(ie));return}Ce(V),hr({backgroundBlur:V})}function Po(V,nt){V.key==="Enter"&&(nt(),V.currentTarget.blur())}function Io(V,nt){V.key==="Enter"&&(nt(),V.currentTarget.blur())}function ps(){k(oe)}async function Bo(V=lt){try{qt(null),await n.socket.command({type:"settings.writeKeybindings",bindings:SN(V)})}catch(nt){qt(nt instanceof Error?nt.message:"Unable to save keybindings.")}}async function hr(V){try{await n.socket.command({type:"settings.writeThemeSettings",settings:{themePreference:(V==null?void 0:V.themePreference)??r,themeId:(V==null?void 0:V.themeId)??M,customAppearance:(V==null?void 0:V.customAppearance)??B,backgroundImage:(V==null?void 0:V.backgroundImage)!==void 0?V.backgroundImage:X,backgroundOpacity:(V==null?void 0:V.backgroundOpacity)??j,backgroundBlur:(V==null?void 0:V.backgroundBlur)??ie,showProjectIconsInSidebar:(V==null?void 0:V.showProjectIconsInSidebar)??J}})}catch(nt){console.error("Failed to save theme settings:",nt)}}async function Ei(V,nt){Kt(V);try{await nt()}finally{Kt(Jt=>Jt===V?null:Jt)}}async function qs(){Pe("requesting");try{const V=await nN();mt(V),me(V==="granted")}finally{Pe(V=>V==="requesting"?null:V)}}async function gs(){Pe("testing");try{let V=tN(Tt);je&&V==="default"&&Ot&&(V=await nN(),mt(V),V!=="granted"&&me(!1)),await BO({event:{chatId:n.activeChatId??"settings-test",chatTitle:"Test notification",kind:"needs_input",projectTitle:"Settings"},onBrowserNotificationClick:()=>{e("/settings/general")},preferences:{browserNotificationsEnabled:je&&V==="granted",soundEnabled:Qe,vibrationEnabled:yt}})}finally{Pe(V=>V==="testing"?null:V)}}async function wn(V){try{dr(null),await n.socket.command({type:"settings.writeProviderSettings",settings:V})}catch(nt){dr(nt instanceof Error?nt.message:"Unable to save provider settings.")}}async function $l(V){const nt={...lt,[V]:T_(Rs[V])};Fe(nt);try{qt(null),await n.socket.command({type:"settings.writeKeybindings",bindings:SN(nt)})}catch(Jt){qt(Jt instanceof Error?Jt.message:"Unable to save keybindings.")}}const Ul=oe.replaceAll("{path}","/Users/jake/Projects/kaizen/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),Ri=Ud.find(V=>V.id===o)??Ud[0],vs=o==="keybindings"?uoe(ot):Ri.subtitle,Vl=!l,Wl=o==="keybindings"?f.jsxs(Dc,{onClick:()=>{n.handleOpenExternalPath("open_editor",ot)},icon:f.jsx(Ry,{className:"h-4 w-4"}),children:["Open in ",n.editorLabel]}):o==="general"?f.jsx(Dc,{variant:Qt.variant,onClick:()=>{if(Qt.kind==="update"){n.handleInstallUpdate();return}n.handleCheckForUpdates({force:!0})},disabled:Qt.disabled,icon:Qt.kind==="check"?f.jsx(dp,{className:pe("size-3.5",Qt.spinning&&"animate-spin")}):Qt.kind==="update"?f.jsx(W5,{className:pe("size-3.5")}):void 0,children:Qt.label}):null;function Ba(){if(hoe(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 ${Vl?"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"}),Ud.map(V=>f.jsx("button",{type:"button",onClick:()=>e(`/settings/${V.id}`),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${V.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(V.icon,{className:"h-4 w-4 shrink-0"}),f.jsx("span",{children:V.label})]})},V.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:Ud.map(V=>f.jsxs("button",{type:"button",onClick:()=>e(`/settings/${V.id}`),className:`flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm transition-colors ${V.id===o?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:[f.jsx(V.icon,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{children:V.label})]},V.id))}),f.jsx("button",{type:"button","aria-label":"Close settings",onClick:Ba,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(ko,{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(wr,{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:Ri.label}),f.jsxs("div",{className:"flex items-center gap-2",children:[Wl,f.jsx(Dc,{"aria-label":"Close settings",title:"Close settings",onClick:Ba,icon:f.jsx(ko,{className:"h-4 w-4"}),className:"hidden md:flex"})]})]}),f.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:vs})]}),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:[rn,"."]}),ze!=null&&ze.lastCheckedAt?f.jsxs("span",{children:[" ","Last checked"," ",new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(ze.lastCheckedAt),"."]}):null,ze!=null&&ze.error?f.jsxs("span",{children:[" ",ze.error]}):null]}),bordered:!1,children:f.jsxs("div",{className:"text-right text-sm text-foreground",children:[f.jsxs("div",{children:["Current:"," ",(ze==null?void 0:ze.currentVersion)??d]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latest: ",(ze==null?void 0:ze.latestVersion)??"Unknown"]})]})}),f.jsx(gn,{title:"Theme",description:"Choose between light, dark, system, or custom appearance",children:f.jsxs(Yn,{value:r,onValueChange:V=>{i(V),hr({themePreference:V})},children:[f.jsx($n,{className:"w-[150px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"light",children:"Light"}),f.jsx(St,{value:"dark",children:"Dark"}),f.jsx(St,{value:"system",children:"System"}),f.jsx(St,{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(Yn,{value:B,onValueChange:V=>{ue(V),hr({customAppearance:V})},children:[f.jsx($n,{className:"w-[150px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"light",children:"Light"}),f.jsx(St,{value:"dark",children:"Dark"}),f.jsx(St,{value:"system",children:"System"})]})]})}),f.jsx(gn,{title:"Color Theme",description:`Choose a color palette for the interface. Custom JSON themes live in ${(rt==null?void 0:rt.themesDirectoryDisplay)??"~/.kaizen/themes"}. Read ${(rt==null?void 0:rt.themesReadmeFileDisplay)??"~/.kaizen/themes/THEME_README.md"} for authoring guidance.`,alignStart:!0,bordered:!1,children:f.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(Yn,{value:M,onValueChange:V=>{re(V),hr({themeId:V})},children:[f.jsx($n,{className:"min-w-[180px]",children:f.jsx(ar,{})}),f.jsx(Un,{children:f.jsx(C_,{children:ee.map(V=>f.jsx(St,{value:V.id,children:V.label},V.id))})})]}),f.jsx(Dc,{variant:"outline","aria-label":"Refresh themes",title:"Refresh themes",className:"px-2.5",disabled:er!==null,onClick:()=>{Ei("refresh",()=>n.handleRefreshThemeSettings())},icon:er==="refresh"?f.jsx(wr,{className:"size-3.5 animate-spin"}):f.jsx(dp,{className:"size-3.5"})})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs(Dc,{disabled:er!==null,onClick:()=>{Ei("open_editor",()=>n.handleOpenCustomThemes())},icon:er==="open_editor"?f.jsx(wr,{className:"size-3.5 animate-spin"}):f.jsx(y9,{className:"size-3.5"}),children:["Open in ",n.editorLabel]}),f.jsx(Dc,{variant:"outline",disabled:er!==null,onClick:()=>{Ei("open_folder",()=>n.handleOpenExternalPath("open_finder",(rt==null?void 0:rt.themesDirectoryDisplay)??"~/.kaizen/themes"))},icon:er==="open_folder"?f.jsx(wr,{className:"size-3.5 animate-spin"}):f.jsx(Ry,{className:"size-3.5"}),children:"Open folder"})]}),rt!=null&&rt.customThemeWarnings.length?f.jsx("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:rt.customThemeWarnings.join(" ")}):null]})}),f.jsx(gn,{title:"Background Image",description:"Choose a background or enter a custom URL",alignStart:!0,bordered:!1,children:(()=>{const V=Et.find(en=>en.url===ke),nt=!ke,Jt=!!ke&&!V,Gs=nt?"__none__":Jt?"__custom__":ke,Fa=nt?"None":Jt?"Custom URL":(V==null?void 0:V.name)??"Unknown";return f.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[f.jsxs(Yn,{value:Gs,onValueChange:en=>{if(en==="__none__")Ke(""),fe(null),hr({backgroundImage:null});else{const tr=wN({themePreference:r,nextBackgroundImage:en,backgroundOpacity:j});Ke(en),fe(en),tr.backgroundOpacity!==void 0&&ge(tr.backgroundOpacity),tr.backgroundBlur!==void 0&&Ce(tr.backgroundBlur),hr({backgroundImage:en,...tr})}},children:[f.jsx($n,{className:"w-full",children:f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[nt?null:f.jsx("img",{src:ke,alt:"",className:"h-5 w-9 shrink-0 rounded object-cover"}),f.jsx("span",{className:"truncate",children:Fa})]})}),f.jsxs(Un,{children:[f.jsx(Xm,{value:"__none__",children:"None"}),Et.map(en=>f.jsx(Xm,{value:en.url,thumbnail:en.url,thumbnailAlt:en.name,children:en.name},en.id)),Jt?f.jsx(Xm,{value:"__custom__",thumbnail:ke,thumbnailAlt:"Custom",children:"Custom URL"}):null]})]}),f.jsx(Hi,{type:"text",placeholder:"Or enter a custom URL...",value:ke,onChange:en=>Ke(en.target.value),onBlur:Ar,onKeyDown:en=>Io(en,Ar),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(Hi,{type:"number",min:0,max:1,step:.05,value:ct,onChange:V=>Je(V.target.value),onBlur:ms,onKeyDown:V=>Po(V,ms),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(Hi,{type:"number",min:0,max:50,step:1,value:Ae,onChange:V=>$e(V.target.value),onBlur:Hl,onKeyDown:V=>Po(V,Hl),className:"hide-number-steppers w-28 text-right font-mono"})})})]}):null,Te?f.jsxs(f.Fragment,{children:[f.jsx(gn,{title:"Browser Notifications",description:"Show desktop or PWA notifications when a background chat needs input or completes.",children:f.jsxs(Yn,{value:je?"enabled":"disabled",onValueChange:V=>{me(V==="enabled")},disabled:!ut,children:[f.jsx($n,{className:"w-[100px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"disabled",children:"Off"}),f.jsx(St,{value:"enabled",children:"On"})]})]})}),je?f.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[f.jsx(gn,{title:"Permission",description:"Permission is only requested when you explicitly enable notifications from here.",bordered:!1,alignStart:!0,children:f.jsxs("div",{className:"flex w-full flex-col items-end gap-2 text-right sm:w-auto",children:[f.jsxs("div",{className:"flex items-center justify-end gap-2 text-sm text-foreground",children:[f.jsx(i8,{className:"size-4 text-muted-foreground"}),f.jsx("span",{children:Le})]}),f.jsx("div",{className:"flex w-full flex-wrap justify-end gap-2 sm:w-auto",children:f.jsxs(Xe,{type:"button",variant:"outline",disabled:!Ot||Ft!==null,onClick:()=>{qs()},children:[Ft==="requesting"?f.jsx(wr,{className:"mr-2 size-4 animate-spin"}):null,"Enable notifications"]})})]})}),f.jsx(gn,{title:"Notification Sound",description:"Play a local alert cue for background chat notifications.",bordered:!1,children:f.jsxs(Yn,{value:Qe?"enabled":"disabled",onValueChange:V=>{Ue(V==="enabled")},children:[f.jsx($n,{className:"ml-auto w-[100px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"disabled",children:"Off"}),f.jsx(St,{value:"enabled",children:"On"})]})]})}),mn?f.jsx(gn,{title:"Vibration",description:"Use device vibration when supported by the browser.",bordered:!1,children:f.jsxs(Yn,{value:yt?"enabled":"disabled",onValueChange:V=>{Oe(V==="enabled")},children:[f.jsx($n,{className:"ml-auto w-[100px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"disabled",children:"Off"}),f.jsx(St,{value:"enabled",children:"On"})]})]})}):null,f.jsx(gn,{title:"Test Notification",description:"Send a local test notification using your current notification settings.",bordered:!1,children:f.jsx("div",{className:"flex flex-wrap justify-end gap-2",children:f.jsxs(Xe,{type:"button",variant:"outline",disabled:Ft!==null,onClick:()=>{gs()},children:[Ft==="testing"?f.jsx(wr,{className:"mr-2 size-4 animate-spin"}):null,"Test notification"]})})})]}):null]}):null,f.jsx(gn,{title:"Project Icons",description:"Show detected project icons in the sidebar and open-project list.",children:f.jsxs(Yn,{value:J?"enabled":"disabled",onValueChange:V=>{const nt=V==="enabled";Re(nt),hr({showProjectIconsInSidebar:nt})},children:[f.jsx($n,{className:"w-[100px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"disabled",children:"Off"}),f.jsx(St,{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(Yn,{value:F?"enabled":"disabled",onValueChange:V=>D(V==="enabled"),children:[f.jsx($n,{className:"w-[100px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"disabled",children:"Off"}),f.jsx(St,{value:"enabled",children:"On"})]})]})}),F?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(Yn,{value:$?"enabled":"disabled",onValueChange:V=>U(V==="enabled"),children:[f.jsx($n,{className:"w-[100px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"disabled",children:"Off"}),f.jsx(St,{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(Yn,{value:W?"enabled":"disabled",onValueChange:V=>z(V==="enabled"),children:[f.jsx($n,{className:"w-[100px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"disabled",children:"Off"}),f.jsx(St,{value:"enabled",children:"On"})]})]})}),f.jsx(gn,{title:`${v_} In Git`,description:`Control whether ${Tn} keeps the project ${v_} 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 \`${v_}\`.`,bordered:!1,children:f.jsxs(Yn,{value:K?"commit":"ignore",onValueChange:V=>{const nt=V==="commit";G(nt),n.handleSetCommitProjectMetadataDirectory(nt)},children:[f.jsx($n,{className:"w-[120px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"commit",children:"Commit"}),f.jsx(St,{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(Yn,{value:A?"enabled":"disabled",onValueChange:V=>q(V==="enabled"),children:[f.jsx($n,{className:"w-[100px]",children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"disabled",children:"Off"}),f.jsx(St,{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(Yn,{value:b,onValueChange:V=>C(V),children:[f.jsx($n,{className:"min-w-[180px]",children:f.jsx(ar,{})}),f.jsx(Un,{children:f.jsx(C_,{children:coe.map(V=>f.jsx(St,{value:V.value,children:V.label},V.value))})})]})}),b==="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(Hi,{type:"text",value:oe,onChange:V=>xe(V.target.value),onBlur:ps,onKeyDown:V=>Io(V,ps),className:"font-mono"}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview:"," ",f.jsx("span",{className:"font-mono",children:Ul})]})]})]})}):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(Hi,{type:"number",min:Vx,max:Wx,step:100,value:dn,onChange:V=>Nt(V.target.value),onBlur:Gt,onKeyDown:V=>Po(V,Gt),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:[Vx,"-",Wx," ","lines",g===Bp?" (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(Hi,{type:"number",min:qx,max:Kx,step:10,value:In,onChange:V=>de(V.target.value),onBlur:$t,onKeyDown:V=>Po(V,$t),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:[qx,"-",Kx," px",p===Fp?" (default)":""]})]})})]})}):o==="changelog"?f.jsx(loe,{entries:aoe}):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(Yn,{value:kt,onValueChange:V=>O(V),children:[f.jsx($n,{className:"min-w-[180px]",children:f.jsx(ar,{})}),f.jsx(Un,{children:f.jsxs(C_,{children:[f.jsx(St,{value:"last_used",children:"Last Used"}),vt.map(V=>f.jsx(St,{value:V.id,children:V.label},V.id))]})})]})}),bn?f.jsx("div",{className:"border-t border-border px-0 py-3 text-sm text-destructive",children:bn}):null,f.jsx(gn,{title:"Claude Code Defaults",description:`Saved defaults when using Claude Code. ${Um(E,"claude")}`,alignStart:!0,children:f.jsxs("div",{className:pe("max-w-[420px]",!cn("claude").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(Yn,{value:((E==null?void 0:E.settings.claude)??lr.claude).active?"active":"inactive",onValueChange:V=>{wn({...(E==null?void 0:E.settings)??lr,claude:{...(E==null?void 0:E.settings.claude)??lr.claude,active:V==="active"}})},children:[f.jsx($n,{className:"min-w-[140px]",disabled:!cn("claude").systemActive,children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"active",children:"Active"}),f.jsx(St,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Ad,{availableProviders:wa,selectedProvider:"claude",disabled:!cn("claude").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.claude.model,modelOptions:L.claude.modelOptions,onModelChange:(V,nt)=>{H("claude",nt)},onClaudeReasoningEffortChange:V=>{Z("claude",{reasoningEffort:V})},onClaudeContextWindowChange:V=>{Z("claude",{contextWindow:V})},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:L.claude.planMode,onPlanModeChange:V=>I("claude",V),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),f.jsx(gn,{title:"Codex Defaults",description:`Saved defaults when using Codex. ${Um(E,"codex")}`,alignStart:!0,children:f.jsxs("div",{className:pe("max-w-[420px]",!cn("codex").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(Yn,{value:((E==null?void 0:E.settings.codex)??lr.codex).active?"active":"inactive",onValueChange:V=>{wn({...(E==null?void 0:E.settings)??lr,codex:{...(E==null?void 0:E.settings.codex)??lr.codex,active:V==="active"}})},children:[f.jsx($n,{className:"min-w-[140px]",disabled:!cn("codex").systemActive,children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"active",children:"Active"}),f.jsx(St,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Ad,{availableProviders:wa,selectedProvider:"codex",disabled:!cn("codex").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.codex.model,modelOptions:L.codex.modelOptions,onModelChange:(V,nt)=>{H("codex",nt)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:V=>{Z("codex",{reasoningEffort:V})},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:V=>{Z("codex",{fastMode:V})},planMode:L.codex.planMode,onPlanModeChange:V=>I("codex",V),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),f.jsx(gn,{title:"Gemini Defaults",description:`Saved defaults when using Gemini. ${Um(E,"gemini")}`,alignStart:!0,children:f.jsxs("div",{className:pe("max-w-[420px]",!cn("gemini").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(Yn,{value:((E==null?void 0:E.settings.gemini)??lr.gemini).active?"active":"inactive",onValueChange:V=>{wn({...(E==null?void 0:E.settings)??lr,gemini:{...(E==null?void 0:E.settings.gemini)??lr.gemini,active:V==="active"}})},children:[f.jsx($n,{className:"min-w-[140px]",disabled:!cn("gemini").systemActive,children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"active",children:"Active"}),f.jsx(St,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Ad,{availableProviders:wa,selectedProvider:"gemini",disabled:!cn("gemini").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.gemini.model,modelOptions:L.gemini.modelOptions,onModelChange:(V,nt)=>{H("gemini",nt)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:V=>{Z("gemini",{thinkingMode:V})},onCodexFastModeChange:()=>{},planMode:L.gemini.planMode,onPlanModeChange:V=>I("gemini",V),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),f.jsx(gn,{title:"Cursor Defaults",description:`Saved defaults when using Cursor. ${Um(E,"cursor")}`,alignStart:!0,children:f.jsxs("div",{className:pe("max-w-[420px]",!cn("cursor").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(Yn,{value:((E==null?void 0:E.settings.cursor)??lr.cursor).active?"active":"inactive",onValueChange:V=>{wn({...(E==null?void 0:E.settings)??lr,cursor:{...(E==null?void 0:E.settings.cursor)??lr.cursor,active:V==="active"}})},children:[f.jsx($n,{className:"min-w-[140px]",disabled:!cn("cursor").systemActive,children:f.jsx(ar,{})}),f.jsxs(Un,{children:[f.jsx(St,{value:"active",children:"Active"}),f.jsx(St,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Ad,{availableProviders:wa,selectedProvider:"cursor",disabled:!cn("cursor").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.cursor.model,modelOptions:L.cursor.modelOptions,onModelChange:(V,nt)=>{H("cursor",nt)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:L.cursor.planMode,onPlanModeChange:V=>I("cursor",V),includePlanMode:!0,className:"justify-start flex-wrap"})]})})]}):o==="keybindings"?f.jsxs("div",{className:"border-b border-border",children:[hn?f.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:hn}):null,pt.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:pt.warning}):null,xN.map((V,nt)=>{const Jt=T_(Rs[V]),Gs=lt[V]??"",Fa=Gs!==Jt;return f.jsx(gn,{title:tD[V],description:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"Comma-separated shortcuts."}),Fa?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:" "}),f.jsxs("button",{type:"button",onClick:()=>{$l(V)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",Jt]})]}):null]}),bordered:nt!==0,children:f.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:f.jsx(Hi,{type:"text",value:Gs,onChange:en=>{const tr=en.target.value;Fe(Ys=>({...Ys,[V]:tr}))},onBlur:en=>{const tr={...lt,[V]:en.currentTarget.value};Fe(tr),Bo(tr)},onKeyDown:en=>Io(en,()=>{const tr={...lt,[V]:en.currentTarget.value};Fe(tr),Bo(tr)}),className:"font-mono"})})},V)})]}):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(e9,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),f.jsx("span",{children:n.commandError})]}):null]})]})]}),Vl?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:c})]})}),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 SN(e){return{submitChatMessage:sl(e.submitChatMessage??""),toggleProjectsSidebar:sl(e.toggleProjectsSidebar??""),toggleEmbeddedTerminal:sl(e.toggleEmbeddedTerminal??""),toggleRightSidebar:sl(e.toggleRightSidebar??""),openInFinder:sl(e.openInFinder??""),openInEditor:sl(e.openInEditor??""),addSplitTerminal:sl(e.addSplitTerminal??"")}}function moe({activeChatId:e,connectionStatus:t,sidebarData:n}){const r=Aa(),i=ss(d=>d.browserNotificationsEnabled),o=ss(d=>d.soundEnabled),l=ss(d=>d.vibrationEnabled),c=v.useRef(eN()),h=v.useRef(typeof document>"u"?!0:document.visibilityState==="visible");return v.useEffect(()=>{function d(){h.current=document.visibilityState==="visible"}return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[]),v.useEffect(()=>{t!=="connected"&&(c.current={...eN(),dedupeByChatId:c.current.dedupeByChatId})},[t]),v.useEffect(()=>{if(!Eu())return;const{events:d,nextState:g}=Sse({activeChatId:e,documentVisible:h.current,previousState:c.current,sidebarData:n});c.current=g;for(const p of d)BO({event:p,onBrowserNotificationClick:()=>{r(`/chat/${p.chatId}`)},preferences:{browserNotificationsEnabled:i,soundEnabled:o,vibrationEnabled:l}})},[e,i,r,n,o,l]),null}function poe(){const e=typeof navigator<"u"&&navigator.standalone===!0,t=typeof window<"u"&&window.matchMedia("(display-mode: standalone)").matches;return e||t}function goe(){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 voe(){v.useLayoutEffect(()=>{let e=0,t=null,n=0;const r=poe(),i=()=>{e=0;const{height:c,offsetTop:h}=goe();t===null&&(t=h),c>n&&(n=c);const d=Math.max(0,h-t),g=n-c>120||d>12,p=document.documentElement;p.style.setProperty("--app-shell-height",`${c}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(i)};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 boe=`${xg}last-seen-version`;function _oe(e,t){return!(!t||e.defaultPrevented||e.isComposing||aq(e.target))}function yoe(){const e=oi(),t=HN(),n=TZ({activeChatId:t.chatId??null,activeOverviewFeatureId:t.featureId??null}),r=Fh("(min-width: 768px)"),i=ME(d=>d.widthPx),o=ME(d=>d.setWidth),l=e.pathname==="/",c=U0.split("/")[1]??"unknown",h=v.useMemo(()=>_w(n.keybindings),[n.keybindings]);return voe(),v.useEffect(()=>{window.localStorage.setItem(boe,c)},[c]),v.useEffect(()=>{function d(g){const p=fl(h,"toggleProjectsSidebar",g);_oe(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(rq,{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:i,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(o7,{open:n.createFeatureModalProjectId!==null,onOpenChange:d=>{d||n.handleCloseCreateFeatureModal()},onConfirm:d=>n.handleConfirmCreateFeature(d)}),f.jsx(a7,{open:n.cursorCurlImportOpen,onOpenChange:d=>{d||n.handleCloseCursorCurlImport()},onSubmit:d=>n.handleSubmitCursorCurlImport(d)}),f.jsx(moe,{activeChatId:n.activeChatId,connectionStatus:n.connectionStatus,sidebarData:n.sidebarData}),f.jsx(sP,{context:n})]})}function xoe(){return f.jsx(UF,{children:f.jsxs(r7,{children:[f.jsxs(aP,{children:[f.jsx(bo,{path:"/open",element:f.jsx(lse,{})}),f.jsx(bo,{path:"/remote-setup",element:f.jsx(vse,{})}),f.jsxs(bo,{element:f.jsx(yoe,{}),children:[f.jsx(bo,{path:"/",element:f.jsx(tse,{})}),f.jsx(bo,{path:"/settings",element:f.jsx(iP,{to:"/settings/general",replace:!0})}),f.jsx(bo,{path:"/settings/:sectionId",element:f.jsx(foe,{})}),f.jsx(bo,{path:"/chat/:chatId",element:f.jsx(Uie,{})}),f.jsx(bo,{path:"/overview/:featureId",element:f.jsx(qie,{})})]})]}),f.jsx(pI,{})]})})}const WO=document.getElementById("root");if(!WO)throw new Error("Missing #root");az.createRoot(WO).render(f.jsx(v.StrictMode,{children:f.jsx(AP,{children:f.jsx(xX,{children:f.jsx(xoe,{})})})}));
|