var w5=Object.defineProperty;var b5=(e,t,n)=>t in e?w5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ls=(e,t,n)=>(b5(e,typeof t!="symbol"?t+"":t,n),n),Mh=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var V=(e,t,n)=>(Mh(e,t,"read from private field"),n?n.call(e):t.get(e)),ae=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ie=(e,t,n,r)=>(Mh(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var El=(e,t,n,r)=>({set _(i){ie(e,t,i,n)},get _(){return V(e,t,r)}}),ye=(e,t,n)=>(Mh(e,t,"access private method"),n);/*!
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 *                     _            _       _           _       
 *                    | |___  __   / \   __| |_ __ ___ (_)_ __  
 *                    | __\ \/ /  / _ \ / _` | '_ ` _ \| | '_ \ 
 *                    | |_ >  <  / ___ \ (_| | | | | | | | | | |
 *                     \__/_/\_\/_/   \_\__,_|_| |_| |_|_|_| |_|
 *                                                              
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * Author: André Tabarra (https://github.com/tabarra)
 * Repository: https://github.com/tabarra/txAdmin
 * This bundled file includes third party libraries under their respective licenses.
 * txAdmin is a free open source software provided under the license below.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * MIT License
 * 
 * Copyright (c) 2019-2023 André Tabarra <maintainer@txadmin.gg>
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 */function x5(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 a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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 Tu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P1={exports:{}},Du={},$1={exports:{}},ke={};/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var nl=Symbol.for("react.element"),S5=Symbol.for("react.portal"),C5=Symbol.for("react.fragment"),E5=Symbol.for("react.strict_mode"),k5=Symbol.for("react.profiler"),R5=Symbol.for("react.provider"),L5=Symbol.for("react.context"),M5=Symbol.for("react.forward_ref"),A5=Symbol.for("react.suspense"),T5=Symbol.for("react.memo"),D5=Symbol.for("react.lazy"),rv=Symbol.iterator;function P5(e){return e===null||typeof e!="object"?null:(e=rv&&e[rv]||e["@@iterator"],typeof e=="function"?e:null)}var O1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I1=Object.assign,N1={};function vo(e,t,n){this.props=e,this.context=t,this.refs=N1,this.updater=n||O1}vo.prototype.isReactComponent={};vo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};vo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function B1(){}B1.prototype=vo.prototype;function Tp(e,t,n){this.props=e,this.context=t,this.refs=N1,this.updater=n||O1}var Dp=Tp.prototype=new B1;Dp.constructor=Tp;I1(Dp,vo.prototype);Dp.isPureReactComponent=!0;var iv=Array.isArray,j1=Object.prototype.hasOwnProperty,Pp={current:null},F1={key:!0,ref:!0,__self:!0,__source:!0};function z1(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)j1.call(t,r)&&!F1.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:nl,type:e,key:o,ref:a,props:i,_owner:Pp.current}}function $5(e,t){return{$$typeof:nl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function $p(e){return typeof e=="object"&&e!==null&&e.$$typeof===nl}function O5(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var sv=/\/+/g;function Ah(e,t){return typeof e=="object"&&e!==null&&e.key!=null?O5(""+e.key):t.toString(36)}function uc(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case nl:case S5:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Ah(a,0):r,iv(i)?(n="",e!=null&&(n=e.replace(sv,"$&/")+"/"),uc(i,t,n,"",function(c){return c})):i!=null&&($p(i)&&(i=$5(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(sv,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",iv(e))for(var s=0;s<e.length;s++){o=e[s];var l=r+Ah(o,s);a+=uc(o,t,n,l,i)}else if(l=P5(e),typeof l=="function")for(e=l.call(e),s=0;!(o=e.next()).done;)o=o.value,l=r+Ah(o,s++),a+=uc(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function kl(e,t,n){if(e==null)return e;var r=[],i=0;return uc(e,r,"","",function(o){return t.call(n,o,i++)}),r}function I5(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Lt={current:null},hc={transition:null},N5={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:hc,ReactCurrentOwner:Pp};ke.Children={map:kl,forEach:function(e,t,n){kl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return kl(e,function(){t++}),t},toArray:function(e){return kl(e,function(t){return t})||[]},only:function(e){if(!$p(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ke.Component=vo;ke.Fragment=C5;ke.Profiler=k5;ke.PureComponent=Tp;ke.StrictMode=E5;ke.Suspense=A5;ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N5;ke.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=I1({},e.props),i=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=Pp.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)j1.call(t,l)&&!F1.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&s!==void 0?s[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var c=0;c<l;c++)s[c]=arguments[c+2];r.children=s}return{$$typeof:nl,type:e.type,key:i,ref:o,props:r,_owner:a}};ke.createContext=function(e){return e={$$typeof:L5,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:R5,_context:e},e.Consumer=e};ke.createElement=z1;ke.createFactory=function(e){var t=z1.bind(null,e);return t.type=e,t};ke.createRef=function(){return{current:null}};ke.forwardRef=function(e){return{$$typeof:M5,render:e}};ke.isValidElement=$p;ke.lazy=function(e){return{$$typeof:D5,_payload:{_status:-1,_result:e},_init:I5}};ke.memo=function(e,t){return{$$typeof:T5,type:e,compare:t===void 0?null:t}};ke.startTransition=function(e){var t=hc.transition;hc.transition={};try{e()}finally{hc.transition=t}};ke.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};ke.useCallback=function(e,t){return Lt.current.useCallback(e,t)};ke.useContext=function(e){return Lt.current.useContext(e)};ke.useDebugValue=function(){};ke.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};ke.useEffect=function(e,t){return Lt.current.useEffect(e,t)};ke.useId=function(){return Lt.current.useId()};ke.useImperativeHandle=function(e,t,n){return Lt.current.useImperativeHandle(e,t,n)};ke.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};ke.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};ke.useMemo=function(e,t){return Lt.current.useMemo(e,t)};ke.useReducer=function(e,t,n){return Lt.current.useReducer(e,t,n)};ke.useRef=function(e){return Lt.current.useRef(e)};ke.useState=function(e){return Lt.current.useState(e)};ke.useSyncExternalStore=function(e,t,n){return Lt.current.useSyncExternalStore(e,t,n)};ke.useTransition=function(){return Lt.current.useTransition()};ke.version="18.2.0";$1.exports=ke;var x=$1.exports;const ot=Tu(x),H1=x5({__proto__:null,default:ot},[x]);/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var B5=x,j5=Symbol.for("react.element"),F5=Symbol.for("react.fragment"),z5=Object.prototype.hasOwnProperty,H5=B5.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,U5={key:!0,ref:!0,__self:!0,__source:!0};function U1(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)z5.call(t,r)&&!U5.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:j5,type:e,key:o,ref:a,props:i,_owner:H5.current}}Du.Fragment=F5;Du.jsx=U1;Du.jsxs=U1;P1.exports=Du;var S=P1.exports;const W5=x.createContext(null),Th={didCatch:!1,error:null};class W1 extends x.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Th}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Th)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&V5(t.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Th)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=t;if(o){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")s=n(l);else if(r)s=x.createElement(r,l);else if(i===null||x.isValidElement(i))s=i;else throw a}return x.createElement(W5.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function V5(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}var $d={},V1={exports:{}},tn={},K1={exports:{}},q1={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(e){function t(j,T){var M=j.length;j.push(T);e:for(;0<M;){var B=M-1>>>1,z=j[B];if(0<i(z,T))j[B]=T,j[M]=z,M=B;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var T=j[0],M=j.pop();if(M!==T){j[0]=M;e:for(var B=0,z=j.length,O=z>>>1;B<O;){var X=2*(B+1)-1,re=j[X],H=X+1,W=j[H];if(0>i(re,M))H<z&&0>i(W,re)?(j[B]=W,j[H]=M,B=H):(j[B]=re,j[X]=M,B=X);else if(H<z&&0>i(W,M))j[B]=W,j[H]=M,B=H;else break e}}return T}function i(j,T){var M=j.sortIndex-T.sortIndex;return M!==0?M:j.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],c=[],m=1,u=null,p=3,g=!1,y=!1,_=!1,h=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(j){for(var T=n(c);T!==null;){if(T.callback===null)r(c);else if(T.startTime<=j)r(c),T.sortIndex=T.expirationTime,t(l,T);else break;T=n(c)}}function b(j){if(_=!1,v(j),!y)if(n(l)!==null)y=!0,F(E);else{var T=n(c);T!==null&&U(b,T.startTime-j)}}function E(j,T){y=!1,_&&(_=!1,f(w),w=-1),g=!0;var M=p;try{for(v(T),u=n(l);u!==null&&(!(u.expirationTime>T)||j&&!A());){var B=u.callback;if(typeof B=="function"){u.callback=null,p=u.priorityLevel;var z=B(u.expirationTime<=T);T=e.unstable_now(),typeof z=="function"?u.callback=z:u===n(l)&&r(l),v(T)}else r(l);u=n(l)}if(u!==null)var O=!0;else{var X=n(c);X!==null&&U(b,X.startTime-T),O=!1}return O}finally{u=null,p=M,g=!1}}var C=!1,R=null,w=-1,k=5,L=-1;function A(){return!(e.unstable_now()-L<k)}function D(){if(R!==null){var j=e.unstable_now();L=j;var T=!0;try{T=R(!0,j)}finally{T?P():(C=!1,R=null)}}else C=!1}var P;if(typeof d=="function")P=function(){d(D)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,I=$.port2;$.port1.onmessage=D,P=function(){I.postMessage(null)}}else P=function(){h(D,0)};function F(j){R=j,C||(C=!0,P())}function U(j,T){w=h(function(){j(e.unstable_now())},T)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,F(E))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(j){switch(p){case 1:case 2:case 3:var T=3;break;default:T=p}var M=p;p=T;try{return j()}finally{p=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,T){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var M=p;p=j;try{return T()}finally{p=M}},e.unstable_scheduleCallback=function(j,T,M){var B=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?B+M:B):M=B,j){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=M+z,j={id:m++,callback:T,priorityLevel:j,startTime:M,expirationTime:z,sortIndex:-1},M>B?(j.sortIndex=M,t(c,j),n(l)===null&&j===n(c)&&(_?(f(w),w=-1):_=!0,U(b,M-B))):(j.sortIndex=z,t(l,j),y||g||(y=!0,F(E))),j},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(j){var T=p;return function(){var M=p;p=T;try{return j.apply(this,arguments)}finally{p=M}}}})(q1);K1.exports=q1;var K5=K1.exports;/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var G1=x,en=K5;function ee(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Y1=new Set,_a={};function Zi(e,t){ro(e,t),ro(e+"Capture",t)}function ro(e,t){for(_a[e]=t,e=0;e<t.length;e++)Y1.add(t[e])}var vr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Od=Object.prototype.hasOwnProperty,q5=/^[: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]*$/,ov={},av={};function G5(e){return Od.call(av,e)?!0:Od.call(ov,e)?!1:q5.test(e)?av[e]=!0:(ov[e]=!0,!1)}function Y5(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function X5(e,t,n,r){if(t===null||typeof t>"u"||Y5(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mt(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var _t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_t[e]=new Mt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_t[t]=new Mt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_t[e]=new Mt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_t[e]=new Mt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){_t[e]=new Mt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_t[e]=new Mt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_t[e]=new Mt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_t[e]=new Mt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_t[e]=new Mt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Op=/[\-:]([a-z])/g;function Ip(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Op,Ip);_t[t]=new Mt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Op,Ip);_t[t]=new Mt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Op,Ip);_t[t]=new Mt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_t[e]=new Mt(e,1,!1,e.toLowerCase(),null,!1,!1)});_t.xlinkHref=new Mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_t[e]=new Mt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Np(e,t,n,r){var i=_t.hasOwnProperty(t)?_t[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(X5(t,n,i,r)&&(n=null),r||i===null?G5(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var kr=G1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Rl=Symbol.for("react.element"),ws=Symbol.for("react.portal"),bs=Symbol.for("react.fragment"),Bp=Symbol.for("react.strict_mode"),Id=Symbol.for("react.profiler"),X1=Symbol.for("react.provider"),Q1=Symbol.for("react.context"),jp=Symbol.for("react.forward_ref"),Nd=Symbol.for("react.suspense"),Bd=Symbol.for("react.suspense_list"),Fp=Symbol.for("react.memo"),Or=Symbol.for("react.lazy"),J1=Symbol.for("react.offscreen"),lv=Symbol.iterator;function Oo(e){return e===null||typeof e!="object"?null:(e=lv&&e[lv]||e["@@iterator"],typeof e=="function"?e:null)}var Qe=Object.assign,Dh;function Qo(e){if(Dh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Dh=t&&t[1]||""}return`
`+Dh+e}var Ph=!1;function $h(e,t){if(!e||Ph)return"";Ph=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
`),o=r.stack.split(`
`),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||i[a]!==o[s]){var l=`
`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Ph=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qo(e):""}function Q5(e){switch(e.tag){case 5:return Qo(e.type);case 16:return Qo("Lazy");case 13:return Qo("Suspense");case 19:return Qo("SuspenseList");case 0:case 2:case 15:return e=$h(e.type,!1),e;case 11:return e=$h(e.type.render,!1),e;case 1:return e=$h(e.type,!0),e;default:return""}}function jd(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case bs:return"Fragment";case ws:return"Portal";case Id:return"Profiler";case Bp:return"StrictMode";case Nd:return"Suspense";case Bd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Q1:return(e.displayName||"Context")+".Consumer";case X1:return(e._context.displayName||"Context")+".Provider";case jp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Fp:return t=e.displayName||null,t!==null?t:jd(e.type)||"Memo";case Or:t=e._payload,e=e._init;try{return jd(e(t))}catch{}}return null}function J5(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return jd(t);case 8:return t===Bp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function si(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Z5(e){var t=Z1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ll(e){e._valueTracker||(e._valueTracker=Z5(e))}function ey(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Z1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ic(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Fd(e,t){var n=t.checked;return Qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function cv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=si(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ty(e,t){t=t.checked,t!=null&&Np(e,"checked",t,!1)}function zd(e,t){ty(e,t);var n=si(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Hd(e,t.type,n):t.hasOwnProperty("defaultValue")&&Hd(e,t.type,si(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uv(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Hd(e,t,n){(t!=="number"||Ic(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Jo=Array.isArray;function Ds(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+si(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ud(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ee(91));return Qe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function hv(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ee(92));if(Jo(n)){if(1<n.length)throw Error(ee(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:si(n)}}function ny(e,t){var n=si(t.value),r=si(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function dv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ry(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Wd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ry(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ml,iy=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ml=Ml||document.createElement("div"),Ml.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ml.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ya(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eE=["Webkit","ms","Moz","O"];Object.keys(sa).forEach(function(e){eE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),sa[t]=sa[e]})});function sy(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||sa.hasOwnProperty(e)&&sa[e]?(""+t).trim():t+"px"}function oy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=sy(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var tE=Qe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Vd(e,t){if(t){if(tE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function Kd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 qd=null;function zp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gd=null,Ps=null,$s=null;function fv(e){if(e=sl(e)){if(typeof Gd!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=Nu(t),Gd(e.stateNode,e.type,t))}}function ay(e){Ps?$s?$s.push(e):$s=[e]:Ps=e}function ly(){if(Ps){var e=Ps,t=$s;if($s=Ps=null,fv(e),t)for(e=0;e<t.length;e++)fv(t[e])}}function cy(e,t){return e(t)}function uy(){}var Oh=!1;function hy(e,t,n){if(Oh)return e(t,n);Oh=!0;try{return cy(e,t,n)}finally{Oh=!1,(Ps!==null||$s!==null)&&(uy(),ly())}}function wa(e,t){var n=e.stateNode;if(n===null)return null;var r=Nu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ee(231,t,typeof n));return n}var Yd=!1;if(vr)try{var Io={};Object.defineProperty(Io,"passive",{get:function(){Yd=!0}}),window.addEventListener("test",Io,Io),window.removeEventListener("test",Io,Io)}catch{Yd=!1}function nE(e,t,n,r,i,o,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(m){this.onError(m)}}var oa=!1,Nc=null,Bc=!1,Xd=null,rE={onError:function(e){oa=!0,Nc=e}};function iE(e,t,n,r,i,o,a,s,l){oa=!1,Nc=null,nE.apply(rE,arguments)}function sE(e,t,n,r,i,o,a,s,l){if(iE.apply(this,arguments),oa){if(oa){var c=Nc;oa=!1,Nc=null}else throw Error(ee(198));Bc||(Bc=!0,Xd=c)}}function es(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function dy(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function pv(e){if(es(e)!==e)throw Error(ee(188))}function oE(e){var t=e.alternate;if(!t){if(t=es(e),t===null)throw Error(ee(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return pv(i),e;if(o===r)return pv(i),t;o=o.sibling}throw Error(ee(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(ee(189))}}if(n.alternate!==r)throw Error(ee(190))}if(n.tag!==3)throw Error(ee(188));return n.stateNode.current===n?e:t}function fy(e){return e=oE(e),e!==null?py(e):null}function py(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=py(e);if(t!==null)return t;e=e.sibling}return null}var my=en.unstable_scheduleCallback,mv=en.unstable_cancelCallback,aE=en.unstable_shouldYield,lE=en.unstable_requestPaint,Ze=en.unstable_now,cE=en.unstable_getCurrentPriorityLevel,Hp=en.unstable_ImmediatePriority,gy=en.unstable_UserBlockingPriority,jc=en.unstable_NormalPriority,uE=en.unstable_LowPriority,vy=en.unstable_IdlePriority,Pu=null,Yn=null;function hE(e){if(Yn&&typeof Yn.onCommitFiberRoot=="function")try{Yn.onCommitFiberRoot(Pu,e,void 0,(e.current.flags&128)===128)}catch{}}var Dn=Math.clz32?Math.clz32:pE,dE=Math.log,fE=Math.LN2;function pE(e){return e>>>=0,e===0?32:31-(dE(e)/fE|0)|0}var Al=64,Tl=4194304;function Zo(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Zo(s):(o&=a,o!==0&&(r=Zo(o)))}else a=n&~i,a!==0?r=Zo(a):o!==0&&(r=Zo(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Dn(t),i=1<<n,r|=e[n],t&=~i;return r}function mE(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gE(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-Dn(o),s=1<<a,l=i[a];l===-1?(!(s&n)||s&r)&&(i[a]=mE(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}function Qd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function _y(){var e=Al;return Al<<=1,!(Al&4194240)&&(Al=64),e}function Ih(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dn(t),e[t]=n}function vE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Dn(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function Up(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Dn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ie=0;function yy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var wy,Wp,by,xy,Sy,Jd=!1,Dl=[],Qr=null,Jr=null,Zr=null,ba=new Map,xa=new Map,Nr=[],_E="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 submit".split(" ");function gv(e,t){switch(e){case"focusin":case"focusout":Qr=null;break;case"dragenter":case"dragleave":Jr=null;break;case"mouseover":case"mouseout":Zr=null;break;case"pointerover":case"pointerout":ba.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xa.delete(t.pointerId)}}function No(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=sl(t),t!==null&&Wp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function yE(e,t,n,r,i){switch(t){case"focusin":return Qr=No(Qr,e,t,n,r,i),!0;case"dragenter":return Jr=No(Jr,e,t,n,r,i),!0;case"mouseover":return Zr=No(Zr,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return ba.set(o,No(ba.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,xa.set(o,No(xa.get(o)||null,e,t,n,r,i)),!0}return!1}function Cy(e){var t=Ri(e.target);if(t!==null){var n=es(t);if(n!==null){if(t=n.tag,t===13){if(t=dy(n),t!==null){e.blockedOn=t,Sy(e.priority,function(){by(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function dc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zd(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);qd=r,n.target.dispatchEvent(r),qd=null}else return t=sl(n),t!==null&&Wp(t),e.blockedOn=n,!1;t.shift()}return!0}function vv(e,t,n){dc(e)&&n.delete(t)}function wE(){Jd=!1,Qr!==null&&dc(Qr)&&(Qr=null),Jr!==null&&dc(Jr)&&(Jr=null),Zr!==null&&dc(Zr)&&(Zr=null),ba.forEach(vv),xa.forEach(vv)}function Bo(e,t){e.blockedOn===t&&(e.blockedOn=null,Jd||(Jd=!0,en.unstable_scheduleCallback(en.unstable_NormalPriority,wE)))}function Sa(e){function t(i){return Bo(i,e)}if(0<Dl.length){Bo(Dl[0],e);for(var n=1;n<Dl.length;n++){var r=Dl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Qr!==null&&Bo(Qr,e),Jr!==null&&Bo(Jr,e),Zr!==null&&Bo(Zr,e),ba.forEach(t),xa.forEach(t),n=0;n<Nr.length;n++)r=Nr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Nr.length&&(n=Nr[0],n.blockedOn===null);)Cy(n),n.blockedOn===null&&Nr.shift()}var Os=kr.ReactCurrentBatchConfig,zc=!0;function bE(e,t,n,r){var i=Ie,o=Os.transition;Os.transition=null;try{Ie=1,Vp(e,t,n,r)}finally{Ie=i,Os.transition=o}}function xE(e,t,n,r){var i=Ie,o=Os.transition;Os.transition=null;try{Ie=4,Vp(e,t,n,r)}finally{Ie=i,Os.transition=o}}function Vp(e,t,n,r){if(zc){var i=Zd(e,t,n,r);if(i===null)Kh(e,t,r,Hc,n),gv(e,r);else if(yE(i,e,t,n,r))r.stopPropagation();else if(gv(e,r),t&4&&-1<_E.indexOf(e)){for(;i!==null;){var o=sl(i);if(o!==null&&wy(o),o=Zd(e,t,n,r),o===null&&Kh(e,t,r,Hc,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Kh(e,t,r,null,n)}}var Hc=null;function Zd(e,t,n,r){if(Hc=null,e=zp(r),e=Ri(e),e!==null)if(t=es(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dy(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Hc=e,null}function Ey(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(cE()){case Hp:return 1;case gy:return 4;case jc:case uE:return 16;case vy:return 536870912;default:return 16}default:return 16}}var Gr=null,Kp=null,fc=null;function ky(){if(fc)return fc;var e,t=Kp,n=t.length,r,i="value"in Gr?Gr.value:Gr.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[o-r];r++);return fc=i.slice(e,1<r?1-r:void 0)}function pc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Pl(){return!0}function _v(){return!1}function nn(e){function t(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Pl:_v,this.isPropagationStopped=_v,this}return Qe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Pl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Pl)},persist:function(){},isPersistent:Pl}),t}var _o={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qp=nn(_o),il=Qe({},_o,{view:0,detail:0}),SE=nn(il),Nh,Bh,jo,$u=Qe({},il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==jo&&(jo&&e.type==="mousemove"?(Nh=e.screenX-jo.screenX,Bh=e.screenY-jo.screenY):Bh=Nh=0,jo=e),Nh)},movementY:function(e){return"movementY"in e?e.movementY:Bh}}),yv=nn($u),CE=Qe({},$u,{dataTransfer:0}),EE=nn(CE),kE=Qe({},il,{relatedTarget:0}),jh=nn(kE),RE=Qe({},_o,{animationName:0,elapsedTime:0,pseudoElement:0}),LE=nn(RE),ME=Qe({},_o,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),AE=nn(ME),TE=Qe({},_o,{data:0}),wv=nn(TE),DE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PE={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"},$E={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OE(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$E[e])?!!t[e]:!1}function Gp(){return OE}var IE=Qe({},il,{key:function(e){if(e.key){var t=DE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?PE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gp,charCode:function(e){return e.type==="keypress"?pc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),NE=nn(IE),BE=Qe({},$u,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bv=nn(BE),jE=Qe({},il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gp}),FE=nn(jE),zE=Qe({},_o,{propertyName:0,elapsedTime:0,pseudoElement:0}),HE=nn(zE),UE=Qe({},$u,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),WE=nn(UE),VE=[9,13,27,32],Yp=vr&&"CompositionEvent"in window,aa=null;vr&&"documentMode"in document&&(aa=document.documentMode);var KE=vr&&"TextEvent"in window&&!aa,Ry=vr&&(!Yp||aa&&8<aa&&11>=aa),xv=" ",Sv=!1;function Ly(e,t){switch(e){case"keyup":return VE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function My(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xs=!1;function qE(e,t){switch(e){case"compositionend":return My(t);case"keypress":return t.which!==32?null:(Sv=!0,xv);case"textInput":return e=t.data,e===xv&&Sv?null:e;default:return null}}function GE(e,t){if(xs)return e==="compositionend"||!Yp&&Ly(e,t)?(e=ky(),fc=Kp=Gr=null,xs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ry&&t.locale!=="ko"?null:t.data;default:return null}}var YE={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 Cv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!YE[e.type]:t==="textarea"}function Ay(e,t,n,r){ay(r),t=Uc(t,"onChange"),0<t.length&&(n=new qp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var la=null,Ca=null;function XE(e){zy(e,0)}function Ou(e){var t=Es(e);if(ey(t))return e}function QE(e,t){if(e==="change")return t}var Ty=!1;if(vr){var Fh;if(vr){var zh="oninput"in document;if(!zh){var Ev=document.createElement("div");Ev.setAttribute("oninput","return;"),zh=typeof Ev.oninput=="function"}Fh=zh}else Fh=!1;Ty=Fh&&(!document.documentMode||9<document.documentMode)}function kv(){la&&(la.detachEvent("onpropertychange",Dy),Ca=la=null)}function Dy(e){if(e.propertyName==="value"&&Ou(Ca)){var t=[];Ay(t,Ca,e,zp(e)),hy(XE,t)}}function JE(e,t,n){e==="focusin"?(kv(),la=t,Ca=n,la.attachEvent("onpropertychange",Dy)):e==="focusout"&&kv()}function ZE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ou(Ca)}function ek(e,t){if(e==="click")return Ou(t)}function tk(e,t){if(e==="input"||e==="change")return Ou(t)}function nk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var In=typeof Object.is=="function"?Object.is:nk;function Ea(e,t){if(In(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Od.call(t,i)||!In(e[i],t[i]))return!1}return!0}function Rv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lv(e,t){var n=Rv(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Rv(n)}}function Py(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Py(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $y(){for(var e=window,t=Ic();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ic(e.document)}return t}function Xp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rk(e){var t=$y(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Py(n.ownerDocument.documentElement,n)){if(r!==null&&Xp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Lv(n,o);var a=Lv(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ik=vr&&"documentMode"in document&&11>=document.documentMode,Ss=null,ef=null,ca=null,tf=!1;function Mv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tf||Ss==null||Ss!==Ic(r)||(r=Ss,"selectionStart"in r&&Xp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ca&&Ea(ca,r)||(ca=r,r=Uc(ef,"onSelect"),0<r.length&&(t=new qp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ss)))}function $l(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Cs={animationend:$l("Animation","AnimationEnd"),animationiteration:$l("Animation","AnimationIteration"),animationstart:$l("Animation","AnimationStart"),transitionend:$l("Transition","TransitionEnd")},Hh={},Oy={};vr&&(Oy=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Iu(e){if(Hh[e])return Hh[e];if(!Cs[e])return e;var t=Cs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Oy)return Hh[e]=t[n];return e}var Iy=Iu("animationend"),Ny=Iu("animationiteration"),By=Iu("animationstart"),jy=Iu("transitionend"),Fy=new Map,Av="abort auxClick 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(" ");function di(e,t){Fy.set(e,t),Zi(t,[e])}for(var Uh=0;Uh<Av.length;Uh++){var Wh=Av[Uh],sk=Wh.toLowerCase(),ok=Wh[0].toUpperCase()+Wh.slice(1);di(sk,"on"+ok)}di(Iy,"onAnimationEnd");di(Ny,"onAnimationIteration");di(By,"onAnimationStart");di("dblclick","onDoubleClick");di("focusin","onFocus");di("focusout","onBlur");di(jy,"onTransitionEnd");ro("onMouseEnter",["mouseout","mouseover"]);ro("onMouseLeave",["mouseout","mouseover"]);ro("onPointerEnter",["pointerout","pointerover"]);ro("onPointerLeave",["pointerout","pointerover"]);Zi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Zi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Zi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Zi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Zi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Zi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ea="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(" "),ak=new Set("cancel close invalid load scroll toggle".split(" ").concat(ea));function Tv(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,sE(r,t,void 0,e),e.currentTarget=null}function zy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;Tv(i,s,c),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;Tv(i,s,c),o=l}}}if(Bc)throw e=Xd,Bc=!1,Xd=null,e}function We(e,t){var n=t[af];n===void 0&&(n=t[af]=new Set);var r=e+"__bubble";n.has(r)||(Hy(t,e,2,!1),n.add(r))}function Vh(e,t,n){var r=0;t&&(r|=4),Hy(n,e,r,t)}var Ol="_reactListening"+Math.random().toString(36).slice(2);function ka(e){if(!e[Ol]){e[Ol]=!0,Y1.forEach(function(n){n!=="selectionchange"&&(ak.has(n)||Vh(n,!1,e),Vh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ol]||(t[Ol]=!0,Vh("selectionchange",!1,t))}}function Hy(e,t,n,r){switch(Ey(t)){case 1:var i=bE;break;case 4:i=xE;break;default:i=Vp}n=i.bind(null,t,n,e),i=void 0,!Yd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Kh(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=Ri(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}hy(function(){var c=o,m=zp(n),u=[];e:{var p=Fy.get(e);if(p!==void 0){var g=qp,y=e;switch(e){case"keypress":if(pc(n)===0)break e;case"keydown":case"keyup":g=NE;break;case"focusin":y="focus",g=jh;break;case"focusout":y="blur",g=jh;break;case"beforeblur":case"afterblur":g=jh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=yv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=EE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=FE;break;case Iy:case Ny:case By:g=LE;break;case jy:g=HE;break;case"scroll":g=SE;break;case"wheel":g=WE;break;case"copy":case"cut":case"paste":g=AE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=bv}var _=(t&4)!==0,h=!_&&e==="scroll",f=_?p!==null?p+"Capture":null:p;_=[];for(var d=c,v;d!==null;){v=d;var b=v.stateNode;if(v.tag===5&&b!==null&&(v=b,f!==null&&(b=wa(d,f),b!=null&&_.push(Ra(d,b,v)))),h)break;d=d.return}0<_.length&&(p=new g(p,y,null,n,m),u.push({event:p,listeners:_}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",p&&n!==qd&&(y=n.relatedTarget||n.fromElement)&&(Ri(y)||y[_r]))break e;if((g||p)&&(p=m.window===m?m:(p=m.ownerDocument)?p.defaultView||p.parentWindow:window,g?(y=n.relatedTarget||n.toElement,g=c,y=y?Ri(y):null,y!==null&&(h=es(y),y!==h||y.tag!==5&&y.tag!==6)&&(y=null)):(g=null,y=c),g!==y)){if(_=yv,b="onMouseLeave",f="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(_=bv,b="onPointerLeave",f="onPointerEnter",d="pointer"),h=g==null?p:Es(g),v=y==null?p:Es(y),p=new _(b,d+"leave",g,n,m),p.target=h,p.relatedTarget=v,b=null,Ri(m)===c&&(_=new _(f,d+"enter",y,n,m),_.target=v,_.relatedTarget=h,b=_),h=b,g&&y)t:{for(_=g,f=y,d=0,v=_;v;v=cs(v))d++;for(v=0,b=f;b;b=cs(b))v++;for(;0<d-v;)_=cs(_),d--;for(;0<v-d;)f=cs(f),v--;for(;d--;){if(_===f||f!==null&&_===f.alternate)break t;_=cs(_),f=cs(f)}_=null}else _=null;g!==null&&Dv(u,p,g,_,!1),y!==null&&h!==null&&Dv(u,h,y,_,!0)}}e:{if(p=c?Es(c):window,g=p.nodeName&&p.nodeName.toLowerCase(),g==="select"||g==="input"&&p.type==="file")var E=QE;else if(Cv(p))if(Ty)E=tk;else{E=ZE;var C=JE}else(g=p.nodeName)&&g.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(E=ek);if(E&&(E=E(e,c))){Ay(u,E,n,m);break e}C&&C(e,p,c),e==="focusout"&&(C=p._wrapperState)&&C.controlled&&p.type==="number"&&Hd(p,"number",p.value)}switch(C=c?Es(c):window,e){case"focusin":(Cv(C)||C.contentEditable==="true")&&(Ss=C,ef=c,ca=null);break;case"focusout":ca=ef=Ss=null;break;case"mousedown":tf=!0;break;case"contextmenu":case"mouseup":case"dragend":tf=!1,Mv(u,n,m);break;case"selectionchange":if(ik)break;case"keydown":case"keyup":Mv(u,n,m)}var R;if(Yp)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else xs?Ly(e,n)&&(w="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(w="onCompositionStart");w&&(Ry&&n.locale!=="ko"&&(xs||w!=="onCompositionStart"?w==="onCompositionEnd"&&xs&&(R=ky()):(Gr=m,Kp="value"in Gr?Gr.value:Gr.textContent,xs=!0)),C=Uc(c,w),0<C.length&&(w=new wv(w,e,null,n,m),u.push({event:w,listeners:C}),R?w.data=R:(R=My(n),R!==null&&(w.data=R)))),(R=KE?qE(e,n):GE(e,n))&&(c=Uc(c,"onBeforeInput"),0<c.length&&(m=new wv("onBeforeInput","beforeinput",null,n,m),u.push({event:m,listeners:c}),m.data=R))}zy(u,t)})}function Ra(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Uc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=wa(e,n),o!=null&&r.unshift(Ra(e,o,i)),o=wa(e,t),o!=null&&r.push(Ra(e,o,i))),e=e.return}return r}function cs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Dv(e,t,n,r,i){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&c!==null&&(s=c,i?(l=wa(n,o),l!=null&&a.unshift(Ra(n,l,s))):i||(l=wa(n,o),l!=null&&a.push(Ra(n,l,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var lk=/\r\n?/g,ck=/\u0000|\uFFFD/g;function Pv(e){return(typeof e=="string"?e:""+e).replace(lk,`
`).replace(ck,"")}function Il(e,t,n){if(t=Pv(t),Pv(e)!==t&&n)throw Error(ee(425))}function Wc(){}var nf=null,rf=null;function sf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var of=typeof setTimeout=="function"?setTimeout:void 0,uk=typeof clearTimeout=="function"?clearTimeout:void 0,$v=typeof Promise=="function"?Promise:void 0,hk=typeof queueMicrotask=="function"?queueMicrotask:typeof $v<"u"?function(e){return $v.resolve(null).then(e).catch(dk)}:of;function dk(e){setTimeout(function(){throw e})}function qh(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Sa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Sa(t)}function ei(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Ov(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var yo=Math.random().toString(36).slice(2),Kn="__reactFiber$"+yo,La="__reactProps$"+yo,_r="__reactContainer$"+yo,af="__reactEvents$"+yo,fk="__reactListeners$"+yo,pk="__reactHandles$"+yo;function Ri(e){var t=e[Kn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_r]||n[Kn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ov(e);e!==null;){if(n=e[Kn])return n;e=Ov(e)}return t}e=n,n=e.parentNode}return null}function sl(e){return e=e[Kn]||e[_r],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ee(33))}function Nu(e){return e[La]||null}var lf=[],ks=-1;function fi(e){return{current:e}}function Ke(e){0>ks||(e.current=lf[ks],lf[ks]=null,ks--)}function ze(e,t){ks++,lf[ks]=e.current,e.current=t}var oi={},St=fi(oi),It=fi(!1),Wi=oi;function io(e,t){var n=e.type.contextTypes;if(!n)return oi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Nt(e){return e=e.childContextTypes,e!=null}function Vc(){Ke(It),Ke(St)}function Iv(e,t,n){if(St.current!==oi)throw Error(ee(168));ze(St,t),ze(It,n)}function Uy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ee(108,J5(e)||"Unknown",i));return Qe({},n,r)}function Kc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||oi,Wi=St.current,ze(St,e),ze(It,It.current),!0}function Nv(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=Uy(e,t,Wi),r.__reactInternalMemoizedMergedChildContext=e,Ke(It),Ke(St),ze(St,e)):Ke(It),ze(It,n)}var ur=null,Bu=!1,Gh=!1;function Wy(e){ur===null?ur=[e]:ur.push(e)}function mk(e){Bu=!0,Wy(e)}function pi(){if(!Gh&&ur!==null){Gh=!0;var e=0,t=Ie;try{var n=ur;for(Ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ur=null,Bu=!1}catch(i){throw ur!==null&&(ur=ur.slice(e+1)),my(Hp,pi),i}finally{Ie=t,Gh=!1}}return null}var Rs=[],Ls=0,qc=null,Gc=0,cn=[],un=0,Vi=null,fr=1,pr="";function bi(e,t){Rs[Ls++]=Gc,Rs[Ls++]=qc,qc=e,Gc=t}function Vy(e,t,n){cn[un++]=fr,cn[un++]=pr,cn[un++]=Vi,Vi=e;var r=fr;e=pr;var i=32-Dn(r)-1;r&=~(1<<i),n+=1;var o=32-Dn(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,fr=1<<32-Dn(t)+i|n<<i|r,pr=o+e}else fr=1<<o|n<<i|r,pr=e}function Qp(e){e.return!==null&&(bi(e,1),Vy(e,1,0))}function Jp(e){for(;e===qc;)qc=Rs[--Ls],Rs[Ls]=null,Gc=Rs[--Ls],Rs[Ls]=null;for(;e===Vi;)Vi=cn[--un],cn[un]=null,pr=cn[--un],cn[un]=null,fr=cn[--un],cn[un]=null}var Qt=null,Gt=null,qe=!1,Tn=null;function Ky(e,t){var n=fn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Bv(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Qt=e,Gt=ei(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qt=e,Gt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Vi!==null?{id:fr,overflow:pr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=fn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Qt=e,Gt=null,!0):!1;default:return!1}}function cf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function uf(e){if(qe){var t=Gt;if(t){var n=t;if(!Bv(e,t)){if(cf(e))throw Error(ee(418));t=ei(n.nextSibling);var r=Qt;t&&Bv(e,t)?Ky(r,n):(e.flags=e.flags&-4097|2,qe=!1,Qt=e)}}else{if(cf(e))throw Error(ee(418));e.flags=e.flags&-4097|2,qe=!1,Qt=e}}}function jv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qt=e}function Nl(e){if(e!==Qt)return!1;if(!qe)return jv(e),qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!sf(e.type,e.memoizedProps)),t&&(t=Gt)){if(cf(e))throw qy(),Error(ee(418));for(;t;)Ky(e,t),t=ei(t.nextSibling)}if(jv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Gt=ei(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Gt=null}}else Gt=Qt?ei(e.stateNode.nextSibling):null;return!0}function qy(){for(var e=Gt;e;)e=ei(e.nextSibling)}function so(){Gt=Qt=null,qe=!1}function Zp(e){Tn===null?Tn=[e]:Tn.push(e)}var gk=kr.ReactCurrentBatchConfig;function kn(e,t){if(e&&e.defaultProps){t=Qe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Yc=fi(null),Xc=null,Ms=null,em=null;function tm(){em=Ms=Xc=null}function nm(e){var t=Yc.current;Ke(Yc),e._currentValue=t}function hf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Is(e,t){Xc=e,em=Ms=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ot=!0),e.firstContext=null)}function vn(e){var t=e._currentValue;if(em!==e)if(e={context:e,memoizedValue:t,next:null},Ms===null){if(Xc===null)throw Error(ee(308));Ms=e,Xc.dependencies={lanes:0,firstContext:e}}else Ms=Ms.next=e;return t}var Li=null;function rm(e){Li===null?Li=[e]:Li.push(e)}function Gy(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,rm(t)):(n.next=i.next,i.next=n),t.interleaved=n,yr(e,r)}function yr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ir=!1;function im(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yy(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ti(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Te&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,yr(e,n)}return i=r.interleaved,i===null?(t.next=t,rm(r)):(t.next=i.next,i.next=t),r.interleaved=t,yr(e,n)}function mc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Up(e,n)}}function Fv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Qc(e,t,n,r){var i=e.updateQueue;Ir=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var m=e.alternate;m!==null&&(m=m.updateQueue,s=m.lastBaseUpdate,s!==a&&(s===null?m.firstBaseUpdate=c:s.next=c,m.lastBaseUpdate=l))}if(o!==null){var u=i.baseState;a=0,m=c=l=null,s=o;do{var p=s.lane,g=s.eventTime;if((r&p)===p){m!==null&&(m=m.next={eventTime:g,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=e,_=s;switch(p=t,g=n,_.tag){case 1:if(y=_.payload,typeof y=="function"){u=y.call(g,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=_.payload,p=typeof y=="function"?y.call(g,u,p):y,p==null)break e;u=Qe({},u,p);break e;case 2:Ir=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else g={eventTime:g,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},m===null?(c=m=g,l=u):m=m.next=g,a|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(m===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=m,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);qi|=a,e.lanes=a,e.memoizedState=u}}function zv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ee(191,i));i.call(r)}}}var Xy=new G1.Component().refs;function df(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Qe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ju={isMounted:function(e){return(e=e._reactInternals)?es(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rt(),i=ri(e),o=gr(r,i);o.payload=t,n!=null&&(o.callback=n),t=ti(e,o,i),t!==null&&(Pn(t,e,i,r),mc(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rt(),i=ri(e),o=gr(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ti(e,o,i),t!==null&&(Pn(t,e,i,r),mc(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rt(),r=ri(e),i=gr(n,r);i.tag=2,t!=null&&(i.callback=t),t=ti(e,i,r),t!==null&&(Pn(t,e,r,n),mc(t,e,r))}};function Hv(e,t,n,r,i,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!Ea(n,r)||!Ea(i,o):!0}function Qy(e,t,n){var r=!1,i=oi,o=t.contextType;return typeof o=="object"&&o!==null?o=vn(o):(i=Nt(t)?Wi:St.current,r=t.contextTypes,o=(r=r!=null)?io(e,i):oi),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ju,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Uv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ju.enqueueReplaceState(t,t.state,null)}function ff(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Xy,im(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=vn(o):(o=Nt(t)?Wi:St.current,i.context=io(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(df(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&ju.enqueueReplaceState(i,i.state,null),Qc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Fo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ee(309));var r=n.stateNode}if(!r)throw Error(ee(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var s=i.refs;s===Xy&&(s=i.refs={}),a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(ee(284));if(!n._owner)throw Error(ee(290,e))}return e}function Bl(e,t){throw e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wv(e){var t=e._init;return t(e._payload)}function Jy(e){function t(f,d){if(e){var v=f.deletions;v===null?(f.deletions=[d],f.flags|=16):v.push(d)}}function n(f,d){if(!e)return null;for(;d!==null;)t(f,d),d=d.sibling;return null}function r(f,d){for(f=new Map;d!==null;)d.key!==null?f.set(d.key,d):f.set(d.index,d),d=d.sibling;return f}function i(f,d){return f=ii(f,d),f.index=0,f.sibling=null,f}function o(f,d,v){return f.index=v,e?(v=f.alternate,v!==null?(v=v.index,v<d?(f.flags|=2,d):v):(f.flags|=2,d)):(f.flags|=1048576,d)}function a(f){return e&&f.alternate===null&&(f.flags|=2),f}function s(f,d,v,b){return d===null||d.tag!==6?(d=td(v,f.mode,b),d.return=f,d):(d=i(d,v),d.return=f,d)}function l(f,d,v,b){var E=v.type;return E===bs?m(f,d,v.props.children,b,v.key):d!==null&&(d.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Or&&Wv(E)===d.type)?(b=i(d,v.props),b.ref=Fo(f,d,v),b.return=f,b):(b=bc(v.type,v.key,v.props,null,f.mode,b),b.ref=Fo(f,d,v),b.return=f,b)}function c(f,d,v,b){return d===null||d.tag!==4||d.stateNode.containerInfo!==v.containerInfo||d.stateNode.implementation!==v.implementation?(d=nd(v,f.mode,b),d.return=f,d):(d=i(d,v.children||[]),d.return=f,d)}function m(f,d,v,b,E){return d===null||d.tag!==7?(d=Hi(v,f.mode,b,E),d.return=f,d):(d=i(d,v),d.return=f,d)}function u(f,d,v){if(typeof d=="string"&&d!==""||typeof d=="number")return d=td(""+d,f.mode,v),d.return=f,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Rl:return v=bc(d.type,d.key,d.props,null,f.mode,v),v.ref=Fo(f,null,d),v.return=f,v;case ws:return d=nd(d,f.mode,v),d.return=f,d;case Or:var b=d._init;return u(f,b(d._payload),v)}if(Jo(d)||Oo(d))return d=Hi(d,f.mode,v,null),d.return=f,d;Bl(f,d)}return null}function p(f,d,v,b){var E=d!==null?d.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return E!==null?null:s(f,d,""+v,b);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Rl:return v.key===E?l(f,d,v,b):null;case ws:return v.key===E?c(f,d,v,b):null;case Or:return E=v._init,p(f,d,E(v._payload),b)}if(Jo(v)||Oo(v))return E!==null?null:m(f,d,v,b,null);Bl(f,v)}return null}function g(f,d,v,b,E){if(typeof b=="string"&&b!==""||typeof b=="number")return f=f.get(v)||null,s(d,f,""+b,E);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Rl:return f=f.get(b.key===null?v:b.key)||null,l(d,f,b,E);case ws:return f=f.get(b.key===null?v:b.key)||null,c(d,f,b,E);case Or:var C=b._init;return g(f,d,v,C(b._payload),E)}if(Jo(b)||Oo(b))return f=f.get(v)||null,m(d,f,b,E,null);Bl(d,b)}return null}function y(f,d,v,b){for(var E=null,C=null,R=d,w=d=0,k=null;R!==null&&w<v.length;w++){R.index>w?(k=R,R=null):k=R.sibling;var L=p(f,R,v[w],b);if(L===null){R===null&&(R=k);break}e&&R&&L.alternate===null&&t(f,R),d=o(L,d,w),C===null?E=L:C.sibling=L,C=L,R=k}if(w===v.length)return n(f,R),qe&&bi(f,w),E;if(R===null){for(;w<v.length;w++)R=u(f,v[w],b),R!==null&&(d=o(R,d,w),C===null?E=R:C.sibling=R,C=R);return qe&&bi(f,w),E}for(R=r(f,R);w<v.length;w++)k=g(R,f,w,v[w],b),k!==null&&(e&&k.alternate!==null&&R.delete(k.key===null?w:k.key),d=o(k,d,w),C===null?E=k:C.sibling=k,C=k);return e&&R.forEach(function(A){return t(f,A)}),qe&&bi(f,w),E}function _(f,d,v,b){var E=Oo(v);if(typeof E!="function")throw Error(ee(150));if(v=E.call(v),v==null)throw Error(ee(151));for(var C=E=null,R=d,w=d=0,k=null,L=v.next();R!==null&&!L.done;w++,L=v.next()){R.index>w?(k=R,R=null):k=R.sibling;var A=p(f,R,L.value,b);if(A===null){R===null&&(R=k);break}e&&R&&A.alternate===null&&t(f,R),d=o(A,d,w),C===null?E=A:C.sibling=A,C=A,R=k}if(L.done)return n(f,R),qe&&bi(f,w),E;if(R===null){for(;!L.done;w++,L=v.next())L=u(f,L.value,b),L!==null&&(d=o(L,d,w),C===null?E=L:C.sibling=L,C=L);return qe&&bi(f,w),E}for(R=r(f,R);!L.done;w++,L=v.next())L=g(R,f,w,L.value,b),L!==null&&(e&&L.alternate!==null&&R.delete(L.key===null?w:L.key),d=o(L,d,w),C===null?E=L:C.sibling=L,C=L);return e&&R.forEach(function(D){return t(f,D)}),qe&&bi(f,w),E}function h(f,d,v,b){if(typeof v=="object"&&v!==null&&v.type===bs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Rl:e:{for(var E=v.key,C=d;C!==null;){if(C.key===E){if(E=v.type,E===bs){if(C.tag===7){n(f,C.sibling),d=i(C,v.props.children),d.return=f,f=d;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Or&&Wv(E)===C.type){n(f,C.sibling),d=i(C,v.props),d.ref=Fo(f,C,v),d.return=f,f=d;break e}n(f,C);break}else t(f,C);C=C.sibling}v.type===bs?(d=Hi(v.props.children,f.mode,b,v.key),d.return=f,f=d):(b=bc(v.type,v.key,v.props,null,f.mode,b),b.ref=Fo(f,d,v),b.return=f,f=b)}return a(f);case ws:e:{for(C=v.key;d!==null;){if(d.key===C)if(d.tag===4&&d.stateNode.containerInfo===v.containerInfo&&d.stateNode.implementation===v.implementation){n(f,d.sibling),d=i(d,v.children||[]),d.return=f,f=d;break e}else{n(f,d);break}else t(f,d);d=d.sibling}d=nd(v,f.mode,b),d.return=f,f=d}return a(f);case Or:return C=v._init,h(f,d,C(v._payload),b)}if(Jo(v))return y(f,d,v,b);if(Oo(v))return _(f,d,v,b);Bl(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,d!==null&&d.tag===6?(n(f,d.sibling),d=i(d,v),d.return=f,f=d):(n(f,d),d=td(v,f.mode,b),d.return=f,f=d),a(f)):n(f,d)}return h}var oo=Jy(!0),Zy=Jy(!1),ol={},Xn=fi(ol),Ma=fi(ol),Aa=fi(ol);function Mi(e){if(e===ol)throw Error(ee(174));return e}function sm(e,t){switch(ze(Aa,t),ze(Ma,e),ze(Xn,ol),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Wd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Wd(t,e)}Ke(Xn),ze(Xn,t)}function ao(){Ke(Xn),Ke(Ma),Ke(Aa)}function ew(e){Mi(Aa.current);var t=Mi(Xn.current),n=Wd(t,e.type);t!==n&&(ze(Ma,e),ze(Xn,n))}function om(e){Ma.current===e&&(Ke(Xn),Ke(Ma))}var Ye=fi(0);function Jc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Yh=[];function am(){for(var e=0;e<Yh.length;e++)Yh[e]._workInProgressVersionPrimary=null;Yh.length=0}var gc=kr.ReactCurrentDispatcher,Xh=kr.ReactCurrentBatchConfig,Ki=0,Xe=null,at=null,ft=null,Zc=!1,ua=!1,Ta=0,vk=0;function yt(){throw Error(ee(321))}function lm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!In(e[n],t[n]))return!1;return!0}function cm(e,t,n,r,i,o){if(Ki=o,Xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,gc.current=e===null||e.memoizedState===null?bk:xk,e=n(r,i),ua){o=0;do{if(ua=!1,Ta=0,25<=o)throw Error(ee(301));o+=1,ft=at=null,t.updateQueue=null,gc.current=Sk,e=n(r,i)}while(ua)}if(gc.current=eu,t=at!==null&&at.next!==null,Ki=0,ft=at=Xe=null,Zc=!1,t)throw Error(ee(300));return e}function um(){var e=Ta!==0;return Ta=0,e}function Fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?Xe.memoizedState=ft=e:ft=ft.next=e,ft}function _n(){if(at===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var t=ft===null?Xe.memoizedState:ft.next;if(t!==null)ft=t,at=e;else{if(e===null)throw Error(ee(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},ft===null?Xe.memoizedState=ft=e:ft=ft.next=e}return ft}function Da(e,t){return typeof t=="function"?t(e):t}function Qh(e){var t=_n(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=at,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=a=null,l=null,c=o;do{var m=c.lane;if((Ki&m)===m)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var u={lane:m,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(s=l=u,a=r):l=l.next=u,Xe.lanes|=m,qi|=m}c=c.next}while(c!==null&&c!==o);l===null?a=r:l.next=s,In(r,t.memoizedState)||(Ot=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,Xe.lanes|=o,qi|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Jh(e){var t=_n(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=e(o,a.action),a=a.next;while(a!==i);In(o,t.memoizedState)||(Ot=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function tw(){}function nw(e,t){var n=Xe,r=_n(),i=t(),o=!In(r.memoizedState,i);if(o&&(r.memoizedState=i,Ot=!0),r=r.queue,hm(sw.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ft!==null&&ft.memoizedState.tag&1){if(n.flags|=2048,Pa(9,iw.bind(null,n,r,i,t),void 0,null),pt===null)throw Error(ee(349));Ki&30||rw(n,t,i)}return i}function rw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Xe.updateQueue,t===null?(t={lastEffect:null,stores:null},Xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function iw(e,t,n,r){t.value=n,t.getSnapshot=r,ow(t)&&aw(e)}function sw(e,t,n){return n(function(){ow(t)&&aw(e)})}function ow(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!In(e,n)}catch{return!0}}function aw(e){var t=yr(e,1);t!==null&&Pn(t,e,1,-1)}function Vv(e){var t=Fn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:e},t.queue=e,e=e.dispatch=wk.bind(null,Xe,e),[t.memoizedState,e]}function Pa(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Xe.updateQueue,t===null?(t={lastEffect:null,stores:null},Xe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function lw(){return _n().memoizedState}function vc(e,t,n,r){var i=Fn();Xe.flags|=e,i.memoizedState=Pa(1|t,n,void 0,r===void 0?null:r)}function Fu(e,t,n,r){var i=_n();r=r===void 0?null:r;var o=void 0;if(at!==null){var a=at.memoizedState;if(o=a.destroy,r!==null&&lm(r,a.deps)){i.memoizedState=Pa(t,n,o,r);return}}Xe.flags|=e,i.memoizedState=Pa(1|t,n,o,r)}function Kv(e,t){return vc(8390656,8,e,t)}function hm(e,t){return Fu(2048,8,e,t)}function cw(e,t){return Fu(4,2,e,t)}function uw(e,t){return Fu(4,4,e,t)}function hw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function dw(e,t,n){return n=n!=null?n.concat([e]):null,Fu(4,4,hw.bind(null,t,e),n)}function dm(){}function fw(e,t){var n=_n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&lm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function pw(e,t){var n=_n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&lm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function mw(e,t,n){return Ki&21?(In(n,t)||(n=_y(),Xe.lanes|=n,qi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ot=!0),e.memoizedState=n)}function _k(e,t){var n=Ie;Ie=n!==0&&4>n?n:4,e(!0);var r=Xh.transition;Xh.transition={};try{e(!1),t()}finally{Ie=n,Xh.transition=r}}function gw(){return _n().memoizedState}function yk(e,t,n){var r=ri(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},vw(e))_w(t,n);else if(n=Gy(e,t,n,r),n!==null){var i=Rt();Pn(n,e,r,i),yw(n,t,r)}}function wk(e,t,n){var r=ri(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(vw(e))_w(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,In(s,a)){var l=t.interleaved;l===null?(i.next=i,rm(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Gy(e,t,i,r),n!==null&&(i=Rt(),Pn(n,e,r,i),yw(n,t,r))}}function vw(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function _w(e,t){ua=Zc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Up(e,n)}}var eu={readContext:vn,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useInsertionEffect:yt,useLayoutEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useMutableSource:yt,useSyncExternalStore:yt,useId:yt,unstable_isNewReconciler:!1},bk={readContext:vn,useCallback:function(e,t){return Fn().memoizedState=[e,t===void 0?null:t],e},useContext:vn,useEffect:Kv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,vc(4194308,4,hw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vc(4194308,4,e,t)},useInsertionEffect:function(e,t){return vc(4,2,e,t)},useMemo:function(e,t){var n=Fn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yk.bind(null,Xe,e),[r.memoizedState,e]},useRef:function(e){var t=Fn();return e={current:e},t.memoizedState=e},useState:Vv,useDebugValue:dm,useDeferredValue:function(e){return Fn().memoizedState=e},useTransition:function(){var e=Vv(!1),t=e[0];return e=_k.bind(null,e[1]),Fn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Xe,i=Fn();if(qe){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),pt===null)throw Error(ee(349));Ki&30||rw(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Kv(sw.bind(null,r,o,e),[e]),r.flags|=2048,Pa(9,iw.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Fn(),t=pt.identifierPrefix;if(qe){var n=pr,r=fr;n=(r&~(1<<32-Dn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ta++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=vk++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},xk={readContext:vn,useCallback:fw,useContext:vn,useEffect:hm,useImperativeHandle:dw,useInsertionEffect:cw,useLayoutEffect:uw,useMemo:pw,useReducer:Qh,useRef:lw,useState:function(){return Qh(Da)},useDebugValue:dm,useDeferredValue:function(e){var t=_n();return mw(t,at.memoizedState,e)},useTransition:function(){var e=Qh(Da)[0],t=_n().memoizedState;return[e,t]},useMutableSource:tw,useSyncExternalStore:nw,useId:gw,unstable_isNewReconciler:!1},Sk={readContext:vn,useCallback:fw,useContext:vn,useEffect:hm,useImperativeHandle:dw,useInsertionEffect:cw,useLayoutEffect:uw,useMemo:pw,useReducer:Jh,useRef:lw,useState:function(){return Jh(Da)},useDebugValue:dm,useDeferredValue:function(e){var t=_n();return at===null?t.memoizedState=e:mw(t,at.memoizedState,e)},useTransition:function(){var e=Jh(Da)[0],t=_n().memoizedState;return[e,t]},useMutableSource:tw,useSyncExternalStore:nw,useId:gw,unstable_isNewReconciler:!1};function lo(e,t){try{var n="",r=t;do n+=Q5(r),r=r.return;while(r);var i=n}catch(o){i=`
Error generating stack: `+o.message+`
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Zh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function pf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ck=typeof WeakMap=="function"?WeakMap:Map;function ww(e,t,n){n=gr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){nu||(nu=!0,Cf=r),pf(e,t)},n}function bw(e,t,n){n=gr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){pf(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){pf(e,t),typeof r!="function"&&(ni===null?ni=new Set([this]):ni.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function qv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ck;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Bk.bind(null,e,t,n),t.then(e,e))}function Gv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Yv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=gr(-1,1),t.tag=2,ti(n,t,1))),n.lanes|=1),e)}var Ek=kr.ReactCurrentOwner,Ot=!1;function kt(e,t,n,r){t.child=e===null?Zy(t,null,n,r):oo(t,e.child,n,r)}function Xv(e,t,n,r,i){n=n.render;var o=t.ref;return Is(t,i),r=cm(e,t,n,r,o,i),n=um(),e!==null&&!Ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wr(e,t,i)):(qe&&n&&Qp(t),t.flags|=1,kt(e,t,r,i),t.child)}function Qv(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!wm(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,xw(e,t,o,r,i)):(e=bc(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ea,n(a,r)&&e.ref===t.ref)return wr(e,t,i)}return t.flags|=1,e=ii(o,r),e.ref=t.ref,e.return=t,t.child=e}function xw(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Ea(o,r)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Ot=!0);else return t.lanes=e.lanes,wr(e,t,i)}return mf(e,t,n,r,i)}function Sw(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ze(Ts,Vt),Vt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ze(Ts,Vt),Vt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ze(Ts,Vt),Vt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ze(Ts,Vt),Vt|=r;return kt(e,t,i,n),t.child}function Cw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function mf(e,t,n,r,i){var o=Nt(n)?Wi:St.current;return o=io(t,o),Is(t,i),n=cm(e,t,n,r,o,i),r=um(),e!==null&&!Ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wr(e,t,i)):(qe&&r&&Qp(t),t.flags|=1,kt(e,t,n,i),t.child)}function Jv(e,t,n,r,i){if(Nt(n)){var o=!0;Kc(t)}else o=!1;if(Is(t,i),t.stateNode===null)_c(e,t),Qy(t,n,r),ff(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=vn(c):(c=Nt(n)?Wi:St.current,c=io(t,c));var m=n.getDerivedStateFromProps,u=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function";u||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==c)&&Uv(t,a,r,c),Ir=!1;var p=t.memoizedState;a.state=p,Qc(t,r,a,i),l=t.memoizedState,s!==r||p!==l||It.current||Ir?(typeof m=="function"&&(df(t,n,m,r),l=t.memoizedState),(s=Ir||Hv(t,n,s,r,p,l,c))?(u||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Yy(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:kn(t.type,s),a.props=c,u=t.pendingProps,p=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=vn(l):(l=Nt(n)?Wi:St.current,l=io(t,l));var g=n.getDerivedStateFromProps;(m=typeof g=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==u||p!==l)&&Uv(t,a,r,l),Ir=!1,p=t.memoizedState,a.state=p,Qc(t,r,a,i);var y=t.memoizedState;s!==u||p!==y||It.current||Ir?(typeof g=="function"&&(df(t,n,g,r),y=t.memoizedState),(c=Ir||Hv(t,n,c,r,p,y,l)||!1)?(m||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,y,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,y,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),a.props=r,a.state=y,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return gf(e,t,n,r,o,i)}function gf(e,t,n,r,i,o){Cw(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&Nv(t,n,!1),wr(e,t,o);r=t.stateNode,Ek.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=oo(t,e.child,null,o),t.child=oo(t,null,s,o)):kt(e,t,s,o),t.memoizedState=r.state,i&&Nv(t,n,!0),t.child}function Ew(e){var t=e.stateNode;t.pendingContext?Iv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Iv(e,t.context,!1),sm(e,t.containerInfo)}function Zv(e,t,n,r,i){return so(),Zp(i),t.flags|=256,kt(e,t,n,r),t.child}var vf={dehydrated:null,treeContext:null,retryLane:0};function _f(e){return{baseLanes:e,cachePool:null,transitions:null}}function kw(e,t,n){var r=t.pendingProps,i=Ye.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ze(Ye,i&1),e===null)return uf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=Uu(a,r,0,null),e=Hi(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=_f(n),t.memoizedState=vf,e):fm(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return kk(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ii(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=ii(s,o):(o=Hi(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?_f(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=vf,r}return o=e.child,e=o.sibling,r=ii(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function fm(e,t){return t=Uu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function jl(e,t,n,r){return r!==null&&Zp(r),oo(t,e.child,null,n),e=fm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kk(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=Zh(Error(ee(422))),jl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Uu({mode:"visible",children:r.children},i,0,null),o=Hi(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&oo(t,e.child,null,a),t.child.memoizedState=_f(a),t.memoizedState=vf,o);if(!(t.mode&1))return jl(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(ee(419)),r=Zh(o,r,void 0),jl(e,t,a,r)}if(s=(a&e.childLanes)!==0,Ot||s){if(r=pt,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,yr(e,i),Pn(r,e,i,-1))}return ym(),r=Zh(Error(ee(421))),jl(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=jk.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Gt=ei(i.nextSibling),Qt=t,qe=!0,Tn=null,e!==null&&(cn[un++]=fr,cn[un++]=pr,cn[un++]=Vi,fr=e.id,pr=e.overflow,Vi=t),t=fm(t,r.children),t.flags|=4096,t)}function e0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),hf(e.return,t,n)}function ed(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Rw(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(kt(e,t,r.children,n),r=Ye.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&e0(e,n,t);else if(e.tag===19)e0(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ze(Ye,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Jc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ed(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Jc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ed(t,!0,n,null,o);break;case"together":ed(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function _c(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function wr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),qi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Rk(e,t,n){switch(t.tag){case 3:Ew(t),so();break;case 5:ew(t);break;case 1:Nt(t.type)&&Kc(t);break;case 4:sm(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ze(Yc,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ze(Ye,Ye.current&1),t.flags|=128,null):n&t.child.childLanes?kw(e,t,n):(ze(Ye,Ye.current&1),e=wr(e,t,n),e!==null?e.sibling:null);ze(Ye,Ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Rw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ze(Ye,Ye.current),r)break;return null;case 22:case 23:return t.lanes=0,Sw(e,t,n)}return wr(e,t,n)}var Lw,yf,Mw,Aw;Lw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};yf=function(){};Mw=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Mi(Xn.current);var o=null;switch(n){case"input":i=Fd(e,i),r=Fd(e,r),o=[];break;case"select":i=Qe({},i,{value:void 0}),r=Qe({},r,{value:void 0}),o=[];break;case"textarea":i=Ud(e,i),r=Ud(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Wc)}Vd(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var s=i[c];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(_a.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(s=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==s&&(l!=null||s!=null))if(c==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(_a.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&We("scroll",e),o||s===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};Aw=function(e,t,n,r){n!==r&&(t.flags|=4)};function zo(e,t){if(!qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lk(e,t,n){var r=t.pendingProps;switch(Jp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(t),null;case 1:return Nt(t.type)&&Vc(),wt(t),null;case 3:return r=t.stateNode,ao(),Ke(It),Ke(St),am(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Nl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tn!==null&&(Rf(Tn),Tn=null))),yf(e,t),wt(t),null;case 5:om(t);var i=Mi(Aa.current);if(n=t.type,e!==null&&t.stateNode!=null)Mw(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return wt(t),null}if(e=Mi(Xn.current),Nl(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Kn]=t,r[La]=o,e=(t.mode&1)!==0,n){case"dialog":We("cancel",r),We("close",r);break;case"iframe":case"object":case"embed":We("load",r);break;case"video":case"audio":for(i=0;i<ea.length;i++)We(ea[i],r);break;case"source":We("error",r);break;case"img":case"image":case"link":We("error",r),We("load",r);break;case"details":We("toggle",r);break;case"input":cv(r,o),We("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},We("invalid",r);break;case"textarea":hv(r,o),We("invalid",r)}Vd(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&Il(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&Il(r.textContent,s,e),i=["children",""+s]):_a.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&We("scroll",r)}switch(n){case"input":Ll(r),uv(r,o,!0);break;case"textarea":Ll(r),dv(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Wc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ry(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Kn]=t,e[La]=r,Lw(e,t,!1,!1),t.stateNode=e;e:{switch(a=Kd(n,r),n){case"dialog":We("cancel",e),We("close",e),i=r;break;case"iframe":case"object":case"embed":We("load",e),i=r;break;case"video":case"audio":for(i=0;i<ea.length;i++)We(ea[i],e);i=r;break;case"source":We("error",e),i=r;break;case"img":case"image":case"link":We("error",e),We("load",e),i=r;break;case"details":We("toggle",e),i=r;break;case"input":cv(e,r),i=Fd(e,r),We("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Qe({},r,{value:void 0}),We("invalid",e);break;case"textarea":hv(e,r),i=Ud(e,r),We("invalid",e);break;default:i=r}Vd(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?oy(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&iy(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ya(e,l):typeof l=="number"&&ya(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(_a.hasOwnProperty(o)?l!=null&&o==="onScroll"&&We("scroll",e):l!=null&&Np(e,o,l,a))}switch(n){case"input":Ll(e),uv(e,r,!1);break;case"textarea":Ll(e),dv(e);break;case"option":r.value!=null&&e.setAttribute("value",""+si(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Ds(e,!!r.multiple,o,!1):r.defaultValue!=null&&Ds(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Wc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return wt(t),null;case 6:if(e&&t.stateNode!=null)Aw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ee(166));if(n=Mi(Aa.current),Mi(Xn.current),Nl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Kn]=t,(o=r.nodeValue!==n)&&(e=Qt,e!==null))switch(e.tag){case 3:Il(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Il(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Kn]=t,t.stateNode=r}return wt(t),null;case 13:if(Ke(Ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qe&&Gt!==null&&t.mode&1&&!(t.flags&128))qy(),so(),t.flags|=98560,o=!1;else if(o=Nl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(ee(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(ee(317));o[Kn]=t}else so(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wt(t),o=!1}else Tn!==null&&(Rf(Tn),Tn=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ye.current&1?ct===0&&(ct=3):ym())),t.updateQueue!==null&&(t.flags|=4),wt(t),null);case 4:return ao(),yf(e,t),e===null&&ka(t.stateNode.containerInfo),wt(t),null;case 10:return nm(t.type._context),wt(t),null;case 17:return Nt(t.type)&&Vc(),wt(t),null;case 19:if(Ke(Ye),o=t.memoizedState,o===null)return wt(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)zo(o,!1);else{if(ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Jc(e),a!==null){for(t.flags|=128,zo(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ze(Ye,Ye.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ze()>co&&(t.flags|=128,r=!0,zo(o,!1),t.lanes=4194304)}else{if(!r)if(e=Jc(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!qe)return wt(t),null}else 2*Ze()-o.renderingStartTime>co&&n!==1073741824&&(t.flags|=128,r=!0,zo(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ze(),t.sibling=null,n=Ye.current,ze(Ye,r?n&1|2:n&1),t):(wt(t),null);case 22:case 23:return _m(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Vt&1073741824&&(wt(t),t.subtreeFlags&6&&(t.flags|=8192)):wt(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function Mk(e,t){switch(Jp(t),t.tag){case 1:return Nt(t.type)&&Vc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ao(),Ke(It),Ke(St),am(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return om(t),null;case 13:if(Ke(Ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ke(Ye),null;case 4:return ao(),null;case 10:return nm(t.type._context),null;case 22:case 23:return _m(),null;case 24:return null;default:return null}}var Fl=!1,xt=!1,Ak=typeof WeakSet=="function"?WeakSet:Set,oe=null;function As(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Je(e,t,r)}else n.current=null}function wf(e,t,n){try{n()}catch(r){Je(e,t,r)}}var t0=!1;function Tk(e,t){if(nf=zc,e=$y(),Xp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,m=0,u=e,p=null;t:for(;;){for(var g;u!==n||i!==0&&u.nodeType!==3||(s=a+i),u!==o||r!==0&&u.nodeType!==3||(l=a+r),u.nodeType===3&&(a+=u.nodeValue.length),(g=u.firstChild)!==null;)p=u,u=g;for(;;){if(u===e)break t;if(p===n&&++c===i&&(s=a),p===o&&++m===r&&(l=a),(g=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=g}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(rf={focusedElem:e,selectionRange:n},zc=!1,oe=t;oe!==null;)if(t=oe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,oe=e;else for(;oe!==null;){t=oe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var _=y.memoizedProps,h=y.memoizedState,f=t.stateNode,d=f.getSnapshotBeforeUpdate(t.elementType===t.type?_:kn(t.type,_),h);f.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(b){Je(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,oe=e;break}oe=t.return}return y=t0,t0=!1,y}function ha(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&wf(t,n,o)}i=i.next}while(i!==r)}}function zu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function bf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Tw(e){var t=e.alternate;t!==null&&(e.alternate=null,Tw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kn],delete t[La],delete t[af],delete t[fk],delete t[pk])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Dw(e){return e.tag===5||e.tag===3||e.tag===4}function n0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wc));else if(r!==4&&(e=e.child,e!==null))for(xf(e,t,n),e=e.sibling;e!==null;)xf(e,t,n),e=e.sibling}function Sf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Sf(e,t,n),e=e.sibling;e!==null;)Sf(e,t,n),e=e.sibling}var gt=null,Ln=!1;function Mr(e,t,n){for(n=n.child;n!==null;)Pw(e,t,n),n=n.sibling}function Pw(e,t,n){if(Yn&&typeof Yn.onCommitFiberUnmount=="function")try{Yn.onCommitFiberUnmount(Pu,n)}catch{}switch(n.tag){case 5:xt||As(n,t);case 6:var r=gt,i=Ln;gt=null,Mr(e,t,n),gt=r,Ln=i,gt!==null&&(Ln?(e=gt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):gt.removeChild(n.stateNode));break;case 18:gt!==null&&(Ln?(e=gt,n=n.stateNode,e.nodeType===8?qh(e.parentNode,n):e.nodeType===1&&qh(e,n),Sa(e)):qh(gt,n.stateNode));break;case 4:r=gt,i=Ln,gt=n.stateNode.containerInfo,Ln=!0,Mr(e,t,n),gt=r,Ln=i;break;case 0:case 11:case 14:case 15:if(!xt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&wf(n,t,a),i=i.next}while(i!==r)}Mr(e,t,n);break;case 1:if(!xt&&(As(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Je(n,t,s)}Mr(e,t,n);break;case 21:Mr(e,t,n);break;case 22:n.mode&1?(xt=(r=xt)||n.memoizedState!==null,Mr(e,t,n),xt=r):Mr(e,t,n);break;default:Mr(e,t,n)}}function r0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ak),t.forEach(function(r){var i=Fk.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function En(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:gt=s.stateNode,Ln=!1;break e;case 3:gt=s.stateNode.containerInfo,Ln=!0;break e;case 4:gt=s.stateNode.containerInfo,Ln=!0;break e}s=s.return}if(gt===null)throw Error(ee(160));Pw(o,a,i),gt=null,Ln=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Je(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$w(t,e),t=t.sibling}function $w(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(En(t,e),jn(e),r&4){try{ha(3,e,e.return),zu(3,e)}catch(_){Je(e,e.return,_)}try{ha(5,e,e.return)}catch(_){Je(e,e.return,_)}}break;case 1:En(t,e),jn(e),r&512&&n!==null&&As(n,n.return);break;case 5:if(En(t,e),jn(e),r&512&&n!==null&&As(n,n.return),e.flags&32){var i=e.stateNode;try{ya(i,"")}catch(_){Je(e,e.return,_)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&ty(i,o),Kd(s,a);var c=Kd(s,o);for(a=0;a<l.length;a+=2){var m=l[a],u=l[a+1];m==="style"?oy(i,u):m==="dangerouslySetInnerHTML"?iy(i,u):m==="children"?ya(i,u):Np(i,m,u,c)}switch(s){case"input":zd(i,o);break;case"textarea":ny(i,o);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?Ds(i,!!o.multiple,g,!1):p!==!!o.multiple&&(o.defaultValue!=null?Ds(i,!!o.multiple,o.defaultValue,!0):Ds(i,!!o.multiple,o.multiple?[]:"",!1))}i[La]=o}catch(_){Je(e,e.return,_)}}break;case 6:if(En(t,e),jn(e),r&4){if(e.stateNode===null)throw Error(ee(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(_){Je(e,e.return,_)}}break;case 3:if(En(t,e),jn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Sa(t.containerInfo)}catch(_){Je(e,e.return,_)}break;case 4:En(t,e),jn(e);break;case 13:En(t,e),jn(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(gm=Ze())),r&4&&r0(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(xt=(c=xt)||m,En(t,e),xt=c):En(t,e),jn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!m&&e.mode&1)for(oe=e,m=e.child;m!==null;){for(u=oe=m;oe!==null;){switch(p=oe,g=p.child,p.tag){case 0:case 11:case 14:case 15:ha(4,p,p.return);break;case 1:As(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(_){Je(r,n,_)}}break;case 5:As(p,p.return);break;case 22:if(p.memoizedState!==null){s0(u);continue}}g!==null?(g.return=p,oe=g):s0(u)}m=m.sibling}e:for(m=null,u=e;;){if(u.tag===5){if(m===null){m=u;try{i=u.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=u.stateNode,l=u.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=sy("display",a))}catch(_){Je(e,e.return,_)}}}else if(u.tag===6){if(m===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(_){Je(e,e.return,_)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;m===u&&(m=null),u=u.return}m===u&&(m=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:En(t,e),jn(e),r&4&&r0(e);break;case 21:break;default:En(t,e),jn(e)}}function jn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Dw(n)){var r=n;break e}n=n.return}throw Error(ee(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ya(i,""),r.flags&=-33);var o=n0(e);Sf(e,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,s=n0(e);xf(e,s,a);break;default:throw Error(ee(161))}}catch(l){Je(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dk(e,t,n){oe=e,Ow(e)}function Ow(e,t,n){for(var r=(e.mode&1)!==0;oe!==null;){var i=oe,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Fl;if(!a){var s=i.alternate,l=s!==null&&s.memoizedState!==null||xt;s=Fl;var c=xt;if(Fl=a,(xt=l)&&!c)for(oe=i;oe!==null;)a=oe,l=a.child,a.tag===22&&a.memoizedState!==null?o0(i):l!==null?(l.return=a,oe=l):o0(i);for(;o!==null;)oe=o,Ow(o),o=o.sibling;oe=i,Fl=s,xt=c}i0(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,oe=o):i0(e)}}function i0(e){for(;oe!==null;){var t=oe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:xt||zu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!xt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:kn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&zv(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}zv(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var m=c.memoizedState;if(m!==null){var u=m.dehydrated;u!==null&&Sa(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ee(163))}xt||t.flags&512&&bf(t)}catch(p){Je(t,t.return,p)}}if(t===e){oe=null;break}if(n=t.sibling,n!==null){n.return=t.return,oe=n;break}oe=t.return}}function s0(e){for(;oe!==null;){var t=oe;if(t===e){oe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,oe=n;break}oe=t.return}}function o0(e){for(;oe!==null;){var t=oe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{zu(4,t)}catch(l){Je(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Je(t,i,l)}}var o=t.return;try{bf(t)}catch(l){Je(t,o,l)}break;case 5:var a=t.return;try{bf(t)}catch(l){Je(t,a,l)}}}catch(l){Je(t,t.return,l)}if(t===e){oe=null;break}var s=t.sibling;if(s!==null){s.return=t.return,oe=s;break}oe=t.return}}var Pk=Math.ceil,tu=kr.ReactCurrentDispatcher,pm=kr.ReactCurrentOwner,pn=kr.ReactCurrentBatchConfig,Te=0,pt=null,tt=null,vt=0,Vt=0,Ts=fi(0),ct=0,$a=null,qi=0,Hu=0,mm=0,da=null,$t=null,gm=0,co=1/0,lr=null,nu=!1,Cf=null,ni=null,zl=!1,Yr=null,ru=0,fa=0,Ef=null,yc=-1,wc=0;function Rt(){return Te&6?Ze():yc!==-1?yc:yc=Ze()}function ri(e){return e.mode&1?Te&2&&vt!==0?vt&-vt:gk.transition!==null?(wc===0&&(wc=_y()),wc):(e=Ie,e!==0||(e=window.event,e=e===void 0?16:Ey(e.type)),e):1}function Pn(e,t,n,r){if(50<fa)throw fa=0,Ef=null,Error(ee(185));rl(e,n,r),(!(Te&2)||e!==pt)&&(e===pt&&(!(Te&2)&&(Hu|=n),ct===4&&Br(e,vt)),Bt(e,r),n===1&&Te===0&&!(t.mode&1)&&(co=Ze()+500,Bu&&pi()))}function Bt(e,t){var n=e.callbackNode;gE(e,t);var r=Fc(e,e===pt?vt:0);if(r===0)n!==null&&mv(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&mv(n),t===1)e.tag===0?mk(a0.bind(null,e)):Wy(a0.bind(null,e)),hk(function(){!(Te&6)&&pi()}),n=null;else{switch(yy(r)){case 1:n=Hp;break;case 4:n=gy;break;case 16:n=jc;break;case 536870912:n=vy;break;default:n=jc}n=Uw(n,Iw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Iw(e,t){if(yc=-1,wc=0,Te&6)throw Error(ee(327));var n=e.callbackNode;if(Ns()&&e.callbackNode!==n)return null;var r=Fc(e,e===pt?vt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=iu(e,r);else{t=r;var i=Te;Te|=2;var o=Bw();(pt!==e||vt!==t)&&(lr=null,co=Ze()+500,zi(e,t));do try{Ik();break}catch(s){Nw(e,s)}while(!0);tm(),tu.current=o,Te=i,tt!==null?t=0:(pt=null,vt=0,t=ct)}if(t!==0){if(t===2&&(i=Qd(e),i!==0&&(r=i,t=kf(e,i))),t===1)throw n=$a,zi(e,0),Br(e,r),Bt(e,Ze()),n;if(t===6)Br(e,r);else{if(i=e.current.alternate,!(r&30)&&!$k(i)&&(t=iu(e,r),t===2&&(o=Qd(e),o!==0&&(r=o,t=kf(e,o))),t===1))throw n=$a,zi(e,0),Br(e,r),Bt(e,Ze()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ee(345));case 2:xi(e,$t,lr);break;case 3:if(Br(e,r),(r&130023424)===r&&(t=gm+500-Ze(),10<t)){if(Fc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Rt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=of(xi.bind(null,e,$t,lr),t);break}xi(e,$t,lr);break;case 4:if(Br(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-Dn(r);o=1<<a,a=t[a],a>i&&(i=a),r&=~o}if(r=i,r=Ze()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Pk(r/1960))-r,10<r){e.timeoutHandle=of(xi.bind(null,e,$t,lr),r);break}xi(e,$t,lr);break;case 5:xi(e,$t,lr);break;default:throw Error(ee(329))}}}return Bt(e,Ze()),e.callbackNode===n?Iw.bind(null,e):null}function kf(e,t){var n=da;return e.current.memoizedState.isDehydrated&&(zi(e,t).flags|=256),e=iu(e,t),e!==2&&(t=$t,$t=n,t!==null&&Rf(t)),e}function Rf(e){$t===null?$t=e:$t.push.apply($t,e)}function $k(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!In(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Br(e,t){for(t&=~mm,t&=~Hu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Dn(t),r=1<<n;e[n]=-1,t&=~r}}function a0(e){if(Te&6)throw Error(ee(327));Ns();var t=Fc(e,0);if(!(t&1))return Bt(e,Ze()),null;var n=iu(e,t);if(e.tag!==0&&n===2){var r=Qd(e);r!==0&&(t=r,n=kf(e,r))}if(n===1)throw n=$a,zi(e,0),Br(e,t),Bt(e,Ze()),n;if(n===6)throw Error(ee(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xi(e,$t,lr),Bt(e,Ze()),null}function vm(e,t){var n=Te;Te|=1;try{return e(t)}finally{Te=n,Te===0&&(co=Ze()+500,Bu&&pi())}}function Gi(e){Yr!==null&&Yr.tag===0&&!(Te&6)&&Ns();var t=Te;Te|=1;var n=pn.transition,r=Ie;try{if(pn.transition=null,Ie=1,e)return e()}finally{Ie=r,pn.transition=n,Te=t,!(Te&6)&&pi()}}function _m(){Vt=Ts.current,Ke(Ts)}function zi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,uk(n)),tt!==null)for(n=tt.return;n!==null;){var r=n;switch(Jp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Vc();break;case 3:ao(),Ke(It),Ke(St),am();break;case 5:om(r);break;case 4:ao();break;case 13:Ke(Ye);break;case 19:Ke(Ye);break;case 10:nm(r.type._context);break;case 22:case 23:_m()}n=n.return}if(pt=e,tt=e=ii(e.current,null),vt=Vt=t,ct=0,$a=null,mm=Hu=qi=0,$t=da=null,Li!==null){for(t=0;t<Li.length;t++)if(n=Li[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}Li=null}return e}function Nw(e,t){do{var n=tt;try{if(tm(),gc.current=eu,Zc){for(var r=Xe.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Zc=!1}if(Ki=0,ft=at=Xe=null,ua=!1,Ta=0,pm.current=null,n===null||n.return===null){ct=1,$a=t,tt=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=vt,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,m=s,u=m.tag;if(!(m.mode&1)&&(u===0||u===11||u===15)){var p=m.alternate;p?(m.updateQueue=p.updateQueue,m.memoizedState=p.memoizedState,m.lanes=p.lanes):(m.updateQueue=null,m.memoizedState=null)}var g=Gv(a);if(g!==null){g.flags&=-257,Yv(g,a,s,o,t),g.mode&1&&qv(o,c,t),t=g,l=c;var y=t.updateQueue;if(y===null){var _=new Set;_.add(l),t.updateQueue=_}else y.add(l);break e}else{if(!(t&1)){qv(o,c,t),ym();break e}l=Error(ee(426))}}else if(qe&&s.mode&1){var h=Gv(a);if(h!==null){!(h.flags&65536)&&(h.flags|=256),Yv(h,a,s,o,t),Zp(lo(l,s));break e}}o=l=lo(l,s),ct!==4&&(ct=2),da===null?da=[o]:da.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var f=ww(o,l,t);Fv(o,f);break e;case 1:s=l;var d=o.type,v=o.stateNode;if(!(o.flags&128)&&(typeof d.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ni===null||!ni.has(v)))){o.flags|=65536,t&=-t,o.lanes|=t;var b=bw(o,s,t);Fv(o,b);break e}}o=o.return}while(o!==null)}Fw(n)}catch(E){t=E,tt===n&&n!==null&&(tt=n=n.return);continue}break}while(!0)}function Bw(){var e=tu.current;return tu.current=eu,e===null?eu:e}function ym(){(ct===0||ct===3||ct===2)&&(ct=4),pt===null||!(qi&268435455)&&!(Hu&268435455)||Br(pt,vt)}function iu(e,t){var n=Te;Te|=2;var r=Bw();(pt!==e||vt!==t)&&(lr=null,zi(e,t));do try{Ok();break}catch(i){Nw(e,i)}while(!0);if(tm(),Te=n,tu.current=r,tt!==null)throw Error(ee(261));return pt=null,vt=0,ct}function Ok(){for(;tt!==null;)jw(tt)}function Ik(){for(;tt!==null&&!aE();)jw(tt)}function jw(e){var t=Hw(e.alternate,e,Vt);e.memoizedProps=e.pendingProps,t===null?Fw(e):tt=t,pm.current=null}function Fw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Mk(n,t),n!==null){n.flags&=32767,tt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ct=6,tt=null;return}}else if(n=Lk(n,t,Vt),n!==null){tt=n;return}if(t=t.sibling,t!==null){tt=t;return}tt=t=e}while(t!==null);ct===0&&(ct=5)}function xi(e,t,n){var r=Ie,i=pn.transition;try{pn.transition=null,Ie=1,Nk(e,t,n,r)}finally{pn.transition=i,Ie=r}return null}function Nk(e,t,n,r){do Ns();while(Yr!==null);if(Te&6)throw Error(ee(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ee(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(vE(e,o),e===pt&&(tt=pt=null,vt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||zl||(zl=!0,Uw(jc,function(){return Ns(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=pn.transition,pn.transition=null;var a=Ie;Ie=1;var s=Te;Te|=4,pm.current=null,Tk(e,n),$w(n,e),rk(rf),zc=!!nf,rf=nf=null,e.current=n,Dk(n),lE(),Te=s,Ie=a,pn.transition=o}else e.current=n;if(zl&&(zl=!1,Yr=e,ru=i),o=e.pendingLanes,o===0&&(ni=null),hE(n.stateNode),Bt(e,Ze()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(nu)throw nu=!1,e=Cf,Cf=null,e;return ru&1&&e.tag!==0&&Ns(),o=e.pendingLanes,o&1?e===Ef?fa++:(fa=0,Ef=e):fa=0,pi(),null}function Ns(){if(Yr!==null){var e=yy(ru),t=pn.transition,n=Ie;try{if(pn.transition=null,Ie=16>e?16:e,Yr===null)var r=!1;else{if(e=Yr,Yr=null,ru=0,Te&6)throw Error(ee(331));var i=Te;for(Te|=4,oe=e.current;oe!==null;){var o=oe,a=o.child;if(oe.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l<s.length;l++){var c=s[l];for(oe=c;oe!==null;){var m=oe;switch(m.tag){case 0:case 11:case 15:ha(8,m,o)}var u=m.child;if(u!==null)u.return=m,oe=u;else for(;oe!==null;){m=oe;var p=m.sibling,g=m.return;if(Tw(m),m===c){oe=null;break}if(p!==null){p.return=g,oe=p;break}oe=g}}}var y=o.alternate;if(y!==null){var _=y.child;if(_!==null){y.child=null;do{var h=_.sibling;_.sibling=null,_=h}while(_!==null)}}oe=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,oe=a;else e:for(;oe!==null;){if(o=oe,o.flags&2048)switch(o.tag){case 0:case 11:case 15:ha(9,o,o.return)}var f=o.sibling;if(f!==null){f.return=o.return,oe=f;break e}oe=o.return}}var d=e.current;for(oe=d;oe!==null;){a=oe;var v=a.child;if(a.subtreeFlags&2064&&v!==null)v.return=a,oe=v;else e:for(a=d;oe!==null;){if(s=oe,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:zu(9,s)}}catch(E){Je(s,s.return,E)}if(s===a){oe=null;break e}var b=s.sibling;if(b!==null){b.return=s.return,oe=b;break e}oe=s.return}}if(Te=i,pi(),Yn&&typeof Yn.onPostCommitFiberRoot=="function")try{Yn.onPostCommitFiberRoot(Pu,e)}catch{}r=!0}return r}finally{Ie=n,pn.transition=t}}return!1}function l0(e,t,n){t=lo(n,t),t=ww(e,t,1),e=ti(e,t,1),t=Rt(),e!==null&&(rl(e,1,t),Bt(e,t))}function Je(e,t,n){if(e.tag===3)l0(e,e,n);else for(;t!==null;){if(t.tag===3){l0(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ni===null||!ni.has(r))){e=lo(n,e),e=bw(t,e,1),t=ti(t,e,1),e=Rt(),t!==null&&(rl(t,1,e),Bt(t,e));break}}t=t.return}}function Bk(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Rt(),e.pingedLanes|=e.suspendedLanes&n,pt===e&&(vt&n)===n&&(ct===4||ct===3&&(vt&130023424)===vt&&500>Ze()-gm?zi(e,0):mm|=n),Bt(e,t)}function zw(e,t){t===0&&(e.mode&1?(t=Tl,Tl<<=1,!(Tl&130023424)&&(Tl=4194304)):t=1);var n=Rt();e=yr(e,t),e!==null&&(rl(e,t,n),Bt(e,n))}function jk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zw(e,n)}function Fk(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ee(314))}r!==null&&r.delete(t),zw(e,n)}var Hw;Hw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||It.current)Ot=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ot=!1,Rk(e,t,n);Ot=!!(e.flags&131072)}else Ot=!1,qe&&t.flags&1048576&&Vy(t,Gc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_c(e,t),e=t.pendingProps;var i=io(t,St.current);Is(t,n),i=cm(null,t,r,e,i,n);var o=um();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Nt(r)?(o=!0,Kc(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,im(t),i.updater=ju,t.stateNode=i,i._reactInternals=t,ff(t,r,e,n),t=gf(null,t,r,!0,o,n)):(t.tag=0,qe&&o&&Qp(t),kt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_c(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Hk(r),e=kn(r,e),i){case 0:t=mf(null,t,r,e,n);break e;case 1:t=Jv(null,t,r,e,n);break e;case 11:t=Xv(null,t,r,e,n);break e;case 14:t=Qv(null,t,r,kn(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kn(r,i),mf(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kn(r,i),Jv(e,t,r,i,n);case 3:e:{if(Ew(t),e===null)throw Error(ee(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Yy(e,t),Qc(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=lo(Error(ee(423)),t),t=Zv(e,t,r,n,i);break e}else if(r!==i){i=lo(Error(ee(424)),t),t=Zv(e,t,r,n,i);break e}else for(Gt=ei(t.stateNode.containerInfo.firstChild),Qt=t,qe=!0,Tn=null,n=Zy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===i){t=wr(e,t,n);break e}kt(e,t,r,n)}t=t.child}return t;case 5:return ew(t),e===null&&uf(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,sf(r,i)?a=null:o!==null&&sf(r,o)&&(t.flags|=32),Cw(e,t),kt(e,t,a,n),t.child;case 6:return e===null&&uf(t),null;case 13:return kw(e,t,n);case 4:return sm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oo(t,null,r,n):kt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kn(r,i),Xv(e,t,r,i,n);case 7:return kt(e,t,t.pendingProps,n),t.child;case 8:return kt(e,t,t.pendingProps.children,n),t.child;case 12:return kt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,ze(Yc,r._currentValue),r._currentValue=a,o!==null)if(In(o.value,a)){if(o.children===i.children&&!It.current){t=wr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=gr(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var m=c.pending;m===null?l.next=l:(l.next=m.next,m.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),hf(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(ee(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),hf(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}kt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Is(t,n),i=vn(i),r=r(i),t.flags|=1,kt(e,t,r,n),t.child;case 14:return r=t.type,i=kn(r,t.pendingProps),i=kn(r.type,i),Qv(e,t,r,i,n);case 15:return xw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kn(r,i),_c(e,t),t.tag=1,Nt(r)?(e=!0,Kc(t)):e=!1,Is(t,n),Qy(t,r,i),ff(t,r,i,n),gf(null,t,r,!0,e,n);case 19:return Rw(e,t,n);case 22:return Sw(e,t,n)}throw Error(ee(156,t.tag))};function Uw(e,t){return my(e,t)}function zk(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,t,n,r){return new zk(e,t,n,r)}function wm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hk(e){if(typeof e=="function")return wm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===jp)return 11;if(e===Fp)return 14}return 2}function ii(e,t){var n=e.alternate;return n===null?(n=fn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function bc(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")wm(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case bs:return Hi(n.children,i,o,t);case Bp:a=8,i|=8;break;case Id:return e=fn(12,n,t,i|2),e.elementType=Id,e.lanes=o,e;case Nd:return e=fn(13,n,t,i),e.elementType=Nd,e.lanes=o,e;case Bd:return e=fn(19,n,t,i),e.elementType=Bd,e.lanes=o,e;case J1:return Uu(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X1:a=10;break e;case Q1:a=9;break e;case jp:a=11;break e;case Fp:a=14;break e;case Or:a=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=fn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Hi(e,t,n,r){return e=fn(7,e,r,t),e.lanes=n,e}function Uu(e,t,n,r){return e=fn(22,e,r,t),e.elementType=J1,e.lanes=n,e.stateNode={isHidden:!1},e}function td(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function nd(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Uk(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ih(0),this.expirationTimes=Ih(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ih(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bm(e,t,n,r,i,o,a,s,l){return e=new Uk(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=fn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},im(o),e}function Wk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ws,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Ww(e){if(!e)return oi;e=e._reactInternals;e:{if(es(e)!==e||e.tag!==1)throw Error(ee(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Nt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ee(171))}if(e.tag===1){var n=e.type;if(Nt(n))return Uy(e,n,t)}return t}function Vw(e,t,n,r,i,o,a,s,l){return e=bm(n,r,!0,e,i,o,a,s,l),e.context=Ww(null),n=e.current,r=Rt(),i=ri(n),o=gr(r,i),o.callback=t??null,ti(n,o,i),e.current.lanes=i,rl(e,i,r),Bt(e,r),e}function Wu(e,t,n,r){var i=t.current,o=Rt(),a=ri(i);return n=Ww(n),t.context===null?t.context=n:t.pendingContext=n,t=gr(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ti(i,t,a),e!==null&&(Pn(e,i,a,o),mc(e,i,a)),a}function su(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function c0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xm(e,t){c0(e,t),(e=e.alternate)&&c0(e,t)}function Vk(){return null}var Kw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Sm(e){this._internalRoot=e}Vu.prototype.render=Sm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));Wu(e,t,null,null)};Vu.prototype.unmount=Sm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Gi(function(){Wu(null,e,null,null)}),t[_r]=null}};function Vu(e){this._internalRoot=e}Vu.prototype.unstable_scheduleHydration=function(e){if(e){var t=xy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nr.length&&t!==0&&t<Nr[n].priority;n++);Nr.splice(n,0,e),n===0&&Cy(e)}};function Cm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ku(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function u0(){}function Kk(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=su(a);o.call(c)}}var a=Vw(t,r,e,0,null,!1,!1,"",u0);return e._reactRootContainer=a,e[_r]=a.current,ka(e.nodeType===8?e.parentNode:e),Gi(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var c=su(l);s.call(c)}}var l=bm(e,0,!1,null,null,!1,!1,"",u0);return e._reactRootContainer=l,e[_r]=l.current,ka(e.nodeType===8?e.parentNode:e),Gi(function(){Wu(t,l,n,r)}),l}function qu(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var l=su(a);s.call(l)}}Wu(t,a,e,i)}else a=Kk(n,t,e,i,r);return su(a)}wy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zo(t.pendingLanes);n!==0&&(Up(t,n|1),Bt(t,Ze()),!(Te&6)&&(co=Ze()+500,pi()))}break;case 13:Gi(function(){var r=yr(e,1);if(r!==null){var i=Rt();Pn(r,e,1,i)}}),xm(e,1)}};Wp=function(e){if(e.tag===13){var t=yr(e,134217728);if(t!==null){var n=Rt();Pn(t,e,134217728,n)}xm(e,134217728)}};by=function(e){if(e.tag===13){var t=ri(e),n=yr(e,t);if(n!==null){var r=Rt();Pn(n,e,t,r)}xm(e,t)}};xy=function(){return Ie};Sy=function(e,t){var n=Ie;try{return Ie=e,t()}finally{Ie=n}};Gd=function(e,t,n){switch(t){case"input":if(zd(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Nu(r);if(!i)throw Error(ee(90));ey(r),zd(r,i)}}}break;case"textarea":ny(e,n);break;case"select":t=n.value,t!=null&&Ds(e,!!n.multiple,t,!1)}};cy=vm;uy=Gi;var qk={usingClientEntryPoint:!1,Events:[sl,Es,Nu,ay,ly,vm]},Ho={findFiberByHostInstance:Ri,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},Gk={bundleType:Ho.bundleType,version:Ho.version,rendererPackageName:Ho.rendererPackageName,rendererConfig:Ho.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:kr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=fy(e),e===null?null:e.stateNode},findFiberByHostInstance:Ho.findFiberByHostInstance||Vk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hl.isDisabled&&Hl.supportsFiber)try{Pu=Hl.inject(Gk),Yn=Hl}catch{}}tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qk;tn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Cm(t))throw Error(ee(200));return Wk(e,t,null,n)};tn.createRoot=function(e,t){if(!Cm(e))throw Error(ee(299));var n=!1,r="",i=Kw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=bm(e,1,!1,null,null,n,!1,r,i),e[_r]=t.current,ka(e.nodeType===8?e.parentNode:e),new Sm(t)};tn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=fy(t),e=e===null?null:e.stateNode,e};tn.flushSync=function(e){return Gi(e)};tn.hydrate=function(e,t,n){if(!Ku(t))throw Error(ee(200));return qu(null,e,t,!0,n)};tn.hydrateRoot=function(e,t,n){if(!Cm(e))throw Error(ee(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=Kw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Vw(t,null,e,1,n??null,i,!1,o,a),e[_r]=t.current,ka(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Vu(t)};tn.render=function(e,t,n){if(!Ku(t))throw Error(ee(200));return qu(null,e,t,!1,n)};tn.unmountComponentAtNode=function(e){if(!Ku(e))throw Error(ee(40));return e._reactRootContainer?(Gi(function(){qu(null,null,e,!1,function(){e._reactRootContainer=null,e[_r]=null})}),!0):!1};tn.unstable_batchedUpdates=vm;tn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ku(n))throw Error(ee(200));if(e==null||e._reactInternals===void 0)throw Error(ee(38));return qu(e,t,n,!1,r)};tn.version="18.2.0-next-9e3b772b8-20220608";function qw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qw)}catch(e){console.error(e)}}qw(),V1.exports=tn;var mi=V1.exports;const Gw=Tu(mi);var h0=mi;$d.createRoot=h0.createRoot,$d.hydrateRoot=h0.hydrateRoot;function Yi(e,t,n,r){const i=x.useRef(t);Yk(()=>{i.current=t},[t]),x.useEffect(()=>{var o;const a=(o=n==null?void 0:n.current)!==null&&o!==void 0?o:window;if(!(a&&a.addEventListener))return;const s=l=>i.current(l);return a.addEventListener(e,s,r),()=>{a.removeEventListener(e,s,r)}},[e,n,r])}const Yk=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Xk(e,t,n="mousedown"){Yi(n,r=>{const i=e==null?void 0:e.current;!i||i.contains(r.target)||t(r)})}var Yw={exports:{}},Xw={};/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var uo=x;function Qk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jk=typeof Object.is=="function"?Object.is:Qk,Zk=uo.useState,e3=uo.useEffect,t3=uo.useLayoutEffect,n3=uo.useDebugValue;function r3(e,t){var n=t(),r=Zk({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return t3(function(){i.value=n,i.getSnapshot=t,rd(i)&&o({inst:i})},[e,n,t]),e3(function(){return rd(i)&&o({inst:i}),e(function(){rd(i)&&o({inst:i})})},[e]),n3(n),n}function rd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jk(e,n)}catch{return!0}}function i3(e,t){return t()}var s3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i3:r3;Xw.useSyncExternalStore=uo.useSyncExternalStore!==void 0?uo.useSyncExternalStore:s3;Yw.exports=Xw;var o3=Yw.exports;const{useEffect:a3,useLayoutEffect:l3,useRef:c3,useInsertionEffect:u3}=H1,h3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d3=h3?l3:a3,f3=u3||d3,Qw=e=>{const t=c3([e,(...n)=>t[0](...n)]).current;return f3(()=>{t[0]=e}),t[1]},p3=(e="",t=location.pathname)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",m3=(e,t="")=>e[0]==="~"?e.slice(1):t+e,g3="popstate",Em="pushState",km="replaceState",v3="hashchange",d0=[g3,Em,km,v3],_3=e=>{for(const t of d0)addEventListener(t,e);return()=>{for(const t of d0)removeEventListener(t,e)}},y3=(e,t)=>o3.useSyncExternalStore(_3,e,t),f0=()=>location.pathname,w3=({ssrPath:e}={})=>y3(f0,e?()=>e:f0),Rm=(e,{replace:t=!1}={})=>history[t?km:Em](null,"",e),b3=(e={})=>[p3(e.base,w3(e)),Qw((t,n)=>Rm(m3(t,e.base),n))];if(typeof history<"u")for(const e of[Em,km]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}function x3(e=C3){let t={};const n=r=>t[r]||(t[r]=e(r));return(r,i)=>{const{regexp:o,keys:a}=n(r||""),s=o.exec(i);return s?[!0,a.reduce((c,m,u)=>(c[m.name]=s[u+1],c),{})]:[!1,null]}}const p0=e=>e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),S3=(e,t,n)=>{let r=e?"((?:[^\\/]+?)(?:\\/(?:[^\\/]+?))*)":"([^\\/]+?)";return t&&n&&(r="(?:\\/"+r+")"),r+(t?"?":"")},C3=e=>{const t=/:([A-Za-z0-9_]+)([?+*]?)/g;let n=null,r=0,i=[],o="";for(;(n=t.exec(e))!==null;){const[a,s,l]=n,c=l==="+"||l==="*",m=l==="?"||l==="*",u=m&&e[n.index-1]==="/"?1:0,p=e.substring(r,n.index-u);i.push({name:s}),r=t.lastIndex,o+=p0(p)+S3(c,m,u)}return o+=p0(e.substring(r)),{keys:i,regexp:new RegExp("^"+o+"(?:\\/)?$","i")}},E3={hook:b3,matcher:x3(),base:""},k3=x.createContext(E3),Gu=()=>x.useContext(k3),Yu=e=>e.hook(e),al=()=>Yu(Gu()),ll=e=>{const t=Gu(),[n]=Yu(t);return t.matcher(e,n)},R3=x.createContext({params:{}}),m0=(e,t)=>x.createElement(R3.Provider,{value:{params:e},children:t}),Ci=({path:e,match:t,component:n,children:r})=>{const i=ll(e),[o,a]=t||i;return o?n?m0(a,x.createElement(n,{params:a})):m0(a,typeof r=="function"?r(a):r):null},Lm=x.forwardRef((e,t)=>{const n=Gu(),[,r]=Yu(n),{to:i,href:o=i,children:a,onClick:s}=e,l=Qw(u=>{u.ctrlKey||u.metaKey||u.altKey||u.shiftKey||u.button!==0||(s&&s(u),u.defaultPrevented||(u.preventDefault(),r(i||o,e)))}),c={href:o[0]==="~"?o.slice(1):n.base+o,onClick:l,to:null,ref:t},m=x.isValidElement(a)?a:x.createElement("a",e);return x.cloneElement(m,c)}),Lf=e=>Array.isArray(e)?[].concat(...e.map(t=>t&&t.type===x.Fragment?Lf(t.props.children):Lf(t))):[e],Jw=({children:e,location:t})=>{const n=Gu(),r=n.matcher,[i]=Yu(n);for(const o of Lf(e)){let a=0;if(x.isValidElement(o)&&(a=o.props.path?r(o.props.path,t||i):[!0,{}])[0])return x.cloneElement(o,{match:a})}return null};function Zw(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=Zw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function L3(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Zw(e))&&(r&&(r+=" "),r+=t);return r}const Mm="-";function M3(e){const t=T3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(a){const s=a.split(Mm);return s[0]===""&&s.length!==1&&s.shift(),eb(s,t)||A3(a)}function o(a,s){const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function eb(e,t){var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?eb(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Mm);return(a=t.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId}const g0=/^\[(.+)\]$/;function A3(e){if(g0.test(e)){const t=g0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function T3(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return P3(Object.entries(e.classGroups),n).forEach(([o,a])=>{Mf(a,r,o,t)}),r}function Mf(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:v0(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(D3(i)){Mf(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{Mf(a,v0(t,o),n,r)})})}function v0(e,t){let n=e;return t.split(Mm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function D3(e){return e.isThemeGetter}function P3(e,t){return t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e}function $3(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(o,a){n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}}const tb="!";function O3(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(a){const s=[];let l=0,c=0,m;for(let _=0;_<a.length;_++){let h=a[_];if(l===0){if(h===r&&(n||a.slice(_,_+i)===t)){s.push(a.slice(c,_)),c=_+i;continue}if(h==="/"){m=_;continue}}h==="["?l++:h==="]"&&l--}const u=s.length===0?a:a.substring(c),p=u.startsWith(tb),g=p?u.substring(1):u,y=m&&m>c?m-c:void 0;return{modifiers:s,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}}}function I3(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function N3(e){return{cache:$3(e.cacheSize),splitModifiers:O3(e),...M3(e)}}const B3=/\s+/;function j3(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=new Set;return e.trim().split(B3).map(a=>{const{modifiers:s,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:m}=n(a);let u=r(m?c.substring(0,m):c),p=!!m;if(!u){if(!m)return{isTailwindClass:!1,originalClassName:a};if(u=r(c),!u)return{isTailwindClass:!1,originalClassName:a};p=!1}const g=I3(s).join(":");return{isTailwindClass:!0,modifierId:l?g+tb:g,classGroupId:u,originalClassName:a,hasPostfixModifier:p}}).reverse().filter(a=>{if(!a.isTailwindClass)return!0;const{modifierId:s,classGroupId:l,hasPostfixModifier:c}=a,m=s+l;return o.has(m)?!1:(o.add(m),i(l,c).forEach(u=>o.add(s+u)),!0)}).reverse().map(a=>a.originalClassName).join(" ")}function F3(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=nb(t))&&(r&&(r+=" "),r+=n);return r}function nb(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=nb(e[r]))&&(n&&(n+=" "),n+=t);return n}function z3(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((m,u)=>u(m),e());return n=N3(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const m=j3(l,n);return i(l,m),m}return function(){return o(F3.apply(null,arguments))}}function Ue(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const rb=/^\[(?:([a-z-]+):)?(.+)\]$/i,H3=/^\d+\/\d+$/,U3=new Set(["px","full","screen"]),W3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V3=/\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$/,K3=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,q3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function sr(e){return Ai(e)||U3.has(e)||H3.test(e)}function Ar(e){return wo(e,"length",t4)}function Ai(e){return!!e&&!Number.isNaN(Number(e))}function Ul(e){return wo(e,"number",Ai)}function Uo(e){return!!e&&Number.isInteger(Number(e))}function G3(e){return e.endsWith("%")&&Ai(e.slice(0,-1))}function be(e){return rb.test(e)}function Tr(e){return W3.test(e)}const Y3=new Set(["length","size","percentage"]);function X3(e){return wo(e,Y3,ib)}function Q3(e){return wo(e,"position",ib)}const J3=new Set(["image","url"]);function Z3(e){return wo(e,J3,r4)}function e4(e){return wo(e,"",n4)}function Wo(){return!0}function wo(e,t,n){const r=rb.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function t4(e){return V3.test(e)}function ib(){return!1}function n4(e){return K3.test(e)}function r4(e){return q3.test(e)}function i4(){const e=Ue("colors"),t=Ue("spacing"),n=Ue("blur"),r=Ue("brightness"),i=Ue("borderColor"),o=Ue("borderRadius"),a=Ue("borderSpacing"),s=Ue("borderWidth"),l=Ue("contrast"),c=Ue("grayscale"),m=Ue("hueRotate"),u=Ue("invert"),p=Ue("gap"),g=Ue("gradientColorStops"),y=Ue("gradientColorStopPositions"),_=Ue("inset"),h=Ue("margin"),f=Ue("opacity"),d=Ue("padding"),v=Ue("saturate"),b=Ue("scale"),E=Ue("sepia"),C=Ue("skew"),R=Ue("space"),w=Ue("translate"),k=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",be,t],D=()=>[be,t],P=()=>["",sr,Ar],$=()=>["auto",Ai,be],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],j=()=>["start","end","center","between","around","evenly","stretch"],T=()=>["","0",be],M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Ai,Ul],z=()=>[Ai,be];return{cacheSize:500,separator:":",theme:{colors:[Wo],spacing:[sr,Ar],blur:["none","",Tr,be],brightness:B(),borderColor:[e],borderRadius:["none","","full",Tr,be],borderSpacing:D(),borderWidth:P(),contrast:B(),grayscale:T(),hueRotate:z(),invert:T(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[G3,Ar],inset:A(),margin:A(),opacity:B(),padding:D(),saturate:B(),scale:B(),sepia:T(),skew:z(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",be]}],container:["container"],columns:[{columns:[Tr]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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"],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:[...I(),be]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Uo,be]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",be]}],grow:[{grow:T()}],shrink:[{shrink:T()}],order:[{order:["first","last","none",Uo,be]}],"grid-cols":[{"grid-cols":[Wo]}],"col-start-end":[{col:["auto",{span:["full",Uo,be]},be]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Wo]}],"row-start-end":[{row:["auto",{span:[Uo,be]},be]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",be]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[d]}],px:[{px:[d]}],py:[{py:[d]}],ps:[{ps:[d]}],pe:[{pe:[d]}],pt:[{pt:[d]}],pr:[{pr:[d]}],pb:[{pb:[d]}],pl:[{pl:[d]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",be,t]}],"min-w":[{"min-w":[be,t,"min","max","fit"]}],"max-w":[{"max-w":[be,t,"none","full","min","max","fit","prose",{screen:[Tr]},Tr]}],h:[{h:[be,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[be,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[be,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[be,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Tr,Ar]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ul]}],"font-family":[{font:[Wo]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",be]}],"line-clamp":[{"line-clamp":["none",Ai,Ul]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",sr,be]}],"list-image":[{"list-image":["none",be]}],"list-style-type":[{list:["none","disc","decimal",be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",sr,Ar]}],"underline-offset":[{"underline-offset":["auto",sr,be]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),Q3]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",X3]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Z3]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:F()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[sr,be]}],"outline-w":[{outline:[sr,Ar]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[sr,Ar]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Tr,e4]}],"shadow-color":[{shadow:[Wo]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":U()}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Tr,be]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",be]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",be]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Uo,be]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",be]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",be]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[sr,Ar,Ul]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}}const s4=z3(i4);var ou={en:{y:function(e){return"year"+(e===1?"":"s")},mo:function(e){return"month"+(e===1?"":"s")},w:function(e){return"week"+(e===1?"":"s")},d:function(e){return"day"+(e===1?"":"s")},h:function(e){return"hour"+(e===1?"":"s")},m:function(e){return"minute"+(e===1?"":"s")},s:function(e){return"second"+(e===1?"":"s")},ms:function(e){return"millisecond"+(e===1?"":"s")},decimal:"."},shortEn:{y:()=>"y",mo:()=>"mo",w:()=>"w",d:()=>"d",h:()=>"h",m:()=>"m",s:()=>"s",ms:()=>"ms"}};function sb(e){var t=function(r,i){var o=y0({},t,i||{});return a4(r,o)};return y0(t,{language:"en",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},e)}var Xu=sb({});function o4(e){var t=[e.language];if(Qn(e,"fallbacks"))if(l4(e.fallbacks)&&e.fallbacks.length)t=t.concat(e.fallbacks);else throw new Error("fallbacks must be an array with at least one element");for(var n=0;n<t.length;n++){var r=t[n];if(Qn(e.languages,r))return e.languages[r];if(Qn(ou,r))return ou[r]}throw new Error("No language found.")}function a4(e,t){var n,r,i;e=Math.abs(e);var o=o4(t),a=[],s,l,c;for(n=0,r=t.units.length;n<r;n++){if(s=t.units[n],l=t.unitMeasures[s],n+1===r)if(Qn(t,"maxDecimalPoints")){var m=Math.pow(10,t.maxDecimalPoints),u=e/l;c=parseFloat((Math.floor(m*u)/m).toFixed(t.maxDecimalPoints))}else c=e/l;else c=Math.floor(e/l);a.push({unitCount:c,unitName:s}),e-=c*l}var p=0;for(n=0;n<a.length;n++)if(a[n].unitCount){p=n;break}if(t.round){var g,y;for(n=a.length-1;n>=0&&(i=a[n],i.unitCount=Math.round(i.unitCount),n!==0);n--)y=a[n-1],g=t.unitMeasures[y.unitName]/t.unitMeasures[i.unitName],(i.unitCount%g===0||t.largest&&t.largest-1<n-p)&&(y.unitCount+=i.unitCount/g,i.unitCount=0)}var _=[];for(n=0,a.length;n<r&&(i=a[n],i.unitCount&&_.push(_0(i.unitCount,i.unitName,o,t)),_.length!==t.largest);n++);if(_.length){var h;if(Qn(t,"delimiter")?h=t.delimiter:Qn(o,"delimiter")?h=o.delimiter:h=", ",!t.conjunction||_.length===1)return _.join(h);if(_.length===2)return _.join(t.conjunction);if(_.length>2)return _.slice(0,-1).join(h)+(t.serialComma?",":"")+t.conjunction+_.slice(-1)}else return _0(0,t.units[t.units.length-1],o,t)}function _0(e,t,n,r){var i;Qn(r,"decimal")?i=r.decimal:Qn(n,"decimal")?i=n.decimal:i=".";var o;typeof n._formatCount=="function"?o=n._formatCount(e,i):o=e.toString().replace(".",i);var a=n[t],s;return typeof a=="function"?s=a(e):s=a,n._numberFirst?s+r.spacer+o:o+r.spacer+s}function y0(e){for(var t,n=1;n<arguments.length;n++){t=arguments[n];for(var r in t)Qn(t,r)&&(e[r]=t[r])}return e}var l4=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function Qn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Xu.getSupportedLanguages=function(){var t=[];for(var n in ou)Qn(ou,n)&&n!=="gr"&&t.push(n);return t};Xu.humanizer=sb;const Zn=Object.create(null);Zn.open="0";Zn.close="1";Zn.ping="2";Zn.pong="3";Zn.message="4";Zn.upgrade="5";Zn.noop="6";const xc=Object.create(null);Object.keys(Zn).forEach(e=>{xc[Zn[e]]=e});const Af={type:"error",data:"parser error"},ob=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ab=typeof ArrayBuffer=="function",lb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Am=({type:e,data:t},n,r)=>ob&&t instanceof Blob?n?r(t):w0(t,r):ab&&(t instanceof ArrayBuffer||lb(t))?n?r(t):w0(new Blob([t]),r):r(Zn[e]+(t||"")),w0=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function b0(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let id;function c4(e,t){if(ob&&e.data instanceof Blob)return e.data.arrayBuffer().then(b0).then(t);if(ab&&(e.data instanceof ArrayBuffer||lb(e.data)))return t(b0(e.data));Am(e,!1,n=>{id||(id=new TextEncoder),t(id.encode(n))})}const x0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ta=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<x0.length;e++)ta[x0.charCodeAt(e)]=e;const u4=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),m=new Uint8Array(c);for(r=0;r<n;r+=4)o=ta[e.charCodeAt(r)],a=ta[e.charCodeAt(r+1)],s=ta[e.charCodeAt(r+2)],l=ta[e.charCodeAt(r+3)],m[i++]=o<<2|a>>4,m[i++]=(a&15)<<4|s>>2,m[i++]=(s&3)<<6|l&63;return c},h4=typeof ArrayBuffer=="function",Tm=(e,t)=>{if(typeof e!="string")return{type:"message",data:cb(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:d4(e.substring(1),t)}:xc[n]?e.length>1?{type:xc[n],data:e.substring(1)}:{type:xc[n]}:Af},d4=(e,t)=>{if(h4){const n=u4(e);return cb(n,t)}else return{base64:!0,data:e}},cb=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ub="",f4=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{Am(o,!1,s=>{r[a]=s,++i===n&&t(r.join(ub))})})},p4=(e,t)=>{const n=e.split(ub),r=[];for(let i=0;i<n.length;i++){const o=Tm(n[i],t);if(r.push(o),o.type==="error")break}return r};function m4(){return new TransformStream({transform(e,t){c4(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let sd;function Wl(e){return e.reduce((t,n)=>t+n.length,0)}function Vl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function g4(e,t){sd||(sd=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,s){for(n.push(a);;){if(r===0){if(Wl(n)<1)break;const l=Vl(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Wl(n)<2)break;const l=Vl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Wl(n)<8)break;const l=Vl(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),m=c.getUint32(0);if(m>Math.pow(2,21)-1){s.enqueue(Af);break}i=m*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Wl(n)<i)break;const l=Vl(n,i);s.enqueue(Tm(o?l:sd.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(Af);break}}}})}const hb=4;function nt(e){if(e)return v4(e)}function v4(e){for(var t in nt.prototype)e[t]=nt.prototype[t];return e}nt.prototype.on=nt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};nt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};nt.prototype.off=nt.prototype.removeListener=nt.prototype.removeAllListeners=nt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};nt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};nt.prototype.emitReserved=nt.prototype.emit;nt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};nt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const hn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function db(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const _4=hn.setTimeout,y4=hn.clearTimeout;function Qu(e,t){t.useNativeTimers?(e.setTimeoutFn=_4.bind(hn),e.clearTimeoutFn=y4.bind(hn)):(e.setTimeoutFn=hn.setTimeout.bind(hn),e.clearTimeoutFn=hn.clearTimeout.bind(hn))}const w4=1.33;function b4(e){return typeof e=="string"?x4(e):Math.ceil((e.byteLength||e.size)*w4)}function x4(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function S4(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function C4(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class E4 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Dm extends nt{constructor(t){super(),this.writable=!1,Qu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new E4(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Tm(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=S4(t);return n.length?"?"+n:""}}const fb="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Tf=64,k4={};let S0=0,Kl=0,C0;function E0(e){let t="";do t=fb[e%Tf]+t,e=Math.floor(e/Tf);while(e>0);return t}function pb(){const e=E0(+new Date);return e!==C0?(S0=0,C0=e):e+"."+E0(S0++)}for(;Kl<Tf;Kl++)k4[fb[Kl]]=Kl;let mb=!1;try{mb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const R4=mb;function gb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||R4))return new XMLHttpRequest}catch{}if(!t)try{return new hn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function L4(){}const M4=function(){return new gb({xdomain:!1}).responseType!=null}();class A4 extends Dm{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=M4&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};p4(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,f4(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=pb()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Jn(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Jn extends nt{constructor(t,n){super(),Qu(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=db(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new gb(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Jn.requestsCount++,Jn.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=L4,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Jn.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Jn.requestsCount=0;Jn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",k0);else if(typeof addEventListener=="function"){const e="onpagehide"in hn?"pagehide":"unload";addEventListener(e,k0,!1)}}function k0(){for(let e in Jn.requests)Jn.requests.hasOwnProperty(e)&&Jn.requests[e].abort()}const Pm=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ql=hn.WebSocket||hn.MozWebSocket,R0=!0,T4="arraybuffer",L0=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class D4 extends Dm{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=L0?{}:db(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=R0&&!L0?n?new ql(t,n):new ql(t):new ql(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Am(r,this.supportsBinary,o=>{const a={};try{R0&&this.ws.send(o)}catch{}i&&Pm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=pb()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!ql}}class P4 extends Dm{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=g4(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=m4();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),o())}).catch(s=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this.writer.write(a).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&Pm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const $4={websocket:D4,webtransport:P4,polling:A4},O4=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,I4=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Df(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=O4.exec(e||""),o={},a=14;for(;a--;)o[I4[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=N4(o,o.path),o.queryKey=B4(o,o.query),o}function N4(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function B4(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let vb=class ys extends nt{constructor(t,n={}){super(),this.binaryType=T4,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Df(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Df(n.host).host),Qu(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=C4(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=hb,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new $4[t](r)}open(){let t;if(this.opts.rememberUpgrade&&ys.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;ys.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ys.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,m(),n.close(),n=null)}const a=u=>{const p=new Error("probe error: "+u);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function s(){a("transport closed")}function l(){a("socket closed")}function c(u){n&&u.name!==n.name&&o()}const m=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",ys.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=b4(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){ys.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};vb.protocol=hb;function j4(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Df(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const F4=typeof ArrayBuffer=="function",z4=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,_b=Object.prototype.toString,H4=typeof Blob=="function"||typeof Blob<"u"&&_b.call(Blob)==="[object BlobConstructor]",U4=typeof File=="function"||typeof File<"u"&&_b.call(File)==="[object FileConstructor]";function $m(e){return F4&&(e instanceof ArrayBuffer||z4(e))||H4&&e instanceof Blob||U4&&e instanceof File}function Sc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Sc(e[n]))return!0;return!1}if($m(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Sc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Sc(e[n]))return!0;return!1}function W4(e){const t=[],n=e.data,r=e;return r.data=Pf(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Pf(e,t){if(!e)return e;if($m(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Pf(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Pf(e[r],t));return n}return e}function V4(e,t){return e.data=$f(e.data,t),delete e.attachments,e}function $f(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=$f(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=$f(e[n],t));return e}const K4=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],q4=5;var Le;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Le||(Le={}));class G4{constructor(t){this.replacer=t}encode(t){return(t.type===Le.EVENT||t.type===Le.ACK)&&Sc(t)?this.encodeAsBinary({type:t.type===Le.EVENT?Le.BINARY_EVENT:Le.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Le.BINARY_EVENT||t.type===Le.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=W4(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function M0(e){return Object.prototype.toString.call(e)==="[object Object]"}class Om extends nt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Le.BINARY_EVENT;r||n.type===Le.BINARY_ACK?(n.type=r?Le.EVENT:Le.ACK,this.reconstructor=new Y4(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if($m(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Le[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Le.BINARY_EVENT||r.type===Le.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Om.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Le.CONNECT:return M0(n);case Le.DISCONNECT:return n===void 0;case Le.CONNECT_ERROR:return typeof n=="string"||M0(n);case Le.EVENT:case Le.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&K4.indexOf(n[0])===-1);case Le.ACK:case Le.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Y4{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=V4(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const X4=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Om,Encoder:G4,get PacketType(){return Le},protocol:q4},Symbol.toStringTag,{value:"Module"}));function Mn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Q4=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class yb extends nt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Mn(t,"open",this.onopen.bind(this)),Mn(t,"packet",this.onpacket.bind(this)),Mn(t,"error",this.onerror.bind(this)),Mn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(Q4.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:Le.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Le.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Le.EVENT:case Le.BINARY_EVENT:this.onevent(t);break;case Le.ACK:case Le.BINARY_ACK:this.onack(t);break;case Le.DISCONNECT:this.ondisconnect();break;case Le.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Le.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function bo(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}bo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};bo.prototype.reset=function(){this.attempts=0};bo.prototype.setMin=function(e){this.ms=e};bo.prototype.setMax=function(e){this.max=e};bo.prototype.setJitter=function(e){this.jitter=e};class Of extends nt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Qu(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new bo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||X4;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new vb(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Mn(n,"open",function(){r.onopen(),t&&t()}),o=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},a=Mn(n,"error",o);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Mn(t,"ping",this.onping.bind(this)),Mn(t,"data",this.ondata.bind(this)),Mn(t,"error",this.onerror.bind(this)),Mn(t,"close",this.onclose.bind(this)),Mn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Pm(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new yb(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Vo={};function pa(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=j4(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Vo[i]&&o in Vo[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new Of(r,t):(Vo[i]||(Vo[i]=new Of(r,t)),l=Vo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(pa,{Manager:Of,Socket:yb,io:pa,connect:pa});function Z(...e){return s4(L3(e))}function J4(e){if(typeof e!="string"||!e)return!1;const t=new URL(e,window.location.href);return e.startsWith("/")&&!e.startsWith("//")&&t.hostname===window.location.hostname}const Z4=e=>{const t=/^[ \t]*(?=\S)/gm,n=e.substring(e.indexOf(`
`)).match(t);if(!n)return e;const r=n.reduce((o,a)=>Math.min(o,a.length),1/0),i=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(i,"")},If=Xu.humanizer({round:!0});Xu.humanizer({round:!0,spacer:"",language:"shortEn"});const od=(e,t="long")=>new Date(e*1e3).toLocaleDateString(navigator.language,{dateStyle:t}),Gl=(e,t="long",n="medium")=>new Date(e*1e3).toLocaleString(navigator.language,{dateStyle:t,timeStyle:n}),wb=e=>{const t={transports:["polling"],upgrade:!1,query:{rooms:e,uiVersion:window.txConsts.txaVersion}};return window.txConsts.isWebInterface?pa({...t,path:"/socket.io"}):pa("monitor",{...t,path:"/WebPipe/socket.io"})},xo=e=>{e&&(window.invokeNative?window.invokeNative("openUrl",e):window.open(e,"_blank"))},Oa=e=>{if(window.txConsts.isWebInterface)return;const n=e.target.closest("a");if(!n)return;const r=n.getAttribute("href");r&&(e.preventDefault(),xo(r))},Im=x.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Z("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Im.displayName="Card";const Ju=x.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Z("flex flex-col space-y-1.5 p-6",e),...t}));Ju.displayName="CardHeader";const Nm=x.forwardRef(({className:e,...t},n)=>S.jsx("h3",{ref:n,className:Z("text-2xl font-semibold leading-none tracking-tight",e),...t}));Nm.displayName="CardTitle";const bb=x.forwardRef(({className:e,...t},n)=>S.jsx("p",{ref:n,className:Z("text-sm text-muted-foreground",e),...t}));bb.displayName="CardDescription";const cl=x.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Z("p-6 pt-0",e),...t}));cl.displayName="CardContent";const So=x.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Z("flex items-center p-6 pt-0",e),...t}));So.displayName="CardFooter";var xb={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},A0=ot.createContext&&ot.createContext(xb),e6=["attr","size","title"];function t6(e,t){if(e==null)return{};var n=n6(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function n6(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},au.apply(this,arguments)}function T0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T0(Object(n),!0).forEach(function(r){r6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r6(e,t,n){return t=i6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i6(e){var t=s6(e,"string");return typeof t=="symbol"?t:String(t)}function s6(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sb(e){return e&&e.map((t,n)=>ot.createElement(t.tag,lu({key:n},t.attr),Sb(t.child)))}function Cb(e){return t=>ot.createElement(o6,au({attr:lu({},e.attr)},t),Sb(e.child))}function o6(e){var t=n=>{var{attr:r,size:i,title:o}=e,a=t6(e,e6),s=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),ot.createElement("svg",au({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:lu(lu({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&ot.createElement("title",null,o),e.children)};return A0!==void 0?ot.createElement(A0.Consumer,null,n=>t(n)):t(xb)}function a6(e){return Cb({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(e)}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}function l6(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ul(...e){return t=>e.forEach(n=>l6(n,t))}function Se(...e){return x.useCallback(ul(...e),e)}const ai=x.forwardRef((e,t)=>{const{children:n,...r}=e,i=x.Children.toArray(n),o=i.find(c6);if(o){const a=o.props.children,s=i.map(l=>l===o?x.Children.count(a)>1?x.Children.only(null):x.isValidElement(a)?a.props.children:null:l);return x.createElement(Nf,Y({},r,{ref:t}),x.isValidElement(a)?x.cloneElement(a,void 0,s):null)}return x.createElement(Nf,Y({},r,{ref:t}),n)});ai.displayName="Slot";const Nf=x.forwardRef((e,t)=>{const{children:n,...r}=e;return x.isValidElement(n)?x.cloneElement(n,{...u6(r,n.props),ref:t?ul(t,n.ref):n.ref}):x.Children.count(n)>1?x.Children.only(null):null});Nf.displayName="SlotClone";const Bm=({children:e})=>x.createElement(x.Fragment,null,e);function c6(e){return x.isValidElement(e)&&e.type===Bm}function u6(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]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Eb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Eb(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function h6(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Eb(e))&&(r&&(r+=" "),r+=t);return r}const D0=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,P0=h6,gi=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return P0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(c=>{const m=n==null?void 0:n[c],u=o==null?void 0:o[c];if(m===null)return null;const p=D0(m)||D0(u);return i[c][p]}),s=n&&Object.entries(n).reduce((c,m)=>{let[u,p]=m;return p===void 0||(c[u]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,m)=>{let{class:u,className:p,...g}=m;return Object.entries(g).every(y=>{let[_,h]=y;return Array.isArray(h)?h.includes({...o,...s}[_]):{...o,...s}[_]===h})?[...c,u,p]:c},[]);return P0(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},hl=gi("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/75",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/75",warning:"bg-warning text-warning-foreground hover:bg-warning/75",success:"bg-success text-success-foreground hover:bg-success/75",info:"bg-info text-info-foreground hover:bg-info/75",outline:"border border-foreground hover:bg-primary hover:text-primary-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/75",ghost:"hover:bg-primary hover:text-primary-foreground",link:"text-accent underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",inline:"h-5 px-1.5 rounded-sm text-xs tracking-wider",xs:"h-7 rounded-sm px-2 text-sm",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Oe=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const a=r?ai:"button";return S.jsx(a,{className:Z(hl({variant:t,size:n,className:e})),ref:o,...i})});Oe.displayName="Button";const d6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],fe=d6.reduce((e,t)=>{const n=x.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?ai:t;return x.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),x.createElement(s,Y({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function cu(e,t){e&&mi.flushSync(()=>e.dispatchEvent(t))}const rt=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{};function f6(e,t){return x.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const ut=e=>{const{present:t,children:n}=e,r=p6(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=Se(r.ref,i.ref);return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};ut.displayName="Presence";function p6(e){const[t,n]=x.useState(),r=x.useRef({}),i=x.useRef(e),o=x.useRef("none"),a=e?"mounted":"unmounted",[s,l]=f6(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=Yl(r.current);o.current=s==="mounted"?c:"none"},[s]),rt(()=>{const c=r.current,m=i.current;if(m!==e){const p=o.current,g=Yl(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(m&&p!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),rt(()=>{if(t){const c=u=>{const g=Yl(r.current).includes(u.animationName);u.target===t&&g&&mi.flushSync(()=>l("ANIMATION_END"))},m=u=>{u.target===t&&(o.current=Yl(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:x.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Yl(e){return(e==null?void 0:e.animationName)||"none"}function m6(e,t){const n=x.createContext(t);function r(o){const{children:a,...s}=o,l=x.useMemo(()=>s,Object.values(s));return x.createElement(n.Provider,{value:l},a)}function i(o){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,i]}function Ft(e,t=[]){let n=[];function r(o,a){const s=x.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:p,children:g,...y}=u,_=(p==null?void 0:p[e][l])||s,h=x.useMemo(()=>y,Object.values(y));return x.createElement(_.Provider,{value:h},g)}function m(u,p){const g=(p==null?void 0:p[e][l])||s,y=x.useContext(g);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,m]}const i=()=>{const o=n.map(a=>x.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,g6(i,...t)]}function g6(...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 a=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(o)[`__scope${c}`];return{...s,...u}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Fe(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const v6=x.createContext(void 0);function Co(e){const t=x.useContext(v6);return e||t||"ltr"}function Bf(e,[t,n]){return Math.min(n,Math.max(t,e))}function ne(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 _6(e,t){return x.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const kb="ScrollArea",[Rb,Dj]=Ft(kb),[y6,wn]=Rb(kb),w6=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[s,l]=x.useState(null),[c,m]=x.useState(null),[u,p]=x.useState(null),[g,y]=x.useState(null),[_,h]=x.useState(null),[f,d]=x.useState(0),[v,b]=x.useState(0),[E,C]=x.useState(!1),[R,w]=x.useState(!1),k=Se(t,A=>l(A)),L=Co(i);return x.createElement(y6,{scope:n,type:r,dir:L,scrollHideDelay:o,scrollArea:s,viewport:c,onViewportChange:m,content:u,onContentChange:p,scrollbarX:g,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:_,onScrollbarYChange:h,scrollbarYEnabled:R,onScrollbarYEnabledChange:w,onCornerWidthChange:d,onCornerHeightChange:b},x.createElement(fe.div,Y({dir:L},a,{ref:k,style:{position:"relative","--radix-scroll-area-corner-width":f+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})))}),b6="ScrollAreaViewport",x6=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...i}=e,o=wn(b6,n),a=x.useRef(null),s=Se(t,a,o.onViewportChange);return x.createElement(x.Fragment,null,x.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),x.createElement(fe.div,Y({"data-radix-scroll-area-viewport":""},i,{ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style}}),x.createElement("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Rr="ScrollAreaScrollbar",Lb=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wn(Rr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,s=e.orientation==="horizontal";return x.useEffect(()=>(s?o(!0):a(!0),()=>{s?o(!1):a(!1)}),[s,o,a]),i.type==="hover"?x.createElement(S6,Y({},r,{ref:t,forceMount:n})):i.type==="scroll"?x.createElement(C6,Y({},r,{ref:t,forceMount:n})):i.type==="auto"?x.createElement(Mb,Y({},r,{ref:t,forceMount:n})):i.type==="always"?x.createElement(jm,Y({},r,{ref:t})):null}),S6=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wn(Rr,e.__scopeScrollArea),[o,a]=x.useState(!1);return x.useEffect(()=>{const s=i.scrollArea;let l=0;if(s){const c=()=>{window.clearTimeout(l),a(!0)},m=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",m),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),x.createElement(ut,{present:n||o},x.createElement(Mb,Y({"data-state":o?"visible":"hidden"},r,{ref:t})))}),C6=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wn(Rr,e.__scopeScrollArea),o=e.orientation==="horizontal",a=eh(()=>l("SCROLL_END"),100),[s,l]=_6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,i.scrollHideDelay,l]),x.useEffect(()=>{const c=i.viewport,m=o?"scrollLeft":"scrollTop";if(c){let u=c[m];const p=()=>{const g=c[m];u!==g&&(l("SCROLL"),a()),u=g};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[i.viewport,o,l,a]),x.createElement(ut,{present:n||s!=="hidden"},x.createElement(jm,Y({"data-state":s==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:ne(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ne(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),Mb=x.forwardRef((e,t)=>{const n=wn(Rr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=x.useState(!1),s=e.orientation==="horizontal",l=eh(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?c:m)}},10);return ho(n.viewport,l),ho(n.content,l),x.createElement(ut,{present:r||o},x.createElement(jm,Y({"data-state":o?"visible":"hidden"},i,{ref:t})))}),jm=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=wn(Rr,e.__scopeScrollArea),o=x.useRef(null),a=x.useRef(0),[s,l]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Pb(s.viewport,s.content),m={...r,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function u(p,g){return D6(p,a.current,s,g)}return n==="horizontal"?x.createElement(E6,Y({},m,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,g=$0(p,s,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=u(p,i.dir))}})):n==="vertical"?x.createElement(k6,Y({},m,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,g=$0(p,s);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=u(p))}})):null}),E6=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=wn(Rr,e.__scopeScrollArea),[a,s]=x.useState(),l=x.useRef(null),c=Se(t,l,o.onScrollbarXChange);return x.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),x.createElement(Tb,Y({"data-orientation":"horizontal"},i,{ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Zu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,u)=>{if(o.viewport){const p=o.viewport.scrollLeft+m.deltaX;e.onWheelScroll(p),Ob(p,u)&&m.preventDefault()}},onResize:()=>{l.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:uu(a.paddingLeft),paddingEnd:uu(a.paddingRight)}})}}))}),k6=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=wn(Rr,e.__scopeScrollArea),[a,s]=x.useState(),l=x.useRef(null),c=Se(t,l,o.onScrollbarYChange);return x.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),x.createElement(Tb,Y({"data-orientation":"vertical"},i,{ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Zu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,u)=>{if(o.viewport){const p=o.viewport.scrollTop+m.deltaY;e.onWheelScroll(p),Ob(p,u)&&m.preventDefault()}},onResize:()=>{l.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:uu(a.paddingTop),paddingEnd:uu(a.paddingBottom)}})}}))}),[R6,Ab]=Rb(Rr),Tb=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:m,onResize:u,...p}=e,g=wn(Rr,n),[y,_]=x.useState(null),h=Se(t,k=>_(k)),f=x.useRef(null),d=x.useRef(""),v=g.viewport,b=r.content-r.viewport,E=Fe(m),C=Fe(l),R=eh(u,10);function w(k){if(f.current){const L=k.clientX-f.current.left,A=k.clientY-f.current.top;c({x:L,y:A})}}return x.useEffect(()=>{const k=L=>{const A=L.target;(y==null?void 0:y.contains(A))&&E(L,b)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[v,y,b,E]),x.useEffect(C,[r,C]),ho(y,R),ho(g.content,R),x.createElement(R6,{scope:n,scrollbar:y,hasThumb:i,onThumbChange:Fe(o),onThumbPointerUp:Fe(a),onThumbPositionChange:C,onThumbPointerDown:Fe(s)},x.createElement(fe.div,Y({},p,{ref:h,style:{position:"absolute",...p.style},onPointerDown:ne(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),f.current=y.getBoundingClientRect(),d.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),w(k))}),onPointerMove:ne(e.onPointerMove,w),onPointerUp:ne(e.onPointerUp,k=>{const L=k.target;L.hasPointerCapture(k.pointerId)&&L.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=d.current,g.viewport&&(g.viewport.style.scrollBehavior=""),f.current=null})})))}),jf="ScrollAreaThumb",L6=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ab(jf,e.__scopeScrollArea);return x.createElement(ut,{present:n||i.hasThumb},x.createElement(M6,Y({ref:t},r)))}),M6=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=wn(jf,n),a=Ab(jf,n),{onThumbPositionChange:s}=a,l=Se(t,u=>a.onThumbChange(u)),c=x.useRef(),m=eh(()=>{c.current&&(c.current(),c.current=void 0)},100);return x.useEffect(()=>{const u=o.viewport;if(u){const p=()=>{if(m(),!c.current){const g=P6(u,s);c.current=g,s()}};return s(),u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,m,s]),x.createElement(fe.div,Y({"data-state":a.hasThumb?"visible":"hidden"},i,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ne(e.onPointerDownCapture,u=>{const g=u.target.getBoundingClientRect(),y=u.clientX-g.left,_=u.clientY-g.top;a.onThumbPointerDown({x:y,y:_})}),onPointerUp:ne(e.onPointerUp,a.onThumbPointerUp)}))}),Db="ScrollAreaCorner",A6=x.forwardRef((e,t)=>{const n=wn(Db,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?x.createElement(T6,Y({},e,{ref:t})):null}),T6=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=wn(Db,n),[o,a]=x.useState(0),[s,l]=x.useState(0),c=!!(o&&s);return ho(i.scrollbarX,()=>{var m;const u=((m=i.scrollbarX)===null||m===void 0?void 0:m.offsetHeight)||0;i.onCornerHeightChange(u),l(u)}),ho(i.scrollbarY,()=>{var m;const u=((m=i.scrollbarY)===null||m===void 0?void 0:m.offsetWidth)||0;i.onCornerWidthChange(u),a(u)}),c?x.createElement(fe.div,Y({},r,{ref:t,style:{width:o,height:s,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function uu(e){return e?parseInt(e,10):0}function Pb(e,t){const n=e/t;return isNaN(n)?0:n}function Zu(e){const t=Pb(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function D6(e,t,n,r="ltr"){const i=Zu(n),o=i/2,a=t||o,s=i-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,m=n.content-n.viewport,u=r==="ltr"?[0,m]:[m*-1,0];return $b([l,c],u)(e)}function $0(e,t,n="ltr"){const r=Zu(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,s=o-r,l=n==="ltr"?[0,a]:[a*-1,0],c=Bf(e,l);return $b([0,a],[0,s])(c)}function $b(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Ob(e,t){return e>0&&e<t}const P6=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,s=n.top!==o.top;(a||s)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function eh(e,t){const n=Fe(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ho(e,t){const n=Fe(t);rt(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const Ib=w6,$6=x6,O6=A6,Eo=x.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(Ib,{ref:r,className:Z("relative overflow-hidden",e),...n,children:[S.jsx($6,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx(Nb,{}),S.jsx(O6,{})]}));Eo.displayName=Ib.displayName;const Nb=x.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Lb,{ref:r,orientation:t,className:Z("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:S.jsx(L6,{className:"relative flex-1 rounded-full bg-border"})}));Nb.displayName=Lb.displayName;function I6({error:e}){const t=()=>{window.location.reload()};return S.jsx("div",{className:"w-screen h-screen flex flex-col items-center justify-center",children:S.jsx(Bb,{title:"App Error:",description:"Due to an unexpected error, the panel has crashed.",error:e,resetButton:S.jsx(Oe,{variant:"outline",onClick:t,children:"Refresh"})})})}function N6({error:e,resetErrorBoundary:t}){return S.jsx("div",{className:"w-full flex flex-col items-center justify-center",children:S.jsx(Bb,{title:"Page Error:",description:"There was an error rendering this page.",error:e,resetButton:S.jsx(Oe,{variant:"outline",onClick:t,children:"Go Back"})})})}function Bb(e){return S.jsxs(Im,{className:"max-w-xl",children:[S.jsxs(Ju,{children:[S.jsxs("h1",{className:"text-3xl text-red-500 pb-0 flex flex-row justify-start items-center",children:[S.jsx(a6,{className:"inline-block mr-2"}),e.title]}),S.jsx("span",{className:"text-sm text-muted-foreground pt-0",children:e.description})]}),S.jsxs(cl,{children:[S.jsxs("p",{className:"truncate",children:["Page: ",S.jsxs("code",{className:"text-muted-foreground ",children:[window.location.pathname??"unknown",window.location.search??""]})]}),S.jsxs("p",{children:["Versions: ",S.jsxs("code",{className:"text-muted-foreground",children:["txAdmin v",window.txConsts.txaVersion," atop FXServer b",window.txConsts.fxsVersion]})]}),S.jsxs("p",{children:["Message: ",S.jsx("code",{className:"text-muted-foreground",children:e.error.message??"unknown"})]}),S.jsx("p",{children:"Stack:"}),S.jsx("pre",{className:"mt-1",children:S.jsx(Eo,{className:`p-2 border border-red-800 rounded-sm 
                                font-mono text-muted-foreground text-xs text-red-800
                                h-32 w-full`,children:e.error.stack})})]}),S.jsxs(So,{className:"flex flex-row justify-between",children:[e.resetButton,S.jsx(Oe,{asChild:!0,variant:"outline",className:"bg-discord hover:bg-discord-active animate-pulse hover:animate-none",children:S.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"Support Discord"})})]})]})}var it={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let B6=0;function De(e,t){const n=`atom${++B6}`,r={toString:()=>n};return typeof e=="function"?r.read=e:(r.init=e,r.read=function(i){return i(this)},r.write=function(i,o,a){return o(this,typeof a=="function"?a(i(this)):a)}),t&&(r.write=t),r}const ad=e=>"init"in e,ld=e=>!!e.write,hu=new WeakMap,j6=(e,t)=>{hu.set(e,t),e.catch(()=>{}).finally(()=>hu.delete(e))},O0=(e,t)=>{const n=hu.get(e);n&&(hu.delete(e),n(t))},I0=(e,t)=>{e.status="fulfilled",e.value=t},N0=(e,t)=>{e.status="rejected",e.reason=t},F6=e=>typeof(e==null?void 0:e.then)=="function",Ko=(e,t)=>!!e&&"v"in e&&"v"in t&&Object.is(e.v,t.v),B0=(e,t)=>!!e&&"e"in e&&"e"in t&&Object.is(e.e,t.e),us=e=>!!e&&"v"in e&&e.v instanceof Promise,z6=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,Xl=e=>{if("e"in e)throw e.e;return e.v},H6=()=>{const e=new WeakMap,t=new WeakMap,n=new Map;let r,i;(it?"production":void 0)!=="production"&&(r=new Set,i=new Set);const o=w=>e.get(w),a=(w,k)=>{(it?"production":void 0)!=="production"&&Object.freeze(k);const L=e.get(w);if(e.set(w,k),n.has(w)||n.set(w,L),us(L)){const A="v"in k?k.v instanceof Promise?k.v:Promise.resolve(k.v):Promise.reject(k.e);L.v!==A&&O0(L.v,A)}},s=(w,k,L)=>{const A=new Map;let D=!1;L.forEach((P,$)=>{!P&&$===w&&(P=k),P?(A.set($,P),k.d.get($)!==P&&(D=!0)):(it?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(D||k.d.size!==A.size)&&(k.d=A)},l=(w,k,L)=>{const A=o(w),D={d:(A==null?void 0:A.d)||new Map,v:k};if(L&&s(w,D,L),Ko(A,D)&&A.d===D.d)return A;if(us(A)&&us(D)&&z6(A,D)){if(A.d===D.d)return A;D.v=A.v}return a(w,D),D},c=(w,k,L,A)=>{if(F6(k)){let D;const P=()=>{const I=o(w);if(!us(I)||I.v!==$)return;const F=l(w,$,L);t.has(w)&&I.d!==F.d&&E(w,F,I.d)},$=new Promise((I,F)=>{let U=!1;k.then(j=>{U||(U=!0,I0($,j),I(j),P())},j=>{U||(U=!0,N0($,j),F(j),P())}),D=j=>{U||(U=!0,j.then(T=>I0($,T),T=>N0($,T)),I(j))}});return $.orig=k,$.status="pending",j6($,I=>{I&&D(I),A==null||A()}),l(w,$,L)}return l(w,k,L)},m=(w,k,L)=>{const A=o(w),D={d:(A==null?void 0:A.d)||new Map,e:k};return L&&s(w,D,L),B0(A,D)&&A.d===D.d?A:(a(w,D),D)},u=(w,k)=>{const L=o(w);if(!k&&L&&(t.has(w)||Array.from(L.d).every(([U,j])=>{if(U===w)return!0;const T=u(U);return T===j||Ko(T,j)})))return L;const A=new Map;let D=!0;const P=U=>{if(U===w){const T=o(U);if(T)return A.set(U,T),Xl(T);if(ad(U))return A.set(U,void 0),U.init;throw new Error("no atom init")}const j=u(U);return A.set(U,j),Xl(j)};let $,I;const F={get signal(){return $||($=new AbortController),$.signal},get setSelf(){return(it?"production":void 0)!=="production"&&!ld(w)&&console.warn("setSelf function cannot be used with read-only atom"),!I&&ld(w)&&(I=(...U)=>{if((it?"production":void 0)!=="production"&&D&&console.warn("setSelf function cannot be called in sync"),!D)return d(w,...U)}),I}};try{const U=w.read(P,F);return c(w,U,A,()=>$==null?void 0:$.abort())}catch(U){return m(w,U,A)}finally{D=!1}},p=w=>Xl(u(w)),g=w=>{let k=t.get(w);return k||(k=v(w)),k},y=(w,k)=>!k.l.size&&(!k.t.size||k.t.size===1&&k.t.has(w)),_=w=>{const k=t.get(w);k&&y(w,k)&&b(w)},h=w=>{const k=new Map,L=new WeakMap,A=$=>{var I;const F=new Set((I=t.get($))==null?void 0:I.t);return n.forEach((U,j)=>{var T;(T=o(j))!=null&&T.d.has($)&&F.add(j)}),F},D=$=>{A($).forEach(I=>{I!==$&&(k.set(I,(k.get(I)||new Set).add($)),L.set(I,(L.get(I)||0)+1),D(I))})};D(w);const P=$=>{A($).forEach(I=>{var F;if(I!==$){let U=L.get(I);if(U&&L.set(I,--U),!U){let j=!!((F=k.get(I))!=null&&F.size);if(j){const T=o(I),M=u(I,!0);j=!Ko(T,M)}j||k.forEach(T=>T.delete(I))}P(I)}})};P(w)},f=(w,...k)=>{let L=!0;const A=$=>Xl(u($)),D=($,...I)=>{let F;if($===w){if(!ad($))throw new Error("atom not writable");const U=o($),j=c($,I[0]);Ko(U,j)||h($)}else F=f($,...I);if(!L){const U=C();(it?"production":void 0)!=="production"&&r.forEach(j=>j({type:"async-write",flushed:U}))}return F},P=w.write(A,D,...k);return L=!1,P},d=(w,...k)=>{const L=f(w,...k),A=C();return(it?"production":void 0)!=="production"&&r.forEach(D=>D({type:"write",flushed:A})),L},v=(w,k,L)=>{var A;const D=L||[];(A=o(w))==null||A.d.forEach(($,I)=>{const F=t.get(I);F?F.t.add(w):I!==w&&v(I,w,D)}),u(w);const P={t:new Set(k&&[k]),l:new Set};if(t.set(w,P),(it?"production":void 0)!=="production"&&i.add(w),ld(w)&&w.onMount){const{onMount:$}=w;D.push(()=>{const I=$((...F)=>d(w,...F));I&&(P.u=I)})}return L||D.forEach($=>$()),P},b=w=>{var k;const L=(k=t.get(w))==null?void 0:k.u;L&&L(),t.delete(w),(it?"production":void 0)!=="production"&&i.delete(w);const A=o(w);A?(us(A)&&O0(A.v),A.d.forEach((D,P)=>{if(P!==w){const $=t.get(P);$&&($.t.delete(w),y(P,$)&&b(P))}})):(it?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",w)},E=(w,k,L)=>{const A=new Set(k.d.keys());L==null||L.forEach((D,P)=>{if(A.has(P)){A.delete(P);return}const $=t.get(P);$&&($.t.delete(w),y(P,$)&&b(P))}),A.forEach(D=>{const P=t.get(D);P?P.t.add(w):t.has(w)&&v(D,w)})},C=()=>{let w;for((it?"production":void 0)!=="production"&&(w=new Set);n.size;){const k=Array.from(n);n.clear(),k.forEach(([L,A])=>{const D=o(L);if(D){const P=t.get(L);P&&D.d!==(A==null?void 0:A.d)&&E(L,D,A==null?void 0:A.d),P&&!(!us(A)&&(Ko(A,D)||B0(A,D)))&&(P.l.forEach($=>$()),(it?"production":void 0)!=="production"&&w.add(L))}else(it?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((it?"production":void 0)!=="production")return w},R=(w,k)=>{const L=g(w),A=C(),D=L.l;return D.add(k),(it?"production":void 0)!=="production"&&r.forEach(P=>P({type:"sub",flushed:A})),()=>{D.delete(k),_(w),(it?"production":void 0)!=="production"&&r.forEach(P=>P({type:"unsub"}))}};return(it?"production":void 0)!=="production"?{get:p,set:d,sub:R,dev_subscribe_store:(w,k)=>{if(k!==2)throw new Error("The current StoreListener revision is 2.");return r.add(w),()=>{r.delete(w)}},dev_get_mounted_atoms:()=>i.values(),dev_get_atom_state:w=>e.get(w),dev_get_mounted:w=>t.get(w),dev_restore_atoms:w=>{for(const[L,A]of w)ad(L)&&(c(L,A),h(L));const k=C();r.forEach(L=>L({type:"restore",flushed:k}))}}:{get:p,set:d,sub:R}};let cd;(it?"production":void 0)!=="production"&&(typeof globalThis.__NUMBER_OF_JOTAI_INSTANCES__=="number"?++globalThis.__NUMBER_OF_JOTAI_INSTANCES__:globalThis.__NUMBER_OF_JOTAI_INSTANCES__=1);const U6=()=>(cd||((it?"production":void 0)!=="production"&&globalThis.__NUMBER_OF_JOTAI_INSTANCES__!==1&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"),cd=H6()),cd);var W6={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const V6=x.createContext(void 0),jb=e=>{const t=x.useContext(V6);return(e==null?void 0:e.store)||t||U6()},K6=e=>typeof(e==null?void 0:e.then)=="function",q6=ot.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function Ge(e,t){const n=jb(t),[[r,i,o],a]=x.useReducer(c=>{const m=n.get(e);return Object.is(c[0],m)&&c[1]===n&&c[2]===e?c:[m,n,e]},void 0,()=>[n.get(e),n,e]);let s=r;(i!==n||o!==e)&&(a(),s=n.get(e));const l=t==null?void 0:t.delay;return x.useEffect(()=>{const c=n.sub(e,()=>{if(typeof l=="number"){setTimeout(a,l);return}a()});return a(),c},[n,e,l]),x.useDebugValue(s),K6(s)?q6(s):s}function Ne(e,t){const n=jb(t);return x.useCallback((...i)=>{if((W6?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function mn(e,t){return[Ge(e,t),Ne(e,t)]}function Fb(e){const t=De(()=>({mounted:!1,inProgress:0,promise:void 0,cleanup:void 0})),n=De(0),r=De(null,(o,a,s)=>{const l=o(t);s?(l.mounted=!0,a(n,c=>c+1)):(l.cleanup==null||l.cleanup(),l.cleanup=void 0,l.mounted=!1)});r.onMount=o=>(o(!0),()=>o(!1));const i=De((o,{setSelf:a})=>{o(n);const s=o(t);return!s.mounted||s.inProgress?s.promise:(++s.inProgress,s.promise=Promise.resolve().then(()=>{try{if(!s.mounted)return;s.cleanup==null||s.cleanup(),s.cleanup=e(o,a)}finally{--s.inProgress,s.promise=void 0}}))},(o,a,...s)=>{const l=o(t);++l.inProgress;try{return a(...s)}finally{--l.inProgress}});return De(o=>{o(r),o(i)})}const zb=""+new URL("favicon_default.svg",import.meta.url).href,G6=""+new URL("favicon_online.svg",import.meta.url).href,Y6=""+new URL("favicon_partial.svg",import.meta.url).href,X6=""+new URL("favicon_offline.svg",import.meta.url).href,ts=De(null),Hb=De(e=>{var t;return((t=e(ts))==null?void 0:t.server.name)??"unconfigured"}),Ub=De(e=>{var t;return(t=e(ts))==null?void 0:t.server.configPendingStep}),Q6=De(e=>{var t;return((t=e(ts))==null?void 0:t.server.instantiated)??!1}),J6=()=>Ne(ts),Wb=()=>Ge(ts),Fm=De([]),th=De(e=>e(Fm).length),Vb=De(null),Z6=()=>{const e=Ne(Fm),t=Ne(Vb);return n=>{const r=n.findIndex(i=>i.type==="fullPlayerlist");r>0&&(n=n.slice(r));for(const i of n)i.type==="fullPlayerlist"?(e(i.playerlist),t(i.mutex)):i.type==="playerJoining"?e(o=>[...o,i]):i.type==="playerDropped"?e(o=>o.filter(a=>a.netid!==i.netid)):console.error("Unknown playerlist event type",i)}},Kb=De(0),zm=()=>{const e=Ne(Kb);return()=>e(Math.random())},qb=De(!1),du="txAdmin",na=document.getElementById("favicon"),Gb=De(du),Hm=()=>{const e=Ne(Gb);return t=>{t?e(t):(e(du),document.title=du,na.href=zb)}},eR=Fb((e,t)=>{if(!window.txConsts.isWebInterface)return;const n=e(Gb),r=e(ts),i=e(th);r?(r.server.status==="ONLINE"?na.href=G6:r.server.status==="PARTIAL"?na.href=Y6:na.href=X6,document.title=`(${i}) ${r.server.name} · ${n}`):(na.href=zb,document.title=du)});function Ei(e,t,n){var r=n||{},i=r.noTrailing,o=i===void 0?!1:i,a=r.noLeading,s=a===void 0?!1:a,l=r.debounceMode,c=l===void 0?void 0:l,m,u=!1,p=0;function g(){m&&clearTimeout(m)}function y(h){var f=h||{},d=f.upcomingOnly,v=d===void 0?!1:d;g(),u=!v}function _(){for(var h=arguments.length,f=new Array(h),d=0;d<h;d++)f[d]=arguments[d];var v=this,b=Date.now()-p;if(u)return;function E(){p=Date.now(),t.apply(v,f)}function C(){m=void 0}!s&&c&&!m&&E(),g(),c===void 0&&b>e?s?(p=Date.now(),o||(m=setTimeout(c?C:E,e))):E():o!==!0&&(m=setTimeout(c?C:E,c===void 0?e-b:e))}return _.cancel=y,_}function tR(e,t,n){var r=n||{},i=r.atBegin,o=i===void 0?!1:i;return Ei(e,t,{debounceMode:o!==!1})}const nR=150,j0=Ei(nR,e=>{console.log("sending hotkey event",e),window.postMessage({type:"globalHotkey",action:e})},{noTrailing:!0});function Yb(e){return e.code==="KeyK"&&e.ctrlKey?(j0("focusPlayerlistFilter"),!0):e.code==="KeyL"&&e.ctrlKey&&e.shiftKey&&window.txConsts.showAdvanced?(j0("toggleLightMode"),!0):!1}function Xb(e){Yb(e)&&e.preventDefault()}function bt({legacyUrl:e}){const t=x.useRef(null),n=location.search??"",r=location.hash??"";return x.useEffect(()=>{var i;t.current&&((i=t.current.contentWindow)==null||i.addEventListener("keydown",Xb))},[]),S.jsx("iframe",{ref:t,id:"legacyPageIframe",src:`./legacy/${e}${n}${r}`,className:"w-full"})}function mr({children:e,className:t,...n}){return S.jsx("code",{className:Z("rounded-sm font-mono text-muted-foreground bg-muted px-[0.25rem]",t),...n,children:e})}function rR({params:e}){return Hm()("Not Found"),S.jsx("div",{className:"w-full flex items-center justify-center",children:S.jsxs("div",{className:"text-center",children:[S.jsx("h1",{className:"bg-fuchsia-600 text-4xl w-fit mx-auto",children:"404 | Not Found"}),S.jsxs("p",{className:"mt-2",children:["The page ",S.jsxs(mr,{children:["/",e.fullPath]})," does not seem to be correct."]}),S.jsx(Lm,{href:"/",className:"text-accent hover:underline",children:"Return to Dashboard?"})]})})}var Qb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={4567:function(a,s,l){var c=this&&this.__decorate||function(d,v,b,E){var C,R=arguments.length,w=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,v,b,E);else for(var k=d.length-1;k>=0;k--)(C=d[k])&&(w=(R<3?C(w):R>3?C(v,b,w):C(v,b))||w);return R>3&&w&&Object.defineProperty(v,b,w),w},m=this&&this.__param||function(d,v){return function(b,E){v(b,E,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=l(9042),p=l(9924),g=l(844),y=l(4725),_=l(2585),h=l(3656);let f=s.AccessibilityManager=class extends g.Disposable{constructor(d,v,b,E){super(),this._terminal=d,this._coreBrowserService=b,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let C=0;C<this._terminal.rows;C++)this._rowElements[C]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[C]);if(this._topBoundaryFocusListener=C=>this._handleBoundaryFocus(C,0),this._bottomBoundaryFocusListener=C=>this._handleBoundaryFocus(C,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(C=>this._handleResize(C.rows))),this.register(this._terminal.onRender(C=>this._refreshRows(C.start,C.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(C=>this._handleChar(C))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(C=>this._handleTab(C))),this.register(this._terminal.onKey(C=>this._handleKey(C.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,h.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let v=0;v<d;v++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,v){this._liveRegionDebouncer.refresh(d,v,this._terminal.rows)}_renderRows(d,v){const b=this._terminal.buffer,E=b.lines.length.toString();for(let C=d;C<=v;C++){const R=b.lines.get(b.ydisp+C),w=[],k=(R==null?void 0:R.translateToString(!0,void 0,void 0,w))||"",L=(b.ydisp+C+1).toString(),A=this._rowElements[C];A&&(k.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=k,this._rowColumns.set(A,w)),A.setAttribute("aria-posinset",L),A.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,v){const b=d.target,E=this._rowElements[v===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==E)return;let C,R;if(v===0?(C=b,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(C=this._rowElements.shift(),R=b,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var k;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:d.anchorNode,offset:d.anchorOffset},b={node:d.focusNode,offset:d.focusOffset};if((v.node.compareDocumentPosition(b.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===b.node&&v.offset>b.offset)&&([v,b]=[b,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const E=this._rowElements.slice(-1)[0];if(b.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(b={node:E,offset:((k=E.textContent)==null?void 0:k.length)??0}),!this._rowContainer.contains(b.node))return;const C=({node:L,offset:A})=>{const D=L instanceof Text?L.parentNode:L;let P=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(D);if(!$)return console.warn("columns is null. Race condition?"),null;let I=A<$.length?$[A]:$.slice(-1)[0]+1;return I>=this._terminal.cols&&(++P,I=0),{row:P,column:I}},R=C(v),w=C(b);if(R&&w){if(R.row>w.row||R.row===w.row&&R.column>=w.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(w.row-R.row)*this._terminal.cols-R.column+w.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=f=c([m(1,_.IInstantiationService),m(2,y.ICoreBrowserService),m(3,y.IRenderService)],f)},3614:(a,s)=>{function l(p){return p.replace(/\r?\n/g,"\r")}function c(p,g){return g?"\x1B[200~"+p+"\x1B[201~":p}function m(p,g,y,_){p=c(p=l(p),y.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(p,!0),g.value=""}function u(p,g,y){const _=y.getBoundingClientRect(),h=p.clientX-_.left-10,f=p.clientY-_.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${h}px`,g.style.top=`${f}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=l,s.bracketTextForPaste=c,s.copyHandler=function(p,g){p.clipboardData&&p.clipboardData.setData("text/plain",g.selectionText),p.preventDefault()},s.handlePasteEvent=function(p,g,y,_){p.stopPropagation(),p.clipboardData&&m(p.clipboardData.getData("text/plain"),g,y,_)},s.paste=m,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(p,g,y,_,h){u(p,g,y),h&&_.rightClickSelect(p),g.value=_.selectionText,g.select()}},7239:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=l(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(m,u,p){this._css.set(m,u,p)}getCss(m,u){return this._css.get(m,u)}setColor(m,u,p){this._color.set(m,u,p)}getColor(m,u){return this._color.get(m,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(l,c,m,u){l.addEventListener(c,m,u);let p=!1;return{dispose:()=>{p||(p=!0,l.removeEventListener(c,m,u))}}}},6465:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var b,E=arguments.length,C=E<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(b=h[R])&&(C=(E<3?b(C):E>3?b(f,d,C):b(f,d))||C);return E>3&&C&&Object.defineProperty(f,d,C),C},m=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier2=void 0;const u=l(3656),p=l(8460),g=l(844),y=l(2585);let _=s.Linkifier2=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(h){super(),this._bufferService=h,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)(()=>{var f;this._lastMouseEvent=void 0,this._linkProviders.length=0,(f=this._activeProviderReplies)==null||f.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(h){return this._linkProviders.push(h),{dispose:()=>{const f=this._linkProviders.indexOf(h);f!==-1&&this._linkProviders.splice(f,1)}}}attachToDom(h,f,d){this._element=h,this._mouseService=f,this._renderService=d,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){if(this._lastMouseEvent=h,!this._element||!this._mouseService)return;const f=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const d=h.composedPath();for(let v=0;v<d.length;v++){const b=d[v];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,f){var v,b;this._activeProviderReplies&&f||((v=this._activeProviderReplies)==null||v.forEach(E=>{E==null||E.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=h.y);let d=!1;for(const[E,C]of this._linkProviders.entries())f?(b=this._activeProviderReplies)!=null&&b.get(E)&&(d=this._checkLinkProviderResult(E,h,d)):C.provideLinks(h.y,R=>{var k,L;if(this._isMouseOut)return;const w=R==null?void 0:R.map(A=>({link:A}));(k=this._activeProviderReplies)==null||k.set(E,w),d=this._checkLinkProviderResult(E,h,d),((L=this._activeProviderReplies)==null?void 0:L.size)===this._linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)})}_removeIntersectingLinks(h,f){const d=new Set;for(let v=0;v<f.size;v++){const b=f.get(v);if(b)for(let E=0;E<b.length;E++){const C=b[E],R=C.link.range.start.y<h?0:C.link.range.start.x,w=C.link.range.end.y>h?this._bufferService.cols:C.link.range.end.x;for(let k=R;k<=w;k++){if(d.has(k)){b.splice(E--,1);break}d.add(k)}}}}_checkLinkProviderResult(h,f,d){var E;if(!this._activeProviderReplies)return d;const v=this._activeProviderReplies.get(h);let b=!1;for(let C=0;C<h;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(b=!0);if(!b&&v){const C=v.find(R=>this._linkAtPosition(R.link,f));C&&(d=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviders.length&&!d)for(let C=0;C<this._activeProviderReplies.size;C++){const R=(E=this._activeProviderReplies.get(C))==null?void 0:E.find(w=>this._linkAtPosition(w.link,f));if(R){d=!0,this._handleNewLink(R);break}}return d}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._element||!this._mouseService||!this._currentLink)return;const f=this._positionFromMouseEvent(h,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,f){this._element&&this._currentLink&&this._lastMouseEvent&&(!h||!f||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(h.link,f)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var d,v;return(v=(d=this._currentLink)==null?void 0:d.state)==null?void 0:v.decorations.pointerCursor},set:d=>{var v,b;(v=this._currentLink)!=null&&v.state&&this._currentLink.state.decorations.pointerCursor!==d&&(this._currentLink.state.decorations.pointerCursor=d,this._currentLink.state.isHovered&&((b=this._element)==null||b.classList.toggle("xterm-cursor-pointer",d)))}},underline:{get:()=>{var d,v;return(v=(d=this._currentLink)==null?void 0:d.state)==null?void 0:v.decorations.underline},set:d=>{var v,b,E;(v=this._currentLink)!=null&&v.state&&((E=(b=this._currentLink)==null?void 0:b.state)==null?void 0:E.decorations.underline)!==d&&(this._currentLink.state.decorations.underline=d,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,d))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(d=>{if(!this._currentLink)return;const v=d.start===0?0:d.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+d.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(v,b),this._lastMouseEvent&&this._element)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}})))}_linkHover(h,f,d){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(d,f.text)}_fireUnderlineEvent(h,f){const d=h.range,v=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(d.start.x-1,d.start.y-v-1,d.end.x,d.end.y-v-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(h,f,d){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(d,f.text)}_linkAtPosition(h,f){const d=h.range.start.y*this._bufferService.cols+h.range.start.x,v=h.range.end.y*this._bufferService.cols+h.range.end.x,b=f.y*this._bufferService.cols+f.x;return d<=b&&b<=v}_positionFromMouseEvent(h,f,d){const v=d.getCoords(h,f,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,f,d,v,b){return{x1:h,y1:f,x2:d,y2:v,cols:this._bufferService.cols,fg:b}}};s.Linkifier2=_=c([m(0,y.IBufferService)],_)},9042:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,s,l){var c=this&&this.__decorate||function(_,h,f,d){var v,b=arguments.length,E=b<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,h,f,d);else for(var C=_.length-1;C>=0;C--)(v=_[C])&&(E=(b<3?v(E):b>3?v(h,f,E):v(h,f))||E);return b>3&&E&&Object.defineProperty(h,f,E),E},m=this&&this.__param||function(_,h){return function(f,d){h(f,d,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=l(511),p=l(2585);let g=s.OscLinkProvider=class{constructor(_,h,f){this._bufferService=_,this._optionsService=h,this._oscLinkService=f}provideLinks(_,h){var k;const f=this._bufferService.buffer.lines.get(_-1);if(!f)return void h(void 0);const d=[],v=this._optionsService.rawOptions.linkHandler,b=new u.CellData,E=f.getTrimmedLength();let C=-1,R=-1,w=!1;for(let L=0;L<E;L++)if(R!==-1||f.hasContent(L)){if(f.loadCell(L,b),b.hasExtendedAttrs()&&b.extended.urlId){if(R===-1){R=L,C=b.extended.urlId;continue}w=b.extended.urlId!==C}else R!==-1&&(w=!0);if(w||R!==-1&&L===E-1){const A=(k=this._oscLinkService.getLinkData(C))==null?void 0:k.uri;if(A){const D={start:{x:R+1,y:_},end:{x:L+(w||L!==E-1?0:1),y:_}};let P=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const $=new URL(A);["http:","https:"].includes($.protocol)||(P=!0)}catch{P=!0}P||d.push({text:A,range:D,activate:($,I)=>v?v.activate($,I,D):y(0,I),hover:($,I)=>{var F;return(F=v==null?void 0:v.hover)==null?void 0:F.call(v,$,I,D)},leave:($,I)=>{var F;return(F=v==null?void 0:v.leave)==null?void 0:F.call(v,$,I,D)}})}w=!1,b.hasExtendedAttrs()&&b.extended.urlId?(R=L,C=b.extended.urlId):(R=-1,C=-1)}}h(d)}};function y(_,h){if(confirm(`Do you want to navigate to ${h}?

WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=g=c([m(0,p.IBufferService),m(1,p.IOptionsService),m(2,p.IOscLinkService)],g)},6193:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(l,c,m){this._rowCount=m,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=l(3614),m=l(3656),u=l(6465),p=l(9042),g=l(3730),y=l(1680),_=l(3107),h=l(5744),f=l(2950),d=l(1296),v=l(428),b=l(4269),E=l(5114),C=l(8934),R=l(3230),w=l(9312),k=l(4725),L=l(6731),A=l(8055),D=l(8969),P=l(8460),$=l(844),I=l(6114),F=l(8437),U=l(2584),j=l(7399),T=l(5941),M=l(9074),B=l(2585),z=l(5435),O=l(4567);class X extends D.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(H={}){super(H),this.browser=I,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((W,N)=>this.refresh(W,N))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(W=>this._reportWindowsOptions(W))),this.register(this._inputHandler.onColor(W=>this._handleColorEvent(W))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(W=>this._afterResize(W.cols,W.rows))),this.register((0,$.toDisposable)(()=>{var W,N;this._customKeyEventHandler=void 0,(N=(W=this.element)==null?void 0:W.parentNode)==null||N.removeChild(this.element)}))}_handleColorEvent(H){if(this._themeService)for(const W of H){let N,K="";switch(W.index){case 256:N="foreground",K="10";break;case 257:N="background",K="11";break;case 258:N="cursor",K="12";break;default:N="ansi",K="4;"+W.index}switch(W.type){case 0:const Q=A.color.toColorRGB(N==="ansi"?this._themeService.colors.ansi[W.index]:this._themeService.colors[N]);this.coreService.triggerDataEvent(`${U.C0.ESC}]${K};${(0,T.toRgbString)(Q)}${U.C1_ESCAPED.ST}`);break;case 1:if(N==="ansi")this._themeService.modifyColors(q=>q.ansi[W.index]=A.rgba.toColor(...W.color));else{const q=N;this._themeService.modifyColors(de=>de[q]=A.rgba.toColor(...W.color))}break;case 2:this._themeService.restoreColor(W.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(H){H?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(O.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(H){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var H;return(H=this.textarea)==null?void 0:H.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const H=this.buffer.ybase+this.buffer.y,W=this.buffer.lines.get(H);if(!W)return;const N=Math.min(this.buffer.x,this.cols-1),K=this._renderService.dimensions.css.cell.height,Q=W.getWidth(N),q=this._renderService.dimensions.css.cell.width*Q,de=this.buffer.y*this._renderService.dimensions.css.cell.height,he=N*this._renderService.dimensions.css.cell.width;this.textarea.style.left=he+"px",this.textarea.style.top=de+"px",this.textarea.style.width=q+"px",this.textarea.style.height=K+"px",this.textarea.style.lineHeight=K+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",W=>{this.hasSelection()&&(0,c.copyHandler)(W,this._selectionService)}));const H=W=>(0,c.handlePasteEvent)(W,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",H)),this.register((0,m.addDisposableDomListener)(this.element,"paste",H)),I.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",W=>{W.button===2&&(0,c.rightClickHandler)(W,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",W=>{(0,c.rightClickHandler)(W,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),I.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",W=>{W.button===1&&(0,c.moveTextAreaUnderMouseCursor)(W,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",H=>this._keyUp(H),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",H=>this._keyDown(H),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",H=>this._keyPress(H),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",H=>this._compositionHelper.compositionupdate(H))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,m.addDisposableDomListener)(this.textarea,"input",H=>this._inputEvent(H),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(H){var N;if(!H)throw new Error("Terminal requires a parent element.");if(H.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((N=this.element)==null?void 0:N.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=H.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"),H.appendChild(this.element);const W=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",K=>this.updateCursorStyle(K))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),I.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,H.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",K=>this._handleTextAreaFocus(K))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(v.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(K=>this._onRender.fire(K))),this.onResize(K=>this._renderService.resize(K.cols,K.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(W);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(y.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(K=>this.scrollLines(K.amount,K.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(w.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(K=>this.scrollLines(K.amount,K.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(K=>this._renderService.handleSelectionChanged(K.start,K.end,K.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(K=>{this.textarea.value=K,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(K=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",K=>this._selectionService.handleMouseDown(K))),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(O.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",K=>this._handleScreenReaderModeOptionChange(K))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",K=>{!this._overviewRulerRenderer&&K&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier2)}bindMouse(){const H=this,W=this.element;function N(q){const de=H._mouseService.getMouseReportCoords(q,H.screenElement);if(!de)return!1;let he,le;switch(q.overrideType||q.type){case"mousemove":le=32,q.buttons===void 0?(he=3,q.button!==void 0&&(he=q.button<3?q.button:3)):he=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":le=0,he=q.button<3?q.button:3;break;case"mousedown":le=1,he=q.button<3?q.button:3;break;case"wheel":if(H._customWheelEventHandler&&H._customWheelEventHandler(q)===!1||H.viewport.getLinesScrolled(q)===0)return!1;le=q.deltaY<0?0:1,he=4;break;default:return!1}return!(le===void 0||he===void 0||he>4)&&H.coreMouseService.triggerMouseEvent({col:de.col,row:de.row,x:de.x,y:de.y,button:he,action:le,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const K={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Q={mouseup:q=>(N(q),q.buttons||(this._document.removeEventListener("mouseup",K.mouseup),K.mousedrag&&this._document.removeEventListener("mousemove",K.mousedrag)),this.cancel(q)),wheel:q=>(N(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&N(q)},mousemove:q=>{q.buttons||N(q)}};this.register(this.coreMouseService.onProtocolChange(q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&q?K.mousemove||(W.addEventListener("mousemove",Q.mousemove),K.mousemove=Q.mousemove):(W.removeEventListener("mousemove",K.mousemove),K.mousemove=null),16&q?K.wheel||(W.addEventListener("wheel",Q.wheel,{passive:!1}),K.wheel=Q.wheel):(W.removeEventListener("wheel",K.wheel),K.wheel=null),2&q?K.mouseup||(K.mouseup=Q.mouseup):(this._document.removeEventListener("mouseup",K.mouseup),K.mouseup=null),4&q?K.mousedrag||(K.mousedrag=Q.mousedrag):(this._document.removeEventListener("mousemove",K.mousedrag),K.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(W,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return N(q),K.mouseup&&this._document.addEventListener("mouseup",K.mouseup),K.mousedrag&&this._document.addEventListener("mousemove",K.mousedrag),this.cancel(q)})),this.register((0,m.addDisposableDomListener)(W,"wheel",q=>{if(!K.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const de=this.viewport.getLinesScrolled(q);if(de===0)return;const he=U.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let le="";for(let Ae=0;Ae<Math.abs(de);Ae++)le+=he;return this.coreService.triggerDataEvent(le,!0),this.cancel(q,!0)}return this.viewport.handleWheel(q)?this.cancel(q):void 0}},{passive:!1})),this.register((0,m.addDisposableDomListener)(W,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,m.addDisposableDomListener)(W,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(H,W){var N;(N=this._renderService)==null||N.refreshRows(H,W)}updateCursorStyle(H){var W;(W=this._selectionService)!=null&&W.shouldColumnSelect(H)?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(H,W,N=0){var K;N===1?(super.scrollLines(H,W,N),this.refresh(0,this.rows-1)):(K=this.viewport)==null||K.scrollLines(H)}paste(H){(0,c.paste)(H,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(H){this._customKeyEventHandler=H}attachCustomWheelEventHandler(H){this._customWheelEventHandler=H}registerLinkProvider(H){return this.linkifier2.registerLinkProvider(H)}registerCharacterJoiner(H){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const W=this._characterJoinerService.register(H);return this.refresh(0,this.rows-1),W}deregisterCharacterJoiner(H){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(H)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(H){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+H)}registerDecoration(H){return this._decorationService.registerDecoration(H)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(H,W,N){this._selectionService.setSelection(H,W,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 H;(H=this._selectionService)==null||H.clearSelection()}selectAll(){var H;(H=this._selectionService)==null||H.selectAll()}selectLines(H,W){var N;(N=this._selectionService)==null||N.selectLines(H,W)}_keyDown(H){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(H)===!1)return!1;const W=this.browser.isMac&&this.options.macOptionIsMeta&&H.altKey;if(!W&&!this._compositionHelper.keydown(H))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;W||H.key!=="Dead"&&H.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const N=(0,j.evaluateKeyboardEvent)(H,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(H),N.type===3||N.type===2){const K=this.rows-1;return this.scrollLines(N.type===2?-K:K),this.cancel(H,!0)}return N.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,H)||(N.cancel&&this.cancel(H,!0),!N.key||!!(H.key&&!H.ctrlKey&&!H.altKey&&!H.metaKey&&H.key.length===1&&H.key.charCodeAt(0)>=65&&H.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(N.key!==U.C0.ETX&&N.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:N.key,domEvent:H}),this._showCursor(),this.coreService.triggerDataEvent(N.key,!0),!this.optionsService.rawOptions.screenReaderMode||H.altKey||H.ctrlKey?this.cancel(H,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(H,W){const N=H.isMac&&!this.options.macOptionIsMeta&&W.altKey&&!W.ctrlKey&&!W.metaKey||H.isWindows&&W.altKey&&W.ctrlKey&&!W.metaKey||H.isWindows&&W.getModifierState("AltGraph");return W.type==="keypress"?N:N&&(!W.keyCode||W.keyCode>47)}_keyUp(H){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(H)===!1||(function(W){return W.keyCode===16||W.keyCode===17||W.keyCode===18}(H)||this.focus(),this.updateCursorStyle(H),this._keyPressHandled=!1)}_keyPress(H){let W;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(H)===!1)return!1;if(this.cancel(H),H.charCode)W=H.charCode;else if(H.which===null||H.which===void 0)W=H.keyCode;else{if(H.which===0||H.charCode===0)return!1;W=H.which}return!(!W||(H.altKey||H.ctrlKey||H.metaKey)&&!this._isThirdLevelShift(this.browser,H)||(W=String.fromCharCode(W),this._onKey.fire({key:W,domEvent:H}),this._showCursor(),this.coreService.triggerDataEvent(W,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(H){if(H.data&&H.inputType==="insertText"&&(!H.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const W=H.data;return this.coreService.triggerDataEvent(W,!0),this.cancel(H),!0}return!1}resize(H,W){H!==this.cols||W!==this.rows?super.resize(H,W):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(H,W){var N,K;(N=this._charSizeService)==null||N.measure(),(K=this.viewport)==null||K.syncScrollArea(!0)}clear(){var H;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 W=1;W<this.rows;W++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(H=this.viewport)==null||H.reset(),this.refresh(0,this.rows-1)}}reset(){var W,N;this.options.rows=this.rows,this.options.cols=this.cols;const H=this._customKeyEventHandler;this._setup(),super.reset(),(W=this._selectionService)==null||W.reset(),this._decorationService.reset(),(N=this.viewport)==null||N.reset(),this._customKeyEventHandler=H,this.refresh(0,this.rows-1)}clearTextureAtlas(){var H;(H=this._renderService)==null||H.clearTextureAtlas()}_reportFocus(){var H;(H=this.element)!=null&&H.classList.contains("focus")?this.coreService.triggerDataEvent(U.C0.ESC+"[I"):this.coreService.triggerDataEvent(U.C0.ESC+"[O")}_reportWindowsOptions(H){if(this._renderService)switch(H){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const W=this._renderService.dimensions.css.canvas.width.toFixed(0),N=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[4;${N};${W}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const K=this._renderService.dimensions.css.cell.width.toFixed(0),Q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[6;${Q};${K}t`)}}cancel(H,W){if(this.options.cancelEvents||W)return H.preventDefault(),H.stopPropagation(),!1}}s.Terminal=X},9924:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(l,c=1e3){this._renderCallback=l,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,c,m){this._rowCount=m,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=u-this._lastRefreshMs,g=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c)}}},1680:function(a,s,l){var c=this&&this.__decorate||function(f,d,v,b){var E,C=arguments.length,R=C<3?d:b===null?b=Object.getOwnPropertyDescriptor(d,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,d,v,b);else for(var w=f.length-1;w>=0;w--)(E=f[w])&&(R=(C<3?E(R):C>3?E(d,v,R):E(d,v))||R);return C>3&&R&&Object.defineProperty(d,v,R),R},m=this&&this.__param||function(f,d){return function(v,b){d(v,b,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=l(3656),p=l(4725),g=l(8460),y=l(844),_=l(2585);let h=s.Viewport=class extends y.Disposable{constructor(f,d,v,b,E,C,R,w){super(),this._viewportElement=f,this._scrollArea=d,this._bufferService=v,this._optionsService=b,this._charSizeService=E,this._renderService=C,this._coreBrowserService=R,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(w.colors),this.register(w.onChangeColors(k=>this._handleThemeChange(k))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(f){this._viewportElement.style.backgroundColor=f.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(f){if(f)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const f=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==f&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=f),this._refreshAnimationFrame=null}syncScrollArea(f=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(f);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(f)}_handleScroll(f){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const f=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(f*(this._smoothScrollState.target-this._smoothScrollState.origin)),f<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(f,d){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&v<this._lastRecordedBufferHeight)||(f.cancelable&&f.preventDefault(),!1)}handleWheel(f){const d=this._getPixelsScrolled(f);return d!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}scrollLines(f){if(f!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=f*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!1})}_getPixelsScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(f,d){var w;let v,b="";const E=[],C=d??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let k=f;k<C;k++){const L=R.get(k);if(!L)continue;const A=(w=R.get(k+1))==null?void 0:w.isWrapped;if(b+=L.translateToString(!A),!A||k===R.length-1){const D=document.createElement("div");D.textContent=b,E.push(D),b.length>0&&(v=D),b=""}}return{bufferElements:E,cursorElement:v}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(f,d){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&d.altKey||v==="ctrl"&&d.ctrlKey||v==="shift"&&d.shiftKey?f*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:f*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(f){this._lastTouchY=f.touches[0].pageY}handleTouchMove(f){const d=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}};s.Viewport=h=c([m(2,_.IBufferService),m(3,_.IOptionsService),m(4,p.ICharSizeService),m(5,p.IRenderService),m(6,p.ICoreBrowserService),m(7,p.IThemeService)],h)},3107:function(a,s,l){var c=this&&this.__decorate||function(_,h,f,d){var v,b=arguments.length,E=b<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,h,f,d);else for(var C=_.length-1;C>=0;C--)(v=_[C])&&(E=(b<3?v(E):b>3?v(h,f,E):v(h,f))||E);return b>3&&E&&Object.defineProperty(h,f,E),E},m=this&&this.__param||function(_,h){return function(f,d){h(f,d,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=l(4725),p=l(844),g=l(2585);let y=s.BufferDecorationRenderer=class extends p.Disposable{constructor(_,h,f,d,v){super(),this._screenElement=_,this._bufferService=h,this._coreBrowserService=f,this._decorationService=d,this._renderService=v,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(b=>this._removeDecoration(b))),this.register((0,p.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var d;const h=this._coreBrowserService.mainDocument.createElement("div");h.classList.add("xterm-decoration"),h.classList.toggle("xterm-decoration-top-layer",((d=_==null?void 0:_.options)==null?void 0:d.layer)==="top"),h.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=_.options.x??0;return f&&f>this._bufferService.cols&&(h.style.display="none"),this._refreshXPosition(_,h),h}_refreshStyle(_){const h=_.marker.line-this._bufferService.buffers.active.ydisp;if(h<0||h>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let f=this._decorationElements.get(_);f||(f=this._createElement(_),_.element=f,this._decorationElements.set(_,f),this._container.appendChild(f),_.onDispose(()=>{this._decorationElements.delete(_),f.remove()})),f.style.top=h*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(f)}}_refreshXPosition(_,h=_.element){if(!h)return;const f=_.options.x??0;(_.options.anchor||"left")==="right"?h.style.right=f?f*this._renderService.dimensions.css.cell.width+"px":"":h.style.left=f?f*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var h;(h=this._decorationElements.get(_))==null||h.remove(),this._decorationElements.delete(_),_.dispose()}};s.BufferDecorationRenderer=y=c([m(1,g.IBufferService),m(2,u.ICoreBrowserService),m(3,g.IDecorationService),m(4,u.IRenderService)],y)},5871:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const c of this._zones)if(c.color===l.options.overviewRulerOptions.color&&c.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,l.marker.line))return;if(this._lineAdjacentToZone(c,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(c,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,c){return c>=l.startBufferLine&&c<=l.endBufferLine}_lineAdjacentToZone(l,c,m){return c>=l.startBufferLine-this._linePadding[m||"full"]&&c<=l.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(l,c){l.startBufferLine=Math.min(l.startBufferLine,c),l.endBufferLine=Math.max(l.endBufferLine,c)}}},5744:function(a,s,l){var c=this&&this.__decorate||function(v,b,E,C){var R,w=arguments.length,k=w<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,E):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,b,E,C);else for(var L=v.length-1;L>=0;L--)(R=v[L])&&(k=(w<3?R(k):w>3?R(b,E,k):R(b,E))||k);return w>3&&k&&Object.defineProperty(b,E,k),k},m=this&&this.__param||function(v,b){return function(E,C){b(E,C,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=l(5871),p=l(4725),g=l(844),y=l(2585),_={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let d=s.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,b,E,C,R,w,k){var A;super(),this._viewportElement=v,this._screenElement=b,this._bufferService=E,this._decorationService=C,this._renderService=R,this._optionsService=w,this._coreBrowserService=k,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var D;(D=this._canvas)==null||D.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const v=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);h.full=this._canvas.width,h.left=v,h.center=b,h.right=v,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=h.left,f.right=h.left+h.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);_.left=b,_.center=b,_.right=b}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const b of v)b.position!=="full"&&this._renderColorZone(b);for(const b of v)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(f[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-_[v.position||"full"]/2),h[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[v.position||"full"]))}_queueRefresh(v,b){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=d=c([m(2,y.IBufferService),m(3,y.IDecorationService),m(4,p.IRenderService),m(5,y.IOptionsService),m(6,p.ICoreBrowserService)],d)},2950:function(a,s,l){var c=this&&this.__decorate||function(_,h,f,d){var v,b=arguments.length,E=b<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,h,f,d);else for(var C=_.length-1;C>=0;C--)(v=_[C])&&(E=(b<3?v(E):b>3?v(h,f,E):v(h,f))||E);return b>3&&E&&Object.defineProperty(h,f,E),E},m=this&&this.__param||function(_,h){return function(f,d){h(f,d,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=l(4725),p=l(2585),g=l(2584);let y=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,h,f,d,v,b){this._textarea=_,this._compositionView=h,this._bufferService=f,this._optionsService=d,this._coreService=v,this._renderService=b,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let f;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),f.length>0&&this._coreService.triggerDataEvent(f,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,f=h.replace(_,"");this._dataAlreadySent=f,h.length>_.length?this._coreService.triggerDataEvent(f,!0):h.length<_.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):h.length===_.length&&h!==_&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),f=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=f+"px",this._compositionView.style.lineHeight=f+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const b=this._compositionView.getBoundingClientRect();this._textarea.style.left=v+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}_||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=y=c([m(2,p.IBufferService),m(3,p.IOptionsService),m(4,p.ICoreService),m(5,u.IRenderService)],y)},9806:(a,s)=>{function l(c,m,u){const p=u.getBoundingClientRect(),g=c.getComputedStyle(u),y=parseInt(g.getPropertyValue("padding-left")),_=parseInt(g.getPropertyValue("padding-top"));return[m.clientX-p.left-y,m.clientY-p.top-_]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=l,s.getCoords=function(c,m,u,p,g,y,_,h,f){if(!y)return;const d=l(c,m,u);return d?(d[0]=Math.ceil((d[0]+(f?_/2:0))/_),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),p+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),g),d):void 0}},9504:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=l(2584);function m(h,f,d,v){const b=h-u(h,d),E=f-u(f,d),C=Math.abs(b-E)-function(R,w,k){let L=0;const A=R-u(R,k),D=w-u(w,k);for(let P=0;P<Math.abs(A-D);P++){const $=p(R,w)==="A"?-1:1,I=k.buffer.lines.get(A+$*P);I!=null&&I.isWrapped&&L++}return L}(h,f,d);return _(C,y(p(h,f),v))}function u(h,f){let d=0,v=f.buffer.lines.get(h),b=v==null?void 0:v.isWrapped;for(;b&&h>=0&&h<f.rows;)d++,v=f.buffer.lines.get(--h),b=v==null?void 0:v.isWrapped;return d}function p(h,f){return h>f?"A":"B"}function g(h,f,d,v,b,E){let C=h,R=f,w="";for(;C!==d||R!==v;)C+=b?1:-1,b&&C>E.cols-1?(w+=E.buffer.translateBufferLineToString(R,!1,h,C),C=0,h=0,R++):!b&&C<0&&(w+=E.buffer.translateBufferLineToString(R,!1,0,h+1),C=E.cols-1,h=C,R--);return w+E.buffer.translateBufferLineToString(R,!1,h,C)}function y(h,f){const d=f?"O":"[";return c.C0.ESC+d+h}function _(h,f){h=Math.floor(h);let d="";for(let v=0;v<h;v++)d+=f;return d}s.moveToCellSequence=function(h,f,d,v){const b=d.buffer.x,E=d.buffer.y;if(!d.buffer.hasScrollback)return function(w,k,L,A,D,P){return m(k,A,D,P).length===0?"":_(g(w,k,w,k-u(k,D),!1,D).length,y("D",P))}(b,E,0,f,d,v)+m(E,f,d,v)+function(w,k,L,A,D,P){let $;$=m(k,A,D,P).length>0?A-u(A,D):k;const I=A,F=function(U,j,T,M,B,z){let O;return O=m(T,M,B,z).length>0?M-u(M,B):j,U<T&&O<=M||U>=T&&O<M?"C":"D"}(w,k,L,A,D,P);return _(g(w,$,L,I,F==="C",D).length,y(F,P))}(b,E,h,f,d,v);let C;if(E===f)return C=b>h?"D":"C",_(Math.abs(b-h),y(C,v));C=E>f?"D":"C";const R=Math.abs(E-f);return _(function(w,k){return k.cols-w}(E>f?h:b,d)+(R-1)*d.cols+1+((E>f?b:h)-1),y(C,v))}},1296:function(a,s,l){var c=this&&this.__decorate||function(P,$,I,F){var U,j=arguments.length,T=j<3?$:F===null?F=Object.getOwnPropertyDescriptor($,I):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(P,$,I,F);else for(var M=P.length-1;M>=0;M--)(U=P[M])&&(T=(j<3?U(T):j>3?U($,I,T):U($,I))||T);return j>3&&T&&Object.defineProperty($,I,T),T},m=this&&this.__param||function(P,$){return function(I,F){$(I,F,P)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=l(3787),p=l(2550),g=l(2223),y=l(6171),_=l(6052),h=l(4725),f=l(8055),d=l(8460),v=l(844),b=l(2585),E="xterm-dom-renderer-owner-",C="xterm-rows",R="xterm-fg-",w="xterm-bg-",k="xterm-focus",L="xterm-selection";let A=1,D=s.DomRenderer=class extends v.Disposable{constructor(P,$,I,F,U,j,T,M,B,z,O,X,re){super(),this._terminal=P,this._document=$,this._element=I,this._screenElement=F,this._viewportElement=U,this._helperContainer=j,this._linkifier2=T,this._charSizeService=B,this._optionsService=z,this._bufferService=O,this._coreBrowserService=X,this._themeService=re,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(C),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(H=>this._injectCss(H))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(H=>this._handleLinkHover(H))),this.register(this._linkifier2.onHideLinkUnderline(H=>this._handleLinkLeave(H))),this.register((0,v.toDisposable)(()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const I of this._rowElements)I.style.width=`${this.dimensions.css.canvas.width}px`,I.style.height=`${this.dimensions.css.cell.height}px`,I.style.lineHeight=`${this.dimensions.css.cell.height}px`,I.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${C} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${C} .xterm-dim { color: ${f.color.multiplyOpacity(P.foreground,.5).css};}`,$+=`${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;}`,$+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% {  border-bottom-style: hidden; }}",$+="@keyframes blink_block_"+this._terminalClass+` { 0% {  background-color: ${P.cursor.css};  color: ${P.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${P.cursor.css}; }}`,$+=`${this._terminalSelector} .${C}.${k} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${C}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[I,F]of P.ansi.entries())$+=`${this._terminalSelector} .${R}${I} { color: ${F.css}; }${this._terminalSelector} .${R}${I}.xterm-dim { color: ${f.color.multiplyOpacity(F,.5).css}; }${this._terminalSelector} .${w}${I} { background-color: ${F.css}; }`;$+=`${this._terminalSelector} .${R}${g.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(P.background).css}; }${this._terminalSelector} .${R}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${w}${g.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,$){for(let I=this._rowElements.length;I<=$;I++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,$){this._refreshRowElements(P,$),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(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,$,I){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,$,I),this.renderRows(0,this._bufferService.rows-1),!P||!$)return;this._selectionRenderModel.update(this._terminal,P,$,I);const F=this._selectionRenderModel.viewportStartRow,U=this._selectionRenderModel.viewportEndRow,j=this._selectionRenderModel.viewportCappedStartRow,T=this._selectionRenderModel.viewportCappedEndRow;if(j>=this._bufferService.rows||T<0)return;const M=this._document.createDocumentFragment();if(I){const B=P[0]>$[0];M.appendChild(this._createSelectionElement(j,B?$[0]:P[0],B?P[0]:$[0],T-j+1))}else{const B=F===j?P[0]:0,z=j===U?$[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(j,B,z));const O=T-j-1;if(M.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,O)),j!==T){const X=U===T?$[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(T,0,X))}}this._selectionContainer.appendChild(M)}_createSelectionElement(P,$,I,F=1){const U=this._document.createElement("div"),j=$*this.dimensions.css.cell.width;let T=this.dimensions.css.cell.width*(I-$);return j+T>this.dimensions.css.canvas.width&&(T=this.dimensions.css.canvas.width-j),U.style.height=F*this.dimensions.css.cell.height+"px",U.style.top=P*this.dimensions.css.cell.height+"px",U.style.left=`${j}px`,U.style.width=`${T}px`,U}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const P of this._rowElements)P.replaceChildren()}renderRows(P,$){const I=this._bufferService.buffer,F=I.ybase+I.y,U=Math.min(I.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,T=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let B=P;B<=$;B++){const z=B+I.ydisp,O=this._rowElements[B],X=I.lines.get(z);if(!O||!X)break;O.replaceChildren(...this._rowFactory.createRow(X,z,z===F,T,M,U,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,$,I,F,U,j){I<0&&(P=0),F<0&&($=0);const T=this._bufferService.rows-1;I=Math.max(Math.min(I,T),0),F=Math.max(Math.min(F,T),0),U=Math.min(U,this._bufferService.cols);const M=this._bufferService.buffer,B=M.ybase+M.y,z=Math.min(M.x,U-1),O=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=I;H<=F;++H){const W=H+M.ydisp,N=this._rowElements[H],K=M.lines.get(W);if(!N||!K)break;N.replaceChildren(...this._rowFactory.createRow(K,W,W===B,X,re,z,O,this.dimensions.css.cell.width,this._widthCache,j?H===I?P:0:-1,j?(H===F?$:U)-1:-1))}}};s.DomRenderer=D=c([m(7,b.IInstantiationService),m(8,h.ICharSizeService),m(9,b.IOptionsService),m(10,b.IBufferService),m(11,h.ICoreBrowserService),m(12,h.IThemeService)],D)},3787:function(a,s,l){var c=this&&this.__decorate||function(C,R,w,k){var L,A=arguments.length,D=A<3?R:k===null?k=Object.getOwnPropertyDescriptor(R,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(C,R,w,k);else for(var P=C.length-1;P>=0;P--)(L=C[P])&&(D=(A<3?L(D):A>3?L(R,w,D):L(R,w))||D);return A>3&&D&&Object.defineProperty(R,w,D),D},m=this&&this.__param||function(C,R){return function(w,k){R(w,k,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=l(2223),p=l(643),g=l(511),y=l(2585),_=l(8055),h=l(4725),f=l(4269),d=l(6171),v=l(3734);let b=s.DomRendererRowFactory=class{constructor(C,R,w,k,L,A,D){this._document=C,this._characterJoinerService=R,this._optionsService=w,this._coreBrowserService=k,this._coreService=L,this._decorationService=A,this._themeService=D,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,R,w){this._selectionStart=C,this._selectionEnd=R,this._columnSelectMode=w}createRow(C,R,w,k,L,A,D,P,$,I,F){const U=[],j=this._characterJoinerService.getJoinedCharacters(R),T=this._themeService.colors;let M,B=C.getNoBgTrimmedLength();w&&B<A+1&&(B=A+1);let z=0,O="",X=0,re=0,H=0,W=!1,N=0,K=!1,Q=0;const q=[],de=I!==-1&&F!==-1;for(let he=0;he<B;he++){C.loadCell(he,this._workCell);let le=this._workCell.getWidth();if(le===0)continue;let Ae=!1,Be=he,ue=this._workCell;if(j.length>0&&he===j[0][0]){Ae=!0;const ge=j.shift();ue=new f.JoinedCellData(this._workCell,C.translateToString(!0,ge[0],ge[1]),ge[1]-ge[0]),Be=ge[1]-1,le=ue.getWidth()}const Ct=this._isCellInSelection(he,R),Sn=w&&he===A,Ee=de&&he>=I&&he<=F;let _e=!1;this._decorationService.forEachDecorationAtCell(he,R,void 0,ge=>{_e=!0});let Ce=ue.getChars()||p.WHITESPACE_CELL_CHAR;if(Ce===" "&&(ue.isUnderline()||ue.isOverline())&&(Ce=" "),Q=le*P-$.get(Ce,ue.isBold(),ue.isItalic()),M){if(z&&(Ct&&K||!Ct&&!K&&ue.bg===X)&&(Ct&&K&&T.selectionForeground||ue.fg===re)&&ue.extended.ext===H&&Ee===W&&Q===N&&!Sn&&!Ae&&!_e){ue.isInvisible()?O+=p.WHITESPACE_CELL_CHAR:O+=Ce,z++;continue}z&&(M.textContent=O),M=this._document.createElement("span"),z=0,O=""}else M=this._document.createElement("span");if(X=ue.bg,re=ue.fg,H=ue.extended.ext,W=Ee,N=Q,K=Ct,Ae&&A>=he&&A<=Be&&(A=he),!this._coreService.isCursorHidden&&Sn&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)D&&q.push("xterm-cursor-blink"),q.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){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")}}if(ue.isBold()&&q.push("xterm-bold"),ue.isItalic()&&q.push("xterm-italic"),ue.isDim()&&q.push("xterm-dim"),O=ue.isInvisible()?p.WHITESPACE_CELL_CHAR:ue.getChars()||p.WHITESPACE_CELL_CHAR,ue.isUnderline()&&(q.push(`xterm-underline-${ue.extended.underlineStyle}`),O===" "&&(O=" "),!ue.isUnderlineColorDefault()))if(ue.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(ue.getUnderlineColor()).join(",")})`;else{let ge=ue.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ue.isBold()&&ge<8&&(ge+=8),M.style.textDecorationColor=T.ansi[ge].css}ue.isOverline()&&(q.push("xterm-overline"),O===" "&&(O=" ")),ue.isStrikethrough()&&q.push("xterm-strikethrough"),Ee&&(M.style.textDecoration="underline");let se=ue.getFgColor(),Re=ue.getFgColorMode(),G=ue.getBgColor(),J=ue.getBgColorMode();const pe=!!ue.isInverse();if(pe){const ge=se;se=G,G=ge;const Cn=Re;Re=J,J=Cn}let me,we,Pe,Me=!1;switch(this._decorationService.forEachDecorationAtCell(he,R,void 0,ge=>{ge.options.layer!=="top"&&Me||(ge.backgroundColorRGB&&(J=50331648,G=ge.backgroundColorRGB.rgba>>8&16777215,me=ge.backgroundColorRGB),ge.foregroundColorRGB&&(Re=50331648,se=ge.foregroundColorRGB.rgba>>8&16777215,we=ge.foregroundColorRGB),Me=ge.options.layer==="top")}),!Me&&Ct&&(me=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,G=me.rgba>>8&16777215,J=50331648,Me=!0,T.selectionForeground&&(Re=50331648,se=T.selectionForeground.rgba>>8&16777215,we=T.selectionForeground)),Me&&q.push("xterm-decoration-top"),J){case 16777216:case 33554432:Pe=T.ansi[G],q.push(`xterm-bg-${G}`);break;case 50331648:Pe=_.rgba.toColor(G>>16,G>>8&255,255&G),this._addStyle(M,`background-color:#${E((G>>>0).toString(16),"0",6)}`);break;default:pe?(Pe=T.foreground,q.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Pe=T.background}switch(me||ue.isDim()&&(me=_.color.multiplyOpacity(Pe,.5)),Re){case 16777216:case 33554432:ue.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(M,Pe,T.ansi[se],ue,me,void 0)||q.push(`xterm-fg-${se}`);break;case 50331648:const ge=_.rgba.toColor(se>>16&255,se>>8&255,255&se);this._applyMinimumContrast(M,Pe,ge,ue,me,we)||this._addStyle(M,`color:#${E(se.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,Pe,T.foreground,ue,me,we)||pe&&q.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}q.length&&(M.className=q.join(" "),q.length=0),Sn||Ae||_e?M.textContent=O:z++,Q!==this.defaultSpacing&&(M.style.letterSpacing=`${Q}px`),U.push(M),he=Be}return M&&z&&(M.textContent=O),U}_applyMinimumContrast(C,R,w,k,L,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const D=this._getContrastCache(k);let P;if(L||A||(P=D.getColor(R.rgba,w.rgba)),P===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);P=_.color.ensureContrastRatio(L||R,A||w,$),D.setColor((L||R).rgba,(A||w).rgba,P??null)}return!!P&&(this._addStyle(C,`color:${P.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,R){C.setAttribute("style",`${C.getAttribute("style")||""}${R};`)}_isCellInSelection(C,R){const w=this._selectionStart,k=this._selectionEnd;return!(!w||!k)&&(this._columnSelectMode?w[0]<=k[0]?C>=w[0]&&R>=w[1]&&C<k[0]&&R<=k[1]:C<w[0]&&R>=w[1]&&C>=k[0]&&R<=k[1]:R>w[1]&&R<k[1]||w[1]===k[1]&&R===w[1]&&C>=w[0]&&C<k[0]||w[1]<k[1]&&R===k[1]&&C<k[0]||w[1]<k[1]&&R===w[1]&&C>=w[0])}};function E(C,R,w){for(;C.length<w;)C=R+C;return C}s.DomRendererRowFactory=b=c([m(1,h.ICharacterJoinerService),m(2,y.IOptionsService),m(3,h.ICoreBrowserService),m(4,y.ICoreService),m(5,y.IDecorationService),m(6,h.IThemeService)],b)},2550:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(l,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=l.createElement("span");m.classList.add("xterm-char-measure-element");const u=l.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const p=l.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const g=l.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[m,u,p,g],this._container.appendChild(m),this._container.appendChild(u),this._container.appendChild(p),this._container.appendChild(g),c.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(l,c,m,u){l===this._font&&c===this._fontSize&&m===this._weight&&u===this._weightBold||(this._font=l,this._fontSize=c,this._weight=m,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(l,c,m){let u=0;if(!c&&!m&&l.length===1&&(u=l.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(l,0);let p=l;c&&(p+="B"),m&&(p+="I");let g=this._holey.get(p);if(g===void 0){let y=0;c&&(y|=1),m&&(y|=2),g=this._measure(l,y),this._holey.set(p,g)}return g}_measure(l,c){const m=this._measureElements[c];return m.textContent=l.repeat(32),m.offsetWidth/32}}},2223:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=l(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(a,s)=>{function l(c){return 57508<=c&&c<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},s.isPowerlineGlyph=l,s.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},s.treatGlyphAsBackgroundColor=function(c){return l(c)||function(m){return 9472<=m&&m<=9631}(c)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(c,m,u=0){return(c-(2*Math.round(m)-u))%(2*Math.round(m))}},6052:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,u,p,g=!1){if(this.selectionStart=u,this.selectionEnd=p,!u||!p||u[0]===p[0]&&u[1]===p[1])return void this.clear();const y=m.buffers.active.ydisp,_=u[1]-y,h=p[1]-y,f=Math.max(_,0),d=Math.min(h,m.rows-1);f>=m.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=_,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=p[0])}isCellSelected(m,u,p){return!!this.hasSelection&&(p-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&p>=this.viewportCappedStartRow&&u<this.endCol&&p<=this.viewportCappedEndRow:u<this.startCol&&p>=this.viewportCappedStartRow&&u>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new l}},456:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,c=this.selectionEnd;return!(!l||!c)&&(l[1]>c[1]||l[1]===c[1]&&l[0]>c[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var b,E=arguments.length,C=E<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(b=h[R])&&(C=(E<3?b(C):E>3?b(f,d,C):b(f,d))||C);return E>3&&C&&Object.defineProperty(f,d,C),C},m=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=l(2585),p=l(8460),g=l(844);let y=s.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,f,d){super(),this._optionsService=d,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new _(h,f,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};s.CharSizeService=y=c([m(2,u.IOptionsService)],y);class _{constructor(f,d,v){this._document=f,this._parentElement=d,this._optionsService=v,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const f={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return f.width!==0&&f.height!==0&&(this._result.width=f.width/32,this._result.height=Math.ceil(f.height)),this._result}}},4269:function(a,s,l){var c=this&&this.__decorate||function(f,d,v,b){var E,C=arguments.length,R=C<3?d:b===null?b=Object.getOwnPropertyDescriptor(d,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,d,v,b);else for(var w=f.length-1;w>=0;w--)(E=f[w])&&(R=(C<3?E(R):C>3?E(d,v,R):E(d,v))||R);return C>3&&R&&Object.defineProperty(d,v,R),R},m=this&&this.__param||function(f,d){return function(v,b){d(v,b,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=l(3734),p=l(643),g=l(511),y=l(2585);class _ extends u.AttributeData{constructor(d,v,b){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=v,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=_;let h=s.CharacterJoinerService=class Jb{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(d){const v={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(v),v.id}deregister(d){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===d)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(d);if(!v||v.length===0)return[];const b=[],E=v.translateToString(!0);let C=0,R=0,w=0,k=v.getFg(0),L=v.getBg(0);for(let A=0;A<v.getTrimmedLength();A++)if(v.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==L){if(A-C>1){const D=this._getJoinedRanges(E,w,R,v,C);for(let P=0;P<D.length;P++)b.push(D[P])}C=A,w=R,k=this._workCell.fg,L=this._workCell.bg}R+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const A=this._getJoinedRanges(E,w,R,v,C);for(let D=0;D<A.length;D++)b.push(A[D])}return b}_getJoinedRanges(d,v,b,E,C){const R=d.substring(v,b);let w=[];try{w=this._characterJoiners[0].handler(R)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const L=this._characterJoiners[k].handler(R);for(let A=0;A<L.length;A++)Jb._mergeRanges(w,L[A])}catch(L){console.error(L)}return this._stringRangesToCellRanges(w,E,C),w}_stringRangesToCellRanges(d,v,b){let E=0,C=!1,R=0,w=d[E];if(w){for(let k=b;k<this._bufferService.cols;k++){const L=v.getWidth(k),A=v.getString(k).length||p.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!C&&w[0]<=R&&(w[0]=k,C=!0),w[1]<=R){if(w[1]=k,w=d[++E],!w)break;w[0]<=R?(w[0]=k,C=!0):C=!1}R+=A}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(d,v){let b=!1;for(let E=0;E<d.length;E++){const C=d[E];if(b){if(v[1]<=C[0])return d[E-1][1]=v[1],d;if(v[1]<=C[1])return d[E-1][1]=Math.max(v[1],C[1]),d.splice(E,1),d;d.splice(E,1),E--}else{if(v[1]<=C[0])return d.splice(E,0,v),d;if(v[1]<=C[1])return C[0]=Math.min(v[0],C[0]),d;v[0]<C[1]&&(C[0]=Math.min(v[0],C[0]),b=!0)}}return b?d[d.length-1][1]=v[1]:d.push(v),d}};s.CharacterJoinerService=h=c([m(0,y.IBufferService)],h)},5114:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=l(844),m=l(8460),u=l(3656);class p extends c.Disposable{constructor(_,h,f){super(),this._textarea=_,this._window=h,this.mainDocument=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(d=>this._screenDprMonitor.setWindow(d))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,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}}s.CoreBrowserService=p;class g extends c.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.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)}}},8934:function(a,s,l){var c=this&&this.__decorate||function(y,_,h,f){var d,v=arguments.length,b=v<3?_:f===null?f=Object.getOwnPropertyDescriptor(_,h):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(y,_,h,f);else for(var E=y.length-1;E>=0;E--)(d=y[E])&&(b=(v<3?d(b):v>3?d(_,h,b):d(_,h))||b);return v>3&&b&&Object.defineProperty(_,h,b),b},m=this&&this.__param||function(y,_){return function(h,f){_(h,f,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=l(4725),p=l(9806);let g=s.MouseService=class{constructor(y,_){this._renderService=y,this._charSizeService=_}getCoords(y,_,h,f,d){return(0,p.getCoords)(window,y,_,h,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(y,_){const h=(0,p.getCoordsRelativeToElement)(window,y,_);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};s.MouseService=g=c([m(0,u.IRenderService),m(1,u.ICharSizeService)],g)},3230:function(a,s,l){var c=this&&this.__decorate||function(d,v,b,E){var C,R=arguments.length,w=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,v,b,E);else for(var k=d.length-1;k>=0;k--)(C=d[k])&&(w=(R<3?C(w):R>3?C(v,b,w):C(v,b))||w);return R>3&&w&&Object.defineProperty(v,b,w),w},m=this&&this.__param||function(d,v){return function(b,E){v(b,E,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=l(6193),p=l(4725),g=l(8460),y=l(844),_=l(7226),h=l(2585);let f=s.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,v,b,E,C,R,w,k){super(),this._rowCount=d,this._charSizeService=E,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new y.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((L,A)=>this._renderRows(L,A),w),this.register(this._renderDebouncer),this.register(w.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(R.onResize(()=>this._fullRefresh())),this.register(R.buffers.onBufferActivate(()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()})),this.register(b.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(C.onDecorationRegistered(()=>this._fullRefresh())),this.register(C.onDecorationRemoved(()=>this._fullRefresh())),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()})),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(R.buffer.y,R.buffer.y,!0))),this.register(k.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(w.window,v),this.register(w.onWindowChange(L=>this._registerIntersectionObserver(L,v)))}_registerIntersectionObserver(d,v){if("IntersectionObserver"in d){const b=new d.IntersectionObserver(E=>this._handleIntersectionChange(E[E.length-1]),{threshold:0});b.observe(v),this._observerDisposable.value=(0,y.toDisposable)(()=>b.disconnect())}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.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(d,v,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,v,this._rowCount))}_renderRows(d,v){this._renderer.value&&(d=Math.min(d,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(d,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:v}),this._onRender.fire({start:d,end:v}),this._isNextRenderRedrawOnly=!0)}resize(d,v){this._rowCount=v,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(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw(v=>this.refreshRows(v.start,v.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,v;this._renderer.value&&((v=(d=this._renderer.value).clearTextureAtlas)==null||v.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(d,v)):this._renderer.value.handleResize(d,v),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,v,b){var E;this._selectionState.start=d,this._selectionState.end=v,this._selectionState.columnSelectMode=b,(E=this._renderer.value)==null||E.handleSelectionChanged(d,v,b)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};s.RenderService=f=c([m(2,h.IOptionsService),m(3,p.ICharSizeService),m(4,h.IDecorationService),m(5,h.IBufferService),m(6,p.ICoreBrowserService),m(7,p.IThemeService)],f)},9312:function(a,s,l){var c=this&&this.__decorate||function(w,k,L,A){var D,P=arguments.length,$=P<3?k:A===null?A=Object.getOwnPropertyDescriptor(k,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(w,k,L,A);else for(var I=w.length-1;I>=0;I--)(D=w[I])&&($=(P<3?D($):P>3?D(k,L,$):D(k,L))||$);return P>3&&$&&Object.defineProperty(k,L,$),$},m=this&&this.__param||function(w,k){return function(L,A){k(L,A,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=l(9806),p=l(9504),g=l(456),y=l(4725),_=l(8460),h=l(844),f=l(6114),d=l(4841),v=l(511),b=l(2585),E=" ",C=new RegExp(E,"g");let R=s.SelectionService=class extends h.Disposable{constructor(w,k,L,A,D,P,$,I,F){super(),this._element=w,this._screenElement=k,this._linkifier=L,this._bufferService=A,this._coreService=D,this._mouseService=P,this._optionsService=$,this._renderService=I,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=U=>this._handleMouseMove(U),this._mouseUpListener=U=>this._handleMouseUp(U),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(U=>this._handleTrim(U)),this.register(this._bufferService.buffers.onBufferActivate(U=>this._handleBufferActivate(U))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const w=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!w||!k||w[0]===k[0]&&w[1]===k[1])}get selectionText(){const w=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!w||!k)return"";const L=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(w[0]===k[0])return"";const D=w[0]<k[0]?w[0]:k[0],P=w[0]<k[0]?k[0]:w[0];for(let $=w[1];$<=k[1];$++){const I=L.translateBufferLineToString($,!0,D,P);A.push(I)}}else{const D=w[1]===k[1]?k[0]:void 0;A.push(L.translateBufferLineToString(w[1],!0,w[0],D));for(let P=w[1]+1;P<=k[1]-1;P++){const $=L.lines.get(P),I=L.translateBufferLineToString(P,!0);$!=null&&$.isWrapped?A[A.length-1]+=I:A.push(I)}if(w[1]!==k[1]){const P=L.lines.get(k[1]),$=L.translateBufferLineToString(k[1],!0,0,k[0]);P&&P.isWrapped?A[A.length-1]+=$:A.push($)}}return A.map(D=>D.replace(C," ")).join(f.isWindows?`\r
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),f.isLinux&&w&&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(w){const k=this._getMouseBufferCoords(w),L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(L&&A&&k)&&this._areCoordsInSelection(k,L,A)}isCellInSelection(w,k){const L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!L||!A)&&this._areCoordsInSelection([w,k],L,A)}_areCoordsInSelection(w,k,L){return w[1]>k[1]&&w[1]<L[1]||k[1]===L[1]&&w[1]===k[1]&&w[0]>=k[0]&&w[0]<L[0]||k[1]<L[1]&&w[1]===L[1]&&w[0]<L[0]||k[1]<L[1]&&w[1]===k[1]&&w[0]>=k[0]}_selectWordAtCursor(w,k){var D,P;const L=(P=(D=this._linkifier.currentLink)==null?void 0:D.link)==null?void 0:P.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(w);return!!A&&(this._selectWordAt(A,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,k){this._model.clearSelection(),w=Math.max(w,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const k=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(w){let k=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=L?0:(k>L&&(k-=L),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(w){return f.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const k=this._getMouseBufferCoords(w);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(w){return w.altKey&&!(f.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const A=L.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const k=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const A=(0,p.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,L=!(!w||!k||w[0]===k[0]&&w[1]===k[1]);L?w&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,k,L)):this._oldHasSelection&&this._fireOnSelectionChange(w,k,L)}_fireOnSelectionChange(w,k,L){this._oldSelectionStart=w,this._oldSelectionEnd=k,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(w,k){let L=k;for(let A=0;k>=A;A++){const D=w.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:D>1&&k!==A&&(L+=D-1)}return L}setSelection(w,k,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,k],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,k,L=!0,A=!0){if(w[0]>=this._bufferService.cols)return;const D=this._bufferService.buffer,P=D.lines.get(w[1]);if(!P)return;const $=D.translateBufferLineToString(w[1],!1);let I=this._convertViewportColToCharacterIndex(P,w[0]),F=I;const U=w[0]-I;let j=0,T=0,M=0,B=0;if($.charAt(I)===" "){for(;I>0&&$.charAt(I-1)===" ";)I--;for(;F<$.length&&$.charAt(F+1)===" ";)F++}else{let X=w[0],re=w[0];P.getWidth(X)===0&&(j++,X--),P.getWidth(re)===2&&(T++,re++);const H=P.getString(re).length;for(H>1&&(B+=H-1,F+=H-1);X>0&&I>0&&!this._isCharWordSeparator(P.loadCell(X-1,this._workCell));){P.loadCell(X-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,X--):W>1&&(M+=W-1,I-=W-1),I--,X--}for(;re<P.length&&F+1<$.length&&!this._isCharWordSeparator(P.loadCell(re+1,this._workCell));){P.loadCell(re+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,re++):W>1&&(B+=W-1,F+=W-1),F++,re++}}F++;let z=I+U-j+M,O=Math.min(this._bufferService.cols,F-I+j+T-M-B);if(k||$.slice(I,F).trim()!==""){if(L&&z===0&&P.getCodePoint(0)!==32){const X=D.lines.get(w[1]-1);if(X&&P.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(re){const H=this._bufferService.cols-re.start;z-=H,O+=H}}}if(A&&z+O===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const X=D.lines.get(w[1]+1);if(X!=null&&X.isWrapped&&X.getCodePoint(0)!==32){const re=this._getWordAt([0,w[1]+1],!1,!1,!0);re&&(O+=re.length)}}return{start:z,length:O}}}_selectWordAt(w,k){const L=this._getWordAt(w,k);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[L.start,w[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(w){const k=this._getWordAt(w,!0);if(k){let L=w[1];for(;k.start<0;)k.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,L]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const k=this._bufferService.buffer.getWrappedRangeForLine(w),L={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(L,this._bufferService.cols)}};s.SelectionService=R=c([m(3,b.IBufferService),m(4,b.ICoreService),m(5,y.IMouseService),m(6,b.IOptionsService),m(7,y.IRenderService),m(8,y.ICoreBrowserService)],R)},4725:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=l(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(a,s,l){var c=this&&this.__decorate||function(R,w,k,L){var A,D=arguments.length,P=D<3?w:L===null?L=Object.getOwnPropertyDescriptor(w,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(R,w,k,L);else for(var $=R.length-1;$>=0;$--)(A=R[$])&&(P=(D<3?A(P):D>3?A(w,k,P):A(w,k))||P);return D>3&&P&&Object.defineProperty(w,k,P),P},m=this&&this.__param||function(R,w){return function(k,L){w(k,L,R)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=l(7239),p=l(8055),g=l(8460),y=l(844),_=l(2585),h=p.css.toColor("#ffffff"),f=p.css.toColor("#000000"),d=p.css.toColor("#ffffff"),v=p.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let k=0;k<216;k++){const L=w[k/36%6|0],A=w[k/6%6|0],D=w[k%6];R.push({css:p.channels.toCss(L,A,D),rgba:p.channels.toRgba(L,A,D)})}for(let k=0;k<24;k++){const L=8+10*k;R.push({css:p.channels.toCss(L,L,L),rgba:p.channels.toRgba(L,L,L)})}return R})());let E=s.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:f,cursor:d,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:p.color.blend(f,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:p.color.blend(f,b),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(R={}){const w=this._colors;if(w.foreground=C(R.foreground,h),w.background=C(R.background,f),w.cursor=C(R.cursor,d),w.cursorAccent=C(R.cursorAccent,v),w.selectionBackgroundTransparent=C(R.selectionBackground,b),w.selectionBackgroundOpaque=p.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=C(R.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=p.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=R.selectionForeground?C(R.selectionForeground,p.NULL_COLOR):void 0,w.selectionForeground===p.NULL_COLOR&&(w.selectionForeground=void 0),p.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=p.color.opacity(w.selectionBackgroundTransparent,.3)),p.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=p.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=s.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=C(R.black,s.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=C(R.red,s.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=C(R.green,s.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=C(R.yellow,s.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=C(R.blue,s.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=C(R.magenta,s.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=C(R.cyan,s.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=C(R.white,s.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=C(R.brightBlack,s.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=C(R.brightRed,s.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=C(R.brightGreen,s.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=C(R.brightYellow,s.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=C(R.brightBlue,s.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=C(R.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=C(R.brightCyan,s.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=C(R.brightWhite,s.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const k=Math.min(w.ansi.length-16,R.extendedAnsi.length);for(let L=0;L<k;L++)w.ansi[L+16]=C(R.extendedAnsi[L],s.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}modifyColors(R){R(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function C(R,w){if(R!==void 0)try{return p.css.toColor(R)}catch{}return w}s.ThemeService=E=c([m(0,_.IOptionsService)],E)},6349:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=l(8460),m=l(844);class u extends m.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const y=new Array(g);for(let _=0;_<Math.min(g,this.length);_++)y[_]=this._array[this._getCyclicIndex(_)];this._array=y,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let y=this._length;y<g;y++)this._array[y]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,y){this._array[this._getCyclicIndex(g)]=y}push(g){this._array[this._getCyclicIndex(this._length)]=g,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(g,y,..._){if(y){for(let h=g;h<this._length-y;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+y)];this._length-=y,this.onDeleteEmitter.fire({index:g,amount:y})}for(let h=this._length-1;h>=g;h--)this._array[this._getCyclicIndex(h+_.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<_.length;h++)this._array[this._getCyclicIndex(g+h)]=_[h];if(_.length&&this.onInsertEmitter.fire({index:g,amount:_.length}),this._length+_.length>this._maxLength){const h=this._length+_.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=_.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,y,_){if(!(y<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let f=y-1;f>=0;f--)this.set(g+f+_,this.get(g+f));const h=g+y+_-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<y;h++)this.set(g+h+_,this.get(g+h))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}s.CircularList=u},1439:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function l(c,m=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const p in c)u[p]=m<=1?c[p]:c[p]&&l(c[p],m-1);return u}},8055:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const c=l(6114);let m=0,u=0,p=0,g=0;var y,_,h,f,d;function v(E){const C=E.toString(16);return C.length<2?"0"+C:C}function b(E,C){return E<C?(C+.05)/(E+.05):(E+.05)/(C+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(E){E.toCss=function(C,R,w,k){return k!==void 0?`#${v(C)}${v(R)}${v(w)}${v(k)}`:`#${v(C)}${v(R)}${v(w)}`},E.toRgba=function(C,R,w,k=255){return(C<<24|R<<16|w<<8|k)>>>0}}(y||(s.channels=y={})),function(E){function C(R,w){return g=Math.round(255*w),[m,u,p]=d.toChannels(R.rgba),{css:y.toCss(m,u,p,g),rgba:y.toRgba(m,u,p,g)}}E.blend=function(R,w){if(g=(255&w.rgba)/255,g===1)return{css:w.css,rgba:w.rgba};const k=w.rgba>>24&255,L=w.rgba>>16&255,A=w.rgba>>8&255,D=R.rgba>>24&255,P=R.rgba>>16&255,$=R.rgba>>8&255;return m=D+Math.round((k-D)*g),u=P+Math.round((L-P)*g),p=$+Math.round((A-$)*g),{css:y.toCss(m,u,p),rgba:y.toRgba(m,u,p)}},E.isOpaque=function(R){return(255&R.rgba)==255},E.ensureContrastRatio=function(R,w,k){const L=d.ensureContrastRatio(R.rgba,w.rgba,k);if(L)return d.toColor(L>>24&255,L>>16&255,L>>8&255)},E.opaque=function(R){const w=(255|R.rgba)>>>0;return[m,u,p]=d.toChannels(w),{css:y.toCss(m,u,p),rgba:w}},E.opacity=C,E.multiplyOpacity=function(R,w){return g=255&R.rgba,C(R,g*w/255)},E.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}}(_||(s.color=_={})),function(E){let C,R;if(!c.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const k=w.getContext("2d",{willReadFrequently:!0});k&&(C=k,C.globalCompositeOperation="copy",R=C.createLinearGradient(0,0,1,1))}E.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return m=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),p=parseInt(w.slice(3,4).repeat(2),16),d.toColor(m,u,p);case 5:return m=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),p=parseInt(w.slice(3,4).repeat(2),16),g=parseInt(w.slice(4,5).repeat(2),16),d.toColor(m,u,p,g);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const k=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return m=parseInt(k[1]),u=parseInt(k[2]),p=parseInt(k[3]),g=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),d.toColor(m,u,p,g);if(!C||!R)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=R,C.fillStyle=w,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[m,u,p,g]=C.getImageData(0,0,1,1).data,g!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(m,u,p,g),css:w}}}(h||(s.css=h={})),function(E){function C(R,w,k){const L=R/255,A=w/255,D=k/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}E.relativeLuminance=function(R){return C(R>>16&255,R>>8&255,255&R)},E.relativeLuminance2=C}(f||(s.rgb=f={})),function(E){function C(w,k,L){const A=w>>24&255,D=w>>16&255,P=w>>8&255;let $=k>>24&255,I=k>>16&255,F=k>>8&255,U=b(f.relativeLuminance2($,I,F),f.relativeLuminance2(A,D,P));for(;U<L&&($>0||I>0||F>0);)$-=Math.max(0,Math.ceil(.1*$)),I-=Math.max(0,Math.ceil(.1*I)),F-=Math.max(0,Math.ceil(.1*F)),U=b(f.relativeLuminance2($,I,F),f.relativeLuminance2(A,D,P));return($<<24|I<<16|F<<8|255)>>>0}function R(w,k,L){const A=w>>24&255,D=w>>16&255,P=w>>8&255;let $=k>>24&255,I=k>>16&255,F=k>>8&255,U=b(f.relativeLuminance2($,I,F),f.relativeLuminance2(A,D,P));for(;U<L&&($<255||I<255||F<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),I=Math.min(255,I+Math.ceil(.1*(255-I))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=b(f.relativeLuminance2($,I,F),f.relativeLuminance2(A,D,P));return($<<24|I<<16|F<<8|255)>>>0}E.blend=function(w,k){if(g=(255&k)/255,g===1)return k;const L=k>>24&255,A=k>>16&255,D=k>>8&255,P=w>>24&255,$=w>>16&255,I=w>>8&255;return m=P+Math.round((L-P)*g),u=$+Math.round((A-$)*g),p=I+Math.round((D-I)*g),y.toRgba(m,u,p)},E.ensureContrastRatio=function(w,k,L){const A=f.relativeLuminance(w>>8),D=f.relativeLuminance(k>>8);if(b(A,D)<L){if(D<A){const I=C(w,k,L),F=b(A,f.relativeLuminance(I>>8));if(F<L){const U=R(w,k,L);return F>b(A,f.relativeLuminance(U>>8))?I:U}return I}const P=R(w,k,L),$=b(A,f.relativeLuminance(P>>8));if($<L){const I=C(w,k,L);return $>b(A,f.relativeLuminance(I>>8))?P:I}return P}},E.reduceLuminance=C,E.increaseLuminance=R,E.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},E.toColor=function(w,k,L,A){return{css:y.toCss(w,k,L,A),rgba:y.toRgba(w,k,L,A)}}}(d||(s.rgba=d={})),s.toPaddedHex=v,s.contrastRatio=b},8969:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=l(844),m=l(2585),u=l(4348),p=l(7866),g=l(744),y=l(7302),_=l(6975),h=l(8460),f=l(1753),d=l(1480),v=l(7994),b=l(9282),E=l(5435),C=l(5981),R=l(2660);let w=!1;class k extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(A=>{var D;(D=this._onScrollApi)==null||D.fire(A.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(A){for(const D in A)this.optionsService.options[D]=A[D]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new y.OptionsService(A)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(f.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(v.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(D=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(D=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new C.WriteBuffer((D,P)=>this._inputHandler.parse(D,P))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,D){this._writeBuffer.write(A,D)}writeSync(A,D){this._logService.logLevel<=m.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(A,D)}resize(A,D){isNaN(A)||isNaN(D)||(A=Math.max(A,g.MINIMUM_COLS),D=Math.max(D,g.MINIMUM_ROWS),this._bufferService.resize(A,D))}scroll(A,D=!1){this._bufferService.scroll(A,D)}scrollLines(A,D,P){this._bufferService.scrollLines(A,D,P)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const D=A-this._bufferService.buffer.ydisp;D!==0&&this.scrollLines(D)}registerEscHandler(A,D){return this._inputHandler.registerEscHandler(A,D)}registerDcsHandler(A,D){return this._inputHandler.registerDcsHandler(A,D)}registerCsiHandler(A,D){return this._inputHandler.registerCsiHandler(A,D)}registerOscHandler(A,D){return this._inputHandler.registerOscHandler(A,D)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?A=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const D of A)D.dispose()})}}}s.CoreTerminal=k},8460:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const m=[];for(let u=0;u<this._listeners.length;u++)m.push(this._listeners[u]);for(let u=0;u<m.length;u++)m[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(l,c){return l(m=>c.fire(m))},s.runAndSubscribe=function(l,c){return c(void 0),l(m=>c(m))}},5435:function(a,s,l){var c=this&&this.__decorate||function(j,T,M,B){var z,O=arguments.length,X=O<3?T:B===null?B=Object.getOwnPropertyDescriptor(T,M):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(j,T,M,B);else for(var re=j.length-1;re>=0;re--)(z=j[re])&&(X=(O<3?z(X):O>3?z(T,M,X):z(T,M))||X);return O>3&&X&&Object.defineProperty(T,M,X),X},m=this&&this.__param||function(j,T){return function(M,B){T(M,B,j)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=l(2584),p=l(7116),g=l(2015),y=l(844),_=l(482),h=l(8437),f=l(8460),d=l(643),v=l(511),b=l(3734),E=l(2585),C=l(1480),R=l(6242),w=l(6351),k=l(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function D(j,T){if(j>24)return T.setWinLines||!1;switch(j){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 P;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(s.WindowsOptionsReportType=P={}));let $=0;class I extends y.Disposable{getAttrData(){return this._curAttrData}constructor(T,M,B,z,O,X,re,H,W=new g.EscapeSequenceParser){super(),this._bufferService=T,this._charsetService=M,this._coreService=B,this._logService=z,this._optionsService=O,this._oscLinkService=X,this._coreMouseService=re,this._unicodeService=H,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new f.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new f.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new f.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new f.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new f.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new f.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new f.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new f.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new f.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new f.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new f.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(N=>this._activeBuffer=N.activeBuffer)),this._parser.setCsiHandlerFallback((N,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(N),params:K.toArray()})}),this._parser.setEscHandlerFallback(N=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(N)})}),this._parser.setExecuteHandlerFallback(N=>{this._logService.debug("Unknown EXECUTE code: ",{code:N})}),this._parser.setOscHandlerFallback((N,K,Q)=>{this._logService.debug("Unknown OSC code: ",{identifier:N,action:K,data:Q})}),this._parser.setDcsHandlerFallback((N,K,Q)=>{K==="HOOK"&&(Q=Q.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(N),action:K,payload:Q})}),this._parser.setPrintHandler((N,K,Q)=>this.print(N,K,Q)),this._parser.registerCsiHandler({final:"@"},N=>this.insertChars(N)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},N=>this.scrollLeft(N)),this._parser.registerCsiHandler({final:"A"},N=>this.cursorUp(N)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},N=>this.scrollRight(N)),this._parser.registerCsiHandler({final:"B"},N=>this.cursorDown(N)),this._parser.registerCsiHandler({final:"C"},N=>this.cursorForward(N)),this._parser.registerCsiHandler({final:"D"},N=>this.cursorBackward(N)),this._parser.registerCsiHandler({final:"E"},N=>this.cursorNextLine(N)),this._parser.registerCsiHandler({final:"F"},N=>this.cursorPrecedingLine(N)),this._parser.registerCsiHandler({final:"G"},N=>this.cursorCharAbsolute(N)),this._parser.registerCsiHandler({final:"H"},N=>this.cursorPosition(N)),this._parser.registerCsiHandler({final:"I"},N=>this.cursorForwardTab(N)),this._parser.registerCsiHandler({final:"J"},N=>this.eraseInDisplay(N,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},N=>this.eraseInDisplay(N,!0)),this._parser.registerCsiHandler({final:"K"},N=>this.eraseInLine(N,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},N=>this.eraseInLine(N,!0)),this._parser.registerCsiHandler({final:"L"},N=>this.insertLines(N)),this._parser.registerCsiHandler({final:"M"},N=>this.deleteLines(N)),this._parser.registerCsiHandler({final:"P"},N=>this.deleteChars(N)),this._parser.registerCsiHandler({final:"S"},N=>this.scrollUp(N)),this._parser.registerCsiHandler({final:"T"},N=>this.scrollDown(N)),this._parser.registerCsiHandler({final:"X"},N=>this.eraseChars(N)),this._parser.registerCsiHandler({final:"Z"},N=>this.cursorBackwardTab(N)),this._parser.registerCsiHandler({final:"`"},N=>this.charPosAbsolute(N)),this._parser.registerCsiHandler({final:"a"},N=>this.hPositionRelative(N)),this._parser.registerCsiHandler({final:"b"},N=>this.repeatPrecedingCharacter(N)),this._parser.registerCsiHandler({final:"c"},N=>this.sendDeviceAttributesPrimary(N)),this._parser.registerCsiHandler({prefix:">",final:"c"},N=>this.sendDeviceAttributesSecondary(N)),this._parser.registerCsiHandler({final:"d"},N=>this.linePosAbsolute(N)),this._parser.registerCsiHandler({final:"e"},N=>this.vPositionRelative(N)),this._parser.registerCsiHandler({final:"f"},N=>this.hVPosition(N)),this._parser.registerCsiHandler({final:"g"},N=>this.tabClear(N)),this._parser.registerCsiHandler({final:"h"},N=>this.setMode(N)),this._parser.registerCsiHandler({prefix:"?",final:"h"},N=>this.setModePrivate(N)),this._parser.registerCsiHandler({final:"l"},N=>this.resetMode(N)),this._parser.registerCsiHandler({prefix:"?",final:"l"},N=>this.resetModePrivate(N)),this._parser.registerCsiHandler({final:"m"},N=>this.charAttributes(N)),this._parser.registerCsiHandler({final:"n"},N=>this.deviceStatus(N)),this._parser.registerCsiHandler({prefix:"?",final:"n"},N=>this.deviceStatusPrivate(N)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},N=>this.softReset(N)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},N=>this.setCursorStyle(N)),this._parser.registerCsiHandler({final:"r"},N=>this.setScrollRegion(N)),this._parser.registerCsiHandler({final:"s"},N=>this.saveCursor(N)),this._parser.registerCsiHandler({final:"t"},N=>this.windowOptions(N)),this._parser.registerCsiHandler({final:"u"},N=>this.restoreCursor(N)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},N=>this.insertColumns(N)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},N=>this.deleteColumns(N)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},N=>this.selectProtected(N)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},N=>this.requestMode(N,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},N=>this.requestMode(N,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new R.OscHandler(N=>(this.setTitle(N),this.setIconName(N),!0))),this._parser.registerOscHandler(1,new R.OscHandler(N=>this.setIconName(N))),this._parser.registerOscHandler(2,new R.OscHandler(N=>this.setTitle(N))),this._parser.registerOscHandler(4,new R.OscHandler(N=>this.setOrReportIndexedColor(N))),this._parser.registerOscHandler(8,new R.OscHandler(N=>this.setHyperlink(N))),this._parser.registerOscHandler(10,new R.OscHandler(N=>this.setOrReportFgColor(N))),this._parser.registerOscHandler(11,new R.OscHandler(N=>this.setOrReportBgColor(N))),this._parser.registerOscHandler(12,new R.OscHandler(N=>this.setOrReportCursorColor(N))),this._parser.registerOscHandler(104,new R.OscHandler(N=>this.restoreIndexedColor(N))),this._parser.registerOscHandler(110,new R.OscHandler(N=>this.restoreFgColor(N))),this._parser.registerOscHandler(111,new R.OscHandler(N=>this.restoreBgColor(N))),this._parser.registerOscHandler(112,new R.OscHandler(N=>this.restoreCursorColor(N))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const N in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:N},()=>this.selectCharset("("+N)),this._parser.registerEscHandler({intermediates:")",final:N},()=>this.selectCharset(")"+N)),this._parser.registerEscHandler({intermediates:"*",final:N},()=>this.selectCharset("*"+N)),this._parser.registerEscHandler({intermediates:"+",final:N},()=>this.selectCharset("+"+N)),this._parser.registerEscHandler({intermediates:"-",final:N},()=>this.selectCharset("-"+N)),this._parser.registerEscHandler({intermediates:".",final:N},()=>this.selectCharset("."+N)),this._parser.registerEscHandler({intermediates:"/",final:N},()=>this.selectCharset("/"+N));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(N=>(this._logService.error("Parsing error: ",N),N)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new w.DcsHandler((N,K)=>this.requestStatusString(N,K)))}_preserveStack(T,M,B,z){this._parseStack.paused=!0,this._parseStack.cursorStartX=T,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=B,this._parseStack.position=z}_logSlowResolvingAsync(T){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([T,new Promise((M,B)=>setTimeout(()=>B("#SLOW_TIMEOUT"),5e3))]).catch(M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(T,M){let B,z=this._activeBuffer.x,O=this._activeBuffer.y,X=0;const re=this._parseStack.paused;if(re){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(B),B;z=this._parseStack.cursorStartX,O=this._parseStack.cursorStartY,this._parseStack.paused=!1,T.length>A&&(X=this._parseStack.position+A)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof T=="string"?` "${T}"`:` "${Array.prototype.map.call(T,N=>String.fromCharCode(N)).join("")}"`),typeof T=="string"?T.split("").map(N=>N.charCodeAt(0)):T),this._parseBuffer.length<T.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(T.length,A))),re||this._dirtyRowTracker.clearRange(),T.length>A)for(let N=X;N<T.length;N+=A){const K=N+A<T.length?N+A:T.length,Q=typeof T=="string"?this._stringDecoder.decode(T.substring(N,K),this._parseBuffer):this._utf8Decoder.decode(T.subarray(N,K),this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,Q))return this._preserveStack(z,O,Q,N),this._logSlowResolvingAsync(B),B}else if(!re){const N=typeof T=="string"?this._stringDecoder.decode(T,this._parseBuffer):this._utf8Decoder.decode(T,this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,N))return this._preserveStack(z,O,N,0),this._logSlowResolvingAsync(B),B}this._activeBuffer.x===z&&this._activeBuffer.y===O||this._onCursorMove.fire();const H=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(H,this._bufferService.rows-1))}print(T,M,B){let z,O;const X=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,H=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,N=this._coreService.modes.insertMode,K=this._curAttrData;let Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&B-M>0&&Q.getWidth(this._activeBuffer.x-1)===2&&Q.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let q=this._parser.precedingJoinState;for(let de=M;de<B;++de){if(z=T[de],z<127&&X){const Be=X[String.fromCharCode(z)];Be&&(z=Be.charCodeAt(0))}const he=this._unicodeService.charProperties(z,q);O=C.UnicodeService.extractWidth(he);const le=C.UnicodeService.extractShouldJoin(he),Ae=le?C.UnicodeService.extractWidth(q):0;if(q=he,re&&this._onA11yChar.fire((0,_.stringFromCodePoint)(z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+O-Ae>H){if(W){const Be=Q;let ue=this._activeBuffer.x-Ae;for(this._activeBuffer.x=Ae,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),Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ae>0&&Q instanceof h.BufferLine&&Q.copyCellsFrom(Be,ue,0,Ae,!1);ue<H;)Be.setCellFromCodepoint(ue++,0,1,K)}else if(this._activeBuffer.x=H-1,O===2)continue}if(le&&this._activeBuffer.x){const Be=Q.getWidth(this._activeBuffer.x-1)?1:2;Q.addCodepointToCell(this._activeBuffer.x-Be,z,O);for(let ue=O-Ae;--ue>=0;)Q.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(N&&(Q.insertCells(this._activeBuffer.x,O-Ae,this._activeBuffer.getNullCell(K)),Q.getWidth(H-1)===2&&Q.setCellFromCodepoint(H-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,K)),Q.setCellFromCodepoint(this._activeBuffer.x++,z,O,K),O>0)for(;--O;)Q.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=q,this._activeBuffer.x<H&&B-M>0&&Q.getWidth(this._activeBuffer.x)===0&&!Q.hasContent(this._activeBuffer.x)&&Q.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(T,M){return T.final!=="t"||T.prefix||T.intermediates?this._parser.registerCsiHandler(T,M):this._parser.registerCsiHandler(T,B=>!D(B.params[0],this._optionsService.rawOptions.windowOptions)||M(B))}registerDcsHandler(T,M){return this._parser.registerDcsHandler(T,new w.DcsHandler(M))}registerEscHandler(T,M){return this._parser.registerEscHandler(T,M)}registerOscHandler(T,M){return this._parser.registerOscHandler(T,new R.OscHandler(M))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var T;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&&((T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&T.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const T=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-T),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(T=this._bufferService.cols-1){this._activeBuffer.x=Math.min(T,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(T,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=T,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=T,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(T,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+T,this._activeBuffer.y+M)}cursorUp(T){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,T.params[0]||1)):this._moveCursor(0,-(T.params[0]||1)),!0}cursorDown(T){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,T.params[0]||1)):this._moveCursor(0,T.params[0]||1),!0}cursorForward(T){return this._moveCursor(T.params[0]||1,0),!0}cursorBackward(T){return this._moveCursor(-(T.params[0]||1),0),!0}cursorNextLine(T){return this.cursorDown(T),this._activeBuffer.x=0,!0}cursorPrecedingLine(T){return this.cursorUp(T),this._activeBuffer.x=0,!0}cursorCharAbsolute(T){return this._setCursor((T.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(T){return this._setCursor(T.length>=2?(T.params[1]||1)-1:0,(T.params[0]||1)-1),!0}charPosAbsolute(T){return this._setCursor((T.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(T){return this._moveCursor(T.params[0]||1,0),!0}linePosAbsolute(T){return this._setCursor(this._activeBuffer.x,(T.params[0]||1)-1),!0}vPositionRelative(T){return this._moveCursor(0,T.params[0]||1),!0}hVPosition(T){return this.cursorPosition(T),!0}tabClear(T){const M=T.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(T){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=T.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(T){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=T.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(T){const M=T.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(T,M,B,z=!1,O=!1){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);X.replaceCells(M,B,this._activeBuffer.getNullCell(this._eraseAttrData()),O),z&&(X.isWrapped=!1)}_resetBufferLine(T,M=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+T),B.isWrapped=!1)}eraseInDisplay(T,M=!1){let B;switch(this._restrictCursor(this._bufferService.cols),T.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);B<this._bufferService.rows;B++)this._resetBufferLine(B,M);this._dirtyRowTracker.markDirty(B);break;case 1:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,M);this._dirtyRowTracker.markDirty(0);break;case 3:const z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0}eraseInLine(T,M=!1){switch(this._restrictCursor(this._bufferService.cols),T.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(T){this._restrictCursor();let M=T.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y,z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-z+1;for(;M--;)this._activeBuffer.lines.splice(O-1,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(T){this._restrictCursor();let M=T.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y;let z;for(z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-z;M--;)this._activeBuffer.lines.splice(B,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(T){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,T.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(T){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,T.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(T){let M=T.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(T){let M=T.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=T.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);z.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=T.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);z.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=T.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);z.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=T.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);z.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(T){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(T.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(T){const M=this._parser.precedingJoinState;if(!M)return!0;const B=T.params[0]||1,z=C.UnicodeService.extractWidth(M),O=this._activeBuffer.x-z,X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(O),re=new Uint32Array(X.length*B);let H=0;for(let N=0;N<X.length;){const K=X.codePointAt(N)||0;re[H++]=K,N+=K>65535?2:1}let W=H;for(let N=1;N<B;++N)re.copyWithin(W,0,H),W+=H;return this.print(re,0,W),!0}sendDeviceAttributesPrimary(T){return T.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(T){return T.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(T.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(T){return(this._optionsService.rawOptions.termName+"").indexOf(T)===0}setMode(T){for(let M=0;M<T.length;M++)switch(T.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(T){for(let M=0;M<T.length;M++)switch(T.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(T){for(let M=0;M<T.length;M++)switch(T.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(T){for(let M=0;M<T.length;M++)switch(T.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),T.params[M]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(T,M){const B=this._coreService.decPrivateModes,{activeProtocol:z,activeEncoding:O}=this._coreMouseService,X=this._coreService,{buffers:re,cols:H}=this._bufferService,{active:W,alt:N}=re,K=this._optionsService.rawOptions,Q=le=>le?1:2,q=T.params[0];return de=q,he=M?q===2?4:q===4?Q(X.modes.insertMode):q===12?3:q===20?Q(K.convertEol):0:q===1?Q(B.applicationCursorKeys):q===3?K.windowOptions.setWinLines?H===80?2:H===132?1:0:0:q===6?Q(B.origin):q===7?Q(B.wraparound):q===8?3:q===9?Q(z==="X10"):q===12?Q(K.cursorBlink):q===25?Q(!X.isCursorHidden):q===45?Q(B.reverseWraparound):q===66?Q(B.applicationKeypad):q===67?4:q===1e3?Q(z==="VT200"):q===1002?Q(z==="DRAG"):q===1003?Q(z==="ANY"):q===1004?Q(B.sendFocus):q===1005?4:q===1006?Q(O==="SGR"):q===1015?4:q===1016?Q(O==="SGR_PIXELS"):q===1048?1:q===47||q===1047||q===1049?Q(W===N):q===2004?Q(B.bracketedPasteMode):0,X.triggerDataEvent(`${u.C0.ESC}[${M?"":"?"}${de};${he}$y`),!0;var de,he}_updateAttrColor(T,M,B,z,O){return M===2?(T|=50331648,T&=-16777216,T|=b.AttributeData.fromColorRGB([B,z,O])):M===5&&(T&=-50331904,T|=33554432|255&B),T}_extractColor(T,M,B){const z=[0,0,-1,0,0,0];let O=0,X=0;do{if(z[X+O]=T.params[M+X],T.hasSubParams(M+X)){const re=T.getSubParams(M+X);let H=0;do z[1]===5&&(O=1),z[X+H+1+O]=re[H];while(++H<re.length&&H+X+1+O<z.length);break}if(z[1]===5&&X+O>=2||z[1]===2&&X+O>=5)break;z[1]&&(O=1)}while(++X+M<T.length&&X+O<z.length);for(let re=2;re<z.length;++re)z[re]===-1&&(z[re]=0);switch(z[0]){case 38:B.fg=this._updateAttrColor(B.fg,z[1],z[3],z[4],z[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,z[1],z[3],z[4],z[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,z[1],z[3],z[4],z[5])}return X}_processUnderline(T,M){M.extended=M.extended.clone(),(!~T||T>5)&&(T=1),M.extended.underlineStyle=T,M.fg|=268435456,T===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(T){T.fg=h.DEFAULT_ATTR_DATA.fg,T.bg=h.DEFAULT_ATTR_DATA.bg,T.extended=T.extended.clone(),T.extended.underlineStyle=0,T.extended.underlineColor&=-67108864,T.updateExtended()}charAttributes(T){if(T.length===1&&T.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=T.length;let B;const z=this._curAttrData;for(let O=0;O<M;O++)B=T.params[O],B>=30&&B<=37?(z.fg&=-50331904,z.fg|=16777216|B-30):B>=40&&B<=47?(z.bg&=-50331904,z.bg|=16777216|B-40):B>=90&&B<=97?(z.fg&=-50331904,z.fg|=16777224|B-90):B>=100&&B<=107?(z.bg&=-50331904,z.bg|=16777224|B-100):B===0?this._processSGR0(z):B===1?z.fg|=134217728:B===3?z.bg|=67108864:B===4?(z.fg|=268435456,this._processUnderline(T.hasSubParams(O)?T.getSubParams(O)[0]:1,z)):B===5?z.fg|=536870912:B===7?z.fg|=67108864:B===8?z.fg|=1073741824:B===9?z.fg|=2147483648:B===2?z.bg|=134217728:B===21?this._processUnderline(2,z):B===22?(z.fg&=-134217729,z.bg&=-134217729):B===23?z.bg&=-67108865:B===24?(z.fg&=-268435457,this._processUnderline(0,z)):B===25?z.fg&=-536870913:B===27?z.fg&=-67108865:B===28?z.fg&=-1073741825:B===29?z.fg&=2147483647:B===39?(z.fg&=-67108864,z.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):B===49?(z.bg&=-67108864,z.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?O+=this._extractColor(T,O,z):B===53?z.bg|=1073741824:B===55?z.bg&=-1073741825:B===59?(z.extended=z.extended.clone(),z.extended.underlineColor=-1,z.updateExtended()):B===100?(z.fg&=-67108864,z.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,z.bg&=-67108864,z.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(T){switch(T.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${M};${B}R`)}return!0}deviceStatusPrivate(T){if(T.params[0]===6){const M=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${M};${B}R`)}return!0}softReset(T){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(T){const M=T.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const B=M%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(T){const M=T.params[0]||1;let B;return(T.length<2||(B=T.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(T){if(!D(T.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=T.length>1?T.params[1]:0;switch(T.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(T){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(T){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(T){return this._windowTitle=T,this._onTitleChange.fire(T),!0}setIconName(T){return this._iconName=T,!0}setOrReportIndexedColor(T){const M=[],B=T.split(";");for(;B.length>1;){const z=B.shift(),O=B.shift();if(/^\d+$/.exec(z)){const X=parseInt(z);if(U(X))if(O==="?")M.push({type:0,index:X});else{const re=(0,k.parseColor)(O);re&&M.push({type:1,index:X,color:re})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(T){const M=T.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(T,M){this._getCurrentLinkId()&&this._finishHyperlink();const B=T.split(":");let z;const O=B.findIndex(X=>X.startsWith("id="));return O!==-1&&(z=B[O].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:z,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(T,M){const B=T.split(";");for(let z=0;z<B.length&&!(M>=this._specialColors.length);++z,++M)if(B[z]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const O=(0,k.parseColor)(B[z]);O&&this._onColor.fire([{type:1,index:this._specialColors[M],color:O}])}return!0}setOrReportFgColor(T){return this._setOrReportSpecialColor(T,0)}setOrReportBgColor(T){return this._setOrReportSpecialColor(T,1)}setOrReportCursorColor(T){return this._setOrReportSpecialColor(T,2)}restoreIndexedColor(T){if(!T)return this._onColor.fire([{type:2}]),!0;const M=[],B=T.split(";");for(let z=0;z<B.length;++z)if(/^\d+$/.exec(B[z])){const O=parseInt(B[z]);U(O)&&M.push({type:2,index:O})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(T){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(T){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(T){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,p.DEFAULT_CHARSET),!0}selectCharset(T){return T.length!==2?(this.selectDefaultCharset(),!0):(T[0]==="/"||this._charsetService.setgCharset(L[T[0]],p.CHARSETS[T[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const T=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,T,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=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(T){return this._charsetService.setgLevel(T),!0}screenAlignmentPattern(){const T=new v.CellData;T.content=4194373,T.fg=this._curAttrData.fg,T.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const B=this._activeBuffer.ybase+this._activeBuffer.y+M,z=this._activeBuffer.lines.get(B);z&&(z.fill(T),z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(T,M){const B=this._bufferService.buffer,z=this._optionsService.rawOptions;return(O=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${O}${u.C0.ESC}\\`),!0))(T==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:T==='"p'?'P1$r61;1"p':T==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:T==="m"?"P1$r0m":T===" q"?`P1$r${{block:2,underline:4,bar:6}[z.cursorStyle]-(z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(T,M){this._dirtyRowTracker.markRangeDirty(T,M)}}s.InputHandler=I;let F=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,T){j>T&&($=j,j=T,T=$),j<this.start&&(this.start=j),T>this.end&&(this.end=T)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(j){return 0<=j&&j<256}F=c([m(0,E.IBufferService)],F)},844:(a,s)=>{function l(c){for(const m of c)m.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const m=this._disposables.indexOf(c);m!==-1&&this._disposables.splice(m,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var m;this._isDisposed||c===this._value||((m=this._value)==null||m.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=l,s.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},1505:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(m,u,p){this._data[m]||(this._data[m]={}),this._data[m][u]=p}get(m,u){return this._data[m]?this._data[m][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=l,s.FourKeyMap=class{constructor(){this._data=new l}set(c,m,u,p,g){this._data.get(c,m)||this._data.set(c,m,new l),this._data.get(c,m).set(u,p,g)}get(c,m,u,p){var g;return(g=this._data.get(c,m))==null?void 0:g.get(u,p)}clear(){this._data.clear()}}},6114:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u";const l=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=l.includes("Firefox"),s.isLegacyEdge=l.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(l),s.getSafariVersion=function(){if(!s.isSafari)return 0;const m=l.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let l=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(l=this._search(this._getKey(c)),this._array.splice(l,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const m=this._getKey(c);if(m===void 0||(l=this._search(m),l===-1)||this._getKey(this._array[l])!==m)return!1;do if(this._array[l]===c)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===m);return!1}*getKeyIterator(c){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===c)}forEachByKey(c,m){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do m(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===c)}values(){return[...this._array].values()}_search(c){let m=0,u=this._array.length-1;for(;u>=m;){let p=m+u>>1;const g=this._getKey(this._array[p]);if(g>c)u=p-1;else{if(!(g<c)){for(;p>0&&this._getKey(this._array[p-1])===c;)p--;return p}m=p+1}}return m}}},7226:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=l(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let y=0,_=0,h=g.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),_=Math.max(y,_),f=g.timeRemaining(),1.5*_>f)return h-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-y))}ms`),void this._start();h=f}this.clear()}}class u extends m{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const y=Date.now()+g;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=l(643);s.updateWindowsModeWrappedState=function(m){const u=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),p=u==null?void 0:u.get(m.cols-1),g=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);g&&p&&(g.isWrapped=p[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&p[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,p=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=p}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=l(6349),m=l(7226),u=l(3734),p=l(8437),g=l(4634),y=l(511),_=l(643),h=l(4863),f=l(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(d,v,b){this._hasScrollback=d,this._optionsService=v,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=f.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,v){return new p.BufferLine(this._bufferService.cols,this.getNullCell(d),v)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const v=d+this._optionsService.rawOptions.scrollback;return v>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:v}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=p.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,v){const b=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const C=this._getCorrectBufferLength(v);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<d)for(let w=0;w<this.lines.length;w++)E+=+this.lines.get(w).resize(d,b);let R=0;if(this._rows<v)for(let w=this._rows;w<v;w++)this.lines.length<v+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(d,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(d,b)));else for(let w=this._rows;w>v;w--)this.lines.length>v+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const w=this.lines.length-C;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=C}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,v-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(d,v),this._cols>d))for(let R=0;R<this.lines.length;R++)E+=+this.lines.get(R).resize(d,b);this._cols=d,this._rows=v,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,v){this._cols!==d&&(d>this._cols?this._reflowLarger(d,v):this._reflowSmaller(d,v))}_reflowLarger(d,v){const b=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(b.length>0){const E=(0,g.reflowLargerCreateNewLayout)(this.lines,b);(0,g.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(d,v,E.countRemoved)}}_reflowLargerAdjustViewport(d,v,b){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let C=b;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new p.BufferLine(d,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(d,v){const b=this.getNullCell(p.DEFAULT_ATTR_DATA),E=[];let C=0;for(let R=this.lines.length-1;R>=0;R--){let w=this.lines.get(R);if(!w||!w.isWrapped&&w.getTrimmedLength()<=d)continue;const k=[w];for(;w.isWrapped&&R>0;)w=this.lines.get(--R),k.unshift(w);const L=this.ybase+this.y;if(L>=R&&L<R+k.length)continue;const A=k[k.length-1].getTrimmedLength(),D=(0,g.reflowSmallerGetNewLineLengths)(k,this._cols,d),P=D.length-k.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const I=[];for(let B=0;B<P;B++){const z=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);I.push(z)}I.length>0&&(E.push({start:R+k.length+C,newLines:I}),C+=I.length),k.push(...I);let F=D.length-1,U=D[F];U===0&&(F--,U=D[F]);let j=k.length-P-1,T=A;for(;j>=0;){const B=Math.min(T,U);if(k[F]===void 0)break;if(k[F].copyCellsFrom(k[j],T-B,U-B,B,!0),U-=B,U===0&&(F--,U=D[F]),T-=B,T===0){j--;const z=Math.max(j,0);T=(0,g.getWrappedLineTrimmedLength)(k,z,this._cols)}}for(let B=0;B<k.length;B++)D[B]<d&&k[B].setCell(D[B],b);let M=P-$;for(;M-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+v-1)}if(E.length>0){const R=[],w=[];for(let F=0;F<this.lines.length;F++)w.push(this.lines.get(F));const k=this.lines.length;let L=k-1,A=0,D=E[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let P=0;for(let F=Math.min(this.lines.maxLength-1,k+C-1);F>=0;F--)if(D&&D.start>L+P){for(let U=D.newLines.length-1;U>=0;U--)this.lines.set(F--,D.newLines[U]);F++,R.push({index:L+1,amount:D.newLines.length}),P+=D.newLines.length,D=E[++A]}else this.lines.set(F,w[L--]);let $=0;for(let F=R.length-1;F>=0;F--)R[F].index+=$,this.lines.onInsertEmitter.fire(R[F]),$+=R[F].amount;const I=Math.max(0,k+C-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(d,v,b=0,E){const C=this.lines.get(d);return C?C.translateToString(v,b,E):""}getWrappedRangeForLine(d){let v=d,b=d;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:v,last:b}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].line===d&&(this.markers[v].dispose(),this.markers.splice(v--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const v=new h.Marker(d);return this.markers.push(v),v.register(this.lines.onTrim(b=>{v.line-=b,v.line<0&&v.dispose()})),v.register(this.lines.onInsert(b=>{v.line>=b.index&&(v.line+=b.amount)})),v.register(this.lines.onDelete(b=>{v.line>=b.index&&v.line<b.index+b.amount&&v.dispose(),v.line>b.index&&(v.line-=b.amount)})),v.register(v.onDispose(()=>this._removeMarker(v))),v}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=l(3734),m=l(511),u=l(643),p=l(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let g=0;class y{constructor(h,f,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const v=f||m.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let b=0;b<h;++b)this.setCell(b,v);this.length=h}get(h){const f=this._data[3*h+0],d=2097151&f;return[this._data[3*h+1],2097152&f?this._combined[h]:d?(0,p.stringFromCodePoint)(d):"",f>>22,2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):d]}set(h,f){this._data[3*h+1]=f[u.CHAR_DATA_ATTR_INDEX],f[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=f[1],this._data[3*h+0]=2097152|h|f[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=f[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&f}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h]:2097151&f?(0,p.stringFromCodePoint)(2097151&f):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,f){return g=3*h,f.content=this._data[g+0],f.fg=this._data[g+1],f.bg=this._data[g+2],2097152&f.content&&(f.combinedData=this._combined[h]),268435456&f.bg&&(f.extended=this._extendedAttrs[h]),f}setCell(h,f){2097152&f.content&&(this._combined[h]=f.combinedData),268435456&f.bg&&(this._extendedAttrs[h]=f.extended),this._data[3*h+0]=f.content,this._data[3*h+1]=f.fg,this._data[3*h+2]=f.bg}setCellFromCodepoint(h,f,d,v){268435456&v.bg&&(this._extendedAttrs[h]=v.extended),this._data[3*h+0]=f|d<<22,this._data[3*h+1]=v.fg,this._data[3*h+2]=v.bg}addCodepointToCell(h,f,d){let v=this._data[3*h+0];2097152&v?this._combined[h]+=(0,p.stringFromCodePoint)(f):2097151&v?(this._combined[h]=(0,p.stringFromCodePoint)(2097151&v)+(0,p.stringFromCodePoint)(f),v&=-2097152,v|=2097152):v=f|4194304,d&&(v&=-12582913,v|=d<<22),this._data[3*h+0]=v}insertCells(h,f,d){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length-h){const v=new m.CellData;for(let b=this.length-h-f-1;b>=0;--b)this.setCell(h+f+b,this.loadCell(h+b,v));for(let b=0;b<f;++b)this.setCell(h+b,d)}else for(let v=h;v<this.length;++v)this.setCell(v,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(h,f,d){if(h%=this.length,f<this.length-h){const v=new m.CellData;for(let b=0;b<this.length-h-f;++b)this.setCell(h+b,this.loadCell(h+f+b,v));for(let b=this.length-f;b<this.length;++b)this.setCell(b,d)}else for(let v=h;v<this.length;++v)this.setCell(v,d);h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodepoint(h,0,1,d)}replaceCells(h,f,d,v=!1){if(v)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&!this.isProtected(f)&&this.setCellFromCodepoint(f,0,1,d);h<f&&h<this.length;)this.isProtected(h)||this.setCell(h,d),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f,0,1,d);h<f&&h<this.length;)this.setCell(h++,d)}resize(h,f){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const v=new Uint32Array(d);v.set(this._data),this._data=v}for(let v=this.length;v<h;++v)this.setCell(v,f)}else{this._data=this._data.subarray(0,d);const v=Object.keys(this._combined);for(let E=0;E<v.length;E++){const C=parseInt(v[E],10);C>=h&&delete this._combined[C]}const b=Object.keys(this._extendedAttrs);for(let E=0;E<b.length;E++){const C=parseInt(b[E],10);C>=h&&delete this._extendedAttrs[C]}}return this.length=h,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,f=!1){if(f)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,h);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const f in h._combined)this._combined[f]=h._combined[f];this._extendedAttrs={};for(const f in h._extendedAttrs)this._extendedAttrs[f]=h._extendedAttrs[f];this.isWrapped=h.isWrapped}clone(){const h=new y(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const f in this._combined)h._combined[f]=this._combined[f];for(const f in this._extendedAttrs)h._extendedAttrs[f]=this._extendedAttrs[f];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,f,d,v,b){const E=h._data;if(b)for(let R=v-1;R>=0;R--){for(let w=0;w<3;w++)this._data[3*(d+R)+w]=E[3*(f+R)+w];268435456&E[3*(f+R)+2]&&(this._extendedAttrs[d+R]=h._extendedAttrs[f+R])}else for(let R=0;R<v;R++){for(let w=0;w<3;w++)this._data[3*(d+R)+w]=E[3*(f+R)+w];268435456&E[3*(f+R)+2]&&(this._extendedAttrs[d+R]=h._extendedAttrs[f+R])}const C=Object.keys(h._combined);for(let R=0;R<C.length;R++){const w=parseInt(C[R],10);w>=f&&(this._combined[w-f+d]=h._combined[w])}}translateToString(h,f,d,v){f=f??0,d=d??this.length,h&&(d=Math.min(d,this.getTrimmedLength())),v&&(v.length=0);let b="";for(;f<d;){const E=this._data[3*f+0],C=2097151&E,R=2097152&E?this._combined[f]:C?(0,p.stringFromCodePoint)(C):u.WHITESPACE_CELL_CHAR;if(b+=R,v)for(let w=0;w<R.length;++w)v.push(f);f+=E>>22||1}return v&&v.push(f),b}}s.BufferLine=y},4841:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(l,c){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return c*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,s)=>{function l(c,m,u){if(m===c.length-1)return c[m].getTrimmedLength();const p=!c[m].hasContent(u-1)&&c[m].getWidth(u-1)===1,g=c[m+1].getWidth(0)===2;return p&&g?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,m,u,p,g){const y=[];for(let _=0;_<c.length-1;_++){let h=_,f=c.get(++h);if(!f.isWrapped)continue;const d=[c.get(_)];for(;h<c.length&&f.isWrapped;)d.push(f),f=c.get(++h);if(p>=_&&p<h){_+=d.length-1;continue}let v=0,b=l(d,v,m),E=1,C=0;for(;E<d.length;){const w=l(d,E,m),k=w-C,L=u-b,A=Math.min(k,L);d[v].copyCellsFrom(d[E],C,b,A,!1),b+=A,b===u&&(v++,b=0),C+=A,C===w&&(E++,C=0),b===0&&v!==0&&d[v-1].getWidth(u-1)===2&&(d[v].copyCellsFrom(d[v-1],u-1,b++,1,!1),d[v-1].setCell(u-1,g))}d[v].replaceCells(b,u,g);let R=0;for(let w=d.length-1;w>0&&(w>v||d[w].getTrimmedLength()===0);w--)R++;R>0&&(y.push(_+d.length-R),y.push(R)),_+=d.length-1}return y},s.reflowLargerCreateNewLayout=function(c,m){const u=[];let p=0,g=m[p],y=0;for(let _=0;_<c.length;_++)if(g===_){const h=m[++p];c.onDeleteEmitter.fire({index:_-y,amount:h}),_+=h-1,y+=h,g=m[++p]}else u.push(_);return{layout:u,countRemoved:y}},s.reflowLargerApplyNewLayout=function(c,m){const u=[];for(let p=0;p<m.length;p++)u.push(c.get(m[p]));for(let p=0;p<u.length;p++)c.set(p,u[p]);c.length=m.length},s.reflowSmallerGetNewLineLengths=function(c,m,u){const p=[],g=c.map((f,d)=>l(c,d,m)).reduce((f,d)=>f+d);let y=0,_=0,h=0;for(;h<g;){if(g-h<u){p.push(g-h);break}y+=u;const f=l(c,_,m);y>f&&(y-=f,_++);const d=c[_].getWidth(y-1)===2;d&&y--;const v=d?u-1:u;p.push(v),h+=v}return p},s.getWrappedLineTrimmedLength=l},5295:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=l(8460),m=l(844),u=l(9092);class p extends m.Disposable{constructor(y,_){super(),this._optionsService=y,this._bufferService=_,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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(y,_){this._normal.resize(y,_),this._alt.resize(y,_),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}s.BufferSet=p},511:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=l(482),m=l(643),u=l(3734);class p extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const _=new p;return _.setFromCharData(y),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(y[m.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(y[m.CHAR_DATA_CHAR_INDEX].length===2){const h=y[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const f=y[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(h-55296)+f-56320+65536|y[m.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=y[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[m.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=y[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},643:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=l(8460),m=l(844);class u{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}s.Marker=u,u._nextId=1},7116:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,s)=>{var l,c,m;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT="	",u.LF=`
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(l||(s.C0=l={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(c||(s.C1=c={})),function(u){u.ST=`${l.ESC}\\`}(m||(s.C1_ESCAPED=m={}))},7399:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=l(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(u,p,g,y){const _={type:0,cancel:!1,key:void 0},h=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?_.key=p?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?_.key=p?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?_.key=p?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(_.key=p?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:_.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(_.key=c.C0.ESC+_.key);break;case 9:if(u.shiftKey){_.key=c.C0.ESC+"[Z";break}_.key=c.C0.HT,_.cancel=!0;break;case 13:_.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,_.cancel=!0;break;case 27:_.key=c.C0.ESC,u.altKey&&(_.key=c.C0.ESC+c.C0.ESC),_.cancel=!0;break;case 37:if(u.metaKey)break;h?(_.key=c.C0.ESC+"[1;"+(h+1)+"D",_.key===c.C0.ESC+"[1;3D"&&(_.key=c.C0.ESC+(g?"b":"[1;5D"))):_.key=p?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;h?(_.key=c.C0.ESC+"[1;"+(h+1)+"C",_.key===c.C0.ESC+"[1;3C"&&(_.key=c.C0.ESC+(g?"f":"[1;5C"))):_.key=p?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;h?(_.key=c.C0.ESC+"[1;"+(h+1)+"A",g||_.key!==c.C0.ESC+"[1;3A"||(_.key=c.C0.ESC+"[1;5A")):_.key=p?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;h?(_.key=c.C0.ESC+"[1;"+(h+1)+"B",g||_.key!==c.C0.ESC+"[1;3B"||(_.key=c.C0.ESC+"[1;5B")):_.key=p?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(_.key=c.C0.ESC+"[2~");break;case 46:_.key=h?c.C0.ESC+"[3;"+(h+1)+"~":c.C0.ESC+"[3~";break;case 36:_.key=h?c.C0.ESC+"[1;"+(h+1)+"H":p?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:_.key=h?c.C0.ESC+"[1;"+(h+1)+"F":p?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?_.type=2:u.ctrlKey?_.key=c.C0.ESC+"[5;"+(h+1)+"~":_.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?_.type=3:u.ctrlKey?_.key=c.C0.ESC+"[6;"+(h+1)+"~":_.key=c.C0.ESC+"[6~";break;case 112:_.key=h?c.C0.ESC+"[1;"+(h+1)+"P":c.C0.ESC+"OP";break;case 113:_.key=h?c.C0.ESC+"[1;"+(h+1)+"Q":c.C0.ESC+"OQ";break;case 114:_.key=h?c.C0.ESC+"[1;"+(h+1)+"R":c.C0.ESC+"OR";break;case 115:_.key=h?c.C0.ESC+"[1;"+(h+1)+"S":c.C0.ESC+"OS";break;case 116:_.key=h?c.C0.ESC+"[15;"+(h+1)+"~":c.C0.ESC+"[15~";break;case 117:_.key=h?c.C0.ESC+"[17;"+(h+1)+"~":c.C0.ESC+"[17~";break;case 118:_.key=h?c.C0.ESC+"[18;"+(h+1)+"~":c.C0.ESC+"[18~";break;case 119:_.key=h?c.C0.ESC+"[19;"+(h+1)+"~":c.C0.ESC+"[19~";break;case 120:_.key=h?c.C0.ESC+"[20;"+(h+1)+"~":c.C0.ESC+"[20~";break;case 121:_.key=h?c.C0.ESC+"[21;"+(h+1)+"~":c.C0.ESC+"[21~";break;case 122:_.key=h?c.C0.ESC+"[23;"+(h+1)+"~":c.C0.ESC+"[23~";break;case 123:_.key=h?c.C0.ESC+"[24;"+(h+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(g&&!y||!u.altKey||u.metaKey)!g||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?_.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(_.key=c.C0.US),u.key==="@"&&(_.key=c.C0.NUL)):u.keyCode===65&&(_.type=1);else{const f=m[u.keyCode],d=f==null?void 0:f[u.shiftKey?1:0];if(d)_.key=c.C0.ESC+d;else if(u.keyCode>=65&&u.keyCode<=90){const v=u.ctrlKey?u.keyCode-64:u.keyCode+32;let b=String.fromCharCode(v);u.shiftKey&&(b=b.toUpperCase()),_.key=c.C0.ESC+b}else if(u.keyCode===32)_.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let v=u.code.slice(3,4);u.shiftKey||(v=v.toLowerCase()),_.key=c.C0.ESC+v,_.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?_.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?_.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?_.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?_.key=c.C0.DEL:u.keyCode===219?_.key=c.C0.ESC:u.keyCode===220?_.key=c.C0.FS:u.keyCode===221&&(_.key=c.C0.GS)}return _}},482:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},s.utf32ToString=function(l,c=0,m=l.length){let u="";for(let p=c;p<m;++p){let g=l[p];g>65535?(g-=65536,u+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):u+=String.fromCharCode(g)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const m=l.length;if(!m)return 0;let u=0,p=0;if(this._interim){const g=l.charCodeAt(p++);56320<=g&&g<=57343?c[u++]=1024*(this._interim-55296)+g-56320+65536:(c[u++]=this._interim,c[u++]=g),this._interim=0}for(let g=p;g<m;++g){const y=l.charCodeAt(g);if(55296<=y&&y<=56319){if(++g>=m)return this._interim=y,u;const _=l.charCodeAt(g);56320<=_&&_<=57343?c[u++]=1024*(y-55296)+_-56320+65536:(c[u++]=y,c[u++]=_)}else y!==65279&&(c[u++]=y)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const m=l.length;if(!m)return 0;let u,p,g,y,_=0,h=0,f=0;if(this.interim[0]){let b=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let C,R=0;for(;(C=63&this.interim[++R])&&R<4;)E<<=6,E|=C;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=w-R;for(;f<k;){if(f>=m)return 0;if(C=l[f++],(192&C)!=128){f--,b=!0;break}this.interim[R++]=C,E<<=6,E|=63&C}b||(w===2?E<128?f--:c[_++]=E:w===3?E<2048||E>=55296&&E<=57343||E===65279||(c[_++]=E):E<65536||E>1114111||(c[_++]=E)),this.interim.fill(0)}const d=m-4;let v=f;for(;v<m;){for(;!(!(v<d)||128&(u=l[v])||128&(p=l[v+1])||128&(g=l[v+2])||128&(y=l[v+3]));)c[_++]=u,c[_++]=p,c[_++]=g,c[_++]=y,v+=4;if(u=l[v++],u<128)c[_++]=u;else if((224&u)==192){if(v>=m)return this.interim[0]=u,_;if(p=l[v++],(192&p)!=128){v--;continue}if(h=(31&u)<<6|63&p,h<128){v--;continue}c[_++]=h}else if((240&u)==224){if(v>=m)return this.interim[0]=u,_;if(p=l[v++],(192&p)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=p,_;if(g=l[v++],(192&g)!=128){v--;continue}if(h=(15&u)<<12|(63&p)<<6|63&g,h<2048||h>=55296&&h<=57343||h===65279)continue;c[_++]=h}else if((248&u)==240){if(v>=m)return this.interim[0]=u,_;if(p=l[v++],(192&p)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=p,_;if(g=l[v++],(192&g)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=p,this.interim[2]=g,_;if(y=l[v++],(192&y)!=128){v--;continue}if(h=(7&u)<<18|(63&p)<<12|(63&g)<<6|63&y,h<65536||h>1114111)continue;c[_++]=h}}return _}}},225:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=l(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;s.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let g=0;g<m.length;++g)p.fill(0,m[g][0],m[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?p[g]:function(y,_){let h,f=0,d=_.length-1;if(y<_[0][0]||y>_[d][1])return!1;for(;d>=f;)if(h=f+d>>1,y>_[h][1])f=h+1;else{if(!(y<_[h][0]))return!0;d=h-1}return!1}(g,u)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,y){let _=this.wcwidth(g),h=_===0&&y!==0;if(h){const f=c.UnicodeService.extractWidth(y);f===0?h=!1:f>_&&(_=f)}return c.UnicodeService.createPropertyValue(0,_,h)}}},5981:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=l(8460),m=l(844);class u extends m.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const h=this._callbacks.shift();h&&h()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,y){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(y),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(y)}_innerWrite(g=0,y=!0){const _=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const h=this._writeBuffer[this._bufferOffset],f=this._action(h,y);if(f){const v=b=>Date.now()-_>=12?setTimeout(()=>this._innerWrite(0,b)):this._innerWrite(_,b);return void f.catch(b=>(queueMicrotask(()=>{throw b}),Promise.resolve(!1))).then(v)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=h.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=u},5941:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const l=/^([\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})$/,c=/^[\da-f]+$/;function m(u,p){const g=u.toString(16),y=g.length<2?"0"+g:g;switch(p){case 4:return g[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}s.parseColor=function(u){if(!u)return;let p=u.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const g=l.exec(p);if(g){const y=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/y*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/y*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/y*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),c.exec(p)&&[3,6,9,12].includes(p.length))){const g=p.length/3,y=[0,0,0];for(let _=0;_<3;++_){const h=parseInt(p.slice(g*_,g*_+g),16);y[_]=g===1?h<<4:g===2?h:g===3?h>>4:h>>8}return y}},s.toRgbString=function(u,p=16){const[g,y,_]=u;return`rgb:${m(g,p)}/${m(y,p)}/${m(_,p)}`}},5770:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=l(482),m=l(8742),u=l(5770),p=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(y,_){this._handlers[y]===void 0&&(this._handlers[y]=[]);const h=this._handlers[y];return h.push(_),{dispose:()=>{const f=h.indexOf(_);f!==-1&&h.splice(f,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(y,_){if(this.reset(),this._ident=y,this._active=this._handlers[y]||p,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(y,_,h){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(y,_,h);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(y,_,h))}unhook(y,_=!0){if(this._active.length){let h=!1,f=this._active.length-1,d=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,h=_,d=this._stack.fallThrough,this._stack.paused=!1),!d&&h===!1){for(;f>=0&&(h=this._active[f].unhook(y),h!==!0);f--)if(h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,h;f--}for(;f>=0;f--)if(h=this._active[f].unhook(!1),h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,h}else this._handlerFb(this._ident,"UNHOOK",y);this._active=p,this._ident=0}};const g=new m.Params;g.addParam(0),s.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=g,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():g,this._data="",this._hitLimit=!1}put(y,_,h){this._hitLimit||(this._data+=(0,c.utf32ToString)(y,_,h),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let _=!1;if(this._hitLimit)_=!1;else if(y&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then(h=>(this._params=g,this._data="",this._hitLimit=!1,h));return this._params=g,this._data="",this._hitLimit=!1,_}}},2015:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=l(844),m=l(8742),u=l(6242),p=l(6351);class g{constructor(f){this.table=new Uint8Array(f)}setDefault(f,d){this.table.fill(f<<4|d)}add(f,d,v,b){this.table[d<<8|f]=v<<4|b}addMany(f,d,v,b){for(let E=0;E<f.length;E++)this.table[d<<8|f[E]]=v<<4|b}}s.TransitionTable=g;const y=160;s.VT500_TRANSITION_TABLE=function(){const h=new g(4095),f=Array.apply(null,Array(256)).map((R,w)=>w),d=(R,w)=>f.slice(R,w),v=d(32,127),b=d(0,24);b.push(25),b.push.apply(b,d(28,32));const E=d(0,14);let C;for(C in h.setDefault(1,0),h.addMany(v,0,2,0),E)h.addMany([24,26,153,154],C,3,0),h.addMany(d(128,144),C,3,0),h.addMany(d(144,152),C,3,0),h.add(156,C,0,0),h.add(27,C,11,1),h.add(157,C,4,8),h.addMany([152,158,159],C,0,7),h.add(155,C,11,3),h.add(144,C,11,9);return h.addMany(b,0,3,0),h.addMany(b,1,3,1),h.add(127,1,0,1),h.addMany(b,8,0,8),h.addMany(b,3,3,3),h.add(127,3,0,3),h.addMany(b,4,3,4),h.add(127,4,0,4),h.addMany(b,6,3,6),h.addMany(b,5,3,5),h.add(127,5,0,5),h.addMany(b,2,3,2),h.add(127,2,0,2),h.add(93,1,4,8),h.addMany(v,8,5,8),h.add(127,8,5,8),h.addMany([156,27,24,26,7],8,6,0),h.addMany(d(28,32),8,0,8),h.addMany([88,94,95],1,0,7),h.addMany(v,7,0,7),h.addMany(b,7,0,7),h.add(156,7,0,0),h.add(127,7,0,7),h.add(91,1,11,3),h.addMany(d(64,127),3,7,0),h.addMany(d(48,60),3,8,4),h.addMany([60,61,62,63],3,9,4),h.addMany(d(48,60),4,8,4),h.addMany(d(64,127),4,7,0),h.addMany([60,61,62,63],4,0,6),h.addMany(d(32,64),6,0,6),h.add(127,6,0,6),h.addMany(d(64,127),6,0,0),h.addMany(d(32,48),3,9,5),h.addMany(d(32,48),5,9,5),h.addMany(d(48,64),5,0,6),h.addMany(d(64,127),5,7,0),h.addMany(d(32,48),4,9,5),h.addMany(d(32,48),1,9,2),h.addMany(d(32,48),2,9,2),h.addMany(d(48,127),2,10,0),h.addMany(d(48,80),1,10,0),h.addMany(d(81,88),1,10,0),h.addMany([89,90,92],1,10,0),h.addMany(d(96,127),1,10,0),h.add(80,1,11,9),h.addMany(b,9,0,9),h.add(127,9,0,9),h.addMany(d(28,32),9,0,9),h.addMany(d(32,48),9,9,12),h.addMany(d(48,60),9,8,10),h.addMany([60,61,62,63],9,9,10),h.addMany(b,11,0,11),h.addMany(d(32,128),11,0,11),h.addMany(d(28,32),11,0,11),h.addMany(b,10,0,10),h.add(127,10,0,10),h.addMany(d(28,32),10,0,10),h.addMany(d(48,60),10,8,10),h.addMany([60,61,62,63],10,0,11),h.addMany(d(32,48),10,9,12),h.addMany(b,12,0,12),h.add(127,12,0,12),h.addMany(d(28,32),12,0,12),h.addMany(d(32,48),12,9,12),h.addMany(d(48,64),12,0,11),h.addMany(d(64,127),12,12,13),h.addMany(d(64,127),10,12,13),h.addMany(d(64,127),9,12,13),h.addMany(b,13,13,13),h.addMany(v,13,13,13),h.add(127,13,0,13),h.addMany([27,156,24,26],13,14,0),h.add(y,0,2,0),h.add(y,8,5,8),h.add(y,6,0,6),h.add(y,11,0,11),h.add(y,13,13,13),h}();class _ extends c.Disposable{constructor(f=s.VT500_TRANSITION_TABLE){super(),this._transitions=f,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,v,b)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,v)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(f,d=[64,126]){let v=0;if(f.prefix){if(f.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=f.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(f.intermediates){if(f.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<f.intermediates.length;++E){const C=f.intermediates.charCodeAt(E);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=C}}if(f.final.length!==1)throw new Error("final must be a single byte");const b=f.final.charCodeAt(0);if(d[0]>b||b>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return v<<=8,v|=b,v}identToString(f){const d=[];for(;f;)d.push(String.fromCharCode(255&f)),f>>=8;return d.reverse().join("")}setPrintHandler(f){this._printHandler=f}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(f,d){const v=this._identifier(f,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const b=this._escHandlers[v];return b.push(d),{dispose:()=>{const E=b.indexOf(d);E!==-1&&b.splice(E,1)}}}clearEscHandler(f){this._escHandlers[this._identifier(f,[48,126])]&&delete this._escHandlers[this._identifier(f,[48,126])]}setEscHandlerFallback(f){this._escHandlerFb=f}setExecuteHandler(f,d){this._executeHandlers[f.charCodeAt(0)]=d}clearExecuteHandler(f){this._executeHandlers[f.charCodeAt(0)]&&delete this._executeHandlers[f.charCodeAt(0)]}setExecuteHandlerFallback(f){this._executeHandlerFb=f}registerCsiHandler(f,d){const v=this._identifier(f);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const b=this._csiHandlers[v];return b.push(d),{dispose:()=>{const E=b.indexOf(d);E!==-1&&b.splice(E,1)}}}clearCsiHandler(f){this._csiHandlers[this._identifier(f)]&&delete this._csiHandlers[this._identifier(f)]}setCsiHandlerFallback(f){this._csiHandlerFb=f}registerDcsHandler(f,d){return this._dcsParser.registerHandler(this._identifier(f),d)}clearDcsHandler(f){this._dcsParser.clearHandler(this._identifier(f))}setDcsHandlerFallback(f){this._dcsParser.setHandlerFallback(f)}registerOscHandler(f,d){return this._oscParser.registerHandler(f,d)}clearOscHandler(f){this._oscParser.clearHandler(f)}setOscHandlerFallback(f){this._oscParser.setHandlerFallback(f)}setErrorHandler(f){this._errorHandler=f}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(f,d,v,b,E){this._parseStack.state=f,this._parseStack.handlers=d,this._parseStack.handlerPos=v,this._parseStack.transition=b,this._parseStack.chunkPos=E}parse(f,d,v){let b,E=0,C=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(v===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&k>-1){for(;k>=0&&(b=w[k](this._params),b!==!0);k--)if(b instanceof Promise)return this._parseStack.handlerPos=k,b}this._parseStack.handlers=[];break;case 4:if(v===!1&&k>-1){for(;k>=0&&(b=w[k](),b!==!0);k--)if(b instanceof Promise)return this._parseStack.handlerPos=k,b}this._parseStack.handlers=[];break;case 6:if(E=f[this._parseStack.chunkPos],b=this._dcsParser.unhook(E!==24&&E!==26,v),b)return b;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=f[this._parseStack.chunkPos],b=this._oscParser.end(E!==24&&E!==26,v),b)return b;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let w=R;w<d;++w){switch(E=f[w],C=this._transitions.table[this.currentState<<8|(E<160?E:y)],C>>4){case 2:for(let P=w+1;;++P){if(P>=d||(E=f[P])<32||E>126&&E<y){this._printHandler(f,w,P),w=P-1;break}if(++P>=d||(E=f[P])<32||E>126&&E<y){this._printHandler(f,w,P),w=P-1;break}if(++P>=d||(E=f[P])<32||E>126&&E<y){this._printHandler(f,w,P),w=P-1;break}if(++P>=d||(E=f[P])<32||E>126&&E<y){this._printHandler(f,w,P),w=P-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|E];let L=k?k.length-1:-1;for(;L>=0&&(b=k[L](this._params),b!==!0);L--)if(b instanceof Promise)return this._preserveStack(3,k,L,C,w),b;L<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++w<d&&(E=f[w])>47&&E<60);w--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const A=this._escHandlers[this._collect<<8|E];let D=A?A.length-1:-1;for(;D>=0&&(b=A[D](),b!==!0);D--)if(b instanceof Promise)return this._preserveStack(4,A,D,C,w),b;D<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let P=w+1;;++P)if(P>=d||(E=f[P])===24||E===26||E===27||E>127&&E<y){this._dcsParser.put(f,w,P),w=P-1;break}break;case 14:if(b=this._dcsParser.unhook(E!==24&&E!==26),b)return this._preserveStack(6,[],0,C,w),b;E===27&&(C|=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 P=w+1;;P++)if(P>=d||(E=f[P])<32||E>127&&E<y){this._oscParser.put(f,w,P),w=P-1;break}break;case 6:if(b=this._oscParser.end(E!==24&&E!==26),b)return this._preserveStack(5,[],0,C,w),b;E===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&C}}}s.EscapeSequenceParser=_},6242:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=l(5770),m=l(482),u=[];s.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,g){this._handlers[p]===void 0&&(this._handlers[p]=[]);const y=this._handlers[p];return y.push(g),{dispose:()=>{const _=y.indexOf(g);_!==-1&&y.splice(_,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,g,y){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(p,g,y);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(p,g,y))}start(){this.reset(),this._state=1}put(p,g,y){if(this._state!==3){if(this._state===1)for(;g<y;){const _=p[g++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&y-g>0&&this._put(p,g,y)}}end(p,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,_=this._active.length-1,h=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,y=g,h=this._stack.fallThrough,this._stack.paused=!1),!h&&y===!1){for(;_>=0&&(y=this._active[_].end(p),y!==!0);_--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,y;_--}for(;_>=0;_--)if(y=this._active[_].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",p);this._active=u,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,g,y){this._hitLimit||(this._data+=(0,m.utf32ToString)(p,g,y),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let g=!1;if(this._hitLimit)g=!1;else if(p&&(g=this._handler(this._data),g instanceof Promise))return g.then(y=>(this._data="",this._hitLimit=!1,y));return this._data="",this._hitLimit=!1,g}}},8742:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const l=2147483647;class c{static fromArray(u){const p=new c;if(!u.length)return p;for(let g=Array.isArray(u[0])?1:0;g<u.length;++g){const y=u[g];if(Array.isArray(y))for(let _=0;_<y.length;++_)p.addSubParam(y[_]);else p.addParam(y)}return p}constructor(u=32,p=32){if(this.maxLength=u,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let p=0;p<this.length;++p){u.push(this.params[p]);const g=this._subParamsIdx[p]>>8,y=255&this._subParamsIdx[p];y-g>0&&u.push(Array.prototype.slice.call(this._subParams,g,y))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>l?l:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>l?l:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const p=this._subParamsIdx[u]>>8,g=255&this._subParamsIdx[u];return g-p>0?this._subParams.subarray(p,g):null}getSubParamsAll(){const u={};for(let p=0;p<this.length;++p){const g=this._subParamsIdx[p]>>8,y=255&this._subParamsIdx[p];y-g>0&&(u[p]=this._subParams.slice(g,y))}return u}addDigit(u){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,y=g[p-1];g[p-1]=~y?Math.min(10*y+u,l):u}}s.Params=c},5741:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,c){const m={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(m),c.dispose=()=>this._wrappedAddonDispose(m),c.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let c=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===l){c=m;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(c,1)}}},8771:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=l(3785),m=l(511);s.BufferApiView=class{constructor(u,p){this._buffer=u,this.type=p}init(u){return this._buffer=u,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(u){const p=this._buffer.lines.get(u);if(p)return new c.BufferLineApiView(p)}getNullCell(){return new m.CellData}}},3785:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=l(511);s.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,u){if(!(m<0||m>=this._line.length))return u?(this._line.loadCell(m,u),u):this._line.loadCell(m,new c.CellData)}translateToString(m,u,p){return this._line.translateToString(m,u,p)}}},8285:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=l(8771),m=l(8460),u=l(844);class p extends u.Disposable{constructor(y){super(),this._core=y,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=p},7975:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,c){return this._core.registerCsiHandler(l,m=>c(m.toArray()))}addCsiHandler(l,c){return this.registerCsiHandler(l,c)}registerDcsHandler(l,c){return this._core.registerDcsHandler(l,(m,u)=>c(m,u.toArray()))}addDcsHandler(l,c){return this.registerDcsHandler(l,c)}registerEscHandler(l,c){return this._core.registerEscHandler(l,c)}addEscHandler(l,c){return this.registerEscHandler(l,c)}registerOscHandler(l,c){return this._core.registerOscHandler(l,c)}addOscHandler(l,c){return this.registerOscHandler(l,c)}}},7090:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var b,E=arguments.length,C=E<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(b=h[R])&&(C=(E<3?b(C):E>3?b(f,d,C):b(f,d))||C);return E>3&&C&&Object.defineProperty(f,d,C),C},m=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const u=l(8460),p=l(844),g=l(5295),y=l(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let _=s.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(h){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(h.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(h.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(h,this))}resize(h,f){this.cols=h,this.rows=f,this.buffers.resize(h,f),this._onResize.fire({cols:h,rows:f})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(h,f=!1){const d=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===h.fg&&v.getBg(0)===h.bg||(v=d.getBlankLine(h,f),this._cachedBlankLine=v),v.isWrapped=f;const b=d.ybase+d.scrollTop,E=d.ybase+d.scrollBottom;if(d.scrollTop===0){const C=d.lines.isFull;E===d.lines.length-1?C?d.lines.recycle().copyFrom(v):d.lines.push(v.clone()):d.lines.splice(E+1,0,v.clone()),C?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const C=E-b+1;d.lines.shiftElements(b+1,C-1,-1),d.lines.set(E,v.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(h,f,d){const v=this.buffer;if(h<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else h+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const b=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+h,v.ybase),0),b!==v.ydisp&&(f||this._onScroll.fire(v.ydisp))}};s.BufferService=_=c([m(0,y.IOptionsService)],_)},7994:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,c){this._charsets[l]=c,this.glevel===l&&(this.charset=c)}}},1753:function(a,s,l){var c=this&&this.__decorate||function(v,b,E,C){var R,w=arguments.length,k=w<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,E):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,b,E,C);else for(var L=v.length-1;L>=0;L--)(R=v[L])&&(k=(w<3?R(k):w>3?R(b,E,k):R(b,E))||k);return w>3&&k&&Object.defineProperty(b,E,k),k},m=this&&this.__param||function(v,b){return function(E,C){b(E,C,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const u=l(2585),p=l(8460),g=l(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function _(v,b){let E=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(E|=64,E|=v.action):(E|=3&v.button,4&v.button&&(E|=64),8&v.button&&(E|=128),v.action===32?E|=32:v.action!==0||b||(E|=3)),E}const h=String.fromCharCode,f={DEFAULT:v=>{const b=[_(v,!1)+32,v.col+32,v.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${h(b[0])}${h(b[1])}${h(b[2])}`},SGR:v=>{const b=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${_(v,!0)};${v.col};${v.row}${b}`},SGR_PIXELS:v=>{const b=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${_(v,!0)};${v.x};${v.y}${b}`}};let d=s.CoreMouseService=class extends g.Disposable{constructor(v,b){super(),this._bufferService=v,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(y))this.addProtocol(E,y[E]);for(const E of Object.keys(f))this.addEncoding(E,f[E]);this.reset()}addProtocol(v,b){this._protocols[v]=b}addEncoding(v,b){this._encodings[v]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const b=this._encodings[this._activeEncoding](v);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,b,E){if(E){if(v.x!==b.x||v.y!==b.y)return!1}else if(v.col!==b.col||v.row!==b.row)return!1;return v.button===b.button&&v.action===b.action&&v.ctrl===b.ctrl&&v.alt===b.alt&&v.shift===b.shift}};s.CoreMouseService=d=c([m(0,u.IBufferService),m(1,u.ICoreService)],d)},6975:function(a,s,l){var c=this&&this.__decorate||function(d,v,b,E){var C,R=arguments.length,w=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,v,b,E);else for(var k=d.length-1;k>=0;k--)(C=d[k])&&(w=(R<3?C(w):R>3?C(v,b,w):C(v,b))||w);return R>3&&w&&Object.defineProperty(v,b,w),w},m=this&&this.__param||function(d,v){return function(b,E){v(b,E,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const u=l(1439),p=l(8460),g=l(844),y=l(2585),_=Object.freeze({insertMode:!1}),h=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let f=s.CoreService=class extends g.Disposable{constructor(d,v,b){super(),this._bufferService=d,this._logService=v,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(h)}reset(){this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(h)}triggerDataEvent(d,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,()=>d.split("").map(E=>E.charCodeAt(0))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,()=>d.split("").map(v=>v.charCodeAt(0))),this._onBinary.fire(d))}};s.CoreService=f=c([m(0,y.IBufferService),m(1,y.ILogService),m(2,y.IOptionsService)],f)},9074:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=l(8055),m=l(8460),u=l(844),p=l(6106);let g=0,y=0;class _ extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(d=>d==null?void 0:d.marker.line),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(d){if(d.marker.isDisposed)return;const v=new h(d);if(v){const b=v.marker.onDispose(()=>v.dispose());v.onDispose(()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),b.dispose())}),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,v,b){let E=0,C=0;for(const R of this._decorations.getKeyIterator(v))E=R.options.x??0,C=E+(R.options.width??1),d>=E&&d<C&&(!b||(R.options.layer??"bottom")===b)&&(yield R)}forEachDecorationAtCell(d,v,b,E){this._decorations.forEachByKey(v,C=>{g=C.options.x??0,y=g+(C.options.width??1),d>=g&&d<y&&(!b||(C.options.layer??"bottom")===b)&&E(C)})}}s.DecorationService=_;class h extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=l(2585),m=l(8343);class u{constructor(...g){this._entries=new Map;for(const[y,_]of g)this.set(y,_)}set(g,y){const _=this._entries.get(g);return this._entries.set(g,y),_}forEach(g){for(const[y,_]of this._entries.entries())g(y,_)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}s.ServiceCollection=u,s.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(p,g){this._services.set(p,g)}getService(p){return this._services.get(p)}createInstance(p,...g){const y=(0,m.getServiceDependencies)(p).sort((f,d)=>f.index-d.index),_=[];for(const f of y){const d=this._services.get(f.id);if(!d)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${f.id}.`);_.push(d)}const h=y.length>0?y[0].index:g.length;if(g.length!==h)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${h+1} conflicts with ${g.length} static arguments`);return new p(...g,..._)}}},7866:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var b,E=arguments.length,C=E<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(b=h[R])&&(C=(E<3?b(C):E>3?b(f,d,C):b(f,d))||C);return E>3&&C&&Object.defineProperty(f,d,C),C},m=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=l(844),p=l(2585),g={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let y,_=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let f=0;f<h.length;f++)typeof h[f]=="function"&&(h[f]=h[f]())}_log(h,f,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(h,...f){var d;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,f)}debug(h,...f){var d;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,f)}info(h,...f){var d;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,f)}warn(h,...f){var d;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,f)}error(h,...f){var d;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,f)}};s.LogService=_=c([m(0,p.IOptionsService)],_),s.setTraceLogger=function(h){y=h},s.traceCall=function(h,f,d){if(typeof d.value!="function")throw new Error("not supported");const v=d.value;d.value=function(...b){if(y.logLevel!==p.LogLevelEnum.TRACE)return v.apply(this,b);y.trace(`GlyphRenderer#${v.name}(${b.map(C=>JSON.stringify(C)).join(", ")})`);const E=v.apply(this,b);return y.trace(`GlyphRenderer#${v.name} return`,E),E}}},7302:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=l(8460),m=l(844),u=l(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends m.Disposable{constructor(_){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const h={...s.DEFAULT_OPTIONS};for(const f in _)if(f in h)try{const d=_[f];h[f]=this._sanitizeAndValidateOption(f,d)}catch(d){console.error(d)}this.rawOptions=h,this.options={...h},this._setupOptions(),this.register((0,m.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(_,h){return this.onOptionChange(f=>{f===_&&h(this.rawOptions[_])})}onMultipleOptionChange(_,h){return this.onOptionChange(f=>{_.indexOf(f)!==-1&&h()})}_setupOptions(){const _=f=>{if(!(f in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);return this.rawOptions[f]},h=(f,d)=>{if(!(f in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);d=this._sanitizeAndValidateOption(f,d),this.rawOptions[f]!==d&&(this.rawOptions[f]=d,this._onOptionChange.fire(f))};for(const f in this.rawOptions){const d={get:_.bind(this,f),set:h.bind(this,f)};Object.defineProperty(this.options,f,d)}}_sanitizeAndValidateOption(_,h){switch(_){case"cursorStyle":if(h||(h=s.DEFAULT_OPTIONS[_]),!function(f){return f==="block"||f==="underline"||f==="bar"}(h))throw new Error(`"${h}" is not a valid value for ${_}`);break;case"wordSeparator":h||(h=s.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof h=="number"&&1<=h&&h<=1e3)break;h=p.includes(h)?h:s.DEFAULT_OPTIONS[_];break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(`${_} cannot be less than 1, value: ${h}`);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${h}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${h}`);break;case"rows":case"cols":if(!h&&h!==0)throw new Error(`${_} must be numeric, value: ${h}`);break;case"windowsPty":h=h??{}}return h}}s.OptionsService=g},2660:function(a,s,l){var c=this&&this.__decorate||function(g,y,_,h){var f,d=arguments.length,v=d<3?y:h===null?h=Object.getOwnPropertyDescriptor(y,_):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(g,y,_,h);else for(var b=g.length-1;b>=0;b--)(f=g[b])&&(v=(d<3?f(v):d>3?f(y,_,v):f(y,_))||v);return d>3&&v&&Object.defineProperty(y,_,v),v},m=this&&this.__param||function(g,y){return function(_,h){y(_,h,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const u=l(2585);let p=s.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const y=this._bufferService.buffer;if(g.id===void 0){const b=y.addMarker(y.ybase+y.y),E={data:g,id:this._nextId++,lines:[b]};return b.onDispose(()=>this._removeMarkerFromLink(E,b)),this._dataByLinkId.set(E.id,E),E.id}const _=g,h=this._getEntryIdKey(_),f=this._entriesWithId.get(h);if(f)return this.addLineToLink(f.id,y.ybase+y.y),f.id;const d=y.addMarker(y.ybase+y.y),v={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(v,d)),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(g,y){const _=this._dataByLinkId.get(g);if(_&&_.lines.every(h=>h.line!==y)){const h=this._bufferService.buffer.addMarker(y);_.lines.push(h),h.onDispose(()=>this._removeMarkerFromLink(_,h))}}getLinkData(g){var y;return(y=this._dataByLinkId.get(g))==null?void 0:y.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,y){const _=g.lines.indexOf(y);_!==-1&&(g.lines.splice(_,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};s.OscLinkService=p=c([m(0,u.IBufferService)],p)},8343:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const l="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(m){return m[c]||[]},s.createDecorator=function(m){if(s.serviceRegistry.has(m))return s.serviceRegistry.get(m);const u=function(p,g,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,h,f){h[l]===h?h[c].push({id:_,index:f}):(h[c]=[{id:_,index:f}],h[l]=h)})(u,p,y)};return u.toString=()=>m,s.serviceRegistry.set(m,u),u}},2585:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=l(8343);var m;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(m||(s.LogLevelEnum=m={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=l(8460),m=l(225);class u{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,y,_=!1){return(16777215&g)<<3|(3&y)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const g=new m.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let y=0,_=0;const h=g.length;for(let f=0;f<h;++f){let d=g.charCodeAt(f);if(55296<=d&&d<=56319){if(++f>=h)return y+this.wcwidth(d);const E=g.charCodeAt(f);56320<=E&&E<=57343?d=1024*(d-55296)+E-56320+65536:y+=this.wcwidth(E)}const v=this.charProperties(d,_);let b=u.extractWidth(v);u.extractShouldJoin(v)&&(b-=u.extractWidth(_)),y+=b,_=v}return y}charProperties(g,y){return this._activeProvider.charProperties(g,y)}}s.UnicodeService=u}},r={};function i(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var o={};return(()=>{var a=o;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const s=i(9042),l=i(3236),c=i(844),m=i(5741),u=i(8285),p=i(7975),g=i(7090),y=["cols","rows"];class _ extends c.Disposable{constructor(f){super(),this._core=this.register(new l.Terminal(f)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const d=b=>this._core.options[b],v=(b,E)=>{this._checkReadonlyOptions(b),this._core.options[b]=E};for(const b in this._core.options){const E={get:d.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this._publicOptions,b,E)}}_checkReadonlyOptions(f){if(y.includes(f))throw new Error(`Option "${f}" 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 p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const d in f)this._publicOptions[d]=f[d]}blur(){this._core.blur()}focus(){this._core.focus()}resize(f,d){this._verifyIntegers(f,d),this._core.resize(f,d)}open(f){this._core.open(f)}attachCustomKeyEventHandler(f){this._core.attachCustomKeyEventHandler(f)}attachCustomWheelEventHandler(f){this._core.attachCustomWheelEventHandler(f)}registerLinkProvider(f){return this._core.registerLinkProvider(f)}registerCharacterJoiner(f){return this._checkProposedApi(),this._core.registerCharacterJoiner(f)}deregisterCharacterJoiner(f){this._checkProposedApi(),this._core.deregisterCharacterJoiner(f)}registerMarker(f=0){return this._verifyIntegers(f),this._core.registerMarker(f)}registerDecoration(f){return this._checkProposedApi(),this._verifyPositiveIntegers(f.x??0,f.width??0,f.height??0),this._core.registerDecoration(f)}hasSelection(){return this._core.hasSelection()}select(f,d,v){this._verifyIntegers(f,d,v),this._core.select(f,d,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,d){this._verifyIntegers(f,d),this._core.selectLines(f,d)}dispose(){super.dispose()}scrollLines(f){this._verifyIntegers(f),this._core.scrollLines(f)}scrollPages(f){this._verifyIntegers(f),this._core.scrollPages(f)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(f){this._verifyIntegers(f),this._core.scrollToLine(f)}clear(){this._core.clear()}write(f,d){this._core.write(f,d)}writeln(f,d){this._core.write(f),this._core.write(`\r
`,d)}paste(f){this._core.paste(f)}refresh(f,d){this._verifyIntegers(f,d),this._core.refresh(f,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(f){this._addonManager.loadAddon(this,f)}static get strings(){return s}_verifyIntegers(...f){for(const d of f)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...f){for(const d of f)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}a.Terminal=_})(),o})())})(Qb);var iR=Qb.exports,Zb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={903:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const c=l(274),m=l(627),u=l(237),p=l(860),g=l(374),y=l(296),_=l(345),h=l(859),f=l(399),d=l(855);class v extends h.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var C;return(C=this._charAtlas)==null?void 0:C.pages[0].canvas}constructor(C,R,w,k,L,A,D,P,$,I){super(),this._terminal=C,this._container=R,this._alpha=L,this._themeService=A,this._bufferService=D,this._optionsService=P,this._decorationService=$,this._coreBrowserService=I,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,y.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new h.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new _.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new c.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${w}-layer`),this._canvas.style.zIndex=k.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(F=>{this._refreshCharAtlas(F),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,h.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,g.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(C,R){}handleSelectionChanged(C,R,w=!1){this._selectionModel.update(this._terminal._core,C,R,w)}_setTransparency(C){if(C===this._alpha)return;const R=this._canvas;this._alpha=C,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,R),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(C){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,m.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,C,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,_.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let R=0;R<this._charAtlas.pages.length;R++)this._bitmapGenerator[R]=new b(this._charAtlas.pages[R].canvas)}}resize(C){this._deviceCellWidth=C.device.cell.width,this._deviceCellHeight=C.device.cell.height,this._deviceCharWidth=C.device.char.width,this._deviceCharHeight=C.device.char.height,this._deviceCharLeft=C.device.char.left,this._deviceCharTop=C.device.char.top,this._canvas.width=C.device.canvas.width,this._canvas.height=C.device.canvas.height,this._canvas.style.width=`${C.css.canvas.width}px`,this._canvas.style.height=`${C.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var C;(C=this._charAtlas)==null||C.clearTexture()}_fillCells(C,R,w,k){this._ctx.fillRect(C*this._deviceCellWidth,R*this._deviceCellHeight,w*this._deviceCellWidth,k*this._deviceCellHeight)}_fillMiddleLineAtCells(C,R,w=1){const k=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(C*this._deviceCellWidth,(R+1)*this._deviceCellHeight-k-this._coreBrowserService.dpr,w*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(C,R,w=1,k=0){this._ctx.fillRect(C*this._deviceCellWidth,(R+1)*this._deviceCellHeight+k-this._coreBrowserService.dpr-1,w*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(C,R,w=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const k=this._coreBrowserService.dpr;this._ctx.lineWidth=k;for(let L=0;L<w;L++){const A=(C+L)*this._deviceCellWidth,D=(C+L+.5)*this._deviceCellWidth,P=(C+L+1)*this._deviceCellWidth,$=(R+1)*this._deviceCellHeight-k-1,I=$-k,F=$+k;this._ctx.moveTo(A,$),this._ctx.bezierCurveTo(A,I,D,I,D,$),this._ctx.bezierCurveTo(D,F,P,F,P,$)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(C,R,w=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const k=this._coreBrowserService.dpr;this._ctx.lineWidth=k,this._ctx.setLineDash([2*k,k]);const L=C*this._deviceCellWidth,A=(R+1)*this._deviceCellHeight-k-1;this._ctx.moveTo(L,A);for(let D=0;D<w;D++){const P=(C+w+D)*this._deviceCellWidth;this._ctx.lineTo(P,A)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(C,R,w=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const k=this._coreBrowserService.dpr;this._ctx.lineWidth=k,this._ctx.setLineDash([4*k,3*k]);const L=C*this._deviceCellWidth,A=(C+w)*this._deviceCellWidth,D=(R+1)*this._deviceCellHeight-k-1;this._ctx.moveTo(L,D),this._ctx.lineTo(A,D),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(C,R,w){this._ctx.fillRect(C*this._deviceCellWidth,R*this._deviceCellHeight,this._coreBrowserService.dpr*w,this._deviceCellHeight)}_strokeRectAtCell(C,R,w,k){const L=this._coreBrowserService.dpr;this._ctx.lineWidth=L,this._ctx.strokeRect(C*this._deviceCellWidth+L/2,R*this._deviceCellHeight+L/2,w*this._deviceCellWidth-L,k*this._deviceCellHeight-L)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(C,R,w,k){this._alpha?this._ctx.clearRect(C*this._deviceCellWidth,R*this._deviceCellHeight,w*this._deviceCellWidth,k*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(C*this._deviceCellWidth,R*this._deviceCellHeight,w*this._deviceCellWidth,k*this._deviceCellHeight))}_fillCharTrueColor(C,R,w){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=u.TEXT_BASELINE,this._clipRow(w);let k=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(k=(0,p.tryDrawCustomChar)(this._ctx,C.getChars(),R*this._deviceCellWidth,w*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),k||this._ctx.fillText(C.getChars(),R*this._deviceCellWidth+this._deviceCharLeft,w*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(C,R,w){var A,D,P,$;const k=C.getChars();if(this._cellColorResolver.resolve(C,R,this._bufferService.buffer.ydisp+w,this._deviceCellWidth),!this._charAtlas)return;let L;L=k&&k.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(k,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(C.getCode()||d.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),L.size.x&&L.size.y&&(this._ctx.save(),this._clipRow(w),this._bitmapGenerator[L.texturePage]&&this._charAtlas.pages[L.texturePage].canvas!==this._bitmapGenerator[L.texturePage].canvas&&((D=(A=this._bitmapGenerator[L.texturePage])==null?void 0:A.bitmap)==null||D.close(),delete this._bitmapGenerator[L.texturePage]),this._charAtlas.pages[L.texturePage].version!==((P=this._bitmapGenerator[L.texturePage])==null?void 0:P.version)&&(this._bitmapGenerator[L.texturePage]||(this._bitmapGenerator[L.texturePage]=new b(this._charAtlas.pages[L.texturePage].canvas)),this._bitmapGenerator[L.texturePage].refresh(),this._bitmapGenerator[L.texturePage].version=this._charAtlas.pages[L.texturePage].version),this._ctx.drawImage((($=this._bitmapGenerator[L.texturePage])==null?void 0:$.bitmap)||this._charAtlas.pages[L.texturePage].canvas,L.texturePosition.x,L.texturePosition.y,L.size.x,L.size.y,R*this._deviceCellWidth+this._deviceCharLeft-L.offset.x,w*this._deviceCellHeight+this._deviceCharTop-L.offset.y,L.size.x,L.size.y),this._ctx.restore())}_clipRow(C){this._ctx.beginPath(),this._ctx.rect(0,C*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(C,R){return`${R?"italic":""} ${C?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}s.BaseRenderLayer=v;class b{get bitmap(){return this._bitmap}constructor(C){this.canvas=C,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var C;(C=this._bitmap)==null||C.close(),this._bitmap=void 0,f.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout(()=>this._generate(),100)),this._state===1&&(this._state=2))}_generate(){var C;this._state===0&&((C=this._bitmap)==null||C.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then(R=>{this._state===2?this.refresh():this._bitmap=R,this._state=0}),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CanvasRenderer=void 0;const c=l(627),m=l(56),u=l(374),p=l(345),g=l(859),y=l(873),_=l(43),h=l(630),f=l(744);class d extends g.Disposable{constructor(b,E,C,R,w,k,L,A,D,P,$){super(),this._terminal=b,this._screenElement=E,this._bufferService=R,this._charSizeService=w,this._optionsService=k,this._coreBrowserService=D,this._themeService=$,this._observerDisposable=this.register(new g.MutableDisposable),this._onRequestRedraw=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new p.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new p.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const I=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new f.TextRenderLayer(this._terminal,this._screenElement,0,I,this._bufferService,this._optionsService,L,P,this._coreBrowserService,$),new h.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,P,this._optionsService,$),new _.LinkRenderLayer(this._terminal,this._screenElement,2,C,this._bufferService,this._optionsService,P,this._coreBrowserService,$),new y.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,A,this._coreBrowserService,P,$)];for(const F of this._renderLayers)(0,p.forwardEvent)(F.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,u.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,m.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(F,U)=>this._setCanvasDevicePixelDimensions(F,U)),this.register(this._coreBrowserService.onWindowChange(F=>{this._observerDisposable.value=(0,m.observeDevicePixelDimensions)(this._renderLayers[0].canvas,F,(U,j)=>this._setCanvasDevicePixelDimensions(U,j))})),this.register((0,g.toDisposable)(()=>{for(const F of this._renderLayers)F.dispose();(0,c.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(b,E){this._updateDimensions();for(const C of this._renderLayers)C.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation(b=>b.handleBlur())}handleFocus(){this._runOperation(b=>b.handleFocus())}handleSelectionChanged(b,E,C=!1){this._runOperation(R=>R.handleSelectionChanged(b,E,C)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(b=>b.handleCursorMove())}clear(){this._runOperation(b=>b.reset())}_runOperation(b){for(const E of this._renderLayers)b(E)}renderRows(b,E){for(const C of this._renderLayers)C.handleGridChanged(b,E)}clearTextureAtlas(){for(const b of this._renderLayers)b.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const b=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*b),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*b),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/b),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/b),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(b,E){this.dimensions.device.canvas.height=E,this.dimensions.device.canvas.width=b;for(const C of this._renderLayers)C.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}s.CanvasRenderer=d},873:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorRenderLayer=void 0;const c=l(457),m=l(859),u=l(399),p=l(782),g=l(903);class y extends g.BaseRenderLayer{constructor(h,f,d,v,b,E,C,R,w,k){super(h,f,"cursor",d,!0,k,b,E,w,R),this._onRequestRedraw=v,this._coreService=C,this._cursorBlinkStateManager=this.register(new m.MutableDisposable),this._cell=new p.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(E.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(h){super.resize(h),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var h;this._clearCursor(),(h=this._cursorBlinkStateManager.value)==null||h.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var h;(h=this._cursorBlinkStateManager.value)==null||h.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var h;(h=this._cursorBlinkStateManager.value)==null||h.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new c.CursorBlinkStateManager(()=>this._render(!0),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var h;(h=this._cursorBlinkStateManager.value)==null||h.restartBlinkAnimation()}handleGridChanged(h,f){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(h){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const f=this._bufferService.buffer.ybase+this._bufferService.buffer.y,d=f-this._bufferService.buffer.ydisp;if(d<0||d>=this._bufferService.rows)return void this._clearCursor();const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(f).loadCell(v,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const b=this._optionsService.rawOptions.cursorStyle,E=this._optionsService.rawOptions.cursorInactiveStyle;return E&&E!=="none"&&this._cursorRenderers[E](v,d,this._cell),this._ctx.restore(),this._state.x=v,this._state.y=d,this._state.isFocused=!1,this._state.style=b,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===v&&this._state.y===d&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](v,d,this._cell),this._ctx.restore(),this._state.x=v,this._state.y=d,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(u.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(h,f,d){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(h,f,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(h,f,d){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(h,f,d.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(d,h,f),this._ctx.restore()}_renderUnderlineCursor(h,f,d){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(h,f),this._ctx.restore()}_renderOutlineCursor(h,f,d){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(h,f,d.getWidth(),1),this._ctx.restore()}}s.CursorRenderLayer=y},574:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GridCache=void 0,s.GridCache=class{constructor(){this.cache=[]}resize(l,c){for(let m=0;m<l;m++){this.cache.length<=m&&this.cache.push([]);for(let u=this.cache[m].length;u<c;u++)this.cache[m].push(void 0);this.cache[m].length=c}this.cache.length=l}clear(){for(let l=0;l<this.cache.length;l++)for(let c=0;c<this.cache[l].length;c++)this.cache[l][c]=void 0}}},43:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const c=l(197),m=l(237),u=l(903);class p extends u.BaseRenderLayer{constructor(y,_,h,f,d,v,b,E,C){super(y,_,"link",h,!0,C,d,v,b,E),this.register(f.onShowLinkUnderline(R=>this._handleShowLinkUnderline(R))),this.register(f.onHideLinkUnderline(R=>this._handleHideLinkUnderline(R)))}resize(y){super.resize(y),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(y){if(y.fg===m.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:y.fg&&(0,c.is256Color)(y.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[y.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(let _=y.y1+1;_<y.y2;_++)this._fillBottomLineAtCells(0,_,y.cols);this._fillBottomLineAtCells(0,y.y2,y.x2)}this._state=y}_handleHideLinkUnderline(y){this._clearCurrentLink()}}s.LinkRenderLayer=p},630:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionRenderLayer=void 0;const c=l(903);class m extends c.BaseRenderLayer{constructor(p,g,y,_,h,f,d,v){super(p,g,"selection",y,!0,v,_,d,f,h),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(p){super.resize(p),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(p,g,y){super.handleSelectionChanged(p,g,y),this._redrawSelection(p,g,y)}_redrawSelection(p,g,y){if(!this._didStateChange(p,g,y,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!p||!g)return void this._clearState();const _=p[1]-this._bufferService.buffer.ydisp,h=g[1]-this._bufferService.buffer.ydisp,f=Math.max(_,0),d=Math.min(h,this._bufferService.rows-1);if(f>=this._bufferService.rows||d<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,y){const v=p[0],b=g[0]-v,E=d-f+1;this._fillCells(v,f,b,E)}else{const v=_===f?p[0]:0,b=f===h?g[0]:this._bufferService.cols;this._fillCells(v,f,b-v,1);const E=Math.max(d-f-1,0);if(this._fillCells(0,f+1,this._bufferService.cols,E),f!==d){const C=h===d?g[0]:this._bufferService.cols;this._fillCells(0,d,C,1)}}this._state.start=[p[0],p[1]],this._state.end=[g[0],g[1]],this._state.columnSelectMode=y,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(p,g,y,_){return!this._areCoordinatesEqual(p,this._state.start)||!this._areCoordinatesEqual(g,this._state.end)||y!==this._state.columnSelectMode||_!==this._state.ydisp}_areCoordinatesEqual(p,g){return!(!p||!g)&&p[0]===g[0]&&p[1]===g[1]}}s.SelectionRenderLayer=m},744:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextRenderLayer=void 0;const c=l(577),m=l(147),u=l(782),p=l(855),g=l(903),y=l(574);class _ extends g.BaseRenderLayer{constructor(f,d,v,b,E,C,R,w,k,L){super(f,d,"text",v,b,L,E,C,w,k),this._characterJoinerService=R,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new u.CellData,this._state=new y.GridCache,this.register(C.onSpecificOptionChange("allowTransparency",A=>this._setTransparency(A)))}resize(f){super.resize(f);const d=this._getFont(!1,!1);this._characterWidth===f.device.char.width&&this._characterFont===d||(this._characterWidth=f.device.char.width,this._characterFont=d,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(f,d,v){for(let b=f;b<=d;b++){const E=b+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.lines.get(E),R=this._characterJoinerService.getJoinedCharacters(E);for(let w=0;w<this._bufferService.cols;w++){C.loadCell(w,this._workCell);let k=this._workCell,L=!1,A=w;if(k.getWidth()!==0){if(R.length>0&&w===R[0][0]){L=!0;const D=R.shift();k=new c.JoinedCellData(this._workCell,C.translateToString(!0,D[0],D[1]),D[1]-D[0]),A=D[1]-1}!L&&this._isOverlapping(k)&&A<C.length-1&&C.getCodePoint(A+1)===p.NULL_CELL_CODE&&(k.content&=-12582913,k.content|=8388608),v(k,w,b),w=A}}}}_drawBackground(f,d){const v=this._ctx,b=this._bufferService.cols;let E=0,C=0,R=null;v.save(),this._forEachCell(f,d,(w,k,L)=>{let A=null;w.isInverse()?A=w.isFgDefault()?this._themeService.colors.foreground.css:w.isFgRGB()?`rgb(${m.AttributeData.toColorRGB(w.getFgColor()).join(",")})`:this._themeService.colors.ansi[w.getFgColor()].css:w.isBgRGB()?A=`rgb(${m.AttributeData.toColorRGB(w.getBgColor()).join(",")})`:w.isBgPalette()&&(A=this._themeService.colors.ansi[w.getBgColor()].css);let D=!1;this._decorationService.forEachDecorationAtCell(k,this._bufferService.buffer.ydisp+L,void 0,P=>{P.options.layer!=="top"&&D||(P.backgroundColorRGB&&(A=P.backgroundColorRGB.css),D=P.options.layer==="top")}),R===null&&(E=k,C=L),L!==C?(v.fillStyle=R||"",this._fillCells(E,C,b-E,1),E=k,C=L):R!==A&&(v.fillStyle=R||"",this._fillCells(E,C,k-E,1),E=k,C=L),R=A}),R!==null&&(v.fillStyle=R,this._fillCells(E,C,b-E,1)),v.restore()}_drawForeground(f,d){this._forEachCell(f,d,(v,b,E)=>this._drawChars(v,b,E))}handleGridChanged(f,d){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,f,this._bufferService.cols,d-f+1),this._drawBackground(f,d),this._drawForeground(f,d))}_isOverlapping(f){if(f.getWidth()!==1||f.getCode()<256)return!1;const d=f.getChars();if(this._characterOverlapCache.hasOwnProperty(d))return this._characterOverlapCache[d];this._ctx.save(),this._ctx.font=this._characterFont;const v=Math.floor(this._ctx.measureText(d).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[d]=v,v}}s.TextRenderLayer=_},274:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const c=l(855),m=l(160),u=l(374);let p,g=0,y=0,_=!1,h=!1,f=!1,d=0;s.CellColorResolver=class{constructor(v,b,E,C,R,w){this._terminal=v,this._optionService=b,this._selectionRenderModel=E,this._decorationService=C,this._coreBrowserService=R,this._themeService=w,this.result={fg:0,bg:0,ext:0}}resolve(v,b,E,C){if(this.result.bg=v.bg,this.result.fg=v.fg,this.result.ext=268435456&v.bg?v.extended.ext:0,y=0,g=0,h=!1,_=!1,f=!1,p=this._themeService.colors,d=0,v.getCode()!==c.NULL_CELL_CODE&&v.extended.underlineStyle===4){const R=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));d=b*C%(2*Math.round(R))}if(this._decorationService.forEachDecorationAtCell(b,E,"bottom",R=>{R.backgroundColorRGB&&(y=R.backgroundColorRGB.rgba>>8&16777215,h=!0),R.foregroundColorRGB&&(g=R.foregroundColorRGB.rgba>>8&16777215,_=!0)}),f=this._selectionRenderModel.isCellSelected(this._terminal,b,E),f){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=-256&this.result.bg|255}y=m.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else y=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(h=!0,p.selectionForeground&&(g=p.selectionForeground.rgba>>8&16777215,_=!0),(0,u.treatGlyphAsBackgroundColor)(v.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))g=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:g=-256&this.result.bg|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:g=(16777215&this.result.fg)<<8|255;break;default:g=this._themeService.colors.foreground.rgba}g=m.rgba.blend(g,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}_=!0}}this._decorationService.forEachDecorationAtCell(b,E,"top",R=>{R.backgroundColorRGB&&(y=R.backgroundColorRGB.rgba>>8&16777215,h=!0),R.foregroundColorRGB&&(g=R.foregroundColorRGB.rgba>>8&16777215,_=!0)}),h&&(y=f?-16777216&v.bg&-134217729|y|50331648:-16777216&v.bg|y|50331648),_&&(g=-16777216&v.fg&-67108865|g|50331648),67108864&this.result.fg&&(h&&!_&&(g=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648,_=!0),!h&&_&&(y=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648,h=!0)),p=void 0,this.result.bg=h?y:this.result.bg,this.result.fg=_?g:this.result.fg,this.result.ext&=536870911,this.result.ext|=d<<29&3758096384}}},627:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const c=l(509),m=l(197),u=[];s.acquireTextureAtlas=function(p,g,y,_,h,f,d,v){const b=(0,m.generateConfig)(_,h,f,d,g,y,v);for(let R=0;R<u.length;R++){const w=u[R],k=w.ownedBy.indexOf(p);if(k>=0){if((0,m.configEquals)(w.config,b))return w.atlas;w.ownedBy.length===1?(w.atlas.dispose(),u.splice(R,1)):w.ownedBy.splice(k,1);break}}for(let R=0;R<u.length;R++){const w=u[R];if((0,m.configEquals)(w.config,b))return w.ownedBy.push(p),w.atlas}const E=p._core,C={atlas:new c.TextureAtlas(document,b,E.unicodeService),config:b,ownedBy:[p]};return u.push(C),C.atlas},s.removeTerminalFromCache=function(p){for(let g=0;g<u.length;g++){const y=u[g].ownedBy.indexOf(p);if(y!==-1){u[g].ownedBy.length===1?(u[g].atlas.dispose(),u.splice(g,1)):u[g].ownedBy.splice(y,1);break}}}},197:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const c=l(160);s.generateConfig=function(m,u,p,g,y,_,h){const f={foreground:_.foreground,background:_.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:_.ansi.slice(),contrastCache:_.contrastCache,halfContrastCache:_.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:h,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:m,deviceCellHeight:u,deviceCharWidth:p,deviceCharHeight:g,fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight,fontWeightBold:y.fontWeightBold,allowTransparency:y.allowTransparency,drawBoldTextInBrightColors:y.drawBoldTextInBrightColors,minimumContrastRatio:y.minimumContrastRatio,colors:f}},s.configEquals=function(m,u){for(let p=0;p<m.colors.ansi.length;p++)if(m.colors.ansi[p].rgba!==u.colors.ansi[p].rgba)return!1;return m.devicePixelRatio===u.devicePixelRatio&&m.customGlyphs===u.customGlyphs&&m.lineHeight===u.lineHeight&&m.letterSpacing===u.letterSpacing&&m.fontFamily===u.fontFamily&&m.fontSize===u.fontSize&&m.fontWeight===u.fontWeight&&m.fontWeightBold===u.fontWeightBold&&m.allowTransparency===u.allowTransparency&&m.deviceCharWidth===u.deviceCharWidth&&m.deviceCharHeight===u.deviceCharHeight&&m.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&m.minimumContrastRatio===u.minimumContrastRatio&&m.colors.foreground.rgba===u.colors.foreground.rgba&&m.colors.background.rgba===u.colors.background.rgba},s.is256Color=function(m){return(50331648&m)==16777216||(50331648&m)==33554432}},237:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=l(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(l=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},l)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const c=l(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const m={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(_,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"║":{1:(_,h)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╒":{1:(_,h)=>`M.5,1 L.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╓":{1:(_,h)=>`M${.5-_},1 L${.5-_},.5 L1,.5 M${.5+_},.5 L${.5+_},1`},"╔":{1:(_,h)=>`M1,${.5-h} L${.5-_},${.5-h} L${.5-_},1 M1,${.5+h} L${.5+_},${.5+h} L${.5+_},1`},"╕":{1:(_,h)=>`M0,${.5-h} L.5,${.5-h} L.5,1 M0,${.5+h} L.5,${.5+h}`},"╖":{1:(_,h)=>`M${.5+_},1 L${.5+_},.5 L0,.5 M${.5-_},.5 L${.5-_},1`},"╗":{1:(_,h)=>`M0,${.5+h} L${.5-_},${.5+h} L${.5-_},1 M0,${.5-h} L${.5+_},${.5-h} L${.5+_},1`},"╘":{1:(_,h)=>`M.5,0 L.5,${.5+h} L1,${.5+h} M.5,${.5-h} L1,${.5-h}`},"╙":{1:(_,h)=>`M1,.5 L${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╚":{1:(_,h)=>`M1,${.5-h} L${.5+_},${.5-h} L${.5+_},0 M1,${.5+h} L${.5-_},${.5+h} L${.5-_},0`},"╛":{1:(_,h)=>`M0,${.5+h} L.5,${.5+h} L.5,0 M0,${.5-h} L.5,${.5-h}`},"╜":{1:(_,h)=>`M0,.5 L${.5+_},.5 L${.5+_},0 M${.5-_},.5 L${.5-_},0`},"╝":{1:(_,h)=>`M0,${.5-h} L${.5-_},${.5-h} L${.5-_},0 M0,${.5+h} L${.5+_},${.5+h} L${.5+_},0`},"╞":{1:(_,h)=>`M.5,0 L.5,1 M.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╟":{1:(_,h)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1 M${.5+_},.5 L1,.5`},"╠":{1:(_,h)=>`M${.5-_},0 L${.5-_},1 M1,${.5+h} L${.5+_},${.5+h} L${.5+_},1 M1,${.5-h} L${.5+_},${.5-h} L${.5+_},0`},"╡":{1:(_,h)=>`M.5,0 L.5,1 M0,${.5-h} L.5,${.5-h} M0,${.5+h} L.5,${.5+h}`},"╢":{1:(_,h)=>`M0,.5 L${.5-_},.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╣":{1:(_,h)=>`M${.5+_},0 L${.5+_},1 M0,${.5+h} L${.5-_},${.5+h} L${.5-_},1 M0,${.5-h} L${.5-_},${.5-h} L${.5-_},0`},"╤":{1:(_,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h} M.5,${.5+h} L.5,1`},"╥":{1:(_,h)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},1 M${.5+_},.5 L${.5+_},1`},"╦":{1:(_,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L${.5-_},${.5+h} L${.5-_},1 M1,${.5+h} L${.5+_},${.5+h} L${.5+_},1`},"╧":{1:(_,h)=>`M.5,0 L.5,${.5-h} M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╨":{1:(_,h)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╩":{1:(_,h)=>`M0,${.5+h} L1,${.5+h} M0,${.5-h} L${.5-_},${.5-h} L${.5-_},0 M1,${.5-h} L${.5+_},${.5-h} L${.5+_},0`},"╪":{1:(_,h)=>`M.5,0 L.5,1 M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╫":{1:(_,h)=>`M0,.5 L1,.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╬":{1:(_,h)=>`M0,${.5+h} L${.5-_},${.5+h} L${.5-_},1 M1,${.5+h} L${.5+_},${.5+h} L${.5+_},1 M0,${.5-h} L${.5-_},${.5-h} L${.5-_},0 M1,${.5-h} L${.5+_},${.5-h} L${.5+_},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(_,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,1,.5`},"╮":{1:(_,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,0,.5`},"╯":{1:(_,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,0,.5`},"╰":{1:(_,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(_,h,f,d,v,b,E,C){const R=s.blockElementDefinitions[h];if(R)return function(A,D,P,$,I,F){for(let U=0;U<D.length;U++){const j=D[U],T=I/8,M=F/8;A.fillRect(P+j.x*T,$+j.y*M,j.w*T,j.h*M)}}(_,R,f,d,v,b),!0;const w=m[h];if(w)return function(A,D,P,$,I,F){let U=u.get(D);U||(U=new Map,u.set(D,U));const j=A.fillStyle;if(typeof j!="string")throw new Error(`Unexpected fillStyle type "${j}"`);let T=U.get(j);if(!T){const M=D[0].length,B=D.length,z=A.canvas.ownerDocument.createElement("canvas");z.width=M,z.height=B;const O=(0,c.throwIfFalsy)(z.getContext("2d")),X=new ImageData(M,B);let re,H,W,N;if(j.startsWith("#"))re=parseInt(j.slice(1,3),16),H=parseInt(j.slice(3,5),16),W=parseInt(j.slice(5,7),16),N=j.length>7&&parseInt(j.slice(7,9),16)||1;else{if(!j.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${j}" when drawing pattern glyph`);[re,H,W,N]=j.substring(5,j.length-1).split(",").map(K=>parseFloat(K))}for(let K=0;K<B;K++)for(let Q=0;Q<M;Q++)X.data[4*(K*M+Q)]=re,X.data[4*(K*M+Q)+1]=H,X.data[4*(K*M+Q)+2]=W,X.data[4*(K*M+Q)+3]=D[K][Q]*(255*N);O.putImageData(X,0,0),T=(0,c.throwIfFalsy)(A.createPattern(z,null)),U.set(j,T)}A.fillStyle=T,A.fillRect(P,$,I,F)}(_,w,f,d,v,b),!0;const k=s.boxDrawingDefinitions[h];if(k)return function(A,D,P,$,I,F,U){A.strokeStyle=A.fillStyle;for(const[j,T]of Object.entries(D)){let M;A.beginPath(),A.lineWidth=U*Number.parseInt(j),M=typeof T=="function"?T(.15,.15/F*I):T;for(const B of M.split(" ")){const z=B[0],O=g[z];if(!O){console.error(`Could not find drawing instructions for "${z}"`);continue}const X=B.substring(1).split(",");X[0]&&X[1]&&O(A,y(X,I,F,P,$,!0,U))}A.stroke(),A.closePath()}}(_,k,f,d,v,b,C),!0;const L=s.powerlineDefinitions[h];return!!L&&(function(A,D,P,$,I,F,U,j){const T=new Path2D;T.rect(P,$,I,F),A.clip(T),A.beginPath();const M=U/12;A.lineWidth=j*M;for(const B of D.d.split(" ")){const z=B[0],O=g[z];if(!O){console.error(`Could not find drawing instructions for "${z}"`);continue}const X=B.substring(1).split(",");X[0]&&X[1]&&O(A,y(X,I,F,P,$,!1,j,(D.leftPadding??0)*(M/2),(D.rightPadding??0)*(M/2)))}D.type===1?(A.strokeStyle=A.fillStyle,A.stroke()):A.fill(),A.closePath()}(_,L,f,d,v,b,E,C),!0)};const u=new Map;function p(_,h,f=0){return Math.max(Math.min(_,h),f)}const g={C:(_,h)=>_.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]),L:(_,h)=>_.lineTo(h[0],h[1]),M:(_,h)=>_.moveTo(h[0],h[1])};function y(_,h,f,d,v,b,E,C=0,R=0){const w=_.map(k=>parseFloat(k)||parseInt(k));if(w.length<2)throw new Error("Too few arguments for instruction");for(let k=0;k<w.length;k+=2)w[k]*=h-C*E-R*E,b&&w[k]!==0&&(w[k]=p(Math.round(w[k]+.5)-.5,h,0)),w[k]+=d+C*E;for(let k=1;k<w.length;k+=2)w[k]*=f,b&&w[k]!==0&&(w[k]=p(Math.round(w[k]+.5)-.5,f,0)),w[k]+=v;return w}},56:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const c=l(859);s.observeDevicePixelDimensions=function(m,u,p){let g=new u.ResizeObserver(y=>{const _=y.find(d=>d.target===m);if(!_)return;if(!("devicePixelContentBoxSize"in _))return g==null||g.disconnect(),void(g=void 0);const h=_.devicePixelContentBoxSize[0].inlineSize,f=_.devicePixelContentBoxSize[0].blockSize;h>0&&f>0&&p(h,f)});try{g.observe(m,{box:["device-pixel-content-box"]})}catch{g.disconnect(),g=void 0}return(0,c.toDisposable)(()=>g==null?void 0:g.disconnect())}},374:(a,s)=>{function l(c){return 57508<=c&&c<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},s.isPowerlineGlyph=l,s.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},s.treatGlyphAsBackgroundColor=function(c){return l(c)||function(m){return 9472<=m&&m<=9631}(c)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(c,m,u=0){return(c-(2*Math.round(m)-u))%(2*Math.round(m))}},296:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,u,p,g=!1){if(this.selectionStart=u,this.selectionEnd=p,!u||!p||u[0]===p[0]&&u[1]===p[1])return void this.clear();const y=m.buffers.active.ydisp,_=u[1]-y,h=p[1]-y,f=Math.max(_,0),d=Math.min(h,m.rows-1);f>=m.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=_,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=p[0])}isCellSelected(m,u,p){return!!this.hasSelection&&(p-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&p>=this.viewportCappedStartRow&&u<this.endCol&&p<=this.viewportCappedEndRow:u<this.startCol&&p>=this.viewportCappedStartRow&&u>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new l}},509:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const c=l(237),m=l(860),u=l(374),p=l(160),g=l(345),y=l(485),_=l(385),h=l(147),f=l(855),d={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let v;class b{get pages(){return this._pages}constructor(k,L,A){this._document=k,this._config=L,this._unicodeService=A,this._didWarmUp=!1,this._cacheMap=new y.FourKeyMap,this._cacheMapCombined=new y.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new h.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new g.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new g.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=R(k,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,u.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const k of this.pages)k.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const k=new _.IdleTaskQueue;for(let L=33;L<126;L++)k.enqueue(()=>{if(!this._cacheMap.get(L,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT)){const A=this._drawToCache(L,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT);this._cacheMap.set(L,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT,A)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const k of this._pages)k.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const L=this._pages.filter(U=>2*U.canvas.width<=(b.maxTextureSize||4096)).sort((U,j)=>j.canvas.width!==U.canvas.width?j.canvas.width-U.canvas.width:j.percentageUsed-U.percentageUsed);let A=-1,D=0;for(let U=0;U<L.length;U++)if(L[U].canvas.width!==D)A=U,D=L[U].canvas.width;else if(U-A==3)break;const P=L.slice(A,A+4),$=P.map(U=>U.glyphs[0].texturePage).sort((U,j)=>U>j?1:-1),I=this.pages.length-P.length,F=this._mergePages(P,I);F.version++;for(let U=$.length-1;U>=0;U--)this._deletePage($[U]);this.pages.push(F),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(F.canvas)}const k=new E(this._document,this._textureSize);return this._pages.push(k),this._activePages.push(k),this._onAddTextureAtlasCanvas.fire(k.canvas),k}_mergePages(k,L){const A=2*k[0].canvas.width,D=new E(this._document,A,k);for(const[P,$]of k.entries()){const I=P*$.canvas.width%A,F=Math.floor(P/2)*$.canvas.height;D.ctx.drawImage($.canvas,I,F);for(const j of $.glyphs)j.texturePage=L,j.sizeClipSpace.x=j.size.x/A,j.sizeClipSpace.y=j.size.y/A,j.texturePosition.x+=I,j.texturePosition.y+=F,j.texturePositionClipSpace.x=j.texturePosition.x/A,j.texturePositionClipSpace.y=j.texturePosition.y/A;this._onRemoveTextureAtlasCanvas.fire($.canvas);const U=this._activePages.indexOf($);U!==-1&&this._activePages.splice(U,1)}return D}_deletePage(k){this._pages.splice(k,1);for(let L=k;L<this._pages.length;L++){const A=this._pages[L];for(const D of A.glyphs)D.texturePage--;A.version++}}getRasterizedGlyphCombinedChar(k,L,A,D,P){return this._getFromCacheMap(this._cacheMapCombined,k,L,A,D,P)}getRasterizedGlyph(k,L,A,D,P){return this._getFromCacheMap(this._cacheMap,k,L,A,D,P)}_getFromCacheMap(k,L,A,D,P,$=!1){return v=k.get(L,A,D,P),v||(v=this._drawToCache(L,A,D,P,$),k.set(L,A,D,P,v)),v}_getColorFromAnsiIndex(k){if(k>=this._config.colors.ansi.length)throw new Error("No color found for idx "+k);return this._config.colors.ansi[k]}_getBackgroundColor(k,L,A,D){if(this._config.allowTransparency)return p.NULL_COLOR;let P;switch(k){case 16777216:case 33554432:P=this._getColorFromAnsiIndex(L);break;case 50331648:const $=h.AttributeData.toColorRGB(L);P=p.rgba.toColor($[0],$[1],$[2]);break;default:P=A?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return P}_getForegroundColor(k,L,A,D,P,$,I,F,U,j){const T=this._getMinimumContrastColor(k,L,A,D,P,$,I,U,F,j);if(T)return T;let M;switch(P){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&U&&$<8&&($+=8),M=this._getColorFromAnsiIndex($);break;case 50331648:const B=h.AttributeData.toColorRGB($);M=p.rgba.toColor(B[0],B[1],B[2]);break;default:M=I?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(M=p.color.opaque(M)),F&&(M=p.color.multiplyOpacity(M,c.DIM_OPACITY)),M}_resolveBackgroundRgba(k,L,A){switch(k){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(k,L,A,D){switch(k){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&D&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(k,L,A,D,P,$,I,F,U,j){if(this._config.minimumContrastRatio===1||j)return;const T=this._getContrastCache(U),M=T.getColor(k,D);if(M!==void 0)return M||void 0;const B=this._resolveBackgroundRgba(L,A,I),z=this._resolveForegroundRgba(P,$,I,F),O=p.rgba.ensureContrastRatio(B,z,this._config.minimumContrastRatio/(U?2:1));if(!O)return void T.setColor(k,D,null);const X=p.rgba.toColor(O>>24&255,O>>16&255,O>>8&255);return T.setColor(k,D,X),X}_getContrastCache(k){return k?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(k,L,A,D,P=!1){const $=typeof k=="number"?String.fromCharCode(k):k,I=Math.min(this._config.deviceCellWidth*Math.max($.length,2)+4,this._textureSize);this._tmpCanvas.width<I&&(this._tmpCanvas.width=I);const F=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<F&&(this._tmpCanvas.height=F),this._tmpCtx.save(),this._workAttributeData.fg=A,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=D,this._workAttributeData.isInvisible())return d;const U=!!this._workAttributeData.isBold(),j=!!this._workAttributeData.isInverse(),T=!!this._workAttributeData.isDim(),M=!!this._workAttributeData.isItalic(),B=!!this._workAttributeData.isUnderline(),z=!!this._workAttributeData.isStrikethrough(),O=!!this._workAttributeData.isOverline();let X=this._workAttributeData.getFgColor(),re=this._workAttributeData.getFgColorMode(),H=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(j){const se=X;X=H,H=se;const Re=re;re=W,W=Re}const N=this._getBackgroundColor(W,H,j,T);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const K=U?this._config.fontWeightBold:this._config.fontWeight,Q=M?"italic":"";this._tmpCtx.font=`${Q} ${K} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const q=$.length===1&&(0,u.isPowerlineGlyph)($.charCodeAt(0)),de=$.length===1&&(0,u.isRestrictedPowerlineGlyph)($.charCodeAt(0)),he=this._getForegroundColor(L,W,H,A,re,X,j,T,U,(0,u.treatGlyphAsBackgroundColor)($.charCodeAt(0)));this._tmpCtx.fillStyle=he.css;const le=de?0:4;let Ae=!1;this._config.customGlyphs!==!1&&(Ae=(0,m.tryDrawCustomChar)(this._tmpCtx,$,le,le,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Be,ue=!q;if(Be=typeof k=="number"?this._unicodeService.wcwidth(k):this._unicodeService.getStringCellWidth(k),B){this._tmpCtx.save();const se=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Re=se%2==1?.5:0;if(this._tmpCtx.lineWidth=se,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ue=!1,this._tmpCtx.strokeStyle=`rgb(${h.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ue=!1;let Pe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Pe<8&&(Pe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Pe).css}this._tmpCtx.beginPath();const G=le,J=Math.ceil(le+this._config.deviceCharHeight)-Re-(P?2*se:0),pe=J+se,me=J+2*se;let we=this._workAttributeData.getUnderlineVariantOffset();for(let Pe=0;Pe<Be;Pe++){this._tmpCtx.save();const Me=G+Pe*this._config.deviceCellWidth,ge=G+(Pe+1)*this._config.deviceCellWidth,Cn=Me+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Me,J),this._tmpCtx.lineTo(ge,J),this._tmpCtx.moveTo(Me,me),this._tmpCtx.lineTo(ge,me);break;case 3:const Bn=se<=1?me:Math.ceil(le+this._config.deviceCharHeight-se/2)-Re,ht=se<=1?J:Math.ceil(le+this._config.deviceCharHeight+se/2)-Re,ir=new Path2D;ir.rect(Me,J,this._config.deviceCellWidth,me-J),this._tmpCtx.clip(ir),this._tmpCtx.moveTo(Me-this._config.deviceCellWidth/2,pe),this._tmpCtx.bezierCurveTo(Me-this._config.deviceCellWidth/2,ht,Me,ht,Me,pe),this._tmpCtx.bezierCurveTo(Me,Bn,Cn,Bn,Cn,pe),this._tmpCtx.bezierCurveTo(Cn,ht,ge,ht,ge,pe),this._tmpCtx.bezierCurveTo(ge,Bn,ge+this._config.deviceCellWidth/2,Bn,ge+this._config.deviceCellWidth/2,pe);break;case 4:const Tt=we===0?0:we>=se?2*se-we:se-we;we>=se||Tt===0?(this._tmpCtx.setLineDash([Math.round(se),Math.round(se)]),this._tmpCtx.moveTo(Me+Tt,J),this._tmpCtx.lineTo(ge,J)):(this._tmpCtx.setLineDash([Math.round(se),Math.round(se)]),this._tmpCtx.moveTo(Me,J),this._tmpCtx.lineTo(Me+Tt,J),this._tmpCtx.moveTo(Me+Tt+se,J),this._tmpCtx.lineTo(ge,J)),we=(0,u.computeNextVariantOffset)(ge-Me,se,we);break;case 5:const v5=.6,_5=.3,Lh=ge-Me,tv=Math.floor(v5*Lh),nv=Math.floor(_5*Lh),y5=Lh-tv-nv;this._tmpCtx.setLineDash([tv,nv,y5]),this._tmpCtx.moveTo(Me,J),this._tmpCtx.lineTo(ge,J);break;default:this._tmpCtx.moveTo(Me,J),this._tmpCtx.lineTo(ge,J)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Ae&&this._config.fontSize>=12&&!this._config.allowTransparency&&$!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Pe=this._tmpCtx.measureText($);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Pe&&Pe.actualBoundingBoxDescent>0){this._tmpCtx.save();const Me=new Path2D;Me.rect(G,J-Math.ceil(se/2),this._config.deviceCellWidth*Be,me-J+Math.ceil(se/2)),this._tmpCtx.clip(Me),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=N.css,this._tmpCtx.strokeText($,le,le+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(O){const se=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Re=se%2==1?.5:0;this._tmpCtx.lineWidth=se,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(le,le+Re),this._tmpCtx.lineTo(le+this._config.deviceCharWidth*Be,le+Re),this._tmpCtx.stroke()}if(Ae||this._tmpCtx.fillText($,le,le+this._config.deviceCharHeight),$==="_"&&!this._config.allowTransparency){let se=C(this._tmpCtx.getImageData(le,le,this._config.deviceCellWidth,this._config.deviceCellHeight),N,he,ue);if(se)for(let Re=1;Re<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText($,le,le+this._config.deviceCharHeight-Re),se=C(this._tmpCtx.getImageData(le,le,this._config.deviceCellWidth,this._config.deviceCellHeight),N,he,ue),se);Re++);}if(z){const se=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Re=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=se,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(le,le+Math.floor(this._config.deviceCharHeight/2)-Re),this._tmpCtx.lineTo(le+this._config.deviceCharWidth*Be,le+Math.floor(this._config.deviceCharHeight/2)-Re),this._tmpCtx.stroke()}this._tmpCtx.restore();const Ct=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Sn;if(Sn=this._config.allowTransparency?function(se){for(let Re=0;Re<se.data.length;Re+=4)if(se.data[Re+3]>0)return!1;return!0}(Ct):C(Ct,N,he,ue),Sn)return d;const Ee=this._findGlyphBoundingBox(Ct,this._workBoundingBox,I,de,Ae,le);let _e,Ce;for(;;){if(this._activePages.length===0){const se=this._createNewPage();_e=se,Ce=se.currentRow,Ce.height=Ee.size.y;break}_e=this._activePages[this._activePages.length-1],Ce=_e.currentRow;for(const se of this._activePages)Ee.size.y<=se.currentRow.height&&(_e=se,Ce=se.currentRow);for(let se=this._activePages.length-1;se>=0;se--)for(const Re of this._activePages[se].fixedRows)Re.height<=Ce.height&&Ee.size.y<=Re.height&&(_e=this._activePages[se],Ce=Re);if(Ce.y+Ee.size.y>=_e.canvas.height||Ce.height>Ee.size.y+2){let se=!1;if(_e.currentRow.y+_e.currentRow.height+Ee.size.y>=_e.canvas.height){let Re;for(const G of this._activePages)if(G.currentRow.y+G.currentRow.height+Ee.size.y<G.canvas.height){Re=G;break}if(Re)_e=Re;else if(b.maxAtlasPages&&this._pages.length>=b.maxAtlasPages&&Ce.y+Ee.size.y<=_e.canvas.height&&Ce.height>=Ee.size.y&&Ce.x+Ee.size.x<=_e.canvas.width)se=!0;else{const G=this._createNewPage();_e=G,Ce=G.currentRow,Ce.height=Ee.size.y,se=!0}}se||(_e.currentRow.height>0&&_e.fixedRows.push(_e.currentRow),Ce={x:0,y:_e.currentRow.y+_e.currentRow.height,height:Ee.size.y},_e.fixedRows.push(Ce),_e.currentRow={x:0,y:Ce.y+Ce.height,height:0})}if(Ce.x+Ee.size.x<=_e.canvas.width)break;Ce===_e.currentRow?(Ce.x=0,Ce.y+=Ce.height,Ce.height=0):_e.fixedRows.splice(_e.fixedRows.indexOf(Ce),1)}return Ee.texturePage=this._pages.indexOf(_e),Ee.texturePosition.x=Ce.x,Ee.texturePosition.y=Ce.y,Ee.texturePositionClipSpace.x=Ce.x/_e.canvas.width,Ee.texturePositionClipSpace.y=Ce.y/_e.canvas.height,Ee.sizeClipSpace.x/=_e.canvas.width,Ee.sizeClipSpace.y/=_e.canvas.height,Ce.height=Math.max(Ce.height,Ee.size.y),Ce.x+=Ee.size.x,_e.ctx.putImageData(Ct,Ee.texturePosition.x-this._workBoundingBox.left,Ee.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Ee.size.x,Ee.size.y),_e.addGlyph(Ee),_e.version++,Ee}_findGlyphBoundingBox(k,L,A,D,P,$){L.top=0;const I=D?this._config.deviceCellHeight:this._tmpCanvas.height,F=D?this._config.deviceCellWidth:A;let U=!1;for(let j=0;j<I;j++){for(let T=0;T<F;T++){const M=j*this._tmpCanvas.width*4+4*T+3;if(k.data[M]!==0){L.top=j,U=!0;break}}if(U)break}L.left=0,U=!1;for(let j=0;j<$+F;j++){for(let T=0;T<I;T++){const M=T*this._tmpCanvas.width*4+4*j+3;if(k.data[M]!==0){L.left=j,U=!0;break}}if(U)break}L.right=F,U=!1;for(let j=$+F-1;j>=$;j--){for(let T=0;T<I;T++){const M=T*this._tmpCanvas.width*4+4*j+3;if(k.data[M]!==0){L.right=j,U=!0;break}}if(U)break}L.bottom=I,U=!1;for(let j=I-1;j>=0;j--){for(let T=0;T<F;T++){const M=j*this._tmpCanvas.width*4+4*T+3;if(k.data[M]!==0){L.bottom=j,U=!0;break}}if(U)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+$+(D||P?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+$+(D||P?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=b;class E{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(k){this._glyphs.push(k),this._usedPixels+=k.size.x*k.size.y}constructor(k,L,A){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],A)for(const D of A)this._glyphs.push(...D.glyphs),this._usedPixels+=D._usedPixels;this.canvas=R(k,L,L),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function C(w,k,L,A){const D=k.rgba>>>24,P=k.rgba>>>16&255,$=k.rgba>>>8&255,I=L.rgba>>>24,F=L.rgba>>>16&255,U=L.rgba>>>8&255,j=Math.floor((Math.abs(D-I)+Math.abs(P-F)+Math.abs($-U))/12);let T=!0;for(let M=0;M<w.data.length;M+=4)w.data[M]===D&&w.data[M+1]===P&&w.data[M+2]===$||A&&Math.abs(w.data[M]-D)+Math.abs(w.data[M+1]-P)+Math.abs(w.data[M+2]-$)<j?w.data[M+3]=0:T=!1;return T}function R(w,k,L){const A=w.createElement("canvas");return A.width=k,A.height=L,A}},577:function(a,s,l){var c=this&&this.__decorate||function(f,d,v,b){var E,C=arguments.length,R=C<3?d:b===null?b=Object.getOwnPropertyDescriptor(d,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,d,v,b);else for(var w=f.length-1;w>=0;w--)(E=f[w])&&(R=(C<3?E(R):C>3?E(d,v,R):E(d,v))||R);return C>3&&R&&Object.defineProperty(d,v,R),R},m=this&&this.__param||function(f,d){return function(v,b){d(v,b,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=l(147),p=l(855),g=l(782),y=l(97);class _ extends u.AttributeData{constructor(d,v,b){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=v,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=_;let h=s.CharacterJoinerService=class ex{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(d){const v={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(v),v.id}deregister(d){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===d)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(d);if(!v||v.length===0)return[];const b=[],E=v.translateToString(!0);let C=0,R=0,w=0,k=v.getFg(0),L=v.getBg(0);for(let A=0;A<v.getTrimmedLength();A++)if(v.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==L){if(A-C>1){const D=this._getJoinedRanges(E,w,R,v,C);for(let P=0;P<D.length;P++)b.push(D[P])}C=A,w=R,k=this._workCell.fg,L=this._workCell.bg}R+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const A=this._getJoinedRanges(E,w,R,v,C);for(let D=0;D<A.length;D++)b.push(A[D])}return b}_getJoinedRanges(d,v,b,E,C){const R=d.substring(v,b);let w=[];try{w=this._characterJoiners[0].handler(R)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const L=this._characterJoiners[k].handler(R);for(let A=0;A<L.length;A++)ex._mergeRanges(w,L[A])}catch(L){console.error(L)}return this._stringRangesToCellRanges(w,E,C),w}_stringRangesToCellRanges(d,v,b){let E=0,C=!1,R=0,w=d[E];if(w){for(let k=b;k<this._bufferService.cols;k++){const L=v.getWidth(k),A=v.getString(k).length||p.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!C&&w[0]<=R&&(w[0]=k,C=!0),w[1]<=R){if(w[1]=k,w=d[++E],!w)break;w[0]<=R?(w[0]=k,C=!0):C=!1}R+=A}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(d,v){let b=!1;for(let E=0;E<d.length;E++){const C=d[E];if(b){if(v[1]<=C[0])return d[E-1][1]=v[1],d;if(v[1]<=C[1])return d[E-1][1]=Math.max(v[1],C[1]),d.splice(E,1),d;d.splice(E,1),E--}else{if(v[1]<=C[0])return d.splice(E,0,v),d;if(v[1]<=C[1])return C[0]=Math.min(v[0],C[0]),d;v[0]<C[1]&&(C[0]=Math.min(v[0],C[0]),b=!0)}}return b?d[d.length-1][1]=v[1]:d.push(v),d}};s.CharacterJoinerService=h=c([m(0,y.IBufferService)],h)},160:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const c=l(399);let m=0,u=0,p=0,g=0;var y,_,h,f,d;function v(E){const C=E.toString(16);return C.length<2?"0"+C:C}function b(E,C){return E<C?(C+.05)/(E+.05):(E+.05)/(C+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(E){E.toCss=function(C,R,w,k){return k!==void 0?`#${v(C)}${v(R)}${v(w)}${v(k)}`:`#${v(C)}${v(R)}${v(w)}`},E.toRgba=function(C,R,w,k=255){return(C<<24|R<<16|w<<8|k)>>>0}}(y||(s.channels=y={})),function(E){function C(R,w){return g=Math.round(255*w),[m,u,p]=d.toChannels(R.rgba),{css:y.toCss(m,u,p,g),rgba:y.toRgba(m,u,p,g)}}E.blend=function(R,w){if(g=(255&w.rgba)/255,g===1)return{css:w.css,rgba:w.rgba};const k=w.rgba>>24&255,L=w.rgba>>16&255,A=w.rgba>>8&255,D=R.rgba>>24&255,P=R.rgba>>16&255,$=R.rgba>>8&255;return m=D+Math.round((k-D)*g),u=P+Math.round((L-P)*g),p=$+Math.round((A-$)*g),{css:y.toCss(m,u,p),rgba:y.toRgba(m,u,p)}},E.isOpaque=function(R){return(255&R.rgba)==255},E.ensureContrastRatio=function(R,w,k){const L=d.ensureContrastRatio(R.rgba,w.rgba,k);if(L)return d.toColor(L>>24&255,L>>16&255,L>>8&255)},E.opaque=function(R){const w=(255|R.rgba)>>>0;return[m,u,p]=d.toChannels(w),{css:y.toCss(m,u,p),rgba:w}},E.opacity=C,E.multiplyOpacity=function(R,w){return g=255&R.rgba,C(R,g*w/255)},E.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}}(_||(s.color=_={})),function(E){let C,R;if(!c.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const k=w.getContext("2d",{willReadFrequently:!0});k&&(C=k,C.globalCompositeOperation="copy",R=C.createLinearGradient(0,0,1,1))}E.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return m=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),p=parseInt(w.slice(3,4).repeat(2),16),d.toColor(m,u,p);case 5:return m=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),p=parseInt(w.slice(3,4).repeat(2),16),g=parseInt(w.slice(4,5).repeat(2),16),d.toColor(m,u,p,g);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const k=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return m=parseInt(k[1]),u=parseInt(k[2]),p=parseInt(k[3]),g=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),d.toColor(m,u,p,g);if(!C||!R)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=R,C.fillStyle=w,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[m,u,p,g]=C.getImageData(0,0,1,1).data,g!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(m,u,p,g),css:w}}}(h||(s.css=h={})),function(E){function C(R,w,k){const L=R/255,A=w/255,D=k/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}E.relativeLuminance=function(R){return C(R>>16&255,R>>8&255,255&R)},E.relativeLuminance2=C}(f||(s.rgb=f={})),function(E){function C(w,k,L){const A=w>>24&255,D=w>>16&255,P=w>>8&255;let $=k>>24&255,I=k>>16&255,F=k>>8&255,U=b(f.relativeLuminance2($,I,F),f.relativeLuminance2(A,D,P));for(;U<L&&($>0||I>0||F>0);)$-=Math.max(0,Math.ceil(.1*$)),I-=Math.max(0,Math.ceil(.1*I)),F-=Math.max(0,Math.ceil(.1*F)),U=b(f.relativeLuminance2($,I,F),f.relativeLuminance2(A,D,P));return($<<24|I<<16|F<<8|255)>>>0}function R(w,k,L){const A=w>>24&255,D=w>>16&255,P=w>>8&255;let $=k>>24&255,I=k>>16&255,F=k>>8&255,U=b(f.relativeLuminance2($,I,F),f.relativeLuminance2(A,D,P));for(;U<L&&($<255||I<255||F<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),I=Math.min(255,I+Math.ceil(.1*(255-I))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=b(f.relativeLuminance2($,I,F),f.relativeLuminance2(A,D,P));return($<<24|I<<16|F<<8|255)>>>0}E.blend=function(w,k){if(g=(255&k)/255,g===1)return k;const L=k>>24&255,A=k>>16&255,D=k>>8&255,P=w>>24&255,$=w>>16&255,I=w>>8&255;return m=P+Math.round((L-P)*g),u=$+Math.round((A-$)*g),p=I+Math.round((D-I)*g),y.toRgba(m,u,p)},E.ensureContrastRatio=function(w,k,L){const A=f.relativeLuminance(w>>8),D=f.relativeLuminance(k>>8);if(b(A,D)<L){if(D<A){const I=C(w,k,L),F=b(A,f.relativeLuminance(I>>8));if(F<L){const U=R(w,k,L);return F>b(A,f.relativeLuminance(U>>8))?I:U}return I}const P=R(w,k,L),$=b(A,f.relativeLuminance(P>>8));if($<L){const I=C(w,k,L);return $>b(A,f.relativeLuminance(I>>8))?P:I}return P}},E.reduceLuminance=C,E.increaseLuminance=R,E.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},E.toColor=function(w,k,L,A){return{css:y.toCss(w,k,L,A),rgba:y.toRgba(w,k,L,A)}}}(d||(s.rgba=d={})),s.toPaddedHex=v,s.contrastRatio=b},345:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const m=[];for(let u=0;u<this._listeners.length;u++)m.push(this._listeners[u]);for(let u=0;u<m.length;u++)m[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(l,c){return l(m=>c.fire(m))},s.runAndSubscribe=function(l,c){return c(void 0),l(m=>c(m))}},859:(a,s)=>{function l(c){for(const m of c)m.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const m=this._disposables.indexOf(c);m!==-1&&this._disposables.splice(m,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var m;this._isDisposed||c===this._value||((m=this._value)==null||m.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=l,s.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},485:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(m,u,p){this._data[m]||(this._data[m]={}),this._data[m][u]=p}get(m,u){return this._data[m]?this._data[m][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=l,s.FourKeyMap=class{constructor(){this._data=new l}set(c,m,u,p,g){this._data.get(c,m)||this._data.set(c,m,new l),this._data.get(c,m).set(u,p,g)}get(c,m,u,p){var g;return(g=this._data.get(c,m))==null?void 0:g.get(u,p)}clear(){this._data.clear()}}},399:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u";const l=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=l.includes("Firefox"),s.isLegacyEdge=l.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(l),s.getSafariVersion=function(){if(!s.isSafari)return 0;const m=l.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(l)},385:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=l(399);class m{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let y=0,_=0,h=g.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),_=Math.max(y,_),f=g.timeRemaining(),1.5*_>f)return h-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-y))}ms`),void this._start();h=f}this.clear()}}class u extends m{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const y=Date.now()+g;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,p=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=p}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},782:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=l(133),m=l(855),u=l(147);class p extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const _=new p;return _.setFromCharData(y),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(y[m.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(y[m.CHAR_DATA_CHAR_INDEX].length===2){const h=y[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const f=y[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(h-55296)+f-56320+65536|y[m.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=y[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[m.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=y[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},855:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},s.utf32ToString=function(l,c=0,m=l.length){let u="";for(let p=c;p<m;++p){let g=l[p];g>65535?(g-=65536,u+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):u+=String.fromCharCode(g)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const m=l.length;if(!m)return 0;let u=0,p=0;if(this._interim){const g=l.charCodeAt(p++);56320<=g&&g<=57343?c[u++]=1024*(this._interim-55296)+g-56320+65536:(c[u++]=this._interim,c[u++]=g),this._interim=0}for(let g=p;g<m;++g){const y=l.charCodeAt(g);if(55296<=y&&y<=56319){if(++g>=m)return this._interim=y,u;const _=l.charCodeAt(g);56320<=_&&_<=57343?c[u++]=1024*(y-55296)+_-56320+65536:(c[u++]=y,c[u++]=_)}else y!==65279&&(c[u++]=y)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const m=l.length;if(!m)return 0;let u,p,g,y,_=0,h=0,f=0;if(this.interim[0]){let b=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let C,R=0;for(;(C=63&this.interim[++R])&&R<4;)E<<=6,E|=C;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=w-R;for(;f<k;){if(f>=m)return 0;if(C=l[f++],(192&C)!=128){f--,b=!0;break}this.interim[R++]=C,E<<=6,E|=63&C}b||(w===2?E<128?f--:c[_++]=E:w===3?E<2048||E>=55296&&E<=57343||E===65279||(c[_++]=E):E<65536||E>1114111||(c[_++]=E)),this.interim.fill(0)}const d=m-4;let v=f;for(;v<m;){for(;!(!(v<d)||128&(u=l[v])||128&(p=l[v+1])||128&(g=l[v+2])||128&(y=l[v+3]));)c[_++]=u,c[_++]=p,c[_++]=g,c[_++]=y,v+=4;if(u=l[v++],u<128)c[_++]=u;else if((224&u)==192){if(v>=m)return this.interim[0]=u,_;if(p=l[v++],(192&p)!=128){v--;continue}if(h=(31&u)<<6|63&p,h<128){v--;continue}c[_++]=h}else if((240&u)==224){if(v>=m)return this.interim[0]=u,_;if(p=l[v++],(192&p)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=p,_;if(g=l[v++],(192&g)!=128){v--;continue}if(h=(15&u)<<12|(63&p)<<6|63&g,h<2048||h>=55296&&h<=57343||h===65279)continue;c[_++]=h}else if((248&u)==240){if(v>=m)return this.interim[0]=u,_;if(p=l[v++],(192&p)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=p,_;if(g=l[v++],(192&g)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=p,this.interim[2]=g,_;if(y=l[v++],(192&y)!=128){v--;continue}if(h=(7&u)<<18|(63&p)<<12|(63&g)<<6|63&y,h<65536||h>1114111)continue;c[_++]=h}}return _}}},776:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var b,E=arguments.length,C=E<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(b=h[R])&&(C=(E<3?b(C):E>3?b(f,d,C):b(f,d))||C);return E>3&&C&&Object.defineProperty(f,d,C),C},m=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=l(859),p=l(97),g={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let y,_=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let f=0;f<h.length;f++)typeof h[f]=="function"&&(h[f]=h[f]())}_log(h,f,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(h,...f){var d;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,f)}debug(h,...f){var d;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,f)}info(h,...f){var d;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,f)}warn(h,...f){var d;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,f)}error(h,...f){var d;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,f)}};s.LogService=_=c([m(0,p.IOptionsService)],_),s.setTraceLogger=function(h){y=h},s.traceCall=function(h,f,d){if(typeof d.value!="function")throw new Error("not supported");const v=d.value;d.value=function(...b){if(y.logLevel!==p.LogLevelEnum.TRACE)return v.apply(this,b);y.trace(`GlyphRenderer#${v.name}(${b.map(C=>JSON.stringify(C)).join(", ")})`);const E=v.apply(this,b);return y.trace(`GlyphRenderer#${v.name} return`,E),E}}},726:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const l="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(m){return m[c]||[]},s.createDecorator=function(m){if(s.serviceRegistry.has(m))return s.serviceRegistry.get(m);const u=function(p,g,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,h,f){h[l]===h?h[c].push({id:_,index:f}):(h[c]=[{id:_,index:f}],h[l]=h)})(u,p,y)};return u.toString=()=>m,s.serviceRegistry.set(m,u),u}},97:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=l(726);var m;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(m||(s.LogLevelEnum=m={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},r={};function i(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var o={};return(()=>{var a=o;Object.defineProperty(a,"__esModule",{value:!0}),a.CanvasAddon=void 0;const s=i(345),l=i(859),c=i(776),m=i(949);class u extends l.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var g;return(g=this._renderer)==null?void 0:g.textureAtlas}activate(g){const y=g._core;if(!g.element)return void this.register(y.onWillOpen(()=>this.activate(g)));this._terminal=g;const _=y.coreService,h=y.optionsService,f=y.screenElement,d=y.linkifier2,v=y,b=v._bufferService,E=v._renderService,C=v._characterJoinerService,R=v._charSizeService,w=v._coreBrowserService,k=v._decorationService,L=v._logService,A=v._themeService;(0,c.setTraceLogger)(L),this._renderer=new m.CanvasRenderer(g,f,d,b,R,h,C,_,w,k,A),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),E.setRenderer(this._renderer),E.handleResize(b.cols,b.rows),this.register((0,l.toDisposable)(()=>{var D;E.setRenderer(this._terminal._core._createRenderer()),E.handleResize(g.cols,g.rows),(D=this._renderer)==null||D.dispose(),this._renderer=void 0}))}clearTextureAtlas(){var g;(g=this._renderer)==null||g.clearTextureAtlas()}}a.CanvasAddon=u})(),o})())})(Zb);var sR=Zb.exports,tx={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const o=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(o._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,o=i._renderService.dimensions;if(o.css.cell.width===0||o.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(s.getPropertyValue("height")),c=Math.max(0,parseInt(s.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),u=l-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),p=c-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/o.css.cell.width)),rows:Math.max(1,Math.floor(u/o.css.cell.height))}}}})(),n})())})(tx);var oR=tx.exports,nx={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={345:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const m=[];for(let u=0;u<this._listeners.length;u++)m.push(this._listeners[u]);for(let u=0;u<m.length;u++)m[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(l,c){return l(m=>c.fire(m))},s.runAndSubscribe=function(l,c){return c(void 0),l(m=>c(m))}},859:(a,s)=>{function l(c){for(const m of c)m.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const m=this._disposables.indexOf(c);m!==-1&&this._disposables.splice(m,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var m;this._isDisposed||c===this._value||((m=this._value)==null||m.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=l,s.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}}},r={};function i(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var o={};return(()=>{var a=o;Object.defineProperty(a,"__esModule",{value:!0}),a.SearchAddon=void 0;const s=i(345),l=i(859),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class m extends l.Disposable{constructor(p){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new l.MutableDisposable),this._linesCacheTimeoutId=0,this._onDidChangeResults=this.register(new s.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(p==null?void 0:p.highlightLimit)??1e3}activate(p){this._terminal=p,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,l.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var p;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((p=this._lastSearchOptions)!=null&&p.decorations)&&(this._highlightTimeout=setTimeout(()=>{const g=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(g,{...this._lastSearchOptions,incremental:!0,noScroll:!0})},200))}clearDecorations(p){this._selectedDecoration.clear(),(0,l.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),p||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(p,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const y=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||p!==this._cachedSearchTerm||y)&&this._highlightAllMatches(p,g);const _=this._findNextAndSelect(p,g);return this._fireResults(g),this._cachedSearchTerm=p,_}_highlightAllMatches(p,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!p||p.length===0)return void this.clearDecorations();g=g||{},this.clearDecorations(!0);const y=[];let _,h=this._find(p,0,0,g);for(;h&&((_==null?void 0:_.row)!==h.row||(_==null?void 0:_.col)!==h.col)&&!(y.length>=this._highlightLimit);)_=h,y.push(_),h=this._find(p,_.col+_.term.length>=this._terminal.cols?_.row+1:_.row,_.col+_.term.length>=this._terminal.cols?0:_.col+1,g);for(const f of y){const d=this._createResultDecoration(f,g.decorations);d&&(this._highlightedLines.add(d.marker.line),this._highlightDecorations.push({decoration:d,match:f,dispose(){d.dispose()}}))}}_find(p,g,y,_){var d;if(!this._terminal||!p||p.length===0)return(d=this._terminal)==null||d.clearSelection(),void this.clearDecorations();if(y>this._terminal.cols)throw new Error(`Invalid col: ${y} to search in terminal of ${this._terminal.cols} cols`);let h;this._initLinesCache();const f={startRow:g,startCol:y};if(h=this._findInLine(p,f,_),!h)for(let v=g+1;v<this._terminal.buffer.active.baseY+this._terminal.rows&&(f.startRow=v,f.startCol=0,h=this._findInLine(p,f,_),!h);v++);return h}_findNextAndSelect(p,g){var v;if(!this._terminal||!p||p.length===0)return(v=this._terminal)==null||v.clearSelection(),this.clearDecorations(),!1;const y=this._terminal.getSelectionPosition();this._terminal.clearSelection();let _=0,h=0;y&&(this._cachedSearchTerm===p?(_=y.end.x,h=y.end.y):(_=y.start.x,h=y.start.y)),this._initLinesCache();const f={startRow:h,startCol:_};let d=this._findInLine(p,f,g);if(!d)for(let b=h+1;b<this._terminal.buffer.active.baseY+this._terminal.rows&&(f.startRow=b,f.startCol=0,d=this._findInLine(p,f,g),!d);b++);if(!d&&h!==0)for(let b=0;b<h&&(f.startRow=b,f.startCol=0,d=this._findInLine(p,f,g),!d);b++);return!d&&y&&(f.startRow=y.start.y,f.startCol=0,d=this._findInLine(p,f,g)),this._selectResult(d,g==null?void 0:g.decorations,g==null?void 0:g.noScroll)}findPrevious(p,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const y=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||p!==this._cachedSearchTerm||y)&&this._highlightAllMatches(p,g);const _=this._findPreviousAndSelect(p,g);return this._fireResults(g),this._cachedSearchTerm=p,_}_didOptionsChange(p,g){return!!g&&(p.caseSensitive!==g.caseSensitive||p.regex!==g.regex||p.wholeWord!==g.wholeWord)}_fireResults(p){if(p!=null&&p.decorations){let g=-1;if(this._selectedDecoration.value){const y=this._selectedDecoration.value.match;for(let _=0;_<this._highlightDecorations.length;_++){const h=this._highlightDecorations[_].match;if(h.row===y.row&&h.col===y.col&&h.size===y.size){g=_;break}}}this._onDidChangeResults.fire({resultIndex:g,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(p,g){var b;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!p||p.length===0)return(b=this._terminal)==null||b.clearSelection(),this.clearDecorations(),!1;const y=this._terminal.getSelectionPosition();this._terminal.clearSelection();let _=this._terminal.buffer.active.baseY+this._terminal.rows-1,h=this._terminal.cols;const f=!0;this._initLinesCache();const d={startRow:_,startCol:h};let v;if(y&&(d.startRow=_=y.start.y,d.startCol=h=y.start.x,this._cachedSearchTerm!==p&&(v=this._findInLine(p,d,g,!1),v||(d.startRow=_=y.end.y,d.startCol=h=y.end.x))),v||(v=this._findInLine(p,d,g,f)),!v){d.startCol=Math.max(d.startCol,this._terminal.cols);for(let E=_-1;E>=0&&(d.startRow=E,v=this._findInLine(p,d,g,f),!v);E--);}if(!v&&_!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let E=this._terminal.buffer.active.baseY+this._terminal.rows-1;E>=_&&(d.startRow=E,v=this._findInLine(p,d,g,f),!v);E--);return this._selectResult(v,g==null?void 0:g.decorations,g==null?void 0:g.noScroll)}_initLinesCache(){const p=this._terminal;this._linesCache||(this._linesCache=new Array(p.buffer.active.length),this._cursorMoveListener=p.onCursorMove(()=>this._destroyLinesCache()),this._resizeListener=p.onResize(()=>this._destroyLinesCache())),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._cursorMoveListener&&(this._cursorMoveListener.dispose(),this._cursorMoveListener=void 0),this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=void 0),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(p,g,y){return(p===0||c.includes(g[p-1]))&&(p+y.length===g.length||c.includes(g[p+y.length]))}_findInLine(p,g,y={},_=!1){var A;const h=this._terminal,f=g.startRow,d=g.startCol,v=h.buffer.active.getLine(f);if(v!=null&&v.isWrapped)return _?void(g.startCol+=h.cols):(g.startRow--,g.startCol+=h.cols,this._findInLine(p,g,y));let b=(A=this._linesCache)==null?void 0:A[f];b||(b=this._translateBufferLineToStringWithWrap(f,!0),this._linesCache&&(this._linesCache[f]=b));const[E,C]=b,R=this._bufferColsToStringOffset(f,d),w=y.caseSensitive?p:p.toLowerCase(),k=y.caseSensitive?E:E.toLowerCase();let L=-1;if(y.regex){const D=RegExp(w,"g");let P;if(_)for(;P=D.exec(k.slice(0,R));)L=D.lastIndex-P[0].length,p=P[0],D.lastIndex-=p.length-1;else P=D.exec(k.slice(R)),P&&P[0].length>0&&(L=R+(D.lastIndex-P[0].length),p=P[0])}else _?R-w.length>=0&&(L=k.lastIndexOf(w,R-w.length)):L=k.indexOf(w,R);if(L>=0){if(y.wholeWord&&!this._isWholeWord(L,k,p))return;let D=0;for(;D<C.length-1&&L>=C[D+1];)D++;let P=D;for(;P<C.length-1&&L+p.length>=C[P+1];)P++;const $=L-C[D],I=L+p.length-C[P],F=this._stringLengthToBufferSize(f+D,$);return{term:p,col:F,row:f+D,size:this._stringLengthToBufferSize(f+P,I)-F+h.cols*(P-D)}}}_stringLengthToBufferSize(p,g){const y=this._terminal.buffer.active.getLine(p);if(!y)return 0;for(let _=0;_<g;_++){const h=y.getCell(_);if(!h)break;const f=h.getChars();f.length>1&&(g-=f.length-1);const d=y.getCell(_+1);d&&d.getWidth()===0&&g++}return g}_bufferColsToStringOffset(p,g){const y=this._terminal;let _=p,h=0,f=y.buffer.active.getLine(_);for(;g>0&&f;){for(let d=0;d<g&&d<y.cols;d++){const v=f.getCell(d);if(!v)break;v.getWidth()&&(h+=v.getCode()===0?1:v.getChars().length)}if(_++,f=y.buffer.active.getLine(_),f&&!f.isWrapped)break;g-=y.cols}return h}_translateBufferLineToStringWithWrap(p,g){var d;const y=this._terminal,_=[],h=[0];let f=y.buffer.active.getLine(p);for(;f;){const v=y.buffer.active.getLine(p+1),b=!!v&&v.isWrapped;let E=f.translateToString(!b&&g);if(b&&v){const C=f.getCell(f.length-1);C&&C.getCode()===0&&C.getWidth()===1&&((d=v.getCell(0))==null?void 0:d.getWidth())===2&&(E=E.slice(0,-1))}if(_.push(E),!b)break;h.push(h[h.length-1]+E.length),p++,f=v}return[_.join(""),h]}_selectResult(p,g,y){const _=this._terminal;if(this._selectedDecoration.clear(),!p)return _.clearSelection(),!1;if(_.select(p.col,p.row,p.size),g){const h=_.registerMarker(-_.buffer.active.baseY-_.buffer.active.cursorY+p.row);if(h){const f=_.registerDecoration({marker:h,x:p.col,width:p.size,backgroundColor:g.activeMatchBackground,layer:"top",overviewRulerOptions:{color:g.activeMatchColorOverviewRuler}});if(f){const d=[];d.push(h),d.push(f.onRender(v=>this._applyStyles(v,g.activeMatchBorder,!0))),d.push(f.onDispose(()=>(0,l.disposeArray)(d))),this._selectedDecoration.value={decoration:f,match:p,dispose(){f.dispose()}}}}}if(!y&&(p.row>=_.buffer.active.viewportY+_.rows||p.row<_.buffer.active.viewportY)){let h=p.row-_.buffer.active.viewportY;h-=Math.floor(_.rows/2),_.scrollLines(h)}return!0}_applyStyles(p,g,y){p.classList.contains("xterm-find-result-decoration")||(p.classList.add("xterm-find-result-decoration"),g&&(p.style.outline=`1px solid ${g}`)),y&&p.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(p,g){const y=this._terminal,_=y.registerMarker(-y.buffer.active.baseY-y.buffer.active.cursorY+p.row);if(!_)return;const h=y.registerDecoration({marker:_,x:p.col,width:p.size,backgroundColor:g.matchBackground,overviewRulerOptions:this._highlightedLines.has(_.line)?void 0:{color:g.matchOverviewRuler,position:"center"}});if(h){const f=[];f.push(_),f.push(h.onRender(d=>this._applyStyles(d,g.matchBorder,!1))),f.push(h.onDispose(()=>(0,l.disposeArray)(f)))}return h}}a.SearchAddon=m})(),o})())})(nx);var aR=nx.exports,rx={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={6:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(c,m,u,p={}){this._terminal=c,this._regex=m,this._handler=u,this._options=p}provideLinks(c,m){const u=l.computeLink(c,this._regex,this._terminal,this._handler);m(this._addCallbacks(u))}_addCallbacks(c){return c.map(m=>(m.leave=this._options.leave,m.hover=(u,p)=>{if(this._options.hover){const{range:g}=m;this._options.hover(u,p,g)}},m))}};class l{static computeLink(m,u,p,g){const y=new RegExp(u.source,(u.flags||"")+"g"),[_,h]=l._getWindowedLineStrings(m-1,p),f=_.join("");let d;const v=[];for(;d=y.exec(f);){const b=d[0];try{const L=new URL(b),A=decodeURI(L.toString());if(b!==A&&b+"/"!==A)continue}catch{continue}const[E,C]=l._mapStrIdx(p,h,0,d.index),[R,w]=l._mapStrIdx(p,E,C,b.length);if(E===-1||C===-1||R===-1||w===-1)continue;const k={start:{x:C+1,y:E+1},end:{x:w,y:R+1}};v.push({range:k,text:b,activate:g})}return v}static _getWindowedLineStrings(m,u){let p,g=m,y=m,_=0,h="";const f=[];if(p=u.buffer.active.getLine(m)){const d=p.translateToString(!0);if(p.isWrapped&&d[0]!==" "){for(_=0;(p=u.buffer.active.getLine(--g))&&_<2048&&(h=p.translateToString(!0),_+=h.length,f.push(h),p.isWrapped&&h.indexOf(" ")===-1););f.reverse()}for(f.push(d),_=0;(p=u.buffer.active.getLine(++y))&&p.isWrapped&&_<2048&&(h=p.translateToString(!0),_+=h.length,f.push(h),h.indexOf(" ")===-1););}return[f,g]}static _mapStrIdx(m,u,p,g){const y=m.buffer.active,_=y.getNullCell();let h=p;for(;g;){const f=y.getLine(u);if(!f)return[-1,-1];for(let d=h;d<f.length;++d){f.getCell(d,_);const v=_.getChars();if(_.getWidth()&&(g-=v.length||1,d===f.length-1&&v==="")){const b=y.getLine(u+1);b&&b.isWrapped&&(b.getCell(0,_),_.getWidth()===2&&(g+=1))}if(g<0)return[u,d]}u++,h=0}return[u,h]}}s.LinkComputer=l}},r={};function i(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var o={};return(()=>{var a=o;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const s=i(6),l=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(m,u){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(m=c,u={}){this._handler=m,this._options=u}activate(m){this._terminal=m;const u=this._options,p=u.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,p,this._handler,u))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),o})())})(rx);var lR=rx.exports;/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var cR={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"};/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),ce=(e,t)=>{const n=x.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:s="",children:l,...c},m)=>x.createElement("svg",{ref:m,...cR,width:i,height:i,stroke:r,strokeWidth:a?Number(o)*24/Number(i):o,className:["lucide",`lucide-${uR(e)}`,s].join(" "),...c},[...t.map(([u,p])=>x.createElement(u,p)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hR=ce("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dR=ce("AlertOctagon",[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fR=ce("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pR=ce("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mR=ce("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gR=ce("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vR=ce("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _R=ce("CaseSensitive",[["path",{d:"m3 15 4-8 4 8",key:"1vwr6u"}],["path",{d:"M4 13h6",key:"1r9ots"}],["circle",{cx:"18",cy:"12",r:"3",key:"1kchzo"}],["path",{d:"M21 9v6",key:"anns31"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yR=ce("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Um=ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wm=ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wR=ce("ChevronRightCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bR=ce("ChevronRightSquare",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xR=ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SR=ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CR=ce("ChevronsDown",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ER=ce("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kR=ce("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RR=ce("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LR=ce("Dna",[["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m17 6-2.5-2.5",key:"5cdfhj"}],["path",{d:"m14 8-1-1",key:"15nbz5"}],["path",{d:"m7 18 2.5 2.5",key:"16tu1a"}],["path",{d:"m3.5 14.5.5.5",key:"hapbhd"}],["path",{d:"m20 9 .5.5",key:"1n7z02"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m10 16 1.5 1.5",key:"11lckj"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const F0=ce("DownloadCloud",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m8 17 4 4 4-4",key:"1ul180"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ix=ce("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MR=ce("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AR=ce("FileDown",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TR=ce("FilePen",[["path",{d:"M4 13.5V4a2 2 0 0 1 2-2h8.5L20 7.5V20a2 2 0 0 1-2 2h-5.5",key:"1bg6eb"}],["path",{d:"M14 2v6h6",key:"1kof46"}],["path",{d:"M10.4 12.6a2 2 0 0 1 3 3L8 21l-4 1 1-4Z",key:"hnx206"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DR=ce("Gavel",[["path",{d:"m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8",key:"15492f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m9 7 8 8",key:"5jnvq1"}],["path",{d:"m21 11-8-8",key:"z4y7zo"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PR=ce("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $R=ce("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sx=ce("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OR=ce("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",key:"1kog09"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IR=ce("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ox=ce("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const li=ce("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NR=ce("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BR=ce("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jR=ce("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FR=ce("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zR=ce("Monitor",[["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"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HR=ce("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UR=ce("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WR=ce("PersonStanding",[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["path",{d:"m9 20 3-6 3 6",key:"se2kox"}],["path",{d:"m6 8 6 2 6-2",key:"4o3us4"}],["path",{d:"M12 10v4",key:"1kjpxc"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VR=ce("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KR=ce("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qR=ce("PlusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GR=ce("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YR=ce("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XR=ce("Regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QR=ce("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JR=ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZR=ce("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eL=ce("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tL=ce("SquareUserRound",[["path",{d:"M18 21a6 6 0 0 0-12 0",key:"kaz2du"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nL=ce("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rL=ce("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ax=ce("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iL=ce("WholeWord",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sL=ce("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dl=ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oL=ce("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);var lx={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const cx=Symbol((lx?"production":void 0)!=="production"?"RESET":"");function nh(e){const t=De(e,(n,r,i)=>{const o=typeof i=="function"?i(n(t)):i;r(t,o===cx?e:o)});return t}const aL=e=>typeof(e==null?void 0:e.then)=="function";function lL(e){let t,n;const r={getItem:(i,o)=>{var a,s;const l=m=>{if(m=m||"",t!==m){try{n=JSON.parse(m)}catch{return o}t=m}return n},c=(s=(a=e())==null?void 0:a.getItem(i))!=null?s:null;return aL(c)?c.then(l):l(c)},setItem:(i,o)=>{var a;return(a=e())==null?void 0:a.setItem(i,JSON.stringify(o))},removeItem:i=>{var o;return(o=e())==null?void 0:o.removeItem(i)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(r.subscribe=(i,o,a)=>{if(!(e()instanceof window.Storage))return()=>{};const s=l=>{if(l.storageArea===e()&&l.key===i){let c;try{c=JSON.parse(l.newValue||"")}catch{c=a}o(c)}};return window.addEventListener("storage",s),()=>{window.removeEventListener("storage",s)}}),r}const cL=lL(()=>typeof window<"u"?window.localStorage:void 0);function uL(e,t,n=cL,r){const i=r==null?void 0:r.getOnInit,o=De(i?n.getItem(e,t):t);return(lx?"production":void 0)!=="production"&&(o.debugPrivate=!0),o.onMount=s=>{i||s(n.getItem(e,t));let l;return n.subscribe&&(l=n.subscribe(e,s,t)),l},De(s=>s(o),(s,l,c)=>{const m=typeof c=="function"?c(s(o)):c;return m===cx?(l(o,t),n.removeItem(e)):m instanceof Promise?m.then(u=>(l(o,u),n.setItem(e,u))):(l(o,m),n.setItem(e,m))})}const mt=x.forwardRef(({className:e,type:t,...n},r)=>S.jsx("input",{type:t,className:Z("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 placeholder:opacity-50","bg-black/5 dark:bg-black/30",e),ref:r,...n}));mt.displayName="Input";var ko=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fo=typeof window>"u"||"Deno"in window;function an(){}function hL(e,t){return typeof e=="function"?e(t):e}function Ff(e){return typeof e=="number"&&e>=0&&e!==1/0}function ux(e,t){return Math.max(e+(t||0)-Date.now(),0)}function z0(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==Vm(a,t.options))return!1}else if(!Ia(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function H0(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Xi(t.options.mutationKey)!==Xi(o))return!1}else if(!Ia(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Vm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Xi)(e)}function Xi(e){return JSON.stringify(e,(t,n)=>zf(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ia(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ia(e[n],t[n])):!1}function hx(e,t){if(e===t)return e;const n=U0(e)&&U0(t);if(n||zf(e)&&zf(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,a=n?[]:{};let s=0;for(let l=0;l<o;l++){const c=n?l:i[l];a[c]=hx(e[c],t[c]),a[c]===e[c]&&s++}return r===o&&s===r?e:a}return t}function fu(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function U0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zf(e){if(!W0(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!W0(n)||!n.hasOwnProperty("isPrototypeOf"))}function W0(e){return Object.prototype.toString.call(e)==="[object Object]"}function dL(e){return new Promise(t=>{setTimeout(t,e)})}function Hf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?hx(e,t):t}function fL(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pL(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Pi,Fr,zs,S1,mL=(S1=class extends ko{constructor(){super();ae(this,Pi,void 0);ae(this,Fr,void 0);ae(this,zs,void 0);ie(this,zs,t=>{if(!fo&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){V(this,Fr)||this.setEventListener(V(this,zs))}onUnsubscribe(){var t;this.hasListeners()||((t=V(this,Fr))==null||t.call(this),ie(this,Fr,void 0))}setEventListener(t){var n;ie(this,zs,t),(n=V(this,Fr))==null||n.call(this),ie(this,Fr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){V(this,Pi)!==t&&(ie(this,Pi,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof V(this,Pi)=="boolean"?V(this,Pi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pi=new WeakMap,Fr=new WeakMap,zs=new WeakMap,S1),pu=new mL,Hs,zr,Us,C1,gL=(C1=class extends ko{constructor(){super();ae(this,Hs,!0);ae(this,zr,void 0);ae(this,Us,void 0);ie(this,Us,t=>{if(!fo&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){V(this,zr)||this.setEventListener(V(this,Us))}onUnsubscribe(){var t;this.hasListeners()||((t=V(this,zr))==null||t.call(this),ie(this,zr,void 0))}setEventListener(t){var n;ie(this,Us,t),(n=V(this,zr))==null||n.call(this),ie(this,zr,t(this.setOnline.bind(this)))}setOnline(t){V(this,Hs)!==t&&(ie(this,Hs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return V(this,Hs)}},Hs=new WeakMap,zr=new WeakMap,Us=new WeakMap,C1),mu=new gL;function vL(e){return Math.min(1e3*2**e,3e4)}function rh(e){return(e??"online")==="online"?mu.isOnline():!0}var dx=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ud(e){return e instanceof dx}function fx(e){let t=!1,n=0,r=!1,i,o,a;const s=new Promise((h,f)=>{o=h,a=f}),l=h=>{var f;r||(g(new dx(h)),(f=e.abort)==null||f.call(e))},c=()=>{t=!0},m=()=>{t=!1},u=()=>!pu.isFocused()||e.networkMode!=="always"&&!mu.isOnline(),p=h=>{var f;r||(r=!0,(f=e.onSuccess)==null||f.call(e,h),i==null||i(),o(h))},g=h=>{var f;r||(r=!0,(f=e.onError)==null||f.call(e,h),i==null||i(),a(h))},y=()=>new Promise(h=>{var f;i=d=>{const v=r||!u();return v&&h(d),v},(f=e.onPause)==null||f.call(e)}).then(()=>{var h;i=void 0,r||(h=e.onContinue)==null||h.call(e)}),_=()=>{if(r)return;let h;try{h=e.fn()}catch(f){h=Promise.reject(f)}Promise.resolve(h).then(p).catch(f=>{var C;if(r)return;const d=e.retry??(fo?0:3),v=e.retryDelay??vL,b=typeof v=="function"?v(n,f):v,E=d===!0||typeof d=="number"&&n<d||typeof d=="function"&&d(n,f);if(t||!E){g(f);return}n++,(C=e.onFail)==null||C.call(e,n,f),dL(b).then(()=>{if(u())return y()}).then(()=>{t?g(f):_()})})};return rh(e.networkMode)?_():y().then(_),{promise:s,cancel:l,continue:()=>(i==null?void 0:i())?s:Promise.resolve(),cancelRetry:c,continueRetry:m}}function _L(){let e=[],t=0,n=p=>{p()},r=p=>{p()},i=p=>setTimeout(p,0);const o=p=>{i=p},a=p=>{let g;t++;try{g=p()}finally{t--,t||c()}return g},s=p=>{t?e.push(p):i(()=>{n(p)})},l=p=>(...g)=>{s(()=>{p(...g)})},c=()=>{const p=e;e=[],p.length&&i(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:a,batchCalls:l,schedule:s,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:o}}var lt=_L(),$i,E1,px=(E1=class{constructor(){ae(this,$i,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ff(this.gcTime)&&ie(this,$i,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fo?1/0:5*60*1e3))}clearGcTimeout(){V(this,$i)&&(clearTimeout(V(this,$i)),ie(this,$i,void 0))}},$i=new WeakMap,E1),Ws,Vs,rn,Hr,sn,dt,Ua,Oi,Ks,Cc,Rn,ar,k1,yL=(k1=class extends px{constructor(t){super();ae(this,Ks);ae(this,Rn);ae(this,Ws,void 0);ae(this,Vs,void 0);ae(this,rn,void 0);ae(this,Hr,void 0);ae(this,sn,void 0);ae(this,dt,void 0);ae(this,Ua,void 0);ae(this,Oi,void 0);ie(this,Oi,!1),ie(this,Ua,t.defaultOptions),ye(this,Ks,Cc).call(this,t.options),ie(this,dt,[]),ie(this,rn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ie(this,Ws,t.state||wL(this.options)),this.state=V(this,Ws),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!V(this,dt).length&&this.state.fetchStatus==="idle"&&V(this,rn).remove(this)}setData(t,n){const r=Hf(this.state.data,t,this.options);return ye(this,Rn,ar).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ye(this,Rn,ar).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=V(this,Hr);return(r=V(this,sn))==null||r.cancel(t),n?n.then(an).catch(an):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(V(this,Ws))}isActive(){return V(this,dt).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||V(this,dt).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!ux(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=V(this,dt).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=V(this,sn))==null||n.continue()}onOnline(){var n;const t=V(this,dt).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=V(this,sn))==null||n.continue()}addObserver(t){V(this,dt).includes(t)||(V(this,dt).push(t),this.clearGcTimeout(),V(this,rn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){V(this,dt).includes(t)&&(ie(this,dt,V(this,dt).filter(n=>n!==t)),V(this,dt).length||(V(this,sn)&&(V(this,Oi)?V(this,sn).cancel({revert:!0}):V(this,sn).cancelRetry()),this.scheduleGc()),V(this,rn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return V(this,dt).length}invalidate(){this.state.isInvalidated||ye(this,Rn,ar).call(this,{type:"invalidate"})}fetch(t,n){var c,m,u,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(V(this,Hr))return(c=V(this,sn))==null||c.continueRetry(),V(this,Hr)}if(t&&ye(this,Ks,Cc).call(this,t),!this.options.queryFn){const g=V(this,dt).find(y=>y.options.queryFn);g&&ye(this,Ks,Cc).call(this,g.options)}const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(ie(this,Oi,!0),r.signal)})};o(i);const a=()=>this.options.queryFn?(ie(this,Oi,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};o(s),(m=this.options.behavior)==null||m.onFetch(s,this),ie(this,Vs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&ye(this,Rn,ar).call(this,{type:"fetch",meta:(p=s.fetchOptions)==null?void 0:p.meta});const l=g=>{var y,_,h,f;ud(g)&&g.silent||ye(this,Rn,ar).call(this,{type:"error",error:g}),ud(g)||((_=(y=V(this,rn).config).onError)==null||_.call(y,g,this),(f=(h=V(this,rn).config).onSettled)==null||f.call(h,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return ie(this,sn,fx({fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var y,_,h,f;if(typeof g>"u"){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(_=(y=V(this,rn).config).onSuccess)==null||_.call(y,g,this),(f=(h=V(this,rn).config).onSettled)==null||f.call(h,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,y)=>{ye(this,Rn,ar).call(this,{type:"failed",failureCount:g,error:y})},onPause:()=>{ye(this,Rn,ar).call(this,{type:"pause"})},onContinue:()=>{ye(this,Rn,ar).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode})),ie(this,Hr,V(this,sn).promise),V(this,Hr)}},Ws=new WeakMap,Vs=new WeakMap,rn=new WeakMap,Hr=new WeakMap,sn=new WeakMap,dt=new WeakMap,Ua=new WeakMap,Oi=new WeakMap,Ks=new WeakSet,Cc=function(t){this.options={...V(this,Ua),...t},this.updateGcTime(this.options.gcTime)},Rn=new WeakSet,ar=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:rh(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return ud(i)&&i.revert&&V(this,Vs)?{...V(this,Vs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),lt.batch(()=>{V(this,dt).forEach(r=>{r.onQueryUpdate()}),V(this,rn).notify({query:this,type:"updated",action:t})})},k1);function wL(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Hn,R1,bL=(R1=class extends ko{constructor(t={}){super();ae(this,Hn,void 0);this.config=t,ie(this,Hn,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Vm(i,n);let a=this.get(o);return a||(a=new yL({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){V(this,Hn).has(t.queryHash)||(V(this,Hn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=V(this,Hn).get(t.queryHash);n&&(t.destroy(),n===t&&V(this,Hn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){lt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return V(this,Hn).get(t)}getAll(){return[...V(this,Hn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>z0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>z0(t,r)):n}notify(t){lt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){lt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){lt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Hn=new WeakMap,R1),Un,Wa,Ut,qs,Wn,Pr,L1,xL=(L1=class extends px{constructor(t){super();ae(this,Wn);ae(this,Un,void 0);ae(this,Wa,void 0);ae(this,Ut,void 0);ae(this,qs,void 0);this.mutationId=t.mutationId,ie(this,Wa,t.defaultOptions),ie(this,Ut,t.mutationCache),ie(this,Un,[]),this.state=t.state||mx(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...V(this,Wa),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){V(this,Un).includes(t)||(V(this,Un).push(t),this.clearGcTimeout(),V(this,Ut).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ie(this,Un,V(this,Un).filter(n=>n!==t)),this.scheduleGc(),V(this,Ut).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){V(this,Un).length||(this.state.status==="pending"?this.scheduleGc():V(this,Ut).remove(this))}continue(){var t;return((t=V(this,qs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,s,l,c,m,u,p,g,y,_,h,f,d,v,b,E,C,R;const n=()=>(ie(this,qs,fx({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(w,k)=>{ye(this,Wn,Pr).call(this,{type:"failed",failureCount:w,error:k})},onPause:()=>{ye(this,Wn,Pr).call(this,{type:"pause"})},onContinue:()=>{ye(this,Wn,Pr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),V(this,qs).promise),r=this.state.status==="pending";try{if(!r){ye(this,Wn,Pr).call(this,{type:"pending",variables:t}),await((o=(i=V(this,Ut).config).onMutate)==null?void 0:o.call(i,t,this));const k=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));k!==this.state.context&&ye(this,Wn,Pr).call(this,{type:"pending",context:k,variables:t})}const w=await n();return await((c=(l=V(this,Ut).config).onSuccess)==null?void 0:c.call(l,w,t,this.state.context,this)),await((u=(m=this.options).onSuccess)==null?void 0:u.call(m,w,t,this.state.context)),await((g=(p=V(this,Ut).config).onSettled)==null?void 0:g.call(p,w,null,this.state.variables,this.state.context,this)),await((_=(y=this.options).onSettled)==null?void 0:_.call(y,w,null,t,this.state.context)),ye(this,Wn,Pr).call(this,{type:"success",data:w}),w}catch(w){try{throw await((f=(h=V(this,Ut).config).onError)==null?void 0:f.call(h,w,t,this.state.context,this)),await((v=(d=this.options).onError)==null?void 0:v.call(d,w,t,this.state.context)),await((E=(b=V(this,Ut).config).onSettled)==null?void 0:E.call(b,void 0,w,this.state.variables,this.state.context,this)),await((R=(C=this.options).onSettled)==null?void 0:R.call(C,void 0,w,t,this.state.context)),w}finally{ye(this,Wn,Pr).call(this,{type:"error",error:w})}}}},Un=new WeakMap,Wa=new WeakMap,Ut=new WeakMap,qs=new WeakMap,Wn=new WeakSet,Pr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!rh(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),lt.batch(()=>{V(this,Un).forEach(r=>{r.onMutationUpdate(t)}),V(this,Ut).notify({mutation:this,type:"updated",action:t})})},L1);function mx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var on,Va,Ii,M1,SL=(M1=class extends ko{constructor(t={}){super();ae(this,on,void 0);ae(this,Va,void 0);ae(this,Ii,void 0);this.config=t,ie(this,on,[]),ie(this,Va,0)}build(t,n,r){const i=new xL({mutationCache:this,mutationId:++El(this,Va)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){V(this,on).push(t),this.notify({type:"added",mutation:t})}remove(t){ie(this,on,V(this,on).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){lt.batch(()=>{V(this,on).forEach(t=>{this.remove(t)})})}getAll(){return V(this,on)}find(t){const n={exact:!0,...t};return V(this,on).find(r=>H0(n,r))}findAll(t={}){return V(this,on).filter(n=>H0(t,n))}notify(t){lt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return ie(this,Ii,(V(this,Ii)??Promise.resolve()).then(()=>{const t=V(this,on).filter(n=>n.state.isPaused);return lt.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(an)),Promise.resolve()))}).then(()=>{ie(this,Ii,void 0)})),V(this,Ii)}},on=new WeakMap,Va=new WeakMap,Ii=new WeakMap,M1);function CL(e){return{onFetch:(t,n)=>{const r=async()=>{var y,_,h,f,d;const i=t.options,o=(h=(_=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:_.fetchMore)==null?void 0:h.direction,a=((f=t.state.data)==null?void 0:f.pages)||[],s=((d=t.state.data)==null?void 0:d.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const m=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},u=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(v,b,E)=>{if(c)return Promise.reject();if(b==null&&v.pages.length)return Promise.resolve(v);const C={queryKey:t.queryKey,pageParam:b,direction:E?"backward":"forward",meta:t.options.meta};m(C);const R=await u(C),{maxPages:w}=t.options,k=E?pL:fL;return{pages:k(v.pages,R,w),pageParams:k(v.pageParams,b,w)}};let g;if(o&&a.length){const v=o==="backward",b=v?EL:V0,E={pages:a,pageParams:s},C=b(i,E);g=await p(E,C,v)}else{g=await p(l,s[0]??i.initialPageParam);const v=e??a.length;for(let b=1;b<v;b++){const E=V0(i,g);g=await p(g,E)}}return g};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function V0(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function EL(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var st,Ur,Wr,Gs,Ys,Vr,Xs,Qs,A1,kL=(A1=class{constructor(e={}){ae(this,st,void 0);ae(this,Ur,void 0);ae(this,Wr,void 0);ae(this,Gs,void 0);ae(this,Ys,void 0);ae(this,Vr,void 0);ae(this,Xs,void 0);ae(this,Qs,void 0);ie(this,st,e.queryCache||new bL),ie(this,Ur,e.mutationCache||new SL),ie(this,Wr,e.defaultOptions||{}),ie(this,Gs,new Map),ie(this,Ys,new Map),ie(this,Vr,0)}mount(){El(this,Vr)._++,V(this,Vr)===1&&(ie(this,Xs,pu.subscribe(()=>{pu.isFocused()&&(this.resumePausedMutations(),V(this,st).onFocus())})),ie(this,Qs,mu.subscribe(()=>{mu.isOnline()&&(this.resumePausedMutations(),V(this,st).onOnline())})))}unmount(){var e,t;El(this,Vr)._--,V(this,Vr)===0&&((e=V(this,Xs))==null||e.call(this),ie(this,Xs,void 0),(t=V(this,Qs))==null||t.call(this),ie(this,Qs,void 0))}isFetching(e){return V(this,st).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return V(this,Ur).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=V(this,st).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=V(this,st).find({queryKey:e}),i=r==null?void 0:r.state.data,o=hL(t,i);if(typeof o>"u")return;const a=this.defaultQueryOptions({queryKey:e});return V(this,st).build(this,a).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return lt.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=V(this,st).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=V(this,st);lt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=V(this,st),r={type:"active",...e};return lt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=lt.batch(()=>V(this,st).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(an).catch(an)}invalidateQueries(e={},t={}){return lt.batch(()=>{if(V(this,st).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=lt.batch(()=>V(this,st).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(an)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(an)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=V(this,st).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(an).catch(an)}fetchInfiniteQuery(e){return e.behavior=CL(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(an).catch(an)}resumePausedMutations(){return V(this,Ur).resumePausedMutations()}getQueryCache(){return V(this,st)}getMutationCache(){return V(this,Ur)}getDefaultOptions(){return V(this,Wr)}setDefaultOptions(e){ie(this,Wr,e)}setQueryDefaults(e,t){V(this,Gs).set(Xi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...V(this,Gs).values()];let n={};return t.forEach(r=>{Ia(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){V(this,Ys).set(Xi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...V(this,Ys).values()];let n={};return t.forEach(r=>{Ia(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...V(this,Wr).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Vm(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...V(this,Wr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){V(this,st).clear(),V(this,Ur).clear()}},st=new WeakMap,Ur=new WeakMap,Wr=new WeakMap,Gs=new WeakMap,Ys=new WeakMap,Vr=new WeakMap,Xs=new WeakMap,Qs=new WeakMap,A1),Pt,Ve,Ka,Et,Ni,Js,Vn,qa,Zs,eo,Bi,ji,Kr,to,Fi,ra,Ga,Uf,Ya,Wf,Xa,Vf,Qa,Kf,Ja,qf,Za,Gf,el,Yf,Au,gx,T1,RL=(T1=class extends ko{constructor(t,n){super();ae(this,Fi);ae(this,Ga);ae(this,Ya);ae(this,Xa);ae(this,Qa);ae(this,Ja);ae(this,Za);ae(this,el);ae(this,Au);ae(this,Pt,void 0);ae(this,Ve,void 0);ae(this,Ka,void 0);ae(this,Et,void 0);ae(this,Ni,void 0);ae(this,Js,void 0);ae(this,Vn,void 0);ae(this,qa,void 0);ae(this,Zs,void 0);ae(this,eo,void 0);ae(this,Bi,void 0);ae(this,ji,void 0);ae(this,Kr,void 0);ae(this,to,new Set);this.options=n,ie(this,Pt,t),ie(this,Vn,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(V(this,Ve).addObserver(this),K0(V(this,Ve),this.options)?ye(this,Fi,ra).call(this):this.updateResult(),ye(this,Qa,Kf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xf(V(this,Ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xf(V(this,Ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,Ja,qf).call(this),ye(this,Za,Gf).call(this),V(this,Ve).removeObserver(this)}setOptions(t,n){const r=this.options,i=V(this,Ve);if(this.options=V(this,Pt).defaultQueryOptions(t),fu(r,this.options)||V(this,Pt).getQueryCache().notify({type:"observerOptionsUpdated",query:V(this,Ve),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),ye(this,el,Yf).call(this);const o=this.hasListeners();o&&q0(V(this,Ve),i,this.options,r)&&ye(this,Fi,ra).call(this),this.updateResult(n),o&&(V(this,Ve)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&ye(this,Ga,Uf).call(this);const a=ye(this,Ya,Wf).call(this);o&&(V(this,Ve)!==i||this.options.enabled!==r.enabled||a!==V(this,Kr))&&ye(this,Xa,Vf).call(this,a)}getOptimisticResult(t){const n=V(this,Pt).getQueryCache().build(V(this,Pt),t),r=this.createResult(n,t);return ML(this,r)&&(ie(this,Et,r),ie(this,Js,this.options),ie(this,Ni,V(this,Ve).state)),r}getCurrentResult(){return V(this,Et)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(V(this,to).add(r),t[r])})}),n}getCurrentQuery(){return V(this,Ve)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=V(this,Pt).defaultQueryOptions(t),r=V(this,Pt).getQueryCache().build(V(this,Pt),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ye(this,Fi,ra).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),V(this,Et)))}createResult(t,n){var C;const r=V(this,Ve),i=this.options,o=V(this,Et),a=V(this,Ni),s=V(this,Js),c=t!==r?t.state:V(this,Ka),{state:m}=t;let{error:u,errorUpdatedAt:p,fetchStatus:g,status:y}=m,_=!1,h;if(n._optimisticResults){const R=this.hasListeners(),w=!R&&K0(t,n),k=R&&q0(t,r,n,i);(w||k)&&(g=rh(t.options.networkMode)?"fetching":"paused",m.dataUpdatedAt||(y="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof m.data<"u")if(o&&m.data===(a==null?void 0:a.data)&&n.select===V(this,qa))h=V(this,Zs);else try{ie(this,qa,n.select),h=n.select(m.data),h=Hf(o==null?void 0:o.data,h,n),ie(this,Zs,h),ie(this,Vn,null)}catch(R){ie(this,Vn,R)}else h=m.data;if(typeof n.placeholderData<"u"&&typeof h>"u"&&y==="pending"){let R;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))R=o.data;else if(R=typeof n.placeholderData=="function"?n.placeholderData((C=V(this,eo))==null?void 0:C.state.data,V(this,eo)):n.placeholderData,n.select&&typeof R<"u")try{R=n.select(R),ie(this,Vn,null)}catch(w){ie(this,Vn,w)}typeof R<"u"&&(y="success",h=Hf(o==null?void 0:o.data,R,n),_=!0)}V(this,Vn)&&(u=V(this,Vn),h=V(this,Zs),p=Date.now(),y="error");const f=g==="fetching",d=y==="pending",v=y==="error",b=d&&f;return{status:y,fetchStatus:g,isPending:d,isSuccess:y==="success",isError:v,isInitialLoading:b,isLoading:b,data:h,dataUpdatedAt:m.dataUpdatedAt,error:u,errorUpdatedAt:p,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>c.dataUpdateCount||m.errorUpdateCount>c.errorUpdateCount,isFetching:f,isRefetching:f&&!d,isLoadingError:v&&m.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:_,isRefetchError:v&&m.dataUpdatedAt!==0,isStale:Km(t,n),refetch:this.refetch}}updateResult(t){const n=V(this,Et),r=this.createResult(V(this,Ve),this.options);if(ie(this,Ni,V(this,Ve).state),ie(this,Js,this.options),V(this,Ni).data!==void 0&&ie(this,eo,V(this,Ve)),fu(r,n))return;ie(this,Et,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!V(this,to).size)return!0;const l=new Set(s??V(this,to));return this.options.throwOnError&&l.add("error"),Object.keys(V(this,Et)).some(c=>{const m=c;return V(this,Et)[m]!==n[m]&&l.has(m)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),ye(this,Au,gx).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,Qa,Kf).call(this)}},Pt=new WeakMap,Ve=new WeakMap,Ka=new WeakMap,Et=new WeakMap,Ni=new WeakMap,Js=new WeakMap,Vn=new WeakMap,qa=new WeakMap,Zs=new WeakMap,eo=new WeakMap,Bi=new WeakMap,ji=new WeakMap,Kr=new WeakMap,to=new WeakMap,Fi=new WeakSet,ra=function(t){ye(this,el,Yf).call(this);let n=V(this,Ve).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(an)),n},Ga=new WeakSet,Uf=function(){if(ye(this,Ja,qf).call(this),fo||V(this,Et).isStale||!Ff(this.options.staleTime))return;const n=ux(V(this,Et).dataUpdatedAt,this.options.staleTime)+1;ie(this,Bi,setTimeout(()=>{V(this,Et).isStale||this.updateResult()},n))},Ya=new WeakSet,Wf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(V(this,Ve)):this.options.refetchInterval)??!1},Xa=new WeakSet,Vf=function(t){ye(this,Za,Gf).call(this),ie(this,Kr,t),!(fo||this.options.enabled===!1||!Ff(V(this,Kr))||V(this,Kr)===0)&&ie(this,ji,setInterval(()=>{(this.options.refetchIntervalInBackground||pu.isFocused())&&ye(this,Fi,ra).call(this)},V(this,Kr)))},Qa=new WeakSet,Kf=function(){ye(this,Ga,Uf).call(this),ye(this,Xa,Vf).call(this,ye(this,Ya,Wf).call(this))},Ja=new WeakSet,qf=function(){V(this,Bi)&&(clearTimeout(V(this,Bi)),ie(this,Bi,void 0))},Za=new WeakSet,Gf=function(){V(this,ji)&&(clearInterval(V(this,ji)),ie(this,ji,void 0))},el=new WeakSet,Yf=function(){const t=V(this,Pt).getQueryCache().build(V(this,Pt),this.options);if(t===V(this,Ve))return;const n=V(this,Ve);ie(this,Ve,t),ie(this,Ka,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Au=new WeakSet,gx=function(t){lt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(V(this,Et))}),V(this,Pt).getQueryCache().notify({query:V(this,Ve),type:"observerResultsUpdated"})})},T1);function LL(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function K0(e,t){return LL(e,t)||e.state.dataUpdatedAt>0&&Xf(e,t,t.refetchOnMount)}function Xf(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Km(e,t)}return!1}function q0(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Km(e,n)}function Km(e,t){return e.isStaleByTime(t.staleTime)}function ML(e,t){return!fu(e.getCurrentResult(),t)}var qr,hr,Wt,dr,no,Ec,tl,Qf,D1,AL=(D1=class extends ko{constructor(n,r){super();ae(this,no);ae(this,tl);ae(this,qr,void 0);ae(this,hr,void 0);ae(this,Wt,void 0);ae(this,dr,void 0);ie(this,hr,void 0),ie(this,qr,n),this.setOptions(r),this.bindMethods(),ye(this,no,Ec).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=V(this,qr).defaultMutationOptions(n),fu(r,this.options)||V(this,qr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:V(this,Wt),observer:this}),(i=V(this,Wt))==null||i.setOptions(this.options),r!=null&&r.mutationKey&&this.options.mutationKey&&Xi(r.mutationKey)!==Xi(this.options.mutationKey)&&this.reset()}onUnsubscribe(){var n;this.hasListeners()||(n=V(this,Wt))==null||n.removeObserver(this)}onMutationUpdate(n){ye(this,no,Ec).call(this),ye(this,tl,Qf).call(this,n)}getCurrentResult(){return V(this,hr)}reset(){var n;(n=V(this,Wt))==null||n.removeObserver(this),ie(this,Wt,void 0),ye(this,no,Ec).call(this),ye(this,tl,Qf).call(this)}mutate(n,r){var i;return ie(this,dr,r),(i=V(this,Wt))==null||i.removeObserver(this),ie(this,Wt,V(this,qr).getMutationCache().build(V(this,qr),this.options)),V(this,Wt).addObserver(this),V(this,Wt).execute(n)}},qr=new WeakMap,hr=new WeakMap,Wt=new WeakMap,dr=new WeakMap,no=new WeakSet,Ec=function(){var r;const n=((r=V(this,Wt))==null?void 0:r.state)??mx();ie(this,hr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},tl=new WeakSet,Qf=function(n){lt.batch(()=>{var r,i,o,a,s,l,c,m;if(V(this,dr)&&this.hasListeners()){const u=V(this,hr).variables,p=V(this,hr).context;(n==null?void 0:n.type)==="success"?((i=(r=V(this,dr)).onSuccess)==null||i.call(r,n.data,u,p),(a=(o=V(this,dr)).onSettled)==null||a.call(o,n.data,null,u,p)):(n==null?void 0:n.type)==="error"&&((l=(s=V(this,dr)).onError)==null||l.call(s,n.error,u,p),(m=(c=V(this,dr)).onSettled)==null||m.call(c,void 0,n.error,u,p))}this.listeners.forEach(u=>{u(V(this,hr))})})},D1),vx=x.createContext(void 0),_x=e=>{const t=x.useContext(vx);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TL=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.createElement(vx.Provider,{value:e},t)),yx=x.createContext(!1),DL=()=>x.useContext(yx);yx.Provider;function PL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $L=x.createContext(PL()),OL=()=>x.useContext($L);function wx(e,t){return typeof e=="function"?e(...t):!!e}var IL=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},NL=e=>{x.useEffect(()=>{e.clearReset()},[e])},BL=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&wx(n,[e.error,r]),jL=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},FL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,zL=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function HL(e,t,n){const r=_x(n),i=DL(),o=OL(),a=r.defaultQueryOptions(e);a._optimisticResults=i?"isRestoring":"optimistic",jL(a),IL(a,o),NL(o);const[s]=x.useState(()=>new t(r,a)),l=s.getOptimisticResult(a);if(x.useSyncExternalStore(x.useCallback(c=>{const m=i?()=>{}:s.subscribe(lt.batchCalls(c));return s.updateResult(),m},[s,i]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),x.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),FL(a,l))throw zL(a,s,o);if(BL({result:l,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return a.notifyOnChangeProps?l:s.trackResult(l)}function UL(e,t){return HL(e,RL,t)}function Qi(e,t){const n=_x(t),[r]=x.useState(()=>new AL(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(a=>r.subscribe(lt.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=x.useCallback((a,s)=>{r.mutate(a,s).catch(WL)},[r]);if(i.error&&wx(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function WL(){}const ih=De(!1),bx=De(void 0),qm=()=>{const[e,t]=mn(ih),[n,r]=mn(bx);return{isAccountModalOpen:e,setAccountModalOpen:t,accountModalTab:n,setAccountModalTab:r}},VL=()=>{const e=Ne(ih),t=Ne(bx);return n=>{e(!0),n&&t(n)}},xx=()=>{const e=Ne(ih);return()=>{e(!1)}},sh=De(!1),Sx=nh({title:"",onConfirm:()=>{}}),KL=()=>{const e=Ne(sh),t=Ne(Sx);return n=>{t(n),e(!0)}},qL=()=>{const e=Ne(sh);return()=>{e(!1)}},GL=()=>{const e=Ge(sh),t=Ge(Sx);return{isOpen:e,...t}},oh=De(!1),Cx=nh({title:"",onSubmit:()=>{}}),Gm=()=>{const e=Ne(oh),t=Ne(Cx);return n=>{t(n),e(!0)}},YL=()=>{const e=Ne(oh);return()=>{e(!1)}},XL=()=>{const e=Ge(oh),t=Ge(Cx);return{isOpen:e,...t}},Ym=De(!1),Xm=De(!1),Qm=De(!1),Ex=()=>{const[e,t]=mn(Ym);return{isSheetOpen:e,setIsSheetOpen:t}},kx=()=>{const[e,t]=mn(Xm);return{isSheetOpen:e,setIsSheetOpen:t}},Rx=()=>{const[e,t]=mn(Qm);return{isSheetOpen:e,setIsSheetOpen:t}},ah=()=>{const e=Ne(Ym),t=Ne(Xm),n=Ne(Qm);return()=>{e(!1),t(!1),n(!1)}},lh=nh(!1),Lx=nh(void 0),Mx=()=>{const e=Ne(Lx),t=Ne(lh);return n=>{e(n),t(!0)}},Ax=()=>{const e=Ne(lh);return()=>{e(!1)}},QL=()=>{const e=Ge(Lx),[t,n]=mn(lh);return{isModalOpen:t,playerRef:e,closeModal:()=>n(!1)}};function JL(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ZL=/[ \t\n\f\r]/g;function e8(e){return typeof e=="object"?e.type==="text"?G0(e.value):!1:G0(e)}function G0(e){return e.replace(ZL,"")===""}class fl{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}fl.prototype.property={};fl.prototype.normal={};fl.prototype.space=null;function Tx(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new fl(n,r,t)}function Jf(e){return e.toLowerCase()}class bn{constructor(t,n){this.property=t,this.attribute=n}}bn.prototype.space=null;bn.prototype.boolean=!1;bn.prototype.booleanish=!1;bn.prototype.overloadedBoolean=!1;bn.prototype.number=!1;bn.prototype.commaSeparated=!1;bn.prototype.spaceSeparated=!1;bn.prototype.commaOrSpaceSeparated=!1;bn.prototype.mustUseProperty=!1;bn.prototype.defined=!1;let t8=0;const xe=ns(),et=ns(),Dx=ns(),te=ns(),je=ns(),Bs=ns(),zt=ns();function ns(){return 2**++t8}const Zf=Object.freeze(Object.defineProperty({__proto__:null,boolean:xe,booleanish:et,commaOrSpaceSeparated:zt,commaSeparated:Bs,number:te,overloadedBoolean:Dx,spaceSeparated:je},Symbol.toStringTag,{value:"Module"})),hd=Object.keys(Zf);class Jm extends bn{constructor(t,n,r,i){let o=-1;if(super(t,n),Y0(this,"space",i),typeof r=="number")for(;++o<hd.length;){const a=hd[o];Y0(this,hd[o],(r&Zf[a])===Zf[a])}}}Jm.prototype.defined=!0;function Y0(e,t,n){n&&(e[t]=n)}const n8={}.hasOwnProperty;function Ro(e){const t={},n={};let r;for(r in e.properties)if(n8.call(e.properties,r)){const i=e.properties[r],o=new Jm(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Jf(r)]=r,n[Jf(o.attribute)]=r}return new fl(t,n,e.space)}const Px=Ro({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),$x=Ro({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Ox(e,t){return t in e?e[t]:t}function Ix(e,t){return Ox(e,t.toLowerCase())}const Nx=Ro({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Ix,properties:{xmlns:null,xmlnsXLink:null}}),Bx=Ro({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:et,ariaAutoComplete:null,ariaBusy:et,ariaChecked:et,ariaColCount:te,ariaColIndex:te,ariaColSpan:te,ariaControls:je,ariaCurrent:null,ariaDescribedBy:je,ariaDetails:null,ariaDisabled:et,ariaDropEffect:je,ariaErrorMessage:null,ariaExpanded:et,ariaFlowTo:je,ariaGrabbed:et,ariaHasPopup:null,ariaHidden:et,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:je,ariaLevel:te,ariaLive:null,ariaModal:et,ariaMultiLine:et,ariaMultiSelectable:et,ariaOrientation:null,ariaOwns:je,ariaPlaceholder:null,ariaPosInSet:te,ariaPressed:et,ariaReadOnly:et,ariaRelevant:null,ariaRequired:et,ariaRoleDescription:je,ariaRowCount:te,ariaRowIndex:te,ariaRowSpan:te,ariaSelected:et,ariaSetSize:te,ariaSort:null,ariaValueMax:te,ariaValueMin:te,ariaValueNow:te,ariaValueText:null,role:null}}),r8=Ro({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Ix,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bs,acceptCharset:je,accessKey:je,action:null,allow:null,allowFullScreen:xe,allowPaymentRequest:xe,allowUserMedia:xe,alt:null,as:null,async:xe,autoCapitalize:null,autoComplete:je,autoFocus:xe,autoPlay:xe,blocking:je,capture:xe,charSet:null,checked:xe,cite:null,className:je,cols:te,colSpan:null,content:null,contentEditable:et,controls:xe,controlsList:je,coords:te|Bs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:xe,defer:xe,dir:null,dirName:null,disabled:xe,download:Dx,draggable:et,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:xe,formTarget:null,headers:je,height:te,hidden:xe,high:te,href:null,hrefLang:null,htmlFor:je,httpEquiv:je,id:null,imageSizes:null,imageSrcSet:null,inert:xe,inputMode:null,integrity:null,is:null,isMap:xe,itemId:null,itemProp:je,itemRef:je,itemScope:xe,itemType:je,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:xe,low:te,manifest:null,max:null,maxLength:te,media:null,method:null,min:null,minLength:te,multiple:xe,muted:xe,name:null,nonce:null,noModule:xe,noValidate:xe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint: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:xe,optimum:te,pattern:null,ping:je,placeholder:null,playsInline:xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:xe,referrerPolicy:null,rel:je,required:xe,reversed:xe,rows:te,rowSpan:te,sandbox:je,scope:null,scoped:xe,seamless:xe,selected:xe,shape:null,size:te,sizes:null,slot:null,span:te,spellCheck:et,src:null,srcDoc:null,srcLang:null,srcSet:null,start:te,step:null,style:null,tabIndex:te,target:null,title:null,translate:null,type:null,typeMustMatch:xe,useMap:null,value:et,width:te,wrap:null,align:null,aLink:null,archive:je,axis:null,background:null,bgColor:null,border:te,borderColor:null,bottomMargin:te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:xe,declare:xe,event:null,face:null,frame:null,frameBorder:null,hSpace:te,leftMargin:te,link:null,longDesc:null,lowSrc:null,marginHeight:te,marginWidth:te,noResize:xe,noHref:xe,noShade:xe,noWrap:xe,object:null,profile:null,prompt:null,rev:null,rightMargin:te,rules:null,scheme:null,scrolling:et,standby:null,summary:null,text:null,topMargin:te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:te,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:xe,disableRemotePlayback:xe,prefix:null,property:null,results:te,security:null,unselectable:null}}),i8=Ro({space:"svg",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"},transform:Ox,properties:{about:zt,accentHeight:te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:te,amplitude:te,arabicForm:null,ascent:te,attributeName:null,attributeType:null,azimuth:te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:te,by:null,calcMode:null,capHeight:te,className:je,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:te,diffuseConstant:te,direction:null,display:null,dur:null,divisor:te,dominantBaseline:null,download:xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:te,enableBackground:null,end:null,event:null,exponent:te,externalResourcesRequired:null,fill:null,fillOpacity:te,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:Bs,g2:Bs,glyphName:Bs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:te,horizOriginX:te,horizOriginY:te,id:null,ideographic:te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:te,k:te,k1:te,k2:te,k3:te,k4:te,kernelMatrix:zt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:te,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:te,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:te,overlineThickness:te,paintOrder:null,panose1:null,path:null,pathLength:te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:je,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:te,pointsAtY:te,pointsAtZ:te,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zt,rev:zt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zt,requiredFeatures:zt,requiredFonts:zt,requiredFormats:zt,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:te,specularExponent:te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:te,strikethroughThickness:te,string:null,stroke:null,strokeDashArray:zt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:te,strokeOpacity:te,strokeWidth:null,style:null,surfaceScale:te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zt,tabIndex:te,tableValues:null,target:null,targetX:te,targetY:te,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:te,underlineThickness:te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:te,values:null,vAlphabetic:te,vMathematical:te,vectorEffect:null,vHanging:te,vIdeographic:te,version:null,vertAdvY:te,vertOriginX:te,vertOriginY:te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),s8=/^data[-\w.:]+$/i,X0=/-[a-z]/g,o8=/[A-Z]/g;function a8(e,t){const n=Jf(t);let r=t,i=bn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&s8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(X0,c8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!X0.test(o)){let a=o.replace(o8,l8);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Jm}return new i(r,t)}function l8(e){return"-"+e.toLowerCase()}function c8(e){return e.charAt(1).toUpperCase()}const u8={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"},h8=Tx([$x,Px,Nx,Bx,r8],"html"),jx=Tx([$x,Px,Nx,Bx,i8],"svg");function d8(e){return e.join(" ").trim()}var Zm={exports:{}},Q0=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,f8=/\n/g,p8=/^\s*/,m8=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,g8=/^:\s*/,v8=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,_8=/^[;\s]*/,y8=/^\s+|\s+$/g,w8=`
`,J0="/",Z0="*",ki="",b8="comment",x8="declaration",S8=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(y){var _=y.match(f8);_&&(n+=_.length);var h=y.lastIndexOf(w8);r=~h?y.length-h:r+y.length}function o(){var y={line:n,column:r};return function(_){return _.position=new a(y),c(),_}}function a(y){this.start=y,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(y){var _=new Error(t.source+":"+n+":"+r+": "+y);if(_.reason=y,_.filename=t.source,_.line=n,_.column=r,_.source=e,!t.silent)throw _}function l(y){var _=y.exec(e);if(_){var h=_[0];return i(h),e=e.slice(h.length),_}}function c(){l(p8)}function m(y){var _;for(y=y||[];_=u();)_!==!1&&y.push(_);return y}function u(){var y=o();if(!(J0!=e.charAt(0)||Z0!=e.charAt(1))){for(var _=2;ki!=e.charAt(_)&&(Z0!=e.charAt(_)||J0!=e.charAt(_+1));)++_;if(_+=2,ki===e.charAt(_-1))return s("End of comment missing");var h=e.slice(2,_-2);return r+=2,i(h),e=e.slice(_),r+=2,y({type:b8,comment:h})}}function p(){var y=o(),_=l(m8);if(_){if(u(),!l(g8))return s("property missing ':'");var h=l(v8),f=y({type:x8,property:e_(_[0].replace(Q0,ki)),value:h?e_(h[0].replace(Q0,ki)):ki});return l(_8),f}}function g(){var y=[];m(y);for(var _;_=p();)_!==!1&&(y.push(_),m(y));return y}return c(),g()};function e_(e){return e?e.replace(y8,ki):ki}var C8=S8;function Fx(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=C8(e),o=typeof t=="function",a,s,l=0,c=i.length;l<c;l++)r=i[l],a=r.property,s=r.value,o?t(a,s,r):s&&(n||(n={}),n[a]=s);return n}Zm.exports=Fx;Zm.exports.default=Fx;var E8=Zm.exports;const k8=Tu(E8),zx=Hx("end"),eg=Hx("start");function Hx(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 R8(e){const t=eg(e),n=zx(e);if(t&&n)return{start:t,end:n}}function ma(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?t_(e.position):"start"in e||"end"in e?t_(e):"line"in e||"column"in e?ep(e):""}function ep(e){return n_(e&&e.line)+":"+n_(e&&e.column)}function t_(e){return ep(e&&e.start)+"-"+ep(e&&e.end)}function n_(e){return e&&typeof e=="number"?e:1}class At extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!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&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=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=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=ma(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=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}At.prototype.file="";At.prototype.name="";At.prototype.reason="";At.prototype.message="";At.prototype.stack="";At.prototype.column=void 0;At.prototype.line=void 0;At.prototype.ancestors=void 0;At.prototype.cause=void 0;At.prototype.fatal=void 0;At.prototype.place=void 0;At.prototype.ruleId=void 0;At.prototype.source=void 0;const tg={}.hasOwnProperty,L8=new Map,M8=/[A-Z]/g,A8=/-([a-z])/g,T8=new Set(["table","tbody","thead","tfoot","tr"]),D8=new Set(["td","th"]);function P8(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=O8(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=$8(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?jx:h8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Ux(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Ux(e,t,n){if(t.type==="element"||t.type==="root"){const r=e.schema;let i=r;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=jx,e.schema=i),e.ancestors.push(t);let o=I8(e,t);const a=N8(e,e.ancestors);let s=e.Fragment;if(e.ancestors.pop(),t.type==="element")if(o&&T8.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!e8(l):!0})),tg.call(e.components,t.tagName)){const l=t.tagName;s=e.components[l],typeof s!="string"&&s!==e.Fragment&&e.passNode&&(a.node=t)}else s=t.tagName;if(o.length>0){const l=o.length>1?o:o[0];l&&(a.children=l)}return e.schema=r,e.create(t,s,a,n)}if(t.type==="text")return t.value}function $8(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function O8(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=eg(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function I8(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:L8;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys&&o.type==="element"){const l=i.get(o.tagName)||0;a=o.tagName+"-"+l,i.set(o.tagName,l+1)}const s=Ux(e,o,a);s!==void 0&&n.push(s)}return n}function N8(e,t){const n=t[t.length-1],r={};let i;if("properties"in n&&n.properties){let o;for(i in n.properties)if(i!=="children"&&tg.call(n.properties,i)){const a=B8(e,t,i,n.properties[i]);if(a){const[s,l]=a;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&D8.has(n.tagName)?o=l:r[s]=l}}if(o){const a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}}return r}function B8(e,t,n,r){const i=a8(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?JL(r):d8(r)),i.property==="style"){let o=typeof r=="object"?r:j8(e,t,String(r));return e.stylePropertyNameCase==="css"&&(o=F8(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?u8[i.property]||i.property:i.attribute,r]}}function j8(e,t,n){const r={};try{k8(n,i)}catch(o){if(!e.ignoreInvalidStyle){const a=o,s=new At("Cannot parse `style` attribute",{ancestors:t,cause:a,source:"hast-util-to-jsx-runtime",ruleId:"style"});throw s.file=e.filePath||void 0,s.url="https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute",s}}return r;function i(o,a){let s=o;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(A8,H8)),r[s]=a}}function F8(e){const t={};let n;for(n in e)tg.call(e,n)&&(t[z8(n)]=e[n]);return t}function z8(e){let t=e.replace(M8,U8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function H8(e,t){return t.toUpperCase()}function U8(e){return"-"+e.toLowerCase()}const dd={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"]},W8={};function V8(e,t){const n=t||W8,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Wx(e,r,i)}function Wx(e,t,n){if(K8(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 r_(e.children,t,n)}return Array.isArray(e)?r_(e,t,n):""}function r_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Wx(e[i],t,n);return r.join("")}function K8(e){return!!(e&&typeof e=="object")}const i_=document.createElement("i");function ng(e){const t="&"+e+";";i_.innerHTML=t;const n=i_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function er(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function dn(e,t){return e.length>0?(er(e,e.length,0,t),e):t}const s_={}.hasOwnProperty;function q8(e){const t={};let n=-1;for(;++n<e.length;)G8(t,e[n]);return t}function G8(e,t){let n;for(n in t){const i=(s_.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){s_.call(i,a)||(i[a]=[]);const s=o[a];Y8(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Y8(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);er(e,0,0,r)}function Vx(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 js(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const X8=vi(new RegExp("\\p{P}","u")),qn=vi(/[A-Za-z]/),Yt=vi(/[\dA-Za-z]/),Q8=vi(/[#-'*+\--9=?A-Z^-~]/);function tp(e){return e!==null&&(e<32||e===127)}const np=vi(/\d/),J8=vi(/[\dA-Fa-f]/),Kx=vi(/[!-/:-@[-`{-~]/);function ve(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function $e(e){return e===-2||e===-1||e===32}function Z8(e){return Kx(e)||X8(e)}const e7=vi(/\s/);function vi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Lo(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Yt(e.charCodeAt(n+1))&&Yt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function He(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return $e(l)?(e.enter(n),s(l)):t(l)}function s(l){return $e(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const t7={tokenize:n7};function n7(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),He(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ve(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const r7={tokenize:i7},o_={tokenize:s7};function i7(e){const t=this,n=[];let r=0,i,o,a;return s;function s(v){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,l,c)(v)}return c(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&d();const b=t.events.length;let E=b,C;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){C=t.events[E][1].end;break}f(r);let R=b;for(;R<t.events.length;)t.events[R][1].end=Object.assign({},C),R++;return er(t.events,E+1,0,t.events.slice(b)),t.events.length=R,c(v)}return s(v)}function c(v){if(r===n.length){if(!i)return p(v);if(i.currentConstruct&&i.currentConstruct.concrete)return y(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(o_,m,u)(v)}function m(v){return i&&d(),f(r),p(v)}function u(v){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,y(v)}function p(v){return t.containerState={},e.attempt(o_,g,y)(v)}function g(v){return r++,n.push([t.currentConstruct,t.containerState]),p(v)}function y(v){if(v===null){i&&d(),f(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),_(v)}function _(v){if(v===null){h(e.exit("chunkFlow"),!0),f(0),e.consume(v);return}return ve(v)?(e.consume(v),h(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(v),_)}function h(v,b){const E=t.sliceStream(v);if(b&&E.push(null),v.previous=o,o&&(o.next=v),o=v,i.defineSkip(v.start),i.write(E),t.parser.lazy[v.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const R=t.events.length;let w=R,k,L;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){if(k){L=t.events[w][1].end;break}k=!0}for(f(r),C=R;C<t.events.length;)t.events[C][1].end=Object.assign({},L),C++;er(t.events,w+1,0,t.events.slice(R)),t.events.length=C}}function f(v){let b=n.length;for(;b-- >v;){const E=n[b];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function d(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function s7(e,t,n){return He(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function a_(e){if(e===null||jt(e)||e7(e))return 1;if(Z8(e))return 2}function rg(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 rp={name:"attention",tokenize:a7,resolveAll:o7};function o7(e,t){let n=-1,r,i,o,a,s,l,c,m;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;l=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 u=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);l_(u,-l),l_(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=dn(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=dn(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=dn(c,rg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=dn(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,c=dn(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,er(e,r-1,n-r+3,c),n=r+c.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function a7(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=a_(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),m=a_(l),u=!m||m===2&&i||n.includes(l),p=!i||i===2&&m||n.includes(r);return c._open=!!(o===42?u:u&&(i||!p)),c._close=!!(o===42?p:p&&(m||!u)),t(l)}}function l_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const l7={name:"autolink",tokenize:c7};function c7(e,t,n){let r=0;return i;function i(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(g){return qn(g)?(e.consume(g),a):c(g)}function a(g){return g===43||g===45||g===46||Yt(g)?(r=1,s(g)):c(g)}function s(g){return g===58?(e.consume(g),r=0,l):(g===43||g===45||g===46||Yt(g))&&r++<32?(e.consume(g),s):(r=0,c(g))}function l(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||tp(g)?n(g):(e.consume(g),l)}function c(g){return g===64?(e.consume(g),m):Q8(g)?(e.consume(g),c):n(g)}function m(g){return Yt(g)?u(g):n(g)}function u(g){return g===46?(e.consume(g),r=0,m):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):p(g)}function p(g){if((g===45||Yt(g))&&r++<63){const y=g===45?p:u;return e.consume(g),y}return n(g)}}const ch={tokenize:u7,partial:!0};function u7(e,t,n){return r;function r(o){return $e(o)?He(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ve(o)?t(o):n(o)}}const qx={name:"blockQuote",tokenize:h7,continuation:{tokenize:d7},exit:f7};function h7(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return $e(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function d7(e,t,n){const r=this;return i;function i(a){return $e(a)?He(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(qx,t,n)(a)}}function f7(e){e.exit("blockQuote")}const Gx={name:"characterEscape",tokenize:p7};function p7(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 Kx(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Yx={name:"characterReference",tokenize:m7};function m7(e,t,n){const r=this;let i=0,o,a;return s;function s(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=Yt,m(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=J8,m):(e.enter("characterReferenceValue"),o=7,a=np,m(u))}function m(u){if(u===59&&i){const p=e.exit("characterReferenceValue");return a===Yt&&!ng(r.sliceSerialize(p))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(u)&&i++<o?(e.consume(u),m):n(u)}}const c_={tokenize:v7,partial:!0},u_={name:"codeFenced",tokenize:g7,concrete:!0};function g7(e,t,n){const r=this,i={tokenize:E,partial:!0};let o=0,a=0,s;return l;function l(C){return c(C)}function c(C){const R=r.events[r.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(C)}function m(C){return C===s?(a++,e.consume(C),m):a<3?n(C):(e.exit("codeFencedFenceSequence"),$e(C)?He(e,u,"whitespace")(C):u(C))}function u(C){return C===null||ve(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(c_,_,b)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||ve(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(C)):$e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),He(e,g,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),p)}function g(C){return C===null||ve(C)?u(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||ve(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(C)):C===96&&C===s?n(C):(e.consume(C),y)}function _(C){return e.attempt(i,b,h)(C)}function h(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),f}function f(C){return o>0&&$e(C)?He(e,d,"linePrefix",o+1)(C):d(C)}function d(C){return C===null||ve(C)?e.check(c_,_,b)(C):(e.enter("codeFlowValue"),v(C))}function v(C){return C===null||ve(C)?(e.exit("codeFlowValue"),d(C)):(e.consume(C),v)}function b(C){return e.exit("codeFenced"),t(C)}function E(C,R,w){let k=0;return L;function L(I){return C.enter("lineEnding"),C.consume(I),C.exit("lineEnding"),A}function A(I){return C.enter("codeFencedFence"),$e(I)?He(C,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):D(I)}function D(I){return I===s?(C.enter("codeFencedFenceSequence"),P(I)):w(I)}function P(I){return I===s?(k++,C.consume(I),P):k>=a?(C.exit("codeFencedFenceSequence"),$e(I)?He(C,$,"whitespace")(I):$(I)):w(I)}function $(I){return I===null||ve(I)?(C.exit("codeFencedFence"),R(I)):w(I)}}}function v7(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const fd={name:"codeIndented",tokenize:y7},_7={tokenize:w7,partial:!0};function y7(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),He(e,o,"linePrefix",5)(c)}function o(c){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):ve(c)?e.attempt(_7,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||ve(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function w7(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ve(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):He(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):ve(a)?i(a):n(a)}}const b7={name:"codeText",tokenize:C7,resolve:x7,previous:S7};function x7(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 S7(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function C7(e,t,n){let r=0,i,o;return a;function a(u){return e.enter("codeText"),e.enter("codeTextSequence"),s(u)}function s(u){return u===96?(e.consume(u),r++,s):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(o=e.enter("codeTextSequence"),i=0,m(u)):ve(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||ve(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function m(u){return u===96?(e.consume(u),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(o.type="codeTextData",c(u))}}function Xx(e){const t={};let n=-1,r,i,o,a,s,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,E7(e,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(a=e[o],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),s=e.slice(i,n),s.unshift(r),er(e,i,n-i+1,s))}}return!c}function E7(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],a=n._tokenizer||r.parser[n.contentType](n.start),s=a.events,l=[],c={};let m,u,p=-1,g=n,y=0,_=0;const h=[_];for(;g;){for(;e[++i][1]!==g;);o.push(i),g._tokenizer||(m=r.sliceStream(g),g.next||m.push(null),u&&a.defineSkip(g.start),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=g,g=g.next}for(g=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(_=p+1,h.push(_),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(a.events=[],g?(g._tokenizer=void 0,g.previous=void 0):h.pop(),p=h.length;p--;){const f=s.slice(h[p],h[p+1]),d=o.pop();l.unshift([d,d+f.length-1]),er(e,d,2,f)}for(p=-1;++p<l.length;)c[y+l[p][0]]=y+l[p][1],y+=l[p][1]-l[p][0]-1;return c}const k7={tokenize:M7,resolve:L7},R7={tokenize:A7,partial:!0};function L7(e){return Xx(e),e}function M7(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):ve(s)?e.check(R7,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function A7(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),He(e,o,"linePrefix")}function o(a){if(a===null||ve(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Qx(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let m=0;return u;function u(f){return f===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(f),e.exit(o),p):f===null||f===32||f===41||tp(f)?n(f):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),_(f))}function p(f){return f===62?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),g(f))}function g(f){return f===62?(e.exit("chunkString"),e.exit(s),p(f)):f===null||f===60||ve(f)?n(f):(e.consume(f),f===92?y:g)}function y(f){return f===60||f===62||f===92?(e.consume(f),g):g(f)}function _(f){return!m&&(f===null||f===41||jt(f))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(f)):m<c&&f===40?(e.consume(f),m++,_):f===41?(e.consume(f),m--,_):f===null||f===32||f===40||tp(f)?n(f):(e.consume(f),f===92?h:_)}function h(f){return f===40||f===41||f===92?(e.consume(f),_):_(f)}}function Jx(e,t,n,r,i,o){const a=this;let s=0,l;return c;function c(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(o),m}function m(g){return s>999||g===null||g===91||g===93&&!l||g===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):ve(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),u(g))}function u(g){return g===null||g===91||g===93||ve(g)||s++>999?(e.exit("chunkString"),m(g)):(e.consume(g),l||(l=!$e(g)),g===92?p:u)}function p(g){return g===91||g===92||g===93?(e.consume(g),s++,u):u(g)}}function Zx(e,t,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===a?(e.exit(o),l(a)):p===null?n(p):ve(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),He(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(p))}function m(p){return p===a||p===null||ve(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?u:m)}function u(p){return p===a||p===92?(e.consume(p),m):m(p)}}function ga(e,t){let n;return r;function r(i){return ve(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):$e(i)?He(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const T7={name:"definition",tokenize:P7},D7={tokenize:$7,partial:!0};function P7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),a(g)}function a(g){return Jx.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function s(g){return i=js(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),l):n(g)}function l(g){return jt(g)?ga(e,c)(g):c(g)}function c(g){return Qx(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function m(g){return e.attempt(D7,u,u)(g)}function u(g){return $e(g)?He(e,p,"whitespace")(g):p(g)}function p(g){return g===null||ve(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function $7(e,t,n){return r;function r(s){return jt(s)?ga(e,i)(s):n(s)}function i(s){return Zx(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return $e(s)?He(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ve(s)?t(s):n(s)}}const O7={name:"hardBreakEscape",tokenize:I7};function I7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ve(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const N7={name:"headingAtx",tokenize:j7,resolve:B7};function B7(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"},er(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function j7(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&r++<6?(e.consume(m),a):m===null||jt(m)?(e.exit("atxHeadingSequence"),s(m)):n(m)}function s(m){return m===35?(e.enter("atxHeadingSequence"),l(m)):m===null||ve(m)?(e.exit("atxHeading"),t(m)):$e(m)?He(e,s,"whitespace")(m):(e.enter("atxHeadingText"),c(m))}function l(m){return m===35?(e.consume(m),l):(e.exit("atxHeadingSequence"),s(m))}function c(m){return m===null||m===35||jt(m)?(e.exit("atxHeadingText"),s(m)):(e.consume(m),c)}}const F7=["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"],h_=["pre","script","style","textarea"],z7={name:"htmlFlow",tokenize:V7,resolveTo:W7,concrete:!0},H7={tokenize:q7,partial:!0},U7={tokenize:K7,partial:!0};function W7(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 V7(e,t,n){const r=this;let i,o,a,s,l;return c;function c(O){return m(O)}function m(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),u}function u(O){return O===33?(e.consume(O),p):O===47?(e.consume(O),o=!0,_):O===63?(e.consume(O),i=3,r.interrupt?t:M):qn(O)?(e.consume(O),a=String.fromCharCode(O),h):n(O)}function p(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,s=0,y):qn(O)?(e.consume(O),i=4,r.interrupt?t:M):n(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:M):n(O)}function y(O){const X="CDATA[";return O===X.charCodeAt(s++)?(e.consume(O),s===X.length?r.interrupt?t:D:y):n(O)}function _(O){return qn(O)?(e.consume(O),a=String.fromCharCode(O),h):n(O)}function h(O){if(O===null||O===47||O===62||jt(O)){const X=O===47,re=a.toLowerCase();return!X&&!o&&h_.includes(re)?(i=1,r.interrupt?t(O):D(O)):F7.includes(a.toLowerCase())?(i=6,X?(e.consume(O),f):r.interrupt?t(O):D(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?d(O):v(O))}return O===45||Yt(O)?(e.consume(O),a+=String.fromCharCode(O),h):n(O)}function f(O){return O===62?(e.consume(O),r.interrupt?t:D):n(O)}function d(O){return $e(O)?(e.consume(O),d):L(O)}function v(O){return O===47?(e.consume(O),L):O===58||O===95||qn(O)?(e.consume(O),b):$e(O)?(e.consume(O),v):L(O)}function b(O){return O===45||O===46||O===58||O===95||Yt(O)?(e.consume(O),b):E(O)}function E(O){return O===61?(e.consume(O),C):$e(O)?(e.consume(O),E):v(O)}function C(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),l=O,R):$e(O)?(e.consume(O),C):w(O)}function R(O){return O===l?(e.consume(O),l=null,k):O===null||ve(O)?n(O):(e.consume(O),R)}function w(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||jt(O)?E(O):(e.consume(O),w)}function k(O){return O===47||O===62||$e(O)?v(O):n(O)}function L(O){return O===62?(e.consume(O),A):n(O)}function A(O){return O===null||ve(O)?D(O):$e(O)?(e.consume(O),A):n(O)}function D(O){return O===45&&i===2?(e.consume(O),F):O===60&&i===1?(e.consume(O),U):O===62&&i===4?(e.consume(O),B):O===63&&i===3?(e.consume(O),M):O===93&&i===5?(e.consume(O),T):ve(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(H7,z,P)(O)):O===null||ve(O)?(e.exit("htmlFlowData"),P(O)):(e.consume(O),D)}function P(O){return e.check(U7,$,z)(O)}function $(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),I}function I(O){return O===null||ve(O)?P(O):(e.enter("htmlFlowData"),D(O))}function F(O){return O===45?(e.consume(O),M):D(O)}function U(O){return O===47?(e.consume(O),a="",j):D(O)}function j(O){if(O===62){const X=a.toLowerCase();return h_.includes(X)?(e.consume(O),B):D(O)}return qn(O)&&a.length<8?(e.consume(O),a+=String.fromCharCode(O),j):D(O)}function T(O){return O===93?(e.consume(O),M):D(O)}function M(O){return O===62?(e.consume(O),B):O===45&&i===2?(e.consume(O),M):D(O)}function B(O){return O===null||ve(O)?(e.exit("htmlFlowData"),z(O)):(e.consume(O),B)}function z(O){return e.exit("htmlFlow"),t(O)}}function K7(e,t,n){const r=this;return i;function i(a){return ve(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function q7(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ch,t,n)}}const G7={name:"htmlText",tokenize:Y7};function Y7(e,t,n){const r=this;let i,o,a;return s;function s(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),l}function l(M){return M===33?(e.consume(M),c):M===47?(e.consume(M),E):M===63?(e.consume(M),v):qn(M)?(e.consume(M),w):n(M)}function c(M){return M===45?(e.consume(M),m):M===91?(e.consume(M),o=0,y):qn(M)?(e.consume(M),d):n(M)}function m(M){return M===45?(e.consume(M),g):n(M)}function u(M){return M===null?n(M):M===45?(e.consume(M),p):ve(M)?(a=u,U(M)):(e.consume(M),u)}function p(M){return M===45?(e.consume(M),g):u(M)}function g(M){return M===62?F(M):M===45?p(M):u(M)}function y(M){const B="CDATA[";return M===B.charCodeAt(o++)?(e.consume(M),o===B.length?_:y):n(M)}function _(M){return M===null?n(M):M===93?(e.consume(M),h):ve(M)?(a=_,U(M)):(e.consume(M),_)}function h(M){return M===93?(e.consume(M),f):_(M)}function f(M){return M===62?F(M):M===93?(e.consume(M),f):_(M)}function d(M){return M===null||M===62?F(M):ve(M)?(a=d,U(M)):(e.consume(M),d)}function v(M){return M===null?n(M):M===63?(e.consume(M),b):ve(M)?(a=v,U(M)):(e.consume(M),v)}function b(M){return M===62?F(M):v(M)}function E(M){return qn(M)?(e.consume(M),C):n(M)}function C(M){return M===45||Yt(M)?(e.consume(M),C):R(M)}function R(M){return ve(M)?(a=R,U(M)):$e(M)?(e.consume(M),R):F(M)}function w(M){return M===45||Yt(M)?(e.consume(M),w):M===47||M===62||jt(M)?k(M):n(M)}function k(M){return M===47?(e.consume(M),F):M===58||M===95||qn(M)?(e.consume(M),L):ve(M)?(a=k,U(M)):$e(M)?(e.consume(M),k):F(M)}function L(M){return M===45||M===46||M===58||M===95||Yt(M)?(e.consume(M),L):A(M)}function A(M){return M===61?(e.consume(M),D):ve(M)?(a=A,U(M)):$e(M)?(e.consume(M),A):k(M)}function D(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,P):ve(M)?(a=D,U(M)):$e(M)?(e.consume(M),D):(e.consume(M),$)}function P(M){return M===i?(e.consume(M),i=void 0,I):M===null?n(M):ve(M)?(a=P,U(M)):(e.consume(M),P)}function $(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||jt(M)?k(M):(e.consume(M),$)}function I(M){return M===47||M===62||jt(M)?k(M):n(M)}function F(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"),j}function j(M){return $e(M)?He(e,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):T(M)}function T(M){return e.enter("htmlTextData"),a(M)}}const ig={name:"labelEnd",tokenize:tM,resolveTo:eM,resolveAll:Z7},X7={tokenize:nM},Q7={tokenize:rM},J7={tokenize:iM};function Z7(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function eM(e,t){let n=e.length,r=0,i,o,a,s;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(a){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"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[a][1].end)},m={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[a-2][1].start)};return s=[["enter",l,t],["enter",c,t]],s=dn(s,e.slice(o+1,o+r+3)),s=dn(s,[["enter",m,t]]),s=dn(s,rg(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=dn(s,[["exit",m,t],e[a-2],e[a-1],["exit",c,t]]),s=dn(s,e.slice(a+1)),s=dn(s,[["exit",l,t]]),er(e,o,e.length,s),e}function tM(e,t,n){const r=this;let i=r.events.length,o,a;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 s;function s(p){return o?o._inactive?u(p):(a=r.parser.defined.includes(js(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(X7,m,a?m:u)(p):p===91?e.attempt(Q7,m,a?c:u)(p):a?m(p):u(p)}function c(p){return e.attempt(J7,m,u)(p)}function m(p){return t(p)}function u(p){return o._balanced=!0,n(p)}}function nM(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),i}function i(u){return jt(u)?ga(e,o)(u):o(u)}function o(u){return u===41?m(u):Qx(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return jt(u)?ga(e,l)(u):m(u)}function s(u){return n(u)}function l(u){return u===34||u===39||u===40?Zx(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):m(u)}function c(u){return jt(u)?ga(e,m)(u):m(u)}function m(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function rM(e,t,n){const r=this;return i;function i(s){return Jx.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(js(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function iM(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 sM={name:"labelStartImage",tokenize:oM,resolveAll:ig.resolveAll};function oM(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const aM={name:"labelStartLink",tokenize:lM,resolveAll:ig.resolveAll};function lM(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const pd={name:"lineEnding",tokenize:cM};function cM(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),He(e,t,"linePrefix")}}const kc={name:"thematicBreak",tokenize:uM};function uM(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ve(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),$e(c)?He(e,s,"whitespace")(c):s(c))}}const Dt={name:"list",tokenize:fM,continuation:{tokenize:pM},exit:gM},hM={tokenize:vM,partial:!0},dM={tokenize:mM,partial:!0};function fM(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,a=0;return s;function s(g){const y=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:np(g)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(kc,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(g)}return n(g)}function l(g){return np(g)&&++a<10?(e.consume(g),l):(!r.interrupt||a<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(ch,r.interrupt?n:m,e.attempt(hM,p,u))}function m(g){return r.containerState.initialBlankLine=!0,o++,p(g)}function u(g){return $e(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),p):n(g)}function p(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function pM(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ch,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,He(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!$e(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dM,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,He(e,e.attempt(Dt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function mM(e,t,n){const r=this;return He(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function gM(e){e.exit(this.containerState.type)}function vM(e,t,n){const r=this;return He(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!$e(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const d_={name:"setextUnderline",tokenize:yM,resolveTo:_M};function _M(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 a={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function yM(e,t,n){const r=this;let i;return o;function o(c){let m=r.events.length,u;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){u=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),$e(c)?He(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ve(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const wM={tokenize:bM};function bM(e){const t=this,n=e.attempt(ch,r,e.attempt(this.parser.constructs.flowInitial,i,He(e,e.attempt(this.parser.constructs.flow,i,e.attempt(k7,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 xM={resolveAll:tS()},SM=eS("string"),CM=eS("text");function eS(e){return{tokenize:t,resolveAll:tS(e==="text"?EM:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(m){return c(m)?o(m):s(m)}function s(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),l}function l(m){return c(m)?(n.exit("data"),o(m)):(n.consume(m),l)}function c(m){if(m===null)return!0;const u=i[m];let p=-1;if(u)for(;++p<u.length;){const g=u[p];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function tS(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 EM(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,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-s,offset:r.end.offset-s,_index:r.start._index+o,_bufferIndex:o?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function kM(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let a=[],s=[];const l={consume:d,enter:v,exit:b,attempt:R(E),check:R(C),interrupt:R(C,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:g,sliceSerialize:p,now:y,defineSkip:_,write:u};let m=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function u(A){return a=dn(a,A),h(),a[a.length-1]!==null?[]:(w(t,0),c.events=rg(o,c.events,c),c.events)}function p(A,D){return LM(g(A),D)}function g(A){return RM(a,A)}function y(){const{line:A,column:D,offset:P,_index:$,_bufferIndex:I}=r;return{line:A,column:D,offset:P,_index:$,_bufferIndex:I}}function _(A){i[A.line]=A.column,L()}function h(){let A;for(;r._index<a.length;){const D=a[r._index];if(typeof D=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<D.length;)f(D.charCodeAt(r._bufferIndex));else f(D)}}function f(A){m=m(A)}function d(A){ve(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,L()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=A}function v(A,D){const P=D||{};return P.type=A,P.start=y(),c.events.push(["enter",P,c]),s.push(P),P}function b(A){const D=s.pop();return D.end=y(),c.events.push(["exit",D,c]),D}function E(A,D){w(A,D.from)}function C(A,D){D.restore()}function R(A,D){return P;function P($,I,F){let U,j,T,M;return Array.isArray($)?z($):"tokenize"in $?z([$]):B($);function B(H){return W;function W(N){const K=N!==null&&H[N],Q=N!==null&&H.null,q=[...Array.isArray(K)?K:K?[K]:[],...Array.isArray(Q)?Q:Q?[Q]:[]];return z(q)(N)}}function z(H){return U=H,j=0,H.length===0?F:O(H[j])}function O(H){return W;function W(N){return M=k(),T=H,H.partial||(c.currentConstruct=H),H.name&&c.parser.constructs.disable.null.includes(H.name)?re():H.tokenize.call(D?Object.assign(Object.create(c),D):c,l,X,re)(N)}}function X(H){return A(T,M),I}function re(H){return M.restore(),++j<U.length?O(U[j]):F}}}function w(A,D){A.resolveAll&&!o.includes(A)&&o.push(A),A.resolve&&er(c.events,D,c.events.length-D,A.resolve(c.events.slice(D),c)),A.resolveTo&&(c.events=A.resolveTo(c.events,c))}function k(){const A=y(),D=c.previous,P=c.currentConstruct,$=c.events.length,I=Array.from(s);return{restore:F,from:$};function F(){r=A,c.previous=D,c.currentConstruct=P,c.events.length=$,s=I,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function RM(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function LM(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=t?" ":"	";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}const MM={42:Dt,43:Dt,45:Dt,48:Dt,49:Dt,50:Dt,51:Dt,52:Dt,53:Dt,54:Dt,55:Dt,56:Dt,57:Dt,62:qx},AM={91:T7},TM={[-2]:fd,[-1]:fd,32:fd},DM={35:N7,42:kc,45:[d_,kc],60:z7,61:d_,95:kc,96:u_,126:u_},PM={38:Yx,92:Gx},$M={[-5]:pd,[-4]:pd,[-3]:pd,33:sM,38:Yx,42:rp,60:[l7,G7],91:aM,92:[O7,Gx],93:ig,95:rp,96:b7},OM={null:[rp,xM]},IM={null:[42,95]},NM={null:[]},BM=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:IM,contentInitial:AM,disable:NM,document:MM,flow:DM,flowInitial:TM,insideSpan:OM,string:PM,text:$M},Symbol.toStringTag,{value:"Module"}));function jM(e){const n=q8([BM,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(t7),document:i(r7),flow:i(wM),string:i(SM),text:i(CM)};return r;function i(o){return a;function a(s){return kM(r,o,s)}}}function FM(e){for(;!Xx(e););return e}const f_=/[\0\t\n\r]/g;function zM(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let c,m,u,p,g;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),u=0,t="",n&&(o.charCodeAt(0)===65279&&u++,n=void 0);u<o.length;){if(f_.lastIndex=u,c=f_.exec(o),p=c&&c.index!==void 0?c.index:o.length,g=o.charCodeAt(p),!c){t=o.slice(u);break}if(g===10&&u===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<p&&(l.push(o.slice(u,p)),e+=p-u),g){case 0:{l.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,l.push(-2);e++<m;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=p+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const HM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function UM(e){return e.replace(HM,WM)}function WM(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Vx(n.slice(o?2:1),o?16:10)}return ng(n)||e}const nS={}.hasOwnProperty;function VM(e,t,n){return typeof t!="string"&&(n=t,t=void 0),KM(n)(FM(jM(n).document().write(zM()(e,t,!0))))}function KM(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ct),autolinkProtocol:k,autolinkEmail:k,atxHeading:o(le),blockQuote:o(K),characterEscape:k,characterReference:k,codeFenced:o(Q),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Q,a),codeText:o(q,a),codeTextData:k,data:k,codeFlowValue:k,definition:o(de),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(he),hardBreakEscape:o(Ae),hardBreakTrailing:o(Ae),htmlFlow:o(Be,a),htmlFlowData:k,htmlText:o(Be,a),htmlTextData:k,image:o(ue),label:a,link:o(Ct),listItem:o(Ee),listItemValue:p,listOrdered:o(Sn,u),listUnordered:o(Sn),paragraph:o(_e),reference:O,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(le),strong:o(Ce),thematicBreak:o(Re)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:N,autolinkProtocol:W,blockQuote:l(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:H,codeFenced:l(h),codeFencedFence:_,codeFencedFenceInfo:g,codeFencedFenceMeta:y,codeFlowValue:L,codeIndented:l(f),codeText:l(I),codeTextData:L,data:L,definition:l(),definitionDestinationString:b,definitionLabelString:d,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(P),htmlFlowData:L,htmlText:l($),htmlTextData:L,image:l(U),label:T,labelText:j,lineEnding:A,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:X,resourceDestinationString:M,resourceTitleString:B,resource:z,setextHeading:l(w),setextHeadingLineSequence:R,setextHeadingText:C,strong:l(),thematicBreak:l()}};rS(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let J={type:"root",children:[]};const pe={stack:[J],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:m,data:n},me=[];let we=-1;for(;++we<G.length;)if(G[we][1].type==="listOrdered"||G[we][1].type==="listUnordered")if(G[we][0]==="enter")me.push(we);else{const Pe=me.pop();we=i(G,Pe,we)}for(we=-1;++we<G.length;){const Pe=t[G[we][0]];nS.call(Pe,G[we][1].type)&&Pe[G[we][1].type].call(Object.assign({sliceSerialize:G[we][2].sliceSerialize},pe),G[we][1])}if(pe.tokenStack.length>0){const Pe=pe.tokenStack[pe.tokenStack.length-1];(Pe[1]||p_).call(pe,void 0,Pe[0])}for(J.position={start:Dr(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:Dr(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<t.transforms.length;)J=t.transforms[we](J)||J;return J}function i(G,J,pe){let me=J-1,we=-1,Pe=!1,Me,ge,Cn,Bn;for(;++me<=pe;){const ht=G[me];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?we++:we--,Bn=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(Me&&!Bn&&!we&&!Cn&&(Cn=me),Bn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bn=void 0}if(!we&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||we===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(Me){let ir=me;for(ge=void 0;ir--;){const Tt=G[ir];if(Tt[1].type==="lineEnding"||Tt[1].type==="lineEndingBlank"){if(Tt[0]==="exit")continue;ge&&(G[ge][1].type="lineEndingBlank",Pe=!0),Tt[1].type="lineEnding",ge=ir}else if(!(Tt[1].type==="linePrefix"||Tt[1].type==="blockQuotePrefix"||Tt[1].type==="blockQuotePrefixWhitespace"||Tt[1].type==="blockQuoteMarker"||Tt[1].type==="listItemIndent"))break}Cn&&(!ge||Cn<ge)&&(Me._spread=!0),Me.end=Object.assign({},ge?G[ge][1].start:ht[1].end),G.splice(ge||me,0,["exit",Me,ht[2]]),me++,pe++}if(ht[1].type==="listItemPrefix"){const ir={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};Me=ir,G.splice(me,0,["enter",ir,ht[2]]),me++,pe++,Cn=void 0,Bn=!0}}}return G[J][1]._spread=Pe,pe}function o(G,J){return pe;function pe(me){s.call(this,G(me),me),J&&J.call(this,me)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(G,J,pe){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([J,pe]),G.position={start:Dr(J.start),end:void 0}}function l(G){return J;function J(pe){G&&G.call(this,pe),c.call(this,pe)}}function c(G,J){const pe=this.stack.pop(),me=this.tokenStack.pop();if(me)me[0].type!==G.type&&(J?J.call(this,G,me[0]):(me[1]||p_).call(this,G,me[0]));else throw new Error("Cannot close `"+G.type+"` ("+ma({start:G.start,end:G.end})+"): it’s not open");pe.position.end=Dr(G.end)}function m(){return V8(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function p(G){if(this.data.expectingFirstListItemValue){const J=this.stack[this.stack.length-2];J.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function g(){const G=this.resume(),J=this.stack[this.stack.length-1];J.lang=G}function y(){const G=this.resume(),J=this.stack[this.stack.length-1];J.meta=G}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function h(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function f(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G.replace(/(\r?\n|\r)$/g,"")}function d(G){const J=this.resume(),pe=this.stack[this.stack.length-1];pe.label=J,pe.identifier=js(this.sliceSerialize(G)).toLowerCase()}function v(){const G=this.resume(),J=this.stack[this.stack.length-1];J.title=G}function b(){const G=this.resume(),J=this.stack[this.stack.length-1];J.url=G}function E(G){const J=this.stack[this.stack.length-1];if(!J.depth){const pe=this.sliceSerialize(G).length;J.depth=pe}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function R(G){const J=this.stack[this.stack.length-1];J.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function k(G){const pe=this.stack[this.stack.length-1].children;let me=pe[pe.length-1];(!me||me.type!=="text")&&(me=se(),me.position={start:Dr(G.start),end:void 0},pe.push(me)),this.stack.push(me)}function L(G){const J=this.stack.pop();J.value+=this.sliceSerialize(G),J.position.end=Dr(G.end)}function A(G){const J=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=J.children[J.children.length-1];pe.position.end=Dr(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(J.type)&&(k.call(this,G),L.call(this,G))}function D(){this.data.atHardBreak=!0}function P(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G}function $(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G}function I(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G}function F(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=J,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function U(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=J,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function j(G){const J=this.sliceSerialize(G),pe=this.stack[this.stack.length-2];pe.label=UM(J),pe.identifier=js(J).toLowerCase()}function T(){const G=this.stack[this.stack.length-1],J=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const me=G.children;pe.children=me}else pe.alt=J}function M(){const G=this.resume(),J=this.stack[this.stack.length-1];J.url=G}function B(){const G=this.resume(),J=this.stack[this.stack.length-1];J.title=G}function z(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function X(G){const J=this.resume(),pe=this.stack[this.stack.length-1];pe.label=J,pe.identifier=js(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function re(G){this.data.characterReferenceType=G.type}function H(G){const J=this.sliceSerialize(G),pe=this.data.characterReferenceType;let me;pe?(me=Vx(J,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):me=ng(J);const we=this.stack.pop();we.value+=me,we.position.end=Dr(G.end)}function W(G){L.call(this,G);const J=this.stack[this.stack.length-1];J.url=this.sliceSerialize(G)}function N(G){L.call(this,G);const J=this.stack[this.stack.length-1];J.url="mailto:"+this.sliceSerialize(G)}function K(){return{type:"blockquote",children:[]}}function Q(){return{type:"code",lang:null,meta:null,value:""}}function q(){return{type:"inlineCode",value:""}}function de(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function he(){return{type:"emphasis",children:[]}}function le(){return{type:"heading",depth:0,children:[]}}function Ae(){return{type:"break"}}function Be(){return{type:"html",value:""}}function ue(){return{type:"image",title:null,url:"",alt:null}}function Ct(){return{type:"link",title:null,url:"",children:[]}}function Sn(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function Ee(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function _e(){return{type:"paragraph",children:[]}}function Ce(){return{type:"strong",children:[]}}function se(){return{type:"text",value:""}}function Re(){return{type:"thematicBreak"}}}function Dr(e){return{line:e.line,column:e.column,offset:e.offset}}function rS(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?rS(e,r):qM(e,r)}}function qM(e,t){let n;for(n in t)if(nS.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 p_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ma({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ma({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ma({start:t.start,end:t.end})+") is still open")}function GM(e){const t=this;t.parser=n;function n(r){return VM(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function YM(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 XM(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function QM(e,t){const n=t.value?t.value+`
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function JM(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZM(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eA(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Lo(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function tA(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 nA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function iS(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 a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function rA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return iS(e,t);const i={src:Lo(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 iA(e,t){const n={src:Lo(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 sA(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 oA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return iS(e,t);const i={href:Lo(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 aA(e,t){const n={href:Lo(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 lA(e,t,n){const r=e.all(t),i=n?cA(n):sS(t),o={},a=[];if(typeof t.checked=="boolean"){const m=r[0];let u;m&&m.type==="element"&&m.tagName==="p"?u=m:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const m=r[s];(i||s!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
`}),m.type==="element"&&m.tagName==="p"&&!i?a.push(...m.children):a.push(m)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function cA(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=sS(n[r])}return t}function sS(e){const t=e.spread;return t??e.children.length>1}function uA(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 a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.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 hA(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function fA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pA(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=eg(t.children[1]),l=zx(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function mA(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const u=t.children[l],p={},g=a?a[l]:void 0;g&&(p.align=g);let y={type:"element",tagName:o,properties:p,children:[]};u&&(y.children=e.all(u),e.patch(u,y),y=e.applyData(u,y)),c.push(y)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,m),e.applyData(t,m)}function gA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const m_=9,g_=32;function vA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(v_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(v_(t.slice(i),i>0,!1)),o.join("")}function v_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===m_||o===g_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===m_||o===g_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _A(e,t){const n={type:"text",value:vA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const wA={blockquote:YM,break:XM,code:QM,delete:JM,emphasis:ZM,footnoteReference:eA,heading:tA,html:nA,imageReference:rA,image:iA,inlineCode:sA,linkReference:oA,link:aA,listItem:lA,list:uA,paragraph:hA,root:dA,strong:fA,table:pA,tableCell:gA,tableRow:mA,text:_A,thematicBreak:yA,toml:Ql,yaml:Ql,definition:Ql,footnoteDefinition:Ql};function Ql(){}const oS=-1,uh=0,gu=1,vu=2,sg=3,og=4,ag=5,lg=6,aS=7,lS=8,__=typeof self=="object"?self:globalThis,bA=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case uh:case oS:return n(a,i);case gu:{const s=n([],i);for(const l of a)s.push(r(l));return s}case vu:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case sg:return n(new Date(a),i);case og:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case ag:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case lg:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case aS:{const{name:s,message:l}=a;return n(new __[s](l),i)}case lS:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new __[o](a),i)};return r},y_=e=>bA(new Map,e)(0),hs="",{toString:xA}={},{keys:SA}=Object,qo=e=>{const t=typeof e;if(t!=="object"||!e)return[uh,t];const n=xA.call(e).slice(8,-1);switch(n){case"Array":return[gu,hs];case"Object":return[vu,hs];case"Date":return[sg,hs];case"RegExp":return[og,hs];case"Map":return[ag,hs];case"Set":return[lg,hs]}return n.includes("Array")?[gu,n]:n.includes("Error")?[aS,n]:[vu,n]},Jl=([e,t])=>e===uh&&(t==="function"||t==="symbol"),CA=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=qo(a);switch(s){case uh:{let m=a;switch(l){case"bigint":s=lS,m=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);m=null;break;case"undefined":return i([oS],a)}return i([s,m],a)}case gu:{if(l)return i([l,[...a]],a);const m=[],u=i([s,m],a);for(const p of a)m.push(o(p));return u}case vu:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const m=[],u=i([s,m],a);for(const p of SA(a))(e||!Jl(qo(a[p])))&&m.push([o(p),o(a[p])]);return u}case sg:return i([s,a.toISOString()],a);case og:{const{source:m,flags:u}=a;return i([s,{source:m,flags:u}],a)}case ag:{const m=[],u=i([s,m],a);for(const[p,g]of a)(e||!(Jl(qo(p))||Jl(qo(g))))&&m.push([o(p),o(g)]);return u}case lg:{const m=[],u=i([s,m],a);for(const p of a)(e||!Jl(qo(p)))&&m.push(o(p));return u}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},w_=(e,{json:t,lossy:n}={})=>{const r=[];return CA(!(t||n),!!t,new Map,r)(e),r},_u=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?y_(w_(e,t)):structuredClone(e):(e,t)=>y_(w_(e,t));function EA(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 kA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function RA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||EA,r=e.options.footnoteBackLabel||kA,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const m=e.all(c),u=String(c.identifier).toUpperCase(),p=Lo(u.toLowerCase());let g=0;const y=[],_=e.footnoteCounts.get(u);for(;_!==void 0&&++g<=_;){y.length>0&&y.push({type:"text",value:" "});let d=typeof n=="string"?n:n(l,g);typeof d=="string"&&(d={type:"text",value:d}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,g),className:["data-footnote-backref"]},children:Array.isArray(d)?d:[d]})}const h=m[m.length-1];if(h&&h.type==="element"&&h.tagName==="p"){const d=h.children[h.children.length-1];d&&d.type==="text"?d.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...y)}else m.push(...y);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(m,!0)};e.patch(c,f),s.push(f)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{..._u(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
`}]}}const cS=function(e){if(e==null)return TA;if(typeof e=="function")return hh(e);if(typeof e=="object")return Array.isArray(e)?LA(e):MA(e);if(typeof e=="string")return AA(e);throw new Error("Expected function, string, or object as test")};function LA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=cS(e[n]);return hh(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function MA(e){const t=e;return hh(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function AA(e){return hh(t);function t(n){return n&&n.type===e}}function hh(e){return t;function t(n,r,i){return!!(DA(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function TA(){return!0}function DA(e){return e!==null&&typeof e=="object"&&"type"in e}const uS=[],PA=!0,b_=!1,$A="skip";function OA(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=cS(i),a=r?-1:1;s(e,void 0,[])();function s(l,c,m){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const g=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(g?"<"+g+">":""))+")"})}return p;function p(){let g=uS,y,_,h;if((!t||o(l,c,m[m.length-1]||void 0))&&(g=IA(n(l,m)),g[0]===b_))return g;if("children"in l&&l.children){const f=l;if(f.children&&g[0]!==$A)for(_=(r?f.children.length:-1)+a,h=m.concat(f);_>-1&&_<f.children.length;){const d=f.children[_];if(y=s(d,_,h)(),y[0]===b_)return y;_=typeof y[1]=="number"?y[1]:_+a}}return g}}}function IA(e){return Array.isArray(e)?e:typeof e=="number"?[PA,e]:e==null?uS:[e]}function hS(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),OA(e,o,s,i);function s(l,c){const m=c[c.length-1],u=m?m.children.indexOf(l):void 0;return a(l,u,m)}}const ip={}.hasOwnProperty,NA={};function BA(e,t){const n=t||NA,r=new Map,i=new Map,o=new Map,a={...wA,...n.handlers},s={all:c,applyData:FA,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:jA,wrap:HA};return hS(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const u=m.type==="definition"?r:i,p=String(m.identifier).toUpperCase();u.has(p)||u.set(p,m)}}),s;function l(m,u){const p=m.type,g=s.handlers[p];if(ip.call(s.handlers,p)&&g)return g(s,m,u);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in m){const{children:_,...h}=m,f=_u(h);return f.children=s.all(m),f}return _u(m)}return(s.options.unknownHandler||zA)(s,m,u)}function c(m){const u=[];if("children"in m){const p=m.children;let g=-1;for(;++g<p.length;){const y=s.one(p[g],m);if(y){if(g&&p[g-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=x_(y.value)),!Array.isArray(y)&&y.type==="element")){const _=y.children[0];_&&_.type==="text"&&(_.value=x_(_.value))}Array.isArray(y)?u.push(...y):u.push(y)}}}return u}}function jA(e,t){e.position&&(t.position=R8(e))}function FA(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 a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,_u(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function zA(e,t){const n=t.data||{},r="value"in t&&!(ip.call(n,"hProperties")||ip.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 HA(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function x_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function S_(e,t){const n=BA(e,t),r=n.one(e,void 0),i=RA(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
`},i),o}function UA(e,t){return e&&"run"in e?async function(n,r){const i=S_(n,t);await e.run(i,r)}:function(n){return S_(n,t||e)}}function C_(e){if(e)throw e}var Rc=Object.prototype.hasOwnProperty,dS=Object.prototype.toString,E_=Object.defineProperty,k_=Object.getOwnPropertyDescriptor,R_=function(t){return typeof Array.isArray=="function"?Array.isArray(t):dS.call(t)==="[object Array]"},L_=function(t){if(!t||dS.call(t)!=="[object Object]")return!1;var n=Rc.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Rc.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Rc.call(t,i)},M_=function(t,n){E_&&n.name==="__proto__"?E_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},A_=function(t,n){if(n==="__proto__")if(Rc.call(t,n)){if(k_)return k_(t,n).value}else return;return t[n]},WA=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,m=!1;for(typeof s=="boolean"&&(m=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=A_(s,n),i=A_(t,n),s!==i&&(m&&i&&(L_(i)||(o=R_(i)))?(o?(o=!1,a=r&&R_(r)?r:[]):a=r&&L_(r)?r:{},M_(s,{name:n,newValue:e(m,a,i)})):typeof i<"u"&&M_(s,{name:n,newValue:i}));return s};const md=Tu(WA);function sp(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 VA(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const m=e[++o];let u=-1;if(l){a(l);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,m?KA(m,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function KA(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){const m=c;if(s&&n)throw m;return i(m)}s||(l instanceof Promise?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const zn={basename:qA,dirname:GA,extname:YA,join:XA,sep:"/"};function qA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pl(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 a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function GA(e){if(pl(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 YA(e){pl(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===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 XA(...e){let t=-1,n;for(;++t<e.length;)pl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":QA(n)}function QA(e){pl(e);const t=e.codePointAt(0)===47;let n=JA(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function JA(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-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(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function pl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ZA={cwd:eT};function eT(){return"/"}function op(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tT(e){if(typeof e=="string")e=new URL(e);else if(!op(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 nT(e)}function nT(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 gd=["history","path","basename","stem","extname","dirname"];class fS{constructor(t){let n;t?op(t)?n={path:t}:typeof t=="string"||rT(t)?n={value:t}:n=t:n={},this.cwd=ZA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<gd.length;){const o=gd[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)gd.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?zn.basename(this.path):void 0}set basename(t){_d(t,"basename"),vd(t,"basename"),this.path=zn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zn.dirname(this.path):void 0}set dirname(t){T_(this.basename,"dirname"),this.path=zn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zn.extname(this.path):void 0}set extname(t){if(vd(t,"extname"),T_(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=zn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){op(t)&&(t=tT(t)),_d(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zn.basename(this.path,this.extname):void 0}set stem(t){_d(t,"stem"),vd(t,"stem"),this.path=zn.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 At(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 vd(e,t){if(e&&e.includes(zn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zn.sep+"`")}function _d(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function T_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function rT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const iT=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};Object.setPrototypeOf(o,r);const a=Object.getOwnPropertyNames(i);for(const s of a){const l=Object.getOwnPropertyDescriptor(i,s);l&&Object.defineProperty(o,s,l)}return o},sT={}.hasOwnProperty;class cg extends iT{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=VA()}copy(){const t=new cg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(md(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(bd("data",this.frozen),this.namespace[t]=n,this):sT.call(this.namespace,t)&&this.namespace[t]||void 0:t?(bd("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=Zl(t),r=this.parser||this.Parser;return yd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),yd("process",this.parser||this.Parser),wd("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=Zl(t),l=r.parse(s);r.run(l,s,function(m,u,p){if(m||!u||!p)return c(m);const g=u,y=r.stringify(g,p);lT(y)?p.value=y:p.result=y,c(m,p)});function c(m,u){m||!u?a(m):o?o(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),yd("processSync",this.parser||this.Parser),wd("processSync",this.compiler||this.Compiler),this.process(t,i),P_("processSync","process",n),r;function i(o,a){n=!0,C_(o),r=a}}run(t,n,r){D_(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(a,s){const l=Zl(n);i.run(t,l,c);function c(m,u,p){const g=u||t;m?s(m):a?a(g):r(void 0,g,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),P_("runSync","run",r),i;function o(a,s){C_(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=Zl(n),i=this.compiler||this.Compiler;return wd("stringify",i),D_(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(bd("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[m,...u]=c;l(m,u)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))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");s(c.plugins),c.settings&&(i.settings=md(!0,i.settings,c.settings))}function s(c){let m=-1;if(c!=null)if(Array.isArray(c))for(;++m<c.length;){const u=c[m];o(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,m){let u=-1,p=-1;for(;++u<r.length;)if(r[u][0]===c){p=u;break}if(p===-1)r.push([c,...m]);else if(m.length>0){let[g,...y]=m;const _=r[p][1];sp(_)&&sp(g)&&(g=md(!0,_,g)),r[p]=[c,g,...y]}}}}const oT=new cg().freeze();function yd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function wd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function bd(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 D_(e){if(!sp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function P_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zl(e){return aT(e)?e:new fS(e)}function aT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lT(e){return typeof e=="string"||cT(e)}function cT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$_=[],O_={allowDangerousHtml:!0},hT=/^(https?|ircs?|mailto|xmpp)$/i,dT=[{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:"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 fT(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,s=e.rehypePlugins||$_,l=e.remarkPlugins||$_,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...O_}:O_,m=e.skipHtml,u=e.unwrapDisallowed,p=e.urlTransform||pT,g=oT().use(GM).use(l).use(UA,c).use(s),y=new fS;typeof r=="string"&&(y.value=r);for(const d of dT)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+uT+d.id,void 0);const _=g.parse(y);let h=g.runSync(_,y);return i&&(h={type:"element",tagName:"div",properties:{className:i},children:h.type==="root"?h.children:[h]}),hS(h,f),P8(h,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function f(d,v,b){if(d.type==="raw"&&b&&typeof v=="number")return m?b.children.splice(v,1):b.children[v]={type:"text",value:d.value},v;if(d.type==="element"){let E;for(E in dd)if(Object.hasOwn(dd,E)&&Object.hasOwn(d.properties,E)){const C=d.properties[E],R=dd[E];(R===null||R.includes(d.tagName))&&(d.properties[E]=p(String(C||""),E,d))}}if(d.type==="element"){let E=t?!t.includes(d.tagName):a?a.includes(d.tagName):!1;if(!E&&n&&typeof v=="number"&&(E=!n(d,v,b)),E&&b&&typeof v=="number")return u&&d.children?b.children.splice(v,1,...d.children):b.children.splice(v,1),v}}}function pT(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||hT.test(e.slice(0,t))?e:""}function mT({href:e,children:t}){const n=al()[1],r=e==null?void 0:e.startsWith("http"),i=()=>{e&&(r?xo(e):n(e??"/"))};return S.jsxs("button",{onClick:i,className:"text-accent no-underline hover:underline m-0",children:[t,r&&S.jsx(ix,{className:"inline ml-1 mb-1 h-5 [.prose-sm_&]:h-4 [.prose-sm_&]:ml-0"})]})}const gT={code:({children:e})=>S.jsx(mr,{className:"not-prose",children:e}),pre:({children:e})=>S.jsx("pre",{className:"not-prose bg-muted p-2 rounded",children:e}),a:({children:e,href:t})=>S.jsx(mT,{href:t,children:e})};function I_({md:e,isSmall:t,isTitle:n}){return S.jsx(fT,{components:gT,className:Z("prose prose-zinc dark:prose-invert",t&&"prose-sm",n&&"tracking-wide"),children:Z4(e.replace(/\n/g,`  
`))})}let vT={data:""},_T=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||vT,yT=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,wT=/\/\*[^]*?\*\/|  +/g,N_=/\n+/g,jr=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+a+";":r+=o[1]=="f"?jr(a,o):o+"{"+jr(a,o[1]=="k"?"":t)+"}":typeof a=="object"?r+=jr(a,t?t.replace(/([^,])+/g,s=>o.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,s):s?s+" "+l:l)):o):a!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=jr.p?jr.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},or={},pS=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+pS(e[n]);return t}return e},bT=(e,t,n,r,i)=>{let o=pS(e),a=or[o]||(or[o]=(l=>{let c=0,m=11;for(;c<l.length;)m=101*m+l.charCodeAt(c++)>>>0;return"go"+m})(o));if(!or[a]){let l=o!==e?e:(c=>{let m,u,p=[{}];for(;m=yT.exec(c.replace(wT,""));)m[4]?p.shift():m[3]?(u=m[3].replace(N_," ").trim(),p.unshift(p[0][u]=p[0][u]||{})):p[0][m[1]]=m[2].replace(N_," ").trim();return p[0]})(e);or[a]=jr(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let s=n&&or.g?or.g:null;return n&&(or.g=or[a]),((l,c,m,u)=>{u?c.data=c.data.replace(u,l):c.data.indexOf(l)===-1&&(c.data=m?l+c.data:c.data+l)})(or[a],t,r,s),a},xT=(e,t,n)=>e.reduce((r,i,o)=>{let a=t[o];if(a&&a.call){let s=a(n),l=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=l?"."+l:s&&typeof s=="object"?s.props?"":jr(s,""):s===!1?"":s}return r+i+(a??"")},"");function dh(e){let t=this||{},n=e.call?e(t.p):e;return bT(n.unshift?n.raw?xT(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,_T(t.target),t.g,t.o,t.k)}let mS,ap,lp;dh.bind({g:1});let br=dh.bind({k:1});function ST(e,t,n,r){jr.p=t,mS=e,ap=n,lp=r}function _i(e,t){let n=this||{};return function(){let r=arguments;function i(o,a){let s=Object.assign({},o),l=s.className||i.className;n.p=Object.assign({theme:ap&&ap()},s),n.o=/ *go\d+/.test(l),s.className=dh.apply(n,r)+(l?" "+l:""),t&&(s.ref=a);let c=e;return e[0]&&(c=s.as||e,delete s.as),lp&&c[0]&&lp(s),mS(c,s)}return t?t(i):i}}var CT=e=>typeof e=="function",yu=(e,t)=>CT(e)?e(t):e,ET=(()=>{let e=0;return()=>(++e).toString()})(),gS=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),kT=20,Lc=new Map,RT=1e3,B_=e=>{if(Lc.has(e))return;let t=setTimeout(()=>{Lc.delete(e),rs({type:4,toastId:e})},RT);Lc.set(e,t)},LT=e=>{let t=Lc.get(e);t&&clearTimeout(t)},cp=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,kT)};case 1:return t.toast.id&&LT(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?cp(e,{type:1,toast:n}):cp(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?B_(r):e.toasts.forEach(o=>{B_(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Mc=[],Ac={toasts:[],pausedAt:void 0},rs=e=>{Ac=cp(Ac,e),Mc.forEach(t=>{t(Ac)})},MT={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},AT=(e={})=>{let[t,n]=x.useState(Ac);x.useEffect(()=>(Mc.push(n),()=>{let i=Mc.indexOf(n);i>-1&&Mc.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,a;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||MT[i.type],style:{...e.style,...(a=e[i.type])==null?void 0:a.style,...i.style}}});return{...t,toasts:r}},TT=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||ET()}),ml=e=>(t,n)=>{let r=TT(t,e,n);return rs({type:2,toast:r}),r.id},Xt=(e,t)=>ml("blank")(e,t);Xt.error=ml("error");Xt.success=ml("success");Xt.loading=ml("loading");Xt.custom=ml("custom");Xt.dismiss=e=>{rs({type:3,toastId:e})};Xt.remove=e=>rs({type:4,toastId:e});Xt.promise=(e,t,n)=>{let r=Xt.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Xt.success(yu(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Xt.error(yu(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var DT=(e,t)=>{rs({type:1,toast:{id:e,height:t}})},PT=()=>{rs({type:5,time:Date.now()})},$T=e=>{let{toasts:t,pausedAt:n}=AT(e);x.useEffect(()=>{if(n)return;let o=Date.now(),a=t.map(s=>{if(s.duration===1/0)return;let l=(s.duration||0)+s.pauseDuration-(o-s.createdAt);if(l<0){s.visible&&Xt.dismiss(s.id);return}return setTimeout(()=>Xt.dismiss(s.id),l)});return()=>{a.forEach(s=>s&&clearTimeout(s))}},[t,n]);let r=x.useCallback(()=>{n&&rs({type:6,time:Date.now()})},[n]),i=x.useCallback((o,a)=>{let{reverseOrder:s=!1,gutter:l=8,defaultPosition:c}=a||{},m=t.filter(g=>(g.position||c)===(o.position||c)&&g.height),u=m.findIndex(g=>g.id===o.id),p=m.filter((g,y)=>y<u&&g.visible).length;return m.filter(g=>g.visible).slice(...s?[p+1]:[0,p]).reduce((g,y)=>g+(y.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:DT,startPause:PT,endPause:r,calculateOffset:i}}},OT=br`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,IT=br`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,NT=br`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,BT=_i("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${OT} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${IT} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${e=>e.secondary||"#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${NT} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,jT=br`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,FT=_i("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${e=>e.secondary||"#e0e0e0"};
  border-right-color: ${e=>e.primary||"#616161"};
  animation: ${jT} 1s linear infinite;
`,zT=br`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,HT=br`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,UT=_i("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${zT} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${HT} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${e=>e.secondary||"#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`,WT=_i("div")`
  position: absolute;
`,VT=_i("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,KT=br`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,qT=_i("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${KT} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,GT=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?x.createElement(qT,null,t):t:n==="blank"?null:x.createElement(VT,null,x.createElement(FT,{...r}),n!=="loading"&&x.createElement(WT,null,n==="error"?x.createElement(BT,{...r}):x.createElement(UT,{...r})))},YT=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,XT=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,QT="0%{opacity:0;} 100%{opacity:1;}",JT="0%{opacity:1;} 100%{opacity:0;}",ZT=_i("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`,eD=_i("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,tD=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=gS()?[QT,JT]:[YT(n),XT(n)];return{animation:t?`${br(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${br(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},nD=x.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?tD(e.position||t||"top-center",e.visible):{opacity:0},o=x.createElement(GT,{toast:e}),a=x.createElement(eD,{...e.ariaProps},yu(e.message,e));return x.createElement(ZT,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:o,message:a}):x.createElement(x.Fragment,null,o,a))});ST(x.createElement);var rD=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let o=x.useCallback(a=>{if(a){let s=()=>{let l=a.getBoundingClientRect().height;r(e,l)};s(),new MutationObserver(s).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return x.createElement("div",{ref:o,className:t,style:n},i)},iD=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:gS()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},sD=dh`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,ec=16,oD=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:a})=>{let{toasts:s,handlers:l}=$T(n);return x.createElement("div",{style:{position:"fixed",zIndex:9999,top:ec,left:ec,right:ec,bottom:ec,pointerEvents:"none",...o},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},s.map(c=>{let m=c.position||t,u=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),p=iD(m,u);return x.createElement(rD,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?sD:"",style:p},c.type==="custom"?yu(c.message,c):i?i(c):x.createElement(nD,{toast:c,position:m}))}))},wu=Xt;const aD=["default","loading","info","success","warning","error"],lD=gi(`max-w-xl w-full sm:w-auto sm:min-w-[28rem] relative overflow-hidden z-40
    p-3 pr-10 flex items-center justify-between space-x-4
    rounded-xl border shadow-lg transition-all pointer-events-none
    text-black/75 dark:text-white/90`,{variants:{type:{default:"dark:border-primary/25 bg-white dark:bg-secondary dark:text-secondary-foreground",loading:"dark:border-primary/25 bg-white dark:bg-secondary dark:text-secondary-foreground",info:"border-info/70 bg-info-hint",success:"border-success/70 bg-success-hint",warning:"border-warning/70 bg-warning-hint",error:"border-destructive/70 bg-destructive-hint"}},defaultVariants:{type:"default"}}),cD={default:S.jsx(wR,{className:"stroke-muted-foreground animate-toastbar-icon"}),loading:S.jsx(li,{className:"animate-spin"}),info:S.jsx(sx,{className:"stroke-info animate-toastbar-icon"}),success:S.jsx(yR,{className:"stroke-success animate-toastbar-icon"}),warning:S.jsx(hR,{className:"stroke-warning animate-toastbar-icon"}),error:S.jsx(dR,{className:"stroke-destructive animate-toastbar-icon"})},uD=({t:e,type:t,data:n})=>{const[r,i]=x.useState(0);return x.useEffect(()=>{let o=null;const a=()=>{o&&clearInterval(o)};return t==="loading"&&e.visible?o=setInterval(()=>{i(s=>s+1)},1e3):o&&a(),a},[t,e.visible]),S.jsxs("div",{className:Z(lD({type:t}),e.visible?"animate-toastbar-enter":"animate-toastbar-leave"),children:[S.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:t==="loading"&&r>5?S.jsx("div",{className:"min-w-[2.65rem] text-center bg-muted/75 rounded-full",children:S.jsxs("span",{className:"text-xs text-secondary-foreground",children:[r,"s"]})}):cD[t]}),S.jsxs("div",{className:"flex-grow",children:[typeof n=="string"?S.jsx("span",{className:"block whitespace-pre-line",children:n}):n.md?S.jsxs(S.Fragment,{children:[n.title?S.jsx(I_,{md:`**${n.title}**`,isSmall:!0,isTitle:!0}):null,S.jsx(I_,{md:n.msg,isSmall:!0})]}):S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"font-semibold mb-1",children:n.title}),S.jsx("span",{className:"block whitespace-pre-line",children:n.msg})]}),t==="error"&&S.jsxs("small",{className:"block text-xs tracking-wide text-muted-foreground",children:["For support, visit ",S.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",onClick:Oa,className:"font-semibold no-underline hover:underline m-0",children:"discord.gg/txAdmin"}),"."]})]}),S.jsxs("button",{onClick:()=>wu.dismiss(e.id),className:"absolute right-4 top-4 opacity-70",children:[S.jsx(dl,{className:"h-6 sm:w-6 md:h-5 md:w-5"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})};function hD(){return S.jsx(oD,{reverseOrder:!0,containerStyle:{top:"calc(4.5rem + 1px)",zIndex:60}})}const Si=(e,t,n={})=>(n.duration??(n.duration=e==="loading"?1/0:5e3),wu.custom(r=>S.jsx(uD,{t:r,type:e,data:t}),n)),dD=(e,t)=>Si(e.type,e,t),ln=Object.assign(dD,{default:(e,t)=>Si("default",e,t),loading:(e,t)=>Si("loading",e,t),info:(e,t)=>Si("info",e,t),success:(e,t)=>Si("success",e,t),warning:(e,t)=>Si("warning",e,t),error:(e,t)=>Si("error",e,t),dismiss:wu.dismiss,remove:wu.remove}),Mo=De(window.txConsts.preAuth),vS=De(e=>!!e(Mo)),fD=De(e=>{const t=e(Mo);return t?t.csrfToken:void 0}),pD=De(e=>{const t=e(Mo);if(t)return{permissions:t.permissions,isMaster:t.isMaster}}),mD=()=>Ge(vS),gD=()=>Ge(fD),vD=()=>Ne(Mo),nr=()=>{const e=Ge(pD);return{hasPerm:n=>{if(!e)return!1;try{return n==="master"?e.isMaster:e.isMaster||e.permissions.includes("all_permissions")||e.permissions.includes(n)}catch{return console.error(`Error validating permission '${n}' denied.`),!1}},isMaster:e?e.isMaster:!1}},ug=()=>{const e=Ne(Mo);return(t="unknown",n="unknown")=>{console.log(`Logout notice received from '${t}' for reason '${n}'. Wiping auth data.`),e(!1),window.history.replaceState(null,"","/login#expired")}},Ao=()=>{const[e,t]=mn(Mo),n=Qi({mutationKey:["auth"],mutationFn:()=>fetch("/auth/logout",{method:"POST"}).then(r=>r.json()),onSuccess:r=>{r.logout&&(t(!1),window.history.replaceState(null,"","/login#logout"))}});return{authData:e,setAuthData:t,logout:{mutate:n.mutate,isLoading:n.isPending}}},_D=Fb((e,t)=>{e(vS)||(console.info("[logoutWatcher] Logout Detected, closing all dialogs and modals."),t(ih,!1),t(sh,!1),t(oh,!1),t(Ym,!1),t(Xm,!1),t(Qm,!1),t(lh,!1),t(ts,null),ln.dismiss())});function xd({icon:e,title:t,disabled:n,onClick:r}){return S.jsxs("div",{className:Z("group bg-secondary xs:bg-transparent 2xl:hover:bg-secondary w-full rounded-lg px-1.5 py-2 cursor-pointer flex items-center justify-center",n&&"opacity-50 pointer-events-none"),onClick:()=>!n&&r(),children:[S.jsx(e,{className:"w-6 h-6 2xl:w-5 2xl:h-5 text-muted-foreground group-hover:scale-110 group-hover:text-secondary-foreground inline"}),S.jsx("span",{className:"hidden 2xl:inline ml-1 align-middle",children:t})]})}const yD=uL("liveConsoleCommandHistory",[]),wD=100;function bD(e){const[t,n]=mn(yD),[r,i]=x.useState(-1),o=x.useRef(""),a=x.useRef(null),{hasPerm:s}=nr(),l=s("console.write");x.useEffect(()=>{e.isConnected&&a.current&&a.current.focus()},[e.isConnected]);const c=()=>{if(!a.current)return;r===-1&&(o.current=a.current.value??"");const g=r+1;t[g]&&(a.current.value=t[g],i(g))},m=()=>{if(!a.current)return;const g=r-1;g===-1?(a.current.value=o.current,i(g)):t[g]&&(a.current.value=t[g],i(g))},u=()=>{if(!a.current)return;const g=a.current.value.trim();if(i(-1),a.current.value="",o.current="",g){const y=t.filter(_=>_!==g);y.unshift(g),y.length>wD&&y.pop(),n(y),e.consoleWrite(g)}},p=g=>{e.isConnected&&(g.key==="ArrowUp"?(c(),g.preventDefault()):g.key==="ArrowDown"?(m(),g.preventDefault()):g.key==="Enter"&&(u(),g.preventDefault()))};return S.jsxs("div",{className:"flex flex-col xs:flex-row xs:items-center gap-2 px-1 sm:px-4 py-2 border-t justify-center",children:[S.jsxs("div",{className:"flex items-center grow",children:[S.jsx("svg",{className:"hidden sm:block w-4 h-4 mr-2 text-warning-inline shrink-0",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:S.jsx("path",{d:"m9 18 6-6-6-6"})}),S.jsx(mt,{ref:a,className:"w-full",placeholder:"Type a command...",type:"text",disabled:!e.isConnected||!l,onKeyDown:p,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})]}),S.jsxs("div",{className:"flex flex-row justify-evenly gap-3 2xl:gap-1 select-none",children:[S.jsx(xd,{icon:JR,title:"Search",disabled:!e.isConnected,onClick:e.toggleSearchBar}),S.jsx(xd,{icon:rL,title:"Clear",disabled:!e.isConnected,onClick:e.consoleClear}),S.jsx(xd,{icon:AR,title:"Download",disabled:!e.isConnected,onClick:()=>{xo("/fxserver/downloadLog")}})]})]})}function xD(){return S.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:S.jsxs("div",{className:"flex items-center space-x-2",children:[S.jsxs("svg",{className:"w-4 h-4 text-green-500",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("polyline",{points:"4 17 10 11 4 5"}),S.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),S.jsx("p",{className:"font-mono text-sm",children:"Live Console"})]})})}function ds({title:e,onClick:t,isActive:n,children:r}){return S.jsx("button",{title:e,className:Z("rounded p-0.5","hover:bg-secondary-foreground hover:text-secondary","focus:outline-none focus:ring-1 focus:ring-secondary-foreground focus:ring-offset-1x focus:ring-offset-secondary-foreground",n&&"bg-muted-foreground text-secondary"),onClick:t,children:r})}const Sd="No results",SD={activeMatchBackground:"#FF00DC",activeMatchColorOverviewRuler:"#FF00DC",matchBackground:"#732268",matchOverviewRuler:"#732268"};function CD({show:e,setShow:t,searchAddon:n}){const[r,i]=x.useState(!1),[o,a]=x.useState(!1),[s,l]=x.useState(!1),c=x.useRef(null),[m,u]=x.useState(Sd),p=E=>{n.clearDecorations(),E&&u(E)},g=E=>({decorations:SD,caseSensitive:r,wholeWord:o,regex:s,...E});x.useEffect(()=>{var E;e?(E=c.current)==null||E.focus():p(Sd)},[e]),x.useEffect(()=>{if(!n)return;const E=n.onDidChangeResults(({resultIndex:C,resultCount:R})=>{u(C===-1?Sd:`${C+1}/${R}`)});return()=>{E.dispose()}},[]);const y=()=>{!c.current||!c.current.value||(console.log("backward search for",c.current.value),n.findPrevious(c.current.value,g()))},_=()=>{!c.current||!c.current.value||(console.log("forward search for",c.current.value),n.findNext(c.current.value,g()))},h=E=>{c.current&&(console.log("search input keydown",E.code),E.code==="Enter"&&(E.shiftKey?y():_(),E.preventDefault()))},f=E=>{c.current&&_()},d=()=>{c.current&&(i(!r),p(),n.findNext(c.current.value,g({caseSensitive:!r})))},v=()=>{c.current&&(a(!o),p(),n.findNext(c.current.value,g({wholeWord:!o})))},b=()=>{c.current&&(l(!s),p(),n.findNext(c.current.value,g({regex:!s})))};return Yi("message",E=>{var C;E.data.type==="liveConsoleSearchHotkey"&&(E.data.action==="previous"?y():E.data.action==="next"?_():E.data.action==="focus"&&((C=c.current)==null||C.focus()))}),e?S.jsxs("div",{className:"absolute top-0 xs:right-4 bg-secondary border z-10 flex items-center justify-center gap-1 xs:gap-4 shadow-xl p-1 rounded-b-lg border-t-0 w-full xs:w-auto flex-wrap",children:[S.jsxs("div",{className:"relative",children:[S.jsx(mt,{ref:c,className:"h-8",placeholder:"Search string",onKeyDown:h,onChange:f,onBlur:()=>{n.clearActiveDecoration()}}),S.jsxs("div",{className:"absolute top-1/2 right-1 transform -translate-y-1/2 flex text-muted-foreground gap-2",children:[S.jsx(ds,{title:"Case Sensitive",isActive:r,onClick:d,children:S.jsx(_R,{className:"h-5 w-5"})}),S.jsx(ds,{title:"Whole Word",isActive:o,onClick:v,children:S.jsx(iL,{className:"h-5 w-5"})}),S.jsx(ds,{title:"Regex",isActive:s,onClick:b,children:S.jsx(XR,{className:"h-4 w-5"})})]})]}),S.jsx("div",{className:"flex grow text-sm text-muted-foreground whitespace-nowrap min-w-[8ch]",children:m}),S.jsxs("div",{className:"flex gap-2 text-muted-foreground",children:[S.jsx(ds,{title:"Previous",onClick:y,children:S.jsx(mR,{className:"h-5 w-5"})}),S.jsx(ds,{title:"Next",onClick:_,children:S.jsx(pR,{className:"h-5 w-5"})}),S.jsx(ds,{title:"Close",onClick:()=>{t(!1)},children:S.jsx(dl,{className:"h-5 w-5"})})]})]}):null}class ED{constructor(t,n){ls(this,"btnRef");ls(this,"containerElement");ls(this,"_disposables",[]);this.btnRef=t,this.containerElement=n}activate(t){if(!this.containerElement)throw new Error("containerElement is null");this.containerElement.addEventListener("wheel",i=>{this.checkViewportY(t)});const n=t.onScroll(()=>{this.checkViewportY(t)});this._disposables.push(n);const r=t.onLineFeed(()=>{this.checkViewportY(t)});this._disposables.push(r)}checkViewportY(t){t.buffer.active.viewportY===t.buffer.active.baseY?this.btnRef.classList.add("hidden"):this.btnRef.classList.remove("hidden")}dispose(){this._disposables.forEach(t=>t.dispose()),this._disposables.length=0}}const kD={background:"#222326",foreground:"#F8F8F8",black:"#000000",brightBlack:"#555555",red:"#D62341",brightRed:"#FF5370",green:"#9ECE58",brightGreen:"#C3E88D",yellow:"#FAED70",brightYellow:"#FFCB6B",blue:"#396FE2",brightBlue:"#82AAFF",magenta:"#BB80B3",brightMagenta:"#C792EA",cyan:"#2DDAFD",brightCyan:"#89DDFF",white:"#D0D0D0",brightWhite:"#FFFFFF"},RD={theme:kD,convertEol:!0,cursorBlink:!0,cursorStyle:"bar",disableStdin:!0,drawBoldTextInBrightColors:!1,fontFamily:"JetBrains Mono Variable, monospace",fontSize:14,lineHeight:1.1,fontWeight:"300",fontWeightBold:"600",letterSpacing:.8,scrollback:5e3,allowProposedApi:!0,allowTransparency:!0,overviewRulerWidth:15},Go=150;function LD(){const[e,t]=x.useState(!1),[n,r]=x.useState(!1),i=Hm(),o=zm();i("Live Console");const a=x.useRef(null),s=x.useRef(null),l=x.useMemo(()=>new iR.Terminal(RD),[]),c=x.useMemo(()=>new oR.FitAddon,[]),m=x.useMemo(()=>new aR.SearchAddon,[]),u=(E,C)=>{xo(C)},p=x.useMemo(()=>new lR.WebLinksAddon(u),[]),g=Ei(Go,E=>{window.postMessage({type:"liveConsoleSearchHotkey",action:E})},{noTrailing:!0}),y=()=>{if(!s.current||!l.element||!c){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const E=c.proposeDimensions();E?l.resize(E.cols,E.rows):console.log("refitTerminal: no proposed dimensions")};Yi("resize",tR(100,y)),x.useEffect(()=>{if(s.current&&a.current&&!l.element){console.log("live console xterm init"),s.current.innerHTML="",l.loadAddon(c),l.loadAddon(m),l.loadAddon(p),l.loadAddon(new sR.CanvasAddon),l.loadAddon(new ED(a.current,s.current)),l.open(s.current),l.write("\x1B[?25l"),y();const E=Ei(Go,()=>{l.scrollLines(Math.min(1,2-l.rows))},{noTrailing:!0}),C=Ei(Go,()=>{l.scrollLines(Math.max(1,l.rows-2))},{noTrailing:!0}),R=Ei(Go,()=>{l.scrollToTop()},{noTrailing:!0}),w=Ei(Go,()=>{l.scrollToBottom()},{noTrailing:!0});l.attachCustomKeyEventHandler(k=>k.code==="F5"||k.code==="Escape"||k.code==="KeyF"&&(k.ctrlKey||k.metaKey)||k.code==="F3"?!1:k.code==="KeyC"&&(k.ctrlKey||k.metaKey)?(document.execCommand("copy"),l.clearSelection(),!1):k.code==="PageUp"?(E(),!1):k.code==="PageDown"?(C(),!1):k.code==="Home"?(R(),!1):k.code==="End"?(w(),!1):!Yb(k))}},[l]),Yi("keydown",E=>{E.code==="F5"?(o(),E.preventDefault()):E.code==="Escape"?(m.clearDecorations(),r(!1)):E.code==="KeyF"&&(E.ctrlKey||E.metaKey)?(n?g("focus"):r(!0),E.preventDefault()):E.code==="F3"&&(g(E.shiftKey?"previous":"next"),E.preventDefault())});const _=x.useRef(0),h=x.useRef(null);x.useEffect(()=>(console.log("live console socket init"),h.current=wb(["liveconsole"]),h.current.on("connect",()=>{console.log("Live Console Socket.IO Connected."),t(!0)}),h.current.on("disconnect",E=>{console.log("Live Console Socket.IO Disonnected:",E);const C=_.current+1;_.current=C,setTimeout(()=>{_.current===C&&t(!1)},500)}),h.current.on("error",E=>{console.log("Live Console Socket.IO",E)}),h.current.on("consoleData",function(E){l.write(E)}),()=>{var E,C;(E=h.current)==null||E.removeAllListeners(),(C=h.current)==null||C.disconnect()}),[]);const f=E=>{!e||!h.current||h.current.emit("consoleCommand",E)},d=()=>{l.clear()},v=()=>{r(!n)},b=()=>{};return S.jsxs("div",{className:"dark text-primary flex flex-col h-full w-full bg-card border md:rounded-xl overflow-clip",children:[S.jsx(xD,{}),S.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[e?null:S.jsx("div",{className:"absolute inset-0 z-20 bg-black/40 backdrop-blur-sm flex items-center justify-center",children:S.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[S.jsx(li,{className:"w-16 h-16 animate-spin"}),S.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Connecting..."})]})}),S.jsx("div",{ref:s,className:"absolute top-1 left-2 right-0 bottom-0"}),S.jsx(CD,{show:n,setShow:r,searchAddon:m}),S.jsx("button",{ref:a,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{l.scrollToBottom()},children:S.jsx(CR,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]}),S.jsx(bD,{isConnected:e,consoleWrite:f,consoleClear:d,toggleSaveSheet:b,toggleSearchBar:v})]})}const MD=[{path:"/players",title:"Players",children:S.jsx(bt,{legacyUrl:"players"})},{path:"/whitelist",title:"Whitelist",children:S.jsx(bt,{legacyUrl:"whitelist"})},{path:"/admins",title:"Admins",children:S.jsx(bt,{legacyUrl:"adminManager"})},{path:"/settings",title:"Settings",children:S.jsx(bt,{legacyUrl:"settings"})},{path:"/system/master-actions",title:"Master Actions",children:S.jsx(bt,{legacyUrl:"masterActions"})},{path:"/system/diagnostics",title:"Diagnostics",children:S.jsx(bt,{legacyUrl:"diagnostics"})},{path:"/system/console-log",title:"Console Log",children:S.jsx(bt,{legacyUrl:"systemLog#nav-console"})},{path:"/system/system-logs",title:"System Logs",children:S.jsx(bt,{legacyUrl:"systemLog"})},{path:"/",title:"Dashboard",children:S.jsx(bt,{legacyUrl:"dashboard"})},{path:"/server/console",title:"Live Console",children:S.jsx(LD,{})},{path:"/server/console/old",title:"Old Live Console",children:S.jsx(bt,{legacyUrl:"console"})},{path:"/server/resources",title:"Resources",children:S.jsx(bt,{legacyUrl:"resources"})},{path:"/server/server-log",title:"Server Log",children:S.jsx(bt,{legacyUrl:"serverLog"})},{path:"/server/cfg-editor",title:"CFG Editor",children:S.jsx(bt,{legacyUrl:"cfgEditor"})},{path:"/server/setup",title:"Server Setup",children:S.jsx(bt,{legacyUrl:"setup"})},{path:"/server/deployer",title:"Server Deployer",children:S.jsx(bt,{legacyUrl:"deployer"})},{path:"/advanced",title:"Advanced",children:S.jsx(bt,{legacyUrl:"advanced"})}];function AD(e){return Hm()(e.title),S.jsx(Ci,{path:e.path,children:e.children})}function TD(){const e=Ne(qb),t=Ge(Kb);return S.jsx(W1,{FallbackComponent:N6,onError:()=>{console.log("Page ErrorBoundary caught an error"),e(!0)},onReset:()=>{console.log("Page ErrorBoundary reset"),Rm("/"),e(!1)},children:S.jsxs(Jw,{children:[MD.map(n=>S.jsx(AD,{path:n.path,title:n.title,children:n.children},n.path)),!1,S.jsx(Ci,{path:"/:fullPath*",component:rR})]})},t)}function xr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=DD({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Fe(n),l=x.useCallback(c=>{if(o){const u=typeof c=="function"?c(e):c;u!==e&&s(u)}else i(c)},[o,e,i,s]);return[a,l]}function DD({defaultProp:e,onChange:t}){const n=x.useState(e),[r]=n,i=x.useRef(r),o=Fe(t);return x.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}function gl(e){const t=e+"CollectionProvider",[n,r]=Ft(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:y,children:_}=g,h=ot.useRef(null),f=ot.useRef(new Map).current;return ot.createElement(i,{scope:y,itemMap:f,collectionRef:h},_)},s=e+"CollectionSlot",l=ot.forwardRef((g,y)=>{const{scope:_,children:h}=g,f=o(s,_),d=Se(y,f.collectionRef);return ot.createElement(ai,{ref:d},h)}),c=e+"CollectionItemSlot",m="data-radix-collection-item",u=ot.forwardRef((g,y)=>{const{scope:_,children:h,...f}=g,d=ot.useRef(null),v=Se(y,d),b=o(c,_);return ot.useEffect(()=>(b.itemMap.set(d,{ref:d,...f}),()=>void b.itemMap.delete(d))),ot.createElement(ai,{[m]:"",ref:v},h)});function p(g){const y=o(e+"CollectionConsumer",g);return ot.useCallback(()=>{const h=y.collectionRef.current;if(!h)return[];const f=Array.from(h.querySelectorAll(`[${m}]`));return Array.from(y.itemMap.values()).sort((b,E)=>f.indexOf(b.ref.current)-f.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:l,ItemSlot:u},p,r]}function PD(e,t=globalThis==null?void 0:globalThis.document){const n=Fe(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const up="dismissableLayer.update",$D="dismissableLayer.pointerDownOutside",OD="dismissableLayer.focusOutside";let j_;const ID=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vl=x.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,m=x.useContext(ID),[u,p]=x.useState(null),g=(n=u==null?void 0:u.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,y]=x.useState({}),_=Se(t,w=>p(w)),h=Array.from(m.layers),[f]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),d=h.indexOf(f),v=u?h.indexOf(u):-1,b=m.layersWithOutsidePointerEventsDisabled.size>0,E=v>=d,C=ND(w=>{const k=w.target,L=[...m.branches].some(A=>A.contains(k));!E||L||(o==null||o(w),s==null||s(w),w.defaultPrevented||l==null||l())},g),R=BD(w=>{const k=w.target;[...m.branches].some(A=>A.contains(k))||(a==null||a(w),s==null||s(w),w.defaultPrevented||l==null||l())},g);return PD(w=>{v===m.layers.size-1&&(i==null||i(w),!w.defaultPrevented&&l&&(w.preventDefault(),l()))},g),x.useEffect(()=>{if(u)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(j_=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(u)),m.layers.add(u),F_(),()=>{r&&m.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=j_)}},[u,g,r,m]),x.useEffect(()=>()=>{u&&(m.layers.delete(u),m.layersWithOutsidePointerEventsDisabled.delete(u),F_())},[u,m]),x.useEffect(()=>{const w=()=>y({});return document.addEventListener(up,w),()=>document.removeEventListener(up,w)},[]),x.createElement(fe.div,Y({},c,{ref:_,style:{pointerEvents:b?E?"auto":"none":void 0,...e.style},onFocusCapture:ne(e.onFocusCapture,R.onFocusCapture),onBlurCapture:ne(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:ne(e.onPointerDownCapture,C.onPointerDownCapture)}))});function ND(e,t=globalThis==null?void 0:globalThis.document){const n=Fe(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let c=function(){_S($D,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function BD(e,t=globalThis==null?void 0:globalThis.document){const n=Fe(e),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&_S(OD,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 F_(){const e=new CustomEvent(up);document.dispatchEvent(e)}function _S(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?cu(i,o):i.dispatchEvent(o)}let Cd=0;function hg(){x.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:z_()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:z_()),Cd++,()=>{Cd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Cd--}},[])}function z_(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const Ed="focusScope.autoFocusOnMount",kd="focusScope.autoFocusOnUnmount",H_={bubbles:!1,cancelable:!0},dg=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=x.useState(null),c=Fe(i),m=Fe(o),u=x.useRef(null),p=Se(t,_=>l(_)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let _=function(v){if(g.paused||!s)return;const b=v.target;s.contains(b)?u.current=b:$r(u.current,{select:!0})},h=function(v){if(g.paused||!s)return;const b=v.relatedTarget;b!==null&&(s.contains(b)||$r(u.current,{select:!0}))},f=function(v){if(document.activeElement===document.body)for(const E of v)E.removedNodes.length>0&&$r(s)};document.addEventListener("focusin",_),document.addEventListener("focusout",h);const d=new MutationObserver(f);return s&&d.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",h),d.disconnect()}}},[r,s,g.paused]),x.useEffect(()=>{if(s){W_.add(g);const _=document.activeElement;if(!s.contains(_)){const f=new CustomEvent(Ed,H_);s.addEventListener(Ed,c),s.dispatchEvent(f),f.defaultPrevented||(jD(WD(yS(s)),{select:!0}),document.activeElement===_&&$r(s))}return()=>{s.removeEventListener(Ed,c),setTimeout(()=>{const f=new CustomEvent(kd,H_);s.addEventListener(kd,m),s.dispatchEvent(f),f.defaultPrevented||$r(_??document.body,{select:!0}),s.removeEventListener(kd,m),W_.remove(g)},0)}}},[s,c,m,g]);const y=x.useCallback(_=>{if(!n&&!r||g.paused)return;const h=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,f=document.activeElement;if(h&&f){const d=_.currentTarget,[v,b]=FD(d);v&&b?!_.shiftKey&&f===b?(_.preventDefault(),n&&$r(v,{select:!0})):_.shiftKey&&f===v&&(_.preventDefault(),n&&$r(b,{select:!0})):f===d&&_.preventDefault()}},[n,r,g.paused]);return x.createElement(fe.div,Y({tabIndex:-1},a,{ref:p,onKeyDown:y}))});function jD(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if($r(r,{select:t}),document.activeElement!==n)return}function FD(e){const t=yS(e),n=U_(t,e),r=U_(t.reverse(),e);return[n,r]}function yS(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 U_(e,t){for(const n of e)if(!zD(n,{upTo:t}))return n}function zD(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 HD(e){return e instanceof HTMLInputElement&&"select"in e}function $r(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&HD(e)&&t&&e.select()}}const W_=UD();function UD(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=V_(e,t),e.unshift(t)},remove(t){var n;e=V_(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function V_(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function WD(e){return e.filter(t=>t.tagName!=="A")}const VD=H1.useId||(()=>{});let KD=0;function gn(e){const[t,n]=x.useState(VD());return rt(()=>{e||n(r=>r??String(KD++))},[e]),e||(t?`radix-${t}`:"")}const qD=["top","right","bottom","left"],ci=Math.min,qt=Math.max,bu=Math.round,tc=Math.floor,ui=e=>({x:e,y:e}),GD={left:"right",right:"left",bottom:"top",top:"bottom"},YD={start:"end",end:"start"};function hp(e,t,n){return qt(e,ci(t,n))}function Sr(e,t){return typeof e=="function"?e(t):e}function Cr(e){return e.split("-")[0]}function To(e){return e.split("-")[1]}function fg(e){return e==="x"?"y":"x"}function pg(e){return e==="y"?"height":"width"}function Do(e){return["top","bottom"].includes(Cr(e))?"y":"x"}function mg(e){return fg(Do(e))}function XD(e,t,n){n===void 0&&(n=!1);const r=To(e),i=mg(e),o=pg(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=xu(a)),[a,xu(a)]}function QD(e){const t=xu(e);return[dp(e),t,dp(t)]}function dp(e){return e.replace(/start|end/g,t=>YD[t])}function JD(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function ZD(e,t,n,r){const i=To(e);let o=JD(Cr(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(dp)))),o}function xu(e){return e.replace(/left|right|bottom|top/g,t=>GD[t])}function eP(e){return{top:0,right:0,bottom:0,left:0,...e}}function wS(e){return typeof e!="number"?eP(e):{top:e,right:e,bottom:e,left:e}}function Su(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function K_(e,t,n){let{reference:r,floating:i}=e;const o=Do(t),a=mg(t),s=pg(a),l=Cr(t),c=o==="y",m=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let g;switch(l){case"top":g={x:m,y:r.y-i.height};break;case"bottom":g={x:m,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-i.width,y:u};break;default:g={x:r.x,y:r.y}}switch(To(t)){case"start":g[a]-=p*(n&&c?-1:1);break;case"end":g[a]+=p*(n&&c?-1:1);break}return g}const tP=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:u}=K_(c,r,l),p=r,g={},y=0;for(let _=0;_<s.length;_++){const{name:h,fn:f}=s[_],{x:d,y:v,data:b,reset:E}=await f({x:m,y:u,initialPlacement:r,placement:p,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});if(m=d??m,u=v??u,g={...g,[h]:{...g[h],...b}},E&&y<=50){y++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:m,y:u}=K_(c,p,l)),_=-1;continue}}return{x:m,y:u,placement:p,strategy:i,middlewareData:g}};async function Na(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:m="viewport",elementContext:u="floating",altBoundary:p=!1,padding:g=0}=Sr(t,e),y=wS(g),h=s[p?u==="floating"?"reference":"floating":u],f=Su(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(h)))==null||n?h:h.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:m,strategy:l})),d=u==="floating"?{...a.floating,x:r,y:i}:a.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),b=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},E=Su(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:d,offsetParent:v,strategy:l}):d);return{top:(f.top-E.top+y.top)/b.y,bottom:(E.bottom-f.bottom+y.bottom)/b.y,left:(f.left-E.left+y.left)/b.x,right:(E.right-f.right+y.right)/b.x}}const nP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:m=0}=Sr(e,t)||{};if(c==null)return{};const u=wS(m),p={x:n,y:r},g=mg(i),y=pg(g),_=await a.getDimensions(c),h=g==="y",f=h?"top":"left",d=h?"bottom":"right",v=h?"clientHeight":"clientWidth",b=o.reference[y]+o.reference[g]-p[g]-o.floating[y],E=p[g]-o.reference[g],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let R=C?C[v]:0;(!R||!await(a.isElement==null?void 0:a.isElement(C)))&&(R=s.floating[v]||o.floating[y]);const w=b/2-E/2,k=R/2-_[y]/2-1,L=ci(u[f],k),A=ci(u[d],k),D=L,P=R-_[y]-A,$=R/2-_[y]/2+w,I=hp(D,$,P),F=!l.arrow&&To(i)!=null&&$!=I&&o.reference[y]/2-($<D?L:A)-_[y]/2<0,U=F?$<D?$-D:$-P:0;return{[g]:p[g]+U,data:{[g]:I,centerOffset:$-I-U,...F&&{alignmentOffset:U}},reset:F}}}),rP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:m=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:_=!0,...h}=Sr(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const f=Cr(i),d=Cr(s)===s,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),b=p||(d||!_?[xu(s)]:QD(s));!p&&y!=="none"&&b.push(...ZD(s,_,y,v));const E=[s,...b],C=await Na(t,h),R=[];let w=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&R.push(C[f]),u){const D=XD(i,a,v);R.push(C[D[0]],C[D[1]])}if(w=[...w,{placement:i,overflows:R}],!R.every(D=>D<=0)){var k,L;const D=(((k=o.flip)==null?void 0:k.index)||0)+1,P=E[D];if(P)return{data:{index:D,overflows:w},reset:{placement:P}};let $=(L=w.filter(I=>I.overflows[0]<=0).sort((I,F)=>I.overflows[1]-F.overflows[1])[0])==null?void 0:L.placement;if(!$)switch(g){case"bestFit":{var A;const I=(A=w.map(F=>[F.placement,F.overflows.filter(U=>U>0).reduce((U,j)=>U+j,0)]).sort((F,U)=>F[1]-U[1])[0])==null?void 0:A[0];I&&($=I);break}case"initialPlacement":$=s;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function q_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function G_(e){return qD.some(t=>e[t]>=0)}const iP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Sr(e,t);switch(r){case"referenceHidden":{const o=await Na(t,{...i,elementContext:"reference"}),a=q_(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:G_(a)}}}case"escaped":{const o=await Na(t,{...i,altBoundary:!0}),a=q_(o,n.floating);return{data:{escapedOffsets:a,escaped:G_(a)}}}default:return{}}}}};async function sP(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Cr(n),s=To(n),l=Do(n)==="y",c=["left","top"].includes(a)?-1:1,m=o&&l?-1:1,u=Sr(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return s&&typeof y=="number"&&(g=s==="end"?y*-1:y),l?{x:g*m,y:p*c}:{x:p*c,y:g*m}}const oP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await sP(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},aP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:h=>{let{x:f,y:d}=h;return{x:f,y:d}}},...l}=Sr(e,t),c={x:n,y:r},m=await Na(t,l),u=Do(Cr(i)),p=fg(u);let g=c[p],y=c[u];if(o){const h=p==="y"?"top":"left",f=p==="y"?"bottom":"right",d=g+m[h],v=g-m[f];g=hp(d,g,v)}if(a){const h=u==="y"?"top":"left",f=u==="y"?"bottom":"right",d=y+m[h],v=y-m[f];y=hp(d,y,v)}const _=s.fn({...t,[p]:g,[u]:y});return{..._,data:{x:_.x-n,y:_.y-r}}}}},lP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Sr(e,t),m={x:n,y:r},u=Do(i),p=fg(u);let g=m[p],y=m[u];const _=Sr(s,t),h=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(l){const v=p==="y"?"height":"width",b=o.reference[p]-o.floating[v]+h.mainAxis,E=o.reference[p]+o.reference[v]-h.mainAxis;g<b?g=b:g>E&&(g=E)}if(c){var f,d;const v=p==="y"?"width":"height",b=["top","left"].includes(Cr(i)),E=o.reference[u]-o.floating[v]+(b&&((f=a.offset)==null?void 0:f[u])||0)+(b?0:h.crossAxis),C=o.reference[u]+o.reference[v]+(b?0:((d=a.offset)==null?void 0:d[u])||0)-(b?h.crossAxis:0);y<E?y=E:y>C&&(y=C)}return{[p]:g,[u]:y}}}},cP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a=()=>{},...s}=Sr(e,t),l=await Na(t,s),c=Cr(n),m=To(n),u=Do(n)==="y",{width:p,height:g}=r.floating;let y,_;c==="top"||c==="bottom"?(y=c,_=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(_=c,y=m==="end"?"top":"bottom");const h=g-l[y],f=p-l[_],d=!t.middlewareData.shift;let v=h,b=f;if(u){const C=p-l.left-l.right;b=m||d?ci(f,C):C}else{const C=g-l.top-l.bottom;v=m||d?ci(h,C):C}if(d&&!m){const C=qt(l.left,0),R=qt(l.right,0),w=qt(l.top,0),k=qt(l.bottom,0);u?b=p-2*(C!==0||R!==0?C+R:qt(l.left,l.right)):v=g-2*(w!==0||k!==0?w+k:qt(l.top,l.bottom))}await a({...t,availableWidth:b,availableHeight:v});const E=await i.getDimensions(o.floating);return p!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function hi(e){return bS(e)?(e.nodeName||"").toLowerCase():"#document"}function Jt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lr(e){var t;return(t=(bS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bS(e){return e instanceof Node||e instanceof Jt(e).Node}function Er(e){return e instanceof Element||e instanceof Jt(e).Element}function tr(e){return e instanceof HTMLElement||e instanceof Jt(e).HTMLElement}function Y_(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jt(e).ShadowRoot}function _l(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=yn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function uP(e){return["table","td","th"].includes(hi(e))}function gg(e){const t=vg(),n=yn(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function hP(e){let t=po(e);for(;tr(t)&&!fh(t);){if(gg(t))return t;t=po(t)}return null}function vg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fh(e){return["html","body","#document"].includes(hi(e))}function yn(e){return Jt(e).getComputedStyle(e)}function ph(e){return Er(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function po(e){if(hi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Y_(e)&&e.host||Lr(e);return Y_(t)?t.host:t}function xS(e){const t=po(e);return fh(t)?e.ownerDocument?e.ownerDocument.body:e.body:tr(t)&&_l(t)?t:xS(t)}function Ba(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=xS(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Jt(i);return o?t.concat(a,a.visualViewport||[],_l(i)?i:[],a.frameElement&&n?Ba(a.frameElement):[]):t.concat(i,Ba(i,[],n))}function SS(e){const t=yn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=tr(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=bu(n)!==o||bu(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function _g(e){return Er(e)?e:e.contextElement}function Fs(e){const t=_g(e);if(!tr(t))return ui(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=SS(t);let a=(o?bu(n.width):n.width)/r,s=(o?bu(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const dP=ui(0);function CS(e){const t=Jt(e);return!vg()||!t.visualViewport?dP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jt(e)?!1:t}function Ji(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=_g(e);let a=ui(1);t&&(r?Er(r)&&(a=Fs(r)):a=Fs(e));const s=fP(o,n,r)?CS(o):ui(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,m=i.width/a.x,u=i.height/a.y;if(o){const p=Jt(o),g=r&&Er(r)?Jt(r):r;let y=p.frameElement;for(;y&&r&&g!==p;){const _=Fs(y),h=y.getBoundingClientRect(),f=yn(y),d=h.left+(y.clientLeft+parseFloat(f.paddingLeft))*_.x,v=h.top+(y.clientTop+parseFloat(f.paddingTop))*_.y;l*=_.x,c*=_.y,m*=_.x,u*=_.y,l+=d,c+=v,y=Jt(y).frameElement}}return Su({width:m,height:u,x:l,y:c})}function pP(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=tr(n),o=Lr(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s=ui(1);const l=ui(0);if((i||!i&&r!=="fixed")&&((hi(n)!=="body"||_l(o))&&(a=ph(n)),tr(n))){const c=Ji(n);s=Fs(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}}function mP(e){return Array.from(e.getClientRects())}function ES(e){return Ji(Lr(e)).left+ph(e).scrollLeft}function gP(e){const t=Lr(e),n=ph(e),r=e.ownerDocument.body,i=qt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=qt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ES(e);const s=-n.scrollTop;return yn(r).direction==="rtl"&&(a+=qt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function vP(e,t){const n=Jt(e),r=Lr(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const c=vg();(!c||c&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function _P(e,t){const n=Ji(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=tr(e)?Fs(e):ui(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function X_(e,t,n){let r;if(t==="viewport")r=vP(e,n);else if(t==="document")r=gP(Lr(e));else if(Er(t))r=_P(t,n);else{const i=CS(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Su(r)}function kS(e,t){const n=po(e);return n===t||!Er(n)||fh(n)?!1:yn(n).position==="fixed"||kS(n,t)}function yP(e,t){const n=t.get(e);if(n)return n;let r=Ba(e,[],!1).filter(s=>Er(s)&&hi(s)!=="body"),i=null;const o=yn(e).position==="fixed";let a=o?po(e):e;for(;Er(a)&&!fh(a);){const s=yn(a),l=gg(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||_l(a)&&!l&&kS(e,a))?r=r.filter(m=>m!==a):i=s,a=po(a)}return t.set(e,r),r}function wP(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?yP(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,m)=>{const u=X_(t,m,i);return c.top=qt(u.top,c.top),c.right=ci(u.right,c.right),c.bottom=ci(u.bottom,c.bottom),c.left=qt(u.left,c.left),c},X_(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function bP(e){const{width:t,height:n}=SS(e);return{width:t,height:n}}function xP(e,t,n){const r=tr(t),i=Lr(t),o=n==="fixed",a=Ji(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=ui(0);if(r||!r&&!o)if((hi(t)!=="body"||_l(i))&&(s=ph(t)),r){const c=Ji(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=ES(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Q_(e,t){return!tr(e)||yn(e).position==="fixed"?null:t?t(e):e.offsetParent}function RS(e,t){const n=Jt(e);if(!tr(e))return n;let r=Q_(e,t);for(;r&&uP(r)&&yn(r).position==="static";)r=Q_(r,t);return r&&(hi(r)==="html"||hi(r)==="body"&&yn(r).position==="static"&&!gg(r))?n:r||hP(e)||n}const SP=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||RS,o=this.getDimensions;return{reference:xP(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function CP(e){return yn(e).direction==="rtl"}const EP={convertOffsetParentRelativeRectToViewportRelativeRect:pP,getDocumentElement:Lr,getClippingRect:wP,getOffsetParent:RS,getElementRects:SP,getClientRects:mP,getDimensions:bP,getScale:Fs,isElement:Er,isRTL:CP};function kP(e,t){let n=null,r;const i=Lr(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:c,top:m,width:u,height:p}=e.getBoundingClientRect();if(s||t(),!u||!p)return;const g=tc(m),y=tc(i.clientWidth-(c+u)),_=tc(i.clientHeight-(m+p)),h=tc(c),d={rootMargin:-g+"px "+-y+"px "+-_+"px "+-h+"px",threshold:qt(0,ci(1,l))||1};let v=!0;function b(E){const C=E[0].intersectionRatio;if(C!==l){if(!v)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(b,{...d,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,d)}n.observe(e)}return a(!0),o}function RP(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=_g(e),m=i||o?[...c?Ba(c):[],...Ba(t)]:[];m.forEach(f=>{i&&f.addEventListener("scroll",n,{passive:!0}),o&&f.addEventListener("resize",n)});const u=c&&s?kP(c,n):null;let p=-1,g=null;a&&(g=new ResizeObserver(f=>{let[d]=f;d&&d.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let y,_=l?Ji(e):null;l&&h();function h(){const f=Ji(e);_&&(f.x!==_.x||f.y!==_.y||f.width!==_.width||f.height!==_.height)&&n(),_=f,y=requestAnimationFrame(h)}return n(),()=>{m.forEach(f=>{i&&f.removeEventListener("scroll",n),o&&f.removeEventListener("resize",n)}),u&&u(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(y)}}const LP=aP,MP=rP,AP=cP,TP=iP,J_=nP,DP=lP,PP=(e,t,n)=>{const r=new Map,i={platform:EP,...n},o={...i.platform,_c:r};return tP(e,t,{...i,platform:o})},$P=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?J_({element:r.current,padding:i}).fn(n):{}:r?J_({element:r,padding:i}).fn(n):{}}}};var Tc=typeof document<"u"?x.useLayoutEffect:x.useEffect;function Cu(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(!Cu(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)&&!Cu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function LS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Z_(e,t){const n=LS(e);return Math.round(t*n)/n}function e1(e){const t=x.useRef(e);return Tc(()=>{t.current=e}),t}function OP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[m,u]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=x.useState(r);Cu(p,r)||g(r);const[y,_]=x.useState(null),[h,f]=x.useState(null),d=x.useCallback(F=>{F!=C.current&&(C.current=F,_(F))},[_]),v=x.useCallback(F=>{F!==R.current&&(R.current=F,f(F))},[f]),b=o||y,E=a||h,C=x.useRef(null),R=x.useRef(null),w=x.useRef(m),k=e1(l),L=e1(i),A=x.useCallback(()=>{if(!C.current||!R.current)return;const F={placement:t,strategy:n,middleware:p};L.current&&(F.platform=L.current),PP(C.current,R.current,F).then(U=>{const j={...U,isPositioned:!0};D.current&&!Cu(w.current,j)&&(w.current=j,mi.flushSync(()=>{u(j)}))})},[p,t,n,L]);Tc(()=>{c===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,u(F=>({...F,isPositioned:!1})))},[c]);const D=x.useRef(!1);Tc(()=>(D.current=!0,()=>{D.current=!1}),[]),Tc(()=>{if(b&&(C.current=b),E&&(R.current=E),b&&E){if(k.current)return k.current(b,E,A);A()}},[b,E,A,k]);const P=x.useMemo(()=>({reference:C,floating:R,setReference:d,setFloating:v}),[d,v]),$=x.useMemo(()=>({reference:b,floating:E}),[b,E]),I=x.useMemo(()=>{const F={position:n,left:0,top:0};if(!$.floating)return F;const U=Z_($.floating,m.x),j=Z_($.floating,m.y);return s?{...F,transform:"translate("+U+"px, "+j+"px)",...LS($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:j}},[n,s,$.floating,m.x,m.y]);return x.useMemo(()=>({...m,update:A,refs:P,elements:$,floatingStyles:I}),[m,A,P,$,I])}function MS(e){const[t,n]=x.useState(void 0);return rt(()=>{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 a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const AS="Popper",[TS,Po]=Ft(AS),[IP,DS]=TS(AS),NP=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return x.createElement(IP,{scope:t,anchor:r,onAnchorChange:i},n)},BP="PopperAnchor",jP=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=DS(BP,n),a=x.useRef(null),s=Se(t,a);return x.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:x.createElement(fe.div,Y({},i,{ref:s}))}),PS="PopperContent",[FP,$j]=TS(PS),zP=x.forwardRef((e,t)=>{var n,r,i,o,a,s,l,c;const{__scopePopper:m,side:u="bottom",sideOffset:p=0,align:g="center",alignOffset:y=0,arrowPadding:_=0,avoidCollisions:h=!0,collisionBoundary:f=[],collisionPadding:d=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:E="optimized",onPlaced:C,...R}=e,w=DS(PS,m),[k,L]=x.useState(null),A=Se(t,Ae=>L(Ae)),[D,P]=x.useState(null),$=MS(D),I=(n=$==null?void 0:$.width)!==null&&n!==void 0?n:0,F=(r=$==null?void 0:$.height)!==null&&r!==void 0?r:0,U=u+(g!=="center"?"-"+g:""),j=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(f)?f:[f],M=T.length>0,B={padding:j,boundary:T.filter(HP),altBoundary:M},{refs:z,floatingStyles:O,placement:X,isPositioned:re,middlewareData:H}=OP({strategy:"fixed",placement:U,whileElementsMounted:(...Ae)=>RP(...Ae,{animationFrame:E==="always"}),elements:{reference:w.anchor},middleware:[oP({mainAxis:p+F,alignmentAxis:y}),h&&LP({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?DP():void 0,...B}),h&&MP({...B}),AP({...B,apply:({elements:Ae,rects:Be,availableWidth:ue,availableHeight:Ct})=>{const{width:Sn,height:Ee}=Be.reference,_e=Ae.floating.style;_e.setProperty("--radix-popper-available-width",`${ue}px`),_e.setProperty("--radix-popper-available-height",`${Ct}px`),_e.setProperty("--radix-popper-anchor-width",`${Sn}px`),_e.setProperty("--radix-popper-anchor-height",`${Ee}px`)}}),D&&$P({element:D,padding:_}),UP({arrowWidth:I,arrowHeight:F}),b&&TP({strategy:"referenceHidden",...B})]}),[W,N]=$S(X),K=Fe(C);rt(()=>{re&&(K==null||K())},[re,K]);const Q=(i=H.arrow)===null||i===void 0?void 0:i.x,q=(o=H.arrow)===null||o===void 0?void 0:o.y,de=((a=H.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[he,le]=x.useState();return rt(()=>{k&&le(window.getComputedStyle(k).zIndex)},[k]),x.createElement("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:re?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(s=H.transformOrigin)===null||s===void 0?void 0:s.x,(l=H.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},x.createElement(FP,{scope:m,placedSide:W,onArrowChange:P,arrowX:Q,arrowY:q,shouldHideArrow:de},x.createElement(fe.div,Y({"data-side":W,"data-align":N},R,{ref:A,style:{...R.style,animation:re?void 0:"none",opacity:(c=H.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function HP(e){return e!==null}const UP=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:c}=t,u=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=u?0:e.arrowWidth,g=u?0:e.arrowHeight,[y,_]=$S(s),h={start:"0%",center:"50%",end:"100%"}[_],f=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+p/2,d=((o=(a=c.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+g/2;let v="",b="";return y==="bottom"?(v=u?h:`${f}px`,b=`${-g}px`):y==="top"?(v=u?h:`${f}px`,b=`${l.floating.height+g}px`):y==="right"?(v=`${-g}px`,b=u?h:`${d}px`):y==="left"&&(v=`${l.floating.width+g}px`,b=u?h:`${d}px`),{data:{x:v,y:b}}}});function $S(e){const[t,n="center"]=e.split("-");return[t,n]}const yg=NP,wg=jP,bg=zP,xg=x.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?Gw.createPortal(x.createElement(fe.div,Y({},i,{ref:t})),r):null}),Rd="rovingFocusGroup.onEntryFocus",WP={bubbles:!1,cancelable:!0},Sg="RovingFocusGroup",[fp,OS,VP]=gl(Sg),[KP,mh]=Ft(Sg,[VP]),[qP,GP]=KP(Sg),YP=x.forwardRef((e,t)=>x.createElement(fp.Provider,{scope:e.__scopeRovingFocusGroup},x.createElement(fp.Slot,{scope:e.__scopeRovingFocusGroup},x.createElement(XP,Y({},e,{ref:t}))))),XP=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,...m}=e,u=x.useRef(null),p=Se(t,u),g=Co(o),[y=null,_]=xr({prop:a,defaultProp:s,onChange:l}),[h,f]=x.useState(!1),d=Fe(c),v=OS(n),b=x.useRef(!1),[E,C]=x.useState(0);return x.useEffect(()=>{const R=u.current;if(R)return R.addEventListener(Rd,d),()=>R.removeEventListener(Rd,d)},[d]),x.createElement(qP,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:y,onItemFocus:x.useCallback(R=>_(R),[_]),onItemShiftTab:x.useCallback(()=>f(!0),[]),onFocusableItemAdd:x.useCallback(()=>C(R=>R+1),[]),onFocusableItemRemove:x.useCallback(()=>C(R=>R-1),[])},x.createElement(fe.div,Y({tabIndex:h||E===0?-1:0,"data-orientation":r},m,{ref:p,style:{outline:"none",...e.style},onMouseDown:ne(e.onMouseDown,()=>{b.current=!0}),onFocus:ne(e.onFocus,R=>{const w=!b.current;if(R.target===R.currentTarget&&w&&!h){const k=new CustomEvent(Rd,WP);if(R.currentTarget.dispatchEvent(k),!k.defaultPrevented){const L=v().filter(I=>I.focusable),A=L.find(I=>I.active),D=L.find(I=>I.id===y),$=[A,D,...L].filter(Boolean).map(I=>I.ref.current);IS($)}}b.current=!1}),onBlur:ne(e.onBlur,()=>f(!1))})))}),QP="RovingFocusGroupItem",JP=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...a}=e,s=gn(),l=o||s,c=GP(QP,n),m=c.currentTabStopId===l,u=OS(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=c;return x.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),x.createElement(fp.ItemSlot,{scope:n,id:l,focusable:r,active:i},x.createElement(fe.span,Y({tabIndex:m?0:-1,"data-orientation":c.orientation},a,{ref:t,onMouseDown:ne(e.onMouseDown,y=>{r?c.onItemFocus(l):y.preventDefault()}),onFocus:ne(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ne(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const _=t$(y,c.orientation,c.dir);if(_!==void 0){y.preventDefault();let f=u().filter(d=>d.focusable).map(d=>d.ref.current);if(_==="last")f.reverse();else if(_==="prev"||_==="next"){_==="prev"&&f.reverse();const d=f.indexOf(y.currentTarget);f=c.loop?n$(f,d+1):f.slice(d+1)}setTimeout(()=>IS(f))}})})))}),ZP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function e$(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function t$(e,t,n){const r=e$(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ZP[r]}function IS(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function n$(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const NS=YP,BS=JP;var r$=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fs=new WeakMap,nc=new WeakMap,rc={},Ld=0,jS=function(e){return e&&(e.host||jS(e.parentNode))},i$=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jS(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})},s$=function(e,t,n,r){var i=i$(t,Array.isArray(e)?e:[e]);rc[n]||(rc[n]=new WeakMap);var o=rc[n],a=[],s=new Set,l=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var m=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))m(p);else{var g=p.getAttribute(r),y=g!==null&&g!=="false",_=(fs.get(p)||0)+1,h=(o.get(p)||0)+1;fs.set(p,_),o.set(p,h),a.push(p),_===1&&y&&nc.set(p,!0),h===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}})};return m(t),s.clear(),Ld++,function(){a.forEach(function(u){var p=fs.get(u)-1,g=o.get(u)-1;fs.set(u,p),o.set(u,g),p||(nc.has(u)||u.removeAttribute(r),nc.delete(u)),g||u.removeAttribute(n)}),Ld--,Ld||(fs=new WeakMap,fs=new WeakMap,nc=new WeakMap,rc={})}},Cg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||r$(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),s$(r,i,n,"aria-hidden")):function(){return null}},Gn=function(){return Gn=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},Gn.apply(this,arguments)};function FS(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 o$(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 Dc="right-scroll-bar-position",Pc="width-before-scroll-bar",a$="with-scroll-bars-hidden",l$="--removed-body-scroll-bar-size";function c$(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function u$(e,t){var n=x.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}function h$(e,t){return u$(t||null,function(n){return e.forEach(function(r){return c$(r,n)})})}function d$(e){return e}function f$(e,t){t===void 0&&(t=d$);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 a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var m=a;a=[],m.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(m){a.push(m),c()},filter:function(m){return a=a.filter(m),n}}}};return i}function p$(e){e===void 0&&(e={});var t=f$(null);return t.options=Gn({async:!0,ssr:!1},e),t}var zS=function(e){var t=e.sideCar,n=FS(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Gn({},n))};zS.isSideCarExport=!0;function m$(e,t){return e.useMedium(t),zS}var HS=p$(),Md=function(){},gh=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Md,onWheelCapture:Md,onTouchMoveCapture:Md}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,m=e.enabled,u=e.shards,p=e.sideCar,g=e.noIsolation,y=e.inert,_=e.allowPinchZoom,h=e.as,f=h===void 0?"div":h,d=FS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),v=p,b=h$([n,t]),E=Gn(Gn({},d),i);return x.createElement(x.Fragment,null,m&&x.createElement(v,{sideCar:HS,removeScrollBar:c,shards:u,noIsolation:g,inert:y,setCallbacks:o,allowPinchZoom:!!_,lockRef:n}),a?x.cloneElement(x.Children.only(s),Gn(Gn({},E),{ref:b})):x.createElement(f,Gn({},E,{className:l,ref:b}),s))});gh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gh.classNames={fullWidth:Pc,zeroRight:Dc};var g$=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function v$(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=g$();return t&&e.setAttribute("nonce",t),e}function _$(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function y$(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var w$=function(){var e=0,t=null;return{add:function(n){e==0&&(t=v$())&&(_$(t,n),y$(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b$=function(){var e=w$();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},US=function(){var e=b$(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},x$={left:0,top:0,right:0,gap:0},Ad=function(e){return parseInt(e||"",10)||0},S$=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[Ad(n),Ad(r),Ad(i)]},C$=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return x$;var t=S$(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])}},E$=US(),k$=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(a$,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(s,"px ").concat(r,`;
  }
  body {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(o,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(s,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(Dc,` {
    right: `).concat(s,"px ").concat(r,`;
  }
  
  .`).concat(Pc,` {
    margin-right: `).concat(s,"px ").concat(r,`;
  }
  
  .`).concat(Dc," .").concat(Dc,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Pc," .").concat(Pc,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body {
    `).concat(l$,": ").concat(s,`px;
  }
`)},R$=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=x.useMemo(function(){return C$(i)},[i]);return x.createElement(E$,{styles:k$(o,!t,i,n?"":"!important")})},pp=!1;if(typeof window<"u")try{var ic=Object.defineProperty({},"passive",{get:function(){return pp=!0,!0}});window.addEventListener("test",ic,ic),window.removeEventListener("test",ic,ic)}catch{pp=!1}var ps=pp?{passive:!1}:!1,L$=function(e){return e.tagName==="TEXTAREA"},WS=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!L$(e)&&n[t]==="visible")},M$=function(e){return WS(e,"overflowY")},A$=function(e){return WS(e,"overflowX")},t1=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=VS(e,n);if(r){var i=KS(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},T$=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},D$=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},VS=function(e,t){return e==="v"?M$(t):A$(t)},KS=function(e,t){return e==="v"?T$(t):D$(t)},P$=function(e,t){return e==="h"&&t==="rtl"?-1:1},$$=function(e,t,n,r,i){var o=P$(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,m=a>0,u=0,p=0;do{var g=KS(e,s),y=g[0],_=g[1],h=g[2],f=_-h-o*y;(y||f)&&VS(e,s)&&(u+=f,p+=y),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(m&&(i&&u===0||!i&&a>u)||!m&&(i&&p===0||!i&&-a>p))&&(c=!0),c},sc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},n1=function(e){return[e.deltaX,e.deltaY]},r1=function(e){return e&&"current"in e?e.current:e},O$=function(e,t){return e[0]===t[0]&&e[1]===t[1]},I$=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},N$=0,ms=[];function B$(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(N$++)[0],o=x.useState(function(){return US()})[0],a=x.useRef(e);x.useEffect(function(){a.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var _=o$([e.lockRef.current],(e.shards||[]).map(r1),!0).filter(Boolean);return _.forEach(function(h){return h.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),_.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=x.useCallback(function(_,h){if("touches"in _&&_.touches.length===2)return!a.current.allowPinchZoom;var f=sc(_),d=n.current,v="deltaX"in _?_.deltaX:d[0]-f[0],b="deltaY"in _?_.deltaY:d[1]-f[1],E,C=_.target,R=Math.abs(v)>Math.abs(b)?"h":"v";if("touches"in _&&R==="h"&&C.type==="range")return!1;var w=t1(R,C);if(!w)return!0;if(w?E=R:(E=R==="v"?"h":"v",w=t1(R,C)),!w)return!1;if(!r.current&&"changedTouches"in _&&(v||b)&&(r.current=E),!E)return!0;var k=r.current||E;return $$(k,h,_,k==="h"?v:b,!0)},[]),l=x.useCallback(function(_){var h=_;if(!(!ms.length||ms[ms.length-1]!==o)){var f="deltaY"in h?n1(h):sc(h),d=t.current.filter(function(E){return E.name===h.type&&E.target===h.target&&O$(E.delta,f)})[0];if(d&&d.should){h.cancelable&&h.preventDefault();return}if(!d){var v=(a.current.shards||[]).map(r1).filter(Boolean).filter(function(E){return E.contains(h.target)}),b=v.length>0?s(h,v[0]):!a.current.noIsolation;b&&h.cancelable&&h.preventDefault()}}},[]),c=x.useCallback(function(_,h,f,d){var v={name:_,delta:h,target:f,should:d};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(b){return b!==v})},1)},[]),m=x.useCallback(function(_){n.current=sc(_),r.current=void 0},[]),u=x.useCallback(function(_){c(_.type,n1(_),_.target,s(_,e.lockRef.current))},[]),p=x.useCallback(function(_){c(_.type,sc(_),_.target,s(_,e.lockRef.current))},[]);x.useEffect(function(){return ms.push(o),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ps),document.addEventListener("touchmove",l,ps),document.addEventListener("touchstart",m,ps),function(){ms=ms.filter(function(_){return _!==o}),document.removeEventListener("wheel",l,ps),document.removeEventListener("touchmove",l,ps),document.removeEventListener("touchstart",m,ps)}},[]);var g=e.removeScrollBar,y=e.inert;return x.createElement(x.Fragment,null,y?x.createElement(o,{styles:I$(i)}):null,g?x.createElement(R$,{gapMode:"margin"}):null)}const j$=m$(HS,B$);var qS=x.forwardRef(function(e,t){return x.createElement(gh,Gn({},e,{ref:t,sideCar:j$}))});qS.classNames=gh.classNames;const Eg=qS,mp=["Enter"," "],F$=["ArrowDown","PageUp","Home"],GS=["ArrowUp","PageDown","End"],z$=[...F$,...GS],H$={ltr:[...mp,"ArrowRight"],rtl:[...mp,"ArrowLeft"]},U$={ltr:["ArrowLeft"],rtl:["ArrowRight"]},vh="Menu",[ja,W$,V$]=gl(vh),[is,YS]=Ft(vh,[V$,Po,mh]),kg=Po(),XS=mh(),[K$,ss]=is(vh),[q$,yl]=is(vh),G$=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=kg(t),[l,c]=x.useState(null),m=x.useRef(!1),u=Fe(o),p=Co(i);return x.useEffect(()=>{const g=()=>{m.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>m.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),x.createElement(yg,s,x.createElement(K$,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c},x.createElement(q$,{scope:t,onClose:x.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:m,dir:p,modal:a},r)))},QS=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=kg(n);return x.createElement(wg,Y({},i,r,{ref:t}))}),JS="MenuPortal",[Y$,ZS]=is(JS,{forceMount:void 0}),X$=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=ss(JS,t);return x.createElement(Y$,{scope:t,forceMount:n},x.createElement(ut,{present:n||o.open},x.createElement(xg,{asChild:!0,container:i},r)))},$n="MenuContent",[Q$,Rg]=is($n),J$=x.forwardRef((e,t)=>{const n=ZS($n,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ss($n,e.__scopeMenu),a=yl($n,e.__scopeMenu);return x.createElement(ja.Provider,{scope:e.__scopeMenu},x.createElement(ut,{present:r||o.open},x.createElement(ja.Slot,{scope:e.__scopeMenu},a.modal?x.createElement(Z$,Y({},i,{ref:t})):x.createElement(eO,Y({},i,{ref:t})))))}),Z$=x.forwardRef((e,t)=>{const n=ss($n,e.__scopeMenu),r=x.useRef(null),i=Se(t,r);return x.useEffect(()=>{const o=r.current;if(o)return Cg(o)},[]),x.createElement(Lg,Y({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ne(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),eO=x.forwardRef((e,t)=>{const n=ss($n,e.__scopeMenu);return x.createElement(Lg,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Lg=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:m,onFocusOutside:u,onInteractOutside:p,onDismiss:g,disableOutsideScroll:y,..._}=e,h=ss($n,n),f=yl($n,n),d=kg(n),v=XS(n),b=W$(n),[E,C]=x.useState(null),R=x.useRef(null),w=Se(t,R,h.onContentChange),k=x.useRef(0),L=x.useRef(""),A=x.useRef(0),D=x.useRef(null),P=x.useRef("right"),$=x.useRef(0),I=y?Eg:x.Fragment,F=y?{as:ai,allowPinchZoom:!0}:void 0,U=T=>{var M,B;const z=L.current+T,O=b().filter(K=>!K.disabled),X=document.activeElement,re=(M=O.find(K=>K.ref.current===X))===null||M===void 0?void 0:M.textValue,H=O.map(K=>K.textValue),W=gO(H,z,re),N=(B=O.find(K=>K.textValue===W))===null||B===void 0?void 0:B.ref.current;(function K(Q){L.current=Q,window.clearTimeout(k.current),Q!==""&&(k.current=window.setTimeout(()=>K(""),1e3))})(z),N&&setTimeout(()=>N.focus())};x.useEffect(()=>()=>window.clearTimeout(k.current),[]),hg();const j=x.useCallback(T=>{var M,B;return P.current===((M=D.current)===null||M===void 0?void 0:M.side)&&_O(T,(B=D.current)===null||B===void 0?void 0:B.area)},[]);return x.createElement(Q$,{scope:n,searchRef:L,onItemEnter:x.useCallback(T=>{j(T)&&T.preventDefault()},[j]),onItemLeave:x.useCallback(T=>{var M;j(T)||((M=R.current)===null||M===void 0||M.focus(),C(null))},[j]),onTriggerLeave:x.useCallback(T=>{j(T)&&T.preventDefault()},[j]),pointerGraceTimerRef:A,onPointerGraceIntentChange:x.useCallback(T=>{D.current=T},[])},x.createElement(I,F,x.createElement(dg,{asChild:!0,trapped:i,onMountAutoFocus:ne(o,T=>{var M;T.preventDefault(),(M=R.current)===null||M===void 0||M.focus()}),onUnmountAutoFocus:a},x.createElement(vl,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:m,onFocusOutside:u,onInteractOutside:p,onDismiss:g},x.createElement(NS,Y({asChild:!0},v,{dir:f.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:ne(l,T=>{f.isUsingKeyboardRef.current||T.preventDefault()})}),x.createElement(bg,Y({role:"menu","aria-orientation":"vertical","data-state":iC(h.open),"data-radix-menu-content":"",dir:f.dir},d,_,{ref:w,style:{outline:"none",..._.style},onKeyDown:ne(_.onKeyDown,T=>{const B=T.target.closest("[data-radix-menu-content]")===T.currentTarget,z=T.ctrlKey||T.altKey||T.metaKey,O=T.key.length===1;B&&(T.key==="Tab"&&T.preventDefault(),!z&&O&&U(T.key));const X=R.current;if(T.target!==X||!z$.includes(T.key))return;T.preventDefault();const H=b().filter(W=>!W.disabled).map(W=>W.ref.current);GS.includes(T.key)&&H.reverse(),pO(H)}),onBlur:ne(e.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(k.current),L.current="")}),onPointerMove:ne(e.onPointerMove,Fa(T=>{const M=T.target,B=$.current!==T.clientX;if(T.currentTarget.contains(M)&&B){const z=T.clientX>$.current?"right":"left";P.current=z,$.current=T.clientX}}))})))))))}),tO=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.createElement(fe.div,Y({},r,{ref:t}))}),gp="MenuItem",i1="menu.itemSelect",Mg=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=x.useRef(null),a=yl(gp,e.__scopeMenu),s=Rg(gp,e.__scopeMenu),l=Se(t,o),c=x.useRef(!1),m=()=>{const u=o.current;if(!n&&u){const p=new CustomEvent(i1,{bubbles:!0,cancelable:!0});u.addEventListener(i1,g=>r==null?void 0:r(g),{once:!0}),cu(u,p),p.defaultPrevented?c.current=!1:a.onClose()}};return x.createElement(eC,Y({},i,{ref:l,disabled:n,onClick:ne(e.onClick,m),onPointerDown:u=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,u),c.current=!0},onPointerUp:ne(e.onPointerUp,u=>{var p;c.current||(p=u.currentTarget)===null||p===void 0||p.click()}),onKeyDown:ne(e.onKeyDown,u=>{const p=s.searchRef.current!=="";n||p&&u.key===" "||mp.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})}))}),eC=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=Rg(gp,n),s=XS(n),l=x.useRef(null),c=Se(t,l),[m,u]=x.useState(!1),[p,g]=x.useState("");return x.useEffect(()=>{const y=l.current;if(y){var _;g(((_=y.textContent)!==null&&_!==void 0?_:"").trim())}},[o.children]),x.createElement(ja.ItemSlot,{scope:n,disabled:r,textValue:i??p},x.createElement(BS,Y({asChild:!0},s,{focusable:!r}),x.createElement(fe.div,Y({role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:ne(e.onPointerMove,Fa(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus())})),onPointerLeave:ne(e.onPointerLeave,Fa(y=>a.onItemLeave(y))),onFocus:ne(e.onFocus,()=>u(!0)),onBlur:ne(e.onBlur,()=>u(!1))}))))}),nO=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return x.createElement(nC,{scope:e.__scopeMenu,checked:n},x.createElement(Mg,Y({role:"menuitemcheckbox","aria-checked":Eu(n)?"mixed":n},i,{ref:t,"data-state":Ag(n),onSelect:ne(i.onSelect,()=>r==null?void 0:r(Eu(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),rO="MenuRadioGroup",[Oj,iO]=is(rO,{value:void 0,onValueChange:()=>{}}),sO="MenuRadioItem",oO=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=iO(sO,e.__scopeMenu),o=n===i.value;return x.createElement(nC,{scope:e.__scopeMenu,checked:o},x.createElement(Mg,Y({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":Ag(o),onSelect:ne(r.onSelect,()=>{var a;return(a=i.onValueChange)===null||a===void 0?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})))}),tC="MenuItemIndicator",[nC,aO]=is(tC,{checked:!1}),lO=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=aO(tC,n);return x.createElement(ut,{present:r||Eu(o.checked)||o.checked===!0},x.createElement(fe.span,Y({},i,{ref:t,"data-state":Ag(o.checked)})))}),cO=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.createElement(fe.div,Y({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),uO="MenuSub",[Ij,rC]=is(uO),oc="MenuSubTrigger",hO=x.forwardRef((e,t)=>{const n=ss(oc,e.__scopeMenu),r=yl(oc,e.__scopeMenu),i=rC(oc,e.__scopeMenu),o=Rg(oc,e.__scopeMenu),a=x.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},m=x.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return x.useEffect(()=>m,[m]),x.useEffect(()=>{const u=s.current;return()=>{window.clearTimeout(u),l(null)}},[s,l]),x.createElement(QS,Y({asChild:!0},c),x.createElement(eC,Y({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":iC(n.open)},e,{ref:ul(t,i.onTriggerChange),onClick:u=>{var p;(p=e.onClick)===null||p===void 0||p.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ne(e.onPointerMove,Fa(u=>{o.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:ne(e.onPointerLeave,Fa(u=>{var p;m();const g=(p=n.content)===null||p===void 0?void 0:p.getBoundingClientRect();if(g){var y;const _=(y=n.content)===null||y===void 0?void 0:y.dataset.side,h=_==="right",f=h?-5:5,d=g[h?"left":"right"],v=g[h?"right":"left"];o.onPointerGraceIntentChange({area:[{x:u.clientX+f,y:u.clientY},{x:d,y:g.top},{x:v,y:g.top},{x:v,y:g.bottom},{x:d,y:g.bottom}],side:_}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(u),u.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ne(e.onKeyDown,u=>{const p=o.searchRef.current!=="";if(!(e.disabled||p&&u.key===" ")&&H$[r.dir].includes(u.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),u.preventDefault()}})})))}),dO="MenuSubContent",fO=x.forwardRef((e,t)=>{const n=ZS($n,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ss($n,e.__scopeMenu),a=yl($n,e.__scopeMenu),s=rC(dO,e.__scopeMenu),l=x.useRef(null),c=Se(t,l);return x.createElement(ja.Provider,{scope:e.__scopeMenu},x.createElement(ut,{present:r||o.open},x.createElement(ja.Slot,{scope:e.__scopeMenu},x.createElement(Lg,Y({id:s.contentId,"aria-labelledby":s.triggerId},i,{ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var u;a.isUsingKeyboardRef.current&&((u=l.current)===null||u===void 0||u.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:ne(e.onFocusOutside,m=>{m.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ne(e.onEscapeKeyDown,m=>{a.onClose(),m.preventDefault()}),onKeyDown:ne(e.onKeyDown,m=>{const u=m.currentTarget.contains(m.target),p=U$[a.dir].includes(m.key);if(u&&p){var g;o.onOpenChange(!1),(g=s.trigger)===null||g===void 0||g.focus(),m.preventDefault()}})})))))});function iC(e){return e?"open":"closed"}function Eu(e){return e==="indeterminate"}function Ag(e){return Eu(e)?"indeterminate":e?"checked":"unchecked"}function pO(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function mO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function gO(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=mO(e,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function vO(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o].x,l=t[o].y,c=t[a].x,m=t[a].y;l>r!=m>r&&n<(c-s)*(r-l)/(m-l)+s&&(i=!i)}return i}function _O(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return vO(n,t)}function Fa(e){return t=>t.pointerType==="mouse"?e(t):void 0}const yO=G$,wO=QS,bO=X$,xO=J$,SO=tO,CO=Mg,EO=nO,kO=oO,RO=lO,LO=cO,MO=hO,AO=fO,sC="DropdownMenu",[TO,Nj]=Ft(sC,[YS]),xn=YS(),[DO,oC]=TO(sC),PO=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=xn(t),c=x.useRef(null),[m=!1,u]=xr({prop:i,defaultProp:o,onChange:a});return x.createElement(DO,{scope:t,triggerId:gn(),triggerRef:c,contentId:gn(),open:m,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s},x.createElement(yO,Y({},l,{open:m,onOpenChange:u,dir:r,modal:s}),n))},$O="DropdownMenuTrigger",OO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=oC($O,n),a=xn(n);return x.createElement(wO,Y({asChild:!0},a),x.createElement(fe.button,Y({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:ul(t,o.triggerRef),onPointerDown:ne(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:ne(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),IO=e=>{const{__scopeDropdownMenu:t,...n}=e,r=xn(t);return x.createElement(bO,Y({},r,n))},NO="DropdownMenuContent",BO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oC(NO,n),o=xn(n),a=x.useRef(!1);return x.createElement(xO,Y({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:ne(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:ne(e.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,m=l.button===2||c;(!i.modal||m)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),jO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xn(n);return x.createElement(SO,Y({},i,r,{ref:t}))}),FO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xn(n);return x.createElement(CO,Y({},i,r,{ref:t}))}),zO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xn(n);return x.createElement(EO,Y({},i,r,{ref:t}))}),HO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xn(n);return x.createElement(kO,Y({},i,r,{ref:t}))}),UO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xn(n);return x.createElement(RO,Y({},i,r,{ref:t}))}),WO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xn(n);return x.createElement(LO,Y({},i,r,{ref:t}))}),VO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xn(n);return x.createElement(MO,Y({},i,r,{ref:t}))}),KO=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xn(n);return x.createElement(AO,Y({},i,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),qO=PO,GO=OO,YO=IO,aC=BO,lC=jO,cC=FO,uC=zO,hC=HO,dC=UO,fC=WO,pC=VO,mC=KO,XO=qO,QO=GO,JO=x.forwardRef(({className:e,inset:t,children:n,...r},i)=>S.jsxs(pC,{ref:i,className:Z("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,S.jsx(xR,{className:"ml-auto h-4 w-4"})]}));JO.displayName=pC.displayName;const ZO=x.forwardRef(({className:e,...t},n)=>S.jsx(mC,{ref:n,className:Z("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));ZO.displayName=mC.displayName;const gC=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>S.jsx(YO,{children:S.jsx(aC,{ref:r,sideOffset:t,className:Z("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-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",e),...n})}));gC.displayName=aC.displayName;const ia=x.forwardRef(({className:e,inset:t,...n},r)=>S.jsx(cC,{ref:r,className:Z("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ia.displayName=cC.displayName;const eI=x.forwardRef(({className:e,children:t,checked:n,...r},i)=>S.jsxs(uC,{ref:i,className:Z("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(dC,{children:S.jsx(Um,{className:"h-4 w-4"})})}),t]}));eI.displayName=uC.displayName;const tI=x.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(hC,{ref:r,className:Z("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(dC,{children:S.jsx(ER,{className:"h-2 w-2 fill-current"})})}),t]}));tI.displayName=hC.displayName;const nI=x.forwardRef(({className:e,inset:t,...n},r)=>S.jsx(lC,{ref:r,className:Z("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));nI.displayName=lC.displayName;const vC=x.forwardRef(({className:e,...t},n)=>S.jsx(fC,{ref:n,className:Z("-mx-1 my-1 h-px bg-muted",e),...t}));vC.displayName=fC.displayName;function Tg(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const _C=x.forwardRef((e,t)=>x.createElement(fe.span,Y({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),yC=_C,wl="NavigationMenu",[Dg,wC,rI]=gl(wl),[vp,iI,sI]=gl(wl),[Pg,Bj]=Ft(wl,[rI,sI]),[oI,Nn]=Pg(wl),[aI,lI]=Pg(wl),cI=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:s=300,orientation:l="horizontal",dir:c,...m}=e,[u,p]=x.useState(null),g=Se(t,k=>p(k)),y=Co(c),_=x.useRef(0),h=x.useRef(0),f=x.useRef(0),[d,v]=x.useState(!0),[b="",E]=xr({prop:r,onChange:k=>{const L=k!=="",A=s>0;L?(window.clearTimeout(f.current),A&&v(!1)):(window.clearTimeout(f.current),f.current=window.setTimeout(()=>v(!0),s)),i==null||i(k)},defaultProp:o}),C=x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>E(""),150)},[E]),R=x.useCallback(k=>{window.clearTimeout(h.current),E(k)},[E]),w=x.useCallback(k=>{b===k?window.clearTimeout(h.current):_.current=window.setTimeout(()=>{window.clearTimeout(h.current),E(k)},a)},[b,E,a]);return x.useEffect(()=>()=>{window.clearTimeout(_.current),window.clearTimeout(h.current),window.clearTimeout(f.current)},[]),x.createElement(uI,{scope:n,isRootMenu:!0,value:b,dir:y,orientation:l,rootNavigationMenu:u,onTriggerEnter:k=>{window.clearTimeout(_.current),d?w(k):R(k)},onTriggerLeave:()=>{window.clearTimeout(_.current),C()},onContentEnter:()=>window.clearTimeout(h.current),onContentLeave:C,onItemSelect:k=>{E(L=>L===k?"":k)},onItemDismiss:()=>E("")},x.createElement(fe.nav,Y({"aria-label":"Main","data-orientation":l,dir:y},m,{ref:g})))}),uI=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:s,onItemSelect:l,onItemDismiss:c,onTriggerEnter:m,onTriggerLeave:u,onContentEnter:p,onContentLeave:g}=e,[y,_]=x.useState(null),[h,f]=x.useState(new Map),[d,v]=x.useState(null);return x.createElement(oI,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:Tg(s),baseId:gn(),dir:i,orientation:o,viewport:y,onViewportChange:_,indicatorTrack:d,onIndicatorTrackChange:v,onTriggerEnter:Fe(m),onTriggerLeave:Fe(u),onContentEnter:Fe(p),onContentLeave:Fe(g),onItemSelect:Fe(l),onItemDismiss:Fe(c),onViewportContentChange:x.useCallback((b,E)=>{f(C=>(C.set(b,E),new Map(C)))},[]),onViewportContentRemove:x.useCallback(b=>{f(E=>E.has(b)?(E.delete(b),new Map(E)):E)},[])},x.createElement(Dg.Provider,{scope:t},x.createElement(aI,{scope:t,items:h},a)))},hI="NavigationMenuList",dI=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Nn(hI,n),o=x.createElement(fe.ul,Y({"data-orientation":i.orientation},r,{ref:t}));return x.createElement(fe.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange},x.createElement(Dg.Slot,{scope:n},i.isRootMenu?x.createElement(EC,{asChild:!0},o):o))}),fI="NavigationMenuItem",[pI,bC]=Pg(fI),mI=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=gn(),a=r||o||"LEGACY_REACT_AUTO_VALUE",s=x.useRef(null),l=x.useRef(null),c=x.useRef(null),m=x.useRef(()=>{}),u=x.useRef(!1),p=x.useCallback((y="start")=>{if(s.current){m.current();const _=_p(s.current);_.length&&$g(y==="start"?_:_.reverse())}},[]),g=x.useCallback(()=>{if(s.current){const y=_p(s.current);y.length&&(m.current=kI(y))}},[]);return x.createElement(pI,{scope:n,value:a,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:u,onEntryKeyDown:p,onFocusProxyEnter:p,onRootContentClose:g,onContentFocusOutside:g},x.createElement(fe.li,Y({},i,{ref:t})))}),s1="NavigationMenuTrigger",gI=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=Nn(s1,e.__scopeNavigationMenu),a=bC(s1,e.__scopeNavigationMenu),s=x.useRef(null),l=Se(s,a.triggerRef,t),c=RC(o.baseId,a.value),m=LC(o.baseId,a.value),u=x.useRef(!1),p=x.useRef(!1),g=a.value===o.value;return x.createElement(x.Fragment,null,x.createElement(Dg.ItemSlot,{scope:n,value:a.value},x.createElement(kC,{asChild:!0},x.createElement(fe.button,Y({id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":Og(g),"aria-expanded":g,"aria-controls":m},i,{ref:l,onPointerEnter:ne(e.onPointerEnter,()=>{p.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:ne(e.onPointerMove,ku(()=>{r||p.current||a.wasEscapeCloseRef.current||u.current||(o.onTriggerEnter(a.value),u.current=!0)})),onPointerLeave:ne(e.onPointerLeave,ku(()=>{r||(o.onTriggerLeave(),u.current=!1)})),onClick:ne(e.onClick,()=>{o.onItemSelect(a.value),p.current=g}),onKeyDown:ne(e.onKeyDown,y=>{const h={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];g&&y.key===h&&(a.onEntryKeyDown(),y.preventDefault())})})))),g&&x.createElement(x.Fragment,null,x.createElement(yC,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:y=>{const _=a.contentRef.current,h=y.relatedTarget,f=h===s.current,d=_==null?void 0:_.contains(h);(f||!d)&&a.onFocusProxyEnter(f?"start":"end")}}),o.viewport&&x.createElement("span",{"aria-owns":m})))}),o1="navigationMenu.linkSelect",vI=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return x.createElement(kC,{asChild:!0},x.createElement(fe.a,Y({"data-active":r?"":void 0,"aria-current":r?"page":void 0},o,{ref:t,onClick:ne(e.onClick,a=>{const s=a.target,l=new CustomEvent(o1,{bubbles:!0,cancelable:!0});if(s.addEventListener(o1,c=>i==null?void 0:i(c),{once:!0}),cu(s,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent($c,{bubbles:!0,cancelable:!0});cu(s,c)}},{checkForDefaultPrevented:!1})})))}),xC="NavigationMenuIndicator",_I=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Nn(xC,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?Gw.createPortal(x.createElement(ut,{present:n||o},x.createElement(yI,Y({},r,{ref:t}))),i.indicatorTrack):null}),yI=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Nn(xC,n),o=wC(n),[a,s]=x.useState(null),[l,c]=x.useState(null),m=i.orientation==="horizontal",u=!!i.value;x.useEffect(()=>{var g;const _=(g=o().find(h=>h.value===i.value))===null||g===void 0?void 0:g.ref.current;_&&s(_)},[o,i.value]);const p=()=>{a&&c({size:m?a.offsetWidth:a.offsetHeight,offset:m?a.offsetLeft:a.offsetTop})};return yp(a,p),yp(i.indicatorTrack,p),l?x.createElement(fe.div,Y({"aria-hidden":!0,"data-state":u?"visible":"hidden","data-orientation":i.orientation},r,{ref:t,style:{position:"absolute",...m?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}})):null}),za="NavigationMenuContent",wI=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Nn(za,e.__scopeNavigationMenu),o=bC(za,e.__scopeNavigationMenu),a=Se(o.contentRef,t),s=o.value===i.value,l={value:o.value,triggerRef:o.triggerRef,focusProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...r};return i.viewport?x.createElement(bI,Y({forceMount:n},l,{ref:a})):x.createElement(ut,{present:n||s},x.createElement(SC,Y({"data-state":Og(s)},l,{ref:a,onPointerEnter:ne(e.onPointerEnter,i.onContentEnter),onPointerLeave:ne(e.onPointerLeave,ku(i.onContentLeave)),style:{pointerEvents:!s&&i.isRootMenu?"none":void 0,...l.style}})))}),bI=x.forwardRef((e,t)=>{const n=Nn(za,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return rt(()=>{r(e.value,{ref:t,...e})},[e,t,r]),rt(()=>()=>i(e.value),[e.value,i]),null}),$c="navigationMenu.rootContentDismiss",SC=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:s,onContentFocusOutside:l,...c}=e,m=Nn(za,n),u=x.useRef(null),p=Se(u,t),g=RC(m.baseId,r),y=LC(m.baseId,r),_=wC(n),h=x.useRef(null),{onItemDismiss:f}=m;x.useEffect(()=>{const v=u.current;if(m.isRootMenu&&v){const b=()=>{var E;f(),s(),v.contains(document.activeElement)&&((E=i.current)===null||E===void 0||E.focus())};return v.addEventListener($c,b),()=>v.removeEventListener($c,b)}},[m.isRootMenu,e.value,i,f,s]);const d=x.useMemo(()=>{const b=_().map(L=>L.value);m.dir==="rtl"&&b.reverse();const E=b.indexOf(m.value),C=b.indexOf(m.previousValue),R=r===m.value,w=C===b.indexOf(r);if(!R&&!w)return h.current;const k=(()=>{if(E!==C){if(R&&C!==-1)return E>C?"from-end":"from-start";if(w&&E!==-1)return E>C?"to-start":"to-end"}return null})();return h.current=k,k},[m.previousValue,m.value,m.dir,_,r]);return x.createElement(EC,{asChild:!0},x.createElement(vl,Y({id:y,"aria-labelledby":g,"data-motion":d,"data-orientation":m.orientation},c,{ref:p,onDismiss:()=>{var v;const b=new Event($c,{bubbles:!0,cancelable:!0});(v=u.current)===null||v===void 0||v.dispatchEvent(b)},onFocusOutside:ne(e.onFocusOutside,v=>{var b;l();const E=v.target;(b=m.rootNavigationMenu)!==null&&b!==void 0&&b.contains(E)&&v.preventDefault()}),onPointerDownOutside:ne(e.onPointerDownOutside,v=>{var b;const E=v.target,C=_().some(w=>{var k;return(k=w.ref.current)===null||k===void 0?void 0:k.contains(E)}),R=m.isRootMenu&&((b=m.viewport)===null||b===void 0?void 0:b.contains(E));(C||R||!m.isRootMenu)&&v.preventDefault()}),onKeyDown:ne(e.onKeyDown,v=>{const b=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!b){const R=_p(v.currentTarget),w=document.activeElement,k=R.findIndex(D=>D===w),A=v.shiftKey?R.slice(0,k).reverse():R.slice(k+1,R.length);if($g(A))v.preventDefault();else{var C;(C=o.current)===null||C===void 0||C.focus()}}}),onEscapeKeyDown:ne(e.onEscapeKeyDown,v=>{a.current=!0})})))}),CC="NavigationMenuViewport",xI=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!Nn(CC,e.__scopeNavigationMenu).value;return x.createElement(ut,{present:n||o},x.createElement(SI,Y({},r,{ref:t})))}),SI=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=Nn(CC,n),a=Se(t,o.onViewportChange),s=lI(za,e.__scopeNavigationMenu),[l,c]=x.useState(null),[m,u]=x.useState(null),p=l?(l==null?void 0:l.width)+"px":void 0,g=l?(l==null?void 0:l.height)+"px":void 0,y=!!o.value,_=y?o.value:o.previousValue;return yp(m,()=>{m&&c({width:m.offsetWidth,height:m.offsetHeight})}),x.createElement(fe.div,Y({"data-state":Og(y),"data-orientation":o.orientation},i,{ref:a,style:{pointerEvents:!y&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":p,"--radix-navigation-menu-viewport-height":g,...i.style},onPointerEnter:ne(e.onPointerEnter,o.onContentEnter),onPointerLeave:ne(e.onPointerLeave,ku(o.onContentLeave))}),Array.from(s.items).map(([f,{ref:d,forceMount:v,...b}])=>{const E=_===f;return x.createElement(ut,{key:f,present:v||E},x.createElement(SC,Y({},b,{ref:ul(d,C=>{E&&C&&u(C)})})))}))}),CI="FocusGroup",EC=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Nn(CI,n);return x.createElement(vp.Provider,{scope:n},x.createElement(vp.Slot,{scope:n},x.createElement(fe.div,Y({dir:i.dir},r,{ref:t}))))}),a1=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],EI="FocusGroupItem",kC=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=iI(n),o=Nn(EI,n);return x.createElement(vp.ItemSlot,{scope:n},x.createElement(fe.button,Y({},r,{ref:t,onKeyDown:ne(e.onKeyDown,a=>{if(["Home","End",...a1].includes(a.key)){let l=i().map(u=>u.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),a1.includes(a.key)){const u=l.indexOf(a.currentTarget);l=l.slice(u+1)}setTimeout(()=>$g(l)),a.preventDefault()}})})))});function _p(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 $g(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function kI(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function yp(e,t){const n=Fe(t);rt(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function Og(e){return e?"open":"closed"}function RC(e,t){return`${e}-trigger-${t}`}function LC(e,t){return`${e}-content-${t}`}function ku(e){return t=>t.pointerType==="mouse"?e(t):void 0}const MC=cI,AC=dI,RI=mI,TC=gI,LI=vI,DC=_I,PC=wI,$C=xI,wp=x.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(MC,{ref:r,className:Z("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,S.jsx(BC,{})]}));wp.displayName=MC.displayName;const bp=x.forwardRef(({className:e,...t},n)=>S.jsx(AC,{ref:n,className:Z("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));bp.displayName=AC.displayName;const OC=RI,MI=gi("group inline-flex h-10 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:bg-secondary focus:text-secondary-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-secondary/50 data-[state=open]:bg-secondary/50"),IC=x.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(TC,{ref:r,className:Z(MI(),"group",e),...n,children:[t," ",S.jsx(Wm,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));IC.displayName=TC.displayName;const NC=x.forwardRef(({className:e,...t},n)=>S.jsx(PC,{ref:n,className:Z("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));NC.displayName=PC.displayName;const AI=LI,BC=x.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:Z("absolute left-0 top-full flex justify-center"),children:S.jsx($C,{className:Z("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));BC.displayName=$C.displayName;const TI=x.forwardRef(({className:e,...t},n)=>S.jsx(DC,{ref:n,className:Z("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:S.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));TI.displayName=DC.displayName;const[_h,jj]=Ft("Tooltip",[Po]),Ig=Po(),DI="TooltipProvider",PI=700,xp="tooltip.open",[$I,Ng]=_h(DI),OI=e=>{const{__scopeTooltip:t,delayDuration:n=PI,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[a,s]=x.useState(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const m=c.current;return()=>window.clearTimeout(m)},[]),x.createElement($I,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(m=>{l.current=m},[]),disableHoverableContent:i},o)},Bg="Tooltip",[II,yh]=_h(Bg),NI=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,l=Ng(Bg,e.__scopeTooltip),c=Ig(t),[m,u]=x.useState(null),p=gn(),g=x.useRef(0),y=a??l.disableHoverableContent,_=s??l.delayDuration,h=x.useRef(!1),[f=!1,d]=xr({prop:r,defaultProp:i,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(xp))):l.onClose(),o==null||o(R)}}),v=x.useMemo(()=>f?h.current?"delayed-open":"instant-open":"closed",[f]),b=x.useCallback(()=>{window.clearTimeout(g.current),h.current=!1,d(!0)},[d]),E=x.useCallback(()=>{window.clearTimeout(g.current),d(!1)},[d]),C=x.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{h.current=!0,d(!0)},_)},[_,d]);return x.useEffect(()=>()=>window.clearTimeout(g.current),[]),x.createElement(yg,c,x.createElement(II,{scope:t,contentId:p,open:f,stateAttribute:v,trigger:m,onTriggerChange:u,onTriggerEnter:x.useCallback(()=>{l.isOpenDelayed?C():b()},[l.isOpenDelayed,C,b]),onTriggerLeave:x.useCallback(()=>{y?E():window.clearTimeout(g.current)},[E,y]),onOpen:b,onClose:E,disableHoverableContent:y},n))},l1="TooltipTrigger",BI=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=yh(l1,n),o=Ng(l1,n),a=Ig(n),s=x.useRef(null),l=Se(t,s,i.onTriggerChange),c=x.useRef(!1),m=x.useRef(!1),u=x.useCallback(()=>c.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),x.createElement(wg,Y({asChild:!0},a),x.createElement(fe.button,Y({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:ne(e.onPointerMove,p=>{p.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:ne(e.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:ne(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:ne(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:ne(e.onBlur,i.onClose),onClick:ne(e.onClick,i.onClose)})))}),jI="TooltipPortal",[Fj,FI]=_h(jI,{forceMount:void 0}),Ha="TooltipContent",zI=x.forwardRef((e,t)=>{const n=FI(Ha,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=yh(Ha,e.__scopeTooltip);return x.createElement(ut,{present:r||a.open},a.disableHoverableContent?x.createElement(jC,Y({side:i},o,{ref:t})):x.createElement(HI,Y({side:i},o,{ref:t})))}),HI=x.forwardRef((e,t)=>{const n=yh(Ha,e.__scopeTooltip),r=Ng(Ha,e.__scopeTooltip),i=x.useRef(null),o=Se(t,i),[a,s]=x.useState(null),{trigger:l,onClose:c}=n,m=i.current,{onPointerInTransitChange:u}=r,p=x.useCallback(()=>{s(null),u(!1)},[u]),g=x.useCallback((y,_)=>{const h=y.currentTarget,f={x:y.clientX,y:y.clientY},d=WI(f,h.getBoundingClientRect()),v=VI(f,d),b=KI(_.getBoundingClientRect()),E=GI([...v,...b]);s(E),u(!0)},[u]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(l&&m){const y=h=>g(h,m),_=h=>g(h,l);return l.addEventListener("pointerleave",y),m.addEventListener("pointerleave",_),()=>{l.removeEventListener("pointerleave",y),m.removeEventListener("pointerleave",_)}}},[l,m,g,p]),x.useEffect(()=>{if(a){const y=_=>{const h=_.target,f={x:_.clientX,y:_.clientY},d=(l==null?void 0:l.contains(h))||(m==null?void 0:m.contains(h)),v=!qI(f,a);d?p():v&&(p(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,m,a,c,p]),x.createElement(jC,Y({},e,{ref:o}))}),[UI,zj]=_h(Bg,{isInside:!1}),jC=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=yh(Ha,n),c=Ig(n),{onClose:m}=l;return x.useEffect(()=>(document.addEventListener(xp,m),()=>document.removeEventListener(xp,m)),[m]),x.useEffect(()=>{if(l.trigger){const u=p=>{const g=p.target;g!=null&&g.contains(l.trigger)&&m()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,m]),x.createElement(vl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:u=>u.preventDefault(),onDismiss:m},x.createElement(bg,Y({"data-state":l.stateAttribute},c,s,{ref:t,style:{...s.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)"}}),x.createElement(Bm,null,r),x.createElement(UI,{scope:n,isInside:!0},x.createElement(yC,{id:l.contentId,role:"tooltip"},i||r))))});function WI(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 VI(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 KI(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 qI(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o].x,l=t[o].y,c=t[a].x,m=t[a].y;l>r!=m>r&&n<(c-s)*(r-l)/(m-l)+s&&(i=!i)}return i}function GI(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),YI(t)}function YI(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],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.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],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.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)}const XI=OI,QI=NI,JI=BI,FC=zI,ZI=XI,Ti=QI,Di=JI,Xr=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>S.jsx(FC,{ref:r,sideOffset:t,className:Z("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-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 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}));Xr.displayName=FC.displayName;function eN(e,t){const n=Ge(qb),r=zm(),i=ah(),o=a=>{if(e.disabled){a.preventDefault();return}i(),(e.isActive||n)&&(console.log("Page is already active or in error state. Forcing error boundry + router re-render."),r(),a.preventDefault())};return S.jsx(Lm,{ref:t,href:e.href,onClick:o,className:e.className,children:e.children})}const jg=x.forwardRef(eN);function Kt({href:e,children:t,className:n,disabled:r}){const[i]=ll(e);return r?S.jsxs(Ti,{children:[S.jsx(Di,{className:"cursor-help",children:S.jsx(Oe,{variant:"ghost",className:"w-full justify-start py-1",disabled:!0,children:t})}),S.jsxs(Xr,{side:"right",className:"text-destructive-inline text-center",children:["You do not have permission ",S.jsx("br",{}),"to access this page."]})]}):S.jsx(jg,{href:e,isActive:i,className:Z(hl({variant:i?"secondary":"ghost"}),"w-full justify-start py-1",n),children:t})}function Sp({href:e,children:t}){const[n]=ll(e);return S.jsx(jg,{href:e,isActive:n,children:S.jsx("a",{children:t})})}const c1=gi("group inline-flex h-10 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50 ring-offset-background  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",{variants:{variant:{default:"hover:bg-primary hover:text-primary-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80"}}});function wi(e){const[t]=ll(e.href);return S.jsx(OC,{children:S.jsx(AI,{asChild:!0,active:t,children:e.disabled?S.jsxs(Ti,{children:[S.jsx(Di,{className:"cursor-help",children:S.jsx("a",{className:Z(c1({variant:"default"}),"pointer-events-none opacity-50",e.className),children:e.children})}),S.jsxs(Xr,{side:"bottom",className:"text-destructive-inline text-center",children:["You do not have permission ",S.jsx("br",{}),"to access this page."]})]}):S.jsx(jg,{href:e.href,isActive:t,className:Z(c1({variant:t?"secondary":"default"}),e.className),children:e.children})})})}function tN(){const{hasPerm:e}=nr();return S.jsxs("div",{className:"space-x-1 flex flex-row select-none",children:[S.jsx(wp,{children:S.jsxs(bp,{children:[S.jsx(wi,{href:"/players",children:"Players"}),S.jsx(wi,{href:"/whitelist",children:"Whitelist"}),S.jsx(wi,{href:"/admins",disabled:!e("manage.admins"),children:"Admins"}),S.jsx(wi,{href:"/settings",disabled:!e("settings.view"),children:"Settings"})]})}),S.jsx(wp,{children:S.jsx(bp,{children:S.jsxs(OC,{children:[S.jsx(IC,{onClick:t=>{t.currentTarget.dataset.state==="open"&&t.preventDefault()},children:"System"}),S.jsxs(NC,{className:"flex flex-col gap-2 p-4 list-none",children:[S.jsx(wi,{className:"w-36 justify-start",href:"/system/master-actions",children:"Master Actions"}),S.jsx(wi,{className:"w-36 justify-start",href:"/system/diagnostics",children:"Diagnostics"}),S.jsx(wi,{className:"w-36 justify-start",href:"/system/system-logs",disabled:!e("txadmin.log.view"),children:"System Logs"})]})]})})})]})}const zC="Avatar",[nN,Hj]=Ft(zC),[rN,HC]=nN(zC),iN=x.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=x.useState("idle");return x.createElement(rN,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o},x.createElement(fe.span,Y({},r,{ref:t})))}),sN="AvatarImage",oN=x.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=HC(sN,n),s=cN(r),l=Fe(c=>{i(c),a.onImageLoadingStatusChange(c)});return rt(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?x.createElement(fe.img,Y({},o,{ref:t,src:r})):null}),aN="AvatarFallback",lN=x.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=HC(aN,n),[a,s]=x.useState(r===void 0);return x.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&o.imageLoadingStatus!=="loaded"?x.createElement(fe.span,Y({},i,{ref:t})):null});function cN(e){const[t,n]=x.useState("idle");return rt(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,o=a=>()=>{r&&n(a)};return n("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=e,()=>{r=!1}},[e]),t}const UC=iN,WC=oN,VC=lN,KC=x.forwardRef(({className:e,...t},n)=>S.jsx(UC,{ref:n,className:Z("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));KC.displayName=UC.displayName;const qC=x.forwardRef(({className:e,...t},n)=>S.jsx(WC,{ref:n,className:Z("aspect-square h-full w-full",e),...t}));qC.displayName=WC.displayName;const GC=x.forwardRef(({className:e,...t},n)=>S.jsx(VC,{ref:n,className:Z("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));GC.displayName=VC.displayName;const u1=["#c67d28","#3d9bf3","#4af34b","#ee59a6","#34f0e0","#b19c9b","#f07891","#6f9a4e","#edb3f5","#ed655f","#59ef9b","#2bfe46","#a3d4f5","#41988e","#a587f6","#b5a626","#bbe5ce","#4da419","#b3f665","#ea5d25","#e19b73","#8e8cbc","#df788c","#f9ae1b","#f475e1","#898d66","#4bbf92","#bcef8e","#a4c791","#ad7895","#3bc359","#dec6dc","#4491bb","#ecccb3","#9fc348","#bc79bd","#a6a055","#b5e925","#ecb155","#7993a0","#eada6e","#f19dbf","#3ec8ea","#85f322","#58956e","#3be4f8","#b77776","#fbc32d","#71c47a","#c57346","#50afbb","#67e7ee","#f04885","#e495f1","#b4bc9f","#ac8455","#b487fb","#ecc23a","#d9b06d","#58f4c7","#ba9def","#71e660","#ce73a5","#f4b2a3","#e68b1a","#f17d59","#53a042","#6bbea6","#c5a1d2","#c6cbf5","#ee7513","#e47774","#839c29","#91b2a8","#8baadc","#e95f7d","#57b2e6","#9dc877","#ed8c4c","#e5b9ba","#90ced4","#ecd19e","#b9bd4f","#22d042","#54ee81","#858c86","#439d5e","#a8b319","#8c91f0","#97f17d","#43a26b","#c89c15","#a9adbd","#e274bd","#85e7bf","#c2a13f","#f14d63","#f1d935","#7bcc69","#d2c977","#e56c9b","#f05b48","#bb73d2","#f0a364","#b2d939","#b38774","#ccd318","#ba8739","#dfb087","#cc9497","#74df32","#5fc32e","#7ba0ec","#b5ac83","#8edcca","#f08c70","#ac91a4","#e47c2d","#8797f3","#2acd7d","#c0e974","#77aa72","#9e8a1a","#49beb7","#b9e5f3","#e36b37","#c4cdca","#848f3c","#e9c0ed","#3e96dc","#cdc98d","#6a8cbe","#a183cd","#87869e","#c68b51","#73ab20","#65b543","#958977","#258eb7","#b782af","#a87d85","#7c8e57","#ec9cab","#e8c25b","#dbc845","#90db22","#db5fbb","#919ad9","#a5b964","#7feea3","#e0b2c6","#779978","#7cd45c","#aca169","#e79b87","#9d8465","#7ab992","#35a633","#46a35a","#96bed5","#d26b3c","#a698b9","#9fc29f","#278dde","#cab0a1","#5f8ce5","#a88e57","#5daacb","#9f8e36","#0ea827","#5e9695","#bbce88","#9de0a6","#eb9ed0","#6de8d8","#8dc957","#d07c76","#8e7dd6","#13edae","#48db29","#ea666f","#a88e4f","#bc8723","#5f9b8f","#94ad74","#df705f","#e480ec","#ce7236","#c37758","#eb8c5e","#ebca7d","#e99b99","#d6d6ee","#f6c823","#977dab","#8491ac","#838e76","#c77e96","#3da27b","#3ab097","#d78d45","#e19adc","#dc4da7","#e9a140","#82dd89","#51bf81","#a9a28c","#aeb1de","#ecae2f","#e9bcb4","#45deac","#47e85d","#76d3ee","#9de053","#da6949","#7ea924"],uN=e=>{e=e.normalize("NFKD").replace(/[\u0300-\u036F]/g,"");let t="";if(/^[A-Z][a-z]*((?:[A-Z][a-z]*)+)$/.test(e)){const n=e.match(/[A-Z]/g);t=n?n.slice(0,2).join(""):"??"}else if(/^[a-z]+([_\-.][a-z]+)+$/.test(e)){const n=e.split(/[_\-.]/);t=n[0][0]+n[1][0]}else{const n=e.replace(/[^a-zA-Z0-9]/g,"");n.length===0?t=e.length?e[0]:"??":n.length<=2?t=n:t=n[0]+n[n.length-1]}return t.toLocaleUpperCase()},hN=e=>{let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return u1[Math.abs(t)%u1.length]};function YC({username:e,profilePicture:t,className:n}){return S.jsxs(KC,{className:Z("bg-zinc-200 dark:bg-zinc-800 transition-colors text-zinc-200",n),children:[t&&S.jsx(qC,{src:t,alt:e}),S.jsx(GC,{className:n,style:{backgroundColor:hN(e)},delayMs:t?1e3:void 0,children:uN(e)})]})}const XC=e=>{document.cookie=`txAdmin-theme=${e};path=/;SameSite=Lax;max-age=31536000;`},va=window.document.documentElement,QC=window.txConsts.customThemes.map(e=>e.name),dN=window.txConsts.customThemes.map(e=>`theme-${e.name}`),Cp=["dark","light"],JC=QC.find(e=>va.classList.contains(`theme-${e}`))??Cp.find(e=>va.classList.contains(e))??window.txConsts.defaultTheme,ZC=De(JC);XC(JC);const Ep=(e,t)=>{var i,o;let n;if(va.classList.remove(...Cp,...dN),Cp.includes(t))va.classList.add(t),n=t;else if(QC.includes(t)){const a=window.txConsts.customThemes.find(l=>l.name===t),s=a!=null&&a.isDark?"dark":"light";va.classList.add(s,`theme-${t}`),n=s}else throw new Error(`invalid theme ${t}`);const r=(o=(i=document.getElementById("legacyPageIframe"))==null?void 0:i.contentDocument)==null?void 0:o.body;r&&(n==="dark"?r.classList.add("theme--dark"):r.classList.remove("theme--dark")),XC(t),console.log(`Changed theme from '${e}' to '${t}'.`)},e2=()=>{const[e,t]=mn(ZC);return{theme:e,setTheme:r=>{r!==e&&(Ep(e,r),t(r))}}},fN=()=>{const e=Ne(ZC);return()=>e(t=>t==="dark"?(Ep(t,"light"),"light"):t==="light"?(Ep(t,"dark"),"dark"):(console.log("invalid theme",t),t))};function t2(e){return Cb({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"},child:[]}]})(e)}function Fg({style:e,className:t}){const n=x.useId(),r=x.useId();return S.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1115 288",children:[S.jsxs("mask",{id:n,fill:"#fff",children:[S.jsx("path",{d:"M.42 48.27v191.46C.42 266.39 22.03 288 48.69 288h191.46c26.66 0 48.27-21.61 48.27-48.27V48.27C288.42 21.61 266.81 0 240.15 0H48.69C22.03 0 .42 21.61.42 48.27Zm36.19 106.19.07-106.24c7.96 0 15.15 3.23 20.38 8.44a28.733 28.733 0 0 1 8.43 20.38v38.82h50.46c0 15.42-12.5 27.91-27.91 27.91H65.49v1.7c0 54.78 50.08 53.84 50.08 53.84h22.11l-24.38 28.45c-77.82-1.38-76.69-73.3-76.69-73.3Zm194.47 73.32c-7.44 0-14.5-3.26-19.32-8.92l-6.64-7.81-15.17-17.82-21.81 25.63a25.37 25.37 0 0 1-19.32 8.92h-25.47l24.39-28.47h.16l23.61-27.73-5.01-5.88-42.43-49.84h25.14c7.43 0 14.49 3.26 19.31 8.92l16.46 19.33 4.96 5.83 7.68-9.02 13.75-16.14a25.366 25.366 0 0 1 19.31-8.92h25.14l-29.54 34.7-17.9 21.02 15.17 17.82 32.67 38.38h-25.14Z"}),S.jsx("path",{d:"m310.85 240.677 75.49-180.805a22.205 22.205 0 0 1 20.487-13.65 22.203 22.203 0 0 1 20.486 13.65l75.49 180.805h-36.828l-15.9-38.781h-86.484l-15.901 38.781h-36.84Zm63.603-67.51h64.723l-32.361-79.23-32.362 79.23Z"}),S.jsx("path",{d:"M616.61 120.438V68.424c0-12.256 9.934-22.202 22.202-22.202h11.279v152.041c0 11.994 2.787 16.46 10.327 16.46 1.953 0 4.466-.274 6.98-.559v27.061c-3.621 1.393-9.207 2.227-16.461 2.227-8.087 0-14.507-1.393-19.534-4.466-6.134-4.181-10.04-9.767-11.434-17.021C610.202 236.746 594.027 244 571.707 244c-19.808 0-36.542-6.98-50.216-21.201-13.387-14.233-20.081-31.528-20.081-52.443 0-20.927 6.694-38.222 20.081-52.169 13.674-14.233 30.408-21.201 50.216-21.201 22.583.024 39.603 10.064 44.903 23.452Zm-10.04 80.624c8.373-8.088 12.553-18.414 12.553-30.682 0-12.28-4.18-22.595-12.553-30.682-8.088-8.088-18.415-12.28-30.409-12.28s-21.76 4.18-29.848 12.28c-7.813 8.087-11.72 18.414-11.72 30.682 0 12.28 3.907 22.594 11.72 30.682 8.088 8.087 17.854 12.28 29.848 12.28s22.321-4.193 30.409-12.28Z"}),S.jsx("path",{d:"M680.5 240.677V122.272c0-12.256 9.933-22.201 22.201-22.201h11.006v20.081c5.86-13.673 19.807-22.88 37.661-22.88 19.248 0 32.636 8.087 39.615 24.548 8.088-16.461 23.155-24.548 45.19-24.548 30.408 0 47.988 21.487 47.988 56.349v44.356c0 10.874 1.953 14.781 9.481 14.781l4.609-.012c.072 0 .131.06.131.131v27.49c-3.346 1.12-8.087 1.68-14.507 1.68-22.035 0-32.921-12.28-32.921-36.828V158.35c0-19.248-8.933-31.242-24.548-31.242-15.615 0-27.061 13.674-27.061 32.635v80.898h-33.207v-82.303c0-19.248-9.207-31.242-25.108-31.242-15.627 0-27.335 13.674-27.335 32.636v80.897H680.5v.048Z"}),S.jsx("path",{d:"M907.304 63.898c-.048-10.077 7.789-18.664 17.806-19.772 11.887-1.31 22.095 7.754 22.095 19.677 0 11.16-8.933 19.807-19.808 19.807-11.136 0-20.046-8.6-20.093-19.712Zm25.548 36.173h11.28v98.752c0 10.874 2.227 14.781 9.766 14.781 2.514 0 4.467-.274 5.861-.56v28.181c-3.347 1.393-8.934 2.227-16.735 2.227-21.487 0-32.361-11.994-32.361-35.708V122.26c-.012-12.244 9.933-22.189 22.189-22.189Z"}),S.jsx("path",{d:"M972.3 240.677V122.272c0-12.256 9.934-22.201 22.202-22.201h11.008v20.081c6.69-13.673 22.32-22.88 42.13-22.88 33.19 0 52.44 21.487 52.44 56.349v44.356c0 10.874 1.95 14.781 9.48 14.781l4.61-.012c.07 0 .13.06.13.131v27.49c-3.91 1.12-8.65 1.68-14.51 1.68-22.03 0-32.92-12.28-32.92-36.828V158.35c0-19.248-10.87-31.242-29.57-31.242-18.69 0-31.8 13.388-31.8 32.635v80.898h-33.2v.036Z"})]}),S.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),S.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[S.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),S.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function pN({style:e,className:t}){const n=x.useId(),r=x.useId();return S.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 288 288",children:[S.jsx("mask",{id:n,fill:"#fff",children:S.jsx("path",{d:"M-.46 48.21v191.46c0 26.66 21.61 48.27 48.27 48.27h191.46c26.66 0 48.27-21.61 48.27-48.27V48.21c0-26.66-21.61-48.27-48.27-48.27H47.81C21.15-.06-.46 21.55-.46 48.21ZM35.73 154.4l.07-106.24c7.96 0 15.15 3.23 20.38 8.44a28.735 28.735 0 0 1 8.43 20.38v38.82h50.46c0 15.42-12.5 27.91-27.91 27.91H64.61v1.7c0 54.78 50.08 53.84 50.08 53.84h22.11l-24.38 28.45c-77.82-1.38-76.69-73.3-76.69-73.3Zm194.47 73.32c-7.44 0-14.5-3.26-19.32-8.92l-6.64-7.81-15.17-17.82-21.81 25.63a25.365 25.365 0 0 1-19.32 8.92h-25.47l24.39-28.47h.16l23.61-27.73-5.01-5.88-42.43-49.84h25.14c7.43 0 14.49 3.26 19.31 8.92l16.46 19.33 4.96 5.83 7.68-9.02 13.75-16.14a25.366 25.366 0 0 1 19.31-8.92h25.14l-29.54 34.7-17.9 21.02 15.17 17.82 32.67 38.38H230.2Z"})}),S.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),S.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[S.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),S.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function mN(){const e=Ge(th),t=Ge(Hb);return S.jsxs("div",{className:"flex justify-start",children:[S.jsx("h1",{className:"line-clamp-1 text-base break-all",children:t}),S.jsxs("span",{children:[": ",S.jsx("span",{className:"font-mono",title:"players connected",children:e})]})]})}const zg=`h-11 w-11 sm:h-10 sm:min-w-max sm:px-2 lg:px-3
    flex justify-center items-center gap-2
    transition-all ring-offset-background 
    focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
    rounded-md text-sm border
   
    bg-zinc-100 hover:bg-zinc-200 border-zinc-200
    dark:bg-zinc-900 dark:hover:bg-zinc-800 dark:border-zinc-800
`;function gN({className:e}){const{setIsSheetOpen:t}=kx();return S.jsxs("button",{className:Z(zg,e),title:"Server Menu",onClick:()=>t(!0),children:[S.jsx(zR,{className:"h-6 w-6 sm:h-5 sm:w-5"}),S.jsx("div",{className:"hidden sm:flex flex-row min-w-max align-middle",children:"Server"})]})}function vN({className:e}){const{setIsSheetOpen:t}=Ex();return S.jsxs("button",{className:Z(zg,e),title:"Global Menu",onClick:()=>t(!0),children:[S.jsx(FR,{className:"h-6 w-6 sm:h-5 sm:w-5"}),S.jsx("div",{className:"hidden sm:flex flex-row min-w-max",children:"Menu"})]})}function _N({className:e}){const{setIsSheetOpen:t}=Rx(),n=Ge(th);return S.jsxs("button",{className:Z(zg,e),title:"Global Menu",onClick:()=>t(!0),children:[S.jsx(WR,{className:"h-6 w-6 sm:h-5 sm:w-5"}),S.jsxs("div",{className:"hidden sm:flex flex-row min-w-max",children:["Players",S.jsxs("span",{className:"hidden lg:inline-block font-mono",children:[": ",n]})]})]})}function yN(){const{authData:e,logout:t}=Ao(),{theme:n,setTheme:r}=e2(),{setAccountModalOpen:i}=qm();if(!e)return null;const o=()=>{r(n==="light"?"dark":"light")},a=()=>{i(!0)},s=()=>{xo("https://discord.gg/uAmsGa2")},l=()=>{t.mutate()};return S.jsxs(XO,{children:[S.jsxs(QO,{className:"flex flex-row items-center gap-2 sm:gap-3 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",children:[S.jsx("span",{className:"hidden xl:block text-muted-foreground",children:e.name}),S.jsx(YC,{className:`w-11 h-11 sm:w-10 sm:h-10 rounded-md text-2xl 
                        transition-all focus-visible:outline-none
                        hover:border-zinc-500 hover:border`,username:e.name,profilePicture:e.profilePicture})]}),S.jsxs(gC,{children:[S.jsxs(ia,{className:"cursor-pointer",onClick:o,children:[S.jsxs("span",{className:"hidden dark:flex items-center",children:[S.jsx(nL,{className:"mr-2 h-4 w-4"}),"Light Mode"]}),S.jsxs("span",{className:"flex dark:hidden items-center",children:[S.jsx(HR,{className:"mr-2 h-4 w-4"}),"Dark Mode"]})]}),S.jsxs(ia,{className:"cursor-pointer",onClick:a,children:[S.jsx(OR,{className:"mr-2 h-4 w-4"}),"Your Account"]}),S.jsxs(ia,{className:"cursor-pointer",onClick:s,children:[S.jsx(t2,{size:"14",className:"mr-2"}),"Support"]}),window.txConsts.isWebInterface&&S.jsxs(S.Fragment,{children:[S.jsx(vC,{}),S.jsxs(ia,{className:"cursor-pointer",onClick:l,children:[S.jsx(NR,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})]})}function wN(){return S.jsx("header",{className:`sticky top-0 z-20 flex flex-col items-center justify-center
            border-b bg-card text-card-foreground border-card-background`,children:S.jsxs("div",{className:"h-14 lg:px-3 px-2 w-full max-w-[1920px] flex flex-row justify-between transition-all",children:[S.jsxs("div",{className:"flex flex-row items-center flex-grow gap-5 mr-5",children:[S.jsx("div",{className:"w-sidebar hidden xl:flex justify-center",children:S.jsx(Sp,{href:"/",children:S.jsx(Fg,{className:"h-9 hover:scale-105 hover:brightness-110"})})}),S.jsx(Sp,{href:"/",children:S.jsx(pN,{className:"h-8 w-8 lg:h-10 lg:w-10 hidden sm:max-xl:block hover:scale-105 hover:brightness-110"})}),S.jsx("div",{className:"lg:hidden",children:S.jsx(mN,{})}),S.jsx("nav",{className:"hidden lg:block flex-grow",children:S.jsx(tN,{})})]}),S.jsxs("div",{className:"flex flex-row items-center gap-2 sm:gap-3",children:[S.jsx(gN,{className:"lg:hidden"}),S.jsx(vN,{className:"lg:hidden"}),S.jsx(_N,{className:"xl:hidden"}),S.jsx(yN,{})]})]})})}function Ru({children:e,href:t,className:n,rel:r,...i}){const o=al()[1],a=t==null?void 0:t.startsWith("http"),s=l=>{t&&(l.preventDefault(),a?xo(t):o(t??"/"))};return S.jsxs("a",{...i,rel:r??"noopener noreferrer",href:t,className:Z("text-accent no-underline hover:underline ml-1 mr-0 cursor-pointer",n),onClick:s,children:[e,a&&S.jsx(ix,{className:"inline ml-1 mb-1 h-5 [.text-sm_&]:h-4 [.text-sm_&]:ml-0"})]})}function bN(){return Ge(Hb)}function xN({pendingStep:e}){const[t]=al(),[n,r]=x.useState(""),i=x.useRef("");return x.useEffect(()=>{let o="";if(e==="setup"&&!t.startsWith("/server/setup")?(o="/server/setup",i.current="Go to the setup page!"):e==="deployer"&&!t.startsWith("/server/deployer")?(o="/server/deployer",i.current="Go to the deployer page!"):o="",o){const a=setTimeout(()=>{r(o)},500);return()=>clearTimeout(a)}else{r("");return}},[t,e]),S.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[S.jsx($R,{className:"h-12 w-12 opacity-75 animate-pulse"}),S.jsx("p",{className:"text-center text-lg tracking-wider font-light opacity-75",children:"You need to configure your server to be able to start your server."}),n?S.jsx(Ru,{href:n,className:"animate-toastbar-enter",children:i.current}):S.jsx(Ru,{href:"#",className:"animate-toastbar-leave pointer-events-none",children:i.current||S.jsx(S.Fragment,{children:" "})})]})}function SN(){const e=Ge(Ub),{hasPerm:t}=nr();return S.jsxs("div",{className:"relative",children:[e&&S.jsx(xN,{pendingStep:e}),S.jsxs("div",{className:Z(e&&"opacity-0 pointer-events-none"),children:[S.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight overflow-hidden text-ellipsis",children:S.jsx(bN,{})}),S.jsxs("div",{className:"space-y-1 select-none",children:[S.jsxs(Kt,{href:"/",children:[S.jsx(IR,{className:"mr-2 h-4 w-4"}),"Dashboard"]}),S.jsxs(Kt,{href:"/server/console",disabled:!t("console.view"),children:[S.jsx(bR,{className:"mr-2 h-4 w-4"}),"Live Console"]}),S.jsxs(Kt,{href:"/server/resources",children:[S.jsx(vR,{className:"mr-2 h-4 w-4"}),"Resources"]}),S.jsxs(Kt,{href:"/server/server-log",children:[S.jsx(MR,{className:"mr-2 h-4 w-4"}),"Server Log"]}),S.jsxs(Kt,{href:"/server/cfg-editor",disabled:!t("server.cfg.editor"),children:[S.jsx(TR,{className:"mr-2 h-4 w-4"}),"CFG Editor"]}),window.txConsts.showAdvanced&&S.jsxs(Kt,{href:"/advanced",className:"text-accent",disabled:!t("all_permisisons"),children:[S.jsx(LR,{className:"mr-2 h-4 w-4"}),"Advanced"]}),!1]})]})]})}function CN({style:e}){return S.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:S.jsx("path",{d:"M18.97 18.35a3.076 3.076 0 0 1-3.42 3.4h-7.1a4.075 4.075 0 0 1-1.529-.25.75.75 0 1 1 .558-1.4 2.679 2.679 0 0 0 .971.146h7.1c1.363 0 1.92-.55 1.92-1.9a3.42 3.42 0 0 0-3.4-3.7.748.748 0 0 1-.714-.783.768.768 0 0 1 .783-.715 4.872 4.872 0 0 1 4.831 5.202zm-12.67.407L2.53 22.53a.75.75 0 0 1-1.06-1.06l3.579-3.579a4.81 4.81 0 0 1 4.721-4.722l1.486-1.485a3.755 3.755 0 1 1 4.428-4.428l2.95-2.95a1.407 1.407 0 0 0-1.124-.556 1.345 1.345 0 0 0-.947.367.75.75 0 1 1-1.046-1.074 2.832 2.832 0 0 1 1.993-.793 2.9 2.9 0 0 1 2.184 1l1.776-1.78a.75.75 0 0 1 1.06 1.06L6.3 18.756zm6.55-8.667 1.24-1.24a2.29 2.29 0 0 0 .17-.84 2.255 2.255 0 1 0-2.25 2.25 2.29 2.29 0 0 0 .84-.17zm5.94-1.41h-.22a.75.75 0 0 0 0 1.5h.22a2.261 2.261 0 0 1 2.46 2.47c0 .864-.309 1.17-1.18 1.17h-.36a.75.75 0 0 0 0 1.5h.36a2.435 2.435 0 0 0 2.68-2.67 3.76 3.76 0 0 0-3.96-3.97zM5.922 8.035a.75.75 0 1 0 .3-1.471A1.421 1.421 0 0 1 6.51 3.75a1.386 1.386 0 0 1 .956.375.749.749 0 0 0 1.029-1.09A2.875 2.875 0 0 0 6.51 2.25a2.922 2.922 0 0 0-.588 5.785zM3.93 15.32h.35a.75.75 0 1 0 0-1.5h-.35c-.871 0-1.18-.306-1.18-1.17a2.261 2.261 0 0 1 2.46-2.47h.99a.75.75 0 0 0 0-1.5h-.99a3.726 3.726 0 0 0-3.96 3.97 2.435 2.435 0 0 0 2.68 2.67z"})})}function EN({style:e}){return S.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:S.jsx("path",{d:"M19.75 18.02c0 2.405-1.332 3.73-3.75 3.73H8a4.932 4.932 0 0 1-1.072-.108.75.75 0 1 1 .324-1.464A3.555 3.555 0 0 0 8 20.25h8c1.577 0 2.25-.667 2.25-2.23a3.954 3.954 0 0 0-3.411-4.22.75.75 0 1 1 .2-1.486 5.422 5.422 0 0 1 4.711 5.706zm1.78-14.49-19 19a.75.75 0 0 1-1.06-1.06l2.842-2.843a4.87 4.87 0 0 1-.062-.607c0-2.662 1.506-5.77 5.75-5.77h.689l1.521-1.52c-.068 0-.132.02-.2.02a4.25 4.25 0 1 1 4.25-4.25c0 .069-.017.133-.02.2l4.23-4.23a.75.75 0 0 1 1.06 1.06zm-9.521 5.72a2.75 2.75 0 1 0-2.75-2.75 2.753 2.753 0 0 0 2.75 2.75zm-6.18 7.861 3.293-3.293a3.7 3.7 0 0 0-3.293 3.293z"})})}const kN="https://monitor/WebPipe",RN=`txAdminPanel/v${window.txConsts.txaVersion} (atop FXServer/b${window.txConsts.fxsVersion})`,n2={"User-Agent":RN,"Content-Type":"application/json; charset=UTF-8",Accept:"application/json"};class LN extends Error{constructor(n,r){super();ls(this,"title");ls(this,"message");this.title=n,this.message=r}}const r2=()=>{const e=gD(),t=ug();return async(n,r={},i)=>{if(!e)throw new Error("CSRF token not set");if(n[0]!=="/"||n[1]==="/")throw new Error(`[useAuthedFetcher] fetchUrl MUST start with a single '/', got '${n}'.`);window.txConsts.isWebInterface||(n=kN+n),r.method??(r.method="GET");const a=await(await fetch(n,{method:r.method,headers:{...n2,"X-TxAdmin-CsrfToken":e},body:r.body?JSON.stringify(r.body):void 0,signal:i==null?void 0:i.signal})).json();if(a!=null&&a.logout)throw t("api"),new Error("Session expired");return a}},MN=async(e,t={})=>{const n=new AbortController,r=setTimeout(()=>{n.abort("timeout")},t.timeout??7500);t.method??(t.method="GET");try{const i=await fetch(e,{...n2,signal:n.signal});return clearTimeout(r),await i.json()}catch(i){throw clearTimeout(r),i}},Zt=e=>{const t=x.useRef(void 0),n=x.useRef(void 0),r=r2();return e.abortOnUnmount??(e.abortOnUnmount=!1),x.useEffect(()=>()=>{var i;e.abortOnUnmount&&((i=t.current)==null||i.abort("unmount"),n.current&&ln.dismiss(n.current))},[]),async i=>{var c,m;n.current&&(ln.dismiss(n.current),n.current=void 0),t.current=new AbortController;let o=e.path;if(i.pathParams)for(const[u,p]of Object.entries(i.pathParams))o=o.replace(`/:${u}/`,`/${p.toString()}/`);if(i.queryParams){const u=new URLSearchParams;for(const[p,g]of Object.entries(i.queryParams))u.append(p,g.toString());o+=`?${u.toString()}`}const a=`${e.method} ${e.path}`,s=(u,p)=>{if(n.current&&ln.error({title:u,msg:p},{id:n.current}),i.error)try{i.error(p,n.current)}catch(g){console.log("[ERROR CB ERROR]",a,g)}else throw new LN(u,p)};if(i.toastId&&i.toastLoadingMessage)throw new Error("[useBackendApi] toastId and toastLoadingMessage are mutually exclusive.");i.toastLoadingMessage?n.current=ln.loading(i.toastLoadingMessage):i.toastId&&(n.current=i.toastId);const l=setTimeout(()=>{var u,p;(u=t.current)!=null&&u.signal.aborted||(console.log("[TIMEOUT]",a),(p=t.current)==null||p.abort("timeout"),s("Request Timeout","If you closed txAdmin, please restart it and try again."))},i.timeout??7500);try{console.log("[>>]",a);const u=await r(o,{method:e.method,body:i.data},t.current);if(clearTimeout(l),(c=t.current)!=null&&c.signal.aborted)return;if(i.genericHandler&&n.current&&("error"in u?ln.error({title:i.genericHandler.errorTitle,msg:u.error},{id:n.current}):ln.success(i.genericHandler.successMsg,{id:n.current})),n.current&&typeof(u==null?void 0:u.type)=="string"&&typeof(u==null?void 0:u.msg)=="string"&&aD.includes(u==null?void 0:u.type)&&typeof ln[u.type]=="function"&&ln[u.type](u,{id:n.current}),i.success)try{i.success(u,n.current)}catch(p){console.log("[SUCCESS CB ERROR]",a,p)}return u}catch(u){if((m=t.current)!=null&&m.signal.aborted)return;clearTimeout(l);let p="unknown error";const g=u;typeof g.message!="string"?p=JSON.stringify(g):g.message.startsWith("NetworkError")?p=`Network error.
If you closed txAdmin, please restart it and try again.`:g.message.startsWith("JSON.parse:")?p="Invalid JSON response from server.":p=g.message,console.error("[ERROR]",a,p),s("Request Error",p)}}},Yo=gi(`h-10 sm:h-8 rounded-md transition-colors
    flex flex-grow items-center justify-center flex-shrink-0
    border bg-muted shadow-sm

    focus:outline-none disabled:opacity-50 ring-offset-background  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,{variants:{type:{default:"hover:bg-primary hover:text-primary-foreground hover:border-primary",destructive:"hover:bg-destructive hover:text-destructive-foreground hover:border-destructive",warning:"hover:bg-warning hover:text-warning-foreground hover:border-warning",success:"hover:bg-success hover:text-success-foreground hover:border-success",info:"hover:bg-info hover:text-info-foreground hover:border-info"}},defaultVariants:{type:"default"}});function AN(){const e=Ge(Ub),t=Ge(Q6),n=KL(),r=Gm(),i=ah(),{hasPerm:o}=nr(),a=Zt({method:"POST",path:"/fxserver/controls"}),s=Zt({method:"POST",path:"/fxserver/commands"}),l=_=>{const h={start:"Starting server",stop:"Stopping server",restart:"Restarting server"},f=`${h[_]}...`,d=()=>{i(),a({data:{action:_},toastLoadingMessage:f})};_==="start"?d():n({title:h[_],message:`Are you sure you want to ${_} the server?`,onConfirm:d})},c=()=>{l(t?"stop":"start")},m=()=>{t&&l("restart")},u=()=>{t&&r({title:"Send Announcement",message:"Type the message to be broadcasted to all players.",placeholder:"announcement message",submitLabel:"Send",required:!0,onSubmit:_=>{i(),s({data:{action:"admin_broadcast",parameter:_},toastLoadingMessage:"Sending announcement..."})}})},p=()=>{t&&r({title:"Kick All Players",message:"Type the kick reason or leave it blank (press enter)",placeholder:"kick reason",submitLabel:"Send",onSubmit:_=>{i(),s({data:{action:"kick_all",parameter:_},toastLoadingMessage:"Kicking players..."})}})},g=o("control.server"),y=o("players.message");return e?S.jsx("div",{className:"w-full h-8 text-center tracking-wider font-light opacity-75",children:"Server not configured."}):S.jsxs("div",{className:"flex flex-row justify-between gap-2",children:[S.jsxs(Ti,{children:[S.jsx(Di,{asChild:!0,children:t?S.jsx("button",{onClick:c,className:Yo({type:"destructive"}),disabled:!g,children:S.jsx(GR,{className:"h-5"})}):S.jsxs("div",{className:"relative flex flex-grow inset-0",children:[S.jsx("div",{className:"absolute inset-0 bg-success animate-pulse rounded blur-sm"}),S.jsx("button",{onClick:c,className:Z(Yo({type:"success"}),"relative"),disabled:!g,children:S.jsx(YR,{className:"h-5"})})]})}),S.jsx(Xr,{className:Z(!g&&"text-destructive-inline text-center"),children:g?S.jsx("p",{children:t?"Stop the server":"Start the server! 🚀"}):S.jsxs("p",{children:["You do not have permission ",S.jsx("br",{}),"to control the server."]})})]}),S.jsxs(Ti,{children:[S.jsx(Di,{asChild:!0,children:S.jsx("button",{onClick:m,className:Z(Yo({type:"warning"})),disabled:!g||!t,children:S.jsx(QR,{className:"h-5"})})}),S.jsx(Xr,{className:Z(!g&&"text-destructive-inline text-center"),children:g?S.jsx("p",{children:"Restart Server"}):S.jsxs("p",{children:["You do not have permission ",S.jsx("br",{}),"to control the server."]})})]}),S.jsxs(Ti,{children:[S.jsx(Di,{asChild:!0,children:S.jsx("button",{onClick:p,className:Yo(),disabled:!g||!t,children:S.jsx(CN,{style:{height:"1.25rem",width:"1.5rem",fill:"currentcolor"}})})}),S.jsx(Xr,{className:Z(!g&&"text-destructive-inline text-center"),children:g?S.jsx("p",{children:"Kick All Players"}):S.jsxs("p",{children:["You do not have permission ",S.jsx("br",{}),"to control the server."]})})]}),S.jsxs(Ti,{children:[S.jsx(Di,{asChild:!0,children:S.jsx("button",{onClick:u,className:Yo(),disabled:!y||!t,children:S.jsx(jR,{className:"h-5"})})}),S.jsx(Xr,{className:Z(!y&&"text-destructive-inline text-center"),children:y?S.jsx("p",{children:"Send Announcement"}):S.jsxs("p",{children:["You do not have permission ",S.jsx("br",{}),"to send an Announcement."]})})]})]})}const TN=gi("rounded-sm text-xs font-semibold px-1 py-[0.125rem] tracking-widest text-center cursor-help",{variants:{type:{default:"bg-secondary text-secondary-foreground",destructive:"bg-destructive text-destructive-foreground",warning:"bg-warning text-warning-foreground",success:"bg-success text-success-foreground",info:"bg-info text-info-foreground",muted:"bg-muted text-muted-foreground"}},defaultVariants:{type:"default"}});function ac({children:e,tooltip:t,type:n}){return S.jsxs(Ti,{children:[S.jsx(Di,{asChild:!0,children:S.jsx("span",{className:TN({type:n}),children:e})}),S.jsx(Xr,{side:"right",children:S.jsx("p",{children:t})})]})}const h1=["READY","CONNECTING","RECONNECTING","IDLE","NEARLY","DISCONNECTED","WAITING_FOR_GUILDS","IDENTIFYING","RESUMING"];function DN(){const e=Wb();let t="--",n="--",r="default",i="--",o="--",a="default",s="--",l="--",c="default";return e&&(t=e.server.status,e.server.status==="ONLINE"?(r="success",n="Resources running, accepting connections."):e.server.status==="PARTIAL"?(r="warning",n="Resources not running or not accepting connections."):e.server.status==="OFFLINE"?(r="destructive",n="Server is offline."):(r="destructive",n="Unknown server status."),e.server.whitelist==="disabled"?(i="DISABLED",o="Anyone can join."):e.server.whitelist==="adminOnly"?(i="ADMIN",a="warning",o="Only admins can join."):e.server.whitelist==="guildMember"?(i="MEMBER",o="Only guild members can join."):e.server.whitelist==="guildRoles"?(i="ROLE",o="Only guild members with the specified roles can join."):e.server.whitelist==="approvedLicense"&&(i="LICENSE",o="Only players with an approved license can join."),e.discord===!1?(s="DISABLED",c="default",l="Discord bot is disabled."):e.discord===0?(s="READY",c="default",l="Discord bot is ready."):(s=`CODE-${e.discord}`,c="destructive",l=h1[e.discord]?`Bot ws status: ${h1[e.discord]}`:"Unknown status code")),S.jsxs("div",{className:"flex flex-col gap-[0.375rem]",children:[S.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Server:",S.jsx(ac,{tooltip:n,type:r,children:t})]}),S.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Process:",S.jsx(ac,{tooltip:"Status of the FXServer process.",children:(e==null?void 0:e.server.process.toUpperCase())??"--"})]}),S.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Whitelist:",S.jsx(ac,{tooltip:o,type:a,children:i})]}),S.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Discord Bot:",S.jsx(ac,{tooltip:l,type:c,children:s})]})]})}const i2=Intl.DateTimeFormat().resolvedOptions().timeZone,PN=S.jsxs("p",{className:"text-destructive",children:["Server's timezone: ",S.jsx("b",{children:window.txConsts.serverTimezone})," ",S.jsx("br",{}),"Your timezone: ",S.jsx("b",{children:i2})," ",S.jsx("br",{}),"Either use relative times, or make sure the scheduled is based on the server timezone."]}),d1={suggestions:["+5","+10","+15","+30"],title:"When should the server restart?",message:S.jsxs(S.Fragment,{children:[S.jsxs("p",{children:["Possible formats: ",S.jsx("br",{}),S.jsxs("ul",{className:"list-disc ml-4",children:[S.jsxs("li",{children:[S.jsx(mr,{children:"+MM"})," relative time in minutes (example: ",S.jsx(mr,{children:"+15"})," for 15 minutes from now.)"]}),S.jsxs("li",{children:[S.jsx(mr,{children:"HH:MM"})," absolute 24-hour time (example: ",S.jsx(mr,{children:"23:30"})," for 11:30 PM.)"]})]})]}),i2!==window.txConsts.serverTimezone&&PN]}),placeholder:"+15",required:!0,isWide:!0},$N=e=>{if(e.startsWith("+")){const t=parseInt(e.substring(1));if(isNaN(t)||t<1||t>=1440)return!1}else{const[t,n]=e.split(":",2).map(r=>parseInt(r));if(typeof t>"u"||isNaN(t)||t<0||t>23||typeof n>"u"||isNaN(n)||n<0||n>59)return!1}return!0};function ON(){const e=ah(),t=Gm(),{hasPerm:n}=nr(),r=Zt({method:"POST",path:"/fxserver/schedule"}),i=Wb();if(!i)return S.jsxs("div",{children:[S.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),S.jsx("span",{className:"font-light text-muted-foreground italic",children:"loading..."})]});const{scheduler:o}=i;let a="nothing scheduled",s="text-muted-foreground italic",l=!1,c=!1,m=!1;const u=typeof o.nextRelativeMs=="number";if(u){const d=o.nextIsTemp?"(temp)":"",v=If(o.nextRelativeMs,{units:["h","m"]}),b=o.nextRelativeMs<6e4;b?(l=!0,a=`right now ${d}`):a=`in ${v} ${d}`,o.nextSkip?(s="text-muted-foreground line-through",b||(m=!0)):(s="text-warning-inline",b||(c=!0))}const p=d=>{if(e(),!$N(d)){ln.error(`Invalid schedule time: ${d}`);return}r({data:{action:"setNextTempSchedule",parameter:d},toastLoadingMessage:"Scheduling server restart..."})},g=()=>{t({...d1,onSubmit:p,submitLabel:"Edit"})},y=()=>{t({...d1,onSubmit:p,submitLabel:"Schedule"})},_=()=>{e(),r({data:{action:"setNextSkip",parameter:!0},toastLoadingMessage:"Cancelling next server restart..."})},h=()=>{e(),r({data:{action:"setNextSkip",parameter:!1},toastLoadingMessage:"Enabling next server restart..."})},f=n("control.server");return S.jsxs("div",{children:[S.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),S.jsx("span",{className:Z("font-light",s),children:a}),S.jsxs("div",{className:"flex flex-row justify-between gap-2 mt-2 flex-wrap",children:[u?S.jsxs(Oe,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!f||l,onClick:g,children:[S.jsx(UR,{className:"h-4 w-4 mr-1"})," Edit"]}):S.jsxs(Oe,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!f||l,onClick:y,children:[S.jsx(qR,{className:"h-4 w-4 mr-1"})," Schedule Restart"]}),c&&S.jsxs(Oe,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",onClick:_,disabled:!f,children:[S.jsx(sL,{className:"h-4 w-4 mr-1"})," Cancel"]}),m&&S.jsxs(Oe,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border",onClick:h,disabled:!f,children:[S.jsx(KR,{className:"h-4 w-4 mr-1"})," Enable"]})]})]})}function s2({isSheet:e}){return S.jsxs("aside",{className:Z("flex flex-col gap-4 z-10",e?"mr-4 pl-2":"tx-sidebar hidden lg:flex"),children:[S.jsx("div",{className:Z(!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm p-4"),children:S.jsx(SN,{})}),S.jsx("hr",{className:e?"block":"hidden"}),S.jsxs("div",{className:Z(!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm p-4","flex flex-col gap-4"),children:[S.jsx(AN,{}),S.jsx(DN,{}),S.jsx(ON,{})]}),S.jsx("hr",{className:e?"block":"hidden"}),window.txConsts.adsData.main?S.jsxs("a",{href:window.txConsts.adsData.main.url,onClick:Oa,target:"_blank",className:`w-sidebar h-[80px] relative self-center group shadow-sm opacity-80 hover:opacity-100
                    dark:brightness-90 dark:hover:brightness-100`,children:[S.jsx("div",{className:`absolute inset-0 -z-10 animate-pulse blur 
                    scale-0 group-hover:scale-100 transition-transform bg-black
                    dark:bg-gradient-to-r dark:from-[#18E889] dark:to-[#01FFFF]`}),S.jsx("img",{className:"rounded-xl max-w-sidebar max-h-[80px] m-auto",src:window.txConsts.adsData.main.img})]}):null,window.txConsts.isWebInterface?S.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 text-sm font-light opacity-85 hover:opacity-100",children:[S.jsxs("span",{className:"text-muted-foreground text-smx",children:["tx: ",S.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",S.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]}),S.jsxs("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",onClick:Oa,target:"_blank",className:"text-muted-foreground hover:text-accent",children:["© 2019-",new Date().getUTCFullYear()," Tabarra"]})]}):null]})}function IN(){const t=Ge(th).toLocaleString("en-US");return S.jsxs("div",{className:"w-full flex justify-between items-center p-4",children:[S.jsx("div",{className:"w-16 h-16 dark:bg-zinc-600/50 bg-zinc-300/75 rounded-full flex items-center justify-center",children:S.jsx(ax,{className:"w-10 h-10 dark:text-zinc-400 text-zinc-500 text-opacity-80 stroke-1"})}),S.jsxs("div",{className:"flex flex-col items-end",children:[S.jsx("div",{className:"text-4xl font-mono font-extralight",children:t}),S.jsx("div",{className:"opacity-80 text-lg font-light tracking-wider",children:"Players"})]})]})}const NN=e=>{let t=e.substring(0,75).replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200D\uFEFF\u200E\uA9C1-\uA9C5\u239B-\u23AD]/g,"").replace(/~(HUD_\S+|HC_\S+|[a-z]|[a1]_\d+|bold|italic|ws|wanted_star|nrt|EX_R\*|BLIP_\S+|ACCEPT|CANCEL|PAD_\S+|INPUT_\S+|INPUTGROUP_\S+)~/ig,"").replace(/\^\d/ig,"").replace(new RegExp("\\p{Mark}{2,}","ug"),"").replace(/\s+/g," ").trim();t.length||(t="empty name");let n=t.normalize("NFKC").replace(/[^\p{Letter}\p{Number} ]/gu,"").replace(/\s+/g,"").toLocaleLowerCase().trim();return n.length||(n="emptyname"),{displayName:t,pureName:n}};/**
 * react-virtual
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function Lu(){return Lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lu.apply(this,arguments)}/**
 * virtual-core
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function Mu(){return Mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mu.apply(this,arguments)}/**
 * virtual-core
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function gs(e,t,n){var r,i=(r=n.initialDeps)!=null?r:[],o;return function(){var a;n.key&&n.debug!=null&&n.debug()&&(a=Date.now());var s=e(),l=s.length!==i.length||s.some(function(y,_){return i[_]!==y});if(!l)return o;i=s;var c;if(n.key&&n.debug!=null&&n.debug()&&(c=Date.now()),o=t.apply(void 0,s),n.key&&n.debug!=null&&n.debug()){var m=Math.round((Date.now()-a)*100)/100,u=Math.round((Date.now()-c)*100)/100,p=u/16,g=function(_,h){for(_=String(_);_.length<h;)_=" "+_;return _};console.info("%c⏱ "+g(u,5)+" /"+g(m,5)+" ms",`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(`+Math.max(0,Math.min(120-120*p,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(o),o}}function Td(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var BN=function(t,n){return Math.abs(t-n)<1};/**
 * virtual-core
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var jN=function(t){return t},FN=function(t){for(var n=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1),i=[],o=n;o<=r;o++)i.push(o);return i},zN=function(t,n){var r=t.scrollElement;if(r){var i=function(s){var l=s.width,c=s.height;n({width:Math.round(l),height:Math.round(c)})};i(r.getBoundingClientRect());var o=new ResizeObserver(function(a){var s=a[0];if(s!=null&&s.borderBoxSize){var l=s.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(r.getBoundingClientRect())});return o.observe(r,{box:"border-box"}),function(){o.unobserve(r)}}},HN=function(t,n){var r=t.scrollElement;if(r){var i=function(){n(r[t.options.horizontal?"scrollLeft":"scrollTop"])};return i(),r.addEventListener("scroll",i,{passive:!0}),function(){r.removeEventListener("scroll",i)}}},UN=function(t,n,r){if(n!=null&&n.borderBoxSize){var i=n.borderBoxSize[0];if(i){var o=Math.round(i[r.options.horizontal?"inlineSize":"blockSize"]);return o}}return Math.round(t.getBoundingClientRect()[r.options.horizontal?"width":"height"])},WN=function(t,n,r){var i,o,a=n.adjustments,s=a===void 0?0:a,l=n.behavior,c=t+s;(i=r.scrollElement)==null||i.scrollTo==null||i.scrollTo((o={},o[r.options.horizontal?"left":"top"]=c,o.behavior=l,o))},VN=function(t){var n=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var r=null,i=function(){return r||(typeof ResizeObserver<"u"?r=new ResizeObserver(function(a){a.forEach(function(s){n._measureElement(s.target,s)})}):null)};return{disconnect:function(){var a;return(a=i())==null?void 0:a.disconnect()},observe:function(a){var s;return(s=i())==null?void 0:s.observe(a,{box:"border-box"})},unobserve:function(a){var s;return(s=i())==null?void 0:s.unobserve(a)}}}(),this.range=null,this.setOptions=function(r){Object.entries(r).forEach(function(i){var o=i[0],a=i[1];typeof a>"u"&&delete r[o]}),n.options=Mu({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:jN,rangeExtractor:FN,onChange:function(){},measureElement:UN,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},r)},this.notify=function(r){n.options.onChange==null||n.options.onChange(n,r)},this.maybeNotify=gs(function(){return n.calculateRange(),[n.isScrolling,n.range?n.range.startIndex:null,n.range?n.range.endIndex:null]},function(r){n.notify(r)},{key:!1,debug:function(){return n.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){n.unsubs.filter(Boolean).forEach(function(r){return r()}),n.unsubs=[],n.scrollElement=null},this._didMount=function(){return n.measureElementCache.forEach(n.observer.observe),function(){n.observer.disconnect(),n.cleanup()}},this._willUpdate=function(){var r=n.options.getScrollElement();n.scrollElement!==r&&(n.cleanup(),n.scrollElement=r,n._scrollToOffset(n.scrollOffset,{adjustments:void 0,behavior:void 0}),n.unsubs.push(n.options.observeElementRect(n,function(i){n.scrollRect=i,n.maybeNotify()})),n.unsubs.push(n.options.observeElementOffset(n,function(i){n.scrollAdjustments=0,n.scrollOffset!==i&&(n.isScrollingTimeoutId!==null&&(clearTimeout(n.isScrollingTimeoutId),n.isScrollingTimeoutId=null),n.isScrolling=!0,n.scrollDirection=n.scrollOffset<i?"forward":"backward",n.scrollOffset=i,n.maybeNotify(),n.isScrollingTimeoutId=setTimeout(function(){n.isScrollingTimeoutId=null,n.isScrolling=!1,n.scrollDirection=null,n.maybeNotify()},n.options.scrollingDelay))})))},this.getSize=function(){return n.scrollRect[n.options.horizontal?"width":"height"]},this.memoOptions=gs(function(){return[n.options.count,n.options.paddingStart,n.options.scrollMargin,n.options.getItemKey]},function(r,i,o,a){return n.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:i,scrollMargin:o,getItemKey:a}},{key:!1}),this.getFurthestMeasurement=function(r,i){for(var o=new Map,a=new Map,s=i-1;s>=0;s--){var l=r[s];if(!o.has(l.lane)){var c=a.get(l.lane);if(c==null||l.end>c.end?a.set(l.lane,l):l.end<c.end&&o.set(l.lane,!0),o.size===n.options.lanes)break}}return a.size===n.options.lanes?Array.from(a.values()).sort(function(m,u){return m.end-u.end})[0]:void 0},this.getMeasurements=gs(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,i){var o=r.count,a=r.paddingStart,s=r.scrollMargin,l=r.getItemKey,c=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var m=n.measurementsCache.slice(0,c),u=c;u<o;u++){var p=l(u),g=n.options.lanes===1?m[u-1]:n.getFurthestMeasurement(m,u),y=g?g.end:a+s,_=i.get(p),h=typeof _=="number"?_:n.options.estimateSize(u),f=y+h,d=g?g.lane:u%n.options.lanes;m[u]={index:u,start:y,size:h,end:f,key:p,lane:d}}return n.measurementsCache=m,m},{key:!1,debug:function(){return n.options.debug}}),this.calculateRange=gs(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,i,o){return n.range=r.length>0&&i>0?KN({measurements:r,outerSize:i,scrollOffset:o}):null},{key:!1,debug:function(){return n.options.debug}}),this.getIndexes=gs(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,i,o,a){return i===null?[]:r(Mu({},i,{overscan:o,count:a}))},{key:!1,debug:function(){return n.options.debug}}),this.indexFromElement=function(r){var i=n.options.indexAttribute,o=r.getAttribute(i);return o?parseInt(o,10):(console.warn("Missing attribute name '"+i+"={index}' on measured element."),-1)},this._measureElement=function(r,i){var o=n.measurementsCache[n.indexFromElement(r)];if(!o||!r.isConnected){n.measureElementCache.forEach(function(l,c){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(c))});return}var a=n.measureElementCache.get(o.key);a!==r&&(a&&n.observer.unobserve(a),n.observer.observe(r),n.measureElementCache.set(o.key,r));var s=n.options.measureElement(r,i,n);n.resizeItem(o,s)},this.resizeItem=function(r,i){var o,a=(o=n.itemSizeCache.get(r.key))!=null?o:r.size,s=i-a;s!==0&&(r.start<n.scrollOffset&&n._scrollToOffset(n.scrollOffset,{adjustments:n.scrollAdjustments+=s,behavior:void 0}),n.pendingMeasuredCacheIndexes.push(r.index),n.itemSizeCache=new Map(n.itemSizeCache.set(r.key,i)),n.notify(!1))},this.measureElement=function(r){r&&n._measureElement(r,void 0)},this.getVirtualItems=gs(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,i){for(var o=[],a=0,s=r.length;a<s;a++){var l=r[a],c=i[l];o.push(c)}return o},{key:!1,debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var i=n.getMeasurements();return Td(i[o2(0,i.length-1,function(o){return Td(i[o]).start},r)])},this.getOffsetForAlignment=function(r,i){var o=n.getSize();i==="auto"&&(r<=n.scrollOffset?i="start":r>=n.scrollOffset+o?i="end":i="start"),i==="start"?r=r:i==="end"?r=r-o:i==="center"&&(r=r-o/2);var a=n.options.horizontal?"scrollWidth":"scrollHeight",s=n.scrollElement?"document"in n.scrollElement?n.scrollElement.document.documentElement[a]:n.scrollElement[a]:0,l=s-n.getSize();return Math.max(Math.min(l,r),0)},this.getOffsetForIndex=function(r,i){i===void 0&&(i="auto"),r=Math.max(0,Math.min(r,n.options.count-1));var o=Td(n.getMeasurements()[r]);if(i==="auto")if(o.end>=n.scrollOffset+n.getSize()-n.options.scrollPaddingEnd)i="end";else if(o.start<=n.scrollOffset+n.options.scrollPaddingStart)i="start";else return[n.scrollOffset,i];var a=i==="end"?o.end+n.options.scrollPaddingEnd:o.start-n.options.scrollPaddingStart;return[n.getOffsetForAlignment(a,i),i]},this.isDynamicMode=function(){return n.measureElementCache.size>0},this.cancelScrollToIndex=function(){n.scrollToIndexTimeoutId!==null&&(clearTimeout(n.scrollToIndexTimeoutId),n.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(r,i){var o=i===void 0?{}:i,a=o.align,s=a===void 0?"start":a,l=o.behavior;n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.getOffsetForAlignment(r,s),{adjustments:void 0,behavior:l})},this.scrollToIndex=function(r,i){var o=i===void 0?{}:i,a=o.align,s=a===void 0?"auto":a,l=o.behavior;r=Math.max(0,Math.min(r,n.options.count-1)),n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var c=n.getOffsetForIndex(r,s),m=c[0],u=c[1];n._scrollToOffset(m,{adjustments:void 0,behavior:l}),l!=="smooth"&&n.isDynamicMode()&&(n.scrollToIndexTimeoutId=setTimeout(function(){n.scrollToIndexTimeoutId=null;var p=n.measureElementCache.has(n.options.getItemKey(r));if(p){var g=n.getOffsetForIndex(r,u),y=g[0];BN(y,n.scrollOffset)||n.scrollToIndex(r,{align:u,behavior:l})}else n.scrollToIndex(r,{align:u,behavior:l})}))},this.scrollBy=function(r,i){var o=i===void 0?{}:i,a=o.behavior;n.cancelScrollToIndex(),a==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.scrollOffset+r,{adjustments:void 0,behavior:a})},this.getTotalSize=function(){var r;return(((r=n.getMeasurements()[n.options.count-1])==null?void 0:r.end)||n.options.paddingStart)-n.options.scrollMargin+n.options.paddingEnd},this._scrollToOffset=function(r,i){var o=i.adjustments,a=i.behavior;n.options.scrollToFn(r,{behavior:a,adjustments:o},n)},this.measure=function(){n.itemSizeCache=new Map,n.notify(!1)},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(r){n.itemSizeCache.set(r.key,r.size)}),this.maybeNotify()},o2=function(t,n,r,i){for(;t<=n;){var o=(t+n)/2|0,a=r(o);if(a<i)t=o+1;else if(a>i)n=o-1;else return o}return t>0?t-1:0};function KN(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,i=t.length-1,o=function(c){return t[c].start},a=o2(0,i,o,r),s=a;s<i&&t[s].end<r+n;)s++;return{startIndex:a,endIndex:s}}/**
 * react-virtual
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var qN=typeof document<"u"?x.useLayoutEffect:x.useEffect;function GN(e){var t=x.useReducer(function(){return{}},{})[1],n=Lu({},e,{onChange:function(a,s){s?mi.flushSync(t):t(),e.onChange==null||e.onChange(a,s)}}),r=x.useState(function(){return new VN(n)}),i=r[0];return i.setOptions(n),x.useEffect(function(){return i._didMount()},[]),qN(function(){return i._willUpdate()}),i}function YN(e){return GN(Lu({observeElementRect:zN,observeElementOffset:HN,scrollToFn:WN},e))}function XN({filterString:e,setFilterString:t}){const n=x.useRef(null);return Yi("message",r=>{var i;r.data.type==="globalHotkey"&&r.data.action==="focusPlayerlistFilter"&&((i=n.current)==null||i.focus())}),S.jsx("div",{className:"pt-2 px-2 flex gap-2",children:S.jsxs("div",{className:"relative w-full",children:[S.jsx(mt,{ref:n,className:"h-8",placeholder:"Filter by Name or ID",value:e,onChange:r=>t(r.target.value),onKeyDown:r=>{r.key==="Escape"&&t("")}}),e?S.jsx("button",{className:"absolute right-2 inset-y-0 text-zinc-500 dark:text-zinc-400 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",onClick:()=>t(""),children:S.jsx(dl,{})}):S.jsx("div",{className:"absolute right-2 inset-y-0 flex items-center text-zinc-500 dark:text-zinc-400 select-none pointer-events-none",children:S.jsx(mr,{className:"text-xs tracking-wide",children:"ctrl+k"})})]})})}const QN=x.memo(XN);function JN({virtualItem:e,player:t,modalOpener:n}){return S.jsxs("div",{className:"player",style:{height:`${e.size}px`,transform:`translateY(${e.start}px)`},onClick:()=>n(t.netid),children:[S.jsx("div",{className:"pid-block leading-[1.7]",children:S.jsx("span",{className:"pid-badge",children:t.netid})}),S.jsx("span",{className:"pname",children:t.displayName})]})}function ZN(){const e=Ge(Fm),t=Ge(Vb),n=Mx(),r=x.useRef(null),[i,o]=x.useState(""),a=x.useMemo(()=>{const u=NN(i).pureName;return u!=="emptyname"?e.filter(p=>p.pureName.includes(u)||p.netid.toString().includes(u)):e},[e,i]),s=x.useMemo(()=>{var g;const u=((g=e.at(-1))==null?void 0:g.netid)??0;return`.tx-playerlist .player .pid-block { min-width: ${Math.floor(Math.log10(u))+1+1}ch; }`},[e]),l=YN({scrollingDelay:0,count:a.length,getScrollElement:()=>{var u;return(u=r.current)==null?void 0:u.getElementsByTagName("div")[0]},estimateSize:()=>30,overscan:15}),c=l.getVirtualItems(),m=u=>{t&&n({mutex:t,netid:u})};return S.jsxs(S.Fragment,{children:[S.jsx(QN,{filterString:i,setFilterString:o}),S.jsxs("div",{className:Z("text-center m-1 text-warning-inline tracking-wider italic text-xs",a.length!==e.length&&c.length?"block":"hidden"),children:["Showing ",a.length," of ",e.length," players."]}),S.jsx("div",{className:Z("text-center m-6 text-muted-foreground tracking-wider italic",c.length?"hidden":"block"),children:e.length&&i?S.jsxs("p",{children:["No players to show.",S.jsx("span",{className:"text-xs block opacity-75",children:"Clear the filter to show all players."})]}):S.jsxs("p",{children:["No players online.",S.jsx("span",{className:"text-xs block opacity-75",children:"Invite some friends to join in!"})]})}),S.jsx("style",{children:s}),S.jsx(Eo,{className:"h-full select-none",ref:r,children:S.jsx("div",{className:"tx-playerlist",style:{height:`${l.getTotalSize()}px`,width:"100%",position:"relative"},children:c.map(u=>S.jsx(JN,{virtualItem:u,player:a[u.index],modalOpener:m},u.key))})})]})}function a2({isSheet:e}){return S.jsxs("aside",{className:Z("flex flex-col gap-4 z-10",e?"w-full pr-2":"tx-sidebar hidden xl:flex"),style:{height:e?"calc(100vh - 3rem)":"calc(100vh - 3.5rem - 1px - 2rem)"},children:[S.jsx("div",{className:"rounded-xl border border-border bg-card text-card-foreground shadow-sm shrink-0",children:S.jsx(IN,{})}),S.jsx("div",{className:Z("min-h-[480px]",!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm","flex flex-col gap-2 flex-grow overflow-hidden"),children:S.jsx(ZN,{})})]})}const l2="Dialog",[c2,u2]=Ft(l2),[e9,rr]=c2(l2),t9=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=x.useRef(null),l=x.useRef(null),[c=!1,m]=xr({prop:r,defaultProp:i,onChange:o});return x.createElement(e9,{scope:t,triggerRef:s,contentRef:l,contentId:gn(),titleId:gn(),descriptionId:gn(),open:c,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(u=>!u),[m]),modal:a},n)},h2="DialogPortal",[n9,d2]=c2(h2,{forceMount:void 0}),r9=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=rr(h2,t);return x.createElement(n9,{scope:t,forceMount:n},x.Children.map(r,a=>x.createElement(ut,{present:n||o.open},x.createElement(xg,{asChild:!0,container:i},a))))},kp="DialogOverlay",i9=x.forwardRef((e,t)=>{const n=d2(kp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=rr(kp,e.__scopeDialog);return o.modal?x.createElement(ut,{present:r||o.open},x.createElement(s9,Y({},i,{ref:t}))):null}),s9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=rr(kp,n);return x.createElement(Eg,{as:ai,allowPinchZoom:!0,shards:[i.contentRef]},x.createElement(fe.div,Y({"data-state":m2(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),mo="DialogContent",o9=x.forwardRef((e,t)=>{const n=d2(mo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=rr(mo,e.__scopeDialog);return x.createElement(ut,{present:r||o.open},o.modal?x.createElement(a9,Y({},i,{ref:t})):x.createElement(l9,Y({},i,{ref:t})))}),a9=x.forwardRef((e,t)=>{const n=rr(mo,e.__scopeDialog),r=x.useRef(null),i=Se(t,n.contentRef,r);return x.useEffect(()=>{const o=r.current;if(o)return Cg(o)},[]),x.createElement(f2,Y({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:ne(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:ne(e.onFocusOutside,o=>o.preventDefault())}))}),l9=x.forwardRef((e,t)=>{const n=rr(mo,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return x.createElement(f2,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a;if((a=e.onCloseAutoFocus)===null||a===void 0||a.call(e,o),!o.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var a,s;(a=e.onInteractOutside)===null||a===void 0||a.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),f2=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=rr(mo,n),l=x.useRef(null),c=Se(t,l);return hg(),x.createElement(x.Fragment,null,x.createElement(dg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},x.createElement(vl,Y({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":m2(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),p2="DialogTitle",c9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=rr(p2,n);return x.createElement(fe.h2,Y({id:i.titleId},r,{ref:t}))}),u9="DialogDescription",h9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=rr(u9,n);return x.createElement(fe.p,Y({id:i.descriptionId},r,{ref:t}))}),d9="DialogClose",f9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=rr(d9,n);return x.createElement(fe.button,Y({type:"button"},r,{ref:t,onClick:ne(e.onClick,()=>i.onOpenChange(!1))}))});function m2(e){return e?"open":"closed"}const p9="DialogTitleWarning",[m9,Uj]=m6(p9,{contentName:mo,titleName:p2,docsSlug:"dialog"}),Hg=t9,Ug=r9,bl=i9,xl=o9,Sl=c9,Cl=h9,wh=f9,Wg=Hg,g9=Ug,g2=x.forwardRef(({className:e,...t},n)=>S.jsx(bl,{className:Z("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));g2.displayName=bl.displayName;const v9=gi("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),bh=x.forwardRef(({side:e="right",className:t,children:n,...r},i)=>S.jsxs(g9,{children:[S.jsx(g2,{}),S.jsxs(xl,{ref:i,className:Z(v9({side:e}),t),...r,children:[n,S.jsxs(wh,{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-secondary",children:[S.jsx(dl,{className:"h-8 w-8 sm:h-6 sm:w-6 md:h-4 md:w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bh.displayName=xl.displayName;const v2=({className:e,...t})=>S.jsx("div",{className:Z("flex flex-col space-y-2 text-center sm:text-left",e),...t});v2.displayName="SheetHeader";const _2=x.forwardRef(({className:e,...t},n)=>S.jsx(Sl,{ref:n,className:Z("text-lg font-semibold text-foreground",e),...t}));_2.displayName=Sl.displayName;const _9=x.forwardRef(({className:e,...t},n)=>S.jsx(Cl,{ref:n,className:Z("text-sm text-muted-foreground",e),...t}));_9.displayName=Cl.displayName;function y9(){const{isSheetOpen:e,setIsSheetOpen:t}=Ex(),{hasPerm:n}=nr();return S.jsx(Wg,{open:e,onOpenChange:t,children:S.jsxs(bh,{side:"left",className:"flex flex-col gap-6 w-full xs:w-3/4 select-none",onOpenAutoFocus:r=>r.preventDefault(),children:[S.jsx(v2,{children:S.jsx(_2,{children:S.jsx(Sp,{href:"/",children:S.jsx(Fg,{className:"h-9 hover:scale-105 hover:brightness-110"})})})}),S.jsxs("div",{children:[S.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"Global Menu"}),S.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[S.jsxs(Kt,{href:"/players",children:[S.jsx(ax,{className:"mr-2 h-4 w-4"}),"Players"]}),S.jsxs(Kt,{href:"/whitelist",children:[S.jsx(kR,{className:"mr-2 h-4 w-4"}),"Whitelist"]}),S.jsxs(Kt,{href:"/admins",disabled:!n("manage.admins"),children:[S.jsx(tL,{className:"mr-2 h-4 w-4"}),"Admins"]}),S.jsxs(Kt,{href:"/settings",disabled:!n("settings.view"),children:[S.jsx(ZR,{className:"mr-2 h-4 w-4"}),"Settings"]})]})]}),S.jsxs("div",{children:[S.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"System Menu"}),S.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[S.jsxs(Kt,{href:"/system/master-actions",children:[S.jsx(oL,{className:"mr-2 h-4 w-4"}),"Master Actions"]}),S.jsxs(Kt,{href:"/system/diagnostics",children:[S.jsx(VR,{className:"mr-2 h-4 w-4"}),"Diagnostics"]}),S.jsxs(Kt,{href:"/system/system-logs",disabled:!n("txadmin.log.view"),children:[S.jsx(ox,{className:"mr-2 h-4 w-4"}),"System Logs"]})]})]})]})})}function w9(){const{isSheetOpen:e,setIsSheetOpen:t}=kx();return S.jsx(Wg,{open:e,onOpenChange:t,children:S.jsx(bh,{side:"left",className:"w-full xs:w-3/4",onOpenAutoFocus:n=>n.preventDefault(),children:S.jsx(Eo,{className:"h-full",children:S.jsx(s2,{isSheet:!0})})})})}function b9(){const{isSheetOpen:e,setIsSheetOpen:t}=Rx();return S.jsx(Wg,{open:e,onOpenChange:t,children:S.jsx(bh,{side:"right",className:"w-full xs:w-3/4",onOpenAutoFocus:n=>n.preventDefault(),children:S.jsx(Eo,{className:"h-full",children:S.jsx(a2,{isSheet:!0})})})})}function x9(){return S.jsxs(S.Fragment,{children:[S.jsx(y9,{}),S.jsx(w9,{}),S.jsx(b9,{})]})}const y2=De(!1),w2=De(window.txConsts.fxsOutdated),b2=De(window.txConsts.txaOutdated);function S9(){const[e,t]=mn(y2),[n,r]=mn(w2),[i,o]=mn(b2);return{offlineWarning:e,setOfflineWarning:t,fxUpdateData:n,setFxUpdateData:r,txUpdateData:i,setTxUpdateData:o}}const C9=()=>Ne(y2),E9=()=>{const e=Ne(w2),t=Ne(b2);return n=>{e(n.fxserver),t(n.txadmin),window.txConsts.fxsOutdated=n.fxserver,window.txConsts.txaOutdated=n.txadmin}},x2="tsUpdateDismissed",k9=12*60*60*1e3,R9=48*60*60*1e3,L9=()=>{const e=localStorage.getItem(x2);if(!e)return!1;const t=parseInt(e);return isNaN(t)?!1:t},M9=e=>{const t=L9(),n=Date.now();return!t||t+(e?k9:R9)<n};function Dd({titleIcon:e,title:t,description:n,isImportant:r,canPostpone:i}){const[o,a]=x.useState(0),s=()=>{a(Math.random())},l=()=>{localStorage.setItem(x2,Date.now().toString()),s()};return x.useEffect(()=>{const c=setInterval(()=>{s()},6e4);return()=>clearInterval(c)},[]),i&&!M9(r)?null:S.jsx("div",{className:"absolute top-[calc(3.5rem+1px)] w-full flex justify-center z-40",children:S.jsxs("div",{className:Z("w-full sm:w-[28rem] h-9 hover:h-32 overflow-hidden sm:rounded-b-md","flex flex-col justify-center items-center p-2","group cursor-default transition-[height] shadow-xl",r?"bg-destructive text-destructive-foreground":"bg-info text-info-foreground"),children:[S.jsxs("h2",{className:"text-md group-hover:font-medium",children:[e,t]}),S.jsxs("span",{className:"hidden group-hover:block text-center text-sm",children:[n,S.jsxs("div",{className:"flex flex-row justify-center items-center mt-3 gap-4",children:[i&&S.jsxs(Oe,{size:"xs",variant:"outline",onClick:()=>l(),className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:[S.jsx(gR,{className:"h-[0.9rem] mr-1"})," Postpone"]}),S.jsx(Oe,{size:"xs",variant:"outline",asChild:!0,className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:S.jsxs("a",{href:"https://discord.gg/uAmsGa2",target:"_blank",children:[S.jsx(t2,{size:"14",className:"mr-1"})," Support"]})})]})]})]})})}function A9(){const{offlineWarning:e,txUpdateData:t,fxUpdateData:n}=S9();return e?S.jsx(Dd,{titleIcon:S.jsx(RR,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:"Socket connection lost.",description:S.jsxs(S.Fragment,{children:["The connection to the txAdmin server has been lost. ",S.jsx("br",{}),"If you closed FXServer, please restart it."]}),isImportant:!0,canPostpone:!1}):t?S.jsx(Dd,{titleIcon:S.jsx(F0,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:t.isImportant?"This version of txAdmin is outdated.":"A patch (bug fix) update is available for txAdmin.",description:t.isImportant?`Version v${t.version} has been released bringing new features, bug fixes and improvements.`:`If you are experiencing any kind of issue, please update to v${t.version}.`,isImportant:t.isImportant,canPostpone:!0}):n?S.jsx(Dd,{titleIcon:S.jsx(F0,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:n.isImportant?"This version of FXServer is outdated.":"An update is available for FXServer.",description:`Please update FXServer to artifact ${n.version}.`,isImportant:n.isImportant,canPostpone:!0}):null}const T9="AlertDialog",[D9,Wj]=Ft(T9,[u2]),yi=u2(),P9=e=>{const{__scopeAlertDialog:t,...n}=e,r=yi(t);return x.createElement(Hg,Y({},r,n,{modal:!0}))},$9=e=>{const{__scopeAlertDialog:t,...n}=e,r=yi(t);return x.createElement(Ug,Y({},r,n))},O9=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=yi(n);return x.createElement(bl,Y({},i,r,{ref:t}))}),S2="AlertDialogContent",[I9,N9]=D9(S2),B9=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=yi(n),a=x.useRef(null),s=Se(t,a),l=x.useRef(null);return x.createElement(m9,{contentName:S2,titleName:j9,docsSlug:"alert-dialog"},x.createElement(I9,{scope:n,cancelRef:l},x.createElement(xl,Y({role:"alertdialog"},o,i,{ref:s,onOpenAutoFocus:ne(i.onOpenAutoFocus,c=>{var m;c.preventDefault(),(m=l.current)===null||m===void 0||m.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault()}),x.createElement(Bm,null,r),!1)))}),j9="AlertDialogTitle",F9=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=yi(n);return x.createElement(Sl,Y({},i,r,{ref:t}))}),z9=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=yi(n);return x.createElement(Cl,Y({},i,r,{ref:t}))}),H9=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=yi(n);return x.createElement(wh,Y({},i,r,{ref:t}))}),U9="AlertDialogCancel",W9=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=N9(U9,n),o=yi(n),a=Se(t,i);return x.createElement(wh,Y({},o,r,{ref:a}))}),V9=P9,K9=$9,C2=O9,E2=B9,k2=H9,R2=W9,L2=F9,M2=z9,q9=V9,G9=K9,A2=x.forwardRef(({className:e,...t},n)=>S.jsx(C2,{className:Z("fixed inset-0 z-50 bg-black/40 dark:bg-black/75 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));A2.displayName=C2.displayName;const T2=x.forwardRef(({className:e,...t},n)=>S.jsxs(G9,{children:[S.jsx(A2,{}),S.jsx(E2,{ref:n,className:Z("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg 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%] sm:rounded-lg",e),...t})]}));T2.displayName=E2.displayName;const D2=({className:e,...t})=>S.jsx("div",{className:Z("flex flex-col space-y-2 text-center sm:text-left",e),...t});D2.displayName="AlertDialogHeader";const P2=({className:e,...t})=>S.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});P2.displayName="AlertDialogFooter";const $2=x.forwardRef(({className:e,...t},n)=>S.jsx(L2,{ref:n,className:Z("text-lg font-semibold",e),...t}));$2.displayName=L2.displayName;const O2=x.forwardRef(({className:e,...t},n)=>S.jsx(M2,{ref:n,className:Z("text-sm text-muted-foreground",e),...t}));O2.displayName=M2.displayName;const I2=x.forwardRef(({className:e,...t},n)=>S.jsx(k2,{ref:n,className:Z(hl(),e),...t}));I2.displayName=k2.displayName;const N2=x.forwardRef(({className:e,...t},n)=>S.jsx(R2,{ref:n,className:Z(hl({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));N2.displayName=R2.displayName;function Y9(){const e=x.useRef(null),t=GL(),n=qL(),r=()=>{t.isOpen&&(n(),t.onCancel&&t.onCancel())},i=()=>{t.isOpen&&(n(),t.onConfirm())},o=s=>{s.preventDefault(),s.key==="Enter"||s.key==="NumpadEnter"?i():(s.key==="Backspace"||s.key==="Escape")&&r()},a=s=>{s||r()};return Xk(e,r),S.jsx(q9,{open:t.isOpen,onOpenChange:a,children:S.jsxs(T2,{ref:e,children:[S.jsxs(D2,{children:[S.jsx($2,{children:t.title}),S.jsx(O2,{children:t.message})]}),S.jsxs(P2,{children:[S.jsx(N2,{children:t.cancelLabel??"Cancel"}),S.jsx(I2,{autoFocus:!0,onKeyDown:o,onClick:i,className:Z(hl({variant:t.confirmBtnVariant??"destructive"})),children:t.actionLabel??"Continue"})]})]})})}const Vg=Hg,X9=Ug,B2=x.forwardRef(({className:e,...t},n)=>S.jsx(bl,{ref:n,className:Z("fixed inset-0 z-50 bg-black/40 dark:bg-black/75 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));B2.displayName=bl.displayName;const xh=x.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(X9,{children:[S.jsx(B2,{}),S.jsxs(xl,{ref:r,className:Z("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg 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%] sm:rounded-lg",e),...n,children:[t,S.jsxs(wh,{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:[S.jsx(dl,{className:"h-6 w-6"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xh.displayName=xl.displayName;const Sh=({className:e,...t})=>S.jsx("div",{className:Z("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Sh.displayName="DialogHeader";const Kg=({className:e,...t})=>S.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Kg.displayName="DialogFooter";const Ch=x.forwardRef(({className:e,...t},n)=>S.jsx(Sl,{ref:n,className:Z("text-lg font-semibold leading-none tracking-tight",e),...t}));Ch.displayName=Sl.displayName;const j2=x.forwardRef(({className:e,...t},n)=>S.jsx(Cl,{ref:n,className:Z("text-sm text-muted-foreground",e),...t}));j2.displayName=Cl.displayName;function Q9(){const e=x.useRef(null),t=XL(),n=YL(),r=()=>{var s;if(!t.isOpen)return;n();const a=((s=e.current)==null?void 0:s.value)??"";t.onSubmit(a.trim())},i=a=>{a.preventDefault(),r()},o=a=>{t.isOpen&&(a||(n(),t.onCancel&&t.onCancel()))};return S.jsx(Vg,{open:t.isOpen,onOpenChange:o,children:S.jsx(xh,{className:Z(t.isWide&&"md:max-w-2xl"),children:S.jsxs("form",{onSubmit:i,className:"grid gap-4",children:[S.jsxs(Sh,{children:[S.jsx(Ch,{children:t.title}),S.jsx(j2,{children:t.message})]}),S.jsx(mt,{autoFocus:!0,id:"userInput",ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required}),S.jsxs(Kg,{className:"gap-2 flex-col",children:[S.jsx("div",{className:"flex flex-col sm:flex-row sm:justify-start gap-2 w-full flex-wrap",children:t.suggestions&&t.suggestions.map((a,s)=>S.jsxs(Oe,{type:"button",onClick:()=>{e.current.value=a,r()},variant:"outline",children:[S.jsx("span",{className:"sm:hidden mr-auto text-muted-foreground",children:"Suggestion:"}),a]},s))}),S.jsx(Oe,{type:"submit",variant:t.submitBtnVariant??"default",children:t.submitLabel??"Submit"})]})]})})})}const Oc=x.forwardRef((e,t)=>x.createElement(fe.label,Y({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),F2=Oc,J9=gi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),On=x.forwardRef(({className:e,...t},n)=>S.jsx(F2,{ref:n,className:Z(J9(),e),...t}));On.displayName=F2.displayName;const z2="Tabs",[Z9,Vj]=Ft(z2,[mh]),H2=mh(),[eB,qg]=Z9(z2),tB=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,m=Co(s),[u,p]=xr({prop:r,onChange:i,defaultProp:o});return x.createElement(eB,{scope:n,baseId:gn(),value:u,onValueChange:p,orientation:a,dir:m,activationMode:l},x.createElement(fe.div,Y({dir:m,"data-orientation":a},c,{ref:t})))}),nB="TabsList",rB=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=qg(nB,n),a=H2(n);return x.createElement(NS,Y({asChild:!0},a,{orientation:o.orientation,dir:o.dir,loop:r}),x.createElement(fe.div,Y({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),iB="TabsTrigger",sB=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=qg(iB,n),s=H2(n),l=U2(a.baseId,r),c=W2(a.baseId,r),m=r===a.value;return x.createElement(BS,Y({asChild:!0},s,{focusable:!i,active:m}),x.createElement(fe.button,Y({type:"button",role:"tab","aria-selected":m,"aria-controls":c,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:ne(e.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?a.onValueChange(r):u.preventDefault()}),onKeyDown:ne(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&a.onValueChange(r)}),onFocus:ne(e.onFocus,()=>{const u=a.activationMode!=="manual";!m&&!i&&u&&a.onValueChange(r)})})))}),oB="TabsContent",aB=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,s=qg(oB,n),l=U2(s.baseId,r),c=W2(s.baseId,r),m=r===s.value,u=x.useRef(m);return x.useEffect(()=>{const p=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(p)},[]),x.createElement(ut,{present:i||m},({present:p})=>x.createElement(fe.div,Y({"data-state":m?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0},a,{ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0}}),p&&o))});function U2(e,t){return`${e}-trigger-${t}`}function W2(e,t){return`${e}-content-${t}`}const lB=tB,V2=rB,K2=sB,q2=aB,cB=lB,G2=x.forwardRef(({className:e,...t},n)=>S.jsx(V2,{ref:n,className:Z("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));G2.displayName=V2.displayName;const Rp=x.forwardRef(({className:e,...t},n)=>S.jsx(K2,{ref:n,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 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 disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Rp.displayName=K2.displayName;const Gg=x.forwardRef(({className:e,...t},n)=>S.jsx(q2,{ref:n,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Gg.displayName=q2.displayName;const lc="123456789ABCDEFGHJKLMNPQRSTUVWXYZ",An={regexValidDiscordId:/^\d{17,20}$/,regexValidHwidToken:/^[0-9A-Fa-f]{1,2}:[0-9A-Fa-f]{64}$/,validIdentifiers:{discord:/^discord:\d{17,20}$/,fivem:/^fivem:\d{1,8}$/,license:/^license:[0-9A-Fa-f]{40}$/,license2:/^license2:[0-9A-Fa-f]{40}$/,live:/^live:\d{14,20}$/,steam:/^steam:1100001[0-9A-Fa-f]{8}$/,xbl:/^xbl:\d{14,20}$/},adminPasswordMinLength:6,adminPasswordMaxLength:128,regexActionID:new RegExp(`^[${lc}]{4}-[${lc}]{4}$`),regexWhitelistReqID:new RegExp(`R[${lc}]{4}`),regexSvLicenseOld:/^\w{32}$/,regexSvLicenseNew:/^cfxk_\w{1,60}_\w{1,20}$/,regexValidIP:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,noLookAlikesAlphabet:lc,nuiWebpipePath:"https://monitor/WebPipe/",regexCustomThemeName:/^[a-z0-9]+(-[a-z0-9]+)*$/},uB=x.memo(function(){const{authData:e,setAuthData:t}=Ao(),{setAccountModalTab:n}=qm(),r=xx(),i=Zt({method:"POST",path:"/auth/changePassword"}),[o,a]=x.useState(""),[s,l]=x.useState(""),[c,m]=x.useState(""),[u,p]=x.useState(""),[g,y]=x.useState(!1),_=h=>{if(h==null||h.preventDefault(),!!e){if(p(""),s.length<An.adminPasswordMinLength||s.length>An.adminPasswordMaxLength){p(`The password must be between ${An.adminPasswordMinLength} and ${An.adminPasswordMaxLength} digits long.`);return}else if(s!==c){p("The passwords do not match.");return}y(!0),i({data:{newPassword:s,oldPassword:e.isTempPassword?void 0:o},error:f=>{y(!1),p(f)},success:f=>{y(!1),"success"in f?e.isTempPassword?(n("identifiers"),t({...e,isTempPassword:!1})):(ln.success("Password changed successfully!"),r()):p(f.error)}})}};if(e)return S.jsx(Gg,{value:"password",tabIndex:void 0,children:S.jsxs("form",{onSubmit:_,children:[e.isTempPassword?S.jsxs("p",{className:"text-sm text-warning-inline",children:["Your account has a temporary password that needs to be changed before you can use this web panel. ",S.jsx("br",{}),S.jsx("strong",{children:"Make sure to take note of your new password before saving."})]}):S.jsx("p",{className:"text-sm text-muted-foreground",children:"You can use your password to login to the txAdmin inferface even without using the Cfx.re login button."}),S.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[!e.isTempPassword&&S.jsxs("div",{className:"space-y-1",children:[S.jsx(On,{htmlFor:"current-password",children:"Current Password"}),S.jsx(mt,{id:"current-password",placeholder:"Enter new password",type:"password",value:o,autoFocus:!0,required:!0,onChange:h=>{a(h.target.value),p("")}})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx(On,{htmlFor:"new-password",children:"New Password"}),S.jsx(mt,{id:"new-password",autoComplete:"new-password",placeholder:"Enter new password",type:"password",value:s,autoFocus:e.isTempPassword,required:!0,onChange:h=>{l(h.target.value),p("")}})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx(On,{htmlFor:"confirm-password",children:"Confirm Password"}),S.jsx(mt,{id:"confirm-password",autoComplete:"new-password",placeholder:"Repeat new password",type:"password",required:!0,onChange:h=>{m(h.target.value),p("")}})]})]}),u&&S.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:u}),S.jsx(Oe,{className:"w-full",type:"submit",disabled:g,children:g?"Saving...":e.isTempPassword?"Save & Next":"Change Password"})]})})});function hB(){const e=r2(),[t,n]=x.useState(""),[r,i]=x.useState(""),[o,a]=x.useState(""),[s,l]=x.useState(!1),c=xx(),[m,u]=x.useState(!1),{isPending:p,error:g,data:y}=UL({queryKey:["getIdentifiers"],gcTime:3e4,queryFn:()=>e("/auth/getIdentifiers")}),_=Zt({method:"POST",path:"/auth/changeIdentifiers"});x.useEffect(()=>{y&&(n(y.cfxreId),i(y.discordId))},[y]),x.useEffect(()=>{a(g?g.message:"")},[g]);const h=v=>{v==null||v.preventDefault(),a(""),u(!0),_({data:{cfxreId:t,discordId:r},error:b=>{a(b)},success:b=>{u(!1),"success"in b?(ln.success("Identifiers changed successfully!"),c()):a(b.error)}})},f=async()=>{if(!t)return;const v=t.trim();if(/^\d+$/.test(v))n(`fivem:${v}`);else if(v.startsWith("fivem:"))t!==v&&n(v);else{try{l(!0);const b=await MN(`https://forum.cfx.re/u/${v}.json`);b.user&&typeof b.user.id=="number"?n(`fivem:${b.user.id}`):a("Could not find the user in the forum. Make sure you typed the username correctly.")}catch{a("Failed to check the identifiers on the forum API.")}l(!1)}},d=()=>{if(!r)return;const v=r.trim();/^\d+$/.test(v)?i(`discord:${v}`):r!==v&&i(v)};return S.jsx(Gg,{value:"identifiers",tabIndex:void 0,children:S.jsxs("form",{onSubmit:h,children:[S.jsxs("p",{className:"text-sm text-muted-foreground",children:["The identifiers are optional for accessing the ",S.jsx("strong",{children:"Web Panel"})," but required for you to be able to use the ",S.jsx("strong",{children:"In Game Menu"})," and the ",S.jsx("strong",{children:"Discord Bot"}),". ",S.jsx("br",{}),S.jsx("strong",{children:"It is recommended that you configure at least one."})]}),S.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[S.jsxs("div",{className:"space-y-1",children:[S.jsxs(On,{htmlFor:"cfxreId",children:["FiveM identifier ",S.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),S.jsx(mt,{id:"cfxreId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"fivem:000000",value:p||s?"loading...":t,disabled:p||s,autoFocus:!0,onBlur:f,onChange:v=>{n(v.target.value),a("")}}),S.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your identifier can be found by clicking in your name in the playerlist and going to the IDs page. ",S.jsx("br",{}),"You can also type in your ",S.jsx(Ru,{href:"https://forum.cfx.re/",children:"forum.cfx.re"})," username and it will be converted automatically. ",S.jsx("br",{}),"This is required if you want to login using the Cfx.re button."]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsxs(On,{htmlFor:"discordId",children:["Discord identifier ",S.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),S.jsx(mt,{id:"discordId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"discord:000000000000000000",value:p?"loading...":r,disabled:p,onBlur:d,onChange:v=>{i(v.target.value),a("")}}),S.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can get your Discord User ID by following ",S.jsx(Ru,{href:"https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID",children:"this guide"}),". ",S.jsx("br",{}),"This is required if you want to use the Discord Bot slash commands."]})]})]}),o&&S.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:o}),S.jsx(Oe,{className:"w-full",type:"submit",disabled:!y||m,children:m?"Saving...":"Save Changes"})]})})}function dB(){const{authData:e}=Ao(),{isAccountModalOpen:t,setAccountModalOpen:n,accountModalTab:r,setAccountModalTab:i}=qm();x.useEffect(()=>{e&&e.isTempPassword&&(n(!0),i("password"))},[]);const o=a=>{!a&&e&&!e.isTempPassword&&(n(!1),setTimeout(()=>{i("password")},500))};if(e)return S.jsx(Vg,{open:t,onOpenChange:o,children:S.jsxs(xh,{className:"sm:max-w-lg",tabIndex:void 0,children:[S.jsx(Sh,{children:S.jsx(Ch,{className:"text-2xl font-bold",children:e.isTempPassword?"Welcome to txAdmin!":`Your Account - ${e.name}`})}),S.jsxs(cB,{defaultValue:"password",value:r,onValueChange:i,children:[S.jsxs(G2,{className:"grid w-full grid-cols-2 mb-4",children:[S.jsx(Rp,{value:"password",children:"Password"}),S.jsx(Rp,{value:"identifiers",disabled:e.isTempPassword,children:"Identifiers"})]}),S.jsx(uB,{}),S.jsx(hB,{})]})]})})}const Y2=x.forwardRef(({className:e,...t},n)=>S.jsx("textarea",{className:Z("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","bg-black/5 dark:bg-black/30",e),ref:n,...t}));Y2.displayName="Textarea";function f1({type:e,count:t}){const n=t>1?`${e}s`:e;return t===0?S.jsxs("span",{className:Z("rounded-sm text-xs font-semibold px-1 py-[0.125rem] tracking-widest text-center inline-block","bg-secondary text-secondary-foreground"),children:["0 ",e,"s"]}):S.jsxs("span",{className:Z("rounded-sm text-xs font-semibold px-1 py-[0.125rem] tracking-widest text-center inline-block",e==="Ban"?"bg-destructive text-destructive-foreground":"bg-warning text-warning-foreground"),children:[t," ",n]})}const p1=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function fB({playerRef:e,player:t,refreshModalData:n}){const r=x.useRef(null),[i,o]=x.useState(t.notesLog??""),[a,s]=x.useState(p1(t.notes)),l=Zt({method:"POST",path:"/player/save_note"}),c=()=>{var u;o("Saving..."),l({queryParams:e,data:{note:(u=r.current)==null?void 0:u.value.trim()},success:p=>{"error"in p?o(p.error):n()}})},m=u=>{u.key==="Enter"&&!u.shiftKey&&!window.txIsMobile?(u.preventDefault(),c()):s(p1(u.currentTarget.value))};return S.jsxs(S.Fragment,{children:[S.jsxs(On,{htmlFor:"playerNotes",children:["Notes: ",S.jsx("span",{className:"text-muted-foreground",children:i})]}),S.jsx(Y2,{ref:r,id:"playerNotes",className:"w-full mt-1",disabled:!t.isRegistered,defaultValue:t.notes,onChange:()=>o("Press enter to save."),onKeyDown:m,style:{height:`${1+1.25*a}rem`},placeholder:t.isRegistered?"Type your notes about the player.":"Cannot set notes for players that are not registered."}),window.txIsMobile&&S.jsx("div",{className:"mt-2 w-full",children:S.jsx(Oe,{variant:"outline",size:"xs",onClick:c,disabled:!t.isRegistered,className:"w-full",children:"Save Note"})})]})}function pB({playerRef:e,player:t,setSelectedTab:n,refreshModalData:r}){const{hasPerm:i}=nr(),o=Zt({method:"POST",path:"/player/whitelist"}),a=t.sessionTime?If(t.sessionTime*6e4,{units:["h","m"]}):"--",s=t.tsLastConnection?od(t.tsLastConnection):"--",l=t.playTime?If(t.playTime*6e4,{units:["d","h","m"]}):"--",c=t.tsJoined?od(t.tsJoined):"--",m=t.tsWhitelisted?od(t.tsWhitelisted):"not yet",u=t.actionHistory.filter(y=>y.type==="ban").length,p=t.actionHistory.filter(y=>y.type==="warn").length,g=()=>{o({queryParams:e,data:{status:!t.tsWhitelisted},toastLoadingMessage:"Updating whitelist...",genericHandler:{successMsg:"Whitelist changed."},success:(y,_)=>{"success"in y&&r()}})};return S.jsxs("div",{className:"p-1",children:[S.jsxs("dl",{className:"pb-2",children:[t.isConnected&&S.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[S.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Session Time"}),S.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:a})]}),S.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[S.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Play Time"}),S.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:l})]}),S.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[S.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Join Date"}),S.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:c})]}),!t.isConnected&&S.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[S.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Last Connection"}),S.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:s})]}),S.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[S.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"ID Whitelisted"}),S.jsx("dd",{className:"text-sm leading-6 mt-0",children:m}),S.jsx("dd",{className:"text-right",children:S.jsx(Oe,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:g,disabled:!i("players.whitelist"),children:t.tsWhitelisted?"Remove":"Add WL"})})]}),S.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[S.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Log"}),S.jsxs("dd",{className:"text-sm leading-6 mt-0 space-x-2",children:[S.jsx(f1,{type:"Ban",count:u}),S.jsx(f1,{type:"Warn",count:p})]}),S.jsx("dd",{className:"text-right",children:S.jsx(Oe,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:()=>{n("History")},children:"View"})})]})]}),S.jsx(fB,{player:t,playerRef:e,refreshModalData:r})]})}function m1({title:e,emptyMessage:t,currIds:n,allIds:r,isSmaller:i}){x.useState(!1);const o=n.sort((s,l)=>s.localeCompare(l)),a=r.filter(s=>!n.includes(s)).sort((s,l)=>s.localeCompare(l));return S.jsxs("div",{children:[S.jsx("div",{className:"flex justify-between items-center pb-1",children:S.jsx("h3",{className:"text-xl",children:e})}),S.jsxs("p",{className:Z("font-mono break-all whitespace-pre-wrap border rounded divide-y divide-border/50 text-muted-foreground",i?"text-2xs leading-5 font-extralight tracking-widest":"text-xs leading-6 tracking-wider"),children:[o.length===0&&S.jsx("span",{className:"block px-1 opacity-50 italic",children:t}),o.map(s=>S.jsx("span",{className:"block px-1 font-semibold",children:s},s)),a.map(s=>S.jsx("span",{className:"block px-1 opacity-50",children:s},s))]})]})}function mB({player:e}){return S.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[S.jsx(m1,{title:"Player Identifiers",emptyMessage:"This player has no identifiers.",currIds:e.ids,allIds:(e==null?void 0:e.oldIds)??[]}),S.jsx(m1,{title:"Player Hardware IDs",emptyMessage:"This player has no hardware IDs.",currIds:e.hwids,isSmaller:!0,allIds:(e==null?void 0:e.oldHwids)??[]})]})}function Yg({children:e}){return S.jsx("div",{className:"flex items-center justify-center min-h-[16.5rem] text-xl p1 text-muted-foreground",children:e})}function gB({action:e,permsDisableWarn:t,permsDisableBan:n,serverTime:r,doRevokeAction:i}){const o=!!e.revokedBy||e.type==="warn"&&t||e.type==="ban"&&n;let a,s,l;if(e.type==="ban"?(s="border-destructive",l=`BANNED by ${e.author}`):e.type==="warn"&&(s="border-warning",l=`WARNED by ${e.author}`),e.revokedBy){s="";const c=Gl(e.revokedAt??0,"medium","short");a=`Revoked by ${e.revokedBy} on ${c}.`}else if(typeof e.exp=="number"){const c=Gl(e.exp,"medium","short");a=e.exp<r?`Expired on ${c}.`:`Expires in ${c}.`}return S.jsxs("div",{className:Z("pl-2 border-l-4 hover:bg-muted rounded-r-sm bg-muted/30",s),children:[S.jsxs("div",{className:"flex w-full justify-between",children:[S.jsx("strong",{className:"text-sm text-muted-foreground",children:l}),S.jsxs("small",{className:"text-right text-2xs space-x-1",children:[S.jsx(mr,{className:"tracking-widest",children:e.id}),S.jsx("span",{className:"opacity-75 cursor-help",title:Gl(e.ts,"long","long"),children:Gl(e.ts,"medium","short")}),S.jsx(Oe,{variant:"outline",size:"inline",disabled:o,onClick:()=>{i(e.id)},children:"Revoke"})]})]}),S.jsx("span",{className:"text-sm",children:e.reason}),a&&S.jsx("small",{className:"block text-xs opacity-75",children:a})]})}function vB({actionHistory:e,serverTime:t,refreshModalData:n}){const{hasPerm:r}=nr(),i=r("players.warn"),o=r("players.ban"),a=Zt({method:"POST",path:"/database/revoke_action"});if(!e.length)return S.jsx(Yg,{children:"No bans/warns found."});const s=c=>{a({data:{actionId:c},toastLoadingMessage:"Revoking action...",genericHandler:{successMsg:"Action revoked."},success:m=>{"success"in m&&n()}})},l=[...e].reverse();return S.jsx("div",{className:"flex flex-col gap-1 p-1",children:l.map(c=>S.jsx(gB,{action:c,permsDisableWarn:!i,permsDisableBan:!o,serverTime:t,doRevokeAction:s},c.id))})}const _B=[" ","Enter","ArrowUp","ArrowDown"],yB=[" ","Enter"],Eh="Select",[kh,Rh,wB]=gl(Eh),[$o,Kj]=Ft(Eh,[wB,Po]),Xg=Po(),[bB,os]=$o(Eh),[xB,SB]=$o(Eh),CB=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:m,autoComplete:u,disabled:p,required:g}=e,y=Xg(t),[_,h]=x.useState(null),[f,d]=x.useState(null),[v,b]=x.useState(!1),E=Co(c),[C=!1,R]=xr({prop:r,defaultProp:i,onChange:o}),[w,k]=xr({prop:a,defaultProp:s,onChange:l}),L=x.useRef(null),A=_?!!_.closest("form"):!0,[D,P]=x.useState(new Set),$=Array.from(D).map(I=>I.props.value).join(";");return x.createElement(yg,y,x.createElement(bB,{required:g,scope:t,trigger:_,onTriggerChange:h,valueNode:f,onValueNodeChange:d,valueNodeHasChildren:v,onValueNodeHasChildrenChange:b,contentId:gn(),value:w,onValueChange:k,open:C,onOpenChange:R,dir:E,triggerPointerDownPosRef:L,disabled:p},x.createElement(kh.Provider,{scope:t},x.createElement(xB,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(I=>{P(F=>new Set(F).add(I))},[]),onNativeOptionRemove:x.useCallback(I=>{P(F=>{const U=new Set(F);return U.delete(I),U})},[])},n)),A?x.createElement(e5,{key:$,"aria-hidden":!0,required:g,tabIndex:-1,name:m,autoComplete:u,value:w,onChange:I=>k(I.target.value),disabled:p},w===void 0?x.createElement("option",{value:""}):null,Array.from(D)):null))},EB="SelectTrigger",kB=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Xg(n),a=os(EB,n),s=a.disabled||r,l=Se(t,a.onTriggerChange),c=Rh(n),[m,u,p]=t5(y=>{const _=c().filter(d=>!d.disabled),h=_.find(d=>d.value===a.value),f=n5(_,y,h);f!==void 0&&a.onValueChange(f.value)}),g=()=>{s||(a.onOpenChange(!0),p())};return x.createElement(wg,Y({asChild:!0},o),x.createElement(fe.button,Y({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Z2(a.value)?"":void 0},i,{ref:l,onClick:ne(i.onClick,y=>{y.currentTarget.focus()}),onPointerDown:ne(i.onPointerDown,y=>{const _=y.target;_.hasPointerCapture(y.pointerId)&&_.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(g(),a.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:ne(i.onKeyDown,y=>{const _=m.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&u(y.key),!(_&&y.key===" ")&&_B.includes(y.key)&&(g(),y.preventDefault())})})))}),RB="SelectValue",LB=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,l=os(RB,n),{onValueNodeHasChildrenChange:c}=l,m=o!==void 0,u=Se(t,l.onValueNodeChange);return rt(()=>{c(m)},[c,m]),x.createElement(fe.span,Y({},s,{ref:u,style:{pointerEvents:"none"}}),Z2(l.value)?x.createElement(x.Fragment,null,a):o)}),MB=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return x.createElement(fe.span,Y({"aria-hidden":!0},i,{ref:t}),r||"▼")}),AB=e=>x.createElement(xg,Y({asChild:!0},e)),go="SelectContent",TB=x.forwardRef((e,t)=>{const n=os(go,e.__scopeSelect),[r,i]=x.useState();if(rt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?mi.createPortal(x.createElement(X2,{scope:e.__scopeSelect},x.createElement(kh.Slot,{scope:e.__scopeSelect},x.createElement("div",null,e.children))),o):null}return x.createElement(DB,Y({},e,{ref:t}))}),cr=10,[X2,as]=$o(go),DB=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:m,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:_,avoidCollisions:h,...f}=e,d=os(go,n),[v,b]=x.useState(null),[E,C]=x.useState(null),R=Se(t,W=>b(W)),[w,k]=x.useState(null),[L,A]=x.useState(null),D=Rh(n),[P,$]=x.useState(!1),I=x.useRef(!1);x.useEffect(()=>{if(v)return Cg(v)},[v]),hg();const F=x.useCallback(W=>{const[N,...K]=D().map(de=>de.ref.current),[Q]=K.slice(-1),q=document.activeElement;for(const de of W)if(de===q||(de==null||de.scrollIntoView({block:"nearest"}),de===N&&E&&(E.scrollTop=0),de===Q&&E&&(E.scrollTop=E.scrollHeight),de==null||de.focus(),document.activeElement!==q))return},[D,E]),U=x.useCallback(()=>F([w,v]),[F,w,v]);x.useEffect(()=>{P&&U()},[P,U]);const{onOpenChange:j,triggerPointerDownPosRef:T}=d;x.useEffect(()=>{if(v){let W={x:0,y:0};const N=Q=>{var q,de,he,le;W={x:Math.abs(Math.round(Q.pageX)-((q=(de=T.current)===null||de===void 0?void 0:de.x)!==null&&q!==void 0?q:0)),y:Math.abs(Math.round(Q.pageY)-((he=(le=T.current)===null||le===void 0?void 0:le.y)!==null&&he!==void 0?he:0))}},K=Q=>{W.x<=10&&W.y<=10?Q.preventDefault():v.contains(Q.target)||j(!1),document.removeEventListener("pointermove",N),T.current=null};return T.current!==null&&(document.addEventListener("pointermove",N),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",K,{capture:!0})}}},[v,j,T]),x.useEffect(()=>{const W=()=>j(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[j]);const[M,B]=t5(W=>{const N=D().filter(q=>!q.disabled),K=N.find(q=>q.ref.current===document.activeElement),Q=n5(N,W,K);Q&&setTimeout(()=>Q.ref.current.focus())}),z=x.useCallback((W,N,K)=>{const Q=!I.current&&!K;(d.value!==void 0&&d.value===N||Q)&&(k(W),Q&&(I.current=!0))},[d.value]),O=x.useCallback(()=>v==null?void 0:v.focus(),[v]),X=x.useCallback((W,N,K)=>{const Q=!I.current&&!K;(d.value!==void 0&&d.value===N||Q)&&A(W)},[d.value]),re=r==="popper"?g1:PB,H=re===g1?{side:s,sideOffset:l,align:c,alignOffset:m,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:_,avoidCollisions:h}:{};return x.createElement(X2,{scope:n,content:v,viewport:E,onViewportChange:C,itemRefCallback:z,selectedItem:w,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:U,selectedItemText:L,position:r,isPositioned:P,searchRef:M},x.createElement(Eg,{as:ai,allowPinchZoom:!0},x.createElement(dg,{asChild:!0,trapped:d.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:ne(i,W=>{var N;(N=d.trigger)===null||N===void 0||N.focus({preventScroll:!0}),W.preventDefault()})},x.createElement(vl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>d.onOpenChange(!1)},x.createElement(re,Y({role:"listbox",id:d.contentId,"data-state":d.open?"open":"closed",dir:d.dir,onContextMenu:W=>W.preventDefault()},f,H,{onPlaced:()=>$(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...f.style},onKeyDown:ne(f.onKeyDown,W=>{const N=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!N&&W.key.length===1&&B(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let Q=D().filter(q=>!q.disabled).map(q=>q.ref.current);if(["ArrowUp","End"].includes(W.key)&&(Q=Q.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const q=W.target,de=Q.indexOf(q);Q=Q.slice(de+1)}setTimeout(()=>F(Q)),W.preventDefault()}})}))))))}),PB=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=os(go,n),a=as(go,n),[s,l]=x.useState(null),[c,m]=x.useState(null),u=Se(t,R=>m(R)),p=Rh(n),g=x.useRef(!1),y=x.useRef(!0),{viewport:_,selectedItem:h,selectedItemText:f,focusSelectedItem:d}=a,v=x.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&_&&h&&f){const R=o.trigger.getBoundingClientRect(),w=c.getBoundingClientRect(),k=o.valueNode.getBoundingClientRect(),L=f.getBoundingClientRect();if(o.dir!=="rtl"){const q=L.left-w.left,de=k.left-q,he=R.left-de,le=R.width+he,Ae=Math.max(le,w.width),Be=window.innerWidth-cr,ue=Bf(de,[cr,Be-Ae]);s.style.minWidth=le+"px",s.style.left=ue+"px"}else{const q=w.right-L.right,de=window.innerWidth-k.right-q,he=window.innerWidth-R.right-de,le=R.width+he,Ae=Math.max(le,w.width),Be=window.innerWidth-cr,ue=Bf(de,[cr,Be-Ae]);s.style.minWidth=le+"px",s.style.right=ue+"px"}const A=p(),D=window.innerHeight-cr*2,P=_.scrollHeight,$=window.getComputedStyle(c),I=parseInt($.borderTopWidth,10),F=parseInt($.paddingTop,10),U=parseInt($.borderBottomWidth,10),j=parseInt($.paddingBottom,10),T=I+F+P+j+U,M=Math.min(h.offsetHeight*5,T),B=window.getComputedStyle(_),z=parseInt(B.paddingTop,10),O=parseInt(B.paddingBottom,10),X=R.top+R.height/2-cr,re=D-X,H=h.offsetHeight/2,W=h.offsetTop+H,N=I+F+W,K=T-N;if(N<=X){const q=h===A[A.length-1].ref.current;s.style.bottom="0px";const de=c.clientHeight-_.offsetTop-_.offsetHeight,he=Math.max(re,H+(q?O:0)+de+U),le=N+he;s.style.height=le+"px"}else{const q=h===A[0].ref.current;s.style.top="0px";const he=Math.max(X,I+_.offsetTop+(q?z:0)+H)+K;s.style.height=he+"px",_.scrollTop=N-X+_.offsetTop}s.style.margin=`${cr}px 0`,s.style.minHeight=M+"px",s.style.maxHeight=D+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[p,o.trigger,o.valueNode,s,c,_,h,f,o.dir,r]);rt(()=>v(),[v]);const[b,E]=x.useState();rt(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const C=x.useCallback(R=>{R&&y.current===!0&&(v(),d==null||d(),y.current=!1)},[v,d]);return x.createElement($B,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:g,onScrollButtonChange:C},x.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b}},x.createElement(fe.div,Y({},i,{ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),g1=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=cr,...o}=e,a=Xg(n);return x.createElement(bg,Y({},a,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)"}}))}),[$B,Qg]=$o(go,{}),v1="SelectViewport",OB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=as(v1,n),o=Qg(v1,n),a=Se(t,i.onViewportChange),s=x.useRef(0);return x.createElement(x.Fragment,null,x.createElement("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}"}}),x.createElement(kh.Slot,{scope:n},x.createElement(fe.div,Y({"data-radix-select-viewport":"",role:"presentation"},r,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:ne(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:u}=o;if(u!=null&&u.current&&m){const p=Math.abs(s.current-c.scrollTop);if(p>0){const g=window.innerHeight-cr*2,y=parseFloat(m.style.minHeight),_=parseFloat(m.style.height),h=Math.max(y,_);if(h<g){const f=h+p,d=Math.min(g,f),v=f-d;m.style.height=d+"px",m.style.bottom==="0px"&&(c.scrollTop=v>0?v:0,m.style.justifyContent="flex-end")}}}s.current=c.scrollTop})}))))}),IB="SelectGroup",[qj,NB]=$o(IB),BB="SelectLabel",jB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=NB(BB,n);return x.createElement(fe.div,Y({id:i.id},r,{ref:t}))}),Lp="SelectItem",[FB,Q2]=$o(Lp),zB=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=os(Lp,n),l=as(Lp,n),c=s.value===r,[m,u]=x.useState(o??""),[p,g]=x.useState(!1),y=Se(t,f=>{var d;return(d=l.itemRefCallback)===null||d===void 0?void 0:d.call(l,f,r,i)}),_=gn(),h=()=>{i||(s.onValueChange(r),s.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 x.createElement(FB,{scope:n,value:r,disabled:i,textId:_,isSelected:c,onItemTextChange:x.useCallback(f=>{u(d=>{var v;return d||((v=f==null?void 0:f.textContent)!==null&&v!==void 0?v:"").trim()})},[])},x.createElement(kh.ItemSlot,{scope:n,value:r,disabled:i,textValue:m},x.createElement(fe.div,Y({role:"option","aria-labelledby":_,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},a,{ref:y,onFocus:ne(a.onFocus,()=>g(!0)),onBlur:ne(a.onBlur,()=>g(!1)),onPointerUp:ne(a.onPointerUp,h),onPointerMove:ne(a.onPointerMove,f=>{if(i){var d;(d=l.onItemLeave)===null||d===void 0||d.call(l)}else f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ne(a.onPointerLeave,f=>{if(f.currentTarget===document.activeElement){var d;(d=l.onItemLeave)===null||d===void 0||d.call(l)}}),onKeyDown:ne(a.onKeyDown,f=>{var d;((d=l.searchRef)===null||d===void 0?void 0:d.current)!==""&&f.key===" "||(yB.includes(f.key)&&h(),f.key===" "&&f.preventDefault())})}))))}),cc="SelectItemText",HB=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=os(cc,n),s=as(cc,n),l=Q2(cc,n),c=SB(cc,n),[m,u]=x.useState(null),p=Se(t,f=>u(f),l.onItemTextChange,f=>{var d;return(d=s.itemTextRefCallback)===null||d===void 0?void 0:d.call(s,f,l.value,l.disabled)}),g=m==null?void 0:m.textContent,y=x.useMemo(()=>x.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:_,onNativeOptionRemove:h}=c;return rt(()=>(_(y),()=>h(y)),[_,h,y]),x.createElement(x.Fragment,null,x.createElement(fe.span,Y({id:l.textId},o,{ref:p})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?mi.createPortal(o.children,a.valueNode):null)}),UB="SelectItemIndicator",WB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Q2(UB,n).isSelected?x.createElement(fe.span,Y({"aria-hidden":!0},r,{ref:t})):null}),_1="SelectScrollUpButton",VB=x.forwardRef((e,t)=>{const n=as(_1,e.__scopeSelect),r=Qg(_1,e.__scopeSelect),[i,o]=x.useState(!1),a=Se(t,r.onScrollButtonChange);return rt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollTop>0;o(c)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.createElement(J2,Y({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),y1="SelectScrollDownButton",KB=x.forwardRef((e,t)=>{const n=as(y1,e.__scopeSelect),r=Qg(y1,e.__scopeSelect),[i,o]=x.useState(!1),a=Se(t,r.onScrollButtonChange);return rt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollHeight-s.clientHeight,m=Math.ceil(s.scrollTop)<c;o(m)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.createElement(J2,Y({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),J2=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=as("SelectScrollButton",n),a=x.useRef(null),s=Rh(n),l=x.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),rt(()=>{var c;const m=s().find(u=>u.ref.current===document.activeElement);m==null||(c=m.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[s]),x.createElement(fe.div,Y({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:ne(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ne(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ne(i.onPointerLeave,()=>{l()})}))}),qB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.createElement(fe.div,Y({"aria-hidden":!0},r,{ref:t}))});function Z2(e){return e===""||e===void 0}const e5=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=x.useRef(null),o=Se(t,i),a=Tg(n);return x.useEffect(()=>{const s=i.current,l=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&m){const u=new Event("change",{bubbles:!0});m.call(s,n),s.dispatchEvent(u)}},[a,n]),x.createElement(_C,{asChild:!0},x.createElement("select",Y({},r,{ref:o,defaultValue:n})))});e5.displayName="BubbleSelect";function t5(e){const t=Fe(e),n=x.useRef(""),r=x.useRef(0),i=x.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function n5(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=GB(e,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function GB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const YB=CB,r5=kB,XB=LB,QB=MB,JB=AB,i5=TB,ZB=OB,s5=jB,o5=zB,ej=HB,tj=WB,a5=VB,l5=KB,c5=qB,w1=YB,b1=XB,Mp=x.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(r5,{ref:r,className:Z("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","bg-black/5 dark:bg-black/30",e),...n,children:[t,S.jsx(QB,{asChild:!0,children:S.jsx(Wm,{className:"h-4 w-4 opacity-50"})})]}));Mp.displayName=r5.displayName;const u5=x.forwardRef(({className:e,...t},n)=>S.jsx(a5,{ref:n,className:Z("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(SR,{className:"h-4 w-4"})}));u5.displayName=a5.displayName;const h5=x.forwardRef(({className:e,...t},n)=>S.jsx(l5,{ref:n,className:Z("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(Wm,{className:"h-4 w-4"})}));h5.displayName=l5.displayName;const Ap=x.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(JB,{children:S.jsxs(i5,{ref:i,className:Z("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-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:[S.jsx(u5,{}),S.jsx(ZB,{className:Z("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(h5,{})]})}));Ap.displayName=i5.displayName;const nj=x.forwardRef(({className:e,...t},n)=>S.jsx(s5,{ref:n,className:Z("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));nj.displayName=s5.displayName;const Ht=x.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(o5,{ref:r,className:Z("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(tj,{children:S.jsx(Um,{className:"h-4 w-4"})})}),S.jsx(ej,{children:t})]}));Ht.displayName=o5.displayName;const rj=x.forwardRef(({className:e,...t},n)=>S.jsx(c5,{ref:n,className:Z("-mx-1 my-1 h-px bg-muted",e),...t}));rj.displayName=c5.displayName;function ij({playerRef:e}){const t=x.useRef(null),n=x.useRef(null),[r,i]=x.useState("2 days"),[o,a]=x.useState("days"),[s,l]=x.useState(!1),{hasPerm:c}=nr(),m=Ax(),u=Zt({method:"POST",path:"/player/ban"});if(!c("players.ban"))return S.jsx(Yg,{children:"You don't have permission to ban players."});const p=g=>{var y,_;g==null||g.preventDefault(),l(!0),u({queryParams:e,data:{reason:(y=t.current)==null?void 0:y.value.trim(),duration:r==="custom"?`${(_=n.current)==null?void 0:_.value} ${o}`:r},toastLoadingMessage:"Banning player...",genericHandler:{successMsg:"Player banned."},success:h=>{l(!1),"success"in h&&m()}})};return S.jsxs("form",{onSubmit:p,className:"grid gap-4 p-1",children:[S.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[S.jsx(On,{htmlFor:"banReason",className:"col-span-4 xs:col-auto",children:"Reason"}),S.jsx(mt,{id:"banReason",placeholder:"The reason for the ban, rule violated, etc.",className:"col-span-full xs:col-span-3",ref:t,autoFocus:!0,required:!0})]}),S.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[S.jsx(On,{htmlFor:"durationSelect",className:"col-span-4 xs:col-auto",children:"Duration"}),S.jsxs("div",{className:"col-span-full xs:col-span-3 space-y-1 ",children:[S.jsxs(w1,{onValueChange:i,defaultValue:r,children:[S.jsx(Mp,{id:"durationSelect",className:"tracking-wide",children:S.jsx(b1,{placeholder:"Select Duration"})}),S.jsxs(Ap,{className:"tracking-wide",children:[S.jsx(Ht,{value:"custom",className:"font-bold",children:"Custom (set below)"}),S.jsx(Ht,{value:"2 hours",children:"2 HOURS"}),S.jsx(Ht,{value:"8 hours",children:"8 HOURS"}),S.jsx(Ht,{value:"1 day",children:"1 DAY"}),S.jsx(Ht,{value:"2 days",children:"2 DAYS"}),S.jsx(Ht,{value:"1 week",children:"1 WEEK"}),S.jsx(Ht,{value:"2 weeks",children:"2 WEEKS"}),S.jsx(Ht,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),S.jsxs("div",{className:"flex flex-row gap-2",children:[S.jsx(mt,{id:"durationMultiplier",type:"number",placeholder:"123",required:!0,disabled:r!=="custom",ref:n}),S.jsxs(w1,{onValueChange:a,defaultValue:o,children:[S.jsx(Mp,{className:"tracking-wide",id:"durationUnits",disabled:r!=="custom",children:S.jsx(b1,{})}),S.jsxs(Ap,{className:"tracking-wide",children:[S.jsx(Ht,{value:"hours",children:"HOURS"}),S.jsx(Ht,{value:"days",children:"DAYS"}),S.jsx(Ht,{value:"weeks",children:"WEEKS"}),S.jsx(Ht,{value:"months",children:"MONTHS"})]})]})]})]})]}),S.jsx("div",{className:"grid grid-cols-4 items-center gap-4",children:S.jsx(Oe,{variant:"destructive",size:"xs",className:"col-start-1 col-span-full xs:col-span-3 xs:col-start-2",type:"submit",disabled:s,children:s?S.jsxs("span",{className:"flex items-center leading-relaxed",children:[S.jsx(li,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})})]})}function Jg({msg:e}){return S.jsxs("div",{className:"flex items-center gap-1 text-xl leading-relaxed text-muted-foreground",children:[S.jsx(li,{className:"inline animate-spin h-5"})," ",e]})}function sj({playerRef:e,player:t}){const{hasPerm:n}=nr(),r=Gm(),i=Ax(),o=al()[1],[a]=ll("/admins"),s=zm(),l=ah(),c=Zt({method:"POST",path:"/player/message"}),m=Zt({method:"POST",path:"/player/kick"}),u=Zt({method:"POST",path:"/player/warn"}),p=f=>{"success"in f&&(i(),l())},g=()=>{if(!t)return;const f=new URLSearchParams;f.set("autofill","true"),f.set("name",t.pureName);for(const d of t.ids)d.startsWith("discord:")?f.set("discord",d):d.startsWith("fivem:")&&f.set("citizenfx",d);o(`/admins?${f.toString()}`),console.log("isAlreadyInAdminPage",a),a&&s(),i(),l()},y=()=>{t&&r({title:`Direct Message ${t.displayName}`,message:"Type direct message below",placeholder:"whatever you wanna say",submitLabel:"Send",required:!0,onSubmit:f=>{c({queryParams:e,data:{message:f},genericHandler:{successMsg:"Direct message sent."},toastLoadingMessage:"Sending direct message...",success:p})}})},_=()=>{t&&r({title:`Kick ${t.displayName}`,message:"Type the kick reason or leave it blank (press enter)",placeholder:"any reason you want",submitLabel:"Send",onSubmit:f=>{m({queryParams:e,data:{reason:f},genericHandler:{successMsg:"Player kicked."},toastLoadingMessage:"Kicking player...",success:p})}})},h=()=>{t&&r({title:`Warn ${t.displayName}`,message:"Type the warn reason.",placeholder:"any reason you want",submitLabel:"Send",required:!0,onSubmit:f=>{u({queryParams:e,data:{reason:f},genericHandler:{successMsg:"Player warned."},toastLoadingMessage:"Warning player...",success:p})}})};return S.jsxs(Kg,{className:"max-w-2xl gap-2 p-2 md:p-4 border-t grid grid-cols-2 sm:flex",children:[S.jsxs(Oe,{variant:"outline",size:"sm",disabled:!n("manage.admins")||!t||!t.ids.length,onClick:g,className:"pl-2 sm:mr-auto",children:[S.jsx(eL,{className:"h-5 mr-1"})," Give Admin"]}),S.jsxs(Oe,{variant:"outline",size:"sm",disabled:!n("players.message")||!t||!t.isConnected,onClick:y,className:"pl-2",children:[S.jsx(BR,{className:"h-5 mr-1"})," DM"]}),S.jsxs(Oe,{variant:"outline",size:"sm",disabled:!n("players.kick")||!t||!t.isConnected,onClick:_,className:"pl-2",children:[S.jsx(EN,{style:{height:"1.25rem",width:"1.75rem",marginRight:"0.25rem",fill:"currentcolor"}})," Kick"]}),S.jsxs(Oe,{variant:"outline",size:"sm",disabled:!n("players.warn")||!t||!t.isConnected,onClick:h,className:"pl-2",children:[S.jsx(fR,{className:"h-5 mr-1"})," Warn"]})]})}const Pd=[{title:"Info",icon:S.jsx(sx,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"History",icon:S.jsx(PR,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:S.jsx(ox,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Ban",icon:S.jsx(DR,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function oj(){const{isModalOpen:e,closeModal:t,playerRef:n}=QL(),[r,i]=x.useState(Pd[0].title),[o,a]=x.useState(0),[s,l]=x.useState(void 0),[c,m]=x.useState(""),u=Zt({method:"GET",path:"/player",abortOnUnmount:!0}),p=()=>{a(o+1)};x.useEffect(()=>{n&&(l(void 0),m(""),u({queryParams:n,success:_=>{"error"in _?m(_.error):l(_)},error:_=>{m(_)}}))},[n,o]),x.useEffect(()=>{e||setTimeout(()=>{i(Pd[0].title)},200)},[e]);const g=_=>{e&&!_&&t()};let y;return s?y=S.jsxs(S.Fragment,{children:[S.jsxs("span",{className:"text-muted-foreground font-mono",children:["[",s.player.netid||"OFFLINE","]"]})," ",s.player.displayName]}):c?y=S.jsx("span",{className:"text-destructive-inline",children:"Error!"}):y=S.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."}),S.jsx(Vg,{open:e,onOpenChange:g,children:S.jsxs(xh,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",onOpenAutoFocus:_=>_.preventDefault(),children:[S.jsx(Sh,{className:"p-4 border-b",children:S.jsx(Ch,{className:"tracking-wide line-clamp-1 break-all mr-6",children:y})}),S.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[S.jsx("div",{className:"flex flex-row md:flex-col gap-1 bg-muted md:bg-transparent p-1 md:p-0 mx-2 md:mx-0 rounded-md",children:Pd.map(_=>S.jsxs(Oe,{variant:r===_.title?"secondary":"ghost",className:Z("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",_.className),onClick:()=>i(_.title),children:[_.icon," ",_.title]},_.title))}),S.jsx(Eo,{className:"w-full max-h-[calc(100vh-3.125rem-4rem-5rem)] min-h-[16.5rem] md:max-h-[50vh] px-4 py-2 md:py-0",children:s?S.jsxs(S.Fragment,{children:[r==="Info"&&S.jsx(pB,{playerRef:n,player:s.player,setSelectedTab:i,refreshModalData:p}),r==="History"&&S.jsx(vB,{actionHistory:s.player.actionHistory,serverTime:s.serverTime,refreshModalData:p}),r==="IDs"&&S.jsx(mB,{player:s.player}),r==="Ban"&&S.jsx(ij,{playerRef:n})]}):S.jsx(Yg,{children:c?S.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):S.jsx(Jg,{msg:"Loading..."})})})]}),S.jsx(sj,{playerRef:n,player:s==null?void 0:s.player})]})})}function aj(){const e=ug(),t=vD(),n=x.useRef(0),r=C9(),i=J6(),o=Z6(),a=E9();return x.useEffect(()=>{const s=window.txConsts.isWebInterface?["status","playerlist"]:["status"],l=wb(s);return l.on("connect",()=>{console.log("Main Socket.IO Connected."),r(!1)}),l.on("disconnect",c=>{console.log("Main Socket.IO Disonnected:",c);const m=n.current+1;n.current=m,setTimeout(()=>{n.current===m&&r(!0)},500)}),l.on("error",c=>{console.log("Main Socket.IO",c)}),l.on("logout",function(c){e("main socketio",c)}),l.on("refreshToUpdate",function(){window.location.href="/login#updated"}),l.on("status",function(c){i(c)}),l.on("playerlist",function(c){window.txConsts.isWebInterface&&o(c)}),l.on("updateAvailable",function(c){a(c)}),l.on("updateAuthData",function(c){console.warn("Got updateAuthData from websocket",c),t(c)}),()=>{l.removeAllListeners(),l.disconnect(),i(null)}},[]),null}function lj(){const e=ug(),t=VL(),n=Mx(),r=fN();return Yi("message",i=>{i.data.type==="logoutNotice"?e("child iframe","got logoutNotice"):i.data.type==="openAccountModal"?t():i.data.type==="openPlayerModal"?n(i.data.ref):i.data.type==="navigateToPage"?Rm(i.data.href):i.data.type==="globalHotkey"&&i.data.action==="toggleLightMode"&&r()}),Yi("keydown",Xb),S.jsx(S.Fragment,{children:S.jsxs(ZI,{delayDuration:300,disableHoverableContent:!0,children:[S.jsx(wN,{}),S.jsxs("div",{className:"md:px-3 min-h-full pt-2 md:py-4 w-full max-w-[1920px] mx-auto flex flex-row gap-4",children:[S.jsx(s2,{}),S.jsx("main",{className:"flex flex-1 min-h-[calc(100vh-4rem-1px)] md:min-h-[calc(100vh-5.5rem-1px)]",children:S.jsx(TD,{})}),window.txConsts.isWebInterface&&S.jsx(a2,{})]}),S.jsx(x9,{}),S.jsx(A9,{}),S.jsx(Y9,{}),S.jsx(Q9,{}),S.jsx(hD,{}),S.jsx(dB,{}),S.jsx(oj,{}),S.jsx(aj,{})]})})}function cj(){const{setAuthData:e}=Ao(),t=x.useRef(null),n=x.useRef(null),[r,i]=x.useState(),o=al()[1],a=g=>{g.message.startsWith("NetworkError")?i("Network error. If you closed txAdmin, please restart it and try again."):i(g.message)},s=g=>{g==="no_admins_setup"?(i("No admins set up. Redirecting..."),o("/addMaster/pin")):i(g)},l=Qi({mutationKey:["oauthRedirect"],mutationFn:()=>{const g=`/auth/cfxre/redirect?origin=${encodeURIComponent(window.location.origin)}`;return fetch(g).then(y=>y.json())},onError:a,onSuccess:g=>{"error"in g?s(g.error):(console.log("Redirecting to",g.authUrl),window.location.href=g.authUrl)}}),c=Qi({mutationKey:["auth"],mutationFn:({username:g,password:y})=>fetch(`/auth/password?uiVersion=${encodeURIComponent(window.txConsts.txaVersion)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:g,password:y})}).then(_=>_.json()),onError:a,onSuccess:g=>{"error"in g?g.error==="refreshToUpdate"?(window.location.href="/login#updated",window.location.reload()):s(g.error):e(g)}}),m=g=>{var y,_;g==null||g.preventDefault(),c.mutate({username:((y=t.current)==null?void 0:y.value)||"",password:((_=n.current)==null?void 0:_.value)||""})};let u;window.location.hash==="#logout"?u="Logged Out.":window.location.hash==="#expired"?u="Session Expired.":window.location.hash==="#updated"&&(u="txAdmin updated, please login again.");const p=r??u;return x.useEffect(()=>{try{const g=localStorage.getItem("authCredsAutofill");if(g){const[y,_]=JSON.parse(g);t.current.value=y??"",n.current.value=_??""}}catch(g){console.error("Username/Pass autofill failed",g)}},[]),S.jsxs("form",{onSubmit:m,className:"w-full",children:[S.jsx(Ju,{className:"space-y-1",children:S.jsx(Nm,{className:"text-3xl",children:"Login"})}),S.jsxs(cl,{className:"grid gap-4",children:[S.jsx("div",{children:S.jsx("button",{type:"button",className:"cfxrebtn",onClick:()=>{l.mutate()},disabled:l.isPending,children:l.isPending?S.jsx("div",{className:"w-[6rem]",children:S.jsx(li,{className:"mx-auto h-5 w-5 animate-spin"})}):S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"51.12 12.29 1070.38 231.43",className:"w-[6rem] h-5",children:S.jsx("path",{fill:"#fff",d:"M555.37 202.281c-12.725 2.072-36.4 4.44-51.493 4.44-39.952 0-47.35-19.533-47.35-75.17 0-57.412 9.174-75.464 46.462-75.464 14.501 0 39.064 2.367 52.382 4.735l1.183-26.635c-12.725-2.96-36.992-7.398-58.004-7.398-60.668 0-76.057 31.665-76.057 104.763 0 69.25 14.205 104.467 76.057 104.467 18.94 0 43.8-3.552 57.708-6.511l-.887-27.227zm69.547-89.966h39.064V84.793h-39.064v-9.174c0-20.42 4.143-26.93 17.756-26.93 9.174 0 23.675.591 23.675.591l.296-26.043c0-.296-21.9-3.255-31.961-3.255-30.778 0-41.728 12.725-41.728 55.34v9.471H575.79v27.522h17.165v120.448h31.962V112.315zm49.422-27.522 42.911 73.69-42.911 74.28h34.33l29.001-50.606 29.298 50.606h34.33l-44.096-75.169 44.096-72.801h-34.33l-29.298 51.198-29.002-51.198h-34.33zM824.38 190.148h34.625v42.615H824.38zm72.21 42.615h32.257V129.48s23.084-10.358 50.014-15.685V81.538c-25.155 4.735-50.31 21.011-50.31 21.011V84.793h-31.961v147.97zm164.839-24.859c-24.563 0-33.441-11.837-33.737-35.513h91.741l2.072-23.083c0-46.167-20.716-67.77-62.148-67.77-40.84 0-64.219 24.563-64.219 78.72 0 52.085 17.165 75.76 61.556 75.76 26.043 0 59.78-6.806 59.78-6.806l-.592-23.971s-31.074 2.663-54.453 2.663zm-34.033-60.372c.296-28.41 10.062-39.36 31.961-39.36 21.604 0 30.482 9.766 30.482 39.36h-62.443zM242.957 146.08v-.723l-4.34-57.857c-.12-1.567-.783-2.923-1.989-4.068s-2.59-1.718-4.158-1.718h-33.63c-1.567 0-2.953.573-4.158 1.718-1.206 1.145-1.868 2.5-1.989 4.068l-4.34 57.857v.723c-.12 1.447.362 2.653 1.447 3.616 1.085.964 2.35 1.447 3.797 1.447h44.116c1.447 0 2.712-.483 3.797-1.447 1.085-.963 1.568-2.17 1.447-3.616zm137.23 84.436c0 8.8-2.772 13.199-8.317 13.199H244.584c1.567 0 2.893-.574 3.977-1.718 1.085-1.145 1.568-2.5 1.447-4.068l-3.616-46.286c-.121-1.568-.783-2.924-1.99-4.068s-2.59-1.718-4.158-1.718h-49.178c-1.567 0-2.953.573-4.159 1.718-1.205 1.144-1.868 2.5-1.989 4.068l-3.616 46.286c-.12 1.567.362 2.923 1.447 4.068s2.41 1.718 3.977 1.718H59.44c-5.544 0-8.317-4.4-8.317-13.2 0-6.508 1.567-13.5 4.701-20.972l75.396-188.76c.964-2.29 2.53-4.279 4.7-5.966 2.17-1.688 4.46-2.532 6.871-2.532h61.293c-1.567 0-2.953.573-4.159 1.718-1.205 1.145-1.868 2.501-1.989 4.068l-2.712 34.715c-.12 1.687.362 3.073 1.447 4.158 1.085 1.085 2.41 1.627 3.977 1.627h30.014c1.567 0 2.893-.542 3.978-1.627 1.084-1.085 1.567-2.471 1.446-4.158l-2.712-34.715c-.121-1.567-.783-2.923-1.989-4.068s-2.59-1.718-4.158-1.718h61.292c2.41 0 4.701.844 6.87 2.532 2.17 1.687 3.738 3.676 4.702 5.966l75.395 188.76c3.133 7.472 4.7 14.464 4.7 20.973z"})})})}),S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"absolute inset-0 flex items-center",children:S.jsx("span",{className:"w-full border-t"})}),S.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:S.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"OR"})})]}),S.jsxs("div",{className:"flex flex-col gap-4",children:[S.jsxs("div",{className:"grid gap-2",children:[S.jsx(On,{htmlFor:"frm-login",children:"Login"}),S.jsx(mt,{id:"frm-login",type:"text",ref:t,placeholder:"username",autoCapitalize:"off",autoComplete:"off",required:!0})]}),S.jsxs("div",{className:"grid gap-2",children:[S.jsx(On,{htmlFor:"frm-password",children:"Password"}),S.jsx(mt,{id:"frm-password",type:"password",ref:n,placeholder:"password",autoCapitalize:"off",autoComplete:"off",required:!0})]})]})]}),S.jsxs(So,{className:"flex-col pb-0",children:[S.jsxs(Oe,{className:"w-full",disabled:c.isPending,children:[c.isPending&&S.jsx(li,{className:"mr-2 h-4 w-4 animate-spin"}),"Login"]}),S.jsx("div",{className:"text-destructive mt-2",children:p??S.jsx(S.Fragment,{children:" "})})]})]})}const vs=({children:e})=>S.jsx("h1",{className:"text-2xl font-bold text-red-500 mb-4",children:e}),Xo=({children:e})=>S.jsx("p",{className:"whitespace-pre-wrap pb-2",children:e}),_s=({returnTo:e})=>S.jsx(So,{className:"w-full flex justify-center mt-4 pb-0",children:S.jsx(Lm,{href:e,children:S.jsx(Oe,{className:"x",children:"Try Again"})})});function d5({error:e,returnTo:t}){var n,r;if(t=t??"/login","errorTitle"in e)return S.jsxs("div",{children:[S.jsx(vs,{children:e.errorTitle}),S.jsx(Xo,{children:e.errorMessage}),S.jsx(_s,{returnTo:t})]});if(e.errorCode==="invalid_session")return S.jsxs("div",{children:[S.jsx(vs,{children:"Invalid Browser Session."}),S.jsxs(Xo,{children:["You may have restarted txAdmin right before entering this page. ",S.jsx("br",{}),"Please return and try again."]}),S.jsx(_s,{returnTo:t})]});if(e.errorCode==="clock_desync")return S.jsxs("div",{children:[S.jsx(vs,{children:"Please Update/Synchronize your VPS clock."}),S.jsx(Xo,{children:"Failed to login because this host's time is wrong. Please make sure to synchronize it with the internet."}),S.jsx(_s,{returnTo:t})]});if(e.errorCode==="timeout")return S.jsxs("div",{children:[S.jsx(vs,{children:"Connection to FiveM servers timed out."}),S.jsx(Xo,{children:"Please try again or login using your existing username and backup password."}),S.jsx(_s,{returnTo:t})]});if(e.errorCode==="not_admin"){const i=((n=e.errorContext)==null?void 0:n.identifier)??"unknown",o=((r=e.errorContext)==null?void 0:r.name)??"unknown";return S.jsxs("div",{children:[S.jsx(vs,{children:`The Cfx.re account '${o}' is not an admin.`}),S.jsxs(Xo,{children:["The account above with identifier ",S.jsx(mr,{children:i})," is not assigned to any account registered on txAdmin. ",S.jsx("br",{}),"You can also try to login using your username and backup password."]}),S.jsx(_s,{returnTo:t})]})}else return S.jsxs(S.Fragment,{children:[S.jsx(vs,{children:"Unknown Error:"}),S.jsx("div",{className:"text-left rounded-sm text-muted-foreground bg-muted p-1",children:S.jsx("code",{className:"text-left whitespace-pre-wrap ",children:JSON.stringify(e,null,2)})}),S.jsx(_s,{returnTo:t})]})}function uj(){const{authData:e,setAuthData:t}=Ao(),[n,r]=x.useState(),i=x.useRef(!1),o=Qi({mutationKey:["auth"],mutationFn:({redirectUri:a})=>fetch("/auth/cfxre/callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUri:a})}).then(s=>s.json()),onSuccess:a=>{"errorCode"in a||"errorTitle"in a?r(a):t(a)},onError:a=>{a.message.startsWith("NetworkError")?r({errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}):r({errorTitle:"Unknown Error",errorMessage:a.message})}});return x.useEffect(()=>{if(!(e||i.current))return i.current=!0,o.mutate({redirectUri:window.location.href}),o.reset},[]),n?S.jsx(d5,{error:n}):S.jsx(Jg,{msg:"Logging in..."})}function hj(){const[e,t]=x.useState(!1),[n,r]=x.useState(),[i,o]=x.useState(!1),a=x.useRef(null),s=Qi({mutationFn:({pin:m,origin:u})=>fetch("/auth/addMaster/pin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pin:m,origin:u})}).then(p=>p.json()),onSuccess:m=>{"error"in m?(o(!0),r(m.error)):(t(!0),console.log("Redirecting to",m.authUrl),window.location.href=m.authUrl)},onError:m=>{o(!0),m.message.startsWith("NetworkError")?r("Network error. If you closed txAdmin, please restart it and try again."):r(m.message)}}),l=m=>{var u;m==null||m.preventDefault(),o(!1),r(void 0),s.mutate({pin:((u=a.current)==null?void 0:u.value)||"0000",origin:window.location.origin})};x.useEffect(()=>{/^#\d{4}$/.test(window.location.hash)&&(r("Autofilled ✔"),a.current.value=window.location.hash.substring(1))},[]);const c=s.isPending||e;return S.jsxs("form",{onSubmit:l,className:"w-full",children:[S.jsxs(Ju,{className:"space-y-1",children:[S.jsx(Nm,{className:"text-3xl",children:"No Cfx.re account linked."}),S.jsx(bb,{className:"text-sm text-muted-foreground",children:'Type the PIN from your terminal and click "Link Account".'})]}),S.jsxs(cl,{className:"grid gap-2",children:[S.jsx("span",{className:Z("text-center",i?"text-destructive":"text-success"),children:n??S.jsx(S.Fragment,{children:" "})}),S.jsx(mt,{className:Z("text-2xl text-center font-mono tracking-[0.25em] p-2",n&&(i?"border-acctext-destructive text-destructive":"border-succtext-success text-success")),id:"frm-pin",type:"text",ref:a,minLength:4,maxLength:4,placeholder:"0000",autoComplete:"off",onFocus:()=>{o(!1),r(void 0)},disabled:c,required:!0})]}),S.jsx(So,{children:S.jsxs(Oe,{className:"w-full",disabled:c,children:[c&&S.jsx(li,{className:"mr-2 h-4 w-4 animate-spin"}),"Link Account"]})})]})}const f5="Checkbox",[dj,Gj]=Ft(f5),[fj,pj]=dj(f5),mj=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l="on",onCheckedChange:c,...m}=e,[u,p]=x.useState(null),g=Se(t,v=>p(v)),y=x.useRef(!1),_=u?!!u.closest("form"):!0,[h=!1,f]=xr({prop:i,defaultProp:o,onChange:c}),d=x.useRef(h);return x.useEffect(()=>{const v=u==null?void 0:u.form;if(v){const b=()=>f(d.current);return v.addEventListener("reset",b),()=>v.removeEventListener("reset",b)}},[u,f]),x.createElement(fj,{scope:n,state:h,disabled:s},x.createElement(fe.button,Y({type:"button",role:"checkbox","aria-checked":Ui(h)?"mixed":h,"aria-required":a,"data-state":p5(h),"data-disabled":s?"":void 0,disabled:s,value:l},m,{ref:g,onKeyDown:ne(e.onKeyDown,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:ne(e.onClick,v=>{f(b=>Ui(b)?!0:!b),_&&(y.current=v.isPropagationStopped(),y.current||v.stopPropagation())})})),_&&x.createElement(_j,{control:u,bubbles:!y.current,name:r,value:l,checked:h,required:a,disabled:s,style:{transform:"translateX(-100%)"}}))}),gj="CheckboxIndicator",vj=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=pj(gj,n);return x.createElement(ut,{present:r||Ui(o.state)||o.state===!0},x.createElement(fe.span,Y({"data-state":p5(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),_j=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=x.useRef(null),a=Tg(n),s=MS(t);return x.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&u){const p=new Event("click",{bubbles:r});l.indeterminate=Ui(n),u.call(l,Ui(n)?!1:n),l.dispatchEvent(p)}},[a,n,r]),x.createElement("input",Y({type:"checkbox","aria-hidden":!0,defaultChecked:Ui(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Ui(e){return e==="indeterminate"}function p5(e){return Ui(e)?"indeterminate":e?"checked":"unchecked"}const m5=mj,yj=vj,g5=x.forwardRef(({className:e,...t},n)=>S.jsx(m5,{ref:n,className:Z("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:S.jsx(yj,{className:Z("flex items-center justify-center text-current"),children:S.jsx(Um,{className:"h-4 w-4"})})}));g5.displayName=m5.displayName;function wj({fivemId:e,fivemName:t,profilePicture:n}){const{setAuthData:r}=Ao(),[i,o]=x.useState(),a=x.useRef(null),s=x.useRef(null),l=x.useRef(null),c=x.useRef(null),m=Qi({mutationKey:["auth"],mutationFn:({discordId:p,password:g})=>fetch("/auth/addMaster/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({discordId:p,password:g})}).then(y=>y.json()),onSuccess:p=>{"error"in p?o(p.error):(window.txConsts.hasMasterAccount=!0,r(p))},onError:p=>{p.message.startsWith("NetworkError")?o("Network error. If you closed txAdmin, please restart it and try again."):o(p.message)}}),u=p=>{var f,d,v,b,E;p==null||p.preventDefault(),o(void 0);let g,y=(d=(f=a.current)==null?void 0:f.value)==null?void 0:d.trim();if(typeof y=="string"&&y.length>0){if(y.startsWith("discord:")&&(y=y.substring(8),a.current.value=y),!An.regexValidDiscordId.test(y)){o("Invalid Discord ID.");return}g=y}if(((v=c.current)==null?void 0:v.value)!=="on"){o("You MUST agree to the terms.");return}const _=((b=s.current)==null?void 0:b.value)||"",h=((E=l.current)==null?void 0:E.value)||"";if(_.length<An.adminPasswordMinLength||_.length>An.adminPasswordMaxLength){o(`The password must be between ${An.adminPasswordMinLength} and ${An.adminPasswordMaxLength} digits long.`);return}else if(_!==h){o("The passwords do not match.");return}m.mutate({discordId:g,password:_})};return x.useEffect(()=>{try{const p=localStorage.getItem("authCredsAutofill");if(p){const[g,y]=JSON.parse(p);s.current.value=y??"",l.current.value=y??""}}catch(p){console.error("Passwords autofill failed",p)}},[]),S.jsxs("form",{onSubmit:u,className:"w-full text-left",children:[S.jsxs(cl,{className:"flex flex-col gap-4",children:[S.jsxs("div",{children:["Cfx.re account",S.jsxs("div",{className:"rounded-md border bg-zinc-100 dark:bg-zinc-900 p-2 mt-2 flex flex-row justify-start items-center",children:[S.jsx(YC,{className:"h-16 w-16 text-3xl",username:t,profilePicture:n}),S.jsxs("div",{className:"text-left ml-4 overflow-hidden text-ellipsis",children:[S.jsx("span",{className:"text-2xl",children:t})," ",S.jsx("br",{}),S.jsx("code",{className:"text-muted-foreground",children:e})]})]})]}),S.jsx("input",{type:"text",name:"frm-username",className:"hidden",value:t,readOnly:!0}),S.jsxs("div",{className:"grid gap-2",children:[S.jsxs("div",{className:"flex flex-row justify-between items-center",children:[S.jsx(Oc,{htmlFor:"frm-discord",children:"Discord ID"}),S.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),S.jsx(mt,{className:"dark:placeholder:text-zinc-800",id:"frm-discord",type:"text",ref:a,placeholder:"000000000000000000",disabled:m.isPending})]}),S.jsxs("div",{className:"grid gap-2",children:[S.jsxs("div",{className:"flex flex-row justify-between items-center",children:[S.jsx(Oc,{htmlFor:"frm-password",children:"Backup Password"}),S.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",An.adminPasswordMinLength,"~",An.adminPasswordMaxLength," digits)"]})]}),S.jsx(mt,{className:"dark:placeholder:text-zinc-800",id:"frm-password",type:"password",ref:s,placeholder:"password",disabled:m.isPending,required:!0})]}),S.jsxs("div",{className:"grid gap-2",children:[S.jsx(Oc,{htmlFor:"frm-password2",children:"Confirm Password"}),S.jsx(mt,{className:"dark:placeholder:text-zinc-800",id:"frm-password2",type:"password",ref:l,placeholder:"password",disabled:m.isPending,required:!0})]}),S.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[S.jsx(g5,{id:"terms",ref:c,required:!0}),S.jsxs("label",{htmlFor:"terms",className:"text-sm font-medium leading-4 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:["I have read and agree to the ",S.jsx("a",{href:"https://fivem.net/terms",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Creator PLA"})," as well as the ",S.jsx("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"txAdmin License"}),"."]})]})]}),S.jsxs(So,{className:"flex-col gap-2",children:[S.jsx("span",{className:"text-center text-destructive whitespace-pre-wrap",children:i}),S.jsxs(Oe,{className:"w-full",disabled:m.isPending,children:[m.isPending&&S.jsx(li,{className:"mr-2 h-4 w-4 animate-spin"}),"Register"]})]})]})}function bj(){const e=x.useRef(!1),[t,n]=x.useState(),[r,i]=x.useState(),o=Qi({mutationKey:["auth"],mutationFn:({redirectUri:a})=>fetch("/auth/addMaster/callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUri:a})}).then(s=>s.json()),onSuccess:a=>{"errorCode"in a||"errorTitle"in a?i(a):n(a)},onError:a=>{a.message.startsWith("NetworkError")?i({errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}):i({errorTitle:"Unknown Error",errorMessage:a.message})}});return x.useEffect(()=>{if(!(t||e.current))return e.current=!0,o.mutate({redirectUri:window.location.href}),o.reset},[]),t?S.jsx(wj,{...t}):r?S.jsx(d5,{error:r,returnTo:"/addMaster/pin"}):S.jsx(Jg,{msg:"Authenticating..."})}function xj(){return S.jsx("div",{className:"min-h-screen flex items-center justify-center",children:S.jsxs("div",{className:"text-center m-4 w-full xs:w-[25rem] min-w-[20rem]",children:[S.jsx(Fg,{className:"h-12 mx-auto"}),S.jsx(Im,{className:"min-h-64 mt-8 mb-4 p-4 flex items-center justify-center",children:S.jsxs(Jw,{children:[S.jsx(Ci,{path:"/login",children:S.jsx(cj,{})}),S.jsx(Ci,{path:"/login/callback",children:S.jsx(uj,{})}),S.jsx(Ci,{path:"/addMaster/pin",children:S.jsx(hj,{})}),S.jsx(Ci,{path:"/addMaster/callback",children:S.jsx(bj,{})}),S.jsx(Ci,{path:"/:fullPath*",children:S.jsx("small",{children:"redirecting to the login page..."})})]})}),S.jsxs("div",{className:"mx-auto flex flex-wrap gap-4 justify-center mb-2",children:[window.txConsts.adsData.login?S.jsxs("a",{href:window.txConsts.adsData.login.url,onClick:Oa,target:"_blank",className:`w-48 h-16 relative group shadow-sm opacity-90 hover:opacity-100
                            dark:brightness-90 dark:hover:brightness-110`,children:[S.jsx("div",{className:`absolute inset-0 -z-10 animate-pulse blur 
                            scale-0 group-hover:scale-100 transition-transform bg-black
                            dark:bg-gradient-to-r dark:from-[#18E889] dark:to-[#01FFFF]`}),S.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:window.txConsts.adsData.login.img})]}):null,S.jsxs("a",{href:"https://discord.gg/uAmsGa2",onClick:Oa,target:"_blank",className:`w-48 h-16 relative group shadow-sm opacity-90 hover:opacity-100 brightness-110
                        dark:brightness-95 dark:hover:brightness-110`,children:[S.jsx("div",{className:`absolute inset-0 -z-10 animate-pulse blur 
                        scale-0 group-hover:scale-100 transition-transform bg-black
                        dark:bg-gradient-to-t dark:from-[#8567EC] dark:to-[#BD5CBF]`}),S.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:"img/discord.png"})]})]}),S.jsx("div",{children:S.jsxs("small",{className:"text-muted-foreground text-sm font-light",children:["tx: ",S.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",S.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]})})]})})}function Sj({children:e}){const{theme:t,setTheme:n}=e2();return x.useEffect(()=>{const r=o=>{const a=o.matches;t==="dark"&&!a?n("light"):t==="light"&&a&&n("dark")},i=window.matchMedia("(prefers-color-scheme: dark)");return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[t]),S.jsx(S.Fragment,{children:e})}var Zg={exports:{}};Zg.exports=ev;var Cj=Zg.exports.isMobile=ev;Zg.exports.default=ev;const Ej=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,kj=/CrOS/,Rj=/android|ipad|playbook|silk/i;function ev(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let n=Ej.test(t)&&!kj.test(t)||!!e.tablet&&Rj.test(t);return!n&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(n=!0),n}try{window.txIsMobile=Cj({tablet:!0})}catch{window.txIsMobile=!1}if(window.location.pathname.substring(0,8)==="/WebPipe"){console.info("Removing WebPipe prefix from the pathname.");const e=window.location.pathname.substring(8)+window.location.search+window.location.hash;window.history.replaceState(null,"",e)}const Lj=["/login","/addMaster"],x1=e=>Lj.some(t=>e.startsWith(t));function Mj(){if(Ge(_D),Ge(eR),mD()){const n=new URLSearchParams(window.location.search).get("r");return n?J4(n)?window.history.replaceState(null,"",n):window.history.replaceState(null,"","/"):x1(window.location.pathname)&&window.history.replaceState(null,"","/"),S.jsx(lj,{})}else{if(!window.txConsts.hasMasterAccount&&!window.location.pathname.startsWith("/addMaster"))console.log("No master account detected. Redirecting to addMaster page."),window.history.replaceState(null,"","/addMaster/pin");else if(!x1(window.location.pathname)){console.log("User is not authenticated. Redirecting to login page.");const t=window.location.pathname+window.location.search+window.location.hash,n=t==="/"?"/login":`/login?r=${encodeURIComponent(t)}`;window.history.replaceState(null,"",n)}return S.jsx(xj,{})}}const Aj=new kL;$d.createRoot(document.getElementById("root")).render(S.jsx(x.StrictMode,{children:S.jsx(W1,{FallbackComponent:I6,children:S.jsx(TL,{client:Aj,children:S.jsx(Sj,{children:S.jsx(Mj,{})})})})}));
//# sourceMappingURL=index-yRcFMDW6.js.map
