var eU=Object.defineProperty;var tU=(e,t,n)=>t in e?eU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _l=(e,t,n)=>tU(e,typeof t!="symbol"?t+"":t,n);/*!
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 *                     _            _       _           _       
 *                    | |___  __   / \   __| |_ __ ___ (_)_ __  
 *                    | __\ \/ /  / _ \ / _` | '_ ` _ \| | '_ \ 
 *                    | |_ >  <  / ___ \ (_| | | | | | | | | | |
 *                     \__/_/\_\/_/   \_\__,_|_| |_| |_|_|_| |_|
 *                                                              
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * Author: André Tabarra (https://github.com/tabarra)
 * Repository: https://github.com/tabarra/txAdmin
 * txAdmin is a free open source software provided under the license below.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * MIT License
 * 
 * Copyright (c) 2019-2025 Take-Two Interactive Software, Inc.
 * 
 * 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.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * This distribution also includes third party code under their own licenses, which
 * can be found in ../THIRD-PARTY-LICENSES.txt or their respective repositories.
 * Attribution for non-code assets can be found at the bottom of ../README.md or at
 * the top of the respective file.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 */function nU(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 s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{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 s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Ui=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lj={exports:{}},_v={},cj={exports:{}},tt={};/**
 * @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 Qh=Symbol.for("react.element"),rU=Symbol.for("react.portal"),iU=Symbol.for("react.fragment"),sU=Symbol.for("react.strict_mode"),oU=Symbol.for("react.profiler"),aU=Symbol.for("react.provider"),lU=Symbol.for("react.context"),cU=Symbol.for("react.forward_ref"),uU=Symbol.for("react.suspense"),dU=Symbol.for("react.memo"),hU=Symbol.for("react.lazy"),pE=Symbol.iterator;function fU(e){return e===null||typeof e!="object"?null:(e=pE&&e[pE]||e["@@iterator"],typeof e=="function"?e:null)}var uj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dj=Object.assign,hj={};function qc(e,t,n){this.props=e,this.context=t,this.refs=hj,this.updater=n||uj}qc.prototype.isReactComponent={};qc.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")};qc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function fj(){}fj.prototype=qc.prototype;function Zw(e,t,n){this.props=e,this.context=t,this.refs=hj,this.updater=n||uj}var e2=Zw.prototype=new fj;e2.constructor=Zw;dj(e2,qc.prototype);e2.isPureReactComponent=!0;var mE=Array.isArray,pj=Object.prototype.hasOwnProperty,t2={current:null},mj={key:!0,ref:!0,__self:!0,__source:!0};function gj(e,t,n){var r,i={},s=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)pj.call(t,r)&&!mj.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:Qh,type:e,key:s,ref:a,props:i,_owner:t2.current}}function pU(e,t){return{$$typeof:Qh,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function n2(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qh}function mU(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var gE=/\/+/g;function nx(e,t){return typeof e=="object"&&e!==null&&e.key!=null?mU(""+e.key):t.toString(36)}function Zp(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Qh:case rU:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+nx(a,0):r,mE(i)?(n="",e!=null&&(n=e.replace(gE,"$&/")+"/"),Zp(i,t,n,"",function(u){return u})):i!=null&&(n2(i)&&(i=pU(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(gE,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",mE(e))for(var o=0;o<e.length;o++){s=e[o];var l=r+nx(s,o);a+=Zp(s,t,n,l,i)}else if(l=fU(e),typeof l=="function")for(e=l.call(e),o=0;!(s=e.next()).done;)s=s.value,l=r+nx(s,o++),a+=Zp(s,t,n,l,i);else if(s==="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 Gf(e,t,n){if(e==null)return e;var r=[],i=0;return Zp(e,r,"","",function(s){return t.call(n,s,i++)}),r}function gU(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 or={current:null},em={transition:null},vU={ReactCurrentDispatcher:or,ReactCurrentBatchConfig:em,ReactCurrentOwner:t2};function vj(){throw Error("act(...) is not supported in production builds of React.")}tt.Children={map:Gf,forEach:function(e,t,n){Gf(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Gf(e,function(){t++}),t},toArray:function(e){return Gf(e,function(t){return t})||[]},only:function(e){if(!n2(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};tt.Component=qc;tt.Fragment=iU;tt.Profiler=oU;tt.PureComponent=Zw;tt.StrictMode=sU;tt.Suspense=uU;tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vU;tt.act=vj;tt.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=dj({},e.props),i=e.key,s=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,a=t2.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(l in t)pj.call(t,l)&&!mj.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&o!==void 0?o[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){o=Array(l);for(var u=0;u<l;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:Qh,type:e.type,key:i,ref:s,props:r,_owner:a}};tt.createContext=function(e){return e={$$typeof:lU,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:aU,_context:e},e.Consumer=e};tt.createElement=gj;tt.createFactory=function(e){var t=gj.bind(null,e);return t.type=e,t};tt.createRef=function(){return{current:null}};tt.forwardRef=function(e){return{$$typeof:cU,render:e}};tt.isValidElement=n2;tt.lazy=function(e){return{$$typeof:hU,_payload:{_status:-1,_result:e},_init:gU}};tt.memo=function(e,t){return{$$typeof:dU,type:e,compare:t===void 0?null:t}};tt.startTransition=function(e){var t=em.transition;em.transition={};try{e()}finally{em.transition=t}};tt.unstable_act=vj;tt.useCallback=function(e,t){return or.current.useCallback(e,t)};tt.useContext=function(e){return or.current.useContext(e)};tt.useDebugValue=function(){};tt.useDeferredValue=function(e){return or.current.useDeferredValue(e)};tt.useEffect=function(e,t){return or.current.useEffect(e,t)};tt.useId=function(){return or.current.useId()};tt.useImperativeHandle=function(e,t,n){return or.current.useImperativeHandle(e,t,n)};tt.useInsertionEffect=function(e,t){return or.current.useInsertionEffect(e,t)};tt.useLayoutEffect=function(e,t){return or.current.useLayoutEffect(e,t)};tt.useMemo=function(e,t){return or.current.useMemo(e,t)};tt.useReducer=function(e,t,n){return or.current.useReducer(e,t,n)};tt.useRef=function(e){return or.current.useRef(e)};tt.useState=function(e){return or.current.useState(e)};tt.useSyncExternalStore=function(e,t,n){return or.current.useSyncExternalStore(e,t,n)};tt.useTransition=function(){return or.current.useTransition()};tt.version="18.3.1";cj.exports=tt;var w=cj.exports;const ot=Rn(w),xj=nU({__proto__:null,default:ot},[w]);/**
 * @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 xU=w,yU=Symbol.for("react.element"),bU=Symbol.for("react.fragment"),_U=Object.prototype.hasOwnProperty,wU=xU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,SU={key:!0,ref:!0,__self:!0,__source:!0};function yj(e,t,n){var r,i={},s=null,a=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)_U.call(t,r)&&!SU.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:yU,type:e,key:s,ref:a,props:i,_owner:wU.current}}_v.Fragment=bU;_v.jsx=yj;_v.jsxs=yj;lj.exports=_v;var c=lj.exports;const CU=w.createContext(null),rx={didCatch:!1,error:null};class bj extends w.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=rx}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(rx)}}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&&kU(t.resetKeys,i)){var s,a;(s=(a=this.props).onReset)===null||s===void 0||s.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(rx)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:s,error:a}=this.state;let o=t;if(s){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")o=n(l);else if(r)o=w.createElement(r,l);else if(i!==void 0)o=i;else throw a}return w.createElement(CU.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}}function kU(){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 Qy={},_j={exports:{}},Ir={},wj={exports:{}},Sj={};/**
 * @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(P,j){var R=P.length;P.push(j);e:for(;0<R;){var I=R-1>>>1,H=P[I];if(0<i(H,j))P[I]=j,P[R]=H,R=I;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var j=P[0],R=P.pop();if(R!==j){P[0]=R;e:for(var I=0,H=P.length,F=H>>>1;I<F;){var G=2*(I+1)-1,Z=P[G],J=G+1,W=P[J];if(0>i(Z,R))J<H&&0>i(W,Z)?(P[I]=W,P[J]=R,I=J):(P[I]=Z,P[G]=R,I=G);else if(J<H&&0>i(W,R))P[I]=W,P[J]=R,I=J;else break e}}return j}function i(P,j){var R=P.sortIndex-j.sortIndex;return R!==0?R:P.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],h=1,d=null,f=3,g=!1,b=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(P){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=P)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function _(P){if(x=!1,y(P),!b)if(n(l)!==null)b=!0,B(C);else{var j=n(u);j!==null&&z(_,j.startTime-P)}}function C(P,j){b=!1,x&&(x=!1,m(k),k=-1),g=!0;var R=f;try{for(y(j),d=n(l);d!==null&&(!(d.expirationTime>j)||P&&!M());){var I=d.callback;if(typeof I=="function"){d.callback=null,f=d.priorityLevel;var H=I(d.expirationTime<=j);j=e.unstable_now(),typeof H=="function"?d.callback=H:d===n(l)&&r(l),y(j)}else r(l);d=n(l)}if(d!==null)var F=!0;else{var G=n(u);G!==null&&z(_,G.startTime-j),F=!1}return F}finally{d=null,f=R,g=!1}}var S=!1,E=null,k=-1,T=5,A=-1;function M(){return!(e.unstable_now()-A<T)}function D(){if(E!==null){var P=e.unstable_now();A=P;var j=!0;try{j=E(!0,P)}finally{j?L():(S=!1,E=null)}}else S=!1}var L;if(typeof p=="function")L=function(){p(D)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,O=N.port2;N.port1.onmessage=D,L=function(){O.postMessage(null)}}else L=function(){v(D,0)};function B(P){E=P,S||(S=!0,L())}function z(P,j){k=v(function(){P(e.unstable_now())},j)}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(P){P.callback=null},e.unstable_continueExecution=function(){b||g||(b=!0,B(C))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var j=3;break;default:j=f}var R=f;f=j;try{return P()}finally{f=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,j){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var R=f;f=P;try{return j()}finally{f=R}},e.unstable_scheduleCallback=function(P,j,R){var I=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?I+R:I):R=I,P){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=R+H,P={id:h++,callback:j,priorityLevel:P,startTime:R,expirationTime:H,sortIndex:-1},R>I?(P.sortIndex=R,t(u,P),n(l)===null&&P===n(u)&&(x?(m(k),k=-1):x=!0,z(_,R-I))):(P.sortIndex=H,t(l,P),b||g||(b=!0,B(C))),P},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(P){var j=f;return function(){var R=f;f=j;try{return P.apply(this,arguments)}finally{f=R}}}})(Sj);wj.exports=Sj;var EU=wj.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 TU=w,Lr=EU;function he(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 Cj=new Set,Qd={};function Ya(e,t){yc(e,t),yc(e+"Capture",t)}function yc(e,t){for(Qd[e]=t,e=0;e<t.length;e++)Cj.add(t[e])}var Rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zy=Object.prototype.hasOwnProperty,AU=/^[: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]*$/,vE={},xE={};function RU(e){return Zy.call(xE,e)?!0:Zy.call(vE,e)?!1:AU.test(e)?xE[e]=!0:(vE[e]=!0,!1)}function MU(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 jU(e,t,n,r){if(t===null||typeof t>"u"||MU(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 ar(e,t,n,r,i,s,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=s,this.removeEmptyString=a}var On={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){On[e]=new ar(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];On[t]=new ar(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){On[e]=new ar(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){On[e]=new ar(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){On[e]=new ar(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){On[e]=new ar(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){On[e]=new ar(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){On[e]=new ar(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){On[e]=new ar(e,5,!1,e.toLowerCase(),null,!1,!1)});var r2=/[\-:]([a-z])/g;function i2(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(r2,i2);On[t]=new ar(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(r2,i2);On[t]=new ar(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(r2,i2);On[t]=new ar(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){On[e]=new ar(e,1,!1,e.toLowerCase(),null,!1,!1)});On.xlinkHref=new ar("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){On[e]=new ar(e,1,!1,e.toLowerCase(),null,!0,!0)});function s2(e,t,n,r){var i=On.hasOwnProperty(t)?On[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(jU(t,n,i,r)&&(n=null),r||i===null?RU(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 Fs=TU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Kf=Symbol.for("react.element"),Il=Symbol.for("react.portal"),$l=Symbol.for("react.fragment"),o2=Symbol.for("react.strict_mode"),eb=Symbol.for("react.profiler"),kj=Symbol.for("react.provider"),Ej=Symbol.for("react.context"),a2=Symbol.for("react.forward_ref"),tb=Symbol.for("react.suspense"),nb=Symbol.for("react.suspense_list"),l2=Symbol.for("react.memo"),io=Symbol.for("react.lazy"),Tj=Symbol.for("react.offscreen"),yE=Symbol.iterator;function ju(e){return e===null||typeof e!="object"?null:(e=yE&&e[yE]||e["@@iterator"],typeof e=="function"?e:null)}var tn=Object.assign,ix;function ud(e){if(ix===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ix=t&&t[1]||""}return`
`+ix+e}var sx=!1;function ox(e,t){if(!e||sx)return"";sx=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
`),s=r.stack.split(`
`),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o]){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<=o);break}}}finally{sx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ud(e):""}function NU(e){switch(e.tag){case 5:return ud(e.type);case 16:return ud("Lazy");case 13:return ud("Suspense");case 19:return ud("SuspenseList");case 0:case 2:case 15:return e=ox(e.type,!1),e;case 11:return e=ox(e.type.render,!1),e;case 1:return e=ox(e.type,!0),e;default:return""}}function rb(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 $l:return"Fragment";case Il:return"Portal";case eb:return"Profiler";case o2:return"StrictMode";case tb:return"Suspense";case nb:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ej:return(e.displayName||"Context")+".Consumer";case kj:return(e._context.displayName||"Context")+".Provider";case a2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case l2:return t=e.displayName||null,t!==null?t:rb(e.type)||"Memo";case io:t=e._payload,e=e._init;try{return rb(e(t))}catch{}}return null}function DU(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 rb(t);case 8:return t===o2?"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 Do(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Aj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function LU(e){var t=Aj(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,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.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 Yf(e){e._valueTracker||(e._valueTracker=LU(e))}function Rj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Aj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Dm(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 ib(e,t){var n=t.checked;return tn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function bE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Do(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 Mj(e,t){t=t.checked,t!=null&&s2(e,"checked",t,!1)}function sb(e,t){Mj(e,t);var n=Do(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")?ob(e,t.type,n):t.hasOwnProperty("defaultValue")&&ob(e,t.type,Do(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _E(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 ob(e,t,n){(t!=="number"||Dm(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var dd=Array.isArray;function Ql(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=""+Do(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 ab(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(he(91));return tn({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function wE(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(he(92));if(dd(n)){if(1<n.length)throw Error(he(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Do(n)}}function jj(e,t){var n=Do(t.value),r=Do(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 SE(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Nj(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 lb(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Nj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Xf,Dj=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(Xf=Xf||document.createElement("div"),Xf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Xf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ed={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},PU=["Webkit","ms","Moz","O"];Object.keys(Ed).forEach(function(e){PU.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ed[t]=Ed[e]})});function Lj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ed.hasOwnProperty(e)&&Ed[e]?(""+t).trim():t+"px"}function Pj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Lj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var OU=tn({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 cb(e,t){if(t){if(OU[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(he(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(he(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(he(61))}if(t.style!=null&&typeof t.style!="object")throw Error(he(62))}}function ub(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 db=null;function c2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hb=null,Zl=null,ec=null;function CE(e){if(e=tf(e)){if(typeof hb!="function")throw Error(he(280));var t=e.stateNode;t&&(t=Ev(t),hb(e.stateNode,e.type,t))}}function Oj(e){Zl?ec?ec.push(e):ec=[e]:Zl=e}function Ij(){if(Zl){var e=Zl,t=ec;if(ec=Zl=null,CE(e),t)for(e=0;e<t.length;e++)CE(t[e])}}function $j(e,t){return e(t)}function Bj(){}var ax=!1;function Fj(e,t,n){if(ax)return e(t,n);ax=!0;try{return $j(e,t,n)}finally{ax=!1,(Zl!==null||ec!==null)&&(Bj(),Ij())}}function eh(e,t){var n=e.stateNode;if(n===null)return null;var r=Ev(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(he(231,t,typeof n));return n}var fb=!1;if(Rs)try{var Nu={};Object.defineProperty(Nu,"passive",{get:function(){fb=!0}}),window.addEventListener("test",Nu,Nu),window.removeEventListener("test",Nu,Nu)}catch{fb=!1}function IU(e,t,n,r,i,s,a,o,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(h){this.onError(h)}}var Td=!1,Lm=null,Pm=!1,pb=null,$U={onError:function(e){Td=!0,Lm=e}};function BU(e,t,n,r,i,s,a,o,l){Td=!1,Lm=null,IU.apply($U,arguments)}function FU(e,t,n,r,i,s,a,o,l){if(BU.apply(this,arguments),Td){if(Td){var u=Lm;Td=!1,Lm=null}else throw Error(he(198));Pm||(Pm=!0,pb=u)}}function Xa(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 zj(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 kE(e){if(Xa(e)!==e)throw Error(he(188))}function zU(e){var t=e.alternate;if(!t){if(t=Xa(e),t===null)throw Error(he(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return kE(i),e;if(s===r)return kE(i),t;s=s.sibling}throw Error(he(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a)throw Error(he(189))}}if(n.alternate!==r)throw Error(he(190))}if(n.tag!==3)throw Error(he(188));return n.stateNode.current===n?e:t}function Hj(e){return e=zU(e),e!==null?Wj(e):null}function Wj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Wj(e);if(t!==null)return t;e=e.sibling}return null}var Uj=Lr.unstable_scheduleCallback,EE=Lr.unstable_cancelCallback,HU=Lr.unstable_shouldYield,WU=Lr.unstable_requestPaint,cn=Lr.unstable_now,UU=Lr.unstable_getCurrentPriorityLevel,u2=Lr.unstable_ImmediatePriority,Vj=Lr.unstable_UserBlockingPriority,Om=Lr.unstable_NormalPriority,VU=Lr.unstable_LowPriority,qj=Lr.unstable_IdlePriority,wv=null,qi=null;function qU(e){if(qi&&typeof qi.onCommitFiberRoot=="function")try{qi.onCommitFiberRoot(wv,e,void 0,(e.current.flags&128)===128)}catch{}}var _i=Math.clz32?Math.clz32:YU,GU=Math.log,KU=Math.LN2;function YU(e){return e>>>=0,e===0?32:31-(GU(e)/KU|0)|0}var Jf=64,Qf=4194304;function hd(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 Im(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=hd(o):(s&=a,s!==0&&(r=hd(s)))}else a=n&~i,a!==0?r=hd(a):s!==0&&(r=hd(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&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-_i(t),i=1<<n,r|=e[n],t&=~i;return r}function XU(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 JU(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-_i(s),o=1<<a,l=i[a];l===-1?(!(o&n)||o&r)&&(i[a]=XU(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}}function mb(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gj(){var e=Jf;return Jf<<=1,!(Jf&4194240)&&(Jf=64),e}function lx(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Zh(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_i(t),e[t]=n}function QU(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-_i(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function d2(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-_i(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var St=0;function Kj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Yj,h2,Xj,Jj,Qj,gb=!1,Zf=[],_o=null,wo=null,So=null,th=new Map,nh=new Map,lo=[],ZU="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 TE(e,t){switch(e){case"focusin":case"focusout":_o=null;break;case"dragenter":case"dragleave":wo=null;break;case"mouseover":case"mouseout":So=null;break;case"pointerover":case"pointerout":th.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":nh.delete(t.pointerId)}}function Du(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=tf(t),t!==null&&h2(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function eV(e,t,n,r,i){switch(t){case"focusin":return _o=Du(_o,e,t,n,r,i),!0;case"dragenter":return wo=Du(wo,e,t,n,r,i),!0;case"mouseover":return So=Du(So,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return th.set(s,Du(th.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,nh.set(s,Du(nh.get(s)||null,e,t,n,r,i)),!0}return!1}function Zj(e){var t=fa(e.target);if(t!==null){var n=Xa(t);if(n!==null){if(t=n.tag,t===13){if(t=zj(n),t!==null){e.blockedOn=t,Qj(e.priority,function(){Xj(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 tm(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vb(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);db=r,n.target.dispatchEvent(r),db=null}else return t=tf(n),t!==null&&h2(t),e.blockedOn=n,!1;t.shift()}return!0}function AE(e,t,n){tm(e)&&n.delete(t)}function tV(){gb=!1,_o!==null&&tm(_o)&&(_o=null),wo!==null&&tm(wo)&&(wo=null),So!==null&&tm(So)&&(So=null),th.forEach(AE),nh.forEach(AE)}function Lu(e,t){e.blockedOn===t&&(e.blockedOn=null,gb||(gb=!0,Lr.unstable_scheduleCallback(Lr.unstable_NormalPriority,tV)))}function rh(e){function t(i){return Lu(i,e)}if(0<Zf.length){Lu(Zf[0],e);for(var n=1;n<Zf.length;n++){var r=Zf[n];r.blockedOn===e&&(r.blockedOn=null)}}for(_o!==null&&Lu(_o,e),wo!==null&&Lu(wo,e),So!==null&&Lu(So,e),th.forEach(t),nh.forEach(t),n=0;n<lo.length;n++)r=lo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<lo.length&&(n=lo[0],n.blockedOn===null);)Zj(n),n.blockedOn===null&&lo.shift()}var tc=Fs.ReactCurrentBatchConfig,$m=!0;function nV(e,t,n,r){var i=St,s=tc.transition;tc.transition=null;try{St=1,f2(e,t,n,r)}finally{St=i,tc.transition=s}}function rV(e,t,n,r){var i=St,s=tc.transition;tc.transition=null;try{St=4,f2(e,t,n,r)}finally{St=i,tc.transition=s}}function f2(e,t,n,r){if($m){var i=vb(e,t,n,r);if(i===null)xx(e,t,r,Bm,n),TE(e,r);else if(eV(i,e,t,n,r))r.stopPropagation();else if(TE(e,r),t&4&&-1<ZU.indexOf(e)){for(;i!==null;){var s=tf(i);if(s!==null&&Yj(s),s=vb(e,t,n,r),s===null&&xx(e,t,r,Bm,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else xx(e,t,r,null,n)}}var Bm=null;function vb(e,t,n,r){if(Bm=null,e=c2(r),e=fa(e),e!==null)if(t=Xa(e),t===null)e=null;else if(n=t.tag,n===13){if(e=zj(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 Bm=e,null}function e6(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(UU()){case u2:return 1;case Vj:return 4;case Om:case VU:return 16;case qj:return 536870912;default:return 16}default:return 16}}var ho=null,p2=null,nm=null;function t6(){if(nm)return nm;var e,t=p2,n=t.length,r,i="value"in ho?ho.value:ho.textContent,s=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[s-r];r++);return nm=i.slice(e,1<r?1-r:void 0)}function rm(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 ep(){return!0}function RE(){return!1}function $r(e){function t(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?ep:RE,this.isPropagationStopped=RE,this}return tn(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=ep)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ep)},persist:function(){},isPersistent:ep}),t}var Gc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},m2=$r(Gc),ef=tn({},Gc,{view:0,detail:0}),iV=$r(ef),cx,ux,Pu,Sv=tn({},ef,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:g2,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!==Pu&&(Pu&&e.type==="mousemove"?(cx=e.screenX-Pu.screenX,ux=e.screenY-Pu.screenY):ux=cx=0,Pu=e),cx)},movementY:function(e){return"movementY"in e?e.movementY:ux}}),ME=$r(Sv),sV=tn({},Sv,{dataTransfer:0}),oV=$r(sV),aV=tn({},ef,{relatedTarget:0}),dx=$r(aV),lV=tn({},Gc,{animationName:0,elapsedTime:0,pseudoElement:0}),cV=$r(lV),uV=tn({},Gc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dV=$r(uV),hV=tn({},Gc,{data:0}),jE=$r(hV),fV={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pV={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"},mV={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gV(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mV[e])?!!t[e]:!1}function g2(){return gV}var vV=tn({},ef,{key:function(e){if(e.key){var t=fV[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=rm(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pV[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:g2,charCode:function(e){return e.type==="keypress"?rm(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rm(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xV=$r(vV),yV=tn({},Sv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),NE=$r(yV),bV=tn({},ef,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:g2}),_V=$r(bV),wV=tn({},Gc,{propertyName:0,elapsedTime:0,pseudoElement:0}),SV=$r(wV),CV=tn({},Sv,{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}),kV=$r(CV),EV=[9,13,27,32],v2=Rs&&"CompositionEvent"in window,Ad=null;Rs&&"documentMode"in document&&(Ad=document.documentMode);var TV=Rs&&"TextEvent"in window&&!Ad,n6=Rs&&(!v2||Ad&&8<Ad&&11>=Ad),DE=" ",LE=!1;function r6(e,t){switch(e){case"keyup":return EV.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function i6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bl=!1;function AV(e,t){switch(e){case"compositionend":return i6(t);case"keypress":return t.which!==32?null:(LE=!0,DE);case"textInput":return e=t.data,e===DE&&LE?null:e;default:return null}}function RV(e,t){if(Bl)return e==="compositionend"||!v2&&r6(e,t)?(e=t6(),nm=p2=ho=null,Bl=!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 n6&&t.locale!=="ko"?null:t.data;default:return null}}var MV={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 PE(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!MV[e.type]:t==="textarea"}function s6(e,t,n,r){Oj(r),t=Fm(t,"onChange"),0<t.length&&(n=new m2("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Rd=null,ih=null;function jV(e){g6(e,0)}function Cv(e){var t=Hl(e);if(Rj(t))return e}function NV(e,t){if(e==="change")return t}var o6=!1;if(Rs){var hx;if(Rs){var fx="oninput"in document;if(!fx){var OE=document.createElement("div");OE.setAttribute("oninput","return;"),fx=typeof OE.oninput=="function"}hx=fx}else hx=!1;o6=hx&&(!document.documentMode||9<document.documentMode)}function IE(){Rd&&(Rd.detachEvent("onpropertychange",a6),ih=Rd=null)}function a6(e){if(e.propertyName==="value"&&Cv(ih)){var t=[];s6(t,ih,e,c2(e)),Fj(jV,t)}}function DV(e,t,n){e==="focusin"?(IE(),Rd=t,ih=n,Rd.attachEvent("onpropertychange",a6)):e==="focusout"&&IE()}function LV(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cv(ih)}function PV(e,t){if(e==="click")return Cv(t)}function OV(e,t){if(e==="input"||e==="change")return Cv(t)}function IV(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ki=typeof Object.is=="function"?Object.is:IV;function sh(e,t){if(ki(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(!Zy.call(t,i)||!ki(e[i],t[i]))return!1}return!0}function $E(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function BE(e,t){var n=$E(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=$E(n)}}function l6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?l6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function c6(){for(var e=window,t=Dm();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Dm(e.document)}return t}function x2(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 $V(e){var t=c6(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&l6(n.ownerDocument.documentElement,n)){if(r!==null&&x2(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,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=BE(n,s);var a=BE(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(),s>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 BV=Rs&&"documentMode"in document&&11>=document.documentMode,Fl=null,xb=null,Md=null,yb=!1;function FE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yb||Fl==null||Fl!==Dm(r)||(r=Fl,"selectionStart"in r&&x2(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}),Md&&sh(Md,r)||(Md=r,r=Fm(xb,"onSelect"),0<r.length&&(t=new m2("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Fl)))}function tp(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var zl={animationend:tp("Animation","AnimationEnd"),animationiteration:tp("Animation","AnimationIteration"),animationstart:tp("Animation","AnimationStart"),transitionend:tp("Transition","TransitionEnd")},px={},u6={};Rs&&(u6=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function kv(e){if(px[e])return px[e];if(!zl[e])return e;var t=zl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in u6)return px[e]=t[n];return e}var d6=kv("animationend"),h6=kv("animationiteration"),f6=kv("animationstart"),p6=kv("transitionend"),m6=new Map,zE="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 qo(e,t){m6.set(e,t),Ya(t,[e])}for(var mx=0;mx<zE.length;mx++){var gx=zE[mx],FV=gx.toLowerCase(),zV=gx[0].toUpperCase()+gx.slice(1);qo(FV,"on"+zV)}qo(d6,"onAnimationEnd");qo(h6,"onAnimationIteration");qo(f6,"onAnimationStart");qo("dblclick","onDoubleClick");qo("focusin","onFocus");qo("focusout","onBlur");qo(p6,"onTransitionEnd");yc("onMouseEnter",["mouseout","mouseover"]);yc("onMouseLeave",["mouseout","mouseover"]);yc("onPointerEnter",["pointerout","pointerover"]);yc("onPointerLeave",["pointerout","pointerover"]);Ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ya("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fd="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(" "),HV=new Set("cancel close invalid load scroll toggle".split(" ").concat(fd));function HE(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,FU(r,t,void 0,e),e.currentTarget=null}function g6(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 s=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;HE(i,o,u),s=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,u=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;HE(i,o,u),s=l}}}if(Pm)throw e=pb,Pm=!1,pb=null,e}function zt(e,t){var n=t[Cb];n===void 0&&(n=t[Cb]=new Set);var r=e+"__bubble";n.has(r)||(v6(t,e,2,!1),n.add(r))}function vx(e,t,n){var r=0;t&&(r|=4),v6(n,e,r,t)}var np="_reactListening"+Math.random().toString(36).slice(2);function oh(e){if(!e[np]){e[np]=!0,Cj.forEach(function(n){n!=="selectionchange"&&(HV.has(n)||vx(n,!1,e),vx(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[np]||(t[np]=!0,vx("selectionchange",!1,t))}}function v6(e,t,n,r){switch(e6(t)){case 1:var i=nV;break;case 4:i=rV;break;default:i=f2}n=i.bind(null,t,n,e),i=void 0,!fb||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 xx(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.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(;o!==null;){if(a=fa(o),a===null)return;if(l=a.tag,l===5||l===6){r=s=a;continue e}o=o.parentNode}}r=r.return}Fj(function(){var u=s,h=c2(n),d=[];e:{var f=m6.get(e);if(f!==void 0){var g=m2,b=e;switch(e){case"keypress":if(rm(n)===0)break e;case"keydown":case"keyup":g=xV;break;case"focusin":b="focus",g=dx;break;case"focusout":b="blur",g=dx;break;case"beforeblur":case"afterblur":g=dx;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=ME;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=oV;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=_V;break;case d6:case h6:case f6:g=cV;break;case p6:g=SV;break;case"scroll":g=iV;break;case"wheel":g=kV;break;case"copy":case"cut":case"paste":g=dV;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=NE}var x=(t&4)!==0,v=!x&&e==="scroll",m=x?f!==null?f+"Capture":null:f;x=[];for(var p=u,y;p!==null;){y=p;var _=y.stateNode;if(y.tag===5&&_!==null&&(y=_,m!==null&&(_=eh(p,m),_!=null&&x.push(ah(p,_,y)))),v)break;p=p.return}0<x.length&&(f=new g(f,b,null,n,h),d.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==db&&(b=n.relatedTarget||n.fromElement)&&(fa(b)||b[Ms]))break e;if((g||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,g?(b=n.relatedTarget||n.toElement,g=u,b=b?fa(b):null,b!==null&&(v=Xa(b),b!==v||b.tag!==5&&b.tag!==6)&&(b=null)):(g=null,b=u),g!==b)){if(x=ME,_="onMouseLeave",m="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(x=NE,_="onPointerLeave",m="onPointerEnter",p="pointer"),v=g==null?f:Hl(g),y=b==null?f:Hl(b),f=new x(_,p+"leave",g,n,h),f.target=v,f.relatedTarget=y,_=null,fa(h)===u&&(x=new x(m,p+"enter",b,n,h),x.target=y,x.relatedTarget=v,_=x),v=_,g&&b)t:{for(x=g,m=b,p=0,y=x;y;y=wl(y))p++;for(y=0,_=m;_;_=wl(_))y++;for(;0<p-y;)x=wl(x),p--;for(;0<y-p;)m=wl(m),y--;for(;p--;){if(x===m||m!==null&&x===m.alternate)break t;x=wl(x),m=wl(m)}x=null}else x=null;g!==null&&WE(d,f,g,x,!1),b!==null&&v!==null&&WE(d,v,b,x,!0)}}e:{if(f=u?Hl(u):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var C=NV;else if(PE(f))if(o6)C=OV;else{C=LV;var S=DV}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=PV);if(C&&(C=C(e,u))){s6(d,C,n,h);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&ob(f,"number",f.value)}switch(S=u?Hl(u):window,e){case"focusin":(PE(S)||S.contentEditable==="true")&&(Fl=S,xb=u,Md=null);break;case"focusout":Md=xb=Fl=null;break;case"mousedown":yb=!0;break;case"contextmenu":case"mouseup":case"dragend":yb=!1,FE(d,n,h);break;case"selectionchange":if(BV)break;case"keydown":case"keyup":FE(d,n,h)}var E;if(v2)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Bl?r6(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(n6&&n.locale!=="ko"&&(Bl||k!=="onCompositionStart"?k==="onCompositionEnd"&&Bl&&(E=t6()):(ho=h,p2="value"in ho?ho.value:ho.textContent,Bl=!0)),S=Fm(u,k),0<S.length&&(k=new jE(k,e,null,n,h),d.push({event:k,listeners:S}),E?k.data=E:(E=i6(n),E!==null&&(k.data=E)))),(E=TV?AV(e,n):RV(e,n))&&(u=Fm(u,"onBeforeInput"),0<u.length&&(h=new jE("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:u}),h.data=E))}g6(d,t)})}function ah(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fm(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=eh(e,n),s!=null&&r.unshift(ah(e,s,i)),s=eh(e,t),s!=null&&r.push(ah(e,s,i))),e=e.return}return r}function wl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function WE(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var o=n,l=o.alternate,u=o.stateNode;if(l!==null&&l===r)break;o.tag===5&&u!==null&&(o=u,i?(l=eh(n,s),l!=null&&a.unshift(ah(n,l,o))):i||(l=eh(n,s),l!=null&&a.push(ah(n,l,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var WV=/\r\n?/g,UV=/\u0000|\uFFFD/g;function UE(e){return(typeof e=="string"?e:""+e).replace(WV,`
`).replace(UV,"")}function rp(e,t,n){if(t=UE(t),UE(e)!==t&&n)throw Error(he(425))}function zm(){}var bb=null,_b=null;function wb(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 Sb=typeof setTimeout=="function"?setTimeout:void 0,VV=typeof clearTimeout=="function"?clearTimeout:void 0,VE=typeof Promise=="function"?Promise:void 0,qV=typeof queueMicrotask=="function"?queueMicrotask:typeof VE<"u"?function(e){return VE.resolve(null).then(e).catch(GV)}:Sb;function GV(e){setTimeout(function(){throw e})}function yx(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),rh(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);rh(t)}function Co(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 qE(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 Kc=Math.random().toString(36).slice(2),zi="__reactFiber$"+Kc,lh="__reactProps$"+Kc,Ms="__reactContainer$"+Kc,Cb="__reactEvents$"+Kc,KV="__reactListeners$"+Kc,YV="__reactHandles$"+Kc;function fa(e){var t=e[zi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ms]||n[zi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=qE(e);e!==null;){if(n=e[zi])return n;e=qE(e)}return t}e=n,n=e.parentNode}return null}function tf(e){return e=e[zi]||e[Ms],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Hl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(he(33))}function Ev(e){return e[lh]||null}var kb=[],Wl=-1;function Go(e){return{current:e}}function Vt(e){0>Wl||(e.current=kb[Wl],kb[Wl]=null,Wl--)}function It(e,t){Wl++,kb[Wl]=e.current,e.current=t}var Lo={},Gn=Go(Lo),gr=Go(!1),Ra=Lo;function bc(e,t){var n=e.type.contextTypes;if(!n)return Lo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function vr(e){return e=e.childContextTypes,e!=null}function Hm(){Vt(gr),Vt(Gn)}function GE(e,t,n){if(Gn.current!==Lo)throw Error(he(168));It(Gn,t),It(gr,n)}function x6(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(he(108,DU(e)||"Unknown",i));return tn({},n,r)}function Wm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lo,Ra=Gn.current,It(Gn,e),It(gr,gr.current),!0}function KE(e,t,n){var r=e.stateNode;if(!r)throw Error(he(169));n?(e=x6(e,t,Ra),r.__reactInternalMemoizedMergedChildContext=e,Vt(gr),Vt(Gn),It(Gn,e)):Vt(gr),It(gr,n)}var gs=null,Tv=!1,bx=!1;function y6(e){gs===null?gs=[e]:gs.push(e)}function XV(e){Tv=!0,y6(e)}function Ko(){if(!bx&&gs!==null){bx=!0;var e=0,t=St;try{var n=gs;for(St=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}gs=null,Tv=!1}catch(i){throw gs!==null&&(gs=gs.slice(e+1)),Uj(u2,Ko),i}finally{St=t,bx=!1}}return null}var Ul=[],Vl=0,Um=null,Vm=0,zr=[],Hr=0,Ma=null,xs=1,ys="";function oa(e,t){Ul[Vl++]=Vm,Ul[Vl++]=Um,Um=e,Vm=t}function b6(e,t,n){zr[Hr++]=xs,zr[Hr++]=ys,zr[Hr++]=Ma,Ma=e;var r=xs;e=ys;var i=32-_i(r)-1;r&=~(1<<i),n+=1;var s=32-_i(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,xs=1<<32-_i(t)+i|n<<i|r,ys=s+e}else xs=1<<s|n<<i|r,ys=e}function y2(e){e.return!==null&&(oa(e,1),b6(e,1,0))}function b2(e){for(;e===Um;)Um=Ul[--Vl],Ul[Vl]=null,Vm=Ul[--Vl],Ul[Vl]=null;for(;e===Ma;)Ma=zr[--Hr],zr[Hr]=null,ys=zr[--Hr],zr[Hr]=null,xs=zr[--Hr],zr[Hr]=null}var jr=null,Rr=null,Kt=!1,mi=null;function _6(e,t){var n=Kr(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 YE(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,jr=e,Rr=Co(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,jr=e,Rr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ma!==null?{id:xs,overflow:ys}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,jr=e,Rr=null,!0):!1;default:return!1}}function Eb(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Tb(e){if(Kt){var t=Rr;if(t){var n=t;if(!YE(e,t)){if(Eb(e))throw Error(he(418));t=Co(n.nextSibling);var r=jr;t&&YE(e,t)?_6(r,n):(e.flags=e.flags&-4097|2,Kt=!1,jr=e)}}else{if(Eb(e))throw Error(he(418));e.flags=e.flags&-4097|2,Kt=!1,jr=e}}}function XE(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;jr=e}function ip(e){if(e!==jr)return!1;if(!Kt)return XE(e),Kt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!wb(e.type,e.memoizedProps)),t&&(t=Rr)){if(Eb(e))throw w6(),Error(he(418));for(;t;)_6(e,t),t=Co(t.nextSibling)}if(XE(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(he(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Rr=Co(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Rr=null}}else Rr=jr?Co(e.stateNode.nextSibling):null;return!0}function w6(){for(var e=Rr;e;)e=Co(e.nextSibling)}function _c(){Rr=jr=null,Kt=!1}function _2(e){mi===null?mi=[e]:mi.push(e)}var JV=Fs.ReactCurrentBatchConfig;function Ou(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(he(309));var r=n.stateNode}if(!r)throw Error(he(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(a){var o=i.refs;a===null?delete o[s]:o[s]=a},t._stringRef=s,t)}if(typeof e!="string")throw Error(he(284));if(!n._owner)throw Error(he(290,e))}return e}function sp(e,t){throw e=Object.prototype.toString.call(t),Error(he(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function JE(e){var t=e._init;return t(e._payload)}function S6(e){function t(m,p){if(e){var y=m.deletions;y===null?(m.deletions=[p],m.flags|=16):y.push(p)}}function n(m,p){if(!e)return null;for(;p!==null;)t(m,p),p=p.sibling;return null}function r(m,p){for(m=new Map;p!==null;)p.key!==null?m.set(p.key,p):m.set(p.index,p),p=p.sibling;return m}function i(m,p){return m=Ao(m,p),m.index=0,m.sibling=null,m}function s(m,p,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<p?(m.flags|=2,p):y):(m.flags|=2,p)):(m.flags|=1048576,p)}function a(m){return e&&m.alternate===null&&(m.flags|=2),m}function o(m,p,y,_){return p===null||p.tag!==6?(p=Tx(y,m.mode,_),p.return=m,p):(p=i(p,y),p.return=m,p)}function l(m,p,y,_){var C=y.type;return C===$l?h(m,p,y.props.children,_,y.key):p!==null&&(p.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===io&&JE(C)===p.type)?(_=i(p,y.props),_.ref=Ou(m,p,y),_.return=m,_):(_=um(y.type,y.key,y.props,null,m.mode,_),_.ref=Ou(m,p,y),_.return=m,_)}function u(m,p,y,_){return p===null||p.tag!==4||p.stateNode.containerInfo!==y.containerInfo||p.stateNode.implementation!==y.implementation?(p=Ax(y,m.mode,_),p.return=m,p):(p=i(p,y.children||[]),p.return=m,p)}function h(m,p,y,_,C){return p===null||p.tag!==7?(p=Sa(y,m.mode,_,C),p.return=m,p):(p=i(p,y),p.return=m,p)}function d(m,p,y){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Tx(""+p,m.mode,y),p.return=m,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Kf:return y=um(p.type,p.key,p.props,null,m.mode,y),y.ref=Ou(m,null,p),y.return=m,y;case Il:return p=Ax(p,m.mode,y),p.return=m,p;case io:var _=p._init;return d(m,_(p._payload),y)}if(dd(p)||ju(p))return p=Sa(p,m.mode,y,null),p.return=m,p;sp(m,p)}return null}function f(m,p,y,_){var C=p!==null?p.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return C!==null?null:o(m,p,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Kf:return y.key===C?l(m,p,y,_):null;case Il:return y.key===C?u(m,p,y,_):null;case io:return C=y._init,f(m,p,C(y._payload),_)}if(dd(y)||ju(y))return C!==null?null:h(m,p,y,_,null);sp(m,y)}return null}function g(m,p,y,_,C){if(typeof _=="string"&&_!==""||typeof _=="number")return m=m.get(y)||null,o(p,m,""+_,C);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Kf:return m=m.get(_.key===null?y:_.key)||null,l(p,m,_,C);case Il:return m=m.get(_.key===null?y:_.key)||null,u(p,m,_,C);case io:var S=_._init;return g(m,p,y,S(_._payload),C)}if(dd(_)||ju(_))return m=m.get(y)||null,h(p,m,_,C,null);sp(p,_)}return null}function b(m,p,y,_){for(var C=null,S=null,E=p,k=p=0,T=null;E!==null&&k<y.length;k++){E.index>k?(T=E,E=null):T=E.sibling;var A=f(m,E,y[k],_);if(A===null){E===null&&(E=T);break}e&&E&&A.alternate===null&&t(m,E),p=s(A,p,k),S===null?C=A:S.sibling=A,S=A,E=T}if(k===y.length)return n(m,E),Kt&&oa(m,k),C;if(E===null){for(;k<y.length;k++)E=d(m,y[k],_),E!==null&&(p=s(E,p,k),S===null?C=E:S.sibling=E,S=E);return Kt&&oa(m,k),C}for(E=r(m,E);k<y.length;k++)T=g(E,m,k,y[k],_),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?k:T.key),p=s(T,p,k),S===null?C=T:S.sibling=T,S=T);return e&&E.forEach(function(M){return t(m,M)}),Kt&&oa(m,k),C}function x(m,p,y,_){var C=ju(y);if(typeof C!="function")throw Error(he(150));if(y=C.call(y),y==null)throw Error(he(151));for(var S=C=null,E=p,k=p=0,T=null,A=y.next();E!==null&&!A.done;k++,A=y.next()){E.index>k?(T=E,E=null):T=E.sibling;var M=f(m,E,A.value,_);if(M===null){E===null&&(E=T);break}e&&E&&M.alternate===null&&t(m,E),p=s(M,p,k),S===null?C=M:S.sibling=M,S=M,E=T}if(A.done)return n(m,E),Kt&&oa(m,k),C;if(E===null){for(;!A.done;k++,A=y.next())A=d(m,A.value,_),A!==null&&(p=s(A,p,k),S===null?C=A:S.sibling=A,S=A);return Kt&&oa(m,k),C}for(E=r(m,E);!A.done;k++,A=y.next())A=g(E,m,k,A.value,_),A!==null&&(e&&A.alternate!==null&&E.delete(A.key===null?k:A.key),p=s(A,p,k),S===null?C=A:S.sibling=A,S=A);return e&&E.forEach(function(D){return t(m,D)}),Kt&&oa(m,k),C}function v(m,p,y,_){if(typeof y=="object"&&y!==null&&y.type===$l&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Kf:e:{for(var C=y.key,S=p;S!==null;){if(S.key===C){if(C=y.type,C===$l){if(S.tag===7){n(m,S.sibling),p=i(S,y.props.children),p.return=m,m=p;break e}}else if(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===io&&JE(C)===S.type){n(m,S.sibling),p=i(S,y.props),p.ref=Ou(m,S,y),p.return=m,m=p;break e}n(m,S);break}else t(m,S);S=S.sibling}y.type===$l?(p=Sa(y.props.children,m.mode,_,y.key),p.return=m,m=p):(_=um(y.type,y.key,y.props,null,m.mode,_),_.ref=Ou(m,p,y),_.return=m,m=_)}return a(m);case Il:e:{for(S=y.key;p!==null;){if(p.key===S)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){n(m,p.sibling),p=i(p,y.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=Ax(y,m.mode,_),p.return=m,m=p}return a(m);case io:return S=y._init,v(m,p,S(y._payload),_)}if(dd(y))return b(m,p,y,_);if(ju(y))return x(m,p,y,_);sp(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(n(m,p.sibling),p=i(p,y),p.return=m,m=p):(n(m,p),p=Tx(y,m.mode,_),p.return=m,m=p),a(m)):n(m,p)}return v}var wc=S6(!0),C6=S6(!1),qm=Go(null),Gm=null,ql=null,w2=null;function S2(){w2=ql=Gm=null}function C2(e){var t=qm.current;Vt(qm),e._currentValue=t}function Ab(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 nc(e,t){Gm=e,w2=ql=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pr=!0),e.firstContext=null)}function ni(e){var t=e._currentValue;if(w2!==e)if(e={context:e,memoizedValue:t,next:null},ql===null){if(Gm===null)throw Error(he(308));ql=e,Gm.dependencies={lanes:0,firstContext:e}}else ql=ql.next=e;return t}var pa=null;function k2(e){pa===null?pa=[e]:pa.push(e)}function k6(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,k2(t)):(n.next=i.next,i.next=n),t.interleaved=n,js(e,r)}function js(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 so=!1;function E2(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function E6(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 Ts(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ko(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,js(e,n)}return i=r.interleaved,i===null?(t.next=t,k2(r)):(t.next=i.next,i.next=t),r.interleaved=t,js(e,n)}function im(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,d2(e,n)}}function QE(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=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};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 Km(e,t,n,r){var i=e.updateQueue;so=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?s=u:a.next=u,a=l;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==a&&(o===null?h.firstBaseUpdate=u:o.next=u,h.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;a=0,h=u=l=null,o=s;do{var f=o.lane,g=o.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:g,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var b=e,x=o;switch(f=t,g=n,x.tag){case 1:if(b=x.payload,typeof b=="function"){d=b.call(g,d,f);break e}d=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=x.payload,f=typeof b=="function"?b.call(g,d,f):b,f==null)break e;d=tn({},d,f);break e;case 2:so=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else g={eventTime:g,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(u=h=g,l=d):h=h.next=g,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Na|=a,e.lanes=a,e.memoizedState=d}}function ZE(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(he(191,i));i.call(r)}}}var nf={},Gi=Go(nf),ch=Go(nf),uh=Go(nf);function ma(e){if(e===nf)throw Error(he(174));return e}function T2(e,t){switch(It(uh,t),It(ch,e),It(Gi,nf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:lb(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=lb(t,e)}Vt(Gi),It(Gi,t)}function Sc(){Vt(Gi),Vt(ch),Vt(uh)}function T6(e){ma(uh.current);var t=ma(Gi.current),n=lb(t,e.type);t!==n&&(It(ch,e),It(Gi,n))}function A2(e){ch.current===e&&(Vt(Gi),Vt(ch))}var Zt=Go(0);function Ym(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 _x=[];function R2(){for(var e=0;e<_x.length;e++)_x[e]._workInProgressVersionPrimary=null;_x.length=0}var sm=Fs.ReactCurrentDispatcher,wx=Fs.ReactCurrentBatchConfig,ja=0,en=null,bn=null,En=null,Xm=!1,jd=!1,dh=0,QV=0;function In(){throw Error(he(321))}function M2(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ki(e[n],t[n]))return!1;return!0}function j2(e,t,n,r,i,s){if(ja=s,en=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,sm.current=e===null||e.memoizedState===null?nq:rq,e=n(r,i),jd){s=0;do{if(jd=!1,dh=0,25<=s)throw Error(he(301));s+=1,En=bn=null,t.updateQueue=null,sm.current=iq,e=n(r,i)}while(jd)}if(sm.current=Jm,t=bn!==null&&bn.next!==null,ja=0,En=bn=en=null,Xm=!1,t)throw Error(he(300));return e}function N2(){var e=dh!==0;return dh=0,e}function Ii(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return En===null?en.memoizedState=En=e:En=En.next=e,En}function ri(){if(bn===null){var e=en.alternate;e=e!==null?e.memoizedState:null}else e=bn.next;var t=En===null?en.memoizedState:En.next;if(t!==null)En=t,bn=e;else{if(e===null)throw Error(he(310));bn=e,e={memoizedState:bn.memoizedState,baseState:bn.baseState,baseQueue:bn.baseQueue,queue:bn.queue,next:null},En===null?en.memoizedState=En=e:En=En.next=e}return En}function hh(e,t){return typeof t=="function"?t(e):t}function Sx(e){var t=ri(),n=t.queue;if(n===null)throw Error(he(311));n.lastRenderedReducer=e;var r=bn,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=a=null,l=null,u=s;do{var h=u.lane;if((ja&h)===h)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=d,a=r):l=l.next=d,en.lanes|=h,Na|=h}u=u.next}while(u!==null&&u!==s);l===null?a=r:l.next=o,ki(r,t.memoizedState)||(pr=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,en.lanes|=s,Na|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Cx(e){var t=ri(),n=t.queue;if(n===null)throw Error(he(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=e(s,a.action),a=a.next;while(a!==i);ki(s,t.memoizedState)||(pr=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function A6(){}function R6(e,t){var n=en,r=ri(),i=t(),s=!ki(r.memoizedState,i);if(s&&(r.memoizedState=i,pr=!0),r=r.queue,D2(N6.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||En!==null&&En.memoizedState.tag&1){if(n.flags|=2048,fh(9,j6.bind(null,n,r,i,t),void 0,null),An===null)throw Error(he(349));ja&30||M6(n,t,i)}return i}function M6(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=en.updateQueue,t===null?(t={lastEffect:null,stores:null},en.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function j6(e,t,n,r){t.value=n,t.getSnapshot=r,D6(t)&&L6(e)}function N6(e,t,n){return n(function(){D6(t)&&L6(e)})}function D6(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ki(e,n)}catch{return!0}}function L6(e){var t=js(e,1);t!==null&&wi(t,e,1,-1)}function e3(e){var t=Ii();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hh,lastRenderedState:e},t.queue=e,e=e.dispatch=tq.bind(null,en,e),[t.memoizedState,e]}function fh(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=en.updateQueue,t===null?(t={lastEffect:null,stores:null},en.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 P6(){return ri().memoizedState}function om(e,t,n,r){var i=Ii();en.flags|=e,i.memoizedState=fh(1|t,n,void 0,r===void 0?null:r)}function Av(e,t,n,r){var i=ri();r=r===void 0?null:r;var s=void 0;if(bn!==null){var a=bn.memoizedState;if(s=a.destroy,r!==null&&M2(r,a.deps)){i.memoizedState=fh(t,n,s,r);return}}en.flags|=e,i.memoizedState=fh(1|t,n,s,r)}function t3(e,t){return om(8390656,8,e,t)}function D2(e,t){return Av(2048,8,e,t)}function O6(e,t){return Av(4,2,e,t)}function I6(e,t){return Av(4,4,e,t)}function $6(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 B6(e,t,n){return n=n!=null?n.concat([e]):null,Av(4,4,$6.bind(null,t,e),n)}function L2(){}function F6(e,t){var n=ri();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&M2(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function z6(e,t){var n=ri();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&M2(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function H6(e,t,n){return ja&21?(ki(n,t)||(n=Gj(),en.lanes|=n,Na|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,pr=!0),e.memoizedState=n)}function ZV(e,t){var n=St;St=n!==0&&4>n?n:4,e(!0);var r=wx.transition;wx.transition={};try{e(!1),t()}finally{St=n,wx.transition=r}}function W6(){return ri().memoizedState}function eq(e,t,n){var r=To(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},U6(e))V6(t,n);else if(n=k6(e,t,n,r),n!==null){var i=ir();wi(n,e,r,i),q6(n,t,r)}}function tq(e,t,n){var r=To(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(U6(e))V6(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,ki(o,a)){var l=t.interleaved;l===null?(i.next=i,k2(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=k6(e,t,i,r),n!==null&&(i=ir(),wi(n,e,r,i),q6(n,t,r))}}function U6(e){var t=e.alternate;return e===en||t!==null&&t===en}function V6(e,t){jd=Xm=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function q6(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,d2(e,n)}}var Jm={readContext:ni,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useInsertionEffect:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useMutableSource:In,useSyncExternalStore:In,useId:In,unstable_isNewReconciler:!1},nq={readContext:ni,useCallback:function(e,t){return Ii().memoizedState=[e,t===void 0?null:t],e},useContext:ni,useEffect:t3,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,om(4194308,4,$6.bind(null,t,e),n)},useLayoutEffect:function(e,t){return om(4194308,4,e,t)},useInsertionEffect:function(e,t){return om(4,2,e,t)},useMemo:function(e,t){var n=Ii();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ii();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=eq.bind(null,en,e),[r.memoizedState,e]},useRef:function(e){var t=Ii();return e={current:e},t.memoizedState=e},useState:e3,useDebugValue:L2,useDeferredValue:function(e){return Ii().memoizedState=e},useTransition:function(){var e=e3(!1),t=e[0];return e=ZV.bind(null,e[1]),Ii().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=en,i=Ii();if(Kt){if(n===void 0)throw Error(he(407));n=n()}else{if(n=t(),An===null)throw Error(he(349));ja&30||M6(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,t3(N6.bind(null,r,s,e),[e]),r.flags|=2048,fh(9,j6.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Ii(),t=An.identifierPrefix;if(Kt){var n=ys,r=xs;n=(r&~(1<<32-_i(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=dh++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=QV++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rq={readContext:ni,useCallback:F6,useContext:ni,useEffect:D2,useImperativeHandle:B6,useInsertionEffect:O6,useLayoutEffect:I6,useMemo:z6,useReducer:Sx,useRef:P6,useState:function(){return Sx(hh)},useDebugValue:L2,useDeferredValue:function(e){var t=ri();return H6(t,bn.memoizedState,e)},useTransition:function(){var e=Sx(hh)[0],t=ri().memoizedState;return[e,t]},useMutableSource:A6,useSyncExternalStore:R6,useId:W6,unstable_isNewReconciler:!1},iq={readContext:ni,useCallback:F6,useContext:ni,useEffect:D2,useImperativeHandle:B6,useInsertionEffect:O6,useLayoutEffect:I6,useMemo:z6,useReducer:Cx,useRef:P6,useState:function(){return Cx(hh)},useDebugValue:L2,useDeferredValue:function(e){var t=ri();return bn===null?t.memoizedState=e:H6(t,bn.memoizedState,e)},useTransition:function(){var e=Cx(hh)[0],t=ri().memoizedState;return[e,t]},useMutableSource:A6,useSyncExternalStore:R6,useId:W6,unstable_isNewReconciler:!1};function di(e,t){if(e&&e.defaultProps){t=tn({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Rb(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:tn({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rv={isMounted:function(e){return(e=e._reactInternals)?Xa(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ir(),i=To(e),s=Ts(r,i);s.payload=t,n!=null&&(s.callback=n),t=ko(e,s,i),t!==null&&(wi(t,e,i,r),im(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ir(),i=To(e),s=Ts(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=ko(e,s,i),t!==null&&(wi(t,e,i,r),im(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ir(),r=To(e),i=Ts(n,r);i.tag=2,t!=null&&(i.callback=t),t=ko(e,i,r),t!==null&&(wi(t,e,r,n),im(t,e,r))}};function n3(e,t,n,r,i,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,a):t.prototype&&t.prototype.isPureReactComponent?!sh(n,r)||!sh(i,s):!0}function G6(e,t,n){var r=!1,i=Lo,s=t.contextType;return typeof s=="object"&&s!==null?s=ni(s):(i=vr(t)?Ra:Gn.current,r=t.contextTypes,s=(r=r!=null)?bc(e,i):Lo),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Rv,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function r3(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&&Rv.enqueueReplaceState(t,t.state,null)}function Mb(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},E2(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=ni(s):(s=vr(t)?Ra:Gn.current,i.context=bc(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Rb(e,t,s,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&&Rv.enqueueReplaceState(i,i.state,null),Km(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Cc(e,t){try{var n="",r=t;do n+=NU(r),r=r.return;while(r);var i=n}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function kx(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function jb(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var sq=typeof WeakMap=="function"?WeakMap:Map;function K6(e,t,n){n=Ts(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Zm||(Zm=!0,zb=r),jb(e,t)},n}function Y6(e,t,n){n=Ts(-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(){jb(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){jb(e,t),typeof r!="function"&&(Eo===null?Eo=new Set([this]):Eo.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function i3(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new sq;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=yq.bind(null,e,t,n),t.then(e,e))}function s3(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 o3(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=Ts(-1,1),t.tag=2,ko(n,t,1))),n.lanes|=1),e)}var oq=Fs.ReactCurrentOwner,pr=!1;function Qn(e,t,n,r){t.child=e===null?C6(t,null,n,r):wc(t,e.child,n,r)}function a3(e,t,n,r,i){n=n.render;var s=t.ref;return nc(t,i),r=j2(e,t,n,r,s,i),n=N2(),e!==null&&!pr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ns(e,t,i)):(Kt&&n&&y2(t),t.flags|=1,Qn(e,t,r,i),t.child)}function l3(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!H2(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,X6(e,t,s,r,i)):(e=um(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:sh,n(a,r)&&e.ref===t.ref)return Ns(e,t,i)}return t.flags|=1,e=Ao(s,r),e.ref=t.ref,e.return=t,t.child=e}function X6(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(sh(s,r)&&e.ref===t.ref)if(pr=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(pr=!0);else return t.lanes=e.lanes,Ns(e,t,i)}return Nb(e,t,n,r,i)}function J6(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},It(Kl,Er),Er|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,It(Kl,Er),Er|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,It(Kl,Er),Er|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,It(Kl,Er),Er|=r;return Qn(e,t,i,n),t.child}function Q6(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Nb(e,t,n,r,i){var s=vr(n)?Ra:Gn.current;return s=bc(t,s),nc(t,i),n=j2(e,t,n,r,s,i),r=N2(),e!==null&&!pr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ns(e,t,i)):(Kt&&r&&y2(t),t.flags|=1,Qn(e,t,n,i),t.child)}function c3(e,t,n,r,i){if(vr(n)){var s=!0;Wm(t)}else s=!1;if(nc(t,i),t.stateNode===null)am(e,t),G6(t,n,r),Mb(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=ni(u):(u=vr(n)?Ra:Gn.current,u=bc(t,u));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==u)&&r3(t,a,r,u),so=!1;var f=t.memoizedState;a.state=f,Km(t,r,a,i),l=t.memoizedState,o!==r||f!==l||gr.current||so?(typeof h=="function"&&(Rb(t,n,h,r),l=t.memoizedState),(o=so||n3(t,n,o,r,f,l,u))?(d||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=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,E6(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:di(t.type,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=ni(l):(l=vr(n)?Ra:Gn.current,l=bc(t,l));var g=n.getDerivedStateFromProps;(h=typeof g=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==d||f!==l)&&r3(t,a,r,l),so=!1,f=t.memoizedState,a.state=f,Km(t,r,a,i);var b=t.memoizedState;o!==d||f!==b||gr.current||so?(typeof g=="function"&&(Rb(t,n,g,r),b=t.memoizedState),(u=so||n3(t,n,u,r,f,b,l)||!1)?(h||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,b,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,b,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),a.props=r,a.state=b,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Db(e,t,n,r,s,i)}function Db(e,t,n,r,i,s){Q6(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&KE(t,n,!1),Ns(e,t,s);r=t.stateNode,oq.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=wc(t,e.child,null,s),t.child=wc(t,null,o,s)):Qn(e,t,o,s),t.memoizedState=r.state,i&&KE(t,n,!0),t.child}function Z6(e){var t=e.stateNode;t.pendingContext?GE(e,t.pendingContext,t.pendingContext!==t.context):t.context&&GE(e,t.context,!1),T2(e,t.containerInfo)}function u3(e,t,n,r,i){return _c(),_2(i),t.flags|=256,Qn(e,t,n,r),t.child}var Lb={dehydrated:null,treeContext:null,retryLane:0};function Pb(e){return{baseLanes:e,cachePool:null,transitions:null}}function eN(e,t,n){var r=t.pendingProps,i=Zt.current,s=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),It(Zt,i&1),e===null)return Tb(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,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=Nv(a,r,0,null),e=Sa(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Pb(n),t.memoizedState=Lb,e):P2(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return aq(e,t,a,r,o,i,n);if(s){s=r.fallback,a=t.mode,i=e.child,o=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=Ao(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=Ao(o,s):(s=Sa(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?Pb(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=Lb,r}return s=e.child,e=s.sibling,r=Ao(s,{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 P2(e,t){return t=Nv({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function op(e,t,n,r){return r!==null&&_2(r),wc(t,e.child,null,n),e=P2(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function aq(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=kx(Error(he(422))),op(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Nv({mode:"visible",children:r.children},i,0,null),s=Sa(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&wc(t,e.child,null,a),t.child.memoizedState=Pb(a),t.memoizedState=Lb,s);if(!(t.mode&1))return op(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(he(419)),r=kx(s,r,void 0),op(e,t,a,r)}if(o=(a&e.childLanes)!==0,pr||o){if(r=An,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!==s.retryLane&&(s.retryLane=i,js(e,i),wi(r,e,i,-1))}return z2(),r=kx(Error(he(421))),op(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=bq.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Rr=Co(i.nextSibling),jr=t,Kt=!0,mi=null,e!==null&&(zr[Hr++]=xs,zr[Hr++]=ys,zr[Hr++]=Ma,xs=e.id,ys=e.overflow,Ma=t),t=P2(t,r.children),t.flags|=4096,t)}function d3(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ab(e.return,t,n)}function Ex(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function tN(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Qn(e,t,r.children,n),r=Zt.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&&d3(e,n,t);else if(e.tag===19)d3(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(It(Zt,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&&Ym(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ex(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ym(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ex(t,!0,n,null,s);break;case"together":Ex(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function am(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ns(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Na|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(he(153));if(t.child!==null){for(e=t.child,n=Ao(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ao(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lq(e,t,n){switch(t.tag){case 3:Z6(t),_c();break;case 5:T6(t);break;case 1:vr(t.type)&&Wm(t);break;case 4:T2(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;It(qm,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(It(Zt,Zt.current&1),t.flags|=128,null):n&t.child.childLanes?eN(e,t,n):(It(Zt,Zt.current&1),e=Ns(e,t,n),e!==null?e.sibling:null);It(Zt,Zt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return tN(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),It(Zt,Zt.current),r)break;return null;case 22:case 23:return t.lanes=0,J6(e,t,n)}return Ns(e,t,n)}var nN,Ob,rN,iN;nN=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}};Ob=function(){};rN=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ma(Gi.current);var s=null;switch(n){case"input":i=ib(e,i),r=ib(e,r),s=[];break;case"select":i=tn({},i,{value:void 0}),r=tn({},r,{value:void 0}),s=[];break;case"textarea":i=ab(e,i),r=ab(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=zm)}cb(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Qd.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Qd.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&zt("scroll",e),s||o===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};iN=function(e,t,n,r){n!==r&&(t.flags|=4)};function Iu(e,t){if(!Kt)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 $n(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 cq(e,t,n){var r=t.pendingProps;switch(b2(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $n(t),null;case 1:return vr(t.type)&&Hm(),$n(t),null;case 3:return r=t.stateNode,Sc(),Vt(gr),Vt(Gn),R2(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ip(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,mi!==null&&(Ub(mi),mi=null))),Ob(e,t),$n(t),null;case 5:A2(t);var i=ma(uh.current);if(n=t.type,e!==null&&t.stateNode!=null)rN(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(he(166));return $n(t),null}if(e=ma(Gi.current),ip(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[zi]=t,r[lh]=s,e=(t.mode&1)!==0,n){case"dialog":zt("cancel",r),zt("close",r);break;case"iframe":case"object":case"embed":zt("load",r);break;case"video":case"audio":for(i=0;i<fd.length;i++)zt(fd[i],r);break;case"source":zt("error",r);break;case"img":case"image":case"link":zt("error",r),zt("load",r);break;case"details":zt("toggle",r);break;case"input":bE(r,s),zt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},zt("invalid",r);break;case"textarea":wE(r,s),zt("invalid",r)}cb(n,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&rp(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&rp(r.textContent,o,e),i=["children",""+o]):Qd.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&zt("scroll",r)}switch(n){case"input":Yf(r),_E(r,s,!0);break;case"textarea":Yf(r),SE(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=zm)}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=Nj(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[zi]=t,e[lh]=r,nN(e,t,!1,!1),t.stateNode=e;e:{switch(a=ub(n,r),n){case"dialog":zt("cancel",e),zt("close",e),i=r;break;case"iframe":case"object":case"embed":zt("load",e),i=r;break;case"video":case"audio":for(i=0;i<fd.length;i++)zt(fd[i],e);i=r;break;case"source":zt("error",e),i=r;break;case"img":case"image":case"link":zt("error",e),zt("load",e),i=r;break;case"details":zt("toggle",e),i=r;break;case"input":bE(e,r),i=ib(e,r),zt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=tn({},r,{value:void 0}),zt("invalid",e);break;case"textarea":wE(e,r),i=ab(e,r),zt("invalid",e);break;default:i=r}cb(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?Pj(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Dj(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Zd(e,l):typeof l=="number"&&Zd(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Qd.hasOwnProperty(s)?l!=null&&s==="onScroll"&&zt("scroll",e):l!=null&&s2(e,s,l,a))}switch(n){case"input":Yf(e),_E(e,r,!1);break;case"textarea":Yf(e),SE(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Do(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Ql(e,!!r.multiple,s,!1):r.defaultValue!=null&&Ql(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=zm)}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 $n(t),null;case 6:if(e&&t.stateNode!=null)iN(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(he(166));if(n=ma(uh.current),ma(Gi.current),ip(t)){if(r=t.stateNode,n=t.memoizedProps,r[zi]=t,(s=r.nodeValue!==n)&&(e=jr,e!==null))switch(e.tag){case 3:rp(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rp(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[zi]=t,t.stateNode=r}return $n(t),null;case 13:if(Vt(Zt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Kt&&Rr!==null&&t.mode&1&&!(t.flags&128))w6(),_c(),t.flags|=98560,s=!1;else if(s=ip(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(he(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(he(317));s[zi]=t}else _c(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$n(t),s=!1}else mi!==null&&(Ub(mi),mi=null),s=!0;if(!s)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||Zt.current&1?Sn===0&&(Sn=3):z2())),t.updateQueue!==null&&(t.flags|=4),$n(t),null);case 4:return Sc(),Ob(e,t),e===null&&oh(t.stateNode.containerInfo),$n(t),null;case 10:return C2(t.type._context),$n(t),null;case 17:return vr(t.type)&&Hm(),$n(t),null;case 19:if(Vt(Zt),s=t.memoizedState,s===null)return $n(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)Iu(s,!1);else{if(Sn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ym(e),a!==null){for(t.flags|=128,Iu(s,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,e=a.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return It(Zt,Zt.current&1|2),t.child}e=e.sibling}s.tail!==null&&cn()>kc&&(t.flags|=128,r=!0,Iu(s,!1),t.lanes=4194304)}else{if(!r)if(e=Ym(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Iu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Kt)return $n(t),null}else 2*cn()-s.renderingStartTime>kc&&n!==1073741824&&(t.flags|=128,r=!0,Iu(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=cn(),t.sibling=null,n=Zt.current,It(Zt,r?n&1|2:n&1),t):($n(t),null);case 22:case 23:return F2(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Er&1073741824&&($n(t),t.subtreeFlags&6&&(t.flags|=8192)):$n(t),null;case 24:return null;case 25:return null}throw Error(he(156,t.tag))}function uq(e,t){switch(b2(t),t.tag){case 1:return vr(t.type)&&Hm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sc(),Vt(gr),Vt(Gn),R2(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return A2(t),null;case 13:if(Vt(Zt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(he(340));_c()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vt(Zt),null;case 4:return Sc(),null;case 10:return C2(t.type._context),null;case 22:case 23:return F2(),null;case 24:return null;default:return null}}var ap=!1,Hn=!1,dq=typeof WeakSet=="function"?WeakSet:Set,Se=null;function Gl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){sn(e,t,r)}else n.current=null}function Ib(e,t,n){try{n()}catch(r){sn(e,t,r)}}var h3=!1;function hq(e,t){if(bb=$m,e=c6(),x2(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,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,h=0,d=e,f=null;t:for(;;){for(var g;d!==n||i!==0&&d.nodeType!==3||(o=a+i),d!==s||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++u===i&&(o=a),f===s&&++h===r&&(l=a),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(_b={focusedElem:e,selectionRange:n},$m=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var x=b.memoizedProps,v=b.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?x:di(t.type,x),v);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(he(163))}}catch(_){sn(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return b=h3,h3=!1,b}function Nd(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 s=i.destroy;i.destroy=void 0,s!==void 0&&Ib(t,n,s)}i=i.next}while(i!==r)}}function Mv(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 $b(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 sN(e){var t=e.alternate;t!==null&&(e.alternate=null,sN(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zi],delete t[lh],delete t[Cb],delete t[KV],delete t[YV])),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 oN(e){return e.tag===5||e.tag===3||e.tag===4}function f3(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oN(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 Bb(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=zm));else if(r!==4&&(e=e.child,e!==null))for(Bb(e,t,n),e=e.sibling;e!==null;)Bb(e,t,n),e=e.sibling}function Fb(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(Fb(e,t,n),e=e.sibling;e!==null;)Fb(e,t,n),e=e.sibling}var Ln=null,hi=!1;function Ys(e,t,n){for(n=n.child;n!==null;)aN(e,t,n),n=n.sibling}function aN(e,t,n){if(qi&&typeof qi.onCommitFiberUnmount=="function")try{qi.onCommitFiberUnmount(wv,n)}catch{}switch(n.tag){case 5:Hn||Gl(n,t);case 6:var r=Ln,i=hi;Ln=null,Ys(e,t,n),Ln=r,hi=i,Ln!==null&&(hi?(e=Ln,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ln.removeChild(n.stateNode));break;case 18:Ln!==null&&(hi?(e=Ln,n=n.stateNode,e.nodeType===8?yx(e.parentNode,n):e.nodeType===1&&yx(e,n),rh(e)):yx(Ln,n.stateNode));break;case 4:r=Ln,i=hi,Ln=n.stateNode.containerInfo,hi=!0,Ys(e,t,n),Ln=r,hi=i;break;case 0:case 11:case 14:case 15:if(!Hn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&Ib(n,t,a),i=i.next}while(i!==r)}Ys(e,t,n);break;case 1:if(!Hn&&(Gl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){sn(n,t,o)}Ys(e,t,n);break;case 21:Ys(e,t,n);break;case 22:n.mode&1?(Hn=(r=Hn)||n.memoizedState!==null,Ys(e,t,n),Hn=r):Ys(e,t,n);break;default:Ys(e,t,n)}}function p3(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dq),t.forEach(function(r){var i=_q.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ci(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:Ln=o.stateNode,hi=!1;break e;case 3:Ln=o.stateNode.containerInfo,hi=!0;break e;case 4:Ln=o.stateNode.containerInfo,hi=!0;break e}o=o.return}if(Ln===null)throw Error(he(160));aN(s,a,i),Ln=null,hi=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){sn(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)lN(t,e),t=t.sibling}function lN(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ci(t,e),Pi(e),r&4){try{Nd(3,e,e.return),Mv(3,e)}catch(x){sn(e,e.return,x)}try{Nd(5,e,e.return)}catch(x){sn(e,e.return,x)}}break;case 1:ci(t,e),Pi(e),r&512&&n!==null&&Gl(n,n.return);break;case 5:if(ci(t,e),Pi(e),r&512&&n!==null&&Gl(n,n.return),e.flags&32){var i=e.stateNode;try{Zd(i,"")}catch(x){sn(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,a=n!==null?n.memoizedProps:s,o=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&Mj(i,s),ub(o,a);var u=ub(o,s);for(a=0;a<l.length;a+=2){var h=l[a],d=l[a+1];h==="style"?Pj(i,d):h==="dangerouslySetInnerHTML"?Dj(i,d):h==="children"?Zd(i,d):s2(i,h,d,u)}switch(o){case"input":sb(i,s);break;case"textarea":jj(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var g=s.value;g!=null?Ql(i,!!s.multiple,g,!1):f!==!!s.multiple&&(s.defaultValue!=null?Ql(i,!!s.multiple,s.defaultValue,!0):Ql(i,!!s.multiple,s.multiple?[]:"",!1))}i[lh]=s}catch(x){sn(e,e.return,x)}}break;case 6:if(ci(t,e),Pi(e),r&4){if(e.stateNode===null)throw Error(he(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(x){sn(e,e.return,x)}}break;case 3:if(ci(t,e),Pi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{rh(t.containerInfo)}catch(x){sn(e,e.return,x)}break;case 4:ci(t,e),Pi(e);break;case 13:ci(t,e),Pi(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||($2=cn())),r&4&&p3(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Hn=(u=Hn)||h,ci(t,e),Hn=u):ci(t,e),Pi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!h&&e.mode&1)for(Se=e,h=e.child;h!==null;){for(d=Se=h;Se!==null;){switch(f=Se,g=f.child,f.tag){case 0:case 11:case 14:case 15:Nd(4,f,f.return);break;case 1:Gl(f,f.return);var b=f.stateNode;if(typeof b.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(x){sn(r,n,x)}}break;case 5:Gl(f,f.return);break;case 22:if(f.memoizedState!==null){g3(d);continue}}g!==null?(g.return=f,Se=g):g3(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{i=d.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=d.stateNode,l=d.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=Lj("display",a))}catch(x){sn(e,e.return,x)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){sn(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ci(t,e),Pi(e),r&4&&p3(e);break;case 21:break;default:ci(t,e),Pi(e)}}function Pi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(oN(n)){var r=n;break e}n=n.return}throw Error(he(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Zd(i,""),r.flags&=-33);var s=f3(e);Fb(e,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=f3(e);Bb(e,o,a);break;default:throw Error(he(161))}}catch(l){sn(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fq(e,t,n){Se=e,cN(e)}function cN(e,t,n){for(var r=(e.mode&1)!==0;Se!==null;){var i=Se,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||ap;if(!a){var o=i.alternate,l=o!==null&&o.memoizedState!==null||Hn;o=ap;var u=Hn;if(ap=a,(Hn=l)&&!u)for(Se=i;Se!==null;)a=Se,l=a.child,a.tag===22&&a.memoizedState!==null?v3(i):l!==null?(l.return=a,Se=l):v3(i);for(;s!==null;)Se=s,cN(s),s=s.sibling;Se=i,ap=o,Hn=u}m3(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Se=s):m3(e)}}function m3(e){for(;Se!==null;){var t=Se;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Hn||Mv(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Hn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:di(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&ZE(t,s,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}ZE(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;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 u=t.alternate;if(u!==null){var h=u.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&rh(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(he(163))}Hn||t.flags&512&&$b(t)}catch(f){sn(t,t.return,f)}}if(t===e){Se=null;break}if(n=t.sibling,n!==null){n.return=t.return,Se=n;break}Se=t.return}}function g3(e){for(;Se!==null;){var t=Se;if(t===e){Se=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Se=n;break}Se=t.return}}function v3(e){for(;Se!==null;){var t=Se;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Mv(4,t)}catch(l){sn(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){sn(t,i,l)}}var s=t.return;try{$b(t)}catch(l){sn(t,s,l)}break;case 5:var a=t.return;try{$b(t)}catch(l){sn(t,a,l)}}}catch(l){sn(t,t.return,l)}if(t===e){Se=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Se=o;break}Se=t.return}}var pq=Math.ceil,Qm=Fs.ReactCurrentDispatcher,O2=Fs.ReactCurrentOwner,Qr=Fs.ReactCurrentBatchConfig,pt=0,An=null,fn=null,Pn=0,Er=0,Kl=Go(0),Sn=0,ph=null,Na=0,jv=0,I2=0,Dd=null,hr=null,$2=0,kc=1/0,ps=null,Zm=!1,zb=null,Eo=null,lp=!1,fo=null,eg=0,Ld=0,Hb=null,lm=-1,cm=0;function ir(){return pt&6?cn():lm!==-1?lm:lm=cn()}function To(e){return e.mode&1?pt&2&&Pn!==0?Pn&-Pn:JV.transition!==null?(cm===0&&(cm=Gj()),cm):(e=St,e!==0||(e=window.event,e=e===void 0?16:e6(e.type)),e):1}function wi(e,t,n,r){if(50<Ld)throw Ld=0,Hb=null,Error(he(185));Zh(e,n,r),(!(pt&2)||e!==An)&&(e===An&&(!(pt&2)&&(jv|=n),Sn===4&&co(e,Pn)),xr(e,r),n===1&&pt===0&&!(t.mode&1)&&(kc=cn()+500,Tv&&Ko()))}function xr(e,t){var n=e.callbackNode;JU(e,t);var r=Im(e,e===An?Pn:0);if(r===0)n!==null&&EE(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&EE(n),t===1)e.tag===0?XV(x3.bind(null,e)):y6(x3.bind(null,e)),qV(function(){!(pt&6)&&Ko()}),n=null;else{switch(Kj(r)){case 1:n=u2;break;case 4:n=Vj;break;case 16:n=Om;break;case 536870912:n=qj;break;default:n=Om}n=vN(n,uN.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function uN(e,t){if(lm=-1,cm=0,pt&6)throw Error(he(327));var n=e.callbackNode;if(rc()&&e.callbackNode!==n)return null;var r=Im(e,e===An?Pn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=tg(e,r);else{t=r;var i=pt;pt|=2;var s=hN();(An!==e||Pn!==t)&&(ps=null,kc=cn()+500,wa(e,t));do try{vq();break}catch(o){dN(e,o)}while(!0);S2(),Qm.current=s,pt=i,fn!==null?t=0:(An=null,Pn=0,t=Sn)}if(t!==0){if(t===2&&(i=mb(e),i!==0&&(r=i,t=Wb(e,i))),t===1)throw n=ph,wa(e,0),co(e,r),xr(e,cn()),n;if(t===6)co(e,r);else{if(i=e.current.alternate,!(r&30)&&!mq(i)&&(t=tg(e,r),t===2&&(s=mb(e),s!==0&&(r=s,t=Wb(e,s))),t===1))throw n=ph,wa(e,0),co(e,r),xr(e,cn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(he(345));case 2:aa(e,hr,ps);break;case 3:if(co(e,r),(r&130023424)===r&&(t=$2+500-cn(),10<t)){if(Im(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){ir(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Sb(aa.bind(null,e,hr,ps),t);break}aa(e,hr,ps);break;case 4:if(co(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-_i(r);s=1<<a,a=t[a],a>i&&(i=a),r&=~s}if(r=i,r=cn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*pq(r/1960))-r,10<r){e.timeoutHandle=Sb(aa.bind(null,e,hr,ps),r);break}aa(e,hr,ps);break;case 5:aa(e,hr,ps);break;default:throw Error(he(329))}}}return xr(e,cn()),e.callbackNode===n?uN.bind(null,e):null}function Wb(e,t){var n=Dd;return e.current.memoizedState.isDehydrated&&(wa(e,t).flags|=256),e=tg(e,t),e!==2&&(t=hr,hr=n,t!==null&&Ub(t)),e}function Ub(e){hr===null?hr=e:hr.push.apply(hr,e)}function mq(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],s=i.getSnapshot;i=i.value;try{if(!ki(s(),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 co(e,t){for(t&=~I2,t&=~jv,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_i(t),r=1<<n;e[n]=-1,t&=~r}}function x3(e){if(pt&6)throw Error(he(327));rc();var t=Im(e,0);if(!(t&1))return xr(e,cn()),null;var n=tg(e,t);if(e.tag!==0&&n===2){var r=mb(e);r!==0&&(t=r,n=Wb(e,r))}if(n===1)throw n=ph,wa(e,0),co(e,t),xr(e,cn()),n;if(n===6)throw Error(he(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,aa(e,hr,ps),xr(e,cn()),null}function B2(e,t){var n=pt;pt|=1;try{return e(t)}finally{pt=n,pt===0&&(kc=cn()+500,Tv&&Ko())}}function Da(e){fo!==null&&fo.tag===0&&!(pt&6)&&rc();var t=pt;pt|=1;var n=Qr.transition,r=St;try{if(Qr.transition=null,St=1,e)return e()}finally{St=r,Qr.transition=n,pt=t,!(pt&6)&&Ko()}}function F2(){Er=Kl.current,Vt(Kl)}function wa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,VV(n)),fn!==null)for(n=fn.return;n!==null;){var r=n;switch(b2(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Hm();break;case 3:Sc(),Vt(gr),Vt(Gn),R2();break;case 5:A2(r);break;case 4:Sc();break;case 13:Vt(Zt);break;case 19:Vt(Zt);break;case 10:C2(r.type._context);break;case 22:case 23:F2()}n=n.return}if(An=e,fn=e=Ao(e.current,null),Pn=Er=t,Sn=0,ph=null,I2=jv=Na=0,hr=Dd=null,pa!==null){for(t=0;t<pa.length;t++)if(n=pa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}n.pending=r}pa=null}return e}function dN(e,t){do{var n=fn;try{if(S2(),sm.current=Jm,Xm){for(var r=en.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Xm=!1}if(ja=0,En=bn=en=null,jd=!1,dh=0,O2.current=null,n===null||n.return===null){Sn=1,ph=t,fn=null;break}e:{var s=e,a=n.return,o=n,l=t;if(t=Pn,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,h=o,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var g=s3(a);if(g!==null){g.flags&=-257,o3(g,a,o,s,t),g.mode&1&&i3(s,u,t),t=g,l=u;var b=t.updateQueue;if(b===null){var x=new Set;x.add(l),t.updateQueue=x}else b.add(l);break e}else{if(!(t&1)){i3(s,u,t),z2();break e}l=Error(he(426))}}else if(Kt&&o.mode&1){var v=s3(a);if(v!==null){!(v.flags&65536)&&(v.flags|=256),o3(v,a,o,s,t),_2(Cc(l,o));break e}}s=l=Cc(l,o),Sn!==4&&(Sn=2),Dd===null?Dd=[s]:Dd.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=K6(s,l,t);QE(s,m);break e;case 1:o=l;var p=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof p.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Eo===null||!Eo.has(y)))){s.flags|=65536,t&=-t,s.lanes|=t;var _=Y6(s,o,t);QE(s,_);break e}}s=s.return}while(s!==null)}pN(n)}catch(C){t=C,fn===n&&n!==null&&(fn=n=n.return);continue}break}while(!0)}function hN(){var e=Qm.current;return Qm.current=Jm,e===null?Jm:e}function z2(){(Sn===0||Sn===3||Sn===2)&&(Sn=4),An===null||!(Na&268435455)&&!(jv&268435455)||co(An,Pn)}function tg(e,t){var n=pt;pt|=2;var r=hN();(An!==e||Pn!==t)&&(ps=null,wa(e,t));do try{gq();break}catch(i){dN(e,i)}while(!0);if(S2(),pt=n,Qm.current=r,fn!==null)throw Error(he(261));return An=null,Pn=0,Sn}function gq(){for(;fn!==null;)fN(fn)}function vq(){for(;fn!==null&&!HU();)fN(fn)}function fN(e){var t=gN(e.alternate,e,Er);e.memoizedProps=e.pendingProps,t===null?pN(e):fn=t,O2.current=null}function pN(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=uq(n,t),n!==null){n.flags&=32767,fn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Sn=6,fn=null;return}}else if(n=cq(n,t,Er),n!==null){fn=n;return}if(t=t.sibling,t!==null){fn=t;return}fn=t=e}while(t!==null);Sn===0&&(Sn=5)}function aa(e,t,n){var r=St,i=Qr.transition;try{Qr.transition=null,St=1,xq(e,t,n,r)}finally{Qr.transition=i,St=r}return null}function xq(e,t,n,r){do rc();while(fo!==null);if(pt&6)throw Error(he(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(he(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(QU(e,s),e===An&&(fn=An=null,Pn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||lp||(lp=!0,vN(Om,function(){return rc(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Qr.transition,Qr.transition=null;var a=St;St=1;var o=pt;pt|=4,O2.current=null,hq(e,n),lN(n,e),$V(_b),$m=!!bb,_b=bb=null,e.current=n,fq(n),WU(),pt=o,St=a,Qr.transition=s}else e.current=n;if(lp&&(lp=!1,fo=e,eg=i),s=e.pendingLanes,s===0&&(Eo=null),qU(n.stateNode),xr(e,cn()),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(Zm)throw Zm=!1,e=zb,zb=null,e;return eg&1&&e.tag!==0&&rc(),s=e.pendingLanes,s&1?e===Hb?Ld++:(Ld=0,Hb=e):Ld=0,Ko(),null}function rc(){if(fo!==null){var e=Kj(eg),t=Qr.transition,n=St;try{if(Qr.transition=null,St=16>e?16:e,fo===null)var r=!1;else{if(e=fo,fo=null,eg=0,pt&6)throw Error(he(331));var i=pt;for(pt|=4,Se=e.current;Se!==null;){var s=Se,a=s.child;if(Se.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(Se=u;Se!==null;){var h=Se;switch(h.tag){case 0:case 11:case 15:Nd(8,h,s)}var d=h.child;if(d!==null)d.return=h,Se=d;else for(;Se!==null;){h=Se;var f=h.sibling,g=h.return;if(sN(h),h===u){Se=null;break}if(f!==null){f.return=g,Se=f;break}Se=g}}}var b=s.alternate;if(b!==null){var x=b.child;if(x!==null){b.child=null;do{var v=x.sibling;x.sibling=null,x=v}while(x!==null)}}Se=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,Se=a;else e:for(;Se!==null;){if(s=Se,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Nd(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,Se=m;break e}Se=s.return}}var p=e.current;for(Se=p;Se!==null;){a=Se;var y=a.child;if(a.subtreeFlags&2064&&y!==null)y.return=a,Se=y;else e:for(a=p;Se!==null;){if(o=Se,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Mv(9,o)}}catch(C){sn(o,o.return,C)}if(o===a){Se=null;break e}var _=o.sibling;if(_!==null){_.return=o.return,Se=_;break e}Se=o.return}}if(pt=i,Ko(),qi&&typeof qi.onPostCommitFiberRoot=="function")try{qi.onPostCommitFiberRoot(wv,e)}catch{}r=!0}return r}finally{St=n,Qr.transition=t}}return!1}function y3(e,t,n){t=Cc(n,t),t=K6(e,t,1),e=ko(e,t,1),t=ir(),e!==null&&(Zh(e,1,t),xr(e,t))}function sn(e,t,n){if(e.tag===3)y3(e,e,n);else for(;t!==null;){if(t.tag===3){y3(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Eo===null||!Eo.has(r))){e=Cc(n,e),e=Y6(t,e,1),t=ko(t,e,1),e=ir(),t!==null&&(Zh(t,1,e),xr(t,e));break}}t=t.return}}function yq(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ir(),e.pingedLanes|=e.suspendedLanes&n,An===e&&(Pn&n)===n&&(Sn===4||Sn===3&&(Pn&130023424)===Pn&&500>cn()-$2?wa(e,0):I2|=n),xr(e,t)}function mN(e,t){t===0&&(e.mode&1?(t=Qf,Qf<<=1,!(Qf&130023424)&&(Qf=4194304)):t=1);var n=ir();e=js(e,t),e!==null&&(Zh(e,t,n),xr(e,n))}function bq(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mN(e,n)}function _q(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(he(314))}r!==null&&r.delete(t),mN(e,n)}var gN;gN=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||gr.current)pr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pr=!1,lq(e,t,n);pr=!!(e.flags&131072)}else pr=!1,Kt&&t.flags&1048576&&b6(t,Vm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;am(e,t),e=t.pendingProps;var i=bc(t,Gn.current);nc(t,n),i=j2(null,t,r,e,i,n);var s=N2();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,vr(r)?(s=!0,Wm(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,E2(t),i.updater=Rv,t.stateNode=i,i._reactInternals=t,Mb(t,r,e,n),t=Db(null,t,r,!0,s,n)):(t.tag=0,Kt&&s&&y2(t),Qn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(am(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Sq(r),e=di(r,e),i){case 0:t=Nb(null,t,r,e,n);break e;case 1:t=c3(null,t,r,e,n);break e;case 11:t=a3(null,t,r,e,n);break e;case 14:t=l3(null,t,r,di(r.type,e),n);break e}throw Error(he(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:di(r,i),Nb(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:di(r,i),c3(e,t,r,i,n);case 3:e:{if(Z6(t),e===null)throw Error(he(387));r=t.pendingProps,s=t.memoizedState,i=s.element,E6(e,t),Km(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Cc(Error(he(423)),t),t=u3(e,t,r,n,i);break e}else if(r!==i){i=Cc(Error(he(424)),t),t=u3(e,t,r,n,i);break e}else for(Rr=Co(t.stateNode.containerInfo.firstChild),jr=t,Kt=!0,mi=null,n=C6(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_c(),r===i){t=Ns(e,t,n);break e}Qn(e,t,r,n)}t=t.child}return t;case 5:return T6(t),e===null&&Tb(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,wb(r,i)?a=null:s!==null&&wb(r,s)&&(t.flags|=32),Q6(e,t),Qn(e,t,a,n),t.child;case 6:return e===null&&Tb(t),null;case 13:return eN(e,t,n);case 4:return T2(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wc(t,null,r,n):Qn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:di(r,i),a3(e,t,r,i,n);case 7:return Qn(e,t,t.pendingProps,n),t.child;case 8:return Qn(e,t,t.pendingProps.children,n),t.child;case 12:return Qn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,It(qm,r._currentValue),r._currentValue=a,s!==null)if(ki(s.value,a)){if(s.children===i.children&&!gr.current){t=Ns(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Ts(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?l.next=l:(l.next=h.next,h.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ab(s.return,n,t),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(he(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Ab(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Qn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,nc(t,n),i=ni(i),r=r(i),t.flags|=1,Qn(e,t,r,n),t.child;case 14:return r=t.type,i=di(r,t.pendingProps),i=di(r.type,i),l3(e,t,r,i,n);case 15:return X6(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:di(r,i),am(e,t),t.tag=1,vr(r)?(e=!0,Wm(t)):e=!1,nc(t,n),G6(t,r,i),Mb(t,r,i,n),Db(null,t,r,!0,e,n);case 19:return tN(e,t,n);case 22:return J6(e,t,n)}throw Error(he(156,t.tag))};function vN(e,t){return Uj(e,t)}function wq(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 Kr(e,t,n,r){return new wq(e,t,n,r)}function H2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sq(e){if(typeof e=="function")return H2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===a2)return 11;if(e===l2)return 14}return 2}function Ao(e,t){var n=e.alternate;return n===null?(n=Kr(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 um(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")H2(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case $l:return Sa(n.children,i,s,t);case o2:a=8,i|=8;break;case eb:return e=Kr(12,n,t,i|2),e.elementType=eb,e.lanes=s,e;case tb:return e=Kr(13,n,t,i),e.elementType=tb,e.lanes=s,e;case nb:return e=Kr(19,n,t,i),e.elementType=nb,e.lanes=s,e;case Tj:return Nv(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kj:a=10;break e;case Ej:a=9;break e;case a2:a=11;break e;case l2:a=14;break e;case io:a=16,r=null;break e}throw Error(he(130,e==null?e:typeof e,""))}return t=Kr(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Sa(e,t,n,r){return e=Kr(7,e,r,t),e.lanes=n,e}function Nv(e,t,n,r){return e=Kr(22,e,r,t),e.elementType=Tj,e.lanes=n,e.stateNode={isHidden:!1},e}function Tx(e,t,n){return e=Kr(6,e,null,t),e.lanes=n,e}function Ax(e,t,n){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Cq(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=lx(0),this.expirationTimes=lx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lx(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function W2(e,t,n,r,i,s,a,o,l){return e=new Cq(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Kr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},E2(s),e}function kq(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Il,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function xN(e){if(!e)return Lo;e=e._reactInternals;e:{if(Xa(e)!==e||e.tag!==1)throw Error(he(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(he(171))}if(e.tag===1){var n=e.type;if(vr(n))return x6(e,n,t)}return t}function yN(e,t,n,r,i,s,a,o,l){return e=W2(n,r,!0,e,i,s,a,o,l),e.context=xN(null),n=e.current,r=ir(),i=To(n),s=Ts(r,i),s.callback=t??null,ko(n,s,i),e.current.lanes=i,Zh(e,i,r),xr(e,r),e}function Dv(e,t,n,r){var i=t.current,s=ir(),a=To(i);return n=xN(n),t.context===null?t.context=n:t.pendingContext=n,t=Ts(s,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ko(i,t,a),e!==null&&(wi(e,i,a,s),im(e,i,a)),a}function ng(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 b3(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function U2(e,t){b3(e,t),(e=e.alternate)&&b3(e,t)}var bN=typeof reportError=="function"?reportError:function(e){console.error(e)};function V2(e){this._internalRoot=e}Lv.prototype.render=V2.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(he(409));Dv(e,t,null,null)};Lv.prototype.unmount=V2.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Da(function(){Dv(null,e,null,null)}),t[Ms]=null}};function Lv(e){this._internalRoot=e}Lv.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<lo.length&&t!==0&&t<lo[n].priority;n++);lo.splice(n,0,e),n===0&&Zj(e)}};function q2(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Pv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function _3(){}function Eq(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=ng(a);s.call(u)}}var a=yN(t,r,e,0,null,!1,!1,"",_3);return e._reactRootContainer=a,e[Ms]=a.current,oh(e.nodeType===8?e.parentNode:e),Da(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=ng(l);o.call(u)}}var l=W2(e,0,!1,null,null,!1,!1,"",_3);return e._reactRootContainer=l,e[Ms]=l.current,oh(e.nodeType===8?e.parentNode:e),Da(function(){Dv(t,l,n,r)}),l}function Ov(e,t,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var l=ng(a);o.call(l)}}Dv(t,a,e,i)}else a=Eq(n,t,e,i,r);return ng(a)}Yj=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=hd(t.pendingLanes);n!==0&&(d2(t,n|1),xr(t,cn()),!(pt&6)&&(kc=cn()+500,Ko()))}break;case 13:Da(function(){var r=js(e,1);if(r!==null){var i=ir();wi(r,e,1,i)}}),U2(e,1)}};h2=function(e){if(e.tag===13){var t=js(e,134217728);if(t!==null){var n=ir();wi(t,e,134217728,n)}U2(e,134217728)}};Xj=function(e){if(e.tag===13){var t=To(e),n=js(e,t);if(n!==null){var r=ir();wi(n,e,t,r)}U2(e,t)}};Jj=function(){return St};Qj=function(e,t){var n=St;try{return St=e,t()}finally{St=n}};hb=function(e,t,n){switch(t){case"input":if(sb(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=Ev(r);if(!i)throw Error(he(90));Rj(r),sb(r,i)}}}break;case"textarea":jj(e,n);break;case"select":t=n.value,t!=null&&Ql(e,!!n.multiple,t,!1)}};$j=B2;Bj=Da;var Tq={usingClientEntryPoint:!1,Events:[tf,Hl,Ev,Oj,Ij,B2]},$u={findFiberByHostInstance:fa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Aq={bundleType:$u.bundleType,version:$u.version,rendererPackageName:$u.rendererPackageName,rendererConfig:$u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Fs.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hj(e),e===null?null:e.stateNode},findFiberByHostInstance:$u.findFiberByHostInstance,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cp.isDisabled&&cp.supportsFiber)try{wv=cp.inject(Aq),qi=cp}catch{}}Ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tq;Ir.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!q2(t))throw Error(he(200));return kq(e,t,null,n)};Ir.createRoot=function(e,t){if(!q2(e))throw Error(he(299));var n=!1,r="",i=bN;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=W2(e,1,!1,null,null,n,!1,r,i),e[Ms]=t.current,oh(e.nodeType===8?e.parentNode:e),new V2(t)};Ir.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(he(188)):(e=Object.keys(e).join(","),Error(he(268,e)));return e=Hj(t),e=e===null?null:e.stateNode,e};Ir.flushSync=function(e){return Da(e)};Ir.hydrate=function(e,t,n){if(!Pv(t))throw Error(he(200));return Ov(null,e,t,!0,n)};Ir.hydrateRoot=function(e,t,n){if(!q2(e))throw Error(he(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=bN;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=yN(t,null,e,1,n??null,i,!1,s,a),e[Ms]=t.current,oh(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 Lv(t)};Ir.render=function(e,t,n){if(!Pv(t))throw Error(he(200));return Ov(null,e,t,!1,n)};Ir.unmountComponentAtNode=function(e){if(!Pv(e))throw Error(he(40));return e._reactRootContainer?(Da(function(){Ov(null,null,e,!1,function(){e._reactRootContainer=null,e[Ms]=null})}),!0):!1};Ir.unstable_batchedUpdates=B2;Ir.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Pv(n))throw Error(he(200));if(e==null||e._reactInternals===void 0)throw Error(he(38));return Ov(e,t,n,!1,r)};Ir.version="18.3.1-next-f1338f8080-20240426";function _N(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_N)}catch(e){console.error(e)}}_N(),_j.exports=Ir;var mr=_j.exports;const G2=Rn(mr);var w3=mr;Qy.createRoot=w3.createRoot,Qy.hydrateRoot=w3.hydrateRoot;var Rq=typeof Ui=="object"&&Ui&&Ui.Object===Object&&Ui,Mq=typeof self=="object"&&self&&self.Object===Object&&self;Rq||Mq||Function("return this")();var jq=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Ei(e,t,n,r){const i=w.useRef(t);jq(()=>{i.current=t},[t]),w.useEffect(()=>{const s=window;if(!(s&&s.addEventListener))return;const a=o=>{i.current(o)};return s.addEventListener(e,a,r),()=>{s.removeEventListener(e,a,r)}},[e,n,r])}function Nq(e,t,n="mousedown",r={}){Ei(n,i=>{const s=i.target;if(!s||!s.isConnected)return;(Array.isArray(e)?e.filter(o=>!!o.current).every(o=>o.current&&!o.current.contains(s)):e.current&&!e.current.contains(s))&&t(i)},void 0,r)}function Dq(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,s,a=[],o="",l=e.split("/");for(l[0]||l.shift();i=l.shift();)n=i[0],n==="*"?(a.push(n),o+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=i.indexOf("?",1),s=i.indexOf(".",1),a.push(i.substring(1,~r?r:~s?s:i.length)),o+=~r&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(o+=(~r?"?":"")+"\\"+i.substring(s))):o+="/"+i;return{keys:a,pattern:new RegExp("^"+o+(t?"(?=$|/)":"/?$"),"i")}}var wN={exports:{}},SN={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ec=w;function Lq(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pq=typeof Object.is=="function"?Object.is:Lq,Oq=Ec.useState,Iq=Ec.useEffect,$q=Ec.useLayoutEffect,Bq=Ec.useDebugValue;function Fq(e,t){var n=t(),r=Oq({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return $q(function(){i.value=n,i.getSnapshot=t,Rx(i)&&s({inst:i})},[e,n,t]),Iq(function(){return Rx(i)&&s({inst:i}),e(function(){Rx(i)&&s({inst:i})})},[e]),Bq(n),n}function Rx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pq(e,n)}catch{return!0}}function zq(e,t){return t()}var Hq=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?zq:Fq;SN.useSyncExternalStore=Ec.useSyncExternalStore!==void 0?Ec.useSyncExternalStore:Hq;wN.exports=SN;var CN=wN.exports;const Wq=xj.useInsertionEffect,Uq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Vq=Uq?w.useLayoutEffect:w.useEffect,qq=Wq||Vq,kN=e=>{const t=w.useRef([e,(...n)=>t[0](...n)]).current;return qq(()=>{t[0]=e}),t[1]},Gq="popstate",K2="pushState",Y2="replaceState",Kq="hashchange",S3=[Gq,K2,Y2,Kq],Yq=e=>{for(const t of S3)addEventListener(t,e);return()=>{for(const t of S3)removeEventListener(t,e)}},EN=(e,t)=>CN.useSyncExternalStore(Yq,e,t),Xq=()=>location.search,Jq=({ssrSearch:e=""}={})=>EN(Xq,()=>e),C3=()=>location.pathname,Qq=({ssrPath:e}={})=>EN(C3,e?()=>e:C3),X2=(e,{replace:t=!1,state:n=null}={})=>history[t?Y2:K2](n,"",e),Zq=(e={})=>[Qq(e),X2],k3=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[k3]>"u"){for(const e of[K2,Y2]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,k3,{value:!0})}const eG=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",TN=(e="")=>e==="/"?"":e,tG=(e,t)=>e[0]==="~"?e.slice(1):TN(t)+e,nG=(e="",t)=>eG(E3(TN(e)),E3(t)),E3=e=>{try{return decodeURI(e)}catch{return e}},AN={hook:Zq,searchHook:Jq,parser:Dq,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},RN=w.createContext(AN),Yc=()=>w.useContext(RN),MN={},jN=w.createContext(MN),rG=()=>w.useContext(jN),Iv=e=>{const[t,n]=e.hook(e);return[nG(e.base,t),kN((r,i)=>n(tG(r,e.base),i))]},zs=()=>Iv(Yc()),J2=(e,t,n,r)=>{const{pattern:i,keys:s}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",r),a=i.exec(n)||[],[o,...l]=a;return o!==void 0?[!0,(()=>{const u=s!==!1?Object.fromEntries(s.map((d,f)=>[d,l[f]])):a.groups;let h={...l};return u&&Object.assign(h,u),h})(),...r?[o]:[]]:[!1,null]},$v=e=>J2(Yc().parser,e,zs()[0]),iG=({children:e,...t})=>{var h,d;const n=Yc(),r=t.hook?AN:n;let i=r;const[s,a]=((h=t.ssrPath)==null?void 0:h.split("?"))??[];a&&(t.ssrSearch=a,t.ssrPath=s),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs);let o=w.useRef({}),l=o.current,u=l;for(let f in r){const g=f==="base"?r[f]+(t[f]||""):t[f]||r[f];l===u&&g!==u[f]&&(o.current=u={...u}),u[f]=g,g!==r[f]&&(i=u)}return w.createElement(RN.Provider,{value:i,children:e})},T3=({children:e,component:t},n)=>t?w.createElement(t,{params:n}):typeof e=="function"?e(n):e,sG=e=>{let t=w.useRef(MN),n=t.current;for(const r in e)e[r]!==n[r]&&(n=e);return Object.keys(e).length===0&&(n=e),t.current=n},da=({path:e,nest:t,match:n,...r})=>{const i=Yc(),[s]=Iv(i),[a,o,l]=n??J2(i.parser,e,s,t),u=sG({...rG(),...o});if(!a)return null;const h=l?w.createElement(iG,{base:l},T3(r,u)):T3(r,u);return w.createElement(jN.Provider,{value:u,children:h})},Ti=w.forwardRef((e,t)=>{const n=Yc(),[r,i]=Iv(n),{to:s="",href:a=s,onClick:o,asChild:l,children:u,className:h,replace:d,state:f,...g}=e,b=kN(v=>{v.ctrlKey||v.metaKey||v.altKey||v.shiftKey||v.button!==0||(o==null||o(v),v.defaultPrevented||(v.preventDefault(),i(a,e)))}),x=n.hrefs(a[0]==="~"?a.slice(1):n.base+a,n);return l&&w.isValidElement(u)?w.cloneElement(u,{onClick:b,href:x}):w.createElement("a",{...g,onClick:b,href:x,className:h!=null&&h.call?h(r===a):h,children:u,ref:t})}),NN=e=>Array.isArray(e)?e.flatMap(t=>NN(t&&t.type===w.Fragment?t.props.children:t)):[e],DN=({children:e,location:t})=>{const n=Yc(),[r]=Iv(n);for(const i of NN(e)){let s=0;if(w.isValidElement(i)&&(s=J2(n.parser,i.props.path,t||r,i.props.nest))[0])return w.cloneElement(i,{match:s})}return null};function LN(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=LN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function PN(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=LN(e))&&(r&&(r+=" "),r+=t);return r}const Q2="-",oG=e=>{const t=lG(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const o=a.split(Q2);return o[0]===""&&o.length!==1&&o.shift(),ON(o,t)||aG(a)},getConflictingClassGroupIds:(a,o)=>{const l=n[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},ON=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?ON(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Q2);return(a=t.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},A3=/^\[(.+)\]$/,aG=e=>{if(A3.test(e)){const t=A3.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},lG=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return uG(Object.entries(e.classGroups),n).forEach(([s,a])=>{Vb(a,r,s,t)}),r},Vb=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:R3(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(cG(i)){Vb(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Vb(a,R3(t,s),n,r)})})},R3=(e,t)=>{let n=e;return t.split(Q2).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},cG=e=>e.isThemeGetter,uG=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[t+a,o])):s);return[n,i]}):e,dG=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},IN="!",hG=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,a=o=>{const l=[];let u=0,h=0,d;for(let v=0;v<o.length;v++){let m=o[v];if(u===0){if(m===i&&(r||o.slice(v,v+s)===t)){l.push(o.slice(h,v)),h=v+s;continue}if(m==="/"){d=v;continue}}m==="["?u++:m==="]"&&u--}const f=l.length===0?o:o.substring(h),g=f.startsWith(IN),b=g?f.substring(1):f,x=d&&d>h?d-h:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:x}};return n?o=>n({className:o,parseClassName:a}):a},fG=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},pG=e=>({cache:dG(e.cacheSize),parseClassName:hG(e),...oG(e)}),mG=/\s+/,gG=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],a=e.trim().split(mG);let o="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:h,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:g}=n(u);let b=!!g,x=r(b?f.substring(0,g):f);if(!x){if(!b){o=u+(o.length>0?" "+o:o);continue}if(x=r(f),!x){o=u+(o.length>0?" "+o:o);continue}b=!1}const v=fG(h).join(":"),m=d?v+IN:v,p=m+x;if(s.includes(p))continue;s.push(p);const y=i(x,b);for(let _=0;_<y.length;++_){const C=y[_];s.push(m+C)}o=u+(o.length>0?" "+o:o)}return o};function vG(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=$N(t))&&(r&&(r+=" "),r+=n);return r}const $N=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=$N(e[r]))&&(n&&(n+=" "),n+=t);return n};function xG(e,...t){let n,r,i,s=a;function a(l){const u=t.reduce((h,d)=>d(h),e());return n=pG(u),r=n.cache.get,i=n.cache.set,s=o,o(l)}function o(l){const u=r(l);if(u)return u;const h=gG(l,n);return i(l,h),h}return function(){return s(vG.apply(null,arguments))}}const Ft=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},BN=/^\[(?:([a-z-]+):)?(.+)\]$/i,yG=/^\d+\/\d+$/,bG=new Set(["px","full","screen"]),_G=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wG=/\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$/,SG=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,CG=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kG=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ds=e=>ic(e)||bG.has(e)||yG.test(e),Xs=e=>Xc(e,"length",DG),ic=e=>!!e&&!Number.isNaN(Number(e)),Mx=e=>Xc(e,"number",ic),Bu=e=>!!e&&Number.isInteger(Number(e)),EG=e=>e.endsWith("%")&&ic(e.slice(0,-1)),Ye=e=>BN.test(e),Js=e=>_G.test(e),TG=new Set(["length","size","percentage"]),AG=e=>Xc(e,TG,FN),RG=e=>Xc(e,"position",FN),MG=new Set(["image","url"]),jG=e=>Xc(e,MG,PG),NG=e=>Xc(e,"",LG),Fu=()=>!0,Xc=(e,t,n)=>{const r=BN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},DG=e=>wG.test(e)&&!SG.test(e),FN=()=>!1,LG=e=>CG.test(e),PG=e=>kG.test(e),OG=()=>{const e=Ft("colors"),t=Ft("spacing"),n=Ft("blur"),r=Ft("brightness"),i=Ft("borderColor"),s=Ft("borderRadius"),a=Ft("borderSpacing"),o=Ft("borderWidth"),l=Ft("contrast"),u=Ft("grayscale"),h=Ft("hueRotate"),d=Ft("invert"),f=Ft("gap"),g=Ft("gradientColorStops"),b=Ft("gradientColorStopPositions"),x=Ft("inset"),v=Ft("margin"),m=Ft("opacity"),p=Ft("padding"),y=Ft("saturate"),_=Ft("scale"),C=Ft("sepia"),S=Ft("skew"),E=Ft("space"),k=Ft("translate"),T=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Ye,t],D=()=>[Ye,t],L=()=>["",ds,Xs],N=()=>["auto",ic,Ye],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",Ye],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[ic,Ye];return{cacheSize:500,separator:":",theme:{colors:[Fu],spacing:[ds,Xs],blur:["none","",Js,Ye],brightness:I(),borderColor:[e],borderRadius:["none","","full",Js,Ye],borderSpacing:D(),borderWidth:L(),contrast:I(),grayscale:j(),hueRotate:I(),invert:j(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[EG,Xs],inset:M(),margin:M(),opacity:I(),padding:D(),saturate:I(),scale:I(),sepia:j(),skew:I(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[Js]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],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:[...O(),Ye]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Bu,Ye]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Bu,Ye]}],"grid-cols":[{"grid-cols":[Fu]}],"col-start-end":[{col:["auto",{span:["full",Bu,Ye]},Ye]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[Fu]}],"row-start-end":[{row:["auto",{span:[Bu,Ye]},Ye]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,t]}],"min-w":[{"min-w":[Ye,t,"min","max","fit"]}],"max-w":[{"max-w":[Ye,t,"none","full","min","max","fit","prose",{screen:[Js]},Js]}],h:[{h:[Ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Js,Xs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mx]}],"font-family":[{font:[Fu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",ic,Mx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ds,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ds,Xs]}],"underline-offset":[{"underline-offset":["auto",ds,Ye]}],"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",Ye]}],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",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),RG]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",AG]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jG]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:B()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[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:["",...B()]}],"outline-offset":[{"outline-offset":[ds,Ye]}],"outline-w":[{outline:[ds,Xs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[ds,Xs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Js,NG]}],"shadow-color":[{shadow:[Fu]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Js,Ye]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",Ye]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Bu,Ye]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],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",Ye]}],"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",Ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ds,Xs,Mx]}],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-s","border-color-e","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"]}}},IG=xG(OG),Qi=Object.create(null);Qi.open="0";Qi.close="1";Qi.ping="2";Qi.pong="3";Qi.message="4";Qi.upgrade="5";Qi.noop="6";const dm=Object.create(null);Object.keys(Qi).forEach(e=>{dm[Qi[e]]=e});const qb={type:"error",data:"parser error"},zN=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",HN=typeof ArrayBuffer=="function",WN=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Z2=({type:e,data:t},n,r)=>zN&&t instanceof Blob?n?r(t):M3(t,r):HN&&(t instanceof ArrayBuffer||WN(t))?n?r(t):M3(new Blob([t]),r):r(Qi[e]+(t||"")),M3=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function j3(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let jx;function $G(e,t){if(zN&&e.data instanceof Blob)return e.data.arrayBuffer().then(j3).then(t);if(HN&&(e.data instanceof ArrayBuffer||WN(e.data)))return t(j3(e.data));Z2(e,!1,n=>{jx||(jx=new TextEncoder),t(jx.encode(n))})}const N3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<N3.length;e++)pd[N3.charCodeAt(e)]=e;const BG=e=>{let t=e.length*.75,n=e.length,r,i=0,s,a,o,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),h=new Uint8Array(u);for(r=0;r<n;r+=4)s=pd[e.charCodeAt(r)],a=pd[e.charCodeAt(r+1)],o=pd[e.charCodeAt(r+2)],l=pd[e.charCodeAt(r+3)],h[i++]=s<<2|a>>4,h[i++]=(a&15)<<4|o>>2,h[i++]=(o&3)<<6|l&63;return u},FG=typeof ArrayBuffer=="function",eS=(e,t)=>{if(typeof e!="string")return{type:"message",data:UN(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:zG(e.substring(1),t)}:dm[n]?e.length>1?{type:dm[n],data:e.substring(1)}:{type:dm[n]}:qb},zG=(e,t)=>{if(FG){const n=BG(e);return UN(n,t)}else return{base64:!0,data:e}},UN=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},VN="",HG=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,a)=>{Z2(s,!1,o=>{r[a]=o,++i===n&&t(r.join(VN))})})},WG=(e,t)=>{const n=e.split(VN),r=[];for(let i=0;i<n.length;i++){const s=eS(n[i],t);if(r.push(s),s.type==="error")break}return r};function UG(){return new TransformStream({transform(e,t){$G(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 s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Nx;function up(e){return e.reduce((t,n)=>t+n.length,0)}function dp(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 VG(e,t){Nx||(Nx=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(a,o){for(n.push(a);;){if(r===0){if(up(n)<1)break;const l=dp(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(up(n)<2)break;const l=dp(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(up(n)<8)break;const l=dp(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),h=u.getUint32(0);if(h>Math.pow(2,21)-1){o.enqueue(qb);break}i=h*Math.pow(2,32)+u.getUint32(4),r=3}else{if(up(n)<i)break;const l=dp(n,i);o.enqueue(eS(s?l:Nx.decode(l),t)),r=0}if(i===0||i>e){o.enqueue(qb);break}}}})}const qN=4;function mn(e){if(e)return qG(e)}function qG(e){for(var t in mn.prototype)e[t]=mn.prototype[t];return e}mn.prototype.on=mn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};mn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};mn.prototype.off=mn.prototype.removeListener=mn.prototype.removeAllListeners=mn.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};mn.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};mn.prototype.emitReserved=mn.prototype.emit;mn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};mn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Bv=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Wr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),GG="arraybuffer";function GN(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const KG=Wr.setTimeout,YG=Wr.clearTimeout;function Fv(e,t){t.useNativeTimers?(e.setTimeoutFn=KG.bind(Wr),e.clearTimeoutFn=YG.bind(Wr)):(e.setTimeoutFn=Wr.setTimeout.bind(Wr),e.clearTimeoutFn=Wr.clearTimeout.bind(Wr))}const XG=1.33;function JG(e){return typeof e=="string"?QG(e):Math.ceil((e.byteLength||e.size)*XG)}function QG(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 KN(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function ZG(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function eK(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class tK extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class tS extends mn{constructor(t){super(),this.writable=!1,Fv(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new tK(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=eS(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=ZG(t);return n.length?"?"+n:""}}class nK extends tS{constructor(){super(...arguments),this._polling=!1}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)};WG(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,HG(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]=KN()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let YN=!1;try{YN=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const rK=YN;function iK(){}class sK extends nK{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}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 Ki extends mn{constructor(t,n,r){super(),this.createRequest=t,Fv(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=GN(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(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.getResponseHeader("set-cookie"))),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=Ki.requestsCount++,Ki.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=iK,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ki.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()}}Ki.requestsCount=0;Ki.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",D3);else if(typeof addEventListener=="function"){const e="onpagehide"in Wr?"pagehide":"unload";addEventListener(e,D3,!1)}}function D3(){for(let e in Ki.requests)Ki.requests.hasOwnProperty(e)&&Ki.requests[e].abort()}const oK=function(){const e=XN({xdomain:!1});return e&&e.responseType!==null}();class aK extends sK{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=oK&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ki(XN,this.uri(),t)}}function XN(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||rK))return new XMLHttpRequest}catch{}if(!t)try{return new Wr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const JN=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class lK extends tS{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=JN?{}:GN(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=this.createSocket(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;Z2(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Bv(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},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]=KN()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Dx=Wr.WebSocket||Wr.MozWebSocket;class cK extends lK{createSocket(t,n,r){return JN?new Dx(t,n,r):n?new Dx(t,n):new Dx(t)}doWrite(t,n){this.ws.send(n)}}class uK extends tS{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=VG(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=UG();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:o,value:l})=>{o||(this.onPacket(l),s())}).catch(o=>{})};s();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&&Bv(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const dK={websocket:cK,webtransport:uK,polling:aK},hK=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,fK=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Gb(e){if(e.length>8e3)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=hK.exec(e||""),s={},a=14;for(;a--;)s[fK[a]]=i[a]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=pK(s,s.path),s.queryKey=mK(s,s.query),s}function pK(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 mK(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Kb=typeof addEventListener=="function"&&typeof removeEventListener=="function",hm=[];Kb&&addEventListener("offline",()=>{hm.forEach(e=>e())},!1);class Ro extends mn{constructor(t,n){if(super(),this.binaryType=GG,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Gb(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Gb(n.host).host);Fv(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=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),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=eK(this.opts.query)),Kb&&(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"})},hm.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=qN,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 this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ro.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}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))}onOpen(){this.readyState="open",Ro.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();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._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),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+=JG(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Bv(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}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 s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),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){if(Ro.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Kb&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=hm.indexOf(this._offlineEventListener);r!==-1&&hm.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ro.protocol=qN;class gK extends Ro{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ro.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ro.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,h(),n.close(),n=null)}const a=d=>{const f=new Error("probe error: "+d);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function o(){a("transport closed")}function l(){a("socket closed")}function u(d){n&&d.name!==n.name&&s()}const h=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",o),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",o),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let vK=class extends gK{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>dK[i]).filter(i=>!!i)),super(t,r)}};function xK(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=Gb(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 s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const yK=typeof ArrayBuffer=="function",bK=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,QN=Object.prototype.toString,_K=typeof Blob=="function"||typeof Blob<"u"&&QN.call(Blob)==="[object BlobConstructor]",wK=typeof File=="function"||typeof File<"u"&&QN.call(File)==="[object FileConstructor]";function nS(e){return yK&&(e instanceof ArrayBuffer||bK(e))||_K&&e instanceof Blob||wK&&e instanceof File}function fm(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(fm(e[n]))return!0;return!1}if(nS(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return fm(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&fm(e[n]))return!0;return!1}function SK(e){const t=[],n=e.data,r=e;return r.data=Yb(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Yb(e,t){if(!e)return e;if(nS(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]=Yb(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]=Yb(e[r],t));return n}return e}function CK(e,t){return e.data=Xb(e.data,t),delete e.attachments,e}function Xb(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]=Xb(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Xb(e[n],t));return e}const kK=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],EK=5;var it;(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"})(it||(it={}));class TK{constructor(t){this.replacer=t}encode(t){return(t.type===it.EVENT||t.type===it.ACK)&&fm(t)?this.encodeAsBinary({type:t.type===it.EVENT?it.BINARY_EVENT:it.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===it.BINARY_EVENT||t.type===it.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=SK(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function L3(e){return Object.prototype.toString.call(e)==="[object Object]"}class rS extends mn{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===it.BINARY_EVENT;r||n.type===it.BINARY_ACK?(n.type=r?it.EVENT:it.ACK,this.reconstructor=new AK(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(nS(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(it[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===it.BINARY_EVENT||r.type===it.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(s,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=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(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(rS.isPayloadValid(r.type,s))r.data=s;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 it.CONNECT:return L3(n);case it.DISCONNECT:return n===void 0;case it.CONNECT_ERROR:return typeof n=="string"||L3(n);case it.EVENT:case it.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&kK.indexOf(n[0])===-1);case it.ACK:case it.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class AK{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=CK(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const RK=Object.freeze(Object.defineProperty({__proto__:null,Decoder:rS,Encoder:TK,get PacketType(){return it},protocol:EK},Symbol.toStringTag,{value:"Module"}));function fi(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const MK=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ZN extends mn{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=[fi(t,"open",this.onopen.bind(this)),fi(t,"packet",this.onpacket.bind(this)),fi(t,"error",this.onerror.bind(this)),fi(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){var r,i,s;if(MK.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 a={type:it.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const h=this.ids++,d=n.pop();this._registerAckCallback(h,d),a.id=h}const o=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!o||(l?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),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 s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},i),a=(...o)=>{this.io.clearTimeoutFn(s),n.apply(this,o)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(a,o)=>a?i(a):r(o);s.withError=!0,n.push(s),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,...s)=>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,...s)),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:it.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),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case it.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 it.EVENT:case it.BINARY_EVENT:this.onevent(t);break;case it.ACK:case it.BINARY_ACK:this.onack(t);break;case it.DISCONNECT:this.ondisconnect();break;case it.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:it.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}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:it.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 Jc(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}Jc.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};Jc.prototype.reset=function(){this.attempts=0};Jc.prototype.setMin=function(e){this.ms=e};Jc.prototype.setMax=function(e){this.max=e};Jc.prototype.setJitter=function(e){this.jitter=e};class Jb extends mn{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,Fv(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 Jc({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||RK;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,t||(this.skipReconnect=!0),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 vK(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=fi(n,"open",function(){r.onopen(),t&&t()}),s=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),t?t(o):this.maybeReconnectOnOpen()},a=fi(n,"error",s);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},o);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(fi(t,"ping",this.onping.bind(this)),fi(t,"data",this.ondata.bind(this)),fi(t,"error",this.onerror.bind(this)),fi(t,"close",this.onclose.bind(this)),fi(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){Bv(()=>{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 ZN(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")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),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 zu={};function Pd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=xK(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,a=zu[i]&&s in zu[i].nsps,o=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return o?l=new Jb(r,t):(zu[i]||(zu[i]=new Jb(r,t)),l=zu[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Pd,{Manager:Jb,Socket:ZN,io:Pd,connect:Pd});function Y(...e){return IG(PN(e))}const jK=e=>{const t=/^[ \t]*(?=\S)/gm,n=e.substring(e.indexOf(`
`)).match(t);if(!n)return e;const r=n.reduce((s,a)=>Math.min(s,a.length),1/0),i=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(i,"")},Wn=(e,t=0)=>e.toLocaleString(window.txBrowserLocale,{maximumFractionDigits:t}),iS=e=>{const t={transports:["polling"],upgrade:!1,query:{rooms:e,uiVersion:window.txConsts.txaVersion}};return window.txConsts.isWebInterface?Pd({...t,path:"/socket.io"}):Pd("monitor",{...t,path:"/WebPipe/socket.io"})},eD=async(e,t,n=null)=>{const r=()=>navigator.clipboard.writeText(e),i=()=>{const s=document.createElement("textarea");s.id="clipboard-input-"+Math.random().toString(36).substring(2,15),s.value=e,s.style.position="fixed",s.style.opacity="0",s.style.top="0",s.style.left="0",t.appendChild(s),s.select();const a=document.execCommand("copy");return document.addEventListener("copy",()=>{setTimeout(()=>{try{t.removeChild(s),console.log("Removed clipboard temporary target:",s.id)}catch{console.log("Failed to remove clipboard temporary target:",s.id)}finally{n&&n.focus()}},0)},{once:!0,signal:AbortSignal.timeout(250)}),a};if(window.txConsts.isWebInterface&&navigator.clipboard)try{return await r()}catch{return i()}else return console.warn("Clipboard API not available, copying via textarea."),i()},rg=e=>{if(e==="permanent")return"permanent";if(typeof e=="string")return e;const t=e.value===1?e.unit.slice(0,-1):e.unit;return`${e.value} ${t}`},NK=e=>{if(typeof e=="string")return e==="permanent"?"PERM":e;let t;return e.unit==="hours"?t="h":e.unit==="days"?t="d":e.unit==="weeks"?t="w":e.unit==="months"?t="mo":t=e.unit,`${e.value}${t}`},DK=(e,t,n="txt")=>{try{if(typeof document>"u"||!document.body)return console.warn("downloadTextFile: document or document.body not available"),!1;const r=n==="txt"?"text/plain":n==="json"?"application/json":"text/markdown",i=new Blob([e],{type:r}),s=URL.createObjectURL(i),a=document.createElement("a");return a.href=s,a.download=`${t}.${n}`,a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s),!0}catch(r){return console.error("downloadTextFile failed:",r),!1}},bs=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Y("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));bs.displayName="Card";const _s=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Y("flex flex-col space-y-1.5 p-6",e),...t}));_s.displayName="CardHeader";const po=w.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:Y("text-2xl font-semibold leading-none tracking-tight",e),...t}));po.displayName="CardTitle";const tD=w.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));tD.displayName="CardDescription";const yi=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Y("p-6 pt-0",e),...t}));yi.displayName="CardContent";const rf=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Y("flex items-center p-6 pt-0",e),...t}));rf.displayName="CardFooter";var nD={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},P3=ot.createContext&&ot.createContext(nD),LK=["attr","size","title"];function PK(e,t){if(e==null)return{};var n=OK(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function OK(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ig(){return ig=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},ig.apply(this,arguments)}function O3(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 sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O3(Object(n),!0).forEach(function(r){IK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IK(e,t,n){return t=$K(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $K(e){var t=BK(e,"string");return typeof t=="symbol"?t:t+""}function BK(e,t){if(typeof e!="object"||!e)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 rD(e){return e&&e.map((t,n)=>ot.createElement(t.tag,sg({key:n},t.attr),rD(t.child)))}function iD(e){return t=>ot.createElement(FK,ig({attr:sg({},e.attr)},t),rD(e.child))}function FK(e){var t=n=>{var{attr:r,size:i,title:s}=e,a=PK(e,LK),o=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),ot.createElement("svg",ig({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:sg(sg({color:e.color||n.color},n.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&ot.createElement("title",null,s),e.children)};return P3!==void 0?ot.createElement(P3.Consumer,null,n=>t(n)):t(nD)}function zK(e){return iD({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 I3(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qc(...e){return t=>{let n=!1;const r=e.map(i=>{const s=I3(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():I3(e[i],null)}}}}function Le(...e){return w.useCallback(Qc(...e),e)}var Po=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),s=i.find(HK);if(s){const a=s.props.children,o=i.map(l=>l===s?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return c.jsx(Qb,{...r,ref:t,children:w.isValidElement(a)?w.cloneElement(a,void 0,o):null})}return c.jsx(Qb,{...r,ref:t,children:n})});Po.displayName="Slot";var Qb=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const i=UK(n);return w.cloneElement(n,{...WK(r,n.props),ref:t?Qc(t,i):i})}return w.Children.count(n)>1?w.Children.only(null):null});Qb.displayName="SlotClone";var sS=({children:e})=>c.jsx(c.Fragment,{children:e});function HK(e){return w.isValidElement(e)&&e.type===sS}function WK(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{s(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function UK(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const $3=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,B3=PN,si=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return B3(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(u=>{const h=n==null?void 0:n[u],d=s==null?void 0:s[u];if(h===null)return null;const f=$3(h)||$3(d);return i[u][f]}),o=n&&Object.entries(n).reduce((u,h)=>{let[d,f]=h;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,h)=>{let{class:d,className:f,...g}=h;return Object.entries(g).every(b=>{let[x,v]=b;return Array.isArray(v)?v.includes({...s,...o}[x]):{...s,...o}[x]===v})?[...u,d,f]:u},[]);return B3(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},sf=si("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",muted:"bg-muted text-muted-foreground hover:bg-secondary hover:text-seconbg-secondary-foreground",link:"text-accent underline-offset-4 hover:underline",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",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/75",ghost:"hover:bg-primary hover:text-primary-foreground","ghost-destructive":"text-destructive hover:bg-destructive hover:text-destructive-foreground","ghost-warning":"text-warning hover:bg-warning hover:text-warning-foreground","ghost-success":"text-success hover:bg-success hover:text-success-foreground","ghost-info":"text-info hover:bg-info hover:text-info-foreground","ghost-secondary":"text-secondary hover:bg-secondary hover:text-secondary-foreground","ghost-muted":"text-muted-foreground hover:bg-muted hover:text-muted-foreground",outline:"border border-foreground hover:bg-primary hover:text-primary-foreground","outline-destructive":"border border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground","outline-warning":"border border-warning text-warning hover:bg-warning hover:text-warning-foreground","outline-success":"border border-success text-success hover:bg-success hover:text-success-foreground","outline-info":"border border-info text-info hover:bg-info hover:text-info-foreground","outline-secondary":"border border-secondary text-secondary hover:bg-secondary hover:text-secondary-foreground","outline-muted":"border border-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground"},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"}}),Re=w.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?Po:"button";return c.jsx(a,{className:Y(sf({variant:t,size:n,className:e})),ref:s,...i})});Re.displayName="Button";var VK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ce=VK.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?Po:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(o,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function og(e,t){e&&mr.flushSync(()=>e.dispatchEvent(t))}var Xt=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function qK(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var on=e=>{const{present:t,children:n}=e,r=GK(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=Le(r.ref,KK(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:s}):null};on.displayName="Presence";function GK(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),s=w.useRef("none"),a=e?"mounted":"unmounted",[o,l]=qK(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=hp(r.current);s.current=o==="mounted"?u:"none"},[o]),Xt(()=>{const u=r.current,h=i.current;if(h!==e){const f=s.current,g=hp(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Xt(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,d=g=>{const x=hp(r.current).includes(g.animationName);if(g.target===t&&x&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=g=>{g.target===t&&(s.current=hp(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function hp(e){return(e==null?void 0:e.animationName)||"none"}function KK(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function YK(e,t){const n=w.createContext(t),r=s=>{const{children:a,...o}=s,l=w.useMemo(()=>o,Object.values(o));return c.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(s){const a=w.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function Cn(e,t=[]){let n=[];function r(s,a){const o=w.createContext(a),l=n.length;n=[...n,a];const u=d=>{var m;const{scope:f,children:g,...b}=d,x=((m=f==null?void 0:f[e])==null?void 0:m[l])||o,v=w.useMemo(()=>b,Object.values(b));return c.jsx(x.Provider,{value:v,children:g})};u.displayName=s+"Provider";function h(d,f){var x;const g=((x=f==null?void 0:f[e])==null?void 0:x[l])||o,b=w.useContext(g);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,h]}const i=()=>{const s=n.map(a=>w.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,XK(i,...t)]}function XK(...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(s){const a=r.reduce((o,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...o,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function xt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var JK=w.createContext(void 0);function Ja(e){const t=w.useContext(JK);return e||t||"ltr"}function Zb(e,[t,n]){return Math.min(n,Math.max(t,e))}function ae(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 QK(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var oS="ScrollArea",[sD,UIe]=Cn(oS),[ZK,oi]=sD(oS),oD=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...a}=e,[o,l]=w.useState(null),[u,h]=w.useState(null),[d,f]=w.useState(null),[g,b]=w.useState(null),[x,v]=w.useState(null),[m,p]=w.useState(0),[y,_]=w.useState(0),[C,S]=w.useState(!1),[E,k]=w.useState(!1),T=Le(t,M=>l(M)),A=Ja(i);return c.jsx(ZK,{scope:n,type:r,dir:A,scrollHideDelay:s,scrollArea:o,viewport:u,onViewportChange:h,content:d,onContentChange:f,scrollbarX:g,onScrollbarXChange:b,scrollbarXEnabled:C,onScrollbarXEnabledChange:S,scrollbarY:x,onScrollbarYChange:v,scrollbarYEnabled:E,onScrollbarYEnabledChange:k,onCornerWidthChange:p,onCornerHeightChange:_,children:c.jsx(Ce.div,{dir:A,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":m+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});oD.displayName=oS;var aD="ScrollAreaViewport",lD=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...s}=e,a=oi(aD,n),o=w.useRef(null),l=Le(t,o,a.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),c.jsx(Ce.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});lD.displayName=aD;var is="ScrollAreaScrollbar",aS=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=oi(is,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return w.useEffect(()=>(o?s(!0):a(!0),()=>{o?s(!1):a(!1)}),[o,s,a]),i.type==="hover"?c.jsx(eY,{...r,ref:t,forceMount:n}):i.type==="scroll"?c.jsx(tY,{...r,ref:t,forceMount:n}):i.type==="auto"?c.jsx(cD,{...r,ref:t,forceMount:n}):i.type==="always"?c.jsx(lS,{...r,ref:t}):null});aS.displayName=is;var eY=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=oi(is,e.__scopeScrollArea),[s,a]=w.useState(!1);return w.useEffect(()=>{const o=i.scrollArea;let l=0;if(o){const u=()=>{window.clearTimeout(l),a(!0)},h=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",h),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),c.jsx(on,{present:n||s,children:c.jsx(cD,{"data-state":s?"visible":"hidden",...r,ref:t})})}),tY=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=oi(is,e.__scopeScrollArea),s=e.orientation==="horizontal",a=Hv(()=>l("SCROLL_END"),100),[o,l]=QK("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 w.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,i.scrollHideDelay,l]),w.useEffect(()=>{const u=i.viewport,h=s?"scrollLeft":"scrollTop";if(u){let d=u[h];const f=()=>{const g=u[h];d!==g&&(l("SCROLL"),a()),d=g};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[i.viewport,s,l,a]),c.jsx(on,{present:n||o!=="hidden",children:c.jsx(lS,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ae(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ae(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),cD=w.forwardRef((e,t)=>{const n=oi(is,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,a]=w.useState(!1),o=e.orientation==="horizontal",l=Hv(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;a(o?u:h)}},10);return Tc(n.viewport,l),Tc(n.content,l),c.jsx(on,{present:r||s,children:c.jsx(lS,{"data-state":s?"visible":"hidden",...i,ref:t})})}),lS=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=oi(is,e.__scopeScrollArea),s=w.useRef(null),a=w.useRef(0),[o,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=pD(o.viewport,o.content),h={...r,sizes:o,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function d(f,g){return aY(f,a.current,o,g)}return n==="horizontal"?c.jsx(nY,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollLeft,g=F3(f,o,i.dir);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollLeft=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollLeft=d(f,i.dir))}}):n==="vertical"?c.jsx(rY,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollTop,g=F3(f,o);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollTop=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollTop=d(f))}}):null}),nY=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=oi(is,e.__scopeScrollArea),[a,o]=w.useState(),l=w.useRef(null),u=Le(t,l,s.onScrollbarXChange);return w.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),c.jsx(dD,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":zv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,d)=>{if(s.viewport){const f=s.viewport.scrollLeft+h.deltaX;e.onWheelScroll(f),gD(f,d)&&h.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:lg(a.paddingLeft),paddingEnd:lg(a.paddingRight)}})}})}),rY=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=oi(is,e.__scopeScrollArea),[a,o]=w.useState(),l=w.useRef(null),u=Le(t,l,s.onScrollbarYChange);return w.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),c.jsx(dD,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":zv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,d)=>{if(s.viewport){const f=s.viewport.scrollTop+h.deltaY;e.onWheelScroll(f),gD(f,d)&&h.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:lg(a.paddingTop),paddingEnd:lg(a.paddingBottom)}})}})}),[iY,uD]=sD(is),dD=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:h,onResize:d,...f}=e,g=oi(is,n),[b,x]=w.useState(null),v=Le(t,T=>x(T)),m=w.useRef(null),p=w.useRef(""),y=g.viewport,_=r.content-r.viewport,C=xt(h),S=xt(l),E=Hv(d,10);function k(T){if(m.current){const A=T.clientX-m.current.left,M=T.clientY-m.current.top;u({x:A,y:M})}}return w.useEffect(()=>{const T=A=>{const M=A.target;(b==null?void 0:b.contains(M))&&C(A,_)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[y,b,_,C]),w.useEffect(S,[r,S]),Tc(b,E),Tc(g.content,E),c.jsx(iY,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:xt(s),onThumbPointerUp:xt(a),onThumbPositionChange:S,onThumbPointerDown:xt(o),children:c.jsx(Ce.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:ae(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),m.current=b.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),k(T))}),onPointerMove:ae(e.onPointerMove,k),onPointerUp:ae(e.onPointerUp,T=>{const A=T.target;A.hasPointerCapture(T.pointerId)&&A.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=p.current,g.viewport&&(g.viewport.style.scrollBehavior=""),m.current=null})})})}),ag="ScrollAreaThumb",hD=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=uD(ag,e.__scopeScrollArea);return c.jsx(on,{present:n||i.hasThumb,children:c.jsx(sY,{ref:t,...r})})}),sY=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=oi(ag,n),a=uD(ag,n),{onThumbPositionChange:o}=a,l=Le(t,d=>a.onThumbChange(d)),u=w.useRef(void 0),h=Hv(()=>{u.current&&(u.current(),u.current=void 0)},100);return w.useEffect(()=>{const d=s.viewport;if(d){const f=()=>{if(h(),!u.current){const g=lY(d,o);u.current=g,o()}};return o(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[s.viewport,h,o]),c.jsx(Ce.div,{"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:ae(e.onPointerDownCapture,d=>{const g=d.target.getBoundingClientRect(),b=d.clientX-g.left,x=d.clientY-g.top;a.onThumbPointerDown({x:b,y:x})}),onPointerUp:ae(e.onPointerUp,a.onThumbPointerUp)})});hD.displayName=ag;var cS="ScrollAreaCorner",fD=w.forwardRef((e,t)=>{const n=oi(cS,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(oY,{...e,ref:t}):null});fD.displayName=cS;var oY=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=oi(cS,n),[s,a]=w.useState(0),[o,l]=w.useState(0),u=!!(s&&o);return Tc(i.scrollbarX,()=>{var d;const h=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(h),l(h)}),Tc(i.scrollbarY,()=>{var d;const h=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(h),a(h)}),u?c.jsx(Ce.div,{...r,ref:t,style:{width:s,height:o,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function lg(e){return e?parseInt(e,10):0}function pD(e,t){const n=e/t;return isNaN(n)?0:n}function zv(e){const t=pD(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function aY(e,t,n,r="ltr"){const i=zv(n),s=i/2,a=t||s,o=i-a,l=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-o,h=n.content-n.viewport,d=r==="ltr"?[0,h]:[h*-1,0];return mD([l,u],d)(e)}function F3(e,t,n="ltr"){const r=zv(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,a=t.content-t.viewport,o=s-r,l=n==="ltr"?[0,a]:[a*-1,0],u=Zb(e,l);return mD([0,a],[0,o])(u)}function mD(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 gD(e,t){return e>0&&e<t}var lY=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},a=n.left!==s.left,o=n.top!==s.top;(a||o)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Hv(e,t){const n=xt(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Tc(e,t){const n=xt(t);Xt(()=>{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])}var vD=oD,cY=lD,uY=fD;const ii=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(vD,{ref:r,className:Y("relative overflow-hidden",e),...n,children:[c.jsx(cY,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(xD,{}),c.jsx(uY,{})]}));ii.displayName=vD.displayName;const xD=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>c.jsx(aS,{ref:r,orientation:t,className:Y("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:c.jsx(hD,{className:"relative flex-1 rounded-full bg-border"})}));xD.displayName=aS.displayName;var _r=(e=>(e.NewFeatureSeenTs="txa:newFeat:seenTs:",e.ErrorFallbackLastReload="txa:errorFallback:lastReload",e.UpdateWarningPostponedTs="txa:updateWarning:postponedTs",e.PlayersPageSearchType="txa:playersPage:searchType",e.AuthCredsAutofill="txa:authCreds:autofill",e.LiveConsoleBookmarks="txa:liveConsole:bookmarks",e.LiveConsoleHistory="txa:liveConsole:history",e.LiveConsoleOptions="txa:liveConsole:options",e))(_r||{});const uS=(e,t)=>({getItem:n=>{const r=localStorage.getItem(n);if(!r)return t;try{const i=JSON.parse(r);return e(i)}catch{return t}},setItem:(n,r)=>{const i=e(r);localStorage.setItem(n,JSON.stringify(i))},removeItem:n=>{localStorage.removeItem(n)}}),yD=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[];function dY({error:e}){const t=()=>{window.location.reload()};return c.jsx("div",{className:"w-screen h-screen flex flex-col items-center justify-center",children:c.jsx(bD,{title:"App Error:",description:"Due to an unexpected error, the panel has crashed.",error:e,resetButton:c.jsx(Re,{variant:"outline",onClick:t,children:"Refresh"})})})}function hY({error:e,resetErrorBoundary:t}){return c.jsx("div",{className:"w-full flex flex-col items-center justify-center",children:c.jsx(bD,{title:"Page Error:",description:"There was an error rendering this page.",error:e,resetButton:c.jsx(Re,{variant:"outline",onClick:t,children:"Go Back"})})})}function bD(e){return window.txConsts.showAdvanced&&w.useEffect(()=>{var t;if((t=e.error.message)!=null&&t.includes("Failed to execute 'removeChild' on 'Node'")){console.warn("Detected removeChild error, scheduling reload");const n=localStorage.getItem(_r.ErrorFallbackLastReload),r=Date.now(),i=n?parseInt(n):0;r-i>3e4&&(localStorage.setItem(_r.ErrorFallbackLastReload,r.toString()),setTimeout(()=>window.location.reload(),500))}},[e.error]),c.jsxs(bs,{className:"max-w-xl",children:[c.jsxs(_s,{children:[c.jsxs("h1",{className:"text-3xl text-red-500 pb-0 flex flex-row justify-start items-center",children:[c.jsx(zK,{className:"inline-block mr-2"}),e.title]}),c.jsx("span",{className:"text-sm text-muted-foreground pt-0",children:e.description})]}),c.jsxs(yi,{children:[c.jsxs("p",{className:"truncate",children:["Page: ",c.jsxs("code",{className:"text-muted-foreground ",children:[window.location.pathname??"unknown",window.location.search??""]})]}),c.jsxs("p",{children:["Versions: ",c.jsxs("code",{className:"text-muted-foreground",children:["txAdmin v",window.txConsts.txaVersion," atop FXServer b",window.txConsts.fxsVersion]})]}),c.jsxs("p",{children:["Message: ",c.jsx("code",{className:"text-muted-foreground",children:e.error.message??"unknown"})]}),c.jsx("p",{children:"Stack:"}),c.jsx("pre",{className:"mt-1",children:c.jsx(ii,{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})})]}),c.jsxs(rf,{className:"flex flex-row justify-between",children:[e.resetButton,c.jsx(Re,{asChild:!0,variant:"outline",className:"bg-discord hover:bg-discord-active animate-pulse hover:animate-none",children:c.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"Support Discord"})})]})]})}let fY=0;function Ze(e,t){const n=`atom${++fY}`,r={toString(){return n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=pY,r.write=mY),t&&(r.write=t),r}function pY(e){return e(this)}function mY(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const z3=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,H3=e=>"init"in e,W3=e=>!!e.write,cg=new WeakMap,e_=e=>{var t;return t_(e)&&!((t=cg.get(e))!=null&&t[1])},gY=(e,t)=>{const n=cg.get(e);n&&(n[1]=!0,n[0].forEach(r=>r(t)))},vY=e=>{if(cg.has(e))return;const t=[new Set,!1];cg.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=r=>{t[0].add(r)}},t_=e=>typeof(e==null?void 0:e.then)=="function",U3=e=>"v"in e||"e"in e,fp=e=>{if("e"in e)throw e.e;return e.v},_D=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},V3=(e,t,n,r,i)=>{var s;n.d.set(r,i.n),e_(n.v)&&_D(t,n.v,i),(s=i.m)==null||s.t.add(t),e&&xY(e,r,t)},Hu=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),Od=(e,t,n)=>{e[t].add(n)},q3=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),Od(e,"M",()=>{var r;(r=n.m)==null||r.l.forEach(i=>Od(e,"M",i))}))},xY=(e,t,n)=>{const r=e.D.get(t);r&&r.add(n)},yY=(e,t)=>e.D.get(t),ra=e=>{let t,n=!1;const r=i=>{try{i()}catch(s){n||(t=s,n=!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(r),e.H.clear(),e.M.forEach(r),e.M.clear(),e.L.forEach(r),e.L.clear();if(n)throw t},wD=(...[e,t,n,r])=>{const i=(m,p,y)=>{const _="v"in p,C=p.v,S=e_(p.v)?p.v:null;if(t_(y)){vY(y);for(const E of p.d.keys())_D(m,y,e(E));p.v=y}else p.v=y;delete p.e,delete p.x,(!_||!Object.is(C,p.v))&&(++p.n,S&&gY(S,y))},s=(m,p)=>{var y;const _=e(p);if(U3(_)&&(_.m&&!_.x||Array.from(_.d).every(([A,M])=>s(m,A).n===M)))return _;_.d.clear();let C=!0;const S=A=>{if(z3(p,A)){const D=e(A);if(!U3(D))if(H3(A))i(A,D,A.init);else throw new Error("no atom init");return fp(D)}const M=s(m,A);try{return fp(M)}finally{if(C)V3(m,p,_,A,M);else{const D=Hu();V3(D,p,_,A,M),d(D,p,_),ra(D)}}};let E,k;const T={get signal(){return E||(E=new AbortController),E.signal},get setSelf(){return!k&&W3(p)&&(k=(...A)=>{if(!C)return h(p,...A)}),k}};try{const A=t(p,S,T);if(i(p,_,A),t_(A)){(y=A.onCancel)==null||y.call(A,()=>E==null?void 0:E.abort());const M=()=>{if(_.m){const D=Hu();d(D,p,_),ra(D)}};A.then(M,M)}return _}catch(A){return delete _.v,_.e=A,delete _.x,++_.n,_}finally{C=!1}},a=m=>fp(s(void 0,m)),o=(m,p,y)=>{var _,C;const S=new Map;for(const E of((_=y.m)==null?void 0:_.t)||[]){const k=e(E);k.m&&S.set(E,k)}for(const E of y.p)S.set(E,e(E));return(C=yY(m,p))==null||C.forEach(E=>{S.set(E,e(E))}),S},l=(m,p,y)=>{const _=[],C=new Set,S=new Set,E=[[p,y]];for(;E.length>0;){const[k,T]=E[E.length-1];if(S.has(k)){E.pop();continue}if(C.has(k)){_.push([k,T,T.n]),S.add(k),T.x=!0,E.pop();continue}C.add(k);for(const[A,M]of o(m,k,T))k!==A&&!C.has(A)&&E.push([A,M])}Od(m,"H",()=>{const k=new Set([p]);for(let T=_.length-1;T>=0;--T){const[A,M,D]=_[T];let L=!1;for(const N of M.d.keys())if(N!==A&&k.has(N)){L=!0;break}L&&(s(m,A),d(m,A,M),D!==M.n&&(q3(m,A,M),k.add(A))),delete M.x}})},u=(m,p,...y)=>{let _=!0;const C=E=>fp(s(m,E)),S=(E,...k)=>{const T=e(E);try{if(z3(p,E)){if(!H3(E))throw new Error("atom not writable");const A=T.n,M=k[0];i(E,T,M),d(m,E,T),A!==T.n&&(q3(m,E,T),l(m,E,T));return}else return u(m,E,...k)}finally{_||ra(m)}};try{return n(p,C,S,...y)}finally{_=!1}},h=(m,...p)=>{const y=Hu();try{return u(y,m,...p)}finally{ra(y)}},d=(m,p,y)=>{if(y.m&&!e_(y.v)){for(const _ of y.d.keys())y.m.d.has(_)||(f(m,_,e(_)).t.add(p),y.m.d.add(_));for(const _ of y.m.d||[])if(!y.d.has(_)){y.m.d.delete(_);const C=g(m,_,e(_));C==null||C.t.delete(p)}}},f=(m,p,y)=>{if(!y.m){s(m,p);for(const _ of y.d.keys())f(m,_,e(_)).t.add(p);if(y.m={l:new Set,d:new Set(y.d.keys()),t:new Set},W3(p)){const _=y.m;let C;const S=(E,k)=>{let T=!0;C=(...A)=>{try{return u(E,p,...A)}finally{T||ra(E)}};try{return k()}finally{T=!1}};Od(m,"L",()=>{const E=S(m,()=>r(p,(...k)=>C(...k)));E&&(_.u=k=>S(k,E))})}}return y.m},g=(m,p,y)=>{if(y.m&&!y.m.l.size&&!Array.from(y.m.t).some(_=>{var C;return(C=e(_).m)==null?void 0:C.d.has(p)})){const _=y.m.u;_&&Od(m,"L",()=>_(m)),delete y.m;for(const C of y.d.keys()){const S=g(m,C,e(C));S==null||S.t.delete(p)}return}return y.m};return{get:a,set:h,sub:(m,p)=>{const y=Hu(),_=e(m),S=f(y,m,_).l;return S.add(p),ra(y),()=>{S.delete(p);const E=Hu();g(E,m,_),ra(E)}},unstable_derive:m=>wD(...m(e,t,n,r))}},bY=()=>{const e=new WeakMap;return wD(r=>{let i=e.get(r);return i||(i={d:new Map,p:new Set,n:0},e.set(r,i)),i},(r,...i)=>r.read(...i),(r,...i)=>r.write(...i),(r,...i)=>{var s;return(s=r.onMount)==null?void 0:s.call(r,...i)})};let Lx;const _Y=()=>(Lx||(Lx=bY()),Lx),wY=w.createContext(void 0),SD=e=>w.useContext(wY)||_Y(),CD=e=>typeof(e==null?void 0:e.then)=="function",SY=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},CY=ot.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(SY(e),e)}),Px=new WeakMap,kY=e=>{let t=Px.get(e);return t||(t=new Promise((n,r)=>{let i=e;const s=l=>u=>{i===l&&n(u)},a=l=>u=>{i===l&&r(u)},o=l=>{"onCancel"in l&&typeof l.onCancel=="function"&&l.onCancel(u=>{CD(u)?(Px.set(u,t),i=u,u.then(s(u),a(u)),o(u)):n(u)})};e.then(s(e),a(e)),o(e)}),Px.set(e,t)),t};function nt(e,t){const n=SD(),[[r,i,s],a]=w.useReducer(u=>{const h=n.get(e);return Object.is(u[0],h)&&u[1]===n&&u[2]===e?u:[h,n,e]},void 0,()=>[n.get(e),n,e]);let o=r;if((i!==n||s!==e)&&(a(),o=n.get(e)),w.useEffect(()=>{const u=n.sub(e,()=>{a()});return a(),u},[n,e,void 0]),w.useDebugValue(o),CD(o)){const u=kY(o);return CY(u)}return o}function rt(e,t){const n=SD();return w.useCallback((...i)=>n.set(e,...i),[n,e])}function sr(e,t){return[nt(e),rt(e)]}function kD(e){const t=Ze(0),n=Ze(()=>({i:0}),(l,u)=>{const h=l(n);return Object.assign(h,{m:!0,peek:l,set:u}),u(t,d=>d+1),()=>{h.m=!1,a(h),o(h)}});n.onMount=l=>l();const r=Ze(l=>{l(t);const u=l(n);if(!u.m||u.irc||u.i&&!u.irf)return u.p;o(u);const h=new Map,d=x=>{const v=l(x);return h.set(x,v),v};d.peek=u.peek;const f=(...x)=>{try{return++u.i,u.set(...x)}finally{Array.from(h.keys(),l),--u.i}};function g([x,v]){return l(x)!==v}function b(){try{if(u.irf=!1,!u.m)return;a(u),u.c=i.effect(d,f)}catch(x){u.e=x,s(u)}finally{u.p=void 0,--u.i}}return f.recurse=(x,...v)=>{if(!u.fc)try{return u.irc=!0,u.set(x,...v)}finally{u.irc=!1,Array.from(h).some(g)&&s(u)}},++u.i,u.irf?b():u.p=Promise.resolve().then(b)}),i=Ze(l=>{l(r)});return i.effect=e,i;function s(l){try{l.irf=!0,l.set(t,u=>u+1)}finally{l.irf=!1}}function a(l){if(l.c)try{l.fc=!0,l.c()}finally{l.fc=!1,l.c=void 0}}function o(l){if("e"in l){const u=l.e;throw delete l.e,u}}}const ED=""+new URL("favicon_default.svg",import.meta.url).href,EY=""+new URL("favicon_online.svg",import.meta.url).href,TY=""+new URL("favicon_partial.svg",import.meta.url).href,AY=""+new URL("favicon_offline.svg",import.meta.url).href;var As=(e=>(e.Unkown="unknown",e.Setup="setup",e.Deployer="deployer",e.Ready="ready",e))(As||{}),sc=(e=>(e.OFFLINE="OFFLINE",e.ONLINE="ONLINE",e.PARTIAL="PARTIAL",e))(sc||{}),md=(e=>(e[e.Disabled=0]="Disabled",e[e.Starting=1]="Starting",e[e.Ready=2]="Ready",e[e.Error=3]="Error",e))(md||{});const Qa=Ze(null),TD=Ze(e=>{var t;return((t=e(Qa))==null?void 0:t.server.name)??"unconfigured"}),dS=Ze(e=>{var t;return((t=e(Qa))==null?void 0:t.configState)??As.Unkown}),AD=Ze(e=>{var t;return((t=e(Qa))==null?void 0:t.runner)??{isIdle:!0,isChildAlive:!1}}),RY=()=>rt(Qa),RD=()=>nt(Qa);function Un(e,t,n){var r=n||{},i=r.noTrailing,s=i===void 0?!1:i,a=r.noLeading,o=a===void 0?!1:a,l=r.debounceMode,u=l===void 0?void 0:l,h,d=!1,f=0;function g(){h&&clearTimeout(h)}function b(v){var m=v||{},p=m.upcomingOnly,y=p===void 0?!1:p;g(),d=!y}function x(){for(var v=arguments.length,m=new Array(v),p=0;p<v;p++)m[p]=arguments[p];var y=this,_=Date.now()-f;if(d)return;function C(){f=Date.now(),t.apply(y,m)}function S(){h=void 0}!o&&u&&!h&&C(),g(),u===void 0&&_>e?o?(f=Date.now(),s||(h=setTimeout(u?S:C,e))):C():s!==!0&&(h=setTimeout(u?S:C,u===void 0?e-_:e))}return x.cancel=b,x}function hS(e,t,n){var r=n||{},i=r.atBegin,s=i===void 0?!1:i;return Un(e,t,{debounceMode:s!==!1})}const Wv=Ze(void 0),fS=Ze(void 0),Uv=Ze(void 0),Vv=Ze(void 0),pS=Ze(0),MY=2.5*60*1e3,jY=()=>{const e=rt(Wv),t=rt(Uv),n=rt(pS);return r=>{e(r.playerDrop),t(r.svRuntime),n(Date.now())}},NY=()=>{const e=rt(Vv);return w.useCallback(Un(150,e,{noLeading:!1,noTrailing:!1}),[e])},DY=()=>{const e=rt(Wv);return t=>{e(n=>{if(!n)return n;const r=n.summaryLast6h.slice(),i=r.findIndex(([s])=>s===t);return i===-1?r.push([t,1]):r[i][1]++,{...n,summaryLast6h:r}})}},mS=()=>{const e=nt(pS);return()=>{const t=Date.now();return{isExpired:t-e>MY,isStale:t-e>60*1e3,age:t-e}}},gS=Ze([]),qv=Ze(e=>e(gS).length),MD=Ze(null),LY=()=>{const e=DY(),t=rt(gS),n=rt(MD);return r=>{const i=r.findIndex(s=>s.type==="fullPlayerlist");i>0&&(r=r.slice(i));for(const s of r)s.type==="fullPlayerlist"?(t(s.playerlist),n(s.mutex)):s.type==="playerJoining"?t(a=>[...a,s]):s.type==="playerDropped"?(t(a=>a.filter(o=>o.netid!==s.netid)),s.reasonCategory&&e(s.reasonCategory)):console.error("Unknown playerlist event type",s)}},jD=Ze(0),of=()=>{const e=rt(jD);return()=>e(Math.random())},ND=Ze(!1),ug="txAdmin",gd=document.getElementById("favicon"),DD=Ze(ug),LD=()=>{const e=rt(DD);return t=>{t?e(t):(e(ug),document.title=ug,gd.href=ED)}},PY=kD((e,t)=>{if(!window.txConsts.isWebInterface)return;const n=e(DD),r=e(Qa),i=e(qv);r?(r.server.health===sc.ONLINE?gd.href=EY:r.server.health===sc.PARTIAL?gd.href=TY:gd.href=AY,document.title=`(${i}) ${r.server.name} · ${n}`):(gd.href=ED,document.title=ug)}),PD=Symbol("");function Zc(e){const t=Ze(e,(n,r,i)=>{const s=typeof i=="function"?i(n(t)):i;r(t,s===PD?e:s)});return t}const OY=e=>typeof(e==null?void 0:e.then)=="function";function IY(e=()=>{try{return window.localStorage}catch{return}},t){var n;let r,i;const s={getItem:(l,u)=>{var h,d;const f=b=>{if(b=b||"",r!==b){try{i=JSON.parse(b,t==null?void 0:t.reviver)}catch{return u}r=b}return i},g=(d=(h=e())==null?void 0:h.getItem(l))!=null?d:null;return OY(g)?g.then(f):f(g)},setItem:(l,u)=>{var h;return(h=e())==null?void 0:h.setItem(l,JSON.stringify(u,void 0))},removeItem:l=>{var u;return(u=e())==null?void 0:u.removeItem(l)}},a=l=>(u,h,d)=>l(u,f=>{let g;try{g=JSON.parse(f||"")}catch{g=d}h(g)});let o;try{o=(n=e())==null?void 0:n.subscribe}catch{}return!o&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(o=(l,u)=>{if(!(e()instanceof window.Storage))return()=>{};const h=d=>{d.storageArea===e()&&d.key===l&&u(d.newValue)};return window.addEventListener("storage",h),()=>{window.removeEventListener("storage",h)}}),o&&(s.subscribe=a(o)),s}const $Y=IY();function vS(e,t,n=$Y,r){const i=Ze(t);return i.onMount=a=>{a(n.getItem(e,t));let o;return n.subscribe&&(o=n.subscribe(e,a,t)),o},Ze(a=>a(i),(a,o,l)=>{const u=typeof l=="function"?l(a(i)):l;return u===PD?(o(i,t),n.removeItem(e)):u instanceof Promise?u.then(h=>(o(i,h),n.setItem(e,h))):(o(i,u),n.setItem(e,u))})}const Gv=Ze(!1),OD=Ze(void 0),xS=()=>{const[e,t]=sr(Gv),[n,r]=sr(OD);return{isAccountModalOpen:e,setAccountModalOpen:t,accountModalTab:n,setAccountModalTab:r}},BY=()=>{const e=rt(Gv),t=rt(OD);return n=>{e(!0),n&&t(n)}},ID=()=>{const e=rt(Gv);return()=>{e(!1)}},Kv=Ze(!1),$D=Zc({title:"",onConfirm:()=>{}}),Yv=()=>{const e=rt(Kv),t=rt($D);return n=>{t(n),e(!0)}},FY=()=>{const e=rt(Kv);return()=>{e(!1)}},zY=()=>{const e=nt(Kv),t=nt($D);return{isOpen:e,...t}},Xv=Ze(!1),BD=Zc({title:"",onSubmit:()=>{}}),af=()=>{const e=rt(Xv),t=rt(BD);return n=>{t(n),e(!0)}},HY=()=>{const e=rt(Xv);return()=>{e(!1)}},WY=()=>{const e=nt(Xv),t=nt(BD);return{isOpen:e,...t}},yS=Ze(!1),bS=Ze(!1),_S=Ze(!1),FD=()=>{const[e,t]=sr(yS);return{isSheetOpen:e,setIsSheetOpen:t}},zD=()=>{const[e,t]=sr(bS);return{isSheetOpen:e,setIsSheetOpen:t}},HD=()=>{const[e,t]=sr(_S);return{isSheetOpen:e,setIsSheetOpen:t}},Jv=()=>{const e=rt(yS),t=rt(bS),n=rt(_S);return()=>{e(!1),t(!1),n(!1)}},yt=w.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:Y("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","bg-black/5 dark:bg-black/30 placeholder:opacity-50",e),ref:r,...n}));yt.displayName="Input";var UY="Label",Id=w.forwardRef((e,t)=>c.jsx(Ce.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Id.displayName=UY;var WD=Id;const VY=si("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Yt=w.forwardRef(({className:e,...t},n)=>c.jsx(WD,{ref:n,className:Y(VY(),e),...t}));Yt.displayName=WD.displayName;/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qY=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),UD=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var GY={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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KY=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>w.createElement("svg",{ref:l,...GY,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:UD("lucide",i),...o},[...a.map(([u,h])=>w.createElement(u,h)),...Array.isArray(s)?s:[s]]));/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oe=(e,t)=>{const n=w.forwardRef(({className:r,...i},s)=>w.createElement(KY,{ref:s,iconNode:t,className:UD(`lucide-${qY(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YY=oe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XY=oe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JY=oe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QY=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZY=oe("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VD=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eX=oe("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tX=oe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rX=oe("ChartBar",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16h8",key:"srdodz"}],["path",{d:"M7 11h12",key:"127s9w"}],["path",{d:"M7 6h3",key:"w9rmul"}]]);/**
 * @license lucide-react v0.447.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=oe("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
 * @license lucide-react v0.447.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=oe("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wS=oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Za=oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SS=oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CS=oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qD=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const n_=oe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kS=oe("CircleAlert",[["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.447.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=oe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.447.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=oe("CircleChevronRight",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lX=oe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cX=oe("CirclePlay",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uX=oe("CirclePlus",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dX=oe("CircleX",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GD=oe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fX=oe("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const G3=oe("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mX=oe("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KD=oe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gX=oe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vX=oe("Delete",[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xX=oe("Dna",[["path",{d:"m10 16 1.5 1.5",key:"11lckj"}],["path",{d:"m14 8-1.5-1.5",key:"1ohn8i"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m17 6-2.891-2.891",key:"xu6p2f"}],["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"m20 9 .891.891",key:"3xwk7g"}],["path",{d:"M3.109 14.109 4 15",key:"q76aoh"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m7 18 2.891 2.891",key:"1sisit"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dg=oe("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yX=oe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const La=oe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bX=oe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _X=oe("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wX=oe("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
 * @license lucide-react v0.447.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=oe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CX=oe("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YD=oe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kX=oe("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hg=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EX=oe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XD=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ES=oe("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.447.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=oe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MX=oe("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fg=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qt=oe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const K3=oe("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DX=oe("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.447.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_=oe("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PX=oe("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.447.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=oe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
 * @license lucide-react v0.447.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=oe("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JD=oe("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $X=oe("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BX=oe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TS=oe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const i_=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UX=oe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VX=oe("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qX=oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GX=oe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AS=oe("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QD=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZD=oe("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
 * @license lucide-react v0.447.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=oe("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
 * @license lucide-react v0.447.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=oe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.447.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=oe("Skull",[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KX=oe("SquareActivity",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YX=oe("SquareChevronRight",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XX=oe("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JX=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QX=oe("StarOff",[["path",{d:"M8.34 8.34 2 9.27l5 4.87L5.82 21 12 17.77 18.18 21l-.59-3.43",key:"16m0ql"}],["path",{d:"M18.42 12.76 22 9.27l-6.91-1L12 2l-1.44 2.91",key:"1vt8nq"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZX=oe("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eJ=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tJ=oe("TimerOff",[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7",key:"10he05"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2",key:"15f7sh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M12 12v-2",key:"fwoke6"}]]);/**
 * @license lucide-react v0.447.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=oe("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
 * @license lucide-react v0.447.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=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nJ=oe("Trash",[["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"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rJ=oe("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pg=oe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RS=oe("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iJ=oe("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Y3=oe("UserRoundPlus",[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sJ=oe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MS=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oJ=oe("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kn=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aJ=oe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function lJ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const cJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dJ={};function X3(e,t){return(dJ.jsx?uJ:cJ).test(e)}const hJ=/[ \t\n\f\r]/g;function fJ(e){return typeof e=="object"?e.type==="text"?J3(e.value):!1:J3(e)}function J3(e){return e.replace(hJ,"")===""}class lf{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}lf.prototype.property={};lf.prototype.normal={};lf.prototype.space=null;function sL(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 lf(n,r,t)}function s_(e){return e.toLowerCase()}class ai{constructor(t,n){this.property=t,this.attribute=n}}ai.prototype.space=null;ai.prototype.boolean=!1;ai.prototype.booleanish=!1;ai.prototype.overloadedBoolean=!1;ai.prototype.number=!1;ai.prototype.commaSeparated=!1;ai.prototype.spaceSeparated=!1;ai.prototype.commaOrSpaceSeparated=!1;ai.prototype.mustUseProperty=!1;ai.prototype.defined=!1;let pJ=0;const Ge=el(),hn=el(),oL=el(),fe=el(),Pt=el(),oc=el(),kr=el();function el(){return 2**++pJ}const o_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:hn,commaOrSpaceSeparated:kr,commaSeparated:oc,number:fe,overloadedBoolean:oL,spaceSeparated:Pt},Symbol.toStringTag,{value:"Module"})),Ox=Object.keys(o_);class jS extends ai{constructor(t,n,r,i){let s=-1;if(super(t,n),Q3(this,"space",i),typeof r=="number")for(;++s<Ox.length;){const a=Ox[s];Q3(this,Ox[s],(r&o_[a])===o_[a])}}}jS.prototype.defined=!0;function Q3(e,t,n){n&&(e[t]=n)}const mJ={}.hasOwnProperty;function eu(e){const t={},n={};let r;for(r in e.properties)if(mJ.call(e.properties,r)){const i=e.properties[r],s=new jS(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[s_(r)]=r,n[s_(s.attribute)]=r}return new lf(t,n,e.space)}const aL=eu({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}}),lL=eu({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function cL(e,t){return t in e?e[t]:t}function uL(e,t){return cL(e,t.toLowerCase())}const dL=eu({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:uL,properties:{xmlns:null,xmlnsXLink:null}}),hL=eu({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:hn,ariaAutoComplete:null,ariaBusy:hn,ariaChecked:hn,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:Pt,ariaCurrent:null,ariaDescribedBy:Pt,ariaDetails:null,ariaDisabled:hn,ariaDropEffect:Pt,ariaErrorMessage:null,ariaExpanded:hn,ariaFlowTo:Pt,ariaGrabbed:hn,ariaHasPopup:null,ariaHidden:hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pt,ariaLevel:fe,ariaLive:null,ariaModal:hn,ariaMultiLine:hn,ariaMultiSelectable:hn,ariaOrientation:null,ariaOwns:Pt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:hn,ariaReadOnly:hn,ariaRelevant:null,ariaRequired:hn,ariaRoleDescription:Pt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:hn,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null}}),gJ=eu({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:uL,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oc,acceptCharset:Pt,accessKey:Pt,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:Pt,autoFocus:Ge,autoPlay:Ge,blocking:Pt,capture:null,charSet:null,checked:Ge,cite:null,className:Pt,cols:fe,colSpan:null,content:null,contentEditable:hn,controls:Ge,controlsList:Pt,coords:fe|oc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:oL,draggable:hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:Pt,height:fe,hidden:Ge,high:fe,href:null,hrefLang:null,htmlFor:Pt,httpEquiv:Pt,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:Pt,itemRef:Pt,itemScope:Ge,itemType:Pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ge,optimum:fe,pattern:null,ping:Pt,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:Pt,required:Ge,reversed:Ge,rows:fe,rowSpan:fe,sandbox:Pt,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:hn,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:hn,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ge,disableRemotePlayback:Ge,prefix:null,property:null,results:fe,security:null,unselectable:null}}),vJ=eu({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:cL,properties:{about:kr,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:Pt,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:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,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:oc,g2:oc,glyphName:oc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:kr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,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:fe,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:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kr,rev:kr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kr,requiredFeatures:kr,requiredFonts:kr,requiredFormats:kr,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:kr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kr,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),xJ=/^data[-\w.:]+$/i,Z3=/-[a-z]/g,yJ=/[A-Z]/g;function bJ(e,t){const n=s_(t);let r=t,i=ai;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xJ.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Z3,wJ);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Z3.test(s)){let a=s.replace(yJ,_J);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=jS}return new i(r,t)}function _J(e){return"-"+e.toLowerCase()}function wJ(e){return e.charAt(1).toUpperCase()}const SJ={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"},CJ=sL([lL,aL,dL,hL,gJ],"html"),NS=sL([lL,aL,dL,hL,vJ],"svg");function kJ(e){return e.join(" ").trim()}var fL={},e4=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,EJ=/\n/g,TJ=/^\s*/,AJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,RJ=/^:\s*/,MJ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,jJ=/^[;\s]*/,NJ=/^\s+|\s+$/g,DJ=`
`,t4="/",n4="*",ha="",LJ="comment",PJ="declaration",OJ=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(b){var x=b.match(EJ);x&&(n+=x.length);var v=b.lastIndexOf(DJ);r=~v?b.length-v:r+b.length}function s(){var b={line:n,column:r};return function(x){return x.position=new a(b),u(),x}}function a(b){this.start=b,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(b){var x=new Error(t.source+":"+n+":"+r+": "+b);if(x.reason=b,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function l(b){var x=b.exec(e);if(x){var v=x[0];return i(v),e=e.slice(v.length),x}}function u(){l(TJ)}function h(b){var x;for(b=b||[];x=d();)x!==!1&&b.push(x);return b}function d(){var b=s();if(!(t4!=e.charAt(0)||n4!=e.charAt(1))){for(var x=2;ha!=e.charAt(x)&&(n4!=e.charAt(x)||t4!=e.charAt(x+1));)++x;if(x+=2,ha===e.charAt(x-1))return o("End of comment missing");var v=e.slice(2,x-2);return r+=2,i(v),e=e.slice(x),r+=2,b({type:LJ,comment:v})}}function f(){var b=s(),x=l(AJ);if(x){if(d(),!l(RJ))return o("property missing ':'");var v=l(MJ),m=b({type:PJ,property:r4(x[0].replace(e4,ha)),value:v?r4(v[0].replace(e4,ha)):ha});return l(jJ),m}}function g(){var b=[];h(b);for(var x;x=f();)x!==!1&&(b.push(x),h(b));return b}return u(),g()};function r4(e){return e?e.replace(NJ,ha):ha}var IJ=Ui&&Ui.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fL,"__esModule",{value:!0});var i4=fL.default=BJ,$J=IJ(OJ);function BJ(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,$J.default)(e),i=typeof t=="function";return r.forEach(function(s){if(s.type==="declaration"){var a=s.property,o=s.value;i?t(a,o,s):o&&(n=n||{},n[a]=o)}}),n}const FJ=i4.default||i4,pL=mL("end"),DS=mL("start");function mL(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 zJ(e){const t=DS(e),n=pL(e);if(t&&n)return{start:t,end:n}}function $d(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?s4(e.position):"start"in e||"end"in e?s4(e):"line"in e||"column"in e?a_(e):""}function a_(e){return o4(e&&e.line)+":"+o4(e&&e.column)}function s4(e){return a_(e&&e.start)+"-"+a_(e&&e.end)}function o4(e){return e&&typeof e=="number"?e:1}class Yn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=o?o.line:void 0,this.name=$d(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}Yn.prototype.file="";Yn.prototype.name="";Yn.prototype.reason="";Yn.prototype.message="";Yn.prototype.stack="";Yn.prototype.column=void 0;Yn.prototype.line=void 0;Yn.prototype.ancestors=void 0;Yn.prototype.cause=void 0;Yn.prototype.fatal=void 0;Yn.prototype.place=void 0;Yn.prototype.ruleId=void 0;Yn.prototype.source=void 0;const LS={}.hasOwnProperty,HJ=new Map,WJ=/[A-Z]/g,UJ=/-([a-z])/g,VJ=new Set(["table","tbody","thead","tfoot","tr"]),qJ=new Set(["td","th"]),gL="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function GJ(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=tQ(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=eQ(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?NS:CJ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=vL(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function vL(e,t,n){if(t.type==="element")return KJ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return YJ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return JJ(e,t,n);if(t.type==="mdxjsEsm")return XJ(e,t);if(t.type==="root")return QJ(e,t,n);if(t.type==="text")return ZJ(e,t)}function KJ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=NS,e.schema=i),e.ancestors.push(t);const s=yL(e,t.tagName,!1),a=nQ(e,t);let o=OS(e,t);return VJ.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!fJ(l):!0})),xL(e,a,s,t),PS(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function YJ(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mh(e,t.position)}function XJ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);mh(e,t.position)}function JJ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=NS,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:yL(e,t.name,!0),a=rQ(e,t),o=OS(e,t);return xL(e,a,s,t),PS(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function QJ(e,t,n){const r={};return PS(r,OS(e,t)),e.create(t,e.Fragment,r,n)}function ZJ(e,t){return t.value}function xL(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function PS(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function eQ(e,t,n){return r;function r(i,s,a,o){const u=Array.isArray(a.children)?n:t;return o?u(s,a,o):u(s,a)}}function tQ(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=DS(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function nQ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&LS.call(t.properties,i)){const s=iQ(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&qJ.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function rQ(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else mh(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else mh(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function OS(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:HJ;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;a=l+"-"+u,i.set(l,u+1)}}const o=vL(e,s,a);o!==void 0&&n.push(o)}return n}function iQ(e,t,n){const r=bJ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?lJ(n):kJ(n)),r.property==="style"){let i=typeof n=="object"?n:sQ(e,String(n));return e.stylePropertyNameCase==="css"&&(i=oQ(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?SJ[r.property]||r.property:r.attribute,n]}}function sQ(e,t){const n={};try{FJ(t,r)}catch(i){if(!e.ignoreInvalidStyle){const s=i,a=new Yn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=gL+"#cannot-parse-style-attribute",a}}return n;function r(i,s){let a=i;a.slice(0,2)!=="--"&&(a.slice(0,4)==="-ms-"&&(a="ms-"+a.slice(4)),a=a.replace(UJ,lQ)),n[a]=s}}function yL(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=X3(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=X3(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return LS.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);mh(e)}function mh(e,t){const n=new Yn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=gL+"#cannot-handle-mdx-estrees-without-createevaluater",n}function oQ(e){const t={};let n;for(n in e)LS.call(e,n)&&(t[aQ(n)]=e[n]);return t}function aQ(e){let t=e.replace(WJ,cQ);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lQ(e,t){return t.toUpperCase()}function cQ(e){return"-"+e.toLowerCase()}const Ix={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"]},uQ={};function IS(e,t){const n=uQ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bL(e,r,i)}function bL(e,t,n){if(dQ(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 a4(e.children,t,n)}return Array.isArray(e)?a4(e,t,n):""}function a4(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=bL(e[i],t,n);return r.join("")}function dQ(e){return!!(e&&typeof e=="object")}const l4=document.createElement("i");function $S(e){const t="&"+e+";";l4.innerHTML=t;const n=l4.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Nr(e,t,n,r){const i=e.length;let s=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);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Ur(e,t){return e.length>0?(Nr(e,e.length,0,t),e):t}const c4={}.hasOwnProperty;function _L(e){const t={};let n=-1;for(;++n<e.length;)hQ(t,e[n]);return t}function hQ(e,t){let n;for(n in t){const i=(c4.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){c4.call(i,a)||(i[a]=[]);const o=s[a];fQ(i[a],Array.isArray(o)?o:o?[o]:[])}}}function fQ(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Nr(e,0,0,r)}function wL(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 Si(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const tr=Yo(/[A-Za-z]/),Vn=Yo(/[\dA-Za-z]/),pQ=Yo(/[#-'*+\--9=?A-Z^-~]/);function mg(e){return e!==null&&(e<32||e===127)}const l_=Yo(/\d/),mQ=Yo(/[\dA-Fa-f]/),gQ=Yo(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function Mt(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const Qv=Yo(new RegExp("\\p{P}|\\p{S}","u")),Pa=Yo(/\s/);function Yo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Vn(e.charCodeAt(n+1))&&Vn(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);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 ut(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return et(l)?(e.enter(n),o(l)):t(l)}function o(l){return et(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const vQ={tokenize:xQ};function xQ(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ut(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return De(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const yQ={tokenize:bQ},u4={tokenize:_Q};function bQ(e){const t=this,n=[];let r=0,i,s,a;return o;function o(y){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,l,u)(y)}return u(y)}function l(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&p();const _=t.events.length;let C=_,S;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){S=t.events[C][1].end;break}m(r);let E=_;for(;E<t.events.length;)t.events[E][1].end={...S},E++;return Nr(t.events,C+1,0,t.events.slice(_)),t.events.length=E,u(y)}return o(y)}function u(y){if(r===n.length){if(!i)return f(y);if(i.currentConstruct&&i.currentConstruct.concrete)return b(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(u4,h,d)(y)}function h(y){return i&&p(),m(r),f(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(y)}function f(y){return t.containerState={},e.attempt(u4,g,b)(y)}function g(y){return r++,n.push([t.currentConstruct,t.containerState]),f(y)}function b(y){if(y===null){i&&p(),m(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),x(y)}function x(y){if(y===null){v(e.exit("chunkFlow"),!0),m(0),e.consume(y);return}return De(y)?(e.consume(y),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),x)}function v(y,_){const C=t.sliceStream(y);if(_&&C.push(null),y.previous=s,s&&(s.next=y),s=y,i.defineSkip(y.start),i.write(C),t.parser.lazy[y.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<a&&(!i.events[S][1].end||i.events[S][1].end.offset>a))return;const E=t.events.length;let k=E,T,A;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(T){A=t.events[k][1].end;break}T=!0}for(m(r),S=E;S<t.events.length;)t.events[S][1].end={...A},S++;Nr(t.events,k+1,0,t.events.slice(E)),t.events.length=S}}function m(y){let _=n.length;for(;_-- >y;){const C=n[_];t.containerState=C[1],C[0].exit.call(t,e)}n.length=y}function p(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function _Q(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ac(e){if(e===null||Mt(e)||Pa(e))return 1;if(Qv(e))return 2}function Zv(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const c_={name:"attention",resolveAll:wQ,tokenize:SQ};function wQ(e,t){let n=-1,r,i,s,a,o,l,u,h;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 d={...e[r][1].end},f={...e[n][1].start};d4(d,-l),d4(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ur(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ur(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=Ur(u,Zv(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ur(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=Ur(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Nr(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function SQ(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ac(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const u=e.exit("attentionSequence"),h=Ac(l),d=!h||h===2&&i||n.includes(l),f=!i||i===2&&h||n.includes(r);return u._open=!!(s===42?d:d&&(i||!f)),u._close=!!(s===42?f:f&&(h||!d)),t(l)}}function d4(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const CQ={name:"autolink",tokenize:kQ};function kQ(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"),s}function s(g){return tr(g)?(e.consume(g),a):g===64?n(g):u(g)}function a(g){return g===43||g===45||g===46||Vn(g)?(r=1,o(g)):u(g)}function o(g){return g===58?(e.consume(g),r=0,l):(g===43||g===45||g===46||Vn(g))&&r++<32?(e.consume(g),o):(r=0,u(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||mg(g)?n(g):(e.consume(g),l)}function u(g){return g===64?(e.consume(g),h):pQ(g)?(e.consume(g),u):n(g)}function h(g){return Vn(g)?d(g):n(g)}function d(g){return g===46?(e.consume(g),r=0,h):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):f(g)}function f(g){if((g===45||Vn(g))&&r++<63){const b=g===45?f:d;return e.consume(g),b}return n(g)}}const cf={partial:!0,tokenize:EQ};function EQ(e,t,n){return r;function r(s){return et(s)?ut(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||De(s)?t(s):n(s)}}const SL={continuation:{tokenize:AQ},exit:RQ,name:"blockQuote",tokenize:TQ};function TQ(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return et(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function AQ(e,t,n){const r=this;return i;function i(a){return et(a)?ut(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(SL,t,n)(a)}}function RQ(e){e.exit("blockQuote")}const CL={name:"characterEscape",tokenize:MQ};function MQ(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return gQ(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const kL={name:"characterReference",tokenize:jQ};function jQ(e,t,n){const r=this;let i=0,s,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=Vn,h(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=mQ,h):(e.enter("characterReferenceValue"),s=7,a=l_,h(d))}function h(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===Vn&&!$S(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<s?(e.consume(d),h):n(d)}}const h4={partial:!0,tokenize:DQ},f4={concrete:!0,name:"codeFenced",tokenize:NQ};function NQ(e,t,n){const r=this,i={partial:!0,tokenize:C};let s=0,a=0,o;return l;function l(S){return u(S)}function u(S){const E=r.events[r.events.length-1];return s=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,o=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(S)}function h(S){return S===o?(a++,e.consume(S),h):a<3?n(S):(e.exit("codeFencedFenceSequence"),et(S)?ut(e,d,"whitespace")(S):d(S))}function d(S){return S===null||De(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(h4,x,_)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||De(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):et(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,g,"whitespace")(S)):S===96&&S===o?n(S):(e.consume(S),f)}function g(S){return S===null||De(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===null||De(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===o?n(S):(e.consume(S),b)}function x(S){return e.attempt(i,_,v)(S)}function v(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),m}function m(S){return s>0&&et(S)?ut(e,p,"linePrefix",s+1)(S):p(S)}function p(S){return S===null||De(S)?e.check(h4,x,_)(S):(e.enter("codeFlowValue"),y(S))}function y(S){return S===null||De(S)?(e.exit("codeFlowValue"),p(S)):(e.consume(S),y)}function _(S){return e.exit("codeFenced"),t(S)}function C(S,E,k){let T=0;return A;function A(O){return S.enter("lineEnding"),S.consume(O),S.exit("lineEnding"),M}function M(O){return S.enter("codeFencedFence"),et(O)?ut(S,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):D(O)}function D(O){return O===o?(S.enter("codeFencedFenceSequence"),L(O)):k(O)}function L(O){return O===o?(T++,S.consume(O),L):T>=a?(S.exit("codeFencedFenceSequence"),et(O)?ut(S,N,"whitespace")(O):N(O)):k(O)}function N(O){return O===null||De(O)?(S.exit("codeFencedFence"),E(O)):k(O)}}}function DQ(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"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const $x={name:"codeIndented",tokenize:PQ},LQ={partial:!0,tokenize:OQ};function PQ(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ut(e,s,"linePrefix",5)(u)}function s(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):De(u)?e.attempt(LQ,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||De(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function OQ(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):De(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ut(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):De(a)?i(a):n(a)}}const IQ={name:"codeText",previous:BQ,resolve:$Q,tokenize:FQ};function $Q(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 BQ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function FQ(e,t,n){let r=0,i,s;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,h(d)):De(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||De(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),u)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",u(d))}}class zQ{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Wu(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Wu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Wu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Wu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Wu(this.left,n.reverse())}}}function Wu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function EL(e){const t={};let n=-1,r,i,s,a,o,l,u;const h=new zQ(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,HQ(h,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--&&(a=h.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return Nr(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!u}function HQ(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[],a=n._tokenizer||r.parser[n.contentType](n.start),o=a.events,l=[],u={};let h,d,f=-1,g=n,b=0,x=0;const v=[x];for(;g;){for(;e.get(++i)[1]!==g;);s.push(i),g._tokenizer||(h=r.sliceStream(g),g.next||h.push(null),d&&a.defineSkip(g.start),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=g,g=g.next}for(g=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(x=f+1,v.push(x),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(a.events=[],g?(g._tokenizer=void 0,g.previous=void 0):v.pop(),f=v.length;f--;){const m=o.slice(v[f],v[f+1]),p=s.pop();l.push([p,p+m.length-1]),e.splice(p,2,m)}for(l.reverse(),f=-1;++f<l.length;)u[b+l[f][0]]=b+l[f][1],b+=l[f][1]-l[f][0]-1;return u}const WQ={resolve:VQ,tokenize:qQ},UQ={partial:!0,tokenize:GQ};function VQ(e){return EL(e),e}function qQ(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):De(o)?e.check(UQ,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function GQ(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ut(e,s,"linePrefix")}function s(a){if(a===null||De(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function TL(e,t,n,r,i,s,a,o,l){const u=l||Number.POSITIVE_INFINITY;let h=0;return d;function d(m){return m===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(m),e.exit(s),f):m===null||m===32||m===41||mg(m)?n(m):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),x(m))}function f(m){return m===62?(e.enter(s),e.consume(m),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),g(m))}function g(m){return m===62?(e.exit("chunkString"),e.exit(o),f(m)):m===null||m===60||De(m)?n(m):(e.consume(m),m===92?b:g)}function b(m){return m===60||m===62||m===92?(e.consume(m),g):g(m)}function x(m){return!h&&(m===null||m===41||Mt(m))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(m)):h<u&&m===40?(e.consume(m),h++,x):m===41?(e.consume(m),h--,x):m===null||m===32||m===40||mg(m)?n(m):(e.consume(m),m===92?v:x)}function v(m){return m===40||m===41||m===92?(e.consume(m),x):x(m)}}function AL(e,t,n,r,i,s){const a=this;let o=0,l;return u;function u(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(s),h}function h(g){return o>999||g===null||g===91||g===93&&!l||g===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(g):g===93?(e.exit(s),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):De(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===null||g===91||g===93||De(g)||o++>999?(e.exit("chunkString"),h(g)):(e.consume(g),l||(l=!et(g)),g===92?f:d)}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}}function RL(e,t,n,r,i,s){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):n(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),u(f))}function u(f){return f===a?(e.exit(s),l(a)):f===null?n(f):De(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ut(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===a||f===null||De(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:h)}function d(f){return f===a||f===92?(e.consume(f),h):h(f)}}function Bd(e,t){let n;return r;function r(i){return De(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):et(i)?ut(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const KQ={name:"definition",tokenize:XQ},YQ={partial:!0,tokenize:JQ};function XQ(e,t,n){const r=this;let i;return s;function s(g){return e.enter("definition"),a(g)}function a(g){return AL.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function o(g){return i=Si(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 Mt(g)?Bd(e,u)(g):u(g)}function u(g){return TL(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function h(g){return e.attempt(YQ,d,d)(g)}function d(g){return et(g)?ut(e,f,"whitespace")(g):f(g)}function f(g){return g===null||De(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function JQ(e,t,n){return r;function r(o){return Mt(o)?Bd(e,i)(o):n(o)}function i(o){return RL(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return et(o)?ut(e,a,"whitespace")(o):a(o)}function a(o){return o===null||De(o)?t(o):n(o)}}const QQ={name:"hardBreakEscape",tokenize:ZQ};function ZQ(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return De(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const eZ={name:"headingAtx",resolve:tZ,tokenize:nZ};function tZ(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Nr(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function nZ(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||Mt(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),l(h)):h===null||De(h)?(e.exit("atxHeading"),t(h)):et(h)?ut(e,o,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function l(h){return h===35?(e.consume(h),l):(e.exit("atxHeadingSequence"),o(h))}function u(h){return h===null||h===35||Mt(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),u)}}const rZ=["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"],p4=["pre","script","style","textarea"],iZ={concrete:!0,name:"htmlFlow",resolveTo:aZ,tokenize:lZ},sZ={partial:!0,tokenize:uZ},oZ={partial:!0,tokenize:cZ};function aZ(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 lZ(e,t,n){const r=this;let i,s,a,o,l;return u;function u(F){return h(F)}function h(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),d}function d(F){return F===33?(e.consume(F),f):F===47?(e.consume(F),s=!0,x):F===63?(e.consume(F),i=3,r.interrupt?t:R):tr(F)?(e.consume(F),a=String.fromCharCode(F),v):n(F)}function f(F){return F===45?(e.consume(F),i=2,g):F===91?(e.consume(F),i=5,o=0,b):tr(F)?(e.consume(F),i=4,r.interrupt?t:R):n(F)}function g(F){return F===45?(e.consume(F),r.interrupt?t:R):n(F)}function b(F){const G="CDATA[";return F===G.charCodeAt(o++)?(e.consume(F),o===G.length?r.interrupt?t:D:b):n(F)}function x(F){return tr(F)?(e.consume(F),a=String.fromCharCode(F),v):n(F)}function v(F){if(F===null||F===47||F===62||Mt(F)){const G=F===47,Z=a.toLowerCase();return!G&&!s&&p4.includes(Z)?(i=1,r.interrupt?t(F):D(F)):rZ.includes(a.toLowerCase())?(i=6,G?(e.consume(F),m):r.interrupt?t(F):D(F)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):s?p(F):y(F))}return F===45||Vn(F)?(e.consume(F),a+=String.fromCharCode(F),v):n(F)}function m(F){return F===62?(e.consume(F),r.interrupt?t:D):n(F)}function p(F){return et(F)?(e.consume(F),p):A(F)}function y(F){return F===47?(e.consume(F),A):F===58||F===95||tr(F)?(e.consume(F),_):et(F)?(e.consume(F),y):A(F)}function _(F){return F===45||F===46||F===58||F===95||Vn(F)?(e.consume(F),_):C(F)}function C(F){return F===61?(e.consume(F),S):et(F)?(e.consume(F),C):y(F)}function S(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),l=F,E):et(F)?(e.consume(F),S):k(F)}function E(F){return F===l?(e.consume(F),l=null,T):F===null||De(F)?n(F):(e.consume(F),E)}function k(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||Mt(F)?C(F):(e.consume(F),k)}function T(F){return F===47||F===62||et(F)?y(F):n(F)}function A(F){return F===62?(e.consume(F),M):n(F)}function M(F){return F===null||De(F)?D(F):et(F)?(e.consume(F),M):n(F)}function D(F){return F===45&&i===2?(e.consume(F),B):F===60&&i===1?(e.consume(F),z):F===62&&i===4?(e.consume(F),I):F===63&&i===3?(e.consume(F),R):F===93&&i===5?(e.consume(F),j):De(F)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(sZ,H,L)(F)):F===null||De(F)?(e.exit("htmlFlowData"),L(F)):(e.consume(F),D)}function L(F){return e.check(oZ,N,H)(F)}function N(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),O}function O(F){return F===null||De(F)?L(F):(e.enter("htmlFlowData"),D(F))}function B(F){return F===45?(e.consume(F),R):D(F)}function z(F){return F===47?(e.consume(F),a="",P):D(F)}function P(F){if(F===62){const G=a.toLowerCase();return p4.includes(G)?(e.consume(F),I):D(F)}return tr(F)&&a.length<8?(e.consume(F),a+=String.fromCharCode(F),P):D(F)}function j(F){return F===93?(e.consume(F),R):D(F)}function R(F){return F===62?(e.consume(F),I):F===45&&i===2?(e.consume(F),R):D(F)}function I(F){return F===null||De(F)?(e.exit("htmlFlowData"),H(F)):(e.consume(F),I)}function H(F){return e.exit("htmlFlow"),t(F)}}function cZ(e,t,n){const r=this;return i;function i(a){return De(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function uZ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(cf,t,n)}}const dZ={name:"htmlText",tokenize:hZ};function hZ(e,t,n){const r=this;let i,s,a;return o;function o(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),l}function l(R){return R===33?(e.consume(R),u):R===47?(e.consume(R),C):R===63?(e.consume(R),y):tr(R)?(e.consume(R),k):n(R)}function u(R){return R===45?(e.consume(R),h):R===91?(e.consume(R),s=0,b):tr(R)?(e.consume(R),p):n(R)}function h(R){return R===45?(e.consume(R),g):n(R)}function d(R){return R===null?n(R):R===45?(e.consume(R),f):De(R)?(a=d,z(R)):(e.consume(R),d)}function f(R){return R===45?(e.consume(R),g):d(R)}function g(R){return R===62?B(R):R===45?f(R):d(R)}function b(R){const I="CDATA[";return R===I.charCodeAt(s++)?(e.consume(R),s===I.length?x:b):n(R)}function x(R){return R===null?n(R):R===93?(e.consume(R),v):De(R)?(a=x,z(R)):(e.consume(R),x)}function v(R){return R===93?(e.consume(R),m):x(R)}function m(R){return R===62?B(R):R===93?(e.consume(R),m):x(R)}function p(R){return R===null||R===62?B(R):De(R)?(a=p,z(R)):(e.consume(R),p)}function y(R){return R===null?n(R):R===63?(e.consume(R),_):De(R)?(a=y,z(R)):(e.consume(R),y)}function _(R){return R===62?B(R):y(R)}function C(R){return tr(R)?(e.consume(R),S):n(R)}function S(R){return R===45||Vn(R)?(e.consume(R),S):E(R)}function E(R){return De(R)?(a=E,z(R)):et(R)?(e.consume(R),E):B(R)}function k(R){return R===45||Vn(R)?(e.consume(R),k):R===47||R===62||Mt(R)?T(R):n(R)}function T(R){return R===47?(e.consume(R),B):R===58||R===95||tr(R)?(e.consume(R),A):De(R)?(a=T,z(R)):et(R)?(e.consume(R),T):B(R)}function A(R){return R===45||R===46||R===58||R===95||Vn(R)?(e.consume(R),A):M(R)}function M(R){return R===61?(e.consume(R),D):De(R)?(a=M,z(R)):et(R)?(e.consume(R),M):T(R)}function D(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,L):De(R)?(a=D,z(R)):et(R)?(e.consume(R),D):(e.consume(R),N)}function L(R){return R===i?(e.consume(R),i=void 0,O):R===null?n(R):De(R)?(a=L,z(R)):(e.consume(R),L)}function N(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Mt(R)?T(R):(e.consume(R),N)}function O(R){return R===47||R===62||Mt(R)?T(R):n(R)}function B(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function z(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),P}function P(R){return et(R)?ut(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):j(R)}function j(R){return e.enter("htmlTextData"),a(R)}}const BS={name:"labelEnd",resolveAll:gZ,resolveTo:vZ,tokenize:xZ},fZ={tokenize:yZ},pZ={tokenize:bZ},mZ={tokenize:_Z};function gZ(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Nr(e,0,e.length,n),e}function vZ(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){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&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},h={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=Ur(o,e.slice(s+1,s+r+3)),o=Ur(o,[["enter",h,t]]),o=Ur(o,Zv(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=Ur(o,[["exit",h,t],e[a-2],e[a-1],["exit",u,t]]),o=Ur(o,e.slice(a+1)),o=Ur(o,[["exit",l,t]]),Nr(e,s,e.length,o),e}function xZ(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(f){return s?s._inactive?d(f):(a=r.parser.defined.includes(Si(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(fZ,h,a?h:d)(f):f===91?e.attempt(pZ,h,a?u:d)(f):a?h(f):d(f)}function u(f){return e.attempt(mZ,h,d)(f)}function h(f){return t(f)}function d(f){return s._balanced=!0,n(f)}}function yZ(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Mt(d)?Bd(e,s)(d):s(d)}function s(d){return d===41?h(d):TL(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Mt(d)?Bd(e,l)(d):h(d)}function o(d){return n(d)}function l(d){return d===34||d===39||d===40?RL(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function u(d){return Mt(d)?Bd(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function bZ(e,t,n){const r=this;return i;function i(o){return AL.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Si(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function _Z(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const wZ={name:"labelStartImage",resolveAll:BS.resolveAll,tokenize:SZ};function SZ(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const CZ={name:"labelStartLink",resolveAll:BS.resolveAll,tokenize:kZ};function kZ(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"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Bx={name:"lineEnding",tokenize:EZ};function EZ(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const pm={name:"thematicBreak",tokenize:TZ};function TZ(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||De(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),et(u)?ut(e,o,"whitespace")(u):o(u))}}const cr={continuation:{tokenize:jZ},exit:DZ,name:"list",tokenize:MZ},AZ={partial:!0,tokenize:LZ},RZ={partial:!0,tokenize:NZ};function MZ(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(g){const b=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:l_(g)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(pm,n,u)(g):u(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(g)}return n(g)}function l(g){return l_(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"),u(g)):n(g)}function u(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(cf,r.interrupt?n:h,e.attempt(AZ,f,d))}function h(g){return r.containerState.initialBlankLine=!0,s++,f(g)}function d(g){return et(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),f):n(g)}function f(g){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function jZ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(cf,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ut(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!et(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(RZ,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ut(e,e.attempt(cr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function NZ(e,t,n){const r=this;return ut(e,i,"listItemIndent",r.containerState.size+1);function i(s){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(s):n(s)}}function DZ(e){e.exit(this.containerState.type)}function LZ(e,t,n){const r=this;return ut(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!et(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const m4={name:"setextUnderline",resolveTo:PZ,tokenize:OZ};function PZ(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function OZ(e,t,n){const r=this;let i;return s;function s(u){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),et(u)?ut(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||De(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const IZ={tokenize:$Z};function $Z(e){const t=this,n=e.attempt(cf,r,e.attempt(this.parser.constructs.flowInitial,i,ut(e,e.attempt(this.parser.constructs.flow,i,e.attempt(WQ,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const BZ={resolveAll:jL()},FZ=ML("string"),zZ=ML("text");function ML(e){return{resolveAll:jL(e==="text"?HZ:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(h){return u(h)?s(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),l}function l(h){return u(h)?(n.exit("data"),s(h)):(n.consume(h),l)}function u(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f<d.length;){const g=d[f];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function jL(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function HZ(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 s=i.length,a=-1,o=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)l=!0,o++;else if(u!==-1){s++;break}}if(o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const WZ={42:cr,43:cr,45:cr,48:cr,49:cr,50:cr,51:cr,52:cr,53:cr,54:cr,55:cr,56:cr,57:cr,62:SL},UZ={91:KQ},VZ={[-2]:$x,[-1]:$x,32:$x},qZ={35:eZ,42:pm,45:[m4,pm],60:iZ,61:m4,95:pm,96:f4,126:f4},GZ={38:kL,92:CL},KZ={[-5]:Bx,[-4]:Bx,[-3]:Bx,33:wZ,38:kL,42:c_,60:[CQ,dZ],91:CZ,92:[QQ,CL],93:BS,95:c_,96:IQ},YZ={null:[c_,BZ]},XZ={null:[42,95]},JZ={null:[]},QZ=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:XZ,contentInitial:UZ,disable:JZ,document:WZ,flow:qZ,flowInitial:VZ,insideSpan:YZ,string:GZ,text:KZ},Symbol.toStringTag,{value:"Module"}));function ZZ(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:E(C),check:E(S),consume:p,enter:y,exit:_,interrupt:E(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:b,parser:e,previous:null,sliceSerialize:f,sliceStream:g,write:d};let h=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function d(M){return a=Ur(a,M),v(),a[a.length-1]!==null?[]:(k(t,0),u.events=Zv(s,u.events,u),u.events)}function f(M,D){return tee(g(M),D)}function g(M){return eee(a,M)}function b(){const{_bufferIndex:M,_index:D,line:L,column:N,offset:O}=r;return{_bufferIndex:M,_index:D,line:L,column:N,offset:O}}function x(M){i[M.line]=M.column,A()}function v(){let M;for(;r._index<a.length;){const D=a[r._index];if(typeof D=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<D.length;)m(D.charCodeAt(r._bufferIndex));else m(D)}}function m(M){h=h(M)}function p(M){De(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,A()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=M}function y(M,D){const L=D||{};return L.type=M,L.start=b(),u.events.push(["enter",L,u]),o.push(L),L}function _(M){const D=o.pop();return D.end=b(),u.events.push(["exit",D,u]),D}function C(M,D){k(M,D.from)}function S(M,D){D.restore()}function E(M,D){return L;function L(N,O,B){let z,P,j,R;return Array.isArray(N)?H(N):"tokenize"in N?H([N]):I(N);function I(J){return W;function W($){const V=$!==null&&J[$],U=$!==null&&J.null,X=[...Array.isArray(V)?V:V?[V]:[],...Array.isArray(U)?U:U?[U]:[]];return H(X)($)}}function H(J){return z=J,P=0,J.length===0?B:F(J[P])}function F(J){return W;function W($){return R=T(),j=J,J.partial||(u.currentConstruct=J),J.name&&u.parser.constructs.disable.null.includes(J.name)?Z():J.tokenize.call(D?Object.assign(Object.create(u),D):u,l,G,Z)($)}}function G(J){return M(j,R),O}function Z(J){return R.restore(),++P<z.length?F(z[P]):B}}}function k(M,D){M.resolveAll&&!s.includes(M)&&s.push(M),M.resolve&&Nr(u.events,D,u.events.length-D,M.resolve(u.events.slice(D),u)),M.resolveTo&&(u.events=M.resolveTo(u.events,u))}function T(){const M=b(),D=u.previous,L=u.currentConstruct,N=u.events.length,O=Array.from(o);return{from:N,restore:B};function B(){r=M,u.previous=D,u.currentConstruct=L,u.events.length=N,o=O,A()}}function A(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function eee(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function tee(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){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(s)}i=s===-2,r.push(a)}return r.join("")}function nee(e){const r={constructs:_L([QZ,...(e||{}).extensions||[]]),content:i(vQ),defined:[],document:i(yQ),flow:i(IZ),lazy:{},string:i(FZ),text:i(zZ)};return r;function i(s){return a;function a(o){return ZZ(r,s,o)}}}function ree(e){for(;!EL(e););return e}const g4=/[\0\t\n\r]/g;function iee(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let u,h,d,f,g;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(g4.lastIndex=d,u=g4.exec(s),f=u&&u.index!==void 0?u.index:s.length,g=s.charCodeAt(f),!u){t=s.slice(d);break}if(g===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(s.slice(d,f)),e+=f-d),g){case 0:{l.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,l.push(-2);e++<h;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const see=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function oee(e){return e.replace(see,aee)}function aee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return wL(n.slice(s?2:1),s?16:10)}return $S(n)||e}const NL={}.hasOwnProperty;function lee(e,t,n){return typeof t!="string"&&(n=t,t=void 0),cee(n)(ree(nee(n).document().write(iee()(e,t,!0))))}function cee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ae),autolinkProtocol:T,autolinkEmail:T,atxHeading:s(le),blockQuote:s(U),characterEscape:T,characterReference:T,codeFenced:s(X),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(X,a),codeText:s(q,a),codeTextData:T,data:T,codeFlowValue:T,definition:s(ne),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(te),hardBreakEscape:s(xe),hardBreakTrailing:s(xe),htmlFlow:s(ie,a),htmlFlowData:T,htmlText:s(ie,a),htmlTextData:T,image:s(Te),label:a,link:s(Ae),listItem:s(we),listItemValue:f,listOrdered:s(be,d),listUnordered:s(be),paragraph:s(_e),reference:F,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(le),strong:s(de),thematicBreak:s(me)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:V,autolinkProtocol:$,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:J,characterReference:W,codeFenced:l(v),codeFencedFence:x,codeFencedFenceInfo:g,codeFencedFenceMeta:b,codeFlowValue:A,codeIndented:l(m),codeText:l(O),codeTextData:A,data:A,definition:l(),definitionDestinationString:_,definitionLabelString:p,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(L),htmlFlowData:A,htmlText:l(N),htmlTextData:A,image:l(z),label:j,labelText:P,lineEnding:M,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:G,resourceDestinationString:R,resourceTitleString:I,resource:H,setextHeading:l(k),setextHeadingLineSequence:E,setextHeadingText:S,strong:l(),thematicBreak:l()}};DL(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let Q={type:"root",children:[]};const re={stack:[Q],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:h,data:n},ce=[];let ve=-1;for(;++ve<K.length;)if(K[ve][1].type==="listOrdered"||K[ve][1].type==="listUnordered")if(K[ve][0]==="enter")ce.push(ve);else{const ge=ce.pop();ve=i(K,ge,ve)}for(ve=-1;++ve<K.length;){const ge=t[K[ve][0]];NL.call(ge,K[ve][1].type)&&ge[K[ve][1].type].call(Object.assign({sliceSerialize:K[ve][2].sliceSerialize},re),K[ve][1])}if(re.tokenStack.length>0){const ge=re.tokenStack[re.tokenStack.length-1];(ge[1]||v4).call(re,void 0,ge[0])}for(Q.position={start:Qs(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Qs(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},ve=-1;++ve<t.transforms.length;)Q=t.transforms[ve](Q)||Q;return Q}function i(K,Q,re){let ce=Q-1,ve=-1,ge=!1,pe,Ue,Fe,He;for(;++ce<=re;){const $e=K[ce];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?ve++:ve--,He=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(pe&&!He&&!ve&&!Fe&&(Fe=ce),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!ve&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||ve===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(pe){let dt=ce;for(Ue=void 0;dt--;){const Ee=K[dt];if(Ee[1].type==="lineEnding"||Ee[1].type==="lineEndingBlank"){if(Ee[0]==="exit")continue;Ue&&(K[Ue][1].type="lineEndingBlank",ge=!0),Ee[1].type="lineEnding",Ue=dt}else if(!(Ee[1].type==="linePrefix"||Ee[1].type==="blockQuotePrefix"||Ee[1].type==="blockQuotePrefixWhitespace"||Ee[1].type==="blockQuoteMarker"||Ee[1].type==="listItemIndent"))break}Fe&&(!Ue||Fe<Ue)&&(pe._spread=!0),pe.end=Object.assign({},Ue?K[Ue][1].start:$e[1].end),K.splice(Ue||ce,0,["exit",pe,$e[2]]),ce++,re++}if($e[1].type==="listItemPrefix"){const dt={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};pe=dt,K.splice(ce,0,["enter",dt,$e[2]]),ce++,re++,Fe=void 0,He=!0}}}return K[Q][1]._spread=ge,re}function s(K,Q){return re;function re(ce){o.call(this,K(ce),ce),Q&&Q.call(this,ce)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(K,Q,re){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([Q,re||void 0]),K.position={start:Qs(Q.start),end:void 0}}function l(K){return Q;function Q(re){K&&K.call(this,re),u.call(this,re)}}function u(K,Q){const re=this.stack.pop(),ce=this.tokenStack.pop();if(ce)ce[0].type!==K.type&&(Q?Q.call(this,K,ce[0]):(ce[1]||v4).call(this,K,ce[0]));else throw new Error("Cannot close `"+K.type+"` ("+$d({start:K.start,end:K.end})+"): it’s not open");re.position.end=Qs(K.end)}function h(){return IS(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(K){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function g(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=K}function b(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=K}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.value=K.replace(/(\r?\n|\r)$/g,"")}function p(K){const Q=this.resume(),re=this.stack[this.stack.length-1];re.label=Q,re.identifier=Si(this.sliceSerialize(K)).toLowerCase()}function y(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.title=K}function _(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.url=K}function C(K){const Q=this.stack[this.stack.length-1];if(!Q.depth){const re=this.sliceSerialize(K).length;Q.depth=re}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function E(K){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function T(K){const re=this.stack[this.stack.length-1].children;let ce=re[re.length-1];(!ce||ce.type!=="text")&&(ce=se(),ce.position={start:Qs(K.start),end:void 0},re.push(ce)),this.stack.push(ce)}function A(K){const Q=this.stack.pop();Q.value+=this.sliceSerialize(K),Q.position.end=Qs(K.end)}function M(K){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const re=Q.children[Q.children.length-1];re.position.end=Qs(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(T.call(this,K),A.call(this,K))}function D(){this.data.atHardBreak=!0}function L(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.value=K}function N(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.value=K}function O(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.value=K}function B(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=Q,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function z(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=Q,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function P(K){const Q=this.sliceSerialize(K),re=this.stack[this.stack.length-2];re.label=oee(Q),re.identifier=Si(Q).toLowerCase()}function j(){const K=this.stack[this.stack.length-1],Q=this.resume(),re=this.stack[this.stack.length-1];if(this.data.inReference=!0,re.type==="link"){const ce=K.children;re.children=ce}else re.alt=Q}function R(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.url=K}function I(){const K=this.resume(),Q=this.stack[this.stack.length-1];Q.title=K}function H(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function G(K){const Q=this.resume(),re=this.stack[this.stack.length-1];re.label=Q,re.identifier=Si(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function Z(K){this.data.characterReferenceType=K.type}function J(K){const Q=this.sliceSerialize(K),re=this.data.characterReferenceType;let ce;re?(ce=wL(Q,re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ce=$S(Q);const ve=this.stack[this.stack.length-1];ve.value+=ce}function W(K){const Q=this.stack.pop();Q.position.end=Qs(K.end)}function $(K){A.call(this,K);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(K)}function V(K){A.call(this,K);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(K)}function U(){return{type:"blockquote",children:[]}}function X(){return{type:"code",lang:null,meta:null,value:""}}function q(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function te(){return{type:"emphasis",children:[]}}function le(){return{type:"heading",depth:0,children:[]}}function xe(){return{type:"break"}}function ie(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function Ae(){return{type:"link",title:null,url:"",children:[]}}function be(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function we(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function _e(){return{type:"paragraph",children:[]}}function de(){return{type:"strong",children:[]}}function se(){return{type:"text",value:""}}function me(){return{type:"thematicBreak"}}}function Qs(e){return{line:e.line,column:e.column,offset:e.offset}}function DL(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?DL(e,r):uee(e,r)}}function uee(e,t){let n;for(n in t)if(NL.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 v4(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$d({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$d({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$d({start:t.start,end:t.end})+") is still open")}function dee(e){const t=this;t.parser=n;function n(r){return lee(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hee(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 fee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function pee(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 mee(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gee(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vee(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=tu(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function xee(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 yee(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function LL(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),s=i[0];s&&s.type==="text"?s.value="["+s.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 bee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return LL(e,t);const i={src:tu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function _ee(e,t){const n={src:tu(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 wee(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 See(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return LL(e,t);const i={href:tu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Cee(e,t){const n={href:tu(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 kee(e,t,n){const r=e.all(t),i=n?Eee(n):PL(t),s={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
`}),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
`});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function Eee(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=PL(n[r])}return t}function PL(e){const t=e.spread;return t??e.children.length>1}function Tee(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 s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function Aee(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ree(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Mee(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jee(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)},o=DS(t.children[1]),l=pL(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function Nee(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l<o;){const d=t.children[l],f={},g=a?a[l]:void 0;g&&(f.align=g);let b={type:"element",tagName:s,properties:f,children:[]};d&&(b.children=e.all(d),e.patch(d,b),b=e.applyData(d,b)),u.push(b)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,h),e.applyData(t,h)}function Dee(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const x4=9,y4=32;function Lee(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(b4(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(b4(t.slice(i),i>0,!1)),s.join("")}function b4(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===x4||s===y4;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===x4||s===y4;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Pee(e,t){const n={type:"text",value:Lee(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Oee(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Iee={blockquote:hee,break:fee,code:pee,delete:mee,emphasis:gee,footnoteReference:vee,heading:xee,html:yee,imageReference:bee,image:_ee,inlineCode:wee,linkReference:See,link:Cee,listItem:kee,list:Tee,paragraph:Aee,root:Ree,strong:Mee,table:jee,tableCell:Dee,tableRow:Nee,text:Pee,thematicBreak:Oee,toml:pp,yaml:pp,definition:pp,footnoteDefinition:pp};function pp(){}const OL=-1,e0=0,gg=1,vg=2,FS=3,zS=4,HS=5,WS=6,IL=7,$L=8,_4=typeof self=="object"?self:globalThis,$ee=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case e0:case OL:return n(a,i);case gg:{const o=n([],i);for(const l of a)o.push(r(l));return o}case vg:{const o=n({},i);for(const[l,u]of a)o[r(l)]=r(u);return o}case FS:return n(new Date(a),i);case zS:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case HS:{const o=n(new Map,i);for(const[l,u]of a)o.set(r(l),r(u));return o}case WS:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case IL:{const{name:o,message:l}=a;return n(new _4[o](l),i)}case $L:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new _4[s](a),i)};return r},w4=e=>$ee(new Map,e)(0),Sl="",{toString:Bee}={},{keys:Fee}=Object,Uu=e=>{const t=typeof e;if(t!=="object"||!e)return[e0,t];const n=Bee.call(e).slice(8,-1);switch(n){case"Array":return[gg,Sl];case"Object":return[vg,Sl];case"Date":return[FS,Sl];case"RegExp":return[zS,Sl];case"Map":return[HS,Sl];case"Set":return[WS,Sl]}return n.includes("Array")?[gg,n]:n.includes("Error")?[IL,n]:[vg,n]},mp=([e,t])=>e===e0&&(t==="function"||t==="symbol"),zee=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=Uu(a);switch(o){case e0:{let h=a;switch(l){case"bigint":o=$L,h=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([OL],a)}return i([o,h],a)}case gg:{if(l)return i([l,[...a]],a);const h=[],d=i([o,h],a);for(const f of a)h.push(s(f));return d}case vg:{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 s(a.toJSON());const h=[],d=i([o,h],a);for(const f of Fee(a))(e||!mp(Uu(a[f])))&&h.push([s(f),s(a[f])]);return d}case FS:return i([o,a.toISOString()],a);case zS:{const{source:h,flags:d}=a;return i([o,{source:h,flags:d}],a)}case HS:{const h=[],d=i([o,h],a);for(const[f,g]of a)(e||!(mp(Uu(f))||mp(Uu(g))))&&h.push([s(f),s(g)]);return d}case WS:{const h=[],d=i([o,h],a);for(const f of a)(e||!mp(Uu(f)))&&h.push(s(f));return d}}const{message:u}=a;return i([o,{name:l,message:u}],a)};return s},S4=(e,{json:t,lossy:n}={})=>{const r=[];return zee(!(t||n),!!t,new Map,r)(e),r},xg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?w4(S4(e,t)):structuredClone(e):(e,t)=>w4(S4(e,t));function Hee(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 Wee(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Uee(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Hee,r=e.options.footnoteBackLabel||Wee,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const h=e.all(u),d=String(u.identifier).toUpperCase(),f=tu(d.toLowerCase());let g=0;const b=[],x=e.footnoteCounts.get(d);for(;x!==void 0&&++g<=x;){b.length>0&&b.push({type:"text",value:" "});let p=typeof n=="string"?n:n(l,g);typeof p=="string"&&(p={type:"text",value:p}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,g),className:["data-footnote-backref"]},children:Array.isArray(p)?p:[p]})}const v=h[h.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const p=v.children[v.children.length-1];p&&p.type==="text"?p.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...b)}else h.push(...b);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(h,!0)};e.patch(u,m),o.push(m)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...xg(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
`}]}}const t0=function(e){if(e==null)return Kee;if(typeof e=="function")return n0(e);if(typeof e=="object")return Array.isArray(e)?Vee(e):qee(e);if(typeof e=="string")return Gee(e);throw new Error("Expected function, string, or object as test")};function Vee(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=t0(e[n]);return n0(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function qee(e){const t=e;return n0(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function Gee(e){return n0(t);function t(n){return n&&n.type===e}}function n0(e){return t;function t(n,r,i){return!!(Yee(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Kee(){return!0}function Yee(e){return e!==null&&typeof e=="object"&&"type"in e}const BL=[],Xee=!0,u_=!1,Jee="skip";function FL(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=t0(i),a=r?-1:1;o(e,void 0,[])();function o(l,u,h){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const g=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(g?"<"+g+">":""))+")"})}return f;function f(){let g=BL,b,x,v;if((!t||s(l,u,h[h.length-1]||void 0))&&(g=Qee(n(l,h)),g[0]===u_))return g;if("children"in l&&l.children){const m=l;if(m.children&&g[0]!==Jee)for(x=(r?m.children.length:-1)+a,v=h.concat(m);x>-1&&x<m.children.length;){const p=m.children[x];if(b=o(p,x,v)(),b[0]===u_)return b;x=typeof b[1]=="number"?b[1]:x+a}}return g}}}function Qee(e){return Array.isArray(e)?e:typeof e=="number"?[Xee,e]:e==null?BL:[e]}function US(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),FL(e,s,o,i);function o(l,u){const h=u[u.length-1],d=h?h.children.indexOf(l):void 0;return a(l,d,h)}}const d_={}.hasOwnProperty,Zee={};function ete(e,t){const n=t||Zee,r=new Map,i=new Map,s=new Map,a={...Iee,...n.handlers},o={all:u,applyData:nte,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:tte,wrap:ite};return US(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?r:i,f=String(h.identifier).toUpperCase();d.has(f)||d.set(f,h)}}),o;function l(h,d){const f=h.type,g=o.handlers[f];if(d_.call(o.handlers,f)&&g)return g(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in h){const{children:x,...v}=h,m=xg(v);return m.children=o.all(h),m}return xg(h)}return(o.options.unknownHandler||rte)(o,h,d)}function u(h){const d=[];if("children"in h){const f=h.children;let g=-1;for(;++g<f.length;){const b=o.one(f[g],h);if(b){if(g&&f[g-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=C4(b.value)),!Array.isArray(b)&&b.type==="element")){const x=b.children[0];x&&x.type==="text"&&(x.value=C4(x.value))}Array.isArray(b)?d.push(...b):d.push(b)}}}return d}}function tte(e,t){e.position&&(t.position=zJ(e))}function nte(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=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"&&s&&Object.assign(n.properties,xg(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function rte(e,t){const n=t.data||{},r="value"in t&&!(d_.call(n,"hProperties")||d_.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 ite(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 C4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function k4(e,t){const n=ete(e,t),r=n.one(e,void 0),i=Uee(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function ste(e,t){return e&&"run"in e?async function(n,r){const i=k4(n,{file:r,...t});await e.run(i,r)}:function(n,r){return k4(n,{file:r,...e||t})}}function E4(e){if(e)throw e}var mm=Object.prototype.hasOwnProperty,zL=Object.prototype.toString,T4=Object.defineProperty,A4=Object.getOwnPropertyDescriptor,R4=function(t){return typeof Array.isArray=="function"?Array.isArray(t):zL.call(t)==="[object Array]"},M4=function(t){if(!t||zL.call(t)!=="[object Object]")return!1;var n=mm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&mm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||mm.call(t,i)},j4=function(t,n){T4&&n.name==="__proto__"?T4(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},N4=function(t,n){if(n==="__proto__")if(mm.call(t,n)){if(A4)return A4(t,n).value}else return;return t[n]},ote=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,u=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=N4(o,n),i=N4(t,n),o!==i&&(h&&i&&(M4(i)||(s=R4(i)))?(s?(s=!1,a=r&&R4(r)?r:[]):a=r&&M4(r)?r:{},j4(o,{name:n,newValue:e(h,a,i)})):typeof i<"u"&&j4(o,{name:n,newValue:i}));return o};const Fx=Rn(ote);function h_(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 ate(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...u){const h=e[++s];let d=-1;if(l){a(l);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,h?lte(h,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function lte(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(u){const h=u;if(o&&n)throw h;return i(h)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const $i={basename:cte,dirname:ute,extname:dte,join:hte,sep:"/"};function cte(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');uf(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function ute(e){if(uf(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 dte(e){uf(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function hte(...e){let t=-1,n;for(;++t<e.length;)uf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":fte(n)}function fte(e){uf(e);const t=e.codePointAt(0)===47;let n=pte(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pte(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===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,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=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,s=0}else o===46&&s>-1?s++:s=-1}return n}function uf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mte={cwd:gte};function gte(){return"/"}function f_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function vte(e){if(typeof e=="string")e=new URL(e);else if(!f_(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 xte(e)}function xte(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 zx=["history","path","basename","stem","extname","dirname"];class HL{constructor(t){let n;t?f_(t)?n={path:t}:typeof t=="string"||yte(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":mte.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<zx.length;){const s=zx[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)zx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$i.basename(this.path):void 0}set basename(t){Wx(t,"basename"),Hx(t,"basename"),this.path=$i.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$i.dirname(this.path):void 0}set dirname(t){D4(this.basename,"dirname"),this.path=$i.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$i.extname(this.path):void 0}set extname(t){if(Hx(t,"extname"),D4(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=$i.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){f_(t)&&(t=vte(t)),Wx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$i.basename(this.path,this.extname):void 0}set stem(t){Wx(t,"stem"),Hx(t,"stem"),this.path=$i.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 Yn(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 Hx(e,t){if(e&&e.includes($i.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$i.sep+"`")}function Wx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function D4(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function yte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bte=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},_te={}.hasOwnProperty;class VS extends bte{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=ate()}copy(){const t=new VS;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Fx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(qx("data",this.frozen),this.namespace[t]=n,this):_te.call(this.namespace,t)&&this.namespace[t]||void 0:t?(qx("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=gp(t),r=this.parser||this.Parser;return Ux("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ux("process",this.parser||this.Parser),Vx("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=gp(t),l=r.parse(o);r.run(l,o,function(h,d,f){if(h||!d||!f)return u(h);const g=d,b=r.stringify(g,f);Cte(b)?f.value=b:f.result=b,u(h,f)});function u(h,d){h||!d?a(h):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Ux("processSync",this.parser||this.Parser),Vx("processSync",this.compiler||this.Compiler),this.process(t,i),P4("processSync","process",n),r;function i(s,a){n=!0,E4(s),r=a}}run(t,n,r){L4(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=gp(n);i.run(t,l,u);function u(h,d,f){const g=d||t;h?o(h):a?a(g):r(void 0,g,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),P4("runSync","run",r),i;function s(a,o){E4(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=gp(n),i=this.compiler||this.Compiler;return Vx("stringify",i),L4(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(qx("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[h,...d]=u;l(h,d)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))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");o(u.plugins),u.settings&&(i.settings=Fx(!0,i.settings,u.settings))}function o(u){let h=-1;if(u!=null)if(Array.isArray(u))for(;++h<u.length;){const d=u[h];s(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,h){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===u){f=d;break}if(f===-1)r.push([u,...h]);else if(h.length>0){let[g,...b]=h;const x=r[f][1];h_(x)&&h_(g)&&(g=Fx(!0,x,g)),r[f]=[u,g,...b]}}}}const wte=new VS().freeze();function Ux(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Vx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qx(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 L4(e){if(!h_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function P4(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function gp(e){return Ste(e)?e:new HL(e)}function Ste(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Cte(e){return typeof e=="string"||kte(e)}function kte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ete="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",O4=[],I4={allowDangerousHtml:!0},Tte=/^(https?|ircs?|mailto|xmpp)$/i,Ate=[{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 Rte(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,a=e.disallowedElements,o=e.rehypePlugins||O4,l=e.remarkPlugins||O4,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...I4}:I4,h=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||Mte,g=wte().use(dee).use(l).use(ste,u).use(o),b=new HL;typeof r=="string"&&(b.value=r);for(const p of Ate)Object.hasOwn(e,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Ete+p.id,void 0);const x=g.parse(b);let v=g.runSync(x,b);return i&&(v={type:"element",tagName:"div",properties:{className:i},children:v.type==="root"?v.children:[v]}),US(v,m),GJ(v,{Fragment:c.Fragment,components:s,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function m(p,y,_){if(p.type==="raw"&&_&&typeof y=="number")return h?_.children.splice(y,1):_.children[y]={type:"text",value:p.value},y;if(p.type==="element"){let C;for(C in Ix)if(Object.hasOwn(Ix,C)&&Object.hasOwn(p.properties,C)){const S=p.properties[C],E=Ix[C];(E===null||E.includes(p.tagName))&&(p.properties[C]=f(String(S||""),C,p))}}if(p.type==="element"){let C=t?!t.includes(p.tagName):a?a.includes(p.tagName):!1;if(!C&&n&&typeof y=="number"&&(C=!n(p,y,_)),C&&_&&typeof y=="number")return d&&p.children?_.children.splice(y,1,...p.children):_.children.splice(y,1),y}}}function Mte(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||Tte.test(e.slice(0,t))?e:""}function $4(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function jte(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Nte(e,t,n){const i=t0(n.ignore||[]),s=Dte(t);let a=-1;for(;++a<s.length;)FL(e,"text",o);function o(u,h){let d=-1,f;for(;++d<h.length;){const g=h[d],b=f?f.children:void 0;if(i(g,b?b.indexOf(g):void 0,f))return;f=g}if(f)return l(u,h)}function l(u,h){const d=h[h.length-1],f=s[a][0],g=s[a][1];let b=0;const v=d.children.indexOf(u);let m=!1,p=[];f.lastIndex=0;let y=f.exec(u.value);for(;y;){const _=y.index,C={index:y.index,input:y.input,stack:[...h,u]};let S=g(...y,C);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?f.lastIndex=_+1:(b!==_&&p.push({type:"text",value:u.value.slice(b,_)}),Array.isArray(S)?p.push(...S):S&&p.push(S),b=_+y[0].length,m=!0),!f.global)break;y=f.exec(u.value)}return m?(b<u.value.length&&p.push({type:"text",value:u.value.slice(b)}),d.children.splice(v,1,...p)):p=[u],v+p.length}}function Dte(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Lte(i[0]),Pte(i[1])])}return t}function Lte(e){return typeof e=="string"?new RegExp(jte(e),"g"):e}function Pte(e){return typeof e=="function"?e:function(){return e}}const Gx="phrasing",Kx=["autolink","link","image","label"];function Ote(){return{transforms:[Wte],enter:{literalAutolink:$te,literalAutolinkEmail:Yx,literalAutolinkHttp:Yx,literalAutolinkWww:Yx},exit:{literalAutolink:Hte,literalAutolinkEmail:zte,literalAutolinkHttp:Bte,literalAutolinkWww:Fte}}}function Ite(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gx,notInConstruct:Kx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gx,notInConstruct:Kx},{character:":",before:"[ps]",after:"\\/",inConstruct:Gx,notInConstruct:Kx}]}}function $te(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Yx(e){this.config.enter.autolinkProtocol.call(this,e)}function Bte(e){this.config.exit.autolinkProtocol.call(this,e)}function Fte(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function zte(e){this.config.exit.autolinkEmail.call(this,e)}function Hte(e){this.exit(e)}function Wte(e){Nte(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ute],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Vte]],{ignore:["link","linkReference"]})}function Ute(e,t,n,r,i){let s="";if(!WL(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!qte(n)))return!1;const a=Gte(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function Vte(e,t,n,r){return!WL(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function qte(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Gte(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=$4(e,"(");let s=$4(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function WL(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Pa(n)||Qv(n))&&(!t||n!==47)}UL.peek=nne;function Kte(){this.buffer()}function Yte(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Xte(){this.buffer()}function Jte(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Qte(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Si(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Zte(e){this.exit(e)}function ene(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Si(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tne(e){this.exit(e)}function nne(){return"["}function UL(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function rne(){return{enter:{gfmFootnoteCallString:Kte,gfmFootnoteCall:Yte,gfmFootnoteDefinitionLabelString:Xte,gfmFootnoteDefinition:Jte},exit:{gfmFootnoteCallString:Qte,gfmFootnoteCall:Zte,gfmFootnoteDefinitionLabelString:ene,gfmFootnoteDefinition:tne}}}function ine(e){let t=!1;return e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:UL},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const u=s.enter("footnoteDefinition"),h=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),h(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?VL:sne))),u(),l}}function sne(e,t,n){return t===0?e:VL(e,t,n)}function VL(e,t,n){return(n?"":"    ")+e}const one=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qL.peek=dne;function ane(){return{canContainEols:["delete"],enter:{strikethrough:cne},exit:{strikethrough:une}}}function lne(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:one}],handlers:{delete:qL}}}function cne(e){this.enter({type:"delete",children:[]},e)}function une(e){this.exit(e)}function qL(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function dne(){return"~"}function hne(e){return e.length}function fne(e,t){const n=t,r=(n.align||[]).concat(),i=n.stringLength||hne,s=[],a=[],o=[],l=[];let u=0,h=-1;for(;++h<e.length;){const x=[],v=[];let m=-1;for(e[h].length>u&&(u=e[h].length);++m<e[h].length;){const p=pne(e[h][m]);if(n.alignDelimiters!==!1){const y=i(p);v[m]=y,(l[m]===void 0||y>l[m])&&(l[m]=y)}x.push(p)}a[h]=x,o[h]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<u;)s[d]=B4(r[d]);else{const x=B4(r);for(;++d<u;)s[d]=x}d=-1;const f=[],g=[];for(;++d<u;){const x=s[d];let v="",m="";x===99?(v=":",m=":"):x===108?v=":":x===114&&(m=":");let p=n.alignDelimiters===!1?1:Math.max(1,l[d]-v.length-m.length);const y=v+"-".repeat(p)+m;n.alignDelimiters!==!1&&(p=v.length+p+m.length,p>l[d]&&(l[d]=p),g[d]=p),f[d]=y}a.splice(1,0,f),o.splice(1,0,g),h=-1;const b=[];for(;++h<a.length;){const x=a[h],v=o[h];d=-1;const m=[];for(;++d<u;){const p=x[d]||"";let y="",_="";if(n.alignDelimiters!==!1){const C=l[d]-(v[d]||0),S=s[d];S===114?y=" ".repeat(C):S===99?C%2?(y=" ".repeat(C/2+.5),_=" ".repeat(C/2-.5)):(y=" ".repeat(C/2),_=y):_=" ".repeat(C)}n.delimiterStart!==!1&&!d&&m.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&p==="")&&(n.delimiterStart!==!1||d)&&m.push(" "),n.alignDelimiters!==!1&&m.push(y),m.push(p),n.alignDelimiters!==!1&&m.push(_),n.padding!==!1&&m.push(" "),(n.delimiterEnd!==!1||d!==u-1)&&m.push("|")}b.push(n.delimiterEnd===!1?m.join("").replace(/ +$/,""):m.join(""))}return b.join(`
`)}function pne(e){return e==null?"":String(e)}function B4(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function mne(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),gne);return i(),a}function gne(e,t,n){return">"+(n?"":" ")+e}function vne(e,t){return F4(e,t.inConstruct,!0)&&!F4(e,t.notInConstruct,!1)}function F4(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function z4(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&vne(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function xne(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function yne(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function bne(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function _ne(e,t,n,r){const i=bne(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(yne(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(s,wne);return d(),f}const o=n.createTracker(r),l=i.repeat(Math.max(xne(s,i)+1,3)),u=n.enter("codeFenced");let h=o.move(l);if(e.lang){const d=n.enter(`codeFencedLang${a}`);h+=o.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);h+=o.move(" "),h+=o.move(n.safe(e.meta,{before:h,after:`
`,encode:["`"],...o.current()})),d()}return h+=o.move(`
`),s&&(h+=o.move(s+`
`)),h+=o.move(l),u(),h}function wne(e,t,n){return(n?"":"    ")+e}function qS(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Sne(e,t,n,r){const i=qS(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
`,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),a(),u}function Cne(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function gh(e){return"&#x"+e.toString(16).toUpperCase()+";"}function yg(e,t,n){const r=Ac(e),i=Ac(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}GL.peek=kne;function GL(e,t,n,r){const i=Cne(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),h=yg(r.before.charCodeAt(r.before.length-1),u,i);h.inside&&(l=gh(u)+l.slice(1));const d=l.charCodeAt(l.length-1),f=yg(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+gh(d));const g=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},o+l+g}function kne(e,t,n){return n.options.emphasis||"*"}function Ene(e,t){let n=!1;return US(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,u_}),!!((!e.depth||e.depth<3)&&IS(e)&&(t.options.setext||n))}function Tne(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(Ene(e,n)){const h=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
`,after:`
`});return d(),h(),f+`
`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
`,...s.current()});return/^[\t ]/.test(u)&&(u=gh(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}KL.peek=Ane;function KL(e){return e.value||""}function Ane(){return"<"}YL.peek=Rne;function YL(e,t,n,r){const i=qS(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),a(),u}function Rne(){return"!"}XL.peek=Mne;function XL(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=h,s(),i==="full"||!u||u!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Mne(){return"!"}JL.peek=jne;function JL(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function jne(){return"`"}function QL(e,t){const n=IS(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ZL.peek=Nne;function ZL(e,t,n,r){const i=qS(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(QL(e,n)){const h=n.stack;n.stack=[],o=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),n.stack=h,d}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),o(),u}function Nne(e,t,n){return QL(e,n)?"<":"["}e8.peek=Dne;function e8(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=h,s(),i==="full"||!u||u!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Dne(){return"["}function GS(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Lne(e){const t=GS(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Pne(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function t8(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function One(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?Pne(n):GS(n);const o=e.ordered?a==="."?")":".":Lne(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),t8(n)===a&&h){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function Ine(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function $ne(e,t,n,r){const i=Ine(n);let s=n.bulletCurrent||GS(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),h);return l(),u;function h(d,f,g){return f?(g?"":" ".repeat(a))+d:(g?s:s+" ".repeat(a-s.length))+d}}function Bne(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const Fne=t0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function zne(e,t,n,r){return(e.children.some(function(a){return Fne(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Hne(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}n8.peek=Wne;function n8(e,t,n,r){const i=Hne(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),h=yg(r.before.charCodeAt(r.before.length-1),u,i);h.inside&&(l=gh(u)+l.slice(1));const d=l.charCodeAt(l.length-1),f=yg(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+gh(d));const g=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},o+l+g}function Wne(e,t,n){return n.options.strong||"*"}function Une(e,t,n,r){return n.safe(e.value,r)}function Vne(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function qne(e,t,n){const r=(t8(n)+(n.options.ruleSpaces?" ":"")).repeat(Vne(n));return n.options.ruleSpaces?r.slice(0,-1):r}const r8={blockquote:mne,break:z4,code:_ne,definition:Sne,emphasis:GL,hardBreak:z4,heading:Tne,html:KL,image:YL,imageReference:XL,inlineCode:JL,link:ZL,linkReference:e8,list:One,listItem:$ne,paragraph:Bne,root:zne,strong:n8,text:Une,thematicBreak:qne};function Gne(){return{enter:{table:Kne,tableData:H4,tableHeader:H4,tableRow:Xne},exit:{codeText:Jne,table:Yne,tableData:Xx,tableHeader:Xx,tableRow:Xx}}}function Kne(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Yne(e){this.exit(e),this.data.inTable=void 0}function Xne(e){this.enter({type:"tableRow",children:[]},e)}function Xx(e){this.exit(e)}function H4(e){this.enter({type:"tableCell",children:[]},e)}function Jne(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Qne));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Qne(e,t){return t==="|"?t:e}function Zne(e){const t=e,n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:a,tableCell:l,tableRow:o}};function a(g,b,x,v){return u(h(g,x,v),g.align)}function o(g,b,x,v){const m=d(g,x,v),p=u([m]);return p.slice(0,p.indexOf(`
`))}function l(g,b,x,v){const m=x.enter("tableCell"),p=x.enter("phrasing"),y=x.containerPhrasing(g,{...v,before:s,after:s});return p(),m(),y}function u(g,b){return fne(g,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function h(g,b,x){const v=g.children;let m=-1;const p=[],y=b.enter("table");for(;++m<v.length;)p[m]=d(v[m],b,x);return y(),p}function d(g,b,x){const v=g.children;let m=-1;const p=[],y=b.enter("tableRow");for(;++m<v.length;)p[m]=l(v[m],g,b,x);return y(),p}function f(g,b,x){let v=r8.inlineCode(g,b,x);return x.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function ere(){return{exit:{taskListCheckValueChecked:W4,taskListCheckValueUnchecked:W4,paragraph:nre}}}function tre(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rre}}}function W4(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function nre(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function rre(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=r8.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(h){return h+a}}function ire(){return[Ote(),rne(),ane(),Gne(),ere()]}function sre(e){return{extensions:[Ite(),ine(e),lne(),Zne(e),tre()]}}const ore={tokenize:hre,partial:!0},i8={tokenize:fre,partial:!0},s8={tokenize:pre,partial:!0},o8={tokenize:mre,partial:!0},are={tokenize:gre,partial:!0},a8={name:"wwwAutolink",tokenize:ure,previous:c8},l8={name:"protocolAutolink",tokenize:dre,previous:u8},Hs={name:"emailAutolink",tokenize:cre,previous:d8},ss={};function lre(){return{text:ss}}let ia=48;for(;ia<123;)ss[ia]=Hs,ia++,ia===58?ia=65:ia===91&&(ia=97);ss[43]=Hs;ss[45]=Hs;ss[46]=Hs;ss[95]=Hs;ss[72]=[Hs,l8];ss[104]=[Hs,l8];ss[87]=[Hs,a8];ss[119]=[Hs,a8];function cre(e,t,n){const r=this;let i,s;return a;function a(d){return!p_(d)||!d8.call(r,r.previous)||KS(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return p_(d)?(e.consume(d),o):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(are,h,u)(d):d===45||d===95||Vn(d)?(s=!0,e.consume(d),l):h(d)}function u(d){return e.consume(d),i=!0,l}function h(d){return s&&i&&tr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function ure(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!c8.call(r,r.previous)||KS(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ore,e.attempt(i8,e.attempt(s8,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function dre(e,t,n){const r=this;let i="",s=!1;return a;function a(d){return(d===72||d===104)&&u8.call(r,r.previous)&&!KS(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(tr(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?u:(s=!0,l)):n(d)}function u(d){return d===null||mg(d)||Mt(d)||Pa(d)||Qv(d)?n(d):e.attempt(i8,e.attempt(s8,h),n)(d)}function h(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function hre(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function fre(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(o8,l,o)(u):u===null||Mt(u)||Pa(u)||u!==45&&Qv(u)?l(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!s?n(u):t(u)}}function pre(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(o8,t,s)(a):a===null||Mt(a)||Pa(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function mre(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||Mt(o)||Pa(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Mt(o)||Pa(o)?t(o):r(o)}function s(o){return tr(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):tr(o)?(e.consume(o),a):n(o)}}function gre(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Vn(s)?n(s):t(s)}}function c8(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Mt(e)}function u8(e){return!tr(e)}function d8(e){return!(e===47||p_(e))}function p_(e){return e===43||e===45||e===46||e===95||Vn(e)}function KS(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const vre={tokenize:kre,partial:!0};function xre(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:wre,continuation:{tokenize:Sre},exit:Cre}},text:{91:{name:"gfmFootnoteCall",tokenize:_re},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yre,resolveTo:bre}}}}function yre(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=Si(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function bre(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function _re(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(s>999||d===93&&!a||d===null||d===91||Mt(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(Si(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Mt(d)||(a=!0),s++,e.consume(d),d===92?h:u}function h(d){return d===91||d===92||d===93?(e.consume(d),s++,u):u(d)}}function wre(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(b)}function h(b){if(a>999||b===93&&!o||b===null||b===91||Mt(b))return n(b);if(b===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return s=Si(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Mt(b)||(o=!0),a++,e.consume(b),b===92?d:h}function d(b){return b===91||b===92||b===93?(e.consume(b),a++,h):h(b)}function f(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(s)||i.push(s),ut(e,g,"gfmFootnoteDefinitionWhitespace")):n(b)}function g(b){return t(b)}}function Sre(e,t,n){return e.check(cf,t,e.attempt(vre,t,n))}function Cre(e){e.exit("gfmFootnoteDefinition")}function kre(e,t,n){const r=this;return ut(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function Ere(e){let n=e.singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},f=[["enter",h,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",d,o]],g=o.parser.constructs.insideSpan.null;g&&Nr(f,f.length,0,Zv(g,a.slice(u+1,l),o)),Nr(f,f.length,0,[["exit",d,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",h,o]]),Nr(a,u-1,l-u+3,f),l=u+f.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const u=this.previous,h=this.events;let d=0;return f;function f(b){return u===126&&h[h.length-1][1].type!=="characterEscape"?l(b):(a.enter("strikethroughSequenceTemporary"),g(b))}function g(b){const x=Ac(u);if(b===126)return d>1?l(b):(a.consume(b),d++,g);if(d<2&&!n)return l(b);const v=a.exit("strikethroughSequenceTemporary"),m=Ac(b);return v._open=!m||m===2&&!!x,v._close=!x||x===2&&!!m,o(b)}}}class Tre{constructor(){this.map=[]}add(t,n,r){Are(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function Are(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Rre(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Mre(){return{flow:{null:{name:"table",tokenize:jre,resolveAll:Nre}}}}function jre(e,t,n){const r=this;let i=0,s=0,a;return o;function o(A){let M=r.events.length-1;for(;M>-1;){const N=r.events[M][1].type;if(N==="lineEnding"||N==="linePrefix")M--;else break}const D=M>-1?r.events[M][1].type:null,L=D==="tableHead"||D==="tableRow"?S:l;return L===S&&r.parser.lazy[r.now().line]?n(A):L(A)}function l(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(a=!0,s+=1),h(A)}function h(A){return A===null?n(A):De(A)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),g):n(A):et(A)?ut(e,h,"whitespace")(A):(s+=1,a&&(a=!1,i+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),d(A)))}function d(A){return A===null||A===124||Mt(A)?(e.exit("data"),h(A)):(e.consume(A),A===92?f:d)}function f(A){return A===92||A===124?(e.consume(A),d):d(A)}function g(A){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(A):(e.enter("tableDelimiterRow"),a=!1,et(A)?ut(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):b(A))}function b(A){return A===45||A===58?v(A):A===124?(a=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),x):C(A)}function x(A){return et(A)?ut(e,v,"whitespace")(A):v(A)}function v(A){return A===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),m):A===45?(s+=1,m(A)):A===null||De(A)?_(A):C(A)}function m(A){return A===45?(e.enter("tableDelimiterFiller"),p(A)):C(A)}function p(A){return A===45?(e.consume(A),p):A===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(A))}function y(A){return et(A)?ut(e,_,"whitespace")(A):_(A)}function _(A){return A===124?b(A):A===null||De(A)?!a||i!==s?C(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):C(A)}function C(A){return n(A)}function S(A){return e.enter("tableRow"),E(A)}function E(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),E):A===null||De(A)?(e.exit("tableRow"),t(A)):et(A)?ut(e,E,"whitespace")(A):(e.enter("data"),k(A))}function k(A){return A===null||A===124||Mt(A)?(e.exit("data"),E(A)):(e.consume(A),A===92?T:k)}function T(A){return A===92||A===124?(e.consume(A),k):k(A)}}function Nre(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,h,d;const f=new Tre;for(;++n<e.length;){const g=e[n],b=g[1];g[0]==="enter"?b.type==="tableHead"?(o=!1,l!==0&&(U4(f,t,l,u,h),h=void 0,l=0),u={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},f.add(n,0,[["enter",u,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},f.add(n,0,[["enter",h,t]])),i=b.type==="tableDelimiterRow"?2:h?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],d=vp(f,t,s,i,void 0,d),s=[0,0,0,0]),a[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],d=vp(f,t,s,i,void 0,d)),s=a,a=[s[1],n,0,0])):b.type==="tableHead"?(o=!0,l=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],d=vp(f,t,s,i,n,d)):a[1]!==0&&(d=vp(f,t,a,i,n,d)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&U4(f,t,l,u,h),f.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=Rre(t.events,n))}return e}function vp(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Ol(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Ol(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Ol(t.events,n[2]),h=Ol(t.events,n[3]),d={type:o,start:Object.assign({},u),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],g=t.events[n[3]];if(f[1].end=Object.assign({},g[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,x=n[3]-n[2]-1;e.add(b,x,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Ol(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function U4(e,t,n,r,i){const s=[],a=Ol(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function Ol(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Dre={name:"tasklistCheck",tokenize:Pre};function Lre(){return{text:{91:Dre}}}function Pre(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Mt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return De(l)?t(l):et(l)?e.check({tokenize:Ore},t,n)(l):n(l)}}function Ore(e,t,n){return ut(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Ire(e){return _L([lre(),xre(),Ere(e),Mre(),Lre()])}const $re={};function Bre(e){const t=this,n=e||$re,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ire(n)),s.push(ire()),a.push(sre(n))}function Be({children:e,className:t,...n}){return c.jsx("code",{className:Y("rounded-sm font-mono text-muted-foreground bg-muted px-[0.25rem]",t),...n,children:e})}const Br={bracket:"text-muted-foreground",key:"text-sky-600 dark:text-sky-300",string:"text-emerald-600 dark:text-emerald-300",number:"text-amber-600 dark:text-amber-300",boolean:"text-violet-600 dark:text-violet-300",null:"text-rose-600 dark:text-rose-300"},Fre=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}},zre=e=>typeof e=="string"?c.jsx("span",{className:Br.string,children:JSON.stringify(e)}):typeof e=="number"?c.jsx("span",{className:Br.number,children:String(e)}):typeof e=="boolean"?c.jsx("span",{className:Br.boolean,children:String(e)}):c.jsx("span",{className:Br.null,children:"null"}),m_=(e,t=0,n="root")=>{if(Array.isArray(e))return e.length===0?c.jsx("span",{className:Br.bracket,children:"[]"}):c.jsxs(w.Fragment,{children:[c.jsx("span",{className:Br.bracket,children:"["}),`
`,e.map((r,i)=>c.jsxs(w.Fragment,{children:["  ".repeat(t+1),m_(r,t+1,`${n}[${i}]`),i<e.length-1?",":"",`
`]},`${n}[${i}]`)),"  ".repeat(t),c.jsx("span",{className:Br.bracket,children:"]"})]});if(e&&typeof e=="object"){const r=Object.entries(e);return r.length===0?c.jsx("span",{className:Br.bracket,children:"{}"}):c.jsxs(w.Fragment,{children:[c.jsx("span",{className:Br.bracket,children:"{"}),`
`,r.map(([i,s],a)=>c.jsxs(w.Fragment,{children:["  ".repeat(t+1),c.jsx("span",{className:Br.key,children:JSON.stringify(i)}),c.jsx("span",{className:Br.bracket,children:": "}),m_(s,t+1,`${n}.${i}`),a<r.length-1?",":"",`
`]},`${n}.${i}`)),"  ".repeat(t),c.jsx("span",{className:Br.bracket,children:"}"})]})}return zre(e)};function h8({value:e,className:t}){const n=Fre(e);return c.jsx("pre",{className:Y("whitespace-pre-wrap attempt-word-wrap font-mono text-sm leading-6",t),children:n.ok?m_(n.value):e})}function Hre({text:e}){const t=e.split(/\s+/),n=t.pop(),r=t.length?t.join(" ")+" ":null;return c.jsxs(c.Fragment,{children:[r,c.jsxs("span",{className:"whitespace-nowrap",children:[n,c.jsx(La,{className:"inline ml-1 mb-1 h-5 -mr-0.5 [.text-sm_&]:h-4 [.text-sm_&]:ml-0 [.text-sm_&]:-mr-1 [.prose-sm_&]:h-4 [.prose-sm_&]:ml-0 [.prose-sm_&]:-mr-0.5 selection:bg-inherit"})]})]})}function pn({children:e,href:t,className:n,rel:r,...i}){const s=zs()[1],a=(t==null?void 0:t.startsWith("http"))||(t==null?void 0:t.startsWith("//")),o=l=>{t&&(l.preventDefault(),a?nu(t):s(t??"/"))};return c.jsx("a",{...i,rel:r??"noopener noreferrer",href:t,className:Y("text-accent no-underline hover:underline cursor-pointer",n),onClick:o,children:a&&typeof e=="string"?c.jsx(Hre,{text:e}):e})}const Wre=[Bre],Ure=e=>{const t=e.split(`
`);let n=!1;for(let r=0;r<t.length;r++){const i=t[r];if(/^\s*(```|~~~)/.test(i)){n=!n;continue}n||i.length!==0&&(/[ \t]{2,}$/.test(i)||(t[r]=i+"  "))}return t.join(`
`)},Vre="not-prose p-2 whitespace-pre-wrap [overflow-wrap:_anywhere] break-all rounded bg-muted [.prose-toast_&]:bg-muted/65 [.prose-toast_&>code]:bg-transparent",qre="not-prose p-2 rounded bg-muted [.prose-toast_&]:bg-muted/65",Gre={code:({className:e,children:t})=>/(^|\s)language-/.test(e??"")||String(t??"").includes(`
`)?c.jsx("code",{className:e,children:t}):c.jsx(Be,{className:"not-prose [.prose-toast_&:not(pre_*)]:bg-muted/65",children:t}),pre:({children:e})=>{if(w.isValidElement(e)){const t=e.props,n=/language-(\w+)/.exec(t.className??"");if(console.log("match",n),(n==null?void 0:n[1])==="json"&&typeof t.children=="string")return c.jsx(h8,{value:t.children.replace(/\n$/,""),className:qre})}return c.jsx("pre",{className:Vre,children:e})},a:({children:e,href:t})=>c.jsx(pn,{href:t,children:e})};function g_({md:e,isSmall:t,isTitle:n,isToast:r,className:i}){const s=Ure(jK(e));return c.jsx(Rte,{remarkPlugins:Wre,components:Gre,className:Y("prose dark:prose-invert prose-zinc",t&&"prose-sm",n&&"tracking-wide",r&&"prose-toast",i),children:s})}let Kre={data:""},Yre=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||Kre,Xre=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Jre=/\/\*[^]*?\*\/|  +/g,V4=/\n+/g,uo=(e,t)=>{let n="",r="",i="";for(let s in e){let a=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+a+";":r+=s[1]=="f"?uo(a,s):s+"{"+uo(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=uo(a,t?t.replace(/([^,])+/g,o=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,o):o?o+" "+l:l)):s):a!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=uo.p?uo.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},hs={},f8=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+f8(e[n]);return t}return e},Qre=(e,t,n,r,i)=>{let s=f8(e),a=hs[s]||(hs[s]=(l=>{let u=0,h=11;for(;u<l.length;)h=101*h+l.charCodeAt(u++)>>>0;return"go"+h})(s));if(!hs[a]){let l=s!==e?e:(u=>{let h,d,f=[{}];for(;h=Xre.exec(u.replace(Jre,""));)h[4]?f.shift():h[3]?(d=h[3].replace(V4," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][h[1]]=h[2].replace(V4," ").trim();return f[0]})(e);hs[a]=uo(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let o=n&&hs.g?hs.g:null;return n&&(hs.g=hs[a]),((l,u,h,d)=>{d?u.data=u.data.replace(d,l):u.data.indexOf(l)===-1&&(u.data=h?l+u.data:u.data+l)})(hs[a],t,r,o),a},Zre=(e,t,n)=>e.reduce((r,i,s)=>{let a=t[s];if(a&&a.call){let o=a(n),l=o&&o.props&&o.props.className||/^go/.test(o)&&o;a=l?"."+l:o&&typeof o=="object"?o.props?"":uo(o,""):o===!1?"":o}return r+i+(a??"")},"");function r0(e){let t=this||{},n=e.call?e(t.p):e;return Qre(n.unshift?n.raw?Zre(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,Yre(t.target),t.g,t.o,t.k)}let p8,v_,x_;r0.bind({g:1});let Ds=r0.bind({k:1});function eie(e,t,n,r){uo.p=t,p8=e,v_=n,x_=r}function Xo(e,t){let n=this||{};return function(){let r=arguments;function i(s,a){let o=Object.assign({},s),l=o.className||i.className;n.p=Object.assign({theme:v_&&v_()},o),n.o=/ *go\d+/.test(l),o.className=r0.apply(n,r)+(l?" "+l:"");let u=e;return e[0]&&(u=o.as||e,delete o.as),x_&&u[0]&&x_(o),p8(u,o)}return i}}var tie=e=>typeof e=="function",bg=(e,t)=>tie(e)?e(t):e,nie=(()=>{let e=0;return()=>(++e).toString()})(),m8=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),rie=20,g8=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,rie)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return g8(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.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(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},gm=[],vm={toasts:[],pausedAt:void 0},tl=e=>{vm=g8(vm,e),gm.forEach(t=>{t(vm)})},iie={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},sie=(e={})=>{let[t,n]=w.useState(vm);w.useEffect(()=>(gm.push(n),()=>{let i=gm.indexOf(n);i>-1&&gm.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var s,a,o;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((s=e[i.type])==null?void 0:s.removeDelay)||(e==null?void 0:e.removeDelay),duration:i.duration||((a=e[i.type])==null?void 0:a.duration)||(e==null?void 0:e.duration)||iie[i.type],style:{...e.style,...(o=e[i.type])==null?void 0:o.style,...i.style}}});return{...t,toasts:r}},oie=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||nie()}),df=e=>(t,n)=>{let r=oie(t,e,n);return tl({type:2,toast:r}),r.id},Zn=(e,t)=>df("blank")(e,t);Zn.error=df("error");Zn.success=df("success");Zn.loading=df("loading");Zn.custom=df("custom");Zn.dismiss=e=>{tl({type:3,toastId:e})};Zn.remove=e=>tl({type:4,toastId:e});Zn.promise=(e,t,n)=>{let r=Zn.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let s=t.success?bg(t.success,i):void 0;return s?Zn.success(s,{id:r,...n,...n==null?void 0:n.success}):Zn.dismiss(r),i}).catch(i=>{let s=t.error?bg(t.error,i):void 0;s?Zn.error(s,{id:r,...n,...n==null?void 0:n.error}):Zn.dismiss(r)}),e};var aie=(e,t)=>{tl({type:1,toast:{id:e,height:t}})},lie=()=>{tl({type:5,time:Date.now()})},Fd=new Map,cie=1e3,uie=(e,t=cie)=>{if(Fd.has(e))return;let n=setTimeout(()=>{Fd.delete(e),tl({type:4,toastId:e})},t);Fd.set(e,n)},die=e=>{let{toasts:t,pausedAt:n}=sie(e);w.useEffect(()=>{if(n)return;let s=Date.now(),a=t.map(o=>{if(o.duration===1/0)return;let l=(o.duration||0)+o.pauseDuration-(s-o.createdAt);if(l<0){o.visible&&Zn.dismiss(o.id);return}return setTimeout(()=>Zn.dismiss(o.id),l)});return()=>{a.forEach(o=>o&&clearTimeout(o))}},[t,n]);let r=w.useCallback(()=>{n&&tl({type:6,time:Date.now()})},[n]),i=w.useCallback((s,a)=>{let{reverseOrder:o=!1,gutter:l=8,defaultPosition:u}=a||{},h=t.filter(g=>(g.position||u)===(s.position||u)&&g.height),d=h.findIndex(g=>g.id===s.id),f=h.filter((g,b)=>b<d&&g.visible).length;return h.filter(g=>g.visible).slice(...o?[f+1]:[0,f]).reduce((g,b)=>g+(b.height||0)+l,0)},[t]);return w.useEffect(()=>{t.forEach(s=>{if(s.dismissed)uie(s.id,s.removeDelay);else{let a=Fd.get(s.id);a&&(clearTimeout(a),Fd.delete(s.id))}})},[t]),{toasts:t,handlers:{updateHeight:aie,startPause:lie,endPause:r,calculateOffset:i}}},hie=Ds`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,fie=Ds`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,pie=Ds`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,mie=Xo("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

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

  &:after,
  &:before {
    content: '';
    animation: ${fie} 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: ${pie} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,gie=Ds`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,vie=Xo("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: ${gie} 1s linear infinite;
`,xie=Ds`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,yie=Ds`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,bie=Xo("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${xie} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${yie} 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;
  }
`,_ie=Xo("div")`
  position: absolute;
`,wie=Xo("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,Sie=Ds`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,Cie=Xo("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${Sie} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,kie=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?w.createElement(Cie,null,t):t:n==="blank"?null:w.createElement(wie,null,w.createElement(vie,{...r}),n!=="loading"&&w.createElement(_ie,null,n==="error"?w.createElement(mie,{...r}):w.createElement(bie,{...r})))},Eie=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,Tie=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,Aie="0%{opacity:0;} 100%{opacity:1;}",Rie="0%{opacity:1;} 100%{opacity:0;}",Mie=Xo("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;
`,jie=Xo("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,Nie=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=m8()?[Aie,Rie]:[Eie(n),Tie(n)];return{animation:t?`${Ds(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ds(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Die=w.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?Nie(e.position||t||"top-center",e.visible):{opacity:0},s=w.createElement(kie,{toast:e}),a=w.createElement(jie,{...e.ariaProps},bg(e.message,e));return w.createElement(Mie,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):w.createElement(w.Fragment,null,s,a))});eie(w.createElement);var Lie=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=w.useCallback(a=>{if(a){let o=()=>{let l=a.getBoundingClientRect().height;r(e,l)};o(),new MutationObserver(o).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return w.createElement("div",{ref:s,className:t,style:n},i)},Pie=(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:m8()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},Oie=r0`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,xp=16,Iie=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:s,containerClassName:a})=>{let{toasts:o,handlers:l}=die(n);return w.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:xp,left:xp,right:xp,bottom:xp,pointerEvents:"none",...s},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},o.map(u=>{let h=u.position||t,d=l.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),f=Pie(h,d);return w.createElement(Lie,{id:u.id,key:u.id,onHeightUpdate:l.updateHeight,className:u.visible?Oie:"",style:f},u.type==="custom"?bg(u.message,u):i?i(u):w.createElement(Die,{toast:u,position:h}))}))},_g=Zn;const $ie=["default","loading","info","success","warning","error"],Bie=si(`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"}}),Fie={default:c.jsx(aX,{className:"stroke-muted-foreground animate-toastbar-icon"}),loading:c.jsx(qt,{className:"animate-spin"}),info:c.jsx(ES,{className:"stroke-info animate-toastbar-icon"}),success:c.jsx(oX,{className:"stroke-success animate-toastbar-icon"}),warning:c.jsx(kS,{className:"stroke-warning animate-toastbar-icon"}),error:c.jsx(IX,{className:"stroke-destructive animate-toastbar-icon"})},zie=({t:e,type:t,data:n})=>{const[r,i]=w.useState(0);return w.useEffect(()=>{let s=null;const a=()=>{s&&clearInterval(s)};return t==="loading"&&e.visible?s=setInterval(()=>{i(o=>o+1)},1e3):s&&a(),a},[t,e.visible]),c.jsxs("div",{className:Y(Bie({type:t}),e.visible?"animate-toastbar-enter":"animate-toastbar-leave"),children:[c.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:t==="loading"&&r>5?c.jsx("div",{className:"min-w-[2.65rem] text-center bg-muted/75 rounded-full",children:c.jsxs("span",{className:"text-xs text-secondary-foreground",children:[r,"s"]})}):Fie[t]}),c.jsxs("div",{className:"flex-grow",children:[typeof n=="string"?c.jsx("span",{className:"block whitespace-pre-line",children:n}):n.md?c.jsxs(c.Fragment,{children:[n.title?c.jsx(g_,{md:`**${n.title}**`,isSmall:!0,isTitle:!0,isToast:!0}):null,c.jsx(g_,{md:n.msg,isSmall:!0,isToast:!0})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-semibold mb-1",children:n.title}),c.jsx("span",{className:"block whitespace-pre-line",children:n.msg})]}),t==="error"&&c.jsxs("small",{className:"block text-xs tracking-wide text-muted-foreground",children:["For support, visit ",c.jsx("a",{href:"https://discord.gg/uAmsGa2",target:"_blank",onClick:ZS,className:"font-semibold no-underline hover:underline m-0",children:"discord.gg/txAdmin"}),"."]})]}),c.jsxs("button",{onClick:()=>_g.dismiss(e.id),className:"absolute right-4 top-4 opacity-70",children:[c.jsx(Kn,{className:"h-6 sm:w-6 md:h-5 md:w-5"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})};function Hie(){return c.jsx(Iie,{reverseOrder:!0,containerStyle:{top:"var(--content-offset)",zIndex:60}})}const la=(e,t,n={})=>{const i=(typeof t=="string"?t:t.msg).split(/\s+/).length;let s;return i<15?s=5e3:i<25?s=7500:i<50?s=1e4:s=15e3,n.duration??(n.duration=e==="loading"?1/0:s),_g.custom(a=>c.jsx(zie,{t:a,type:e,data:t}),n)},Wie=(e,t)=>la(e.type,e,t),ze=Object.assign(Wie,{default:(e,t)=>la("default",e,t),loading:(e,t)=>la("loading",e,t),info:(e,t)=>la("info",e,t),success:(e,t)=>la("success",e,t),warning:(e,t)=>la("warning",e,t),error:(e,t)=>la("error",e,t),dismiss:_g.dismiss,remove:_g.remove});var wg={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 v8(e){var t=function(r,i){var s=G4({},t,i||{});return Vie(r,s)};return G4(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 i0=v8({});function Uie(e){var t=[e.language];if(Yi(e,"fallbacks"))if(qie(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(Yi(e.languages,r))return e.languages[r];if(Yi(wg,r))return wg[r]}throw new Error("No language found.")}function Vie(e,t){var n,r,i;e=Math.abs(e);var s=Uie(t),a=[],o,l,u;for(n=0,r=t.units.length;n<r;n++){if(o=t.units[n],l=t.unitMeasures[o],n+1===r)if(Yi(t,"maxDecimalPoints")){var h=Math.pow(10,t.maxDecimalPoints),d=e/l;u=parseFloat((Math.floor(h*d)/h).toFixed(t.maxDecimalPoints))}else u=e/l;else u=Math.floor(e/l);a.push({unitCount:u,unitName:o}),e-=u*l}var f=0;for(n=0;n<a.length;n++)if(a[n].unitCount){f=n;break}if(t.round){var g,b;for(n=a.length-1;n>=0&&(i=a[n],i.unitCount=Math.round(i.unitCount),n!==0);n--)b=a[n-1],g=t.unitMeasures[b.unitName]/t.unitMeasures[i.unitName],(i.unitCount%g===0||t.largest&&t.largest-1<n-f)&&(b.unitCount+=i.unitCount/g,i.unitCount=0)}var x=[];for(n=0,a.length;n<r&&(i=a[n],i.unitCount&&x.push(q4(i.unitCount,i.unitName,s,t)),x.length!==t.largest);n++);if(x.length){var v;if(Yi(t,"delimiter")?v=t.delimiter:Yi(s,"delimiter")?v=s.delimiter:v=", ",!t.conjunction||x.length===1)return x.join(v);if(x.length===2)return x.join(t.conjunction);if(x.length>2)return x.slice(0,-1).join(v)+(t.serialComma?",":"")+t.conjunction+x.slice(-1)}else return q4(0,t.units[t.units.length-1],s,t)}function q4(e,t,n,r){var i;Yi(r,"decimal")?i=r.decimal:Yi(n,"decimal")?i=n.decimal:i=".";var s;typeof n._formatCount=="function"?s=n._formatCount(e,i):s=e.toString().replace(".",i);var a=n[t],o;return typeof a=="function"?o=a(e):o=a,n._numberFirst?o+r.spacer+s:s+r.spacer+o}function G4(e){for(var t,n=1;n<arguments.length;n++){t=arguments[n];for(var r in t)Yi(t,r)&&(e[r]=t[r])}return e}var qie=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function Yi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}i0.getSupportedLanguages=function(){var t=[];for(var n in wg)Yi(wg,n)&&n!=="gr"&&t.push(n);return t};i0.humanizer=v8;const Gie=new Date().getFullYear(),Sg=i0.humanizer({round:!0,fallbacks:["en"]}),hf=i0.humanizer({round:!0,spacer:"",language:"shortEn",fallbacks:["en"]}),s0=e=>new Date(e<1e10?e*1e3:e),Rc=(e,t="2-digit",n="2-digit",r,i)=>e.toLocaleTimeString(window.txBrowserLocale,{hour:t,minute:n,second:r,hour12:i}),Kie=(e,t="2-digit",n="2-digit",r,i)=>Rc(s0(e),t,n,r,i),Mc=(e,t="long")=>e.toLocaleDateString(window.txBrowserLocale,{dateStyle:t}),x8=(e,t="long")=>Mc(s0(e),t),Yie=(e,t="long",n="medium")=>e.toLocaleString(window.txBrowserLocale,{dateStyle:t,timeStyle:n}),ws=(e,t="long",n="medium")=>Yie(s0(e),t,n),vh=e=>{const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},y_=e=>{const t=s0(e),n=t.getFullYear()!==Gie;return t.toLocaleString(window.txBrowserLocale,{year:n?"numeric":void 0,month:n?"numeric":"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})},Xie="https://monitor/WebPipe",Jie=`txAdminPanel/v${window.txConsts.txaVersion} (atop FXServer/b${window.txConsts.fxsVersion})`,y8={"Content-Type":"application/json; charset=UTF-8",Accept:"application/json"};var xh=(e=>(e[e.DEFAULT=7500]="DEFAULT",e[e.LONG=15e3]="LONG",e[e.REALLY_LONG=3e4]="REALLY_LONG",e[e.REALLY_REALLY_LONG=45e3]="REALLY_REALLY_LONG",e))(xh||{});class b_ extends Error{constructor(n,r){super();_l(this,"title");_l(this,"message");this.title=n,this.message=r}}const b8=()=>{const e=Fse(),t=oC();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=Xie+n),r.method??(r.method="GET");const a=await(await fetch(n,{method:r.method,headers:{...y8,"User-Agent":Jie,"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("useAuthedFetcher",(a==null?void 0:a.reason)??"unknown"),new Error("Session expired");return a}},Oo=async(e,t={})=>{const n=t.method??"GET",r=n==="POST"&&t.body?JSON.stringify(t.body):void 0;return await(await fetch(e,{headers:y8,signal:AbortSignal.timeout(t.timeout??7500),...t,method:n,body:r})).json()},K4=void 0,bt=e=>{const t=w.useRef(void 0),n=w.useRef(void 0),r=b8();return e.abortOnUnmount??(e.abortOnUnmount=!1),w.useEffect(()=>()=>{var i;e.abortOnUnmount&&((i=t.current)==null||i.abort("unmount"),n.current&&ze.dismiss(n.current))},[]),async i=>{var h;t.current=new AbortController;let s=e.path;if(i.pathParams)for(const[d,f]of Object.entries(i.pathParams)){const g=new RegExp(`/:${d}(/|$)`),b=s.replace(g,`/${f}$1`);if(b===s)throw new Error(`[useBackendApi] pathParam '${d}' not found in path '${e.path}'`);s=b}if(i.queryParams){const d=new URLSearchParams;for(const[f,g]of Object.entries(i.queryParams))(typeof g=="string"||typeof g=="number"||typeof g=="boolean")&&d.append(f,g.toString());s+=`?${d.toString()}`}const a=`${e.method} ${e.path}`,o=(d,f)=>{if(n.current&&ze.error({title:d,msg:f},{id:n.current}),i.error)try{i.error(f,n.current)}catch(g){console.log("[ERROR CB ERROR]",a,g)}else throw new b_(d,f)};if(i.toastId&&i.toastLoadingMessage)throw new Error("[useBackendApi] toastId and toastLoadingMessage are mutually exclusive.");i.toastLoadingMessage?n.current=ze.loading(i.toastLoadingMessage):i.toastId?n.current=i.toastId:n.current&&(ze.dismiss(n.current),n.current=void 0);const l=i.timeout??7500,u=setTimeout(()=>{var f,g;if((f=t.current)!=null&&f.signal.aborted)return;console.log("[TIMEOUT]",a);const d=`Request timed out after ${hf(l,{units:["s","ms"]})}.`;(g=t.current)==null||g.abort(d),o("Request Timeout","If you closed txAdmin, please restart it and try again.")},l);try{console.log("[>>]",a);const d=await r(s,{method:e.method,body:i.data},t.current);if(clearTimeout(u),e.throwGenericErrors&&"error"in d)throw new b_("API Error",d.error);if(i.genericHandler&&n.current&&("error"in d?ze.error({title:i.genericHandler.errorTitle,msg:d.error},{id:n.current}):ze.success(i.genericHandler.successMsg,{id:n.current})),n.current&&typeof(d==null?void 0:d.type)=="string"&&typeof(d==null?void 0:d.msg)=="string"&&$ie.includes(d==null?void 0:d.type)&&typeof ze[d.type]=="function"&&ze[d.type](d,{id:n.current}),i.success)try{i.success(d,n.current)}catch(f){console.log("[SUCCESS CB ERROR]",a,f)}return d}catch(d){if(clearTimeout(u),d==="unmount")return console.warn("[UNMOUNTED]",a),K4;const f=((h=t.current)==null?void 0:h.signal.reason)??d;let g="unknown error";return typeof f=="string"?g=f:typeof f.message!="string"?g=JSON.stringify(f):f.message.startsWith("NetworkError")?g=`Network error.
If you closed txAdmin, please restart it and try again.`:f.message.startsWith("JSON.parse:")?g="Invalid JSON response from server.":g=f.message,console.error("[ERROR]",a,g),o("Request Error",g),K4}finally{if(i.finally)try{i.finally()}catch(d){console.log("[FINALLY CB ERROR]",a,d)}}}};function Zs({children:e}){return c.jsx("p",{className:"whitespace-pre-wrap text-secondary-foreground leading-relaxed pb-2",children:e})}function ff({error:e}){var r,i;e.returnTo=e.returnTo??"/login";let t=null,n=null;if("errorTitle"in e)t=e.errorTitle,n=c.jsx(Zs,{children:e.errorMessage});else if(e.errorCode==="invalid_session")t="Invalid Browser Session.",n=c.jsxs(Zs,{children:["You may have restarted txAdmin right before entering this page. ",c.jsx("br",{}),"Please return and try again."]});else if(e.errorCode==="clock_desync")t="Please Update/Synchronize your VPS clock.",n=c.jsx(Zs,{children:"Failed to login because this host's time is wrong. Please make sure to synchronize it with the internet."});else if(e.errorCode==="timeout")t="Connection to FiveM servers timed out.",n=c.jsx(Zs,{children:"Please try again or login using your existing username and backup password."});else if(e.errorCode==="end_user_aborted")t="Login Aborted",n=c.jsxs(Zs,{children:["The Cfx.re login process was aborted. ",c.jsx("br",{}),"Return to the login page to try again."]});else if(e.errorCode==="end_user_logout")t="Login Aborted",n=c.jsxs(Zs,{children:["The Cfx.re login process was aborted because you logged out of the Cfx.re account. ",c.jsx("br",{}),"Return to the login page to try again."]});else if(e.errorCode==="master_already_set")t="Master Account Already Set",n=c.jsxs(Zs,{children:["Please go back to the login page to continue. ",c.jsx("br",{})]});else if(e.errorCode==="not_admin"){const s=((r=e.errorContext)==null?void 0:r.identifier)??"unknown";t=`The Cfx.re account '${((i=e.errorContext)==null?void 0:i.name)??"unknown"}' is not an admin.`,n=c.jsxs(Zs,{children:["The account above with identifier ",c.jsx(Be,{children:s})," is not assigned to any account registered on txAdmin. ",c.jsx("br",{}),"You can also try to login using your username and backup password."]})}else t="Unknown Error:",n=c.jsx("div",{className:"text-left rounded-sm text-muted-foreground bg-muted p-1",children:c.jsx("pre",{className:"text-left whitespace-pre-wrap",children:JSON.stringify(e,null,2)})});return c.jsxs("div",{className:"p-4",children:[c.jsx("h3",{className:"text-2xl font-bold text-destructive-inline mb-4",children:t}),n,c.jsx(rf,{className:"w-full flex justify-center mt-4 pb-0",children:c.jsx(Ti,{href:e.returnTo,asChild:!0,children:c.jsxs(Re,{className:"x",children:[c.jsx(XY,{className:"inline mr-2 h-4 w-4"}),"Try Again"]})})})]})}const Cg=()=>{const e=new URLSearchParams(window.location.search),t=e.get("error"),n=e.get("error_description");if(t==="access_denied"&&n==="End-User aborted interaction")return{errorCode:"end_user_aborted"};if(t==="access_denied"&&n==="End-User aborted interaction (logout)")return{errorCode:"end_user_logout"}},pf=e=>{var t,n;return(t=e.message)!=null&&t.startsWith("NetworkError")?{errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}:(n=e.message)!=null&&n.startsWith("AbortSignal.timeout")?{errorTitle:"Browser Outdated",errorMessage:"The version of this browser is too old to use txAdmin. Please download a new version of Edge, Chrome, Firefox, etc. and try again."}:{errorTitle:"Unknown Error",errorMessage:e.message??"😵"}};var YS="Avatar",[Qie,VIe]=Cn(YS),[Zie,_8]=Qie(YS),w8=w.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=w.useState("idle");return c.jsx(Zie,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:c.jsx(Ce.span,{...r,ref:t})})});w8.displayName=YS;var S8="AvatarImage",C8=w.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,a=_8(S8,n),o=ese(r,s.referrerPolicy),l=xt(u=>{i(u),a.onImageLoadingStatusChange(u)});return Xt(()=>{o!=="idle"&&l(o)},[o,l]),o==="loaded"?c.jsx(Ce.img,{...s,ref:t,src:r}):null});C8.displayName=S8;var k8="AvatarFallback",E8=w.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=_8(k8,n),[a,o]=w.useState(r===void 0);return w.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&s.imageLoadingStatus!=="loaded"?c.jsx(Ce.span,{...i,ref:t}):null});E8.displayName=k8;function ese(e,t){const[n,r]=w.useState("idle");return Xt(()=>{if(!e){r("error");return}let i=!0;const s=new window.Image,a=o=>()=>{i&&r(o)};return r("loading"),s.onload=a("loaded"),s.onerror=a("error"),s.src=e,t&&(s.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var T8=w8,A8=C8,R8=E8;const XS=w.forwardRef(({className:e,...t},n)=>c.jsx(T8,{ref:n,className:Y("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));XS.displayName=T8.displayName;const JS=w.forwardRef(({className:e,...t},n)=>c.jsx(A8,{ref:n,className:Y("aspect-square h-full w-full",e),...t}));JS.displayName=A8.displayName;const QS=w.forwardRef(({className:e,...t},n)=>c.jsx(R8,{ref:n,className:Y("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));QS.displayName=R8.displayName;function Y4({serverName:e,gameName:t,iconFilename:n,className:r,extraClasses:i}){let s;t==="fivem"?s="/img/fivem-server-icon.png":t==="redm"?s="/img/redm-server-icon.png":s="/img/unknown-server-icon.png";let a=s;return n&&/^icon-([a-f0-9]{16})\.png$/.test(n)&&(a=`/.runtime/${n}`),c.jsxs(XS,{className:Y(r,i),children:[c.jsx(JS,{src:a,alt:e}),c.jsx(QS,{asChild:!0,children:c.jsx("img",{src:s,className:"aspect-square rounded-md h-full w-full"})})]})}function tse(e){return c.jsxs("div",{className:"relative flex shrink-0",children:[c.jsx(Y4,{...e,extraClasses:"size-14 xs:size-16 rounded-md z-10"}),c.jsx(Y4,{...e,extraClasses:"size-14 xs:size-16 absolute blur-lg z-0 scale-90"})]})}function nse(){return c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xl xs:text-2xl text-primary/85 font-semibold line-clamp-1",children:"Welcome to txAdmin!"}),c.jsx("div",{className:"text-sm xs:text-base font-normal tracking-wide text-muted-foreground",children:"please login to continue"})]})}function rse(){const e=window.txConsts.server;return!e||!e.name||!e.game&&!e.icon?c.jsx(nse,{}):c.jsxs(c.Fragment,{children:[c.jsx(tse,{iconFilename:e.icon,serverName:e.name,gameName:e.game}),c.jsxs("div",{className:"grow xs:h-full flex flex-col xs:justify-between",children:[c.jsx("div",{className:"text-xl xs:text-2xl font-semibold line-clamp-1",children:e.name}),c.jsx("div",{className:"text-sm xs:text-base text-muted-foreground",children:"Login to continue"})]})]})}var Mo=(e=>(e.NONE="",e.LOGOUT="#logout",e.EXPIRED="#expired",e.UPDATED="#updated",e.MASTER_ALREADY_SET="#master_already_set",e.SHUTDOWN="#shutdown",e))(Mo||{});function ise(){const{setAuthData:e}=rl(),t=w.useRef(null),n=w.useRef(null),[r,i]=w.useState(),[s,a]=w.useState(!1),o=zs()[1],l=f=>{const{errorTitle:g,errorMessage:b}=pf(f);i(`${g}:
${b}`)},u=f=>{f==="no_admins_setup"?(i(`No admins set up.
Redirecting...`),o("/addMaster/pin")):i(f)},h=async()=>{var f,g;try{a(!0);const b=await Oo(`/auth/password?uiVersion=${encodeURIComponent(window.txConsts.txaVersion)}`,{method:"POST",body:{username:((f=t.current)==null?void 0:f.value)??"",password:((g=n.current)==null?void 0:g.value)??""}});"error"in b?b.error==="refreshToUpdate"?(window.location.href="/login#updated",window.location.reload()):u(b.error):e(b)}catch(b){l(b)}finally{a(!1)}},d=async()=>{try{a(!0);const f=await Oo(`/auth/cfxre/redirect?origin=${encodeURIComponent(window.location.origin)}`);"error"in f?(u(f.error),a(!1)):(console.log("Redirecting to",f.authUrl),window.location.href=f.authUrl)}catch(f){l(f),a(!1)}};return w.useEffect(()=>{try{const f=localStorage.getItem(_r.AuthCredsAutofill);if(f){const[g,b]=JSON.parse(f);t.current.value=g??"",n.current.value=b??""}}catch(f){console.error("Username/Pass autofill failed",f)}},[]),w.useEffect(()=>{const f=window.location.hash;f&&(f==="#logout"?i("Logged Out."):f==="#expired"?i("Session Expired."):f==="#updated"?i(`txAdmin updated!
Please login again.`):f==="#master_already_set"?i("Master account already configured."):f==="#shutdown"&&i(`The txAdmin server shut down.
Please start it again to be able to login.`),window.location.hash="")},[]),c.jsxs("form",{onSubmit:f=>{f.preventDefault(),h()},className:"w-full rounded-[inherit]",children:[c.jsx(_s,{className:"rounded-t-[inherit]",children:c.jsx(po,{className:"h-14 xs:h-16 flex flex-row justify-center items-center gap-4",children:c.jsx(rse,{})})}),c.jsxs(yi,{className:"flex flex-col pt-4 gap-4 border-t rounded-b-[inherit] bg-card",children:[r&&c.jsx("div",{className:"text-center text-sm whitespace-pre-wrap text-destructive-inline",children:r}),c.jsxs("div",{className:"flex flex-col xs:grid grid-cols-8 gap-2 xs:gap-4 items-baseline",children:[c.jsx(Yt,{className:"col-span-2",htmlFor:"frm-login",children:"Username"}),c.jsx(yt,{id:"frm-login",ref:t,type:"text",placeholder:"username",autoCapitalize:"off",autoComplete:"off",className:"col-span-6",required:!0})]}),c.jsxs("div",{className:"flex flex-col xs:grid grid-cols-8 gap-2 xs:gap-4 items-baseline",children:[c.jsx(Yt,{className:"col-span-2",htmlFor:"frm-password",children:"Password"}),c.jsx(yt,{id:"frm-password",ref:n,type:"password",placeholder:"password",autoCapitalize:"off",autoComplete:"off",className:"col-span-6",required:!0})]}),c.jsxs(Re,{variant:"outline",disabled:s,children:[s?c.jsx(qt,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(K3,{className:"inline mr-2 h-4 w-4"})," Login"]}),c.jsxs(Re,{className:"cfxrebtn",variant:"outline",disabled:s,onClick:d,children:[s?c.jsx(qt,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(K3,{className:"inline mr-2 h-4 w-4"})," Login with Cfx.re"]})]})]})}function sse(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}function zd(e=Mo.NONE){const t=window.location.pathname+window.location.search+window.location.hash,n=t==="/"||t.startsWith("/login")?`/login${e}`:`/login?r=${encodeURIComponent(t)}${e}`;window.history.replaceState(null,"",n)}const nu=e=>{e&&(window.invokeNative?window.invokeNative("openUrl",e):window.open(e,"_blank"))},ZS=e=>{if(window.txConsts.isWebInterface)return;const n=e.target.closest("a");if(!n)return;const r=n.getAttribute("href");r&&(e.preventDefault(),nu(r))},eC=(e,t)=>{if(typeof e!="string"||!e.length)throw new Error("setUrlSearchParam: paramName must be a non-empty string");const n=new URL(window.location.toString());t?n.searchParams.set(e,t):n.searchParams.delete(e),window.history.replaceState({},"",n)},ose=e=>{if(!e.length)throw new Error("getUrlSearchParam: paramName must be a non-empty string");return new URL(window.location.toString()).searchParams.get(e)},ase=e=>{const t=new URL(window.location.href);e?t.hash=e:t.hash="",window.history.replaceState(null,"",t.toString())},o0=Zc(!1),M8=Zc(void 0),__="playerModal",a0=e=>{eC(__,e)},l0=()=>{const e=rt(M8),t=rt(o0);return n=>{const r="mutex"in n?`${n.mutex}#${n.netid}`:n.license;a0(r),e(n),t(!0)}},tC=()=>{const e=rt(o0);return()=>{a0(void 0),e(!1)}},lse=()=>{const e=nt(M8),[t,n]=sr(o0);return{isModalOpen:t,playerRef:e,closeModal:()=>{a0(void 0),n(!1)}}},nC=Zc(!1),j8=Zc(void 0),w_="actionModal",N8=e=>{eC(w_,e)},rC=()=>{const e=rt(j8),t=rt(nC);return n=>{N8(n),e(n),t(!0)}},cse=()=>{const e=nt(j8),[t,n]=sr(nC);return{isModalOpen:t,actionRef:e,closeModal:()=>{N8(void 0),n(!1)}}};var X4=Object.prototype.hasOwnProperty;function kg(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&kg(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(X4.call(e,n)&&++r&&!X4.call(t,n)||!(n in t)||!kg(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const vs=new WeakMap,mo=()=>{},er=mo(),S_=Object,gt=e=>e===er,Hi=e=>typeof e=="function",Io=(e,t)=>({...e,...t}),D8=e=>Hi(e.then),Jx={},yp={},iC="undefined",c0=typeof window!=iC,C_=typeof document!=iC,use=()=>c0&&typeof window.requestAnimationFrame!=iC,L8=(e,t)=>{const n=vs.get(e);return[()=>!gt(t)&&e.get(t)||Jx,r=>{if(!gt(t)){const i=e.get(t);t in yp||(yp[t]=i),n[5](t,Io(i,r),i||Jx)}},n[6],()=>!gt(t)&&t in yp?yp[t]:!gt(t)&&e.get(t)||Jx]};let k_=!0;const dse=()=>k_,[E_,T_]=c0&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[mo,mo],hse=()=>{const e=C_&&document.visibilityState;return gt(e)||e!=="hidden"},fse=e=>(C_&&document.addEventListener("visibilitychange",e),E_("focus",e),()=>{C_&&document.removeEventListener("visibilitychange",e),T_("focus",e)}),pse=e=>{const t=()=>{k_=!0,e()},n=()=>{k_=!1};return E_("online",t),E_("offline",n),()=>{T_("online",t),T_("offline",n)}},mse={isOnline:dse,isVisible:hse},gse={initFocus:fse,initReconnect:pse},J4=!ot.useId,yh=!c0||"Deno"in globalThis,vse=e=>use()?window.requestAnimationFrame(e):setTimeout(e,1),Qx=yh?w.useEffect:w.useLayoutEffect,Zx=typeof navigator<"u"&&navigator.connection,Q4=!yh&&Zx&&(["slow-2g","2g"].includes(Zx.effectiveType)||Zx.saveData),bp=new WeakMap,ey=(e,t)=>S_.prototype.toString.call(e)===`[object ${t}]`;let xse=0;const A_=e=>{const t=typeof e,n=ey(e,"Date"),r=ey(e,"RegExp"),i=ey(e,"Object");let s,a;if(S_(e)===e&&!n&&!r){if(s=bp.get(e),s)return s;if(s=++xse+"~",bp.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=A_(e[a])+",";bp.set(e,s)}if(i){s="#";const o=S_.keys(e).sort();for(;!gt(a=o.pop());)gt(e[a])||(s+=a+":"+A_(e[a])+",");bp.set(e,s)}}else s=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},sC=e=>{if(Hi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?A_(e):"",[e,t]};let yse=0;const R_=()=>++yse,P8=0,O8=1,I8=2,bse=3;var Vu={__proto__:null,ERROR_REVALIDATE_EVENT:bse,FOCUS_EVENT:P8,MUTATE_EVENT:I8,RECONNECT_EVENT:O8};async function $8(...e){const[t,n,r,i]=e,s=Io({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let a=s.populateCache;const o=s.rollbackOnError;let l=s.optimisticData;const u=f=>typeof o=="function"?o(f):o!==!1,h=s.throwOnError;if(Hi(n)){const f=n,g=[],b=t.keys();for(const x of b)!/^\$(inf|sub)\$/.test(x)&&f(t.get(x)._k)&&g.push(x);return Promise.all(g.map(d))}return d(n);async function d(f){const[g]=sC(f);if(!g)return;const[b,x]=L8(t,g),[v,m,p,y]=vs.get(t),_=()=>{const L=v[g];return(Hi(s.revalidate)?s.revalidate(b().data,f):s.revalidate!==!1)&&(delete p[g],delete y[g],L&&L[0])?L[0](I8).then(()=>b().data):b().data};if(e.length<3)return _();let C=r,S;const E=R_();m[g]=[E,0];const k=!gt(l),T=b(),A=T.data,M=T._c,D=gt(M)?A:M;if(k&&(l=Hi(l)?l(D,A):l,x({data:l,_c:D})),Hi(C))try{C=C(D)}catch(L){S=L}if(C&&D8(C))if(C=await C.catch(L=>{S=L}),E!==m[g][0]){if(S)throw S;return C}else S&&k&&u(S)&&(a=!0,x({data:D,_c:er}));if(a&&!S)if(Hi(a)){const L=a(C,D);x({data:L,error:er,_c:er})}else x({data:C,error:er,_c:er});if(m[g][1]=R_(),Promise.resolve(_()).then(()=>{x({_c:er})}),S){if(h)throw S;return}return C}}const Z4=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},_se=(e,t)=>{if(!vs.has(e)){const n=Io(gse,t),r={},i=$8.bind(er,e);let s=mo;const a={},o=(h,d)=>{const f=a[h]||[];return a[h]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},l=(h,d,f)=>{e.set(h,d);const g=a[h];if(g)for(const b of g)b(d,f)},u=()=>{if(!vs.has(e)&&(vs.set(e,[r,{},{},{},i,l,o]),!yh)){const h=n.initFocus(setTimeout.bind(er,Z4.bind(er,r,P8))),d=n.initReconnect(setTimeout.bind(er,Z4.bind(er,r,O8)));s=()=>{h&&h(),d&&d(),vs.delete(e)}}};return u(),[e,i,u,s]}return[e,vs.get(e)[4]]},wse=(e,t,n,r,i)=>{const s=n.errorRetryCount,a=i.retryCount,o=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!gt(s)&&a>s||setTimeout(r,o,i)},Sse=kg,[B8,F8]=_se(new Map),Cse=Io({onLoadingSlow:mo,onSuccess:mo,onError:mo,onErrorRetry:wse,onDiscarded:mo,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Q4?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Q4?5e3:3e3,compare:Sse,isPaused:()=>!1,cache:B8,mutate:F8,fallback:{}},mse),kse=(e,t)=>{const n=Io(e,t);if(t){const{use:r,fallback:i}=e,{use:s,fallback:a}=t;r&&s&&(n.use=r.concat(s)),i&&a&&(n.fallback=Io(i,a))}return n},Ese=w.createContext({}),Tse="$inf$",z8=c0&&window.__SWR_DEVTOOLS_USE__,Ase=z8?window.__SWR_DEVTOOLS_USE__:[],Rse=()=>{z8&&(window.__SWR_DEVTOOLS_REACT__=ot)},Mse=e=>Hi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],jse=()=>Io(Cse,w.useContext(Ese)),Nse=e=>(t,n,r)=>e(t,n&&((...s)=>{const[a]=sC(t),[,,,o]=vs.get(B8);if(a.startsWith(Tse))return n(...s);const l=o[a];return gt(l)?n(...s):(delete o[a],l)}),r),Dse=Ase.concat(Nse),Lse=e=>function(...n){const r=jse(),[i,s,a]=Mse(n),o=kse(r,a);let l=e;const{use:u}=o,h=(u||[]).concat(Dse);for(let d=h.length;d--;)l=h[d](l);return l(i,s||o.fetcher||null,o)},Pse=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};Rse();const ty=ot.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),ny={dedupe:!0},Ose=(e,t,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:a,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:h,refreshWhenOffline:d,keepPreviousData:f}=n,[g,b,x,v]=vs.get(r),[m,p]=sC(e),y=w.useRef(!1),_=w.useRef(!1),C=w.useRef(m),S=w.useRef(t),E=w.useRef(n),k=()=>E.current,T=()=>k().isVisible()&&k().isOnline(),[A,M,D,L]=L8(r,m),N=w.useRef({}).current,O=gt(a)?gt(n.fallback)?er:n.fallback[m]:a,B=(q,ne)=>{for(const te in N){const le=te;if(le==="data"){if(!i(q[le],ne[le])&&(!gt(q[le])||!i(Z,ne[le])))return!1}else if(ne[le]!==q[le])return!1}return!0},z=w.useMemo(()=>{const q=!m||!t?!1:gt(o)?k().isPaused()||s?!1:l!==!1:o,ne=Ae=>{const be=Io(Ae);return delete be._k,q?{isValidating:!0,isLoading:!0,...be}:be},te=A(),le=L(),xe=ne(te),ie=te===le?xe:ne(le);let Te=xe;return[()=>{const Ae=ne(A());return B(Ae,Te)?(Te.data=Ae.data,Te.isLoading=Ae.isLoading,Te.isValidating=Ae.isValidating,Te.error=Ae.error,Te):(Te=Ae,Ae)},()=>ie]},[r,m]),P=CN.useSyncExternalStore(w.useCallback(q=>D(m,(ne,te)=>{B(te,ne)||q()}),[r,m]),z[0],z[1]),j=!y.current,R=g[m]&&g[m].length>0,I=P.data,H=gt(I)?O&&D8(O)?ty(O):O:I,F=P.error,G=w.useRef(H),Z=f?gt(I)?G.current:I:H,J=R&&!gt(F)?!1:j&&!gt(o)?o:k().isPaused()?!1:s?gt(H)?!1:l:gt(H)||l,W=!!(m&&t&&j&&J),$=gt(P.isValidating)?W:P.isValidating,V=gt(P.isLoading)?W:P.isLoading,U=w.useCallback(async q=>{const ne=S.current;if(!m||!ne||_.current||k().isPaused())return!1;let te,le,xe=!0;const ie=q||{},Te=!x[m]||!ie.dedupe,Ae=()=>J4?!_.current&&m===C.current&&y.current:m===C.current,be={isValidating:!1,isLoading:!1},we=()=>{M(be)},_e=()=>{const se=x[m];se&&se[1]===le&&delete x[m]},de={isValidating:!0};gt(A().data)&&(de.isLoading=!0);try{if(Te&&(M(de),n.loadingTimeout&&gt(A().data)&&setTimeout(()=>{xe&&Ae()&&k().onLoadingSlow(m,n)},n.loadingTimeout),x[m]=[ne(p),R_()]),[te,le]=x[m],te=await te,Te&&setTimeout(_e,n.dedupingInterval),!x[m]||x[m][1]!==le)return Te&&Ae()&&k().onDiscarded(m),!1;be.error=er;const se=b[m];if(!gt(se)&&(le<=se[0]||le<=se[1]||se[1]===0))return we(),Te&&Ae()&&k().onDiscarded(m),!1;const me=A().data;be.data=i(me,te)?me:te,Te&&Ae()&&k().onSuccess(te,m,n)}catch(se){_e();const me=k(),{shouldRetryOnError:K}=me;me.isPaused()||(be.error=se,Te&&Ae()&&(me.onError(se,m,me),(K===!0||Hi(K)&&K(se))&&(!k().revalidateOnFocus||!k().revalidateOnReconnect||T())&&me.onErrorRetry(se,m,me,Q=>{const re=g[m];re&&re[0]&&re[0](Vu.ERROR_REVALIDATE_EVENT,Q)},{retryCount:(ie.retryCount||0)+1,dedupe:!0})))}return xe=!1,we(),!0},[m,r]),X=w.useCallback((...q)=>$8(r,C.current,...q),[]);if(Qx(()=>{S.current=t,E.current=n,gt(I)||(G.current=I)}),Qx(()=>{if(!m)return;const q=U.bind(er,ny);let ne=0;const le=Pse(m,g,(xe,ie={})=>{if(xe==Vu.FOCUS_EVENT){const Te=Date.now();k().revalidateOnFocus&&Te>ne&&T()&&(ne=Te+k().focusThrottleInterval,q())}else if(xe==Vu.RECONNECT_EVENT)k().revalidateOnReconnect&&T()&&q();else{if(xe==Vu.MUTATE_EVENT)return U();if(xe==Vu.ERROR_REVALIDATE_EVENT)return U(ie)}});return _.current=!1,C.current=m,y.current=!0,M({_k:p}),J&&(gt(H)||yh?q():vse(q)),()=>{_.current=!0,le()}},[m]),Qx(()=>{let q;function ne(){const le=Hi(u)?u(A().data):u;le&&q!==-1&&(q=setTimeout(te,le))}function te(){!A().error&&(h||k().isVisible())&&(d||k().isOnline())?U(ny).then(ne):ne()}return ne(),()=>{q&&(clearTimeout(q),q=-1)}},[u,h,d,m]),w.useDebugValue(Z),s&&gt(H)&&m){if(!J4&&yh)throw new Error("Fallback data is required when using Suspense in SSR.");S.current=t,E.current=n,_.current=!1;const q=v[m];if(!gt(q)){const ne=X(q);ty(ne)}if(gt(F)){const ne=U(ny);gt(Z)||(ne.status="fulfilled",ne.value=!0),ty(ne)}else throw F}return{mutate:X,get data(){return N.data=!0,Z},get error(){return N.error=!0,F},get isValidating(){return N.isValidating=!0,$},get isLoading(){return N.isLoading=!0,V}}},nl=Lse(Ose),ru=Ze(window.txConsts.preAuth),H8=Ze(e=>!!e(ru)),Ise=Ze(e=>{const t=e(ru);return t?t.csrfToken:void 0}),$se=Ze(e=>{const t=e(ru);if(t)return{permissions:t.permissions,isMaster:t.isMaster}}),Bse=()=>nt(H8),Fse=()=>nt(Ise),zse=()=>rt(ru),Xn=()=>{const e=nt($se);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}},oC=()=>{const e=rt(ru);return(t="unknown",n="unknown",r=Mo.EXPIRED)=>{console.log("[useExpireAuthData] Logout notice received:",{src:t,reason:n,reasonHash:r}),e(!1),zd(r)}},rl=()=>{const[e,t]=sr(ru);return{authData:e,setAuthData:t,logout:()=>Oo("/auth/logout",{method:"POST"}).then(r=>{r.logout?(console.log("[useAuth] Manually triggered logout."),t(!1),zd(Mo.LOGOUT)):(console.error("Failed to logout:",r),t(!1),zd(Mo.LOGOUT))}).catch(r=>{console.log("Error sending logout request:",r),t(!1),zd(Mo.LOGOUT)})}},Hse=kD((e,t)=>{e(H8)||(console.info("[logoutWatcher] Logout Detected, closing all dialogs and modals."),t(Gv,!1),t(Kv,!1),t(Xv,!1),t(yS,!1),t(bS,!1),t(_S,!1),t(o0,!1),t(nC,!1),t(Qa,null),t(Wv,void 0),t(fS,void 0),t(Uv,void 0),t(Vv,void 0),t(pS,0),ze.dismiss(),F8(()=>!0,void 0,{revalidate:!1}))}),Wse=150,eT=Un(Wse,e=>{console.log("sending hotkey event",e),window.postMessage({type:"globalHotkey",action:e})},{noTrailing:!0});function aC(e){return e.code==="KeyK"&&e.ctrlKey?(eT("focusPlayerlistFilter"),!0):e.code==="KeyL"&&e.altKey?(eT("toggleLightMode"),!0):!1}function W8(e){aC(e)&&e.preventDefault()}function eo({legacyUrl:e}){const t=w.useRef(null),n=location.search??"",r=location.hash??"";return w.useEffect(()=>{var i;t.current&&((i=t.current.contentWindow)==null||i.addEventListener("keydown",W8))},[]),c.jsx("iframe",{ref:t,id:"legacyPageIframe",src:`./legacy/${e}${n}${r}`,className:"w-full"})}function Use({params:e}){const t=LD(),n=zs()[1];return t("Not Found"),w.useEffect(()=>{e["*"]==="whitelist"&&n("/allowlist")},[]),c.jsx("div",{className:"w-full flex items-center justify-center",children:c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"bg-fuchsia-600 text-4xl w-fit mx-auto",children:"404 | Not Found"}),c.jsxs("p",{className:"mt-2",children:["The page ",c.jsxs(Be,{children:["/",e["*"]]})," does not seem to be correct."]}),c.jsx(Ti,{href:"/",className:"text-accent hover:underline",children:"Return to Dashboard?"})]})})}var U8={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={4567:function(a,o,l){var u=this&&this.__decorate||function(p,y,_,C){var S,E=arguments.length,k=E<3?y:C===null?C=Object.getOwnPropertyDescriptor(y,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,y,_,C);else for(var T=p.length-1;T>=0;T--)(S=p[T])&&(k=(E<3?S(k):E>3?S(y,_,k):S(y,_))||k);return E>3&&k&&Object.defineProperty(y,_,k),k},h=this&&this.__param||function(p,y){return function(_,C){y(_,C,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),f=l(9924),g=l(844),b=l(4725),x=l(2585),v=l(3656);let m=o.AccessibilityManager=class extends g.Disposable{constructor(p,y,_,C){super(),this._terminal=p,this._coreBrowserService=_,this._renderService=C,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 S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,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 f.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(S=>this._handleResize(S.rows))),this.register(this._terminal.onRender(S=>this._refreshRows(S.start,S.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(S=>this._handleChar(S))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(S=>this._handleTab(S))),this.register(this._terminal.onKey(S=>this._handleKey(S.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,v.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(p){for(let y=0;y<p;y++)this._handleChar(" ")}_handleChar(p){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,y){this._liveRegionDebouncer.refresh(p,y,this._terminal.rows)}_renderRows(p,y){const _=this._terminal.buffer,C=_.lines.length.toString();for(let S=p;S<=y;S++){const E=_.lines.get(_.ydisp+S),k=[],T=(E==null?void 0:E.translateToString(!0,void 0,void 0,k))||"",A=(_.ydisp+S+1).toString(),M=this._rowElements[S];M&&(T.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=T,this._rowColumns.set(M,k)),M.setAttribute("aria-posinset",A),M.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(p,y){const _=p.target,C=this._rowElements[y===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||p.relatedTarget!==C)return;let S,E;if(y===0?(S=_,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(S=this._rowElements.shift(),E=_,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){var T;if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:p.anchorNode,offset:p.anchorOffset},_={node:p.focusNode,offset:p.focusOffset};if((y.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===_.node&&y.offset>_.offset)&&([y,_]=[_,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const C=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:C,offset:((T=C.textContent)==null?void 0:T.length)??0}),!this._rowContainer.contains(_.node))return;const S=({node:A,offset:M})=>{const D=A instanceof Text?A.parentNode:A;let L=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(D);if(!N)return console.warn("columns is null. Race condition?"),null;let O=M<N.length?N[M]:N.slice(-1)[0]+1;return O>=this._terminal.cols&&(++L,O=0),{row:L,column:O}},E=S(y),k=S(_);if(E&&k){if(E.row>k.row||E.row===k.row&&E.column>=k.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(k.row-E.row)*this._terminal.cols-E.column+k.column)}}_handleResize(p){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>p;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_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 p=0;p<this._terminal.rows;p++)this._refreshRowDimensions(this._rowElements[p])}}_refreshRowDimensions(p){p.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=m=u([h(1,x.IInstantiationService),h(2,b.ICoreBrowserService),h(3,b.IRenderService)],m)},3614:(a,o)=>{function l(f){return f.replace(/\r?\n/g,"\r")}function u(f,g){return g?"\x1B[200~"+f+"\x1B[201~":f}function h(f,g,b,x){f=u(f=l(f),b.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(f,!0),g.value=""}function d(f,g,b){const x=b.getBoundingClientRect(),v=f.clientX-x.left-10,m=f.clientY-x.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${v}px`,g.style.top=`${m}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=u,o.copyHandler=function(f,g){f.clipboardData&&f.clipboardData.setData("text/plain",g.selectionText),f.preventDefault()},o.handlePasteEvent=function(f,g,b,x){f.stopPropagation(),f.clipboardData&&h(f.clipboardData.getData("text/plain"),g,b,x)},o.paste=h,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(f,g,b,x,v){d(f,g,b),v&&x.rightClickSelect(f),g.value=x.selectionText,g.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=l(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(h,d,f){this._css.set(h,d,f)}getCss(h,d){return this._css.get(h,d)}setColor(h,d,f){this._color.set(h,d,f)}getColor(h,d){return this._color.get(h,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,h,d){l.addEventListener(u,h,d);let f=!1;return{dispose:()=>{f||(f=!0,l.removeEventListener(u,h,d))}}}},3551:function(a,o,l){var u=this&&this.__decorate||function(m,p,y,_){var C,S=arguments.length,E=S<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,p,y,_);else for(var k=m.length-1;k>=0;k--)(C=m[k])&&(E=(S<3?C(E):S>3?C(p,y,E):C(p,y))||E);return S>3&&E&&Object.defineProperty(p,y,E),E},h=this&&this.__param||function(m,p){return function(y,_){p(y,_,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),f=l(8460),g=l(844),b=l(2585),x=l(4725);let v=o.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(m,p,y,_,C){super(),this._element=m,this._mouseService=p,this._renderService=y,this._bufferService=_,this._linkProviderService=C,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)(()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(m){this._lastMouseEvent=m;const p=this._positionFromMouseEvent(m,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const y=m.composedPath();for(let _=0;_<y.length;_++){const C=y[_];if(C.classList.contains("xterm"))break;if(C.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(m){if(this._activeLine!==m.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(m,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,m)||(this._clearCurrentLink(),this._askForLink(m,!0))}_askForLink(m,p){var _,C;this._activeProviderReplies&&p||((_=this._activeProviderReplies)==null||_.forEach(S=>{S==null||S.forEach(E=>{E.link.dispose&&E.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=m.y);let y=!1;for(const[S,E]of this._linkProviderService.linkProviders.entries())p?(C=this._activeProviderReplies)!=null&&C.get(S)&&(y=this._checkLinkProviderResult(S,m,y)):E.provideLinks(m.y,k=>{var A,M;if(this._isMouseOut)return;const T=k==null?void 0:k.map(D=>({link:D}));(A=this._activeProviderReplies)==null||A.set(S,T),y=this._checkLinkProviderResult(S,m,y),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(m.y,this._activeProviderReplies)})}_removeIntersectingLinks(m,p){const y=new Set;for(let _=0;_<p.size;_++){const C=p.get(_);if(C)for(let S=0;S<C.length;S++){const E=C[S],k=E.link.range.start.y<m?0:E.link.range.start.x,T=E.link.range.end.y>m?this._bufferService.cols:E.link.range.end.x;for(let A=k;A<=T;A++){if(y.has(A)){C.splice(S--,1);break}y.add(A)}}}}_checkLinkProviderResult(m,p,y){var S;if(!this._activeProviderReplies)return y;const _=this._activeProviderReplies.get(m);let C=!1;for(let E=0;E<m;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(C=!0);if(!C&&_){const E=_.find(k=>this._linkAtPosition(k.link,p));E&&(y=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let E=0;E<this._activeProviderReplies.size;E++){const k=(S=this._activeProviderReplies.get(E))==null?void 0:S.find(T=>this._linkAtPosition(T.link,p));if(k){y=!0,this._handleNewLink(k);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(m){if(!this._currentLink)return;const p=this._positionFromMouseEvent(m,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(m,this._currentLink.link.text)}_clearCurrentLink(m,p){this._currentLink&&this._lastMouseEvent&&(!m||!p||this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(m){if(!this._lastMouseEvent)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(m.link,p)&&(this._currentLink=m,this._currentLink.state={decorations:{underline:m.link.decorations===void 0||m.link.decorations.underline,pointerCursor:m.link.decorations===void 0||m.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,m.link,this._lastMouseEvent),m.link.decorations={},Object.defineProperties(m.link.decorations,{pointerCursor:{get:()=>{var y,_;return(_=(y=this._currentLink)==null?void 0:y.state)==null?void 0:_.decorations.pointerCursor},set:y=>{var _;(_=this._currentLink)!=null&&_.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,_;return(_=(y=this._currentLink)==null?void 0:y.state)==null?void 0:_.decorations.underline},set:y=>{var _,C,S;(_=this._currentLink)!=null&&_.state&&((S=(C=this._currentLink)==null?void 0:C.state)==null?void 0:S.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(m.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(y=>{if(!this._currentLink)return;const _=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=C&&(this._clearCurrentLink(_,C),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}})))}_linkHover(m,p,y){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&m.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(y,p.text)}_fireUnderlineEvent(m,p){const y=m.range,_=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-_-1,y.end.x,y.end.y-_-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(m,p,y){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&m.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(y,p.text)}_linkAtPosition(m,p){const y=m.range.start.y*this._bufferService.cols+m.range.start.x,_=m.range.end.y*this._bufferService.cols+m.range.end.x,C=p.y*this._bufferService.cols+p.x;return y<=C&&C<=_}_positionFromMouseEvent(m,p,y){const _=y.getCoords(m,p,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(m,p,y,_,C){return{x1:m,y1:p,x2:y,y2:_,cols:this._bufferService.cols,fg:C}}};o.Linkifier=v=u([h(1,x.IMouseService),h(2,x.IRenderService),h(3,b.IBufferService),h(4,x.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var u=this&&this.__decorate||function(x,v,m,p){var y,_=arguments.length,C=_<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,v,m,p);else for(var S=x.length-1;S>=0;S--)(y=x[S])&&(C=(_<3?y(C):_>3?y(v,m,C):y(v,m))||C);return _>3&&C&&Object.defineProperty(v,m,C),C},h=this&&this.__param||function(x,v){return function(m,p){v(m,p,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),f=l(2585);let g=o.OscLinkProvider=class{constructor(x,v,m){this._bufferService=x,this._optionsService=v,this._oscLinkService=m}provideLinks(x,v){var T;const m=this._bufferService.buffer.lines.get(x-1);if(!m)return void v(void 0);const p=[],y=this._optionsService.rawOptions.linkHandler,_=new d.CellData,C=m.getTrimmedLength();let S=-1,E=-1,k=!1;for(let A=0;A<C;A++)if(E!==-1||m.hasContent(A)){if(m.loadCell(A,_),_.hasExtendedAttrs()&&_.extended.urlId){if(E===-1){E=A,S=_.extended.urlId;continue}k=_.extended.urlId!==S}else E!==-1&&(k=!0);if(k||E!==-1&&A===C-1){const M=(T=this._oscLinkService.getLinkData(S))==null?void 0:T.uri;if(M){const D={start:{x:E+1,y:x},end:{x:A+(k||A!==C-1?0:1),y:x}};let L=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const N=new URL(M);["http:","https:"].includes(N.protocol)||(L=!0)}catch{L=!0}L||p.push({text:M,range:D,activate:(N,O)=>y?y.activate(N,O,D):b(0,O),hover:(N,O)=>{var B;return(B=y==null?void 0:y.hover)==null?void 0:B.call(y,N,O,D)},leave:(N,O)=>{var B;return(B=y==null?void 0:y.leave)==null?void 0:B.call(y,N,O,D)}})}k=!1,_.hasExtendedAttrs()&&_.extended.urlId?(E=A,S=_.extended.urlId):(E=-1,S=-1)}}v(p)}};function b(x,v){if(confirm(`Do you want to navigate to ${v}?

WARNING: This link could potentially be dangerous`)){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=g=u([h(0,f.IBufferService),h(1,f.IOptionsService),h(2,f.IOscLinkService)],g)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,u){this._renderCallback=l,this._coreBrowserService=u,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,u,h){this._rowCount=h,l=l!==void 0?l:0,u=u!==void 0?u: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,u):u,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),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=l(3614),h=l(3656),d=l(3551),f=l(9042),g=l(3730),b=l(1680),x=l(3107),v=l(5744),m=l(2950),p=l(1296),y=l(428),_=l(4269),C=l(5114),S=l(8934),E=l(3230),k=l(9312),T=l(4725),A=l(6731),M=l(8055),D=l(8969),L=l(8460),N=l(844),O=l(6114),B=l(8437),z=l(2584),P=l(7399),j=l(5941),R=l(9074),I=l(2585),H=l(5435),F=l(4567),G=l(779);class Z 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(W={}){super(W),this.browser=O,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new N.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(R.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(G.LinkProviderService),this._instantiationService.setService(T.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows(($,V)=>this.refresh($,V))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport($=>this._reportWindowsOptions($))),this.register(this._inputHandler.onColor($=>this._handleColorEvent($))),this.register((0,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize($=>this._afterResize($.cols,$.rows))),this.register((0,N.toDisposable)(()=>{var $,V;this._customKeyEventHandler=void 0,(V=($=this.element)==null?void 0:$.parentNode)==null||V.removeChild(this.element)}))}_handleColorEvent(W){if(this._themeService)for(const $ of W){let V,U="";switch($.index){case 256:V="foreground",U="10";break;case 257:V="background",U="11";break;case 258:V="cursor",U="12";break;default:V="ansi",U="4;"+$.index}switch($.type){case 0:const X=M.color.toColorRGB(V==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[V]);this.coreService.triggerDataEvent(`${z.C0.ESC}]${U};${(0,j.toRgbString)(X)}${z.C1_ESCAPED.ST}`);break;case 1:if(V==="ansi")this._themeService.modifyColors(q=>q.ansi[$.index]=M.channels.toColor(...$.color));else{const q=V;this._themeService.modifyColors(ne=>ne[q]=M.channels.toColor(...$.color))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.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 W=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(W);if(!$)return;const V=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,X=$.getWidth(V),q=this._renderService.dimensions.css.cell.width*X,ne=this.buffer.y*this._renderService.dimensions.css.cell.height,te=V*this._renderService.dimensions.css.cell.width;this.textarea.style.left=te+"px",this.textarea.style.top=ne+"px",this.textarea.style.width=q+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,h.addDisposableDomListener)(this.element,"copy",$=>{this.hasSelection()&&(0,u.copyHandler)($,this._selectionService)}));const W=$=>(0,u.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,h.addDisposableDomListener)(this.element,"paste",W)),O.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",$=>{$.button===2&&(0,u.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",$=>{(0,u.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),O.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",$=>{$.button===1&&(0,u.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",W=>this._keyUp(W),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",W=>this._keyDown(W),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",W=>this._keyPress(W),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",W=>this._compositionHelper.compositionupdate(W))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,h.addDisposableDomListener)(this.textarea,"input",W=>this._inputEvent(W),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(W){var V;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((V=this.element)==null?void 0:V.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.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,h.addDisposableDomListener)(this.screenElement,"mousemove",U=>this.updateCursorStyle(U))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),O.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(C.CoreBrowserService,this.textarea,W.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(T.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,h.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(T.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(A.ThemeService),this._instantiationService.setService(T.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(T.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(T.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(m.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(T.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(b.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(T.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,h.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),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(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(p.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,$=this.element;function V(q){const ne=W._mouseService.getMouseReportCoords(q,W.screenElement);if(!ne)return!1;let te,le;switch(q.overrideType||q.type){case"mousemove":le=32,q.buttons===void 0?(te=3,q.button!==void 0&&(te=q.button<3?q.button:3)):te=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":le=0,te=q.button<3?q.button:3;break;case"mousedown":le=1,te=q.button<3?q.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(q)===!1||W.viewport.getLinesScrolled(q)===0)return!1;le=q.deltaY<0?0:1,te=4;break;default:return!1}return!(le===void 0||te===void 0||te>4)&&W.coreMouseService.triggerMouseEvent({col:ne.col,row:ne.row,x:ne.x,y:ne.y,button:te,action:le,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},X={mouseup:q=>(V(q),q.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(q)),wheel:q=>(V(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&V(q)},mousemove:q=>{q.buttons||V(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?U.mousemove||($.addEventListener("mousemove",X.mousemove),U.mousemove=X.mousemove):($.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&q?U.wheel||($.addEventListener("wheel",X.wheel,{passive:!1}),U.wheel=X.wheel):($.removeEventListener("wheel",U.wheel),U.wheel=null),2&q?U.mouseup||(U.mouseup=X.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&q?U.mousedrag||(U.mousedrag=X.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)($,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return V(q),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(q)})),this.register((0,h.addDisposableDomListener)($,"wheel",q=>{if(!U.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const ne=this.viewport.getLinesScrolled(q);if(ne===0)return;const te=z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let le="";for(let xe=0;xe<Math.abs(ne);xe++)le+=te;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,h.addDisposableDomListener)($,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,h.addDisposableDomListener)($,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(W,$){var V;(V=this._renderService)==null||V.refreshRows(W,$)}updateCursorStyle(W){var $;($=this._selectionService)!=null&&$.shouldColumnSelect(W)?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(W,$,V=0){var U;V===1?(super.scrollLines(W,$,V),this.refresh(0,this.rows-1)):(U=this.viewport)==null||U.scrollLines(W)}paste(W){(0,u.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,$,V){this._selectionService.setSelection(W,$,V)}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 W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,$){var V;(V=this._selectionService)==null||V.selectLines(W,$)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!$&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const V=(0,P.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),V.type===3||V.type===2){const U=this.rows-1;return this.scrollLines(V.type===2?-U:U),this.cancel(W,!0)}return V.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(V.cancel&&this.cancel(W,!0),!V.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(V.key!==z.C0.ETX&&V.key!==z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:V.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(V.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,$){const V=W.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||W.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||W.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?V:V&&(!$.keyCode||$.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||(function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18}(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)$=W.charCode;else if(W.which===null||W.which===void 0)$=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;$=W.which}return!(!$||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=W.data;return this.coreService.triggerDataEvent($,!0),this.cancel(W),!0}return!1}resize(W,$){W!==this.cols||$!==this.rows?super.resize(W,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,$){var V,U;(V=this._charSizeService)==null||V.measure(),(U=this.viewport)==null||U.syncScrollArea(!0)}clear(){var W;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 $=1;$<this.rows;$++)this.buffer.lines.push(this.buffer.getBlankLine(B.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var $,V;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),($=this._selectionService)==null||$.reset(),this._decorationService.reset(),(V=this.viewport)==null||V.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(z.C0.ESC+"[I"):this.coreService.triggerDataEvent(z.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),V=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[4;${V};${$}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),X=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[6;${X};${U}t`)}}cancel(W,$){if(this.options.cancelEvents||$)return W.preventDefault(),W.stopPropagation(),!1}}o.Terminal=Z},9924:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,u=1e3){this._renderCallback=l,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,u,h){this._rowCount=h,l=l!==void 0?l:0,u=u!==void 0?u: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,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=d-this._lastRefreshMs,g=this._debounceThresholdMS-f;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),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u)}}},1680:function(a,o,l){var u=this&&this.__decorate||function(m,p,y,_){var C,S=arguments.length,E=S<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,p,y,_);else for(var k=m.length-1;k>=0;k--)(C=m[k])&&(E=(S<3?C(E):S>3?C(p,y,E):C(p,y))||E);return S>3&&E&&Object.defineProperty(p,y,E),E},h=this&&this.__param||function(m,p){return function(y,_){p(y,_,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=l(3656),f=l(4725),g=l(8460),b=l(844),x=l(2585);let v=o.Viewport=class extends b.Disposable{constructor(m,p,y,_,C,S,E,k){super(),this._viewportElement=m,this._scrollArea=p,this._bufferService=y,this._optionsService=_,this._charSizeService=C,this._renderService=S,this._coreBrowserService=E,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,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(T=>this._activeBuffer=T.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(T=>this._renderDimensions=T)),this._handleThemeChange(k.colors),this.register(k.onChangeColors(T=>this._handleThemeChange(T))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(m){this._viewportElement.style.backgroundColor=m.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(m){if(m)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 p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const m=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==m&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=m),this._refreshAnimationFrame=null}syncScrollArea(m=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(m);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(m)}_handleScroll(m){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 p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const m=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(m*(this._smoothScrollState.target-this._smoothScrollState.origin)),m<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(m,p){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&y<this._lastRecordedBufferHeight)||(m.cancelable&&m.preventDefault(),!1)}handleWheel(m){const p=this._getPixelsScrolled(m);return p!==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+p:this._smoothScrollState.target+=p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=p,this._bubbleScroll(m,p))}scrollLines(m){if(m!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const p=m*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!1})}_getPixelsScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let p=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_LINE?p*=this._currentRowHeight:m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._currentRowHeight*this._bufferService.rows),p}getBufferElements(m,p){var k;let y,_="";const C=[],S=p??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let T=m;T<S;T++){const A=E.get(T);if(!A)continue;const M=(k=E.get(T+1))==null?void 0:k.isWrapped;if(_+=A.translateToString(!M),!M||T===E.length-1){const D=document.createElement("div");D.textContent=_,C.push(D),_.length>0&&(y=D),_=""}}return{bufferElements:C,cursorElement:y}}getLinesScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let p=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(m,p){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&p.altKey||y==="ctrl"&&p.ctrlKey||y==="shift"&&p.shiftKey?m*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:m*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(m){this._lastTouchY=m.touches[0].pageY}handleTouchMove(m){const p=this._lastTouchY-m.touches[0].pageY;return this._lastTouchY=m.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(m,p))}};o.Viewport=v=u([h(2,x.IBufferService),h(3,x.IOptionsService),h(4,f.ICharSizeService),h(5,f.IRenderService),h(6,f.ICoreBrowserService),h(7,f.IThemeService)],v)},3107:function(a,o,l){var u=this&&this.__decorate||function(x,v,m,p){var y,_=arguments.length,C=_<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,v,m,p);else for(var S=x.length-1;S>=0;S--)(y=x[S])&&(C=(_<3?y(C):_>3?y(v,m,C):y(v,m))||C);return _>3&&C&&Object.defineProperty(v,m,C),C},h=this&&this.__param||function(x,v){return function(m,p){v(m,p,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=l(4725),f=l(844),g=l(2585);let b=o.BufferDecorationRenderer=class extends f.Disposable{constructor(x,v,m,p,y){super(),this._screenElement=x,this._bufferService=v,this._coreBrowserService=m,this._decorationService=p,this._renderService=y,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(_=>this._removeDecoration(_))),this.register((0,f.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 x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var p;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((p=x==null?void 0:x.options)==null?void 0:p.layer)==="top"),v.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const m=x.options.x??0;return m&&m>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(x,v),v}_refreshStyle(x){const v=x.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let m=this._decorationElements.get(x);m||(m=this._createElement(x),x.element=m,this._decorationElements.set(x,m),this._container.appendChild(m),x.onDispose(()=>{this._decorationElements.delete(x),m.remove()})),m.style.top=v*this._renderService.dimensions.css.cell.height+"px",m.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(m)}}_refreshXPosition(x,v=x.element){if(!v)return;const m=x.options.x??0;(x.options.anchor||"left")==="right"?v.style.right=m?m*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=m?m*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var v;(v=this._decorationElements.get(x))==null||v.remove(),this._decorationElements.delete(x),x.dispose()}};o.BufferDecorationRenderer=b=u([h(1,g.IBufferService),h(2,d.ICoreBrowserService),h(3,g.IDecorationService),h(4,d.IRenderService)],b)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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 u of this._zones)if(u.color===l.options.overviewRulerOptions.color&&u.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,l.marker.line))return;if(this._lineAdjacentToZone(u,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(u,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,u){return u>=l.startBufferLine&&u<=l.endBufferLine}_lineAdjacentToZone(l,u,h){return u>=l.startBufferLine-this._linePadding[h||"full"]&&u<=l.endBufferLine+this._linePadding[h||"full"]}_addLineToZone(l,u){l.startBufferLine=Math.min(l.startBufferLine,u),l.endBufferLine=Math.max(l.endBufferLine,u)}}},5744:function(a,o,l){var u=this&&this.__decorate||function(y,_,C,S){var E,k=arguments.length,T=k<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,C):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,_,C,S);else for(var A=y.length-1;A>=0;A--)(E=y[A])&&(T=(k<3?E(T):k>3?E(_,C,T):E(_,C))||T);return k>3&&T&&Object.defineProperty(_,C,T),T},h=this&&this.__param||function(y,_){return function(C,S){_(C,S,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=l(5871),f=l(4725),g=l(844),b=l(2585),x={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0};let p=o.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,_,C,S,E,k,T){var M;super(),this._viewportElement=y,this._screenElement=_,this._bufferService=C,this._decorationService=S,this._renderService=E,this._optionsService=k,this._coreBrowserService=T,this._colorZoneStore=new d.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(),(M=this._viewportElement.parentElement)==null||M.insertBefore(this._canvas,this._viewportElement);const A=this._canvas.getContext("2d");if(!A)throw new Error("Ctx cannot be null");this._ctx=A,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 y=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=_,v.right=y,this._refreshDrawHeightConstants(),m.full=0,m.left=0,m.center=v.left,m.right=v.left+v.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);x.left=_,x.center=_,x.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.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 _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const _ of y)_.position!=="full"&&this._renderColorZone(_);for(const _ of y)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(m[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-x[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[y.position||"full"]))}_queueRefresh(y,_){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=p=u([h(2,b.IBufferService),h(3,b.IDecorationService),h(4,f.IRenderService),h(5,b.IOptionsService),h(6,f.ICoreBrowserService)],p)},2950:function(a,o,l){var u=this&&this.__decorate||function(x,v,m,p){var y,_=arguments.length,C=_<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,v,m,p);else for(var S=x.length-1;S>=0;S--)(y=x[S])&&(C=(_<3?y(C):_>3?y(v,m,C):y(v,m))||C);return _>3&&C&&Object.defineProperty(v,m,C),C},h=this&&this.__param||function(x,v){return function(m,p){v(m,p,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=l(4725),f=l(2585),g=l(2584);let b=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,v,m,p,y,_){this._textarea=x,this._compositionView=v,this._bufferService=m,this._optionsService=p,this._coreService=y,this._renderService=_,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let m;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,m=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),m.length>0&&this._coreService.triggerDataEvent(m,!0)}},0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const v=this._textarea.value,m=v.replace(x,"");this._dataAlreadySent=m,v.length>x.length?this._coreService.triggerDataEvent(m,!0):v.length<x.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):v.length===x.length&&v!==x&&this._coreService.triggerDataEvent(v,!0)}},0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),m=this._renderService.dimensions.css.cell.height,p=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=p+"px",this._compositionView.style.height=m+"px",this._compositionView.style.lineHeight=m+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=p+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}x||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=b=u([h(2,f.IBufferService),h(3,f.IOptionsService),h(4,f.ICoreService),h(5,d.IRenderService)],b)},9806:(a,o)=>{function l(u,h,d){const f=d.getBoundingClientRect(),g=u.getComputedStyle(d),b=parseInt(g.getPropertyValue("padding-left")),x=parseInt(g.getPropertyValue("padding-top"));return[h.clientX-f.left-b,h.clientY-f.top-x]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(u,h,d,f,g,b,x,v,m){if(!b)return;const p=l(u,h,d);return p?(p[0]=Math.ceil((p[0]+(m?x/2:0))/x),p[1]=Math.ceil(p[1]/v),p[0]=Math.min(Math.max(p[0],1),f+(m?1:0)),p[1]=Math.min(Math.max(p[1],1),g),p):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=l(2584);function h(v,m,p,y){const _=v-d(v,p),C=m-d(m,p),S=Math.abs(_-C)-function(E,k,T){let A=0;const M=E-d(E,T),D=k-d(k,T);for(let L=0;L<Math.abs(M-D);L++){const N=f(E,k)==="A"?-1:1,O=T.buffer.lines.get(M+N*L);O!=null&&O.isWrapped&&A++}return A}(v,m,p);return x(S,b(f(v,m),y))}function d(v,m){let p=0,y=m.buffer.lines.get(v),_=y==null?void 0:y.isWrapped;for(;_&&v>=0&&v<m.rows;)p++,y=m.buffer.lines.get(--v),_=y==null?void 0:y.isWrapped;return p}function f(v,m){return v>m?"A":"B"}function g(v,m,p,y,_,C){let S=v,E=m,k="";for(;S!==p||E!==y;)S+=_?1:-1,_&&S>C.cols-1?(k+=C.buffer.translateBufferLineToString(E,!1,v,S),S=0,v=0,E++):!_&&S<0&&(k+=C.buffer.translateBufferLineToString(E,!1,0,v+1),S=C.cols-1,v=S,E--);return k+C.buffer.translateBufferLineToString(E,!1,v,S)}function b(v,m){const p=m?"O":"[";return u.C0.ESC+p+v}function x(v,m){v=Math.floor(v);let p="";for(let y=0;y<v;y++)p+=m;return p}o.moveToCellSequence=function(v,m,p,y){const _=p.buffer.x,C=p.buffer.y;if(!p.buffer.hasScrollback)return function(k,T,A,M,D,L){return h(T,M,D,L).length===0?"":x(g(k,T,k,T-d(T,D),!1,D).length,b("D",L))}(_,C,0,m,p,y)+h(C,m,p,y)+function(k,T,A,M,D,L){let N;N=h(T,M,D,L).length>0?M-d(M,D):T;const O=M,B=function(z,P,j,R,I,H){let F;return F=h(j,R,I,H).length>0?R-d(R,I):P,z<j&&F<=R||z>=j&&F<R?"C":"D"}(k,T,A,M,D,L);return x(g(k,N,A,O,B==="C",D).length,b(B,L))}(_,C,v,m,p,y);let S;if(C===m)return S=_>v?"D":"C",x(Math.abs(_-v),b(S,y));S=C>m?"D":"C";const E=Math.abs(C-m);return x(function(k,T){return T.cols-k}(C>m?v:_,p)+(E-1)*p.cols+1+((C>m?_:v)-1),b(S,y))}},1296:function(a,o,l){var u=this&&this.__decorate||function(L,N,O,B){var z,P=arguments.length,j=P<3?N:B===null?B=Object.getOwnPropertyDescriptor(N,O):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(L,N,O,B);else for(var R=L.length-1;R>=0;R--)(z=L[R])&&(j=(P<3?z(j):P>3?z(N,O,j):z(N,O))||j);return P>3&&j&&Object.defineProperty(N,O,j),j},h=this&&this.__param||function(L,N){return function(O,B){N(O,B,L)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=l(3787),f=l(2550),g=l(2223),b=l(6171),x=l(6052),v=l(4725),m=l(8055),p=l(8460),y=l(844),_=l(2585),C="xterm-dom-renderer-owner-",S="xterm-rows",E="xterm-fg-",k="xterm-bg-",T="xterm-focus",A="xterm-selection";let M=1,D=o.DomRenderer=class extends y.Disposable{constructor(L,N,O,B,z,P,j,R,I,H,F,G,Z){super(),this._terminal=L,this._document=N,this._element=O,this._screenElement=B,this._viewportElement=z,this._helperContainer=P,this._linkifier2=j,this._charSizeService=I,this._optionsService=H,this._bufferService=F,this._coreBrowserService=G,this._themeService=Z,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),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(A),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(J=>this._injectCss(J))),this._injectCss(this._themeService.colors),this._rowFactory=R.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(C+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(J=>this._handleLinkHover(J))),this.register(this._linkifier2.onHideLinkUnderline(J=>this._handleLinkLeave(J))),this.register((0,y.toDisposable)(()=>{this._element.classList.remove(C+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new f.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 L=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*L,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*L),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/L),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/L),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 O of this._rowElements)O.style.width=`${this.dimensions.css.canvas.width}px`,O.style.height=`${this.dimensions.css.cell.height}px`,O.style.lineHeight=`${this.dimensions.css.cell.height}px`,O.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const N=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=N,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(L){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let N=`${this._terminalSelector} .${S} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;N+=`${this._terminalSelector} .${S} .xterm-dim { color: ${m.color.multiplyOpacity(L.foreground,.5).css};}`,N+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const O=`blink_underline_${this._terminalClass}`,B=`blink_bar_${this._terminalClass}`,z=`blink_block_${this._terminalClass}`;N+=`@keyframes ${O} { 50% {  border-bottom-style: hidden; }}`,N+=`@keyframes ${B} { 50% {  box-shadow: none; }}`,N+=`@keyframes ${z} { 0% {  background-color: ${L.cursor.css};  color: ${L.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${L.cursor.css}; }}`,N+=`${this._terminalSelector} .${S}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${O} 1s step-end infinite;}${this._terminalSelector} .${S}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${S}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${L.cursor.css} !important; color: ${L.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,N+=`${this._terminalSelector} .${A} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${A} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${A} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;for(const[P,j]of L.ansi.entries())N+=`${this._terminalSelector} .${E}${P} { color: ${j.css}; }${this._terminalSelector} .${E}${P}.xterm-dim { color: ${m.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${k}${P} { background-color: ${j.css}; }`;N+=`${this._terminalSelector} .${E}${g.INVERTED_DEFAULT_COLOR} { color: ${m.color.opaque(L.background).css}; }${this._terminalSelector} .${E}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${m.color.multiplyOpacity(m.color.opaque(L.background),.5).css}; }${this._terminalSelector} .${k}${g.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`,this._themeStyleElement.textContent=N}_setDefaultSpacing(){const L=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${L}px`,this._rowFactory.defaultSpacing=L}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(L,N){for(let O=this._rowElements.length;O<=N;O++){const B=this._document.createElement("div");this._rowContainer.appendChild(B),this._rowElements.push(B)}for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(L,N){this._refreshRowElements(L,N),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(T),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(T),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(L,N,O){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(L,N,O),this.renderRows(0,this._bufferService.rows-1),!L||!N)return;this._selectionRenderModel.update(this._terminal,L,N,O);const B=this._selectionRenderModel.viewportStartRow,z=this._selectionRenderModel.viewportEndRow,P=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(P>=this._bufferService.rows||j<0)return;const R=this._document.createDocumentFragment();if(O){const I=L[0]>N[0];R.appendChild(this._createSelectionElement(P,I?N[0]:L[0],I?L[0]:N[0],j-P+1))}else{const I=B===P?L[0]:0,H=P===z?N[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(P,I,H));const F=j-P-1;if(R.appendChild(this._createSelectionElement(P+1,0,this._bufferService.cols,F)),P!==j){const G=z===j?N[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(j,0,G))}}this._selectionContainer.appendChild(R)}_createSelectionElement(L,N,O,B=1){const z=this._document.createElement("div"),P=N*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(O-N);return P+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-P),z.style.height=B*this.dimensions.css.cell.height+"px",z.style.top=L*this.dimensions.css.cell.height+"px",z.style.left=`${P}px`,z.style.width=`${j}px`,z}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 L of this._rowElements)L.replaceChildren()}renderRows(L,N){const O=this._bufferService.buffer,B=O.ybase+O.y,z=Math.min(O.x,this._bufferService.cols-1),P=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,R=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=L;I<=N;I++){const H=I+O.ydisp,F=this._rowElements[I],G=O.lines.get(H);if(!F||!G)break;F.replaceChildren(...this._rowFactory.createRow(G,H,H===B,j,R,z,P,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!0)}_handleLinkLeave(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!1)}_setCellUnderline(L,N,O,B,z,P){O<0&&(L=0),B<0&&(N=0);const j=this._bufferService.rows-1;O=Math.max(Math.min(O,j),0),B=Math.max(Math.min(B,j),0),z=Math.min(z,this._bufferService.cols);const R=this._bufferService.buffer,I=R.ybase+R.y,H=Math.min(R.x,z-1),F=this._optionsService.rawOptions.cursorBlink,G=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=O;J<=B;++J){const W=J+R.ydisp,$=this._rowElements[J],V=R.lines.get(W);if(!$||!V)break;$.replaceChildren(...this._rowFactory.createRow(V,W,W===I,G,Z,H,F,this.dimensions.css.cell.width,this._widthCache,P?J===O?L:0:-1,P?(J===B?N:z)-1:-1))}}};o.DomRenderer=D=u([h(7,_.IInstantiationService),h(8,v.ICharSizeService),h(9,_.IOptionsService),h(10,_.IBufferService),h(11,v.ICoreBrowserService),h(12,v.IThemeService)],D)},3787:function(a,o,l){var u=this&&this.__decorate||function(S,E,k,T){var A,M=arguments.length,D=M<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,E,k,T);else for(var L=S.length-1;L>=0;L--)(A=S[L])&&(D=(M<3?A(D):M>3?A(E,k,D):A(E,k))||D);return M>3&&D&&Object.defineProperty(E,k,D),D},h=this&&this.__param||function(S,E){return function(k,T){E(k,T,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=l(2223),f=l(643),g=l(511),b=l(2585),x=l(8055),v=l(4725),m=l(4269),p=l(6171),y=l(3734);let _=o.DomRendererRowFactory=class{constructor(S,E,k,T,A,M,D){this._document=S,this._characterJoinerService=E,this._optionsService=k,this._coreBrowserService=T,this._coreService=A,this._decorationService=M,this._themeService=D,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,E,k){this._selectionStart=S,this._selectionEnd=E,this._columnSelectMode=k}createRow(S,E,k,T,A,M,D,L,N,O,B){const z=[],P=this._characterJoinerService.getJoinedCharacters(E),j=this._themeService.colors;let R,I=S.getNoBgTrimmedLength();k&&I<M+1&&(I=M+1);let H=0,F="",G=0,Z=0,J=0,W=!1,$=0,V=!1,U=0;const X=[],q=O!==-1&&B!==-1;for(let ne=0;ne<I;ne++){S.loadCell(ne,this._workCell);let te=this._workCell.getWidth();if(te===0)continue;let le=!1,xe=ne,ie=this._workCell;if(P.length>0&&ne===P[0][0]){le=!0;const pe=P.shift();ie=new m.JoinedCellData(this._workCell,S.translateToString(!0,pe[0],pe[1]),pe[1]-pe[0]),xe=pe[1]-1,te=ie.getWidth()}const Te=this._isCellInSelection(ne,E),Ae=k&&ne===M,be=q&&ne>=O&&ne<=B;let we=!1;this._decorationService.forEachDecorationAtCell(ne,E,void 0,pe=>{we=!0});let _e=ie.getChars()||f.WHITESPACE_CELL_CHAR;if(_e===" "&&(ie.isUnderline()||ie.isOverline())&&(_e=" "),U=te*L-N.get(_e,ie.isBold(),ie.isItalic()),R){if(H&&(Te&&V||!Te&&!V&&ie.bg===G)&&(Te&&V&&j.selectionForeground||ie.fg===Z)&&ie.extended.ext===J&&be===W&&U===$&&!Ae&&!le&&!we){ie.isInvisible()?F+=f.WHITESPACE_CELL_CHAR:F+=_e,H++;continue}H&&(R.textContent=F),R=this._document.createElement("span"),H=0,F=""}else R=this._document.createElement("span");if(G=ie.bg,Z=ie.fg,J=ie.extended.ext,W=be,$=U,V=Te,le&&M>=ne&&M<=xe&&(M=ne),!this._coreService.isCursorHidden&&Ae&&this._coreService.isCursorInitialized){if(X.push("xterm-cursor"),this._coreBrowserService.isFocused)D&&X.push("xterm-cursor-blink"),X.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(A)switch(A){case"outline":X.push("xterm-cursor-outline");break;case"block":X.push("xterm-cursor-block");break;case"bar":X.push("xterm-cursor-bar");break;case"underline":X.push("xterm-cursor-underline")}}if(ie.isBold()&&X.push("xterm-bold"),ie.isItalic()&&X.push("xterm-italic"),ie.isDim()&&X.push("xterm-dim"),F=ie.isInvisible()?f.WHITESPACE_CELL_CHAR:ie.getChars()||f.WHITESPACE_CELL_CHAR,ie.isUnderline()&&(X.push(`xterm-underline-${ie.extended.underlineStyle}`),F===" "&&(F=" "),!ie.isUnderlineColorDefault()))if(ie.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(ie.getUnderlineColor()).join(",")})`;else{let pe=ie.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ie.isBold()&&pe<8&&(pe+=8),R.style.textDecorationColor=j.ansi[pe].css}ie.isOverline()&&(X.push("xterm-overline"),F===" "&&(F=" ")),ie.isStrikethrough()&&X.push("xterm-strikethrough"),be&&(R.style.textDecoration="underline");let de=ie.getFgColor(),se=ie.getFgColorMode(),me=ie.getBgColor(),K=ie.getBgColorMode();const Q=!!ie.isInverse();if(Q){const pe=de;de=me,me=pe;const Ue=se;se=K,K=Ue}let re,ce,ve,ge=!1;switch(this._decorationService.forEachDecorationAtCell(ne,E,void 0,pe=>{pe.options.layer!=="top"&&ge||(pe.backgroundColorRGB&&(K=50331648,me=pe.backgroundColorRGB.rgba>>8&16777215,re=pe.backgroundColorRGB),pe.foregroundColorRGB&&(se=50331648,de=pe.foregroundColorRGB.rgba>>8&16777215,ce=pe.foregroundColorRGB),ge=pe.options.layer==="top")}),!ge&&Te&&(re=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,me=re.rgba>>8&16777215,K=50331648,ge=!0,j.selectionForeground&&(se=50331648,de=j.selectionForeground.rgba>>8&16777215,ce=j.selectionForeground)),ge&&X.push("xterm-decoration-top"),K){case 16777216:case 33554432:ve=j.ansi[me],X.push(`xterm-bg-${me}`);break;case 50331648:ve=x.channels.toColor(me>>16,me>>8&255,255&me),this._addStyle(R,`background-color:#${C((me>>>0).toString(16),"0",6)}`);break;default:Q?(ve=j.foreground,X.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):ve=j.background}switch(re||ie.isDim()&&(re=x.color.multiplyOpacity(ve,.5)),se){case 16777216:case 33554432:ie.isBold()&&de<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(de+=8),this._applyMinimumContrast(R,ve,j.ansi[de],ie,re,void 0)||X.push(`xterm-fg-${de}`);break;case 50331648:const pe=x.channels.toColor(de>>16&255,de>>8&255,255&de);this._applyMinimumContrast(R,ve,pe,ie,re,ce)||this._addStyle(R,`color:#${C(de.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,ve,j.foreground,ie,re,ce)||Q&&X.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}X.length&&(R.className=X.join(" "),X.length=0),Ae||le||we?R.textContent=F:H++,U!==this.defaultSpacing&&(R.style.letterSpacing=`${U}px`),z.push(R),ne=xe}return R&&H&&(R.textContent=F),z}_applyMinimumContrast(S,E,k,T,A,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.treatGlyphAsBackgroundColor)(T.getCode()))return!1;const D=this._getContrastCache(T);let L;if(A||M||(L=D.getColor(E.rgba,k.rgba)),L===void 0){const N=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);L=x.color.ensureContrastRatio(A||E,M||k,N),D.setColor((A||E).rgba,(M||k).rgba,L??null)}return!!L&&(this._addStyle(S,`color:${L.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,E){S.setAttribute("style",`${S.getAttribute("style")||""}${E};`)}_isCellInSelection(S,E){const k=this._selectionStart,T=this._selectionEnd;return!(!k||!T)&&(this._columnSelectMode?k[0]<=T[0]?S>=k[0]&&E>=k[1]&&S<T[0]&&E<=T[1]:S<k[0]&&E>=k[1]&&S>=T[0]&&E<=T[1]:E>k[1]&&E<T[1]||k[1]===T[1]&&E===k[1]&&S>=k[0]&&S<T[0]||k[1]<T[1]&&E===T[1]&&S<T[0]||k[1]<T[1]&&E===k[1]&&S>=k[0])}};function C(S,E,k){for(;S.length<k;)S=E+S;return S}o.DomRendererRowFactory=_=u([h(1,v.ICharacterJoinerService),h(2,b.IOptionsService),h(3,v.ICoreBrowserService),h(4,b.ICoreService),h(5,b.IDecorationService),h(6,v.IThemeService)],_)},2550:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,u){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 h=l.createElement("span");h.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const f=l.createElement("span");f.classList.add("xterm-char-measure-element"),f.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=[h,d,f,g],this._container.appendChild(h),this._container.appendChild(d),this._container.appendChild(f),this._container.appendChild(g),u.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,u,h,d){l===this._font&&u===this._fontSize&&h===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=u,this._weight=h,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,u,h){let d=0;if(!u&&!h&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const b=this._measure(l,0);return b>0&&(this._flat[d]=b),b}let f=l;u&&(f+="B"),h&&(f+="I");let g=this._holey.get(f);if(g===void 0){let b=0;u&&(b|=1),h&&(b|=2),g=this._measure(l,b),g>0&&this._holey.set(f,g)}return g}_measure(l,u){const h=this._measureElements[u];return h.textContent=l.repeat(32),h.offsetWidth/32}}},2223:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(h){return 57508<=h&&h<=57558}function u(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},o.isEmoji=u,o.allowRescaling=function(h,d,f,g){return d===1&&f>Math.ceil(1.5*g)&&h!==void 0&&h>255&&!u(h)&&!l(h)&&!function(b){return 57344<=b&&b<=63743}(h)},o.treatGlyphAsBackgroundColor=function(h){return l(h)||function(d){return 9472<=d&&d<=9631}(h)},o.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}}}},o.computeNextVariantOffset=function(h,d,f=0){return(h-(2*Math.round(d)-f))%(2*Math.round(d))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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(h,d,f,g=!1){if(this.selectionStart=d,this.selectionEnd=f,!d||!f||d[0]===f[0]&&d[1]===f[1])return void this.clear();const b=h.buffers.active.ydisp,x=d[1]-b,v=f[1]-b,m=Math.max(x,0),p=Math.min(v,h.rows-1);m>=h.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=x,this.viewportEndRow=v,this.viewportCappedStartRow=m,this.viewportCappedEndRow=p,this.startCol=d[0],this.endCol=f[0])}isCellSelected(h,d,f){return!!this.hasSelection&&(f-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&f>=this.viewportCappedStartRow&&d<this.endCol&&f<=this.viewportCappedEndRow:d<this.startCol&&f>=this.viewportCappedStartRow&&d>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.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,u=this.selectionEnd;return!(!l||!u)&&(l[1]>u[1]||l[1]===u[1]&&l[0]>u[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,o,l){var u=this&&this.__decorate||function(p,y,_,C){var S,E=arguments.length,k=E<3?y:C===null?C=Object.getOwnPropertyDescriptor(y,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,y,_,C);else for(var T=p.length-1;T>=0;T--)(S=p[T])&&(k=(E<3?S(k):E>3?S(y,_,k):S(y,_))||k);return E>3&&k&&Object.defineProperty(y,_,k),k},h=this&&this.__param||function(p,y){return function(_,C){y(_,C,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=l(2585),f=l(8460),g=l(844);let b=o.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,y,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new m(this._optionsService))}catch{this._measureStrategy=this.register(new v(p,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};o.CharSizeService=b=u([h(2,d.IOptionsService)],b);class x extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,_){y!==void 0&&y>0&&_!==void 0&&_>0&&(this._result.width=y,this._result.height=_)}}class v extends x{constructor(y,_,C){super(),this._document=y,this._parentElement=_,this._optionsService=C,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class m extends x{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(a,o,l){var u=this&&this.__decorate||function(m,p,y,_){var C,S=arguments.length,E=S<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,p,y,_);else for(var k=m.length-1;k>=0;k--)(C=m[k])&&(E=(S<3?C(E):S>3?C(p,y,E):C(p,y))||E);return S>3&&E&&Object.defineProperty(p,y,E),E},h=this&&this.__param||function(m,p){return function(y,_){p(y,_,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(3734),f=l(643),g=l(511),b=l(2585);class x extends d.AttributeData{constructor(p,y,_){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=y,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=x;let v=o.CharacterJoinerService=class V8{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(p){const y={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(y),y.id}deregister(p){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===p)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(p);if(!y||y.length===0)return[];const _=[],C=y.translateToString(!0);let S=0,E=0,k=0,T=y.getFg(0),A=y.getBg(0);for(let M=0;M<y.getTrimmedLength();M++)if(y.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==T||this._workCell.bg!==A){if(M-S>1){const D=this._getJoinedRanges(C,k,E,y,S);for(let L=0;L<D.length;L++)_.push(D[L])}S=M,k=E,T=this._workCell.fg,A=this._workCell.bg}E+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const M=this._getJoinedRanges(C,k,E,y,S);for(let D=0;D<M.length;D++)_.push(M[D])}return _}_getJoinedRanges(p,y,_,C,S){const E=p.substring(y,_);let k=[];try{k=this._characterJoiners[0].handler(E)}catch(T){console.error(T)}for(let T=1;T<this._characterJoiners.length;T++)try{const A=this._characterJoiners[T].handler(E);for(let M=0;M<A.length;M++)V8._mergeRanges(k,A[M])}catch(A){console.error(A)}return this._stringRangesToCellRanges(k,C,S),k}_stringRangesToCellRanges(p,y,_){let C=0,S=!1,E=0,k=p[C];if(k){for(let T=_;T<this._bufferService.cols;T++){const A=y.getWidth(T),M=y.getString(T).length||f.WHITESPACE_CELL_CHAR.length;if(A!==0){if(!S&&k[0]<=E&&(k[0]=T,S=!0),k[1]<=E){if(k[1]=T,k=p[++C],!k)break;k[0]<=E?(k[0]=T,S=!0):S=!1}E+=M}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(p,y){let _=!1;for(let C=0;C<p.length;C++){const S=p[C];if(_){if(y[1]<=S[0])return p[C-1][1]=y[1],p;if(y[1]<=S[1])return p[C-1][1]=Math.max(y[1],S[1]),p.splice(C,1),p;p.splice(C,1),C--}else{if(y[1]<=S[0])return p.splice(C,0,y),p;if(y[1]<=S[1])return S[0]=Math.min(y[0],S[0]),p;y[0]<S[1]&&(S[0]=Math.min(y[0],S[0]),_=!0)}}return _?p[p.length-1][1]=y[1]:p.push(y),p}};o.CharacterJoinerService=v=u([h(0,b.IBufferService)],v)},5114:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=l(844),h=l(8460),d=l(3656);class f extends u.Disposable{constructor(x,v,m){super(),this._textarea=x,this._window=v,this.mainDocument=m,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new h.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(p=>this._screenDprMonitor.setWindow(p))),this.register((0,h.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(x){this._window!==x&&(this._window=x,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}}o.CoreBrowserService=f;class g extends u.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)(()=>this.clearListener()))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=l(844);class h extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{const g=this.linkProviders.indexOf(f);g!==-1&&this.linkProviders.splice(g,1)}}}}o.LinkProviderService=h},8934:function(a,o,l){var u=this&&this.__decorate||function(b,x,v,m){var p,y=arguments.length,_=y<3?x:m===null?m=Object.getOwnPropertyDescriptor(x,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(b,x,v,m);else for(var C=b.length-1;C>=0;C--)(p=b[C])&&(_=(y<3?p(_):y>3?p(x,v,_):p(x,v))||_);return y>3&&_&&Object.defineProperty(x,v,_),_},h=this&&this.__param||function(b,x){return function(v,m){x(v,m,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=l(4725),f=l(9806);let g=o.MouseService=class{constructor(b,x){this._renderService=b,this._charSizeService=x}getCoords(b,x,v,m,p){return(0,f.getCoords)(window,b,x,v,m,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(b,x){const v=(0,f.getCoordsRelativeToElement)(window,b,x);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=g=u([h(0,d.IRenderService),h(1,d.ICharSizeService)],g)},3230:function(a,o,l){var u=this&&this.__decorate||function(p,y,_,C){var S,E=arguments.length,k=E<3?y:C===null?C=Object.getOwnPropertyDescriptor(y,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,y,_,C);else for(var T=p.length-1;T>=0;T--)(S=p[T])&&(k=(E<3?S(k):E>3?S(y,_,k):S(y,_))||k);return E>3&&k&&Object.defineProperty(y,_,k),k},h=this&&this.__param||function(p,y){return function(_,C){y(_,C,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=l(6193),f=l(4725),g=l(8460),b=l(844),x=l(7226),v=l(2585);let m=o.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,y,_,C,S,E,k,T){super(),this._rowCount=p,this._charSizeService=C,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new b.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 d.RenderDebouncer((A,M)=>this._renderRows(A,M),k),this.register(this._renderDebouncer),this.register(k.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var A;return(A=this._renderer.value)==null?void 0:A.clear()})),this.register(_.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(E.buffer.y,E.buffer.y,!0))),this.register(T.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(k.window,y),this.register(k.onWindowChange(A=>this._registerIntersectionObserver(A,y)))}_registerIntersectionObserver(p,y){if("IntersectionObserver"in p){const _=new p.IntersectionObserver(C=>this._handleIntersectionChange(C[C.length-1]),{threshold:0});_.observe(y),this._observerDisposable.value=(0,b.toDisposable)(()=>_.disconnect())}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,y,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,y,this._rowCount))}_renderRows(p,y){this._renderer.value&&(p=Math.min(p,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(p,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:y}),this._onRender.fire({start:p,end:y}),this._isNextRenderRedrawOnly=!0)}resize(p,y){this._rowCount=y,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(p){this._renderer.value=p,this._renderer.value&&(this._renderer.value.onRequestRedraw(y=>this.refreshRows(y.start,y.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,y;this._renderer.value&&((y=(p=this._renderer.value).clearTextureAtlas)==null||y.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var _;return(_=this._renderer.value)==null?void 0:_.handleResize(p,y)}):this._renderer.value.handleResize(p,y),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)==null||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)==null||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)==null||p.handleFocus()}handleSelectionChanged(p,y,_){var C;this._selectionState.start=p,this._selectionState.end=y,this._selectionState.columnSelectMode=_,(C=this._renderer.value)==null||C.handleSelectionChanged(p,y,_)}handleCursorMove(){var p;(p=this._renderer.value)==null||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)==null||p.clear()}};o.RenderService=m=u([h(2,v.IOptionsService),h(3,f.ICharSizeService),h(4,v.IDecorationService),h(5,v.IBufferService),h(6,f.ICoreBrowserService),h(7,f.IThemeService)],m)},9312:function(a,o,l){var u=this&&this.__decorate||function(k,T,A,M){var D,L=arguments.length,N=L<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,A):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(k,T,A,M);else for(var O=k.length-1;O>=0;O--)(D=k[O])&&(N=(L<3?D(N):L>3?D(T,A,N):D(T,A))||N);return L>3&&N&&Object.defineProperty(T,A,N),N},h=this&&this.__param||function(k,T){return function(A,M){T(A,M,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=l(9806),f=l(9504),g=l(456),b=l(4725),x=l(8460),v=l(844),m=l(6114),p=l(4841),y=l(511),_=l(2585),C=" ",S=new RegExp(C,"g");let E=o.SelectionService=class extends v.Disposable{constructor(k,T,A,M,D,L,N,O,B){super(),this._element=k,this._screenElement=T,this._linkifier=A,this._bufferService=M,this._coreService=D,this._mouseService=L,this._optionsService=N,this._renderService=O,this._coreBrowserService=B,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=z=>this._handleMouseMove(z),this._mouseUpListener=z=>this._handleMouseUp(z),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(z=>this._handleTrim(z)),this.register(this._bufferService.buffers.onBufferActivate(z=>this._handleBufferActivate(z))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.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 k=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!k||!T||k[0]===T[0]&&k[1]===T[1])}get selectionText(){const k=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;if(!k||!T)return"";const A=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(k[0]===T[0])return"";const D=k[0]<T[0]?k[0]:T[0],L=k[0]<T[0]?T[0]:k[0];for(let N=k[1];N<=T[1];N++){const O=A.translateBufferLineToString(N,!0,D,L);M.push(O)}}else{const D=k[1]===T[1]?T[0]:void 0;M.push(A.translateBufferLineToString(k[1],!0,k[0],D));for(let L=k[1]+1;L<=T[1]-1;L++){const N=A.lines.get(L),O=A.translateBufferLineToString(L,!0);N!=null&&N.isWrapped?M[M.length-1]+=O:M.push(O)}if(k[1]!==T[1]){const L=A.lines.get(T[1]),N=A.translateBufferLineToString(T[1],!0,0,T[0]);L&&L.isWrapped?M[M.length-1]+=N:M.push(N)}}return M.map(D=>D.replace(S," ")).join(m.isWindows?`\r
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),m.isLinux&&k&&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(k){const T=this._getMouseBufferCoords(k),A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(A&&M&&T)&&this._areCoordsInSelection(T,A,M)}isCellInSelection(k,T){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!A||!M)&&this._areCoordsInSelection([k,T],A,M)}_areCoordsInSelection(k,T,A){return k[1]>T[1]&&k[1]<A[1]||T[1]===A[1]&&k[1]===T[1]&&k[0]>=T[0]&&k[0]<A[0]||T[1]<A[1]&&k[1]===A[1]&&k[0]<A[0]||T[1]<A[1]&&k[1]===T[1]&&k[0]>=T[0]}_selectWordAtCursor(k,T){var D,L;const A=(L=(D=this._linkifier.currentLink)==null?void 0:D.link)==null?void 0:L.range;if(A)return this._model.selectionStart=[A.start.x-1,A.start.y-1],this._model.selectionStartLength=(0,p.getRangeLength)(A,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(k);return!!M&&(this._selectWordAt(M,T),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,T){this._model.clearSelection(),k=Math.max(k,0),T=Math.min(T,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,T],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const T=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(T)return T[0]--,T[1]--,T[1]+=this._bufferService.buffer.ydisp,T}_getMouseEventScrollAmount(k){let T=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const A=this._renderService.dimensions.css.canvas.height;return T>=0&&T<=A?0:(T>A&&(T-=A),T=Math.min(Math.max(T,-50),50),T/=50,T/Math.abs(T)+Math.round(14*T))}shouldForceSelection(k){return m.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const T=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);T&&T.length!==this._model.selectionStart[0]&&T.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const T=this._getMouseBufferCoords(k);T&&(this._activeSelectionMode=2,this._selectLineAt(T[1]))}shouldColumnSelect(k){return k.altKey&&!(m.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const T=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!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(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const A=this._bufferService.buffer;if(this._model.selectionEnd[1]<A.lines.length){const M=A.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}T&&T[0]===this._model.selectionEnd[0]&&T[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const T=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&T<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const A=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){const M=(0,f.moveToCellSequence)(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,T=this._model.finalSelectionEnd,A=!(!k||!T||k[0]===T[0]&&k[1]===T[1]);A?k&&T&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&T[0]===this._oldSelectionEnd[0]&&T[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,T,A)):this._oldHasSelection&&this._fireOnSelectionChange(k,T,A)}_fireOnSelectionChange(k,T,A){this._oldSelectionStart=k,this._oldSelectionEnd=T,this._oldHasSelection=A,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim(T=>this._handleTrim(T))}_convertViewportColToCharacterIndex(k,T){let A=T;for(let M=0;T>=M;M++){const D=k.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:D>1&&T!==M&&(A+=D-1)}return A}setSelection(k,T,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,T],this._model.selectionStartLength=A,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,T,A=!0,M=!0){if(k[0]>=this._bufferService.cols)return;const D=this._bufferService.buffer,L=D.lines.get(k[1]);if(!L)return;const N=D.translateBufferLineToString(k[1],!1);let O=this._convertViewportColToCharacterIndex(L,k[0]),B=O;const z=k[0]-O;let P=0,j=0,R=0,I=0;if(N.charAt(O)===" "){for(;O>0&&N.charAt(O-1)===" ";)O--;for(;B<N.length&&N.charAt(B+1)===" ";)B++}else{let G=k[0],Z=k[0];L.getWidth(G)===0&&(P++,G--),L.getWidth(Z)===2&&(j++,Z++);const J=L.getString(Z).length;for(J>1&&(I+=J-1,B+=J-1);G>0&&O>0&&!this._isCharWordSeparator(L.loadCell(G-1,this._workCell));){L.loadCell(G-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(P++,G--):W>1&&(R+=W-1,O-=W-1),O--,G--}for(;Z<L.length&&B+1<N.length&&!this._isCharWordSeparator(L.loadCell(Z+1,this._workCell));){L.loadCell(Z+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,Z++):W>1&&(I+=W-1,B+=W-1),B++,Z++}}B++;let H=O+z-P+R,F=Math.min(this._bufferService.cols,B-O+P+j-R-I);if(T||N.slice(O,B).trim()!==""){if(A&&H===0&&L.getCodePoint(0)!==32){const G=D.lines.get(k[1]-1);if(G&&L.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(Z){const J=this._bufferService.cols-Z.start;H-=J,F+=J}}}if(M&&H+F===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const G=D.lines.get(k[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const Z=this._getWordAt([0,k[1]+1],!1,!1,!0);Z&&(F+=Z.length)}}return{start:H,length:F}}}_selectWordAt(k,T){const A=this._getWordAt(k,T);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[A.start,k[1]],this._model.selectionStartLength=A.length}}_selectToWordAt(k){const T=this._getWordAt(k,!0);if(T){let A=k[1];for(;T.start<0;)T.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,A]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const T=this._bufferService.buffer.getWrappedRangeForLine(k),A={start:{x:0,y:T.first},end:{x:this._bufferService.cols-1,y:T.last}};this._model.selectionStart=[0,T.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)(A,this._bufferService.cols)}};o.SelectionService=E=u([h(3,_.IBufferService),h(4,_.ICoreService),h(5,b.IMouseService),h(6,_.IOptionsService),h(7,b.IRenderService),h(8,b.ICoreBrowserService)],E)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=l(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,l){var u=this&&this.__decorate||function(E,k,T,A){var M,D=arguments.length,L=D<3?k:A===null?A=Object.getOwnPropertyDescriptor(k,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,k,T,A);else for(var N=E.length-1;N>=0;N--)(M=E[N])&&(L=(D<3?M(L):D>3?M(k,T,L):M(k,T))||L);return D>3&&L&&Object.defineProperty(k,T,L),L},h=this&&this.__param||function(E,k){return function(T,A){k(T,A,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),f=l(8055),g=l(8460),b=l(844),x=l(2585),v=f.css.toColor("#ffffff"),m=f.css.toColor("#000000"),p=f.css.toColor("#ffffff"),y=f.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let T=0;T<216;T++){const A=k[T/36%6|0],M=k[T/6%6|0],D=k[T%6];E.push({css:f.channels.toCss(A,M,D),rgba:f.channels.toRgba(A,M,D)})}for(let T=0;T<24;T++){const A=8+10*T;E.push({css:f.channels.toCss(A,A,A),rgba:f.channels.toRgba(A,A,A)})}return E})());let C=o.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:m,cursor:p,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:f.color.blend(m,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:f.color.blend(m,_),ansi:o.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(E={}){const k=this._colors;if(k.foreground=S(E.foreground,v),k.background=S(E.background,m),k.cursor=S(E.cursor,p),k.cursorAccent=S(E.cursorAccent,y),k.selectionBackgroundTransparent=S(E.selectionBackground,_),k.selectionBackgroundOpaque=f.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=S(E.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=f.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=E.selectionForeground?S(E.selectionForeground,f.NULL_COLOR):void 0,k.selectionForeground===f.NULL_COLOR&&(k.selectionForeground=void 0),f.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=f.color.opacity(k.selectionBackgroundTransparent,.3)),f.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=f.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=S(E.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=S(E.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=S(E.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=S(E.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=S(E.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=S(E.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=S(E.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=S(E.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=S(E.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=S(E.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=S(E.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=S(E.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=S(E.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=S(E.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=S(E.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=S(E.brightWhite,o.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const T=Math.min(k.ansi.length-16,E.extendedAnsi.length);for(let A=0;A<T;A++)k.ansi[A+16]=S(E.extendedAnsi[A],o.DEFAULT_ANSI_COLORS[A+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[E]=this._restoreColors.ansi[E]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(E){E(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function S(E,k){if(E!==void 0)try{return f.css.toColor(E)}catch{}return k}o.ThemeService=C=u([h(0,x.IOptionsService)],C)},6349:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=l(8460),h=l(844);class d extends h.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.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 b=new Array(g);for(let x=0;x<Math.min(g,this.length);x++)b[x]=this._array[this._getCyclicIndex(x)];this._array=b,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let b=this._length;b<g;b++)this._array[b]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,b){this._array[this._getCyclicIndex(g)]=b}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,b,...x){if(b){for(let v=g;v<this._length-b;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+b)];this._length-=b,this.onDeleteEmitter.fire({index:g,amount:b})}for(let v=this._length-1;v>=g;v--)this._array[this._getCyclicIndex(v+x.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<x.length;v++)this._array[this._getCyclicIndex(g+v)]=x[v];if(x.length&&this.onInsertEmitter.fire({index:g,amount:x.length}),this._length+x.length>this._maxLength){const v=this._length+x.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=x.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,b,x){if(!(b<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let m=b-1;m>=0;m--)this.set(g+m+x,this.get(g+m));const v=g+b+x-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<b;v++)this.set(g+v+x,this.get(g+v))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}o.CircularList=d},1439:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(u,h=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const f in u)d[f]=h<=1?u[f]:u[f]&&l(u[f],h-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,h=0,d=0;var f,g,b,x,v;function m(y){const _=y.toString(16);return _.length<2?"0"+_:_}function p(y,_){return y<_?(_+.05)/(y+.05):(y+.05)/(_+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(_,C,S,E){return E!==void 0?`#${m(_)}${m(C)}${m(S)}${m(E)}`:`#${m(_)}${m(C)}${m(S)}`},y.toRgba=function(_,C,S,E=255){return(_<<24|C<<16|S<<8|E)>>>0},y.toColor=function(_,C,S,E){return{css:y.toCss(_,C,S,E),rgba:y.toRgba(_,C,S,E)}}}(f||(o.channels=f={})),function(y){function _(C,S){return d=Math.round(255*S),[l,u,h]=v.toChannels(C.rgba),{css:f.toCss(l,u,h,d),rgba:f.toRgba(l,u,h,d)}}y.blend=function(C,S){if(d=(255&S.rgba)/255,d===1)return{css:S.css,rgba:S.rgba};const E=S.rgba>>24&255,k=S.rgba>>16&255,T=S.rgba>>8&255,A=C.rgba>>24&255,M=C.rgba>>16&255,D=C.rgba>>8&255;return l=A+Math.round((E-A)*d),u=M+Math.round((k-M)*d),h=D+Math.round((T-D)*d),{css:f.toCss(l,u,h),rgba:f.toRgba(l,u,h)}},y.isOpaque=function(C){return(255&C.rgba)==255},y.ensureContrastRatio=function(C,S,E){const k=v.ensureContrastRatio(C.rgba,S.rgba,E);if(k)return f.toColor(k>>24&255,k>>16&255,k>>8&255)},y.opaque=function(C){const S=(255|C.rgba)>>>0;return[l,u,h]=v.toChannels(S),{css:f.toCss(l,u,h),rgba:S}},y.opacity=_,y.multiplyOpacity=function(C,S){return d=255&C.rgba,_(C,d*S/255)},y.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(g||(o.color=g={})),function(y){let _,C;try{const S=document.createElement("canvas");S.width=1,S.height=1;const E=S.getContext("2d",{willReadFrequently:!0});E&&(_=E,_.globalCompositeOperation="copy",C=_.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return l=parseInt(S.slice(1,2).repeat(2),16),u=parseInt(S.slice(2,3).repeat(2),16),h=parseInt(S.slice(3,4).repeat(2),16),f.toColor(l,u,h);case 5:return l=parseInt(S.slice(1,2).repeat(2),16),u=parseInt(S.slice(2,3).repeat(2),16),h=parseInt(S.slice(3,4).repeat(2),16),d=parseInt(S.slice(4,5).repeat(2),16),f.toColor(l,u,h,d);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const E=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return l=parseInt(E[1]),u=parseInt(E[2]),h=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(l,u,h,d);if(!_||!C)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=C,_.fillStyle=S,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[l,u,h,d]=_.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(l,u,h,d),css:S}}}(b||(o.css=b={})),function(y){function _(C,S,E){const k=C/255,T=S/255,A=E/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))}y.relativeLuminance=function(C){return _(C>>16&255,C>>8&255,255&C)},y.relativeLuminance2=_}(x||(o.rgb=x={})),function(y){function _(S,E,k){const T=S>>24&255,A=S>>16&255,M=S>>8&255;let D=E>>24&255,L=E>>16&255,N=E>>8&255,O=p(x.relativeLuminance2(D,L,N),x.relativeLuminance2(T,A,M));for(;O<k&&(D>0||L>0||N>0);)D-=Math.max(0,Math.ceil(.1*D)),L-=Math.max(0,Math.ceil(.1*L)),N-=Math.max(0,Math.ceil(.1*N)),O=p(x.relativeLuminance2(D,L,N),x.relativeLuminance2(T,A,M));return(D<<24|L<<16|N<<8|255)>>>0}function C(S,E,k){const T=S>>24&255,A=S>>16&255,M=S>>8&255;let D=E>>24&255,L=E>>16&255,N=E>>8&255,O=p(x.relativeLuminance2(D,L,N),x.relativeLuminance2(T,A,M));for(;O<k&&(D<255||L<255||N<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),L=Math.min(255,L+Math.ceil(.1*(255-L))),N=Math.min(255,N+Math.ceil(.1*(255-N))),O=p(x.relativeLuminance2(D,L,N),x.relativeLuminance2(T,A,M));return(D<<24|L<<16|N<<8|255)>>>0}y.blend=function(S,E){if(d=(255&E)/255,d===1)return E;const k=E>>24&255,T=E>>16&255,A=E>>8&255,M=S>>24&255,D=S>>16&255,L=S>>8&255;return l=M+Math.round((k-M)*d),u=D+Math.round((T-D)*d),h=L+Math.round((A-L)*d),f.toRgba(l,u,h)},y.ensureContrastRatio=function(S,E,k){const T=x.relativeLuminance(S>>8),A=x.relativeLuminance(E>>8);if(p(T,A)<k){if(A<T){const L=_(S,E,k),N=p(T,x.relativeLuminance(L>>8));if(N<k){const O=C(S,E,k);return N>p(T,x.relativeLuminance(O>>8))?L:O}return L}const M=C(S,E,k),D=p(T,x.relativeLuminance(M>>8));if(D<k){const L=_(S,E,k);return D>p(T,x.relativeLuminance(L>>8))?M:L}return M}},y.reduceLuminance=_,y.increaseLuminance=C,y.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}}(v||(o.rgba=v={})),o.toPaddedHex=m,o.contrastRatio=p},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=l(844),h=l(2585),d=l(4348),f=l(7866),g=l(744),b=l(7302),x=l(6975),v=l(8460),m=l(1753),p=l(1480),y=l(7994),_=l(9282),C=l(5435),S=l(5981),E=l(2660);let k=!1;class T extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event(M=>{var D;(D=this._onScrollApi)==null||D.fire(M.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(M){for(const D in M)this.optionsService.options[D]=M[D]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new b.OptionsService(M)),this._instantiationService.setService(h.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(h.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(h.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(h.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(m.CoreMouseService)),this._instantiationService.setService(h.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(p.UnicodeService)),this._instantiationService.setService(h.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(h.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(h.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new C.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.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 S.WriteBuffer((D,L)=>this._inputHandler.parse(D,L))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,D){this._writeBuffer.write(M,D)}writeSync(M,D){this._logService.logLevel<=h.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(M,D)}input(M,D=!0){this.coreService.triggerDataEvent(M,D)}resize(M,D){isNaN(M)||isNaN(D)||(M=Math.max(M,g.MINIMUM_COLS),D=Math.max(D,g.MINIMUM_ROWS),this._bufferService.resize(M,D))}scroll(M,D=!1){this._bufferService.scroll(M,D)}scrollLines(M,D,L){this._bufferService.scrollLines(M,D,L)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const D=M-this._bufferService.buffer.ydisp;D!==0&&this.scrollLines(D)}registerEscHandler(M,D){return this._inputHandler.registerEscHandler(M,D)}registerDcsHandler(M,D){return this._inputHandler.registerDcsHandler(M,D)}registerCsiHandler(M,D){return this._inputHandler.registerCsiHandler(M,D)}registerOscHandler(M,D){return this._inputHandler.registerOscHandler(M,D)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?M=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)(()=>{for(const D of M)D.dispose()})}}}o.CoreTerminal=T},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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 u=0;u<this._listeners.length;u++)if(this._listeners[u]===l)return void this._listeners.splice(u,1)}}})),this._event}fire(l,u){const h=[];for(let d=0;d<this._listeners.length;d++)h.push(this._listeners[d]);for(let d=0;d<h.length;d++)h[d].call(void 0,l,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,u){return l(h=>u.fire(h))},o.runAndSubscribe=function(l,u){return u(void 0),l(h=>u(h))}},5435:function(a,o,l){var u=this&&this.__decorate||function(P,j,R,I){var H,F=arguments.length,G=F<3?j:I===null?I=Object.getOwnPropertyDescriptor(j,R):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(P,j,R,I);else for(var Z=P.length-1;Z>=0;Z--)(H=P[Z])&&(G=(F<3?H(G):F>3?H(j,R,G):H(j,R))||G);return F>3&&G&&Object.defineProperty(j,R,G),G},h=this&&this.__param||function(P,j){return function(R,I){j(R,I,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),f=l(7116),g=l(2015),b=l(844),x=l(482),v=l(8437),m=l(8460),p=l(643),y=l(511),_=l(3734),C=l(2585),S=l(1480),E=l(6242),k=l(6351),T=l(5941),A={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function D(P,j){if(P>24)return j.setWinLines||!1;switch(P){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var L;(function(P){P[P.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",P[P.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(L||(o.WindowsOptionsReportType=L={}));let N=0;class O extends b.Disposable{getAttrData(){return this._curAttrData}constructor(j,R,I,H,F,G,Z,J,W=new g.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=R,this._coreService=I,this._logService=H,this._optionsService=F,this._oscLinkService=G,this._coreMouseService=Z,this._unicodeService=J,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new m.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new m.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new m.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new m.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new m.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new m.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new m.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new m.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new m.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new m.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new m.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new m.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 B(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate($=>this._activeBuffer=$.activeBuffer)),this._parser.setCsiHandlerFallback(($,V)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:V.toArray()})}),this._parser.setEscHandlerFallback($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})}),this._parser.setExecuteHandlerFallback($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})}),this._parser.setOscHandlerFallback(($,V,U)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:V,data:U})}),this._parser.setDcsHandlerFallback(($,V,U)=>{V==="HOOK"&&(U=U.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:V,payload:U})}),this._parser.setPrintHandler(($,V,U)=>this.print($,V,U)),this._parser.registerCsiHandler({final:"@"},$=>this.insertChars($)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},$=>this.scrollLeft($)),this._parser.registerCsiHandler({final:"A"},$=>this.cursorUp($)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},$=>this.scrollRight($)),this._parser.registerCsiHandler({final:"B"},$=>this.cursorDown($)),this._parser.registerCsiHandler({final:"C"},$=>this.cursorForward($)),this._parser.registerCsiHandler({final:"D"},$=>this.cursorBackward($)),this._parser.registerCsiHandler({final:"E"},$=>this.cursorNextLine($)),this._parser.registerCsiHandler({final:"F"},$=>this.cursorPrecedingLine($)),this._parser.registerCsiHandler({final:"G"},$=>this.cursorCharAbsolute($)),this._parser.registerCsiHandler({final:"H"},$=>this.cursorPosition($)),this._parser.registerCsiHandler({final:"I"},$=>this.cursorForwardTab($)),this._parser.registerCsiHandler({final:"J"},$=>this.eraseInDisplay($,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},$=>this.eraseInDisplay($,!0)),this._parser.registerCsiHandler({final:"K"},$=>this.eraseInLine($,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},$=>this.eraseInLine($,!0)),this._parser.registerCsiHandler({final:"L"},$=>this.insertLines($)),this._parser.registerCsiHandler({final:"M"},$=>this.deleteLines($)),this._parser.registerCsiHandler({final:"P"},$=>this.deleteChars($)),this._parser.registerCsiHandler({final:"S"},$=>this.scrollUp($)),this._parser.registerCsiHandler({final:"T"},$=>this.scrollDown($)),this._parser.registerCsiHandler({final:"X"},$=>this.eraseChars($)),this._parser.registerCsiHandler({final:"Z"},$=>this.cursorBackwardTab($)),this._parser.registerCsiHandler({final:"`"},$=>this.charPosAbsolute($)),this._parser.registerCsiHandler({final:"a"},$=>this.hPositionRelative($)),this._parser.registerCsiHandler({final:"b"},$=>this.repeatPrecedingCharacter($)),this._parser.registerCsiHandler({final:"c"},$=>this.sendDeviceAttributesPrimary($)),this._parser.registerCsiHandler({prefix:">",final:"c"},$=>this.sendDeviceAttributesSecondary($)),this._parser.registerCsiHandler({final:"d"},$=>this.linePosAbsolute($)),this._parser.registerCsiHandler({final:"e"},$=>this.vPositionRelative($)),this._parser.registerCsiHandler({final:"f"},$=>this.hVPosition($)),this._parser.registerCsiHandler({final:"g"},$=>this.tabClear($)),this._parser.registerCsiHandler({final:"h"},$=>this.setMode($)),this._parser.registerCsiHandler({prefix:"?",final:"h"},$=>this.setModePrivate($)),this._parser.registerCsiHandler({final:"l"},$=>this.resetMode($)),this._parser.registerCsiHandler({prefix:"?",final:"l"},$=>this.resetModePrivate($)),this._parser.registerCsiHandler({final:"m"},$=>this.charAttributes($)),this._parser.registerCsiHandler({final:"n"},$=>this.deviceStatus($)),this._parser.registerCsiHandler({prefix:"?",final:"n"},$=>this.deviceStatusPrivate($)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},$=>this.softReset($)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},$=>this.setCursorStyle($)),this._parser.registerCsiHandler({final:"r"},$=>this.setScrollRegion($)),this._parser.registerCsiHandler({final:"s"},$=>this.saveCursor($)),this._parser.registerCsiHandler({final:"t"},$=>this.windowOptions($)),this._parser.registerCsiHandler({final:"u"},$=>this.restoreCursor($)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},$=>this.insertColumns($)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},$=>this.deleteColumns($)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},$=>this.selectProtected($)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},$=>this.requestMode($,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},$=>this.requestMode($,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new E.OscHandler($=>(this.setTitle($),this.setIconName($),!0))),this._parser.registerOscHandler(1,new E.OscHandler($=>this.setIconName($))),this._parser.registerOscHandler(2,new E.OscHandler($=>this.setTitle($))),this._parser.registerOscHandler(4,new E.OscHandler($=>this.setOrReportIndexedColor($))),this._parser.registerOscHandler(8,new E.OscHandler($=>this.setHyperlink($))),this._parser.registerOscHandler(10,new E.OscHandler($=>this.setOrReportFgColor($))),this._parser.registerOscHandler(11,new E.OscHandler($=>this.setOrReportBgColor($))),this._parser.registerOscHandler(12,new E.OscHandler($=>this.setOrReportCursorColor($))),this._parser.registerOscHandler(104,new E.OscHandler($=>this.restoreIndexedColor($))),this._parser.registerOscHandler(110,new E.OscHandler($=>this.restoreFgColor($))),this._parser.registerOscHandler(111,new E.OscHandler($=>this.restoreBgColor($))),this._parser.registerOscHandler(112,new E.OscHandler($=>this.restoreCursorColor($))),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 $ in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},()=>this.selectCharset("("+$)),this._parser.registerEscHandler({intermediates:")",final:$},()=>this.selectCharset(")"+$)),this._parser.registerEscHandler({intermediates:"*",final:$},()=>this.selectCharset("*"+$)),this._parser.registerEscHandler({intermediates:"+",final:$},()=>this.selectCharset("+"+$)),this._parser.registerEscHandler({intermediates:"-",final:$},()=>this.selectCharset("-"+$)),this._parser.registerEscHandler({intermediates:".",final:$},()=>this.selectCharset("."+$)),this._parser.registerEscHandler({intermediates:"/",final:$},()=>this.selectCharset("/"+$));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler($=>(this._logService.error("Parsing error: ",$),$)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(($,V)=>this.requestStatusString($,V)))}_preserveStack(j,R,I,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=R,this._parseStack.decodedLength=I,this._parseStack.position=H}_logSlowResolvingAsync(j){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([j,new Promise((R,I)=>setTimeout(()=>I("#SLOW_TIMEOUT"),5e3))]).catch(R=>{if(R!=="#SLOW_TIMEOUT")throw R;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,R){let I,H=this._activeBuffer.x,F=this._activeBuffer.y,G=0;const Z=this._parseStack.paused;if(Z){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,R))return this._logSlowResolvingAsync(I),I;H=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>M&&(G=this._parseStack.position+M)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,$=>String.fromCharCode($)).join("")}"`),typeof j=="string"?j.split("").map($=>$.charCodeAt(0)):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(j.length,M))),Z||this._dirtyRowTracker.clearRange(),j.length>M)for(let $=G;$<j.length;$+=M){const V=$+M<j.length?$+M:j.length,U=typeof j=="string"?this._stringDecoder.decode(j.substring($,V),this._parseBuffer):this._utf8Decoder.decode(j.subarray($,V),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,U))return this._preserveStack(H,F,U,$),this._logSlowResolvingAsync(I),I}else if(!Z){const $=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,$))return this._preserveStack(H,F,$,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===H&&this._activeBuffer.y===F||this._onCursorMove.fire();const J=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(J,this._bufferService.rows-1))}print(j,R,I){let H,F;const G=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,V=this._curAttrData;let U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-R>0&&U.getWidth(this._activeBuffer.x-1)===2&&U.setCellFromCodepoint(this._activeBuffer.x-1,0,1,V);let X=this._parser.precedingJoinState;for(let q=R;q<I;++q){if(H=j[q],H<127&&G){const xe=G[String.fromCharCode(H)];xe&&(H=xe.charCodeAt(0))}const ne=this._unicodeService.charProperties(H,X);F=S.UnicodeService.extractWidth(ne);const te=S.UnicodeService.extractShouldJoin(ne),le=te?S.UnicodeService.extractWidth(X):0;if(X=ne,Z&&this._onA11yChar.fire((0,x.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-le>J){if(W){const xe=U;let ie=this._activeBuffer.x-le;for(this._activeBuffer.x=le,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),U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),le>0&&U instanceof v.BufferLine&&U.copyCellsFrom(xe,ie,0,le,!1);ie<J;)xe.setCellFromCodepoint(ie++,0,1,V)}else if(this._activeBuffer.x=J-1,F===2)continue}if(te&&this._activeBuffer.x){const xe=U.getWidth(this._activeBuffer.x-1)?1:2;U.addCodepointToCell(this._activeBuffer.x-xe,H,F);for(let ie=F-le;--ie>=0;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}else if($&&(U.insertCells(this._activeBuffer.x,F-le,this._activeBuffer.getNullCell(V)),U.getWidth(J-1)===2&&U.setCellFromCodepoint(J-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,V)),U.setCellFromCodepoint(this._activeBuffer.x++,H,F,V),F>0)for(;--F;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}this._parser.precedingJoinState=X,this._activeBuffer.x<J&&I-R>0&&U.getWidth(this._activeBuffer.x)===0&&!U.hasContent(this._activeBuffer.x)&&U.setCellFromCodepoint(this._activeBuffer.x,0,1,V),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,R){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,R):this._parser.registerCsiHandler(j,I=>!D(I.params[0],this._optionsService.rawOptions.windowOptions)||R(I))}registerDcsHandler(j,R){return this._parser.registerDcsHandler(j,new k.DcsHandler(R))}registerEscHandler(j,R){return this._parser.registerEscHandler(j,R)}registerOscHandler(j,R){return this._parser.registerOscHandler(j,new E.OscHandler(R))}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 j;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&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);R.hasWidth(this._activeBuffer.x)&&!R.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,R){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+R):(this._activeBuffer.x=j,this._activeBuffer.y=R),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,R){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+R)}cursorUp(j){const R=this._activeBuffer.y-this._activeBuffer.scrollTop;return R>=0?this._moveCursor(0,-Math.min(R,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const R=this._activeBuffer.scrollBottom-this._activeBuffer.y;return R>=0?this._moveCursor(0,Math.min(R,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const R=j.params[0];return R===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:R===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=j.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=j.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const R=j.params[0];return R===1&&(this._curAttrData.bg|=536870912),R!==2&&R!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,R,I,H=!1,F=!1){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);G.replaceCells(R,I,this._activeBuffer.getNullCell(this._eraseAttrData()),F),H&&(G.isWrapped=!1)}_resetBufferLine(j,R=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),R),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),I.isWrapped=!1)}eraseInDisplay(j,R=!1){let I;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);I<this._bufferService.rows;I++)this._resetBufferLine(I,R);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,R),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,R);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,R);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(j,R=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,R);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,R)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let R=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;R--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let R=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;R--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let R=j.params[0]||1;for(;R--;)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(j){let R=j.params[0]||1;for(;R--;)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(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=j.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);H.deleteCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=j.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);H.insertCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=j.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);H.insertCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=j.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);H.deleteCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const R=this._parser.precedingJoinState;if(!R)return!0;const I=j.params[0]||1,H=S.UnicodeService.extractWidth(R),F=this._activeBuffer.x-H,G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),Z=new Uint32Array(G.length*I);let J=0;for(let $=0;$<G.length;){const V=G.codePointAt($)||0;Z[J++]=V,$+=V>65535?2:1}let W=J;for(let $=1;$<I;++$)Z.copyWithin(W,0,J),W+=J;return this.print(Z,0,W),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let R=0;R<j.length;R++)switch(j.params[R]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let R=0;R<j.length;R++)switch(j.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.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(j){for(let R=0;R<j.length;R++)switch(j.params[R]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let R=0;R<j.length;R++)switch(j.params[R]){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(),j.params[R]===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(j,R){const I=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:F}=this._coreMouseService,G=this._coreService,{buffers:Z,cols:J}=this._bufferService,{active:W,alt:$}=Z,V=this._optionsService.rawOptions,U=te=>te?1:2,X=j.params[0];return q=X,ne=R?X===2?4:X===4?U(G.modes.insertMode):X===12?3:X===20?U(V.convertEol):0:X===1?U(I.applicationCursorKeys):X===3?V.windowOptions.setWinLines?J===80?2:J===132?1:0:0:X===6?U(I.origin):X===7?U(I.wraparound):X===8?3:X===9?U(H==="X10"):X===12?U(V.cursorBlink):X===25?U(!G.isCursorHidden):X===45?U(I.reverseWraparound):X===66?U(I.applicationKeypad):X===67?4:X===1e3?U(H==="VT200"):X===1002?U(H==="DRAG"):X===1003?U(H==="ANY"):X===1004?U(I.sendFocus):X===1005?4:X===1006?U(F==="SGR"):X===1015?4:X===1016?U(F==="SGR_PIXELS"):X===1048?1:X===47||X===1047||X===1049?U(W===$):X===2004?U(I.bracketedPasteMode):0,G.triggerDataEvent(`${d.C0.ESC}[${R?"":"?"}${q};${ne}$y`),!0;var q,ne}_updateAttrColor(j,R,I,H,F){return R===2?(j|=50331648,j&=-16777216,j|=_.AttributeData.fromColorRGB([I,H,F])):R===5&&(j&=-50331904,j|=33554432|255&I),j}_extractColor(j,R,I){const H=[0,0,-1,0,0,0];let F=0,G=0;do{if(H[G+F]=j.params[R+G],j.hasSubParams(R+G)){const Z=j.getSubParams(R+G);let J=0;do H[1]===5&&(F=1),H[G+J+1+F]=Z[J];while(++J<Z.length&&J+G+1+F<H.length);break}if(H[1]===5&&G+F>=2||H[1]===2&&G+F>=5)break;H[1]&&(F=1)}while(++G+R<j.length&&G+F<H.length);for(let Z=2;Z<H.length;++Z)H[Z]===-1&&(H[Z]=0);switch(H[0]){case 38:I.fg=this._updateAttrColor(I.fg,H[1],H[3],H[4],H[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,H[1],H[3],H[4],H[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,H[1],H[3],H[4],H[5])}return G}_processUnderline(j,R){R.extended=R.extended.clone(),(!~j||j>5)&&(j=1),R.extended.underlineStyle=j,R.fg|=268435456,j===0&&(R.fg&=-268435457),R.updateExtended()}_processSGR0(j){j.fg=v.DEFAULT_ATTR_DATA.fg,j.bg=v.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const R=j.length;let I;const H=this._curAttrData;for(let F=0;F<R;F++)I=j.params[F],I>=30&&I<=37?(H.fg&=-50331904,H.fg|=16777216|I-30):I>=40&&I<=47?(H.bg&=-50331904,H.bg|=16777216|I-40):I>=90&&I<=97?(H.fg&=-50331904,H.fg|=16777224|I-90):I>=100&&I<=107?(H.bg&=-50331904,H.bg|=16777224|I-100):I===0?this._processSGR0(H):I===1?H.fg|=134217728:I===3?H.bg|=67108864:I===4?(H.fg|=268435456,this._processUnderline(j.hasSubParams(F)?j.getSubParams(F)[0]:1,H)):I===5?H.fg|=536870912:I===7?H.fg|=67108864:I===8?H.fg|=1073741824:I===9?H.fg|=2147483648:I===2?H.bg|=134217728:I===21?this._processUnderline(2,H):I===22?(H.fg&=-134217729,H.bg&=-134217729):I===23?H.bg&=-67108865:I===24?(H.fg&=-268435457,this._processUnderline(0,H)):I===25?H.fg&=-536870913:I===27?H.fg&=-67108865:I===28?H.fg&=-1073741825:I===29?H.fg&=2147483647:I===39?(H.fg&=-67108864,H.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):I===49?(H.bg&=-67108864,H.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?F+=this._extractColor(j,F,H):I===53?H.bg|=1073741824:I===55?H.bg&=-1073741825:I===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):I===100?(H.fg&=-67108864,H.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const R=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${R};${I}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const R=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${R};${I}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.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(j){const R=j.params[0]||1;switch(R){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 I=R%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(j){const R=j.params[0]||1;let I;return(j.length<2||(I=j.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>R&&(this._activeBuffer.scrollTop=R-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(j){if(!D(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const R=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:R!==2&&this._onRequestWindowsOptionsReport.fire(L.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(L.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:R!==0&&R!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),R!==0&&R!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:R!==0&&R!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),R!==0&&R!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const R=[],I=j.split(";");for(;I.length>1;){const H=I.shift(),F=I.shift();if(/^\d+$/.exec(H)){const G=parseInt(H);if(z(G))if(F==="?")R.push({type:0,index:G});else{const Z=(0,T.parseColor)(F);Z&&R.push({type:1,index:G,color:Z})}}}return R.length&&this._onColor.fire(R),!0}setHyperlink(j){const R=j.split(";");return!(R.length<2)&&(R[1]?this._createHyperlink(R[0],R[1]):!R[0]&&this._finishHyperlink())}_createHyperlink(j,R){this._getCurrentLinkId()&&this._finishHyperlink();const I=j.split(":");let H;const F=I.findIndex(G=>G.startsWith("id="));return F!==-1&&(H=I[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:R}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,R){const I=j.split(";");for(let H=0;H<I.length&&!(R>=this._specialColors.length);++H,++R)if(I[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[R]}]);else{const F=(0,T.parseColor)(I[H]);F&&this._onColor.fire([{type:1,index:this._specialColors[R],color:F}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const R=[],I=j.split(";");for(let H=0;H<I.length;++H)if(/^\d+$/.exec(I[H])){const F=parseInt(I[H]);z(F)&&R.push({type:2,index:F})}return R.length&&this._onColor.fire(R),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,f.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(A[j[0]],f.CHARSETS[j[1]]||f.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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new y.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let R=0;R<this._bufferService.rows;++R){const I=this._activeBuffer.ybase+this._activeBuffer.y+R,H=this._activeBuffer.lines.get(I);H&&(H.fill(j),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,R){const I=this._bufferService.buffer,H=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${F}${d.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,R){this._dirtyRowTracker.markRangeDirty(j,R)}}o.InputHandler=O;let B=class{constructor(P){this._bufferService=P,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(P){P<this.start?this.start=P:P>this.end&&(this.end=P)}markRangeDirty(P,j){P>j&&(N=P,P=j,j=N),P<this.start&&(this.start=P),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function z(P){return 0<=P&&P<256}B=u([h(0,C.IBufferService)],B)},844:(a,o)=>{function l(u){for(const h of u)h.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const h=this._disposables.indexOf(u);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var h;this._isDisposed||u===this._value||((h=this._value)==null||h.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(h,d,f){this._data[h]||(this._data[h]={}),this._data[h][d]=f}get(h,d){return this._data[h]?this._data[h][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,h,d,f,g){this._data.get(u,h)||this._data.set(u,h,new l),this._data.get(u,h).set(d,f,g)}get(u,h,d,f){var g;return(g=this._data.get(u,h))==null?void 0:g.get(d,f)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const h=l.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(l=this._search(this._getKey(u)),this._array.splice(l,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const h=this._getKey(u);if(h===void 0||(l=this._search(h),l===-1)||this._getKey(this._array[l])!==h)return!1;do if(this._array[l]===u)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===h);return!1}*getKeyIterator(u){if(this._array.length!==0&&(l=this._search(u),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===u))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===u)}forEachByKey(u,h){if(this._array.length!==0&&(l=this._search(u),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===u))do h(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===u)}values(){return[...this._array].values()}_search(u){let h=0,d=this._array.length-1;for(;d>=h;){let f=h+d>>1;const g=this._getKey(this._array[f]);if(g>u)d=f-1;else{if(!(g<u)){for(;f>0&&this._getKey(this._array[f-1])===u;)f--;return f}h=f+1}}return h}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(6114);class h{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 b=0,x=0,v=g.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),x=Math.max(b,x),m=g.timeRemaining(),1.5*x>m)return v-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-b))}ms`),void this._start();v=m}this.clear()}}class d extends h{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const b=Date.now()+g;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=l(643);o.updateWindowsModeWrappedState=function(h){const d=h.buffer.lines.get(h.buffer.ybase+h.buffer.y-1),f=d==null?void 0:d.get(h.cols-1),g=h.buffer.lines.get(h.buffer.ybase+h.buffer.y);g&&f&&(g.isWrapped=f[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&f[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,f=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=f}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=l(6349),h=l(7226),d=l(3734),f=l(8437),g=l(4634),b=l(511),x=l(643),v=l(4863),m=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(p,y,_){this._hasScrollback=p,this._optionsService=y,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=m.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new h.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,y){return new f.BufferLine(this._bufferService.cols,this.getNullCell(p),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&p<this._rows}_getCorrectBufferLength(p){if(!this._hasScrollback)return p;const y=p+this._optionsService.rawOptions.scrollback;return y>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=f.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(p))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(p,y){const _=this.getNullCell(f.DEFAULT_ATTR_DATA);let C=0;const S=this._getCorrectBufferLength(y);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<p)for(let k=0;k<this.lines.length;k++)C+=+this.lines.get(k).resize(p,_);let E=0;if(this._rows<y)for(let k=this._rows;k<y;k++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(p,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(p,_)));else for(let k=this._rows;k>y;k--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const k=this.lines.length-S;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=S}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,y-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(p,y),this._cols>p))for(let E=0;E<this.lines.length;E++)C+=+this.lines.get(E).resize(p,_);this._cols=p,this._rows=y,this._memoryCleanupQueue.clear(),C>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,y){this._cols!==p&&(p>this._cols?this._reflowLarger(p,y):this._reflowSmaller(p,y))}_reflowLarger(p,y){const _=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(_.length>0){const C=(0,g.reflowLargerCreateNewLayout)(this.lines,_);(0,g.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(p,y,C.countRemoved)}}_reflowLargerAdjustViewport(p,y,_){const C=this.getNullCell(f.DEFAULT_ATTR_DATA);let S=_;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new f.BufferLine(p,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(p,y){const _=this.getNullCell(f.DEFAULT_ATTR_DATA),C=[];let S=0;for(let E=this.lines.length-1;E>=0;E--){let k=this.lines.get(E);if(!k||!k.isWrapped&&k.getTrimmedLength()<=p)continue;const T=[k];for(;k.isWrapped&&E>0;)k=this.lines.get(--E),T.unshift(k);const A=this.ybase+this.y;if(A>=E&&A<E+T.length)continue;const M=T[T.length-1].getTrimmedLength(),D=(0,g.reflowSmallerGetNewLineLengths)(T,this._cols,p),L=D.length-T.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const O=[];for(let I=0;I<L;I++){const H=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);O.push(H)}O.length>0&&(C.push({start:E+T.length+S,newLines:O}),S+=O.length),T.push(...O);let B=D.length-1,z=D[B];z===0&&(B--,z=D[B]);let P=T.length-L-1,j=M;for(;P>=0;){const I=Math.min(j,z);if(T[B]===void 0)break;if(T[B].copyCellsFrom(T[P],j-I,z-I,I,!0),z-=I,z===0&&(B--,z=D[B]),j-=I,j===0){P--;const H=Math.max(P,0);j=(0,g.getWrappedLineTrimmedLength)(T,H,this._cols)}}for(let I=0;I<T.length;I++)D[I]<p&&T[I].setCell(D[I],_);let R=L-N;for(;R-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+y-1)}if(C.length>0){const E=[],k=[];for(let B=0;B<this.lines.length;B++)k.push(this.lines.get(B));const T=this.lines.length;let A=T-1,M=0,D=C[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let L=0;for(let B=Math.min(this.lines.maxLength-1,T+S-1);B>=0;B--)if(D&&D.start>A+L){for(let z=D.newLines.length-1;z>=0;z--)this.lines.set(B--,D.newLines[z]);B++,E.push({index:A+1,amount:D.newLines.length}),L+=D.newLines.length,D=C[++M]}else this.lines.set(B,k[A--]);let N=0;for(let B=E.length-1;B>=0;B--)E[B].index+=N,this.lines.onInsertEmitter.fire(E[B]),N+=E[B].amount;const O=Math.max(0,T+S-this.lines.maxLength);O>0&&this.lines.onTrimEmitter.fire(O)}}translateBufferLineToString(p,y,_=0,C){const S=this.lines.get(p);return S?S.translateToString(y,_,C):""}getWrappedRangeForLine(p){let y=p,_=p;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:y,last:_}}setupTabStops(p){for(p!=null?this.tabs[p]||(p=this.prevStop(p)):(this.tabs={},p=0);p<this._cols;p+=this._optionsService.rawOptions.tabStopWidth)this.tabs[p]=!0}prevStop(p){for(p==null&&(p=this.x);!this.tabs[--p]&&p>0;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p<this._cols;);return p>=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===p&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].dispose(),this.markers.splice(p--,1);this._isClearing=!1}addMarker(p){const y=new v.Marker(p);return this.markers.push(y),y.register(this.lines.onTrim(_=>{y.line-=_,y.line<0&&y.dispose()})),y.register(this.lines.onInsert(_=>{y.line>=_.index&&(y.line+=_.amount)})),y.register(this.lines.onDelete(_=>{y.line>=_.index&&y.line<_.index+_.amount&&y.dispose(),y.line>_.index&&(y.line-=_.amount)})),y.register(y.onDispose(()=>this._removeMarker(y))),y}_removeMarker(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=l(3734),h=l(511),d=l(643),f=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let g=0;class b{constructor(v,m,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=m||h.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let _=0;_<v;++_)this.setCell(_,y);this.length=v}get(v){const m=this._data[3*v+0],p=2097151&m;return[this._data[3*v+1],2097152&m?this._combined[v]:p?(0,f.stringFromCodePoint)(p):"",m>>22,2097152&m?this._combined[v].charCodeAt(this._combined[v].length-1):p]}set(v,m){this._data[3*v+1]=m[d.CHAR_DATA_ATTR_INDEX],m[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=m[1],this._data[3*v+0]=2097152|v|m[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=m[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const m=this._data[3*v+0];return 2097152&m?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&m}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const m=this._data[3*v+0];return 2097152&m?this._combined[v]:2097151&m?(0,f.stringFromCodePoint)(2097151&m):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,m){return g=3*v,m.content=this._data[g+0],m.fg=this._data[g+1],m.bg=this._data[g+2],2097152&m.content&&(m.combinedData=this._combined[v]),268435456&m.bg&&(m.extended=this._extendedAttrs[v]),m}setCell(v,m){2097152&m.content&&(this._combined[v]=m.combinedData),268435456&m.bg&&(this._extendedAttrs[v]=m.extended),this._data[3*v+0]=m.content,this._data[3*v+1]=m.fg,this._data[3*v+2]=m.bg}setCellFromCodepoint(v,m,p,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=m|p<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,m,p){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,f.stringFromCodePoint)(m):2097151&y?(this._combined[v]=(0,f.stringFromCodePoint)(2097151&y)+(0,f.stringFromCodePoint)(m),y&=-2097152,y|=2097152):y=m|4194304,p&&(y&=-12582913,y|=p<<22),this._data[3*v+0]=y}insertCells(v,m,p){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),m<this.length-v){const y=new h.CellData;for(let _=this.length-v-m-1;_>=0;--_)this.setCell(v+m+_,this.loadCell(v+_,y));for(let _=0;_<m;++_)this.setCell(v+_,p)}else for(let y=v;y<this.length;++y)this.setCell(y,p);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,p)}deleteCells(v,m,p){if(v%=this.length,m<this.length-v){const y=new h.CellData;for(let _=0;_<this.length-v-m;++_)this.setCell(v+_,this.loadCell(v+m+_,y));for(let _=this.length-m;_<this.length;++_)this.setCell(_,p)}else for(let y=v;y<this.length;++y)this.setCell(y,p);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,p)}replaceCells(v,m,p,y=!1){if(y)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,p),m<this.length&&this.getWidth(m-1)===2&&!this.isProtected(m)&&this.setCellFromCodepoint(m,0,1,p);v<m&&v<this.length;)this.isProtected(v)||this.setCell(v,p),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),m<this.length&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m,0,1,p);v<m&&v<this.length;)this.setCell(v++,p)}resize(v,m){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const p=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const y=new Uint32Array(p);y.set(this._data),this._data=y}for(let y=this.length;y<v;++y)this.setCell(y,m)}else{this._data=this._data.subarray(0,p);const y=Object.keys(this._combined);for(let C=0;C<y.length;C++){const S=parseInt(y[C],10);S>=v&&delete this._combined[S]}const _=Object.keys(this._extendedAttrs);for(let C=0;C<_.length;C++){const S=parseInt(_[C],10);S>=v&&delete this._extendedAttrs[S]}}return this.length=v,4*p*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,m=!1){if(m)for(let p=0;p<this.length;++p)this.isProtected(p)||this.setCell(p,v);else{this._combined={},this._extendedAttrs={};for(let p=0;p<this.length;++p)this.setCell(p,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const m in v._combined)this._combined[m]=v._combined[m];this._extendedAttrs={};for(const m in v._extendedAttrs)this._extendedAttrs[m]=v._extendedAttrs[m];this.isWrapped=v.isWrapped}clone(){const v=new b(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const m in this._combined)v._combined[m]=this._combined[m];for(const m in this._extendedAttrs)v._extendedAttrs[m]=this._extendedAttrs[m];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,m,p,y,_){const C=v._data;if(_)for(let E=y-1;E>=0;E--){for(let k=0;k<3;k++)this._data[3*(p+E)+k]=C[3*(m+E)+k];268435456&C[3*(m+E)+2]&&(this._extendedAttrs[p+E]=v._extendedAttrs[m+E])}else for(let E=0;E<y;E++){for(let k=0;k<3;k++)this._data[3*(p+E)+k]=C[3*(m+E)+k];268435456&C[3*(m+E)+2]&&(this._extendedAttrs[p+E]=v._extendedAttrs[m+E])}const S=Object.keys(v._combined);for(let E=0;E<S.length;E++){const k=parseInt(S[E],10);k>=m&&(this._combined[k-m+p]=v._combined[k])}}translateToString(v,m,p,y){m=m??0,p=p??this.length,v&&(p=Math.min(p,this.getTrimmedLength())),y&&(y.length=0);let _="";for(;m<p;){const C=this._data[3*m+0],S=2097151&C,E=2097152&C?this._combined[m]:S?(0,f.stringFromCodePoint)(S):d.WHITESPACE_CELL_CHAR;if(_+=E,y)for(let k=0;k<E.length;++k)y.push(m);m+=C>>22||1}return y&&y.push(m),_}}o.BufferLine=b},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,u){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 u*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(u,h,d){if(h===u.length-1)return u[h].getTrimmedLength();const f=!u[h].hasContent(d-1)&&u[h].getWidth(d-1)===1,g=u[h+1].getWidth(0)===2;return f&&g?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,h,d,f,g){const b=[];for(let x=0;x<u.length-1;x++){let v=x,m=u.get(++v);if(!m.isWrapped)continue;const p=[u.get(x)];for(;v<u.length&&m.isWrapped;)p.push(m),m=u.get(++v);if(f>=x&&f<v){x+=p.length-1;continue}let y=0,_=l(p,y,h),C=1,S=0;for(;C<p.length;){const k=l(p,C,h),T=k-S,A=d-_,M=Math.min(T,A);p[y].copyCellsFrom(p[C],S,_,M,!1),_+=M,_===d&&(y++,_=0),S+=M,S===k&&(C++,S=0),_===0&&y!==0&&p[y-1].getWidth(d-1)===2&&(p[y].copyCellsFrom(p[y-1],d-1,_++,1,!1),p[y-1].setCell(d-1,g))}p[y].replaceCells(_,d,g);let E=0;for(let k=p.length-1;k>0&&(k>y||p[k].getTrimmedLength()===0);k--)E++;E>0&&(b.push(x+p.length-E),b.push(E)),x+=p.length-1}return b},o.reflowLargerCreateNewLayout=function(u,h){const d=[];let f=0,g=h[f],b=0;for(let x=0;x<u.length;x++)if(g===x){const v=h[++f];u.onDeleteEmitter.fire({index:x-b,amount:v}),x+=v-1,b+=v,g=h[++f]}else d.push(x);return{layout:d,countRemoved:b}},o.reflowLargerApplyNewLayout=function(u,h){const d=[];for(let f=0;f<h.length;f++)d.push(u.get(h[f]));for(let f=0;f<d.length;f++)u.set(f,d[f]);u.length=h.length},o.reflowSmallerGetNewLineLengths=function(u,h,d){const f=[],g=u.map((m,p)=>l(u,p,h)).reduce((m,p)=>m+p);let b=0,x=0,v=0;for(;v<g;){if(g-v<d){f.push(g-v);break}b+=d;const m=l(u,x,h);b>m&&(b-=m,x++);const p=u[x].getWidth(b-1)===2;p&&b--;const y=p?d-1:d;f.push(y),v+=y}return f},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=l(8460),h=l(844),d=l(9092);class f extends h.Disposable{constructor(b,x){super(),this._optionsService=b,this._bufferService=x,this._onBufferActivate=this.register(new u.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,x){this._normal.resize(b,x),this._alt.resize(b,x),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}o.BufferSet=f},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(482),h=l(643),d=l(3734);class f extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const x=new f;return x.setFromCharData(b),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(b[h.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(b[h.CHAR_DATA_CHAR_INDEX].length===2){const v=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const m=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(v-55296)+m-56320+65536|b[h.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=b[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=f},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=l(8460),h=l(844);class d{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,h.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,u,h;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT="	",d.LF=`
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(l||(o.C0=l={})),function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""}(u||(o.C1=u={})),function(d){d.ST=`${l.ESC}\\`}(h||(o.C1_ESCAPED=h={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),h={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:["'",'"']};o.evaluateKeyboardEvent=function(d,f,g,b){const x={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?x.key=f?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?x.key=f?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?x.key=f?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(x.key=f?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:x.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(x.key=u.C0.ESC+x.key);break;case 9:if(d.shiftKey){x.key=u.C0.ESC+"[Z";break}x.key=u.C0.HT,x.cancel=!0;break;case 13:x.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,x.cancel=!0;break;case 27:x.key=u.C0.ESC,d.altKey&&(x.key=u.C0.ESC+u.C0.ESC),x.cancel=!0;break;case 37:if(d.metaKey)break;v?(x.key=u.C0.ESC+"[1;"+(v+1)+"D",x.key===u.C0.ESC+"[1;3D"&&(x.key=u.C0.ESC+(g?"b":"[1;5D"))):x.key=f?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(x.key=u.C0.ESC+"[1;"+(v+1)+"C",x.key===u.C0.ESC+"[1;3C"&&(x.key=u.C0.ESC+(g?"f":"[1;5C"))):x.key=f?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(x.key=u.C0.ESC+"[1;"+(v+1)+"A",g||x.key!==u.C0.ESC+"[1;3A"||(x.key=u.C0.ESC+"[1;5A")):x.key=f?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(x.key=u.C0.ESC+"[1;"+(v+1)+"B",g||x.key!==u.C0.ESC+"[1;3B"||(x.key=u.C0.ESC+"[1;5B")):x.key=f?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(x.key=u.C0.ESC+"[2~");break;case 46:x.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:x.key=v?u.C0.ESC+"[1;"+(v+1)+"H":f?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:x.key=v?u.C0.ESC+"[1;"+(v+1)+"F":f?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?x.type=2:d.ctrlKey?x.key=u.C0.ESC+"[5;"+(v+1)+"~":x.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?x.type=3:d.ctrlKey?x.key=u.C0.ESC+"[6;"+(v+1)+"~":x.key=u.C0.ESC+"[6~";break;case 112:x.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:x.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:x.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:x.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:x.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:x.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:x.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:x.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:x.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:x.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:x.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:x.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(g&&!b||!d.altKey||d.metaKey)!g||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?x.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(x.key=u.C0.US),d.key==="@"&&(x.key=u.C0.NUL)):d.keyCode===65&&(x.type=1);else{const m=h[d.keyCode],p=m==null?void 0:m[d.shiftKey?1:0];if(p)x.key=u.C0.ESC+p;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let _=String.fromCharCode(y);d.shiftKey&&(_=_.toUpperCase()),x.key=u.C0.ESC+_}else if(d.keyCode===32)x.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),x.key=u.C0.ESC+y,x.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?x.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?x.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?x.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?x.key=u.C0.DEL:d.keyCode===219?x.key=u.C0.ESC:d.keyCode===220?x.key=u.C0.FS:d.keyCode===221&&(x.key=u.C0.GS)}return x}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,h=l.length){let d="";for(let f=u;f<h;++f){let g=l[f];g>65535?(g-=65536,d+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):d+=String.fromCharCode(g)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const h=l.length;if(!h)return 0;let d=0,f=0;if(this._interim){const g=l.charCodeAt(f++);56320<=g&&g<=57343?u[d++]=1024*(this._interim-55296)+g-56320+65536:(u[d++]=this._interim,u[d++]=g),this._interim=0}for(let g=f;g<h;++g){const b=l.charCodeAt(g);if(55296<=b&&b<=56319){if(++g>=h)return this._interim=b,d;const x=l.charCodeAt(g);56320<=x&&x<=57343?u[d++]=1024*(b-55296)+x-56320+65536:(u[d++]=b,u[d++]=x)}else b!==65279&&(u[d++]=b)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const h=l.length;if(!h)return 0;let d,f,g,b,x=0,v=0,m=0;if(this.interim[0]){let _=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let S,E=0;for(;(S=63&this.interim[++E])&&E<4;)C<<=6,C|=S;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=k-E;for(;m<T;){if(m>=h)return 0;if(S=l[m++],(192&S)!=128){m--,_=!0;break}this.interim[E++]=S,C<<=6,C|=63&S}_||(k===2?C<128?m--:u[x++]=C:k===3?C<2048||C>=55296&&C<=57343||C===65279||(u[x++]=C):C<65536||C>1114111||(u[x++]=C)),this.interim.fill(0)}const p=h-4;let y=m;for(;y<h;){for(;!(!(y<p)||128&(d=l[y])||128&(f=l[y+1])||128&(g=l[y+2])||128&(b=l[y+3]));)u[x++]=d,u[x++]=f,u[x++]=g,u[x++]=b,y+=4;if(d=l[y++],d<128)u[x++]=d;else if((224&d)==192){if(y>=h)return this.interim[0]=d,x;if(f=l[y++],(192&f)!=128){y--;continue}if(v=(31&d)<<6|63&f,v<128){y--;continue}u[x++]=v}else if((240&d)==224){if(y>=h)return this.interim[0]=d,x;if(f=l[y++],(192&f)!=128){y--;continue}if(y>=h)return this.interim[0]=d,this.interim[1]=f,x;if(g=l[y++],(192&g)!=128){y--;continue}if(v=(15&d)<<12|(63&f)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;u[x++]=v}else if((248&d)==240){if(y>=h)return this.interim[0]=d,x;if(f=l[y++],(192&f)!=128){y--;continue}if(y>=h)return this.interim[0]=d,this.interim[1]=f,x;if(g=l[y++],(192&g)!=128){y--;continue}if(y>=h)return this.interim[0]=d,this.interim[1]=f,this.interim[2]=g,x;if(b=l[y++],(192&b)!=128){y--;continue}if(v=(7&d)<<18|(63&f)<<12|(63&g)<<6|63&b,v<65536||v>1114111)continue;u[x++]=v}}return x}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),h=[[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]],d=[[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 f;o.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let g=0;g<h.length;++g)f.fill(0,h[g][0],h[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?f[g]:function(b,x){let v,m=0,p=x.length-1;if(b<x[0][0]||b>x[p][1])return!1;for(;p>=m;)if(v=m+p>>1,b>x[v][1])m=v+1;else{if(!(b<x[v][0]))return!0;p=v-1}return!1}(g,d)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,b){let x=this.wcwidth(g),v=x===0&&b!==0;if(v){const m=u.UnicodeService.extractWidth(b);m===0?v=!1:m>x&&(x=m)}return u.UnicodeService.createPropertyValue(0,x,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),h=l(844);class d extends h.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 u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,b){if(b!==void 0&&this._syncCalls>b)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 x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,b){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(b),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(b)}_innerWrite(g=0,b=!0){const x=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],m=this._action(v,b);if(m){const y=_=>Date.now()-x>=12?setTimeout(()=>this._innerWrite(0,_)):this._innerWrite(x,_);return void m.catch(_=>(queueMicrotask(()=>{throw _}),Promise.resolve(!1))).then(y)}const p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-x>=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()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.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})$/,u=/^[\da-f]+$/;function h(d,f){const g=d.toString(16),b=g.length<2?"0"+g:g;switch(f){case 4:return g[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}o.parseColor=function(d){if(!d)return;let f=d.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const g=l.exec(f);if(g){const b=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/b*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/b*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/b*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),u.exec(f)&&[3,6,9,12].includes(f.length))){const g=f.length/3,b=[0,0,0];for(let x=0;x<3;++x){const v=parseInt(f.slice(g*x,g*x+g),16);b[x]=g===1?v<<4:g===2?v:g===3?v>>4:v>>8}return b}},o.toRgbString=function(d,f=16){const[g,b,x]=d;return`rgb:${h(g,f)}/${h(b,f)}/${h(x,f)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),h=l(8742),d=l(5770),f=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(b,x){this._handlers[b]===void 0&&(this._handlers[b]=[]);const v=this._handlers[b];return v.push(x),{dispose:()=>{const m=v.indexOf(x);m!==-1&&v.splice(m,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(b,x){if(this.reset(),this._ident=b,this._active=this._handlers[b]||f,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(b,x,v){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(b,x,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(b,x,v))}unhook(b,x=!0){if(this._active.length){let v=!1,m=this._active.length-1,p=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,v=x,p=this._stack.fallThrough,this._stack.paused=!1),!p&&v===!1){for(;m>=0&&(v=this._active[m].unhook(b),v!==!0);m--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,v;m--}for(;m>=0;m--)if(v=this._active[m].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",b);this._active=f,this._ident=0}};const g=new h.Params;g.addParam(0),o.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=g,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():g,this._data="",this._hitLimit=!1}put(b,x,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(b,x,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let x=!1;if(this._hitLimit)x=!1;else if(b&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then(v=>(this._params=g,this._data="",this._hitLimit=!1,v));return this._params=g,this._data="",this._hitLimit=!1,x}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),h=l(8742),d=l(6242),f=l(6351);class g{constructor(m){this.table=new Uint8Array(m)}setDefault(m,p){this.table.fill(m<<4|p)}add(m,p,y,_){this.table[p<<8|m]=y<<4|_}addMany(m,p,y,_){for(let C=0;C<m.length;C++)this.table[p<<8|m[C]]=y<<4|_}}o.TransitionTable=g;const b=160;o.VT500_TRANSITION_TABLE=function(){const v=new g(4095),m=Array.apply(null,Array(256)).map((E,k)=>k),p=(E,k)=>m.slice(E,k),y=p(32,127),_=p(0,24);_.push(25),_.push.apply(_,p(28,32));const C=p(0,14);let S;for(S in v.setDefault(1,0),v.addMany(y,0,2,0),C)v.addMany([24,26,153,154],S,3,0),v.addMany(p(128,144),S,3,0),v.addMany(p(144,152),S,3,0),v.add(156,S,0,0),v.add(27,S,11,1),v.add(157,S,4,8),v.addMany([152,158,159],S,0,7),v.add(155,S,11,3),v.add(144,S,11,9);return v.addMany(_,0,3,0),v.addMany(_,1,3,1),v.add(127,1,0,1),v.addMany(_,8,0,8),v.addMany(_,3,3,3),v.add(127,3,0,3),v.addMany(_,4,3,4),v.add(127,4,0,4),v.addMany(_,6,3,6),v.addMany(_,5,3,5),v.add(127,5,0,5),v.addMany(_,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(p(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(_,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(p(64,127),3,7,0),v.addMany(p(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(p(48,60),4,8,4),v.addMany(p(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(p(32,64),6,0,6),v.add(127,6,0,6),v.addMany(p(64,127),6,0,0),v.addMany(p(32,48),3,9,5),v.addMany(p(32,48),5,9,5),v.addMany(p(48,64),5,0,6),v.addMany(p(64,127),5,7,0),v.addMany(p(32,48),4,9,5),v.addMany(p(32,48),1,9,2),v.addMany(p(32,48),2,9,2),v.addMany(p(48,127),2,10,0),v.addMany(p(48,80),1,10,0),v.addMany(p(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(p(96,127),1,10,0),v.add(80,1,11,9),v.addMany(_,9,0,9),v.add(127,9,0,9),v.addMany(p(28,32),9,0,9),v.addMany(p(32,48),9,9,12),v.addMany(p(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(_,11,0,11),v.addMany(p(32,128),11,0,11),v.addMany(p(28,32),11,0,11),v.addMany(_,10,0,10),v.add(127,10,0,10),v.addMany(p(28,32),10,0,10),v.addMany(p(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(p(32,48),10,9,12),v.addMany(_,12,0,12),v.add(127,12,0,12),v.addMany(p(28,32),12,0,12),v.addMany(p(32,48),12,9,12),v.addMany(p(48,64),12,0,11),v.addMany(p(64,127),12,12,13),v.addMany(p(64,127),10,12,13),v.addMany(p(64,127),9,12,13),v.addMany(_,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(b,0,2,0),v.add(b,8,5,8),v.add(b,6,0,6),v.add(b,11,0,11),v.add(b,13,13,13),v}();class x extends u.Disposable{constructor(m=o.VT500_TRANSITION_TABLE){super(),this._transitions=m,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(p,y,_)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,y)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(m,p=[64,126]){let y=0;if(m.prefix){if(m.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=m.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(m.intermediates){if(m.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<m.intermediates.length;++C){const S=m.intermediates.charCodeAt(C);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=S}}if(m.final.length!==1)throw new Error("final must be a single byte");const _=m.final.charCodeAt(0);if(p[0]>_||_>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return y<<=8,y|=_,y}identToString(m){const p=[];for(;m;)p.push(String.fromCharCode(255&m)),m>>=8;return p.reverse().join("")}setPrintHandler(m){this._printHandler=m}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(m,p){const y=this._identifier(m,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const _=this._escHandlers[y];return _.push(p),{dispose:()=>{const C=_.indexOf(p);C!==-1&&_.splice(C,1)}}}clearEscHandler(m){this._escHandlers[this._identifier(m,[48,126])]&&delete this._escHandlers[this._identifier(m,[48,126])]}setEscHandlerFallback(m){this._escHandlerFb=m}setExecuteHandler(m,p){this._executeHandlers[m.charCodeAt(0)]=p}clearExecuteHandler(m){this._executeHandlers[m.charCodeAt(0)]&&delete this._executeHandlers[m.charCodeAt(0)]}setExecuteHandlerFallback(m){this._executeHandlerFb=m}registerCsiHandler(m,p){const y=this._identifier(m);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const _=this._csiHandlers[y];return _.push(p),{dispose:()=>{const C=_.indexOf(p);C!==-1&&_.splice(C,1)}}}clearCsiHandler(m){this._csiHandlers[this._identifier(m)]&&delete this._csiHandlers[this._identifier(m)]}setCsiHandlerFallback(m){this._csiHandlerFb=m}registerDcsHandler(m,p){return this._dcsParser.registerHandler(this._identifier(m),p)}clearDcsHandler(m){this._dcsParser.clearHandler(this._identifier(m))}setDcsHandlerFallback(m){this._dcsParser.setHandlerFallback(m)}registerOscHandler(m,p){return this._oscParser.registerHandler(m,p)}clearOscHandler(m){this._oscParser.clearHandler(m)}setOscHandlerFallback(m){this._oscParser.setHandlerFallback(m)}setErrorHandler(m){this._errorHandler=m}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(m,p,y,_,C){this._parseStack.state=m,this._parseStack.handlers=p,this._parseStack.handlerPos=y,this._parseStack.transition=_,this._parseStack.chunkPos=C}parse(m,p,y){let _,C=0,S=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let T=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&T>-1){for(;T>=0&&(_=k[T](this._params),_!==!0);T--)if(_ instanceof Promise)return this._parseStack.handlerPos=T,_}this._parseStack.handlers=[];break;case 4:if(y===!1&&T>-1){for(;T>=0&&(_=k[T](),_!==!0);T--)if(_ instanceof Promise)return this._parseStack.handlerPos=T,_}this._parseStack.handlers=[];break;case 6:if(C=m[this._parseStack.chunkPos],_=this._dcsParser.unhook(C!==24&&C!==26,y),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=m[this._parseStack.chunkPos],_=this._oscParser.end(C!==24&&C!==26,y),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=E;k<p;++k){switch(C=m[k],S=this._transitions.table[this.currentState<<8|(C<160?C:b)],S>>4){case 2:for(let L=k+1;;++L){if(L>=p||(C=m[L])<32||C>126&&C<b){this._printHandler(m,k,L),k=L-1;break}if(++L>=p||(C=m[L])<32||C>126&&C<b){this._printHandler(m,k,L),k=L-1;break}if(++L>=p||(C=m[L])<32||C>126&&C<b){this._printHandler(m,k,L),k=L-1;break}if(++L>=p||(C=m[L])<32||C>126&&C<b){this._printHandler(m,k,L),k=L-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const T=this._csiHandlers[this._collect<<8|C];let A=T?T.length-1:-1;for(;A>=0&&(_=T[A](this._params),_!==!0);A--)if(_ instanceof Promise)return this._preserveStack(3,T,A,S,k),_;A<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++k<p&&(C=m[k])>47&&C<60);k--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const M=this._escHandlers[this._collect<<8|C];let D=M?M.length-1:-1;for(;D>=0&&(_=M[D](),_!==!0);D--)if(_ instanceof Promise)return this._preserveStack(4,M,D,S,k),_;D<0&&this._escHandlerFb(this._collect<<8|C),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|C,this._params);break;case 13:for(let L=k+1;;++L)if(L>=p||(C=m[L])===24||C===26||C===27||C>127&&C<b){this._dcsParser.put(m,k,L),k=L-1;break}break;case 14:if(_=this._dcsParser.unhook(C!==24&&C!==26),_)return this._preserveStack(6,[],0,S,k),_;C===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let L=k+1;;L++)if(L>=p||(C=m[L])<32||C>127&&C<b){this._oscParser.put(m,k,L),k=L-1;break}break;case 6:if(_=this._oscParser.end(C!==24&&C!==26),_)return this._preserveStack(5,[],0,S,k),_;C===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}o.EscapeSequenceParser=x},6242:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),h=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,g){this._handlers[f]===void 0&&(this._handlers[f]=[]);const b=this._handlers[f];return b.push(g),{dispose:()=>{const x=b.indexOf(g);x!==-1&&b.splice(x,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,g,b){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(f,g,b);else this._handlerFb(this._id,"PUT",(0,h.utf32ToString)(f,g,b))}start(){this.reset(),this._state=1}put(f,g,b){if(this._state!==3){if(this._state===1)for(;g<b;){const x=f[g++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&b-g>0&&this._put(f,g,b)}}end(f,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,x=this._active.length-1,v=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,b=g,v=this._stack.fallThrough,this._stack.paused=!1),!v&&b===!1){for(;x>=0&&(b=this._active[x].end(f),b!==!0);x--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,b;x--}for(;x>=0;x--)if(b=this._active[x].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",f);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,g,b){this._hitLimit||(this._data+=(0,h.utf32ToString)(f,g,b),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let g=!1;if(this._hitLimit)g=!1;else if(f&&(g=this._handler(this._data),g instanceof Promise))return g.then(b=>(this._data="",this._hitLimit=!1,b));return this._data="",this._hitLimit=!1,g}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(d){const f=new u;if(!d.length)return f;for(let g=Array.isArray(d[0])?1:0;g<d.length;++g){const b=d[g];if(Array.isArray(b))for(let x=0;x<b.length;++x)f.addSubParam(b[x]);else f.addParam(b)}return f}constructor(d=32,f=32){if(this.maxLength=d,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let f=0;f<this.length;++f){d.push(this.params[f]);const g=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];b-g>0&&d.push(Array.prototype.slice.call(this._subParams,g,b))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const f=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];return g-f>0?this._subParams.subarray(f,g):null}getSubParamsAll(){const d={};for(let f=0;f<this.length;++f){const g=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];b-g>0&&(d[f]=this._subParams.slice(g,b))}return d}addDigit(d){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,b=g[f-1];g[f-1]=~b?Math.min(10*b+d,l):d}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const h={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(h),u.dispose=()=>this._wrappedAddonDispose(h),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let h=0;h<this._addons.length;h++)if(this._addons[h]===l){u=h;break}if(u===-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(u,1)}}},8771:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),h=l(511);o.BufferApiView=class{constructor(d,f){this._buffer=d,this.type=f}init(d){return this._buffer=d,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(d){const f=this._buffer.lines.get(d);if(f)return new u.BufferLineApiView(f)}getNullCell(){return new h.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(h){this._line=h}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(h,d){if(!(h<0||h>=this._line.length))return d?(this._line.loadCell(h,d),d):this._line.loadCell(h,new u.CellData)}translateToString(h,d,f){return this._line.translateToString(h,d,f)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),h=l(8460),d=l(844);class f extends d.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new h.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.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)}}o.BufferNamespaceApi=f},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,h=>u(h.toArray()))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,(h,d)=>u(h,d.toArray()))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.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,o,l){var u=this&&this.__decorate||function(v,m,p,y){var _,C=arguments.length,S=C<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,m,p,y);else for(var E=v.length-1;E>=0;E--)(_=v[E])&&(S=(C<3?_(S):C>3?_(m,p,S):_(m,p))||S);return C>3&&S&&Object.defineProperty(m,p,S),S},h=this&&this.__param||function(v,m){return function(p,y){m(p,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),f=l(844),g=l(5295),b=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let x=o.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(v,this))}resize(v,m){this.cols=v,this.rows=m,this.buffers.resize(v,m),this._onResize.fire({cols:v,rows:m})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,m=!1){const p=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=p.getBlankLine(v,m),this._cachedBlankLine=y),y.isWrapped=m;const _=p.ybase+p.scrollTop,C=p.ybase+p.scrollBottom;if(p.scrollTop===0){const S=p.lines.isFull;C===p.lines.length-1?S?p.lines.recycle().copyFrom(y):p.lines.push(y.clone()):p.lines.splice(C+1,0,y.clone()),S?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const S=C-_+1;p.lines.shiftElements(_+1,S-1,-1),p.lines.set(C,y.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(v,m,p){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const _=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),_!==y.ydisp&&(m||this._onScroll.fire(y.ydisp))}};o.BufferService=x=u([h(0,b.IOptionsService)],x)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.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,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(a,o,l){var u=this&&this.__decorate||function(y,_,C,S){var E,k=arguments.length,T=k<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,C):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,_,C,S);else for(var A=y.length-1;A>=0;A--)(E=y[A])&&(T=(k<3?E(T):k>3?E(_,C,T):E(_,C))||T);return k>3&&T&&Object.defineProperty(_,C,T),T},h=this&&this.__param||function(y,_){return function(C,S){_(C,S,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),f=l(8460),g=l(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function x(y,_){let C=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(C|=64,C|=y.action):(C|=3&y.button,4&y.button&&(C|=64),8&y.button&&(C|=128),y.action===32?C|=32:y.action!==0||_||(C|=3)),C}const v=String.fromCharCode,m={DEFAULT:y=>{const _=[x(y,!1)+32,y.col+32,y.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${v(_[0])}${v(_[1])}${v(_[2])}`},SGR:y=>{const _=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${x(y,!0)};${y.col};${y.row}${_}`},SGR_PIXELS:y=>{const _=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${x(y,!0)};${y.x};${y.y}${_}`}};let p=o.CoreMouseService=class extends g.Disposable{constructor(y,_){super(),this._bufferService=y,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(b))this.addProtocol(C,b[C]);for(const C of Object.keys(m))this.addEncoding(C,m[C]);this.reset()}addProtocol(y,_){this._protocols[y]=_}addEncoding(y,_){this._encodings[y]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const _=this._encodings[this._activeEncoding](y);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,_,C){if(C){if(y.x!==_.x||y.y!==_.y)return!1}else if(y.col!==_.col||y.row!==_.row)return!1;return y.button===_.button&&y.action===_.action&&y.ctrl===_.ctrl&&y.alt===_.alt&&y.shift===_.shift}};o.CoreMouseService=p=u([h(0,d.IBufferService),h(1,d.ICoreService)],p)},6975:function(a,o,l){var u=this&&this.__decorate||function(p,y,_,C){var S,E=arguments.length,k=E<3?y:C===null?C=Object.getOwnPropertyDescriptor(y,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,y,_,C);else for(var T=p.length-1;T>=0;T--)(S=p[T])&&(k=(E<3?S(k):E>3?S(y,_,k):S(y,_))||k);return E>3&&k&&Object.defineProperty(y,_,k),k},h=this&&this.__param||function(p,y){return function(_,C){y(_,C,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),f=l(8460),g=l(844),b=l(2585),x=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let m=o.CoreService=class extends g.Disposable{constructor(p,y,_){super(),this._bufferService=p,this._logService=y,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(x),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(x),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(p,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${p}"`,()=>p.split("").map(C=>C.charCodeAt(0))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,()=>p.split("").map(y=>y.charCodeAt(0))),this._onBinary.fire(p))}};o.CoreService=m=u([h(0,b.IBufferService),h(1,b.ILogService),h(2,b.IOptionsService)],m)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),h=l(8460),d=l(844),f=l(6106);let g=0,b=0;class x extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList(p=>p==null?void 0:p.marker.line),this._onDecorationRegistered=this.register(new h.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new h.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(p){if(p.marker.isDisposed)return;const y=new v(p);if(y){const _=y.marker.onDispose(()=>y.dispose());y.onDispose(()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),_.dispose())}),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,y,_){let C=0,S=0;for(const E of this._decorations.getKeyIterator(y))C=E.options.x??0,S=C+(E.options.width??1),p>=C&&p<S&&(!_||(E.options.layer??"bottom")===_)&&(yield E)}forEachDecorationAtCell(p,y,_,C){this._decorations.forEachByKey(y,S=>{g=S.options.x??0,b=g+(S.options.width??1),p>=g&&p<b&&(!_||(S.options.layer??"bottom")===_)&&C(S)})}}o.DecorationService=x;class v extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(p){super(),this.options=p,this.onRenderEmitter=this.register(new h.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=p.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),h=l(8343);class d{constructor(...g){this._entries=new Map;for(const[b,x]of g)this.set(b,x)}set(g,b){const x=this._entries.get(g);return this._entries.set(g,b),x}forEach(g){for(const[b,x]of this._entries.entries())g(b,x)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(f,g){this._services.set(f,g)}getService(f){return this._services.get(f)}createInstance(f,...g){const b=(0,h.getServiceDependencies)(f).sort((m,p)=>m.index-p.index),x=[];for(const m of b){const p=this._services.get(m.id);if(!p)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${m.id}.`);x.push(p)}const v=b.length>0?b[0].index:g.length;if(g.length!==v)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${v+1} conflicts with ${g.length} static arguments`);return new f(...g,...x)}}},7866:function(a,o,l){var u=this&&this.__decorate||function(v,m,p,y){var _,C=arguments.length,S=C<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,m,p,y);else for(var E=v.length-1;E>=0;E--)(_=v[E])&&(S=(C<3?_(S):C>3?_(m,p,S):_(m,p))||S);return C>3&&S&&Object.defineProperty(m,p,S),S},h=this&&this.__param||function(v,m){return function(p,y){m(p,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),f=l(2585),g={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let b,x=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let m=0;m<v.length;m++)typeof v[m]=="function"&&(v[m]=v[m]())}_log(v,m,p){this._evalLazyOptionalParams(p),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+m,...p)}trace(v,...m){var p;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.trace.bind(this._optionsService.options.logger))??console.log,v,m)}debug(v,...m){var p;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.debug.bind(this._optionsService.options.logger))??console.log,v,m)}info(v,...m){var p;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.info.bind(this._optionsService.options.logger))??console.info,v,m)}warn(v,...m){var p;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.warn.bind(this._optionsService.options.logger))??console.warn,v,m)}error(v,...m){var p;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.error.bind(this._optionsService.options.logger))??console.error,v,m)}};o.LogService=x=u([h(0,f.IOptionsService)],x),o.setTraceLogger=function(v){b=v},o.traceCall=function(v,m,p){if(typeof p.value!="function")throw new Error("not supported");const y=p.value;p.value=function(..._){if(b.logLevel!==f.LogLevelEnum.TRACE)return y.apply(this,_);b.trace(`GlyphRenderer#${y.name}(${_.map(S=>JSON.stringify(S)).join(", ")})`);const C=y.apply(this,_);return b.trace(`GlyphRenderer#${y.name} return`,C),C}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),h=l(844),d=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const f=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends h.Disposable{constructor(x){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const m in x)if(m in v)try{const p=x[m];v[m]=this._sanitizeAndValidateOption(m,p)}catch(p){console.error(p)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,h.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(x,v){return this.onOptionChange(m=>{m===x&&v(this.rawOptions[x])})}onMultipleOptionChange(x,v){return this.onOptionChange(m=>{x.indexOf(m)!==-1&&v()})}_setupOptions(){const x=m=>{if(!(m in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${m}"`);return this.rawOptions[m]},v=(m,p)=>{if(!(m in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${m}"`);p=this._sanitizeAndValidateOption(m,p),this.rawOptions[m]!==p&&(this.rawOptions[m]=p,this._onOptionChange.fire(m))};for(const m in this.rawOptions){const p={get:x.bind(this,m),set:v.bind(this,m)};Object.defineProperty(this.options,m,p)}}_sanitizeAndValidateOption(x,v){switch(x){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[x]),!function(m){return m==="block"||m==="underline"||m==="bar"}(v))throw new Error(`"${v}" is not a valid value for ${x}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=f.includes(v)?v:o.DEFAULT_OPTIONS[x];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${x} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${x} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=g},2660:function(a,o,l){var u=this&&this.__decorate||function(g,b,x,v){var m,p=arguments.length,y=p<3?b:v===null?v=Object.getOwnPropertyDescriptor(b,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(g,b,x,v);else for(var _=g.length-1;_>=0;_--)(m=g[_])&&(y=(p<3?m(y):p>3?m(b,x,y):m(b,x))||y);return p>3&&y&&Object.defineProperty(b,x,y),y},h=this&&this.__param||function(g,b){return function(x,v){b(x,v,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let f=o.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const b=this._bufferService.buffer;if(g.id===void 0){const _=b.addMarker(b.ybase+b.y),C={data:g,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(C,_)),this._dataByLinkId.set(C.id,C),C.id}const x=g,v=this._getEntryIdKey(x),m=this._entriesWithId.get(v);if(m)return this.addLineToLink(m.id,b.ybase+b.y),m.id;const p=b.addMarker(b.ybase+b.y),y={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(y,p)),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(g,b){const x=this._dataByLinkId.get(g);if(x&&x.lines.every(v=>v.line!==b)){const v=this._bufferService.buffer.addMarker(b);x.lines.push(v),v.onDispose(()=>this._removeMarkerFromLink(x,v))}}getLinkData(g){var b;return(b=this._dataByLinkId.get(g))==null?void 0:b.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,b){const x=g.lines.indexOf(b);x!==-1&&(g.lines.splice(x,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};o.OscLinkService=f=u([h(0,d.IBufferService)],f)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(h){return h[u]||[]},o.createDecorator=function(h){if(o.serviceRegistry.has(h))return o.serviceRegistry.get(h);const d=function(f,g,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,v,m){v[l]===v?v[u].push({id:x,index:m}):(v[u]=[{id:x,index:m}],v[l]=v)})(d,f,b)};return d.toString=()=>h,o.serviceRegistry.set(h,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var h;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(h||(o.LogLevelEnum=h={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),h=l(225);class d{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,b,x=!1){return(16777215&g)<<3|(3&b)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const g=new h.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 b=0,x=0;const v=g.length;for(let m=0;m<v;++m){let p=g.charCodeAt(m);if(55296<=p&&p<=56319){if(++m>=v)return b+this.wcwidth(p);const C=g.charCodeAt(m);56320<=C&&C<=57343?p=1024*(p-55296)+C-56320+65536:b+=this.wcwidth(C)}const y=this.charProperties(p,x);let _=d.extractWidth(y);d.extractShouldJoin(y)&&(_-=d.extractWidth(x)),b+=_,x=y}return b}charProperties(g,b){return this._activeProvider.charProperties(g,b)}}o.UnicodeService=d}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=i(9042),l=i(3236),u=i(844),h=i(5741),d=i(8285),f=i(7975),g=i(7090),b=["cols","rows"];class x extends u.Disposable{constructor(m){super(),this._core=this.register(new l.Terminal(m)),this._addonManager=this.register(new h.AddonManager),this._publicOptions={...this._core.options};const p=_=>this._core.options[_],y=(_,C)=>{this._checkReadonlyOptions(_),this._core.options[_]=C};for(const _ in this._core.options){const C={get:p.bind(this,_),set:y.bind(this,_)};Object.defineProperty(this._publicOptions,_,C)}}_checkReadonlyOptions(m){if(b.includes(m))throw new Error(`Option "${m}" 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 f.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const m=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:m.applicationCursorKeys,applicationKeypadMode:m.applicationKeypad,bracketedPasteMode:m.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:m.origin,reverseWraparoundMode:m.reverseWraparound,sendFocusMode:m.sendFocus,wraparoundMode:m.wraparound}}get options(){return this._publicOptions}set options(m){for(const p in m)this._publicOptions[p]=m[p]}blur(){this._core.blur()}focus(){this._core.focus()}input(m,p=!0){this._core.input(m,p)}resize(m,p){this._verifyIntegers(m,p),this._core.resize(m,p)}open(m){this._core.open(m)}attachCustomKeyEventHandler(m){this._core.attachCustomKeyEventHandler(m)}attachCustomWheelEventHandler(m){this._core.attachCustomWheelEventHandler(m)}registerLinkProvider(m){return this._core.registerLinkProvider(m)}registerCharacterJoiner(m){return this._checkProposedApi(),this._core.registerCharacterJoiner(m)}deregisterCharacterJoiner(m){this._checkProposedApi(),this._core.deregisterCharacterJoiner(m)}registerMarker(m=0){return this._verifyIntegers(m),this._core.registerMarker(m)}registerDecoration(m){return this._checkProposedApi(),this._verifyPositiveIntegers(m.x??0,m.width??0,m.height??0),this._core.registerDecoration(m)}hasSelection(){return this._core.hasSelection()}select(m,p,y){this._verifyIntegers(m,p,y),this._core.select(m,p,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(m,p){this._verifyIntegers(m,p),this._core.selectLines(m,p)}dispose(){super.dispose()}scrollLines(m){this._verifyIntegers(m),this._core.scrollLines(m)}scrollPages(m){this._verifyIntegers(m),this._core.scrollPages(m)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(m){this._verifyIntegers(m),this._core.scrollToLine(m)}clear(){this._core.clear()}write(m,p){this._core.write(m,p)}writeln(m,p){this._core.write(m),this._core.write(`\r
`,p)}paste(m){this._core.paste(m)}refresh(m,p){this._verifyIntegers(m,p),this._core.refresh(m,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(m){this._addonManager.loadAddon(this,m)}static get strings(){return o}_verifyIntegers(...m){for(const p of m)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...m){for(const p of m)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}a.Terminal=x})(),s})())})(U8);var q8=U8.exports,G8={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={903:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BaseRenderLayer=void 0;const u=l(274),h=l(627),d=l(237),f=l(860),g=l(374),b=l(296),x=l(345),v=l(859),m=l(399),p=l(855);class y extends v.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var S;return(S=this._charAtlas)==null?void 0:S.pages[0].canvas}constructor(S,E,k,T,A,M,D,L,N,O){super(),this._terminal=S,this._container=E,this._alpha=A,this._themeService=M,this._bufferService=D,this._optionsService=L,this._decorationService=N,this._coreBrowserService=O,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,b.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new v.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new x.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new u.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-${k}-layer`),this._canvas.style.zIndex=T.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(B=>{this._refreshCharAtlas(B),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,v.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(S,E){}handleSelectionChanged(S,E,k=!1){this._selectionModel.update(this._terminal._core,S,E,k)}_setTransparency(S){if(S===this._alpha)return;const E=this._canvas;this._alpha=S,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,E),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(S){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,h.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,S,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,x.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let E=0;E<this._charAtlas.pages.length;E++)this._bitmapGenerator[E]=new _(this._charAtlas.pages[E].canvas)}}resize(S){this._deviceCellWidth=S.device.cell.width,this._deviceCellHeight=S.device.cell.height,this._deviceCharWidth=S.device.char.width,this._deviceCharHeight=S.device.char.height,this._deviceCharLeft=S.device.char.left,this._deviceCharTop=S.device.char.top,this._canvas.width=S.device.canvas.width,this._canvas.height=S.device.canvas.height,this._canvas.style.width=`${S.css.canvas.width}px`,this._canvas.style.height=`${S.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var S;(S=this._charAtlas)==null||S.clearTexture()}_fillCells(S,E,k,T){this._ctx.fillRect(S*this._deviceCellWidth,E*this._deviceCellHeight,k*this._deviceCellWidth,T*this._deviceCellHeight)}_fillMiddleLineAtCells(S,E,k=1){const T=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(S*this._deviceCellWidth,(E+1)*this._deviceCellHeight-T-this._coreBrowserService.dpr,k*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(S,E,k=1,T=0){this._ctx.fillRect(S*this._deviceCellWidth,(E+1)*this._deviceCellHeight+T-this._coreBrowserService.dpr-1,k*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(S,E,k=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const T=this._coreBrowserService.dpr;this._ctx.lineWidth=T;for(let A=0;A<k;A++){const M=(S+A)*this._deviceCellWidth,D=(S+A+.5)*this._deviceCellWidth,L=(S+A+1)*this._deviceCellWidth,N=(E+1)*this._deviceCellHeight-T-1,O=N-T,B=N+T;this._ctx.moveTo(M,N),this._ctx.bezierCurveTo(M,O,D,O,D,N),this._ctx.bezierCurveTo(D,B,L,B,L,N)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(S,E,k=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const T=this._coreBrowserService.dpr;this._ctx.lineWidth=T,this._ctx.setLineDash([2*T,T]);const A=S*this._deviceCellWidth,M=(E+1)*this._deviceCellHeight-T-1;this._ctx.moveTo(A,M);for(let D=0;D<k;D++){const L=(S+k+D)*this._deviceCellWidth;this._ctx.lineTo(L,M)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(S,E,k=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const T=this._coreBrowserService.dpr;this._ctx.lineWidth=T,this._ctx.setLineDash([4*T,3*T]);const A=S*this._deviceCellWidth,M=(S+k)*this._deviceCellWidth,D=(E+1)*this._deviceCellHeight-T-1;this._ctx.moveTo(A,D),this._ctx.lineTo(M,D),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(S,E,k){this._ctx.fillRect(S*this._deviceCellWidth,E*this._deviceCellHeight,this._coreBrowserService.dpr*k,this._deviceCellHeight)}_strokeRectAtCell(S,E,k,T){const A=this._coreBrowserService.dpr;this._ctx.lineWidth=A,this._ctx.strokeRect(S*this._deviceCellWidth+A/2,E*this._deviceCellHeight+A/2,k*this._deviceCellWidth-A,T*this._deviceCellHeight-A)}_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(S,E,k,T){this._alpha?this._ctx.clearRect(S*this._deviceCellWidth,E*this._deviceCellHeight,k*this._deviceCellWidth,T*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(S*this._deviceCellWidth,E*this._deviceCellHeight,k*this._deviceCellWidth,T*this._deviceCellHeight))}_fillCharTrueColor(S,E,k){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=d.TEXT_BASELINE,this._clipRow(k);let T=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(T=(0,f.tryDrawCustomChar)(this._ctx,S.getChars(),E*this._deviceCellWidth,k*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),T||this._ctx.fillText(S.getChars(),E*this._deviceCellWidth+this._deviceCharLeft,k*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(S,E,k){var N,O,B,z;const T=S.getChars(),A=S.getCode(),M=S.getWidth();if(this._cellColorResolver.resolve(S,E,this._bufferService.buffer.ydisp+k,this._deviceCellWidth),!this._charAtlas)return;let D;if(D=T&&T.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(T,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(S.getCode()||p.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!D.size.x||!D.size.y)return;this._ctx.save(),this._clipRow(k),this._bitmapGenerator[D.texturePage]&&this._charAtlas.pages[D.texturePage].canvas!==this._bitmapGenerator[D.texturePage].canvas&&((O=(N=this._bitmapGenerator[D.texturePage])==null?void 0:N.bitmap)==null||O.close(),delete this._bitmapGenerator[D.texturePage]),this._charAtlas.pages[D.texturePage].version!==((B=this._bitmapGenerator[D.texturePage])==null?void 0:B.version)&&(this._bitmapGenerator[D.texturePage]||(this._bitmapGenerator[D.texturePage]=new _(this._charAtlas.pages[D.texturePage].canvas)),this._bitmapGenerator[D.texturePage].refresh(),this._bitmapGenerator[D.texturePage].version=this._charAtlas.pages[D.texturePage].version);let L=D.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,g.allowRescaling)(A,M,D.size.x,this._deviceCellWidth)&&(L=this._deviceCellWidth-1),this._ctx.drawImage(((z=this._bitmapGenerator[D.texturePage])==null?void 0:z.bitmap)||this._charAtlas.pages[D.texturePage].canvas,D.texturePosition.x,D.texturePosition.y,D.size.x,D.size.y,E*this._deviceCellWidth+this._deviceCharLeft-D.offset.x,k*this._deviceCellHeight+this._deviceCharTop-D.offset.y,L,D.size.y),this._ctx.restore()}_clipRow(S){this._ctx.beginPath(),this._ctx.rect(0,S*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(S,E){return`${E?"italic":""} ${S?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}o.BaseRenderLayer=y;class _{get bitmap(){return this._bitmap}constructor(S){this.canvas=S,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var S;(S=this._bitmap)==null||S.close(),this._bitmap=void 0,m.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout(()=>this._generate(),100)),this._state===1&&(this._state=2))}_generate(){var S;this._state===0&&((S=this._bitmap)==null||S.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then(E=>{this._state===2?this.refresh():this._bitmap=E,this._state=0}),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CanvasRenderer=void 0;const u=l(627),h=l(56),d=l(374),f=l(345),g=l(859),b=l(873),x=l(43),v=l(630),m=l(744);class p extends g.Disposable{constructor(_,C,S,E,k,T,A,M,D,L,N){super(),this._terminal=_,this._screenElement=C,this._bufferService=E,this._charSizeService=k,this._optionsService=T,this._coreBrowserService=D,this._themeService=N,this._observerDisposable=this.register(new g.MutableDisposable),this._onRequestRedraw=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new f.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new f.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const O=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new m.TextRenderLayer(this._terminal,this._screenElement,0,O,this._bufferService,this._optionsService,A,L,this._coreBrowserService,N),new v.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,L,this._optionsService,N),new x.LinkRenderLayer(this._terminal,this._screenElement,2,S,this._bufferService,this._optionsService,L,this._coreBrowserService,N),new b.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,M,this._coreBrowserService,L,N)];for(const B of this._renderLayers)(0,f.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,d.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,h.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(B,z)=>this._setCanvasDevicePixelDimensions(B,z)),this.register(this._coreBrowserService.onWindowChange(B=>{this._observerDisposable.value=(0,h.observeDevicePixelDimensions)(this._renderLayers[0].canvas,B,(z,P)=>this._setCanvasDevicePixelDimensions(z,P))})),this.register((0,g.toDisposable)(()=>{for(const B of this._renderLayers)B.dispose();(0,u.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(_,C){this._updateDimensions();for(const S of this._renderLayers)S.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(_=>_.handleBlur())}handleFocus(){this._runOperation(_=>_.handleFocus())}handleSelectionChanged(_,C,S=!1){this._runOperation(E=>E.handleSelectionChanged(_,C,S)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(_=>_.handleCursorMove())}clear(){this._runOperation(_=>_.reset())}_runOperation(_){for(const C of this._renderLayers)_(C)}renderRows(_,C){for(const S of this._renderLayers)S.handleGridChanged(_,C)}clearTextureAtlas(){for(const _ of this._renderLayers)_.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const _=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*_),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*_),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/_),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/_),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(_,C){this.dimensions.device.canvas.height=C,this.dimensions.device.canvas.width=_;for(const S of this._renderLayers)S.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}o.CanvasRenderer=p},873:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorRenderLayer=void 0;const u=l(457),h=l(859),d=l(399),f=l(782),g=l(903);class b extends g.BaseRenderLayer{constructor(v,m,p,y,_,C,S,E,k,T){super(v,m,"cursor",p,!0,T,_,C,k,E),this._onRequestRedraw=y,this._coreService=S,this._cursorBlinkStateManager=this.register(new h.MutableDisposable),this._cell=new f.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(C.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(v){super.resize(v),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var v;this._clearCursor(),(v=this._cursorBlinkStateManager.value)==null||v.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var v;(v=this._cursorBlinkStateManager.value)==null||v.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var v;(v=this._cursorBlinkStateManager.value)==null||v.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 u.CursorBlinkStateManager(()=>this._render(!0),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var v;(v=this._cursorBlinkStateManager.value)==null||v.restartBlinkAnimation()}handleGridChanged(v,m){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(v){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const m=this._bufferService.buffer.ybase+this._bufferService.buffer.y,p=m-this._bufferService.buffer.ydisp;if(p<0||p>=this._bufferService.rows)return void this._clearCursor();const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(m).loadCell(y,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 _=this._optionsService.rawOptions.cursorStyle,C=this._optionsService.rawOptions.cursorInactiveStyle;return C&&C!=="none"&&this._cursorRenderers[C](y,p,this._cell),this._ctx.restore(),this._state.x=y,this._state.y=p,this._state.isFocused=!1,this._state.style=_,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===y&&this._state.y===p&&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"](y,p,this._cell),this._ctx.restore(),this._state.x=y,this._state.y=p,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(d.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(v,m,p){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(v,m,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(v,m,p){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(v,m,p.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(p,v,m),this._ctx.restore()}_renderUnderlineCursor(v,m,p){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(v,m),this._ctx.restore()}_renderOutlineCursor(v,m,p){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(v,m,p.getWidth(),1),this._ctx.restore()}}o.CursorRenderLayer=b},574:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GridCache=void 0,o.GridCache=class{constructor(){this.cache=[]}resize(l,u){for(let h=0;h<l;h++){this.cache.length<=h&&this.cache.push([]);for(let d=this.cache[h].length;d<u;d++)this.cache[h].push(void 0);this.cache[h].length=u}this.cache.length=l}clear(){for(let l=0;l<this.cache.length;l++)for(let u=0;u<this.cache[l].length;u++)this.cache[l][u]=void 0}}},43:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkRenderLayer=void 0;const u=l(197),h=l(237),d=l(903);class f extends d.BaseRenderLayer{constructor(b,x,v,m,p,y,_,C,S){super(b,x,"link",v,!0,S,p,y,_,C),this.register(m.onShowLinkUnderline(E=>this._handleShowLinkUnderline(E))),this.register(m.onHideLinkUnderline(E=>this._handleHideLinkUnderline(E)))}resize(b){super.resize(b),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 b=this._state.y2-this._state.y1-1;b>0&&this._clearCells(0,this._state.y1+1,this._state.cols,b),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(b){if(b.fg===h.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:b.fg&&(0,u.is256Color)(b.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[b.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,b.y1===b.y2)this._fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this._fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(let x=b.y1+1;x<b.y2;x++)this._fillBottomLineAtCells(0,x,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}o.LinkRenderLayer=f},630:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionRenderLayer=void 0;const u=l(903);class h extends u.BaseRenderLayer{constructor(f,g,b,x,v,m,p,y){super(f,g,"selection",b,!0,y,x,p,m,v),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(f){super.resize(f),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(f,g,b){super.handleSelectionChanged(f,g,b),this._redrawSelection(f,g,b)}_redrawSelection(f,g,b){if(!this._didStateChange(f,g,b,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!f||!g)return void this._clearState();const x=f[1]-this._bufferService.buffer.ydisp,v=g[1]-this._bufferService.buffer.ydisp,m=Math.max(x,0),p=Math.min(v,this._bufferService.rows-1);if(m>=this._bufferService.rows||p<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,b){const y=f[0],_=g[0]-y,C=p-m+1;this._fillCells(y,m,_,C)}else{const y=x===m?f[0]:0,_=m===v?g[0]:this._bufferService.cols;this._fillCells(y,m,_-y,1);const C=Math.max(p-m-1,0);if(this._fillCells(0,m+1,this._bufferService.cols,C),m!==p){const S=v===p?g[0]:this._bufferService.cols;this._fillCells(0,p,S,1)}}this._state.start=[f[0],f[1]],this._state.end=[g[0],g[1]],this._state.columnSelectMode=b,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(f,g,b,x){return!this._areCoordinatesEqual(f,this._state.start)||!this._areCoordinatesEqual(g,this._state.end)||b!==this._state.columnSelectMode||x!==this._state.ydisp}_areCoordinatesEqual(f,g){return!(!f||!g)&&f[0]===g[0]&&f[1]===g[1]}}o.SelectionRenderLayer=h},744:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextRenderLayer=void 0;const u=l(577),h=l(147),d=l(782),f=l(855),g=l(903),b=l(574);class x extends g.BaseRenderLayer{constructor(m,p,y,_,C,S,E,k,T,A){super(m,p,"text",y,_,A,C,S,k,T),this._characterJoinerService=E,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new d.CellData,this._state=new b.GridCache,this.register(S.onSpecificOptionChange("allowTransparency",M=>this._setTransparency(M)))}resize(m){super.resize(m);const p=this._getFont(!1,!1);this._characterWidth===m.device.char.width&&this._characterFont===p||(this._characterWidth=m.device.char.width,this._characterFont=p,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(m,p,y){for(let _=m;_<=p;_++){const C=_+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.lines.get(C),E=this._characterJoinerService.getJoinedCharacters(C);for(let k=0;k<this._bufferService.cols;k++){S.loadCell(k,this._workCell);let T=this._workCell,A=!1,M=k;if(T.getWidth()!==0){if(E.length>0&&k===E[0][0]){A=!0;const D=E.shift();T=new u.JoinedCellData(this._workCell,S.translateToString(!0,D[0],D[1]),D[1]-D[0]),M=D[1]-1}!A&&this._isOverlapping(T)&&M<S.length-1&&S.getCodePoint(M+1)===f.NULL_CELL_CODE&&(T.content&=-12582913,T.content|=8388608),y(T,k,_),k=M}}}}_drawBackground(m,p){const y=this._ctx,_=this._bufferService.cols;let C=0,S=0,E=null;y.save(),this._forEachCell(m,p,(k,T,A)=>{let M=null;k.isInverse()?M=k.isFgDefault()?this._themeService.colors.foreground.css:k.isFgRGB()?`rgb(${h.AttributeData.toColorRGB(k.getFgColor()).join(",")})`:this._themeService.colors.ansi[k.getFgColor()].css:k.isBgRGB()?M=`rgb(${h.AttributeData.toColorRGB(k.getBgColor()).join(",")})`:k.isBgPalette()&&(M=this._themeService.colors.ansi[k.getBgColor()].css);let D=!1;this._decorationService.forEachDecorationAtCell(T,this._bufferService.buffer.ydisp+A,void 0,L=>{L.options.layer!=="top"&&D||(L.backgroundColorRGB&&(M=L.backgroundColorRGB.css),D=L.options.layer==="top")}),E===null&&(C=T,S=A),A!==S?(y.fillStyle=E||"",this._fillCells(C,S,_-C,1),C=T,S=A):E!==M&&(y.fillStyle=E||"",this._fillCells(C,S,T-C,1),C=T,S=A),E=M}),E!==null&&(y.fillStyle=E,this._fillCells(C,S,_-C,1)),y.restore()}_drawForeground(m,p){this._forEachCell(m,p,(y,_,C)=>this._drawChars(y,_,C))}handleGridChanged(m,p){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,m,this._bufferService.cols,p-m+1),this._drawBackground(m,p),this._drawForeground(m,p))}_isOverlapping(m){if(m.getWidth()!==1||m.getCode()<256)return!1;const p=m.getChars();if(this._characterOverlapCache.hasOwnProperty(p))return this._characterOverlapCache[p];this._ctx.save(),this._ctx.font=this._characterFont;const y=Math.floor(this._ctx.measureText(p).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[p]=y,y}}o.TextRenderLayer=x},274:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellColorResolver=void 0;const u=l(855),h=l(160),d=l(374);let f,g=0,b=0,x=!1,v=!1,m=!1,p=0;o.CellColorResolver=class{constructor(y,_,C,S,E,k){this._terminal=y,this._optionService=_,this._selectionRenderModel=C,this._decorationService=S,this._coreBrowserService=E,this._themeService=k,this.result={fg:0,bg:0,ext:0}}resolve(y,_,C,S){if(this.result.bg=y.bg,this.result.fg=y.fg,this.result.ext=268435456&y.bg?y.extended.ext:0,b=0,g=0,v=!1,x=!1,m=!1,f=this._themeService.colors,p=0,y.getCode()!==u.NULL_CELL_CODE&&y.extended.underlineStyle===4){const E=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));p=_*S%(2*Math.round(E))}if(this._decorationService.forEachDecorationAtCell(_,C,"bottom",E=>{E.backgroundColorRGB&&(b=E.backgroundColorRGB.rgba>>8&16777215,v=!0),E.foregroundColorRGB&&(g=E.foregroundColorRGB.rgba>>8&16777215,x=!0)}),m=this._selectionRenderModel.isCellSelected(this._terminal,_,C),m){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}b=h.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(v=!0,f.selectionForeground&&(g=f.selectionForeground.rgba>>8&16777215,x=!0),(0,d.treatGlyphAsBackgroundColor)(y.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))g=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.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=(16777215&this.result.bg)<<8|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=h.rgba.blend(g,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}x=!0}}this._decorationService.forEachDecorationAtCell(_,C,"top",E=>{E.backgroundColorRGB&&(b=E.backgroundColorRGB.rgba>>8&16777215,v=!0),E.foregroundColorRGB&&(g=E.foregroundColorRGB.rgba>>8&16777215,x=!0)}),v&&(b=m?-16777216&y.bg&-134217729|b|50331648:-16777216&y.bg|b|50331648),x&&(g=-16777216&y.fg&-67108865|g|50331648),67108864&this.result.fg&&(v&&!x&&(g=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&f.background.rgba>>8|50331648,x=!0),!v&&x&&(b=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&f.foreground.rgba>>8|50331648,v=!0)),f=void 0,this.result.bg=v?b:this.result.bg,this.result.fg=x?g:this.result.fg,this.result.ext&=536870911,this.result.ext|=p<<29&3758096384}}},627:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.removeTerminalFromCache=o.acquireTextureAtlas=void 0;const u=l(509),h=l(197),d=[];o.acquireTextureAtlas=function(f,g,b,x,v,m,p,y){const _=(0,h.generateConfig)(x,v,m,p,g,b,y);for(let E=0;E<d.length;E++){const k=d[E],T=k.ownedBy.indexOf(f);if(T>=0){if((0,h.configEquals)(k.config,_))return k.atlas;k.ownedBy.length===1?(k.atlas.dispose(),d.splice(E,1)):k.ownedBy.splice(T,1);break}}for(let E=0;E<d.length;E++){const k=d[E];if((0,h.configEquals)(k.config,_))return k.ownedBy.push(f),k.atlas}const C=f._core,S={atlas:new u.TextureAtlas(document,_,C.unicodeService),config:_,ownedBy:[f]};return d.push(S),S.atlas},o.removeTerminalFromCache=function(f){for(let g=0;g<d.length;g++){const b=d[g].ownedBy.indexOf(f);if(b!==-1){d[g].ownedBy.length===1?(d[g].atlas.dispose(),d.splice(g,1)):d[g].ownedBy.splice(b,1);break}}}},197:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.is256Color=o.configEquals=o.generateConfig=void 0;const u=l(160);o.generateConfig=function(h,d,f,g,b,x,v){const m={foreground:x.foreground,background:x.background,cursor:u.NULL_COLOR,cursorAccent:u.NULL_COLOR,selectionForeground:u.NULL_COLOR,selectionBackgroundTransparent:u.NULL_COLOR,selectionBackgroundOpaque:u.NULL_COLOR,selectionInactiveBackgroundTransparent:u.NULL_COLOR,selectionInactiveBackgroundOpaque:u.NULL_COLOR,ansi:x.ansi.slice(),contrastCache:x.contrastCache,halfContrastCache:x.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:v,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:h,deviceCellHeight:d,deviceCharWidth:f,deviceCharHeight:g,fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight,fontWeightBold:b.fontWeightBold,allowTransparency:b.allowTransparency,drawBoldTextInBrightColors:b.drawBoldTextInBrightColors,minimumContrastRatio:b.minimumContrastRatio,colors:m}},o.configEquals=function(h,d){for(let f=0;f<h.colors.ansi.length;f++)if(h.colors.ansi[f].rgba!==d.colors.ansi[f].rgba)return!1;return h.devicePixelRatio===d.devicePixelRatio&&h.customGlyphs===d.customGlyphs&&h.lineHeight===d.lineHeight&&h.letterSpacing===d.letterSpacing&&h.fontFamily===d.fontFamily&&h.fontSize===d.fontSize&&h.fontWeight===d.fontWeight&&h.fontWeightBold===d.fontWeightBold&&h.allowTransparency===d.allowTransparency&&h.deviceCharWidth===d.deviceCharWidth&&h.deviceCharHeight===d.deviceCharHeight&&h.drawBoldTextInBrightColors===d.drawBoldTextInBrightColors&&h.minimumContrastRatio===d.minimumContrastRatio&&h.colors.foreground.rgba===d.colors.foreground.rgba&&h.colors.background.rgba===d.colors.background.rgba},o.is256Color=function(h){return(50331648&h)==16777216||(50331648&h)==33554432}},237:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=l(399);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},457:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorBlinkStateManager=void 0,o.CursorBlinkStateManager=class{constructor(l,u){this._renderCallback=l,this._coreBrowserService=u,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 u=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,u>0)return void this._restartInterval(u)}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 u=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(u)}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,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tryDrawCustomChar=o.powerlineDefinitions=o.boxDrawingDefinitions=o.blockElementDefinitions=void 0;const u=l(374);o.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 h={"░":[[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]]};o.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:(x,v)=>`M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v}`},"║":{1:(x,v)=>`M${.5-x},0 L${.5-x},1 M${.5+x},0 L${.5+x},1`},"╒":{1:(x,v)=>`M.5,1 L.5,${.5-v} L1,${.5-v} M.5,${.5+v} L1,${.5+v}`},"╓":{1:(x,v)=>`M${.5-x},1 L${.5-x},.5 L1,.5 M${.5+x},.5 L${.5+x},1`},"╔":{1:(x,v)=>`M1,${.5-v} L${.5-x},${.5-v} L${.5-x},1 M1,${.5+v} L${.5+x},${.5+v} L${.5+x},1`},"╕":{1:(x,v)=>`M0,${.5-v} L.5,${.5-v} L.5,1 M0,${.5+v} L.5,${.5+v}`},"╖":{1:(x,v)=>`M${.5+x},1 L${.5+x},.5 L0,.5 M${.5-x},.5 L${.5-x},1`},"╗":{1:(x,v)=>`M0,${.5+v} L${.5-x},${.5+v} L${.5-x},1 M0,${.5-v} L${.5+x},${.5-v} L${.5+x},1`},"╘":{1:(x,v)=>`M.5,0 L.5,${.5+v} L1,${.5+v} M.5,${.5-v} L1,${.5-v}`},"╙":{1:(x,v)=>`M1,.5 L${.5-x},.5 L${.5-x},0 M${.5+x},.5 L${.5+x},0`},"╚":{1:(x,v)=>`M1,${.5-v} L${.5+x},${.5-v} L${.5+x},0 M1,${.5+v} L${.5-x},${.5+v} L${.5-x},0`},"╛":{1:(x,v)=>`M0,${.5+v} L.5,${.5+v} L.5,0 M0,${.5-v} L.5,${.5-v}`},"╜":{1:(x,v)=>`M0,.5 L${.5+x},.5 L${.5+x},0 M${.5-x},.5 L${.5-x},0`},"╝":{1:(x,v)=>`M0,${.5-v} L${.5-x},${.5-v} L${.5-x},0 M0,${.5+v} L${.5+x},${.5+v} L${.5+x},0`},"╞":{1:(x,v)=>`M.5,0 L.5,1 M.5,${.5-v} L1,${.5-v} M.5,${.5+v} L1,${.5+v}`},"╟":{1:(x,v)=>`M${.5-x},0 L${.5-x},1 M${.5+x},0 L${.5+x},1 M${.5+x},.5 L1,.5`},"╠":{1:(x,v)=>`M${.5-x},0 L${.5-x},1 M1,${.5+v} L${.5+x},${.5+v} L${.5+x},1 M1,${.5-v} L${.5+x},${.5-v} L${.5+x},0`},"╡":{1:(x,v)=>`M.5,0 L.5,1 M0,${.5-v} L.5,${.5-v} M0,${.5+v} L.5,${.5+v}`},"╢":{1:(x,v)=>`M0,.5 L${.5-x},.5 M${.5-x},0 L${.5-x},1 M${.5+x},0 L${.5+x},1`},"╣":{1:(x,v)=>`M${.5+x},0 L${.5+x},1 M0,${.5+v} L${.5-x},${.5+v} L${.5-x},1 M0,${.5-v} L${.5-x},${.5-v} L${.5-x},0`},"╤":{1:(x,v)=>`M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v} M.5,${.5+v} L.5,1`},"╥":{1:(x,v)=>`M0,.5 L1,.5 M${.5-x},.5 L${.5-x},1 M${.5+x},.5 L${.5+x},1`},"╦":{1:(x,v)=>`M0,${.5-v} L1,${.5-v} M0,${.5+v} L${.5-x},${.5+v} L${.5-x},1 M1,${.5+v} L${.5+x},${.5+v} L${.5+x},1`},"╧":{1:(x,v)=>`M.5,0 L.5,${.5-v} M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v}`},"╨":{1:(x,v)=>`M0,.5 L1,.5 M${.5-x},.5 L${.5-x},0 M${.5+x},.5 L${.5+x},0`},"╩":{1:(x,v)=>`M0,${.5+v} L1,${.5+v} M0,${.5-v} L${.5-x},${.5-v} L${.5-x},0 M1,${.5-v} L${.5+x},${.5-v} L${.5+x},0`},"╪":{1:(x,v)=>`M.5,0 L.5,1 M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v}`},"╫":{1:(x,v)=>`M0,.5 L1,.5 M${.5-x},0 L${.5-x},1 M${.5+x},0 L${.5+x},1`},"╬":{1:(x,v)=>`M0,${.5+v} L${.5-x},${.5+v} L${.5-x},1 M1,${.5+v} L${.5+x},${.5+v} L${.5+x},1 M0,${.5-v} L${.5-x},${.5-v} L${.5-x},0 M1,${.5-v} L${.5+x},${.5-v} L${.5+x},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:(x,v)=>`M.5,1 L.5,${.5+v/.15*.5} C.5,${.5+v/.15*.5},.5,.5,1,.5`},"╮":{1:(x,v)=>`M.5,1 L.5,${.5+v/.15*.5} C.5,${.5+v/.15*.5},.5,.5,0,.5`},"╯":{1:(x,v)=>`M.5,0 L.5,${.5-v/.15*.5} C.5,${.5-v/.15*.5},.5,.5,0,.5`},"╰":{1:(x,v)=>`M.5,0 L.5,${.5-v/.15*.5} C.5,${.5-v/.15*.5},.5,.5,1,.5`}},o.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}},o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.tryDrawCustomChar=function(x,v,m,p,y,_,C,S){const E=o.blockElementDefinitions[v];if(E)return function(M,D,L,N,O,B){for(let z=0;z<D.length;z++){const P=D[z],j=O/8,R=B/8;M.fillRect(L+P.x*j,N+P.y*R,P.w*j,P.h*R)}}(x,E,m,p,y,_),!0;const k=h[v];if(k)return function(M,D,L,N,O,B){let z=d.get(D);z||(z=new Map,d.set(D,z));const P=M.fillStyle;if(typeof P!="string")throw new Error(`Unexpected fillStyle type "${P}"`);let j=z.get(P);if(!j){const R=D[0].length,I=D.length,H=M.canvas.ownerDocument.createElement("canvas");H.width=R,H.height=I;const F=(0,u.throwIfFalsy)(H.getContext("2d")),G=new ImageData(R,I);let Z,J,W,$;if(P.startsWith("#"))Z=parseInt(P.slice(1,3),16),J=parseInt(P.slice(3,5),16),W=parseInt(P.slice(5,7),16),$=P.length>7&&parseInt(P.slice(7,9),16)||1;else{if(!P.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${P}" when drawing pattern glyph`);[Z,J,W,$]=P.substring(5,P.length-1).split(",").map(V=>parseFloat(V))}for(let V=0;V<I;V++)for(let U=0;U<R;U++)G.data[4*(V*R+U)]=Z,G.data[4*(V*R+U)+1]=J,G.data[4*(V*R+U)+2]=W,G.data[4*(V*R+U)+3]=D[V][U]*(255*$);F.putImageData(G,0,0),j=(0,u.throwIfFalsy)(M.createPattern(H,null)),z.set(P,j)}M.fillStyle=j,M.fillRect(L,N,O,B)}(x,k,m,p,y,_),!0;const T=o.boxDrawingDefinitions[v];if(T)return function(M,D,L,N,O,B,z){M.strokeStyle=M.fillStyle;for(const[P,j]of Object.entries(D)){let R;M.beginPath(),M.lineWidth=z*Number.parseInt(P),R=typeof j=="function"?j(.15,.15/B*O):j;for(const I of R.split(" ")){const H=I[0],F=g[H];if(!F){console.error(`Could not find drawing instructions for "${H}"`);continue}const G=I.substring(1).split(",");G[0]&&G[1]&&F(M,b(G,O,B,L,N,!0,z))}M.stroke(),M.closePath()}}(x,T,m,p,y,_,S),!0;const A=o.powerlineDefinitions[v];return!!A&&(function(M,D,L,N,O,B,z,P){const j=new Path2D;j.rect(L,N,O,B),M.clip(j),M.beginPath();const R=z/12;M.lineWidth=P*R;for(const I of D.d.split(" ")){const H=I[0],F=g[H];if(!F){console.error(`Could not find drawing instructions for "${H}"`);continue}const G=I.substring(1).split(",");G[0]&&G[1]&&F(M,b(G,O,B,L,N,!1,P,(D.leftPadding??0)*(R/2),(D.rightPadding??0)*(R/2)))}D.type===1?(M.strokeStyle=M.fillStyle,M.stroke()):M.fill(),M.closePath()}(x,A,m,p,y,_,C,S),!0)};const d=new Map;function f(x,v,m=0){return Math.max(Math.min(x,v),m)}const g={C:(x,v)=>x.bezierCurveTo(v[0],v[1],v[2],v[3],v[4],v[5]),L:(x,v)=>x.lineTo(v[0],v[1]),M:(x,v)=>x.moveTo(v[0],v[1])};function b(x,v,m,p,y,_,C,S=0,E=0){const k=x.map(T=>parseFloat(T)||parseInt(T));if(k.length<2)throw new Error("Too few arguments for instruction");for(let T=0;T<k.length;T+=2)k[T]*=v-S*C-E*C,_&&k[T]!==0&&(k[T]=f(Math.round(k[T]+.5)-.5,v,0)),k[T]+=p+S*C;for(let T=1;T<k.length;T+=2)k[T]*=m,_&&k[T]!==0&&(k[T]=f(Math.round(k[T]+.5)-.5,m,0)),k[T]+=y;return k}},56:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.observeDevicePixelDimensions=void 0;const u=l(859);o.observeDevicePixelDimensions=function(h,d,f){let g=new d.ResizeObserver(b=>{const x=b.find(p=>p.target===h);if(!x)return;if(!("devicePixelContentBoxSize"in x))return g==null||g.disconnect(),void(g=void 0);const v=x.devicePixelContentBoxSize[0].inlineSize,m=x.devicePixelContentBoxSize[0].blockSize;v>0&&m>0&&f(v,m)});try{g.observe(h,{box:["device-pixel-content-box"]})}catch{g.disconnect(),g=void 0}return(0,u.toDisposable)(()=>g==null?void 0:g.disconnect())}},374:(a,o)=>{function l(h){return 57508<=h&&h<=57558}function u(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},o.isEmoji=u,o.allowRescaling=function(h,d,f,g){return d===1&&f>Math.ceil(1.5*g)&&h!==void 0&&h>255&&!u(h)&&!l(h)&&!function(b){return 57344<=b&&b<=63743}(h)},o.treatGlyphAsBackgroundColor=function(h){return l(h)||function(d){return 9472<=d&&d<=9631}(h)},o.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}}}},o.computeNextVariantOffset=function(h,d,f=0){return(h-(2*Math.round(d)-f))%(2*Math.round(d))}},296:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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(h,d,f,g=!1){if(this.selectionStart=d,this.selectionEnd=f,!d||!f||d[0]===f[0]&&d[1]===f[1])return void this.clear();const b=h.buffers.active.ydisp,x=d[1]-b,v=f[1]-b,m=Math.max(x,0),p=Math.min(v,h.rows-1);m>=h.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=x,this.viewportEndRow=v,this.viewportCappedStartRow=m,this.viewportCappedEndRow=p,this.startCol=d[0],this.endCol=f[0])}isCellSelected(h,d,f){return!!this.hasSelection&&(f-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&f>=this.viewportCappedStartRow&&d<this.endCol&&f<=this.viewportCappedEndRow:d<this.startCol&&f>=this.viewportCappedStartRow&&d>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},509:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextureAtlas=void 0;const u=l(237),h=l(860),d=l(374),f=l(160),g=l(345),b=l(485),x=l(385),v=l(147),m=l(855),p={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 y;class _{get pages(){return this._pages}constructor(T,A,M){this._document=T,this._config=A,this._unicodeService=M,this._didWarmUp=!1,this._cacheMap=new b.FourKeyMap,this._cacheMapCombined=new b.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new v.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=E(T,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,d.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const T of this.pages)T.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const T=new x.IdleTaskQueue;for(let A=33;A<126;A++)T.enqueue(()=>{if(!this._cacheMap.get(A,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT)){const M=this._drawToCache(A,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT);this._cacheMap.set(A,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT,M)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const T of this._pages)T.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(_.maxAtlasPages&&this._pages.length>=Math.max(4,_.maxAtlasPages)){const A=this._pages.filter(z=>2*z.canvas.width<=(_.maxTextureSize||4096)).sort((z,P)=>P.canvas.width!==z.canvas.width?P.canvas.width-z.canvas.width:P.percentageUsed-z.percentageUsed);let M=-1,D=0;for(let z=0;z<A.length;z++)if(A[z].canvas.width!==D)M=z,D=A[z].canvas.width;else if(z-M==3)break;const L=A.slice(M,M+4),N=L.map(z=>z.glyphs[0].texturePage).sort((z,P)=>z>P?1:-1),O=this.pages.length-L.length,B=this._mergePages(L,O);B.version++;for(let z=N.length-1;z>=0;z--)this._deletePage(N[z]);this.pages.push(B),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(B.canvas)}const T=new C(this._document,this._textureSize);return this._pages.push(T),this._activePages.push(T),this._onAddTextureAtlasCanvas.fire(T.canvas),T}_mergePages(T,A){const M=2*T[0].canvas.width,D=new C(this._document,M,T);for(const[L,N]of T.entries()){const O=L*N.canvas.width%M,B=Math.floor(L/2)*N.canvas.height;D.ctx.drawImage(N.canvas,O,B);for(const P of N.glyphs)P.texturePage=A,P.sizeClipSpace.x=P.size.x/M,P.sizeClipSpace.y=P.size.y/M,P.texturePosition.x+=O,P.texturePosition.y+=B,P.texturePositionClipSpace.x=P.texturePosition.x/M,P.texturePositionClipSpace.y=P.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire(N.canvas);const z=this._activePages.indexOf(N);z!==-1&&this._activePages.splice(z,1)}return D}_deletePage(T){this._pages.splice(T,1);for(let A=T;A<this._pages.length;A++){const M=this._pages[A];for(const D of M.glyphs)D.texturePage--;M.version++}}getRasterizedGlyphCombinedChar(T,A,M,D,L){return this._getFromCacheMap(this._cacheMapCombined,T,A,M,D,L)}getRasterizedGlyph(T,A,M,D,L){return this._getFromCacheMap(this._cacheMap,T,A,M,D,L)}_getFromCacheMap(T,A,M,D,L,N=!1){return y=T.get(A,M,D,L),y||(y=this._drawToCache(A,M,D,L,N),T.set(A,M,D,L,y)),y}_getColorFromAnsiIndex(T){if(T>=this._config.colors.ansi.length)throw new Error("No color found for idx "+T);return this._config.colors.ansi[T]}_getBackgroundColor(T,A,M,D){if(this._config.allowTransparency)return f.NULL_COLOR;let L;switch(T){case 16777216:case 33554432:L=this._getColorFromAnsiIndex(A);break;case 50331648:const N=v.AttributeData.toColorRGB(A);L=f.channels.toColor(N[0],N[1],N[2]);break;default:L=M?f.color.opaque(this._config.colors.foreground):this._config.colors.background}return L}_getForegroundColor(T,A,M,D,L,N,O,B,z,P){const j=this._getMinimumContrastColor(T,A,M,D,L,N,O,z,B,P);if(j)return j;let R;switch(L){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&z&&N<8&&(N+=8),R=this._getColorFromAnsiIndex(N);break;case 50331648:const I=v.AttributeData.toColorRGB(N);R=f.channels.toColor(I[0],I[1],I[2]);break;default:R=O?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(R=f.color.opaque(R)),B&&(R=f.color.multiplyOpacity(R,u.DIM_OPACITY)),R}_resolveBackgroundRgba(T,A,M){switch(T){case 16777216:case 33554432:return this._getColorFromAnsiIndex(A).rgba;case 50331648:return A<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(T,A,M,D){switch(T){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&D&&A<8&&(A+=8),this._getColorFromAnsiIndex(A).rgba;case 50331648:return A<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(T,A,M,D,L,N,O,B,z,P){if(this._config.minimumContrastRatio===1||P)return;const j=this._getContrastCache(z),R=j.getColor(T,D);if(R!==void 0)return R||void 0;const I=this._resolveBackgroundRgba(A,M,O),H=this._resolveForegroundRgba(L,N,O,B),F=f.rgba.ensureContrastRatio(I,H,this._config.minimumContrastRatio/(z?2:1));if(!F)return void j.setColor(T,D,null);const G=f.channels.toColor(F>>24&255,F>>16&255,F>>8&255);return j.setColor(T,D,G),G}_getContrastCache(T){return T?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(T,A,M,D,L=!1){const N=typeof T=="number"?String.fromCharCode(T):T,O=Math.min(this._config.deviceCellWidth*Math.max(N.length,2)+4,this._textureSize);this._tmpCanvas.width<O&&(this._tmpCanvas.width=O);const B=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<B&&(this._tmpCanvas.height=B),this._tmpCtx.save(),this._workAttributeData.fg=M,this._workAttributeData.bg=A,this._workAttributeData.extended.ext=D,this._workAttributeData.isInvisible())return p;const z=!!this._workAttributeData.isBold(),P=!!this._workAttributeData.isInverse(),j=!!this._workAttributeData.isDim(),R=!!this._workAttributeData.isItalic(),I=!!this._workAttributeData.isUnderline(),H=!!this._workAttributeData.isStrikethrough(),F=!!this._workAttributeData.isOverline();let G=this._workAttributeData.getFgColor(),Z=this._workAttributeData.getFgColorMode(),J=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(P){const de=G;G=J,J=de;const se=Z;Z=W,W=se}const $=this._getBackgroundColor(W,J,P,j);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const V=z?this._config.fontWeightBold:this._config.fontWeight,U=R?"italic":"";this._tmpCtx.font=`${U} ${V} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=u.TEXT_BASELINE;const X=N.length===1&&(0,d.isPowerlineGlyph)(N.charCodeAt(0)),q=N.length===1&&(0,d.isRestrictedPowerlineGlyph)(N.charCodeAt(0)),ne=this._getForegroundColor(A,W,J,M,Z,G,P,j,z,(0,d.treatGlyphAsBackgroundColor)(N.charCodeAt(0)));this._tmpCtx.fillStyle=ne.css;const te=q?0:4;let le=!1;this._config.customGlyphs!==!1&&(le=(0,h.tryDrawCustomChar)(this._tmpCtx,N,te,te,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let xe,ie=!X;if(xe=typeof T=="number"?this._unicodeService.wcwidth(T):this._unicodeService.getStringCellWidth(T),I){this._tmpCtx.save();const de=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),se=de%2==1?.5:0;if(this._tmpCtx.lineWidth=de,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ie=!1,this._tmpCtx.strokeStyle=`rgb(${v.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ie=!1;let ve=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ve<8&&(ve+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ve).css}this._tmpCtx.beginPath();const me=te,K=Math.ceil(te+this._config.deviceCharHeight)-se-(L?2*de:0),Q=K+de,re=K+2*de;let ce=this._workAttributeData.getUnderlineVariantOffset();for(let ve=0;ve<xe;ve++){this._tmpCtx.save();const ge=me+ve*this._config.deviceCellWidth,pe=me+(ve+1)*this._config.deviceCellWidth,Ue=ge+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ge,K),this._tmpCtx.lineTo(pe,K),this._tmpCtx.moveTo(ge,re),this._tmpCtx.lineTo(pe,re);break;case 3:const Fe=de<=1?re:Math.ceil(te+this._config.deviceCharHeight-de/2)-se,He=de<=1?K:Math.ceil(te+this._config.deviceCharHeight+de/2)-se,$e=new Path2D;$e.rect(ge,K,this._config.deviceCellWidth,re-K),this._tmpCtx.clip($e),this._tmpCtx.moveTo(ge-this._config.deviceCellWidth/2,Q),this._tmpCtx.bezierCurveTo(ge-this._config.deviceCellWidth/2,He,ge,He,ge,Q),this._tmpCtx.bezierCurveTo(ge,Fe,Ue,Fe,Ue,Q),this._tmpCtx.bezierCurveTo(Ue,He,pe,He,pe,Q),this._tmpCtx.bezierCurveTo(pe,Fe,pe+this._config.deviceCellWidth/2,Fe,pe+this._config.deviceCellWidth/2,Q);break;case 4:const dt=ce===0?0:ce>=de?2*de-ce:de-ce;ce>=de||dt===0?(this._tmpCtx.setLineDash([Math.round(de),Math.round(de)]),this._tmpCtx.moveTo(ge+dt,K),this._tmpCtx.lineTo(pe,K)):(this._tmpCtx.setLineDash([Math.round(de),Math.round(de)]),this._tmpCtx.moveTo(ge,K),this._tmpCtx.lineTo(ge+dt,K),this._tmpCtx.moveTo(ge+dt+de,K),this._tmpCtx.lineTo(pe,K)),ce=(0,d.computeNextVariantOffset)(pe-ge,de,ce);break;case 5:const Ee=.6,Me=.3,Ie=pe-ge,ht=Math.floor(Ee*Ie),Je=Math.floor(Me*Ie),at=Ie-ht-Je;this._tmpCtx.setLineDash([ht,Je,at]),this._tmpCtx.moveTo(ge,K),this._tmpCtx.lineTo(pe,K);break;default:this._tmpCtx.moveTo(ge,K),this._tmpCtx.lineTo(pe,K)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!le&&this._config.fontSize>=12&&!this._config.allowTransparency&&N!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const ve=this._tmpCtx.measureText(N);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ve&&ve.actualBoundingBoxDescent>0){this._tmpCtx.save();const ge=new Path2D;ge.rect(me,K-Math.ceil(de/2),this._config.deviceCellWidth*xe,re-K+Math.ceil(de/2)),this._tmpCtx.clip(ge),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(N,te,te+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(F){const de=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),se=de%2==1?.5:0;this._tmpCtx.lineWidth=de,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(te,te+se),this._tmpCtx.lineTo(te+this._config.deviceCharWidth*xe,te+se),this._tmpCtx.stroke()}if(le||this._tmpCtx.fillText(N,te,te+this._config.deviceCharHeight),N==="_"&&!this._config.allowTransparency){let de=S(this._tmpCtx.getImageData(te,te,this._config.deviceCellWidth,this._config.deviceCellHeight),$,ne,ie);if(de)for(let se=1;se<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(N,te,te+this._config.deviceCharHeight-se),de=S(this._tmpCtx.getImageData(te,te,this._config.deviceCellWidth,this._config.deviceCellHeight),$,ne,ie),de);se++);}if(H){const de=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),se=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=de,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(te,te+Math.floor(this._config.deviceCharHeight/2)-se),this._tmpCtx.lineTo(te+this._config.deviceCharWidth*xe,te+Math.floor(this._config.deviceCharHeight/2)-se),this._tmpCtx.stroke()}this._tmpCtx.restore();const Te=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ae;if(Ae=this._config.allowTransparency?function(de){for(let se=0;se<de.data.length;se+=4)if(de.data[se+3]>0)return!1;return!0}(Te):S(Te,$,ne,ie),Ae)return p;const be=this._findGlyphBoundingBox(Te,this._workBoundingBox,O,q,le,te);let we,_e;for(;;){if(this._activePages.length===0){const de=this._createNewPage();we=de,_e=de.currentRow,_e.height=be.size.y;break}we=this._activePages[this._activePages.length-1],_e=we.currentRow;for(const de of this._activePages)be.size.y<=de.currentRow.height&&(we=de,_e=de.currentRow);for(let de=this._activePages.length-1;de>=0;de--)for(const se of this._activePages[de].fixedRows)se.height<=_e.height&&be.size.y<=se.height&&(we=this._activePages[de],_e=se);if(_e.y+be.size.y>=we.canvas.height||_e.height>be.size.y+2){let de=!1;if(we.currentRow.y+we.currentRow.height+be.size.y>=we.canvas.height){let se;for(const me of this._activePages)if(me.currentRow.y+me.currentRow.height+be.size.y<me.canvas.height){se=me;break}if(se)we=se;else if(_.maxAtlasPages&&this._pages.length>=_.maxAtlasPages&&_e.y+be.size.y<=we.canvas.height&&_e.height>=be.size.y&&_e.x+be.size.x<=we.canvas.width)de=!0;else{const me=this._createNewPage();we=me,_e=me.currentRow,_e.height=be.size.y,de=!0}}de||(we.currentRow.height>0&&we.fixedRows.push(we.currentRow),_e={x:0,y:we.currentRow.y+we.currentRow.height,height:be.size.y},we.fixedRows.push(_e),we.currentRow={x:0,y:_e.y+_e.height,height:0})}if(_e.x+be.size.x<=we.canvas.width)break;_e===we.currentRow?(_e.x=0,_e.y+=_e.height,_e.height=0):we.fixedRows.splice(we.fixedRows.indexOf(_e),1)}return be.texturePage=this._pages.indexOf(we),be.texturePosition.x=_e.x,be.texturePosition.y=_e.y,be.texturePositionClipSpace.x=_e.x/we.canvas.width,be.texturePositionClipSpace.y=_e.y/we.canvas.height,be.sizeClipSpace.x/=we.canvas.width,be.sizeClipSpace.y/=we.canvas.height,_e.height=Math.max(_e.height,be.size.y),_e.x+=be.size.x,we.ctx.putImageData(Te,be.texturePosition.x-this._workBoundingBox.left,be.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,be.size.x,be.size.y),we.addGlyph(be),we.version++,be}_findGlyphBoundingBox(T,A,M,D,L,N){A.top=0;const O=D?this._config.deviceCellHeight:this._tmpCanvas.height,B=D?this._config.deviceCellWidth:M;let z=!1;for(let P=0;P<O;P++){for(let j=0;j<B;j++){const R=P*this._tmpCanvas.width*4+4*j+3;if(T.data[R]!==0){A.top=P,z=!0;break}}if(z)break}A.left=0,z=!1;for(let P=0;P<N+B;P++){for(let j=0;j<O;j++){const R=j*this._tmpCanvas.width*4+4*P+3;if(T.data[R]!==0){A.left=P,z=!0;break}}if(z)break}A.right=B,z=!1;for(let P=N+B-1;P>=N;P--){for(let j=0;j<O;j++){const R=j*this._tmpCanvas.width*4+4*P+3;if(T.data[R]!==0){A.right=P,z=!0;break}}if(z)break}A.bottom=O,z=!1;for(let P=O-1;P>=0;P--){for(let j=0;j<B;j++){const R=P*this._tmpCanvas.width*4+4*j+3;if(T.data[R]!==0){A.bottom=P,z=!0;break}}if(z)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:A.right-A.left+1,y:A.bottom-A.top+1},sizeClipSpace:{x:A.right-A.left+1,y:A.bottom-A.top+1},offset:{x:-A.left+N+(D||L?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-A.top+N+(D||L?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}o.TextureAtlas=_;class C{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(T){this._glyphs.push(T),this._usedPixels+=T.size.x*T.size.y}constructor(T,A,M){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],M)for(const D of M)this._glyphs.push(...D.glyphs),this._usedPixels+=D._usedPixels;this.canvas=E(T,A,A),this.ctx=(0,d.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 S(k,T,A,M){const D=T.rgba>>>24,L=T.rgba>>>16&255,N=T.rgba>>>8&255,O=A.rgba>>>24,B=A.rgba>>>16&255,z=A.rgba>>>8&255,P=Math.floor((Math.abs(D-O)+Math.abs(L-B)+Math.abs(N-z))/12);let j=!0;for(let R=0;R<k.data.length;R+=4)k.data[R]===D&&k.data[R+1]===L&&k.data[R+2]===N||M&&Math.abs(k.data[R]-D)+Math.abs(k.data[R+1]-L)+Math.abs(k.data[R+2]-N)<P?k.data[R+3]=0:j=!1;return j}function E(k,T,A){const M=k.createElement("canvas");return M.width=T,M.height=A,M}},577:function(a,o,l){var u=this&&this.__decorate||function(m,p,y,_){var C,S=arguments.length,E=S<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,p,y,_);else for(var k=m.length-1;k>=0;k--)(C=m[k])&&(E=(S<3?C(E):S>3?C(p,y,E):C(p,y))||E);return S>3&&E&&Object.defineProperty(p,y,E),E},h=this&&this.__param||function(m,p){return function(y,_){p(y,_,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(147),f=l(855),g=l(782),b=l(97);class x extends d.AttributeData{constructor(p,y,_){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=y,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=x;let v=o.CharacterJoinerService=class K8{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(p){const y={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(y),y.id}deregister(p){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===p)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(p);if(!y||y.length===0)return[];const _=[],C=y.translateToString(!0);let S=0,E=0,k=0,T=y.getFg(0),A=y.getBg(0);for(let M=0;M<y.getTrimmedLength();M++)if(y.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==T||this._workCell.bg!==A){if(M-S>1){const D=this._getJoinedRanges(C,k,E,y,S);for(let L=0;L<D.length;L++)_.push(D[L])}S=M,k=E,T=this._workCell.fg,A=this._workCell.bg}E+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const M=this._getJoinedRanges(C,k,E,y,S);for(let D=0;D<M.length;D++)_.push(M[D])}return _}_getJoinedRanges(p,y,_,C,S){const E=p.substring(y,_);let k=[];try{k=this._characterJoiners[0].handler(E)}catch(T){console.error(T)}for(let T=1;T<this._characterJoiners.length;T++)try{const A=this._characterJoiners[T].handler(E);for(let M=0;M<A.length;M++)K8._mergeRanges(k,A[M])}catch(A){console.error(A)}return this._stringRangesToCellRanges(k,C,S),k}_stringRangesToCellRanges(p,y,_){let C=0,S=!1,E=0,k=p[C];if(k){for(let T=_;T<this._bufferService.cols;T++){const A=y.getWidth(T),M=y.getString(T).length||f.WHITESPACE_CELL_CHAR.length;if(A!==0){if(!S&&k[0]<=E&&(k[0]=T,S=!0),k[1]<=E){if(k[1]=T,k=p[++C],!k)break;k[0]<=E?(k[0]=T,S=!0):S=!1}E+=M}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(p,y){let _=!1;for(let C=0;C<p.length;C++){const S=p[C];if(_){if(y[1]<=S[0])return p[C-1][1]=y[1],p;if(y[1]<=S[1])return p[C-1][1]=Math.max(y[1],S[1]),p.splice(C,1),p;p.splice(C,1),C--}else{if(y[1]<=S[0])return p.splice(C,0,y),p;if(y[1]<=S[1])return S[0]=Math.min(y[0],S[0]),p;y[0]<S[1]&&(S[0]=Math.min(y[0],S[0]),_=!0)}}return _?p[p.length-1][1]=y[1]:p.push(y),p}};o.CharacterJoinerService=v=u([h(0,b.IBufferService)],v)},160:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,h=0,d=0;var f,g,b,x,v;function m(y){const _=y.toString(16);return _.length<2?"0"+_:_}function p(y,_){return y<_?(_+.05)/(y+.05):(y+.05)/(_+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(_,C,S,E){return E!==void 0?`#${m(_)}${m(C)}${m(S)}${m(E)}`:`#${m(_)}${m(C)}${m(S)}`},y.toRgba=function(_,C,S,E=255){return(_<<24|C<<16|S<<8|E)>>>0},y.toColor=function(_,C,S,E){return{css:y.toCss(_,C,S,E),rgba:y.toRgba(_,C,S,E)}}}(f||(o.channels=f={})),function(y){function _(C,S){return d=Math.round(255*S),[l,u,h]=v.toChannels(C.rgba),{css:f.toCss(l,u,h,d),rgba:f.toRgba(l,u,h,d)}}y.blend=function(C,S){if(d=(255&S.rgba)/255,d===1)return{css:S.css,rgba:S.rgba};const E=S.rgba>>24&255,k=S.rgba>>16&255,T=S.rgba>>8&255,A=C.rgba>>24&255,M=C.rgba>>16&255,D=C.rgba>>8&255;return l=A+Math.round((E-A)*d),u=M+Math.round((k-M)*d),h=D+Math.round((T-D)*d),{css:f.toCss(l,u,h),rgba:f.toRgba(l,u,h)}},y.isOpaque=function(C){return(255&C.rgba)==255},y.ensureContrastRatio=function(C,S,E){const k=v.ensureContrastRatio(C.rgba,S.rgba,E);if(k)return f.toColor(k>>24&255,k>>16&255,k>>8&255)},y.opaque=function(C){const S=(255|C.rgba)>>>0;return[l,u,h]=v.toChannels(S),{css:f.toCss(l,u,h),rgba:S}},y.opacity=_,y.multiplyOpacity=function(C,S){return d=255&C.rgba,_(C,d*S/255)},y.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(g||(o.color=g={})),function(y){let _,C;try{const S=document.createElement("canvas");S.width=1,S.height=1;const E=S.getContext("2d",{willReadFrequently:!0});E&&(_=E,_.globalCompositeOperation="copy",C=_.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return l=parseInt(S.slice(1,2).repeat(2),16),u=parseInt(S.slice(2,3).repeat(2),16),h=parseInt(S.slice(3,4).repeat(2),16),f.toColor(l,u,h);case 5:return l=parseInt(S.slice(1,2).repeat(2),16),u=parseInt(S.slice(2,3).repeat(2),16),h=parseInt(S.slice(3,4).repeat(2),16),d=parseInt(S.slice(4,5).repeat(2),16),f.toColor(l,u,h,d);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const E=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return l=parseInt(E[1]),u=parseInt(E[2]),h=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(l,u,h,d);if(!_||!C)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=C,_.fillStyle=S,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[l,u,h,d]=_.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(l,u,h,d),css:S}}}(b||(o.css=b={})),function(y){function _(C,S,E){const k=C/255,T=S/255,A=E/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))}y.relativeLuminance=function(C){return _(C>>16&255,C>>8&255,255&C)},y.relativeLuminance2=_}(x||(o.rgb=x={})),function(y){function _(S,E,k){const T=S>>24&255,A=S>>16&255,M=S>>8&255;let D=E>>24&255,L=E>>16&255,N=E>>8&255,O=p(x.relativeLuminance2(D,L,N),x.relativeLuminance2(T,A,M));for(;O<k&&(D>0||L>0||N>0);)D-=Math.max(0,Math.ceil(.1*D)),L-=Math.max(0,Math.ceil(.1*L)),N-=Math.max(0,Math.ceil(.1*N)),O=p(x.relativeLuminance2(D,L,N),x.relativeLuminance2(T,A,M));return(D<<24|L<<16|N<<8|255)>>>0}function C(S,E,k){const T=S>>24&255,A=S>>16&255,M=S>>8&255;let D=E>>24&255,L=E>>16&255,N=E>>8&255,O=p(x.relativeLuminance2(D,L,N),x.relativeLuminance2(T,A,M));for(;O<k&&(D<255||L<255||N<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),L=Math.min(255,L+Math.ceil(.1*(255-L))),N=Math.min(255,N+Math.ceil(.1*(255-N))),O=p(x.relativeLuminance2(D,L,N),x.relativeLuminance2(T,A,M));return(D<<24|L<<16|N<<8|255)>>>0}y.blend=function(S,E){if(d=(255&E)/255,d===1)return E;const k=E>>24&255,T=E>>16&255,A=E>>8&255,M=S>>24&255,D=S>>16&255,L=S>>8&255;return l=M+Math.round((k-M)*d),u=D+Math.round((T-D)*d),h=L+Math.round((A-L)*d),f.toRgba(l,u,h)},y.ensureContrastRatio=function(S,E,k){const T=x.relativeLuminance(S>>8),A=x.relativeLuminance(E>>8);if(p(T,A)<k){if(A<T){const L=_(S,E,k),N=p(T,x.relativeLuminance(L>>8));if(N<k){const O=C(S,E,k);return N>p(T,x.relativeLuminance(O>>8))?L:O}return L}const M=C(S,E,k),D=p(T,x.relativeLuminance(M>>8));if(D<k){const L=_(S,E,k);return D>p(T,x.relativeLuminance(L>>8))?M:L}return M}},y.reduceLuminance=_,y.increaseLuminance=C,y.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}}(v||(o.rgba=v={})),o.toPaddedHex=m,o.contrastRatio=p},345:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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 u=0;u<this._listeners.length;u++)if(this._listeners[u]===l)return void this._listeners.splice(u,1)}}})),this._event}fire(l,u){const h=[];for(let d=0;d<this._listeners.length;d++)h.push(this._listeners[d]);for(let d=0;d<h.length;d++)h[d].call(void 0,l,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,u){return l(h=>u.fire(h))},o.runAndSubscribe=function(l,u){return u(void 0),l(h=>u(h))}},859:(a,o)=>{function l(u){for(const h of u)h.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const h=this._disposables.indexOf(u);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var h;this._isDisposed||u===this._value||((h=this._value)==null||h.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},485:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(h,d,f){this._data[h]||(this._data[h]={}),this._data[h][d]=f}get(h,d){return this._data[h]?this._data[h][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,h,d,f,g){this._data.get(u,h)||this._data.set(u,h,new l),this._data.get(u,h).set(d,f,g)}get(u,h,d,f){var g;return(g=this._data.get(u,h))==null?void 0:g.get(d,f)}clear(){this._data.clear()}}},399:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const h=l.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},385:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(399);class h{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 b=0,x=0,v=g.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),x=Math.max(b,x),m=g.timeRemaining(),1.5*x>m)return v-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-b))}ms`),void this._start();v=m}this.clear()}}class d extends h{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const b=Date.now()+g;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},147:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,f=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=f}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},782:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(133),h=l(855),d=l(147);class f extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const x=new f;return x.setFromCharData(b),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(b[h.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(b[h.CHAR_DATA_CHAR_INDEX].length===2){const v=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const m=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(v-55296)+m-56320+65536|b[h.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=b[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=f},855:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},133:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,h=l.length){let d="";for(let f=u;f<h;++f){let g=l[f];g>65535?(g-=65536,d+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):d+=String.fromCharCode(g)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const h=l.length;if(!h)return 0;let d=0,f=0;if(this._interim){const g=l.charCodeAt(f++);56320<=g&&g<=57343?u[d++]=1024*(this._interim-55296)+g-56320+65536:(u[d++]=this._interim,u[d++]=g),this._interim=0}for(let g=f;g<h;++g){const b=l.charCodeAt(g);if(55296<=b&&b<=56319){if(++g>=h)return this._interim=b,d;const x=l.charCodeAt(g);56320<=x&&x<=57343?u[d++]=1024*(b-55296)+x-56320+65536:(u[d++]=b,u[d++]=x)}else b!==65279&&(u[d++]=b)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const h=l.length;if(!h)return 0;let d,f,g,b,x=0,v=0,m=0;if(this.interim[0]){let _=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let S,E=0;for(;(S=63&this.interim[++E])&&E<4;)C<<=6,C|=S;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=k-E;for(;m<T;){if(m>=h)return 0;if(S=l[m++],(192&S)!=128){m--,_=!0;break}this.interim[E++]=S,C<<=6,C|=63&S}_||(k===2?C<128?m--:u[x++]=C:k===3?C<2048||C>=55296&&C<=57343||C===65279||(u[x++]=C):C<65536||C>1114111||(u[x++]=C)),this.interim.fill(0)}const p=h-4;let y=m;for(;y<h;){for(;!(!(y<p)||128&(d=l[y])||128&(f=l[y+1])||128&(g=l[y+2])||128&(b=l[y+3]));)u[x++]=d,u[x++]=f,u[x++]=g,u[x++]=b,y+=4;if(d=l[y++],d<128)u[x++]=d;else if((224&d)==192){if(y>=h)return this.interim[0]=d,x;if(f=l[y++],(192&f)!=128){y--;continue}if(v=(31&d)<<6|63&f,v<128){y--;continue}u[x++]=v}else if((240&d)==224){if(y>=h)return this.interim[0]=d,x;if(f=l[y++],(192&f)!=128){y--;continue}if(y>=h)return this.interim[0]=d,this.interim[1]=f,x;if(g=l[y++],(192&g)!=128){y--;continue}if(v=(15&d)<<12|(63&f)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;u[x++]=v}else if((248&d)==240){if(y>=h)return this.interim[0]=d,x;if(f=l[y++],(192&f)!=128){y--;continue}if(y>=h)return this.interim[0]=d,this.interim[1]=f,x;if(g=l[y++],(192&g)!=128){y--;continue}if(y>=h)return this.interim[0]=d,this.interim[1]=f,this.interim[2]=g,x;if(b=l[y++],(192&b)!=128){y--;continue}if(v=(7&d)<<18|(63&f)<<12|(63&g)<<6|63&b,v<65536||v>1114111)continue;u[x++]=v}}return x}}},776:function(a,o,l){var u=this&&this.__decorate||function(v,m,p,y){var _,C=arguments.length,S=C<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,m,p,y);else for(var E=v.length-1;E>=0;E--)(_=v[E])&&(S=(C<3?_(S):C>3?_(m,p,S):_(m,p))||S);return C>3&&S&&Object.defineProperty(m,p,S),S},h=this&&this.__param||function(v,m){return function(p,y){m(p,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(859),f=l(97),g={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let b,x=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let m=0;m<v.length;m++)typeof v[m]=="function"&&(v[m]=v[m]())}_log(v,m,p){this._evalLazyOptionalParams(p),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+m,...p)}trace(v,...m){var p;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.trace.bind(this._optionsService.options.logger))??console.log,v,m)}debug(v,...m){var p;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.debug.bind(this._optionsService.options.logger))??console.log,v,m)}info(v,...m){var p;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.info.bind(this._optionsService.options.logger))??console.info,v,m)}warn(v,...m){var p;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.warn.bind(this._optionsService.options.logger))??console.warn,v,m)}error(v,...m){var p;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.error.bind(this._optionsService.options.logger))??console.error,v,m)}};o.LogService=x=u([h(0,f.IOptionsService)],x),o.setTraceLogger=function(v){b=v},o.traceCall=function(v,m,p){if(typeof p.value!="function")throw new Error("not supported");const y=p.value;p.value=function(..._){if(b.logLevel!==f.LogLevelEnum.TRACE)return y.apply(this,_);b.trace(`GlyphRenderer#${y.name}(${_.map(S=>JSON.stringify(S)).join(", ")})`);const C=y.apply(this,_);return b.trace(`GlyphRenderer#${y.name} return`,C),C}}},726:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(h){return h[u]||[]},o.createDecorator=function(h){if(o.serviceRegistry.has(h))return o.serviceRegistry.get(h);const d=function(f,g,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,v,m){v[l]===v?v[u].push({id:x,index:m}):(v[u]=[{id:x,index:m}],v[l]=v)})(d,f,b)};return d.toString=()=>h,o.serviceRegistry.set(h,d),d}},97:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(726);var h;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(h||(o.LogLevelEnum=h={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.CanvasAddon=void 0;const o=i(345),l=i(859),u=i(776),h=i(949);class d extends l.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var g;return(g=this._renderer)==null?void 0:g.textureAtlas}activate(g){const b=g._core;if(!g.element)return void this.register(b.onWillOpen(()=>this.activate(g)));this._terminal=g;const x=b.coreService,v=b.optionsService,m=b.screenElement,p=b.linkifier,y=b,_=y._bufferService,C=y._renderService,S=y._characterJoinerService,E=y._charSizeService,k=y._coreBrowserService,T=y._decorationService,A=y._logService,M=y._themeService;(0,u.setTraceLogger)(A),this._renderer=new h.CanvasRenderer(g,m,p,_,E,v,S,x,k,T,M),this.register((0,o.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,o.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),C.setRenderer(this._renderer),C.handleResize(_.cols,_.rows),this.register((0,l.toDisposable)(()=>{var D;C.setRenderer(this._terminal._core._createRenderer()),C.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=d})(),s})())})(G8);var Y8=G8.exports,X8={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 s=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(s._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,s=i._renderService.dimensions;if(s.css.cell.width===0||s.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),d=l-(parseInt(h.getPropertyValue("padding-top"))+parseInt(h.getPropertyValue("padding-bottom"))),f=u-(parseInt(h.getPropertyValue("padding-right"))+parseInt(h.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(f/s.css.cell.width)),rows:Math.max(1,Math.floor(d/s.css.cell.height))}}}})(),n})())})(X8);var J8=X8.exports,Q8={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={345:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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 u=0;u<this._listeners.length;u++)if(this._listeners[u]===l)return void this._listeners.splice(u,1)}}})),this._event}fire(l,u){const h=[];for(let d=0;d<this._listeners.length;d++)h.push(this._listeners[d]);for(let d=0;d<h.length;d++)h[d].call(void 0,l,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,u){return l(h=>u.fire(h))},o.runAndSubscribe=function(l,u){return u(void 0),l(h=>u(h))}},859:(a,o)=>{function l(u){for(const h of u)h.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const h=this._disposables.indexOf(u);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var h;this._isDisposed||u===this._value||((h=this._value)==null||h.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.SearchAddon=void 0;const o=i(345),l=i(859),u=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class h extends l.Disposable{constructor(f){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new l.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new l.MutableDisposable,this._onDidChangeResults=this.register(new o.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(f==null?void 0:f.highlightLimit)??1e3}activate(f){this._terminal=f,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,l.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var f;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((f=this._lastSearchOptions)!=null&&f.decorations)&&(this._highlightTimeout=setTimeout(()=>{const g=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(g,{...this._lastSearchOptions,incremental:!0,noScroll:!0})},200))}clearDecorations(f){this._selectedDecoration.clear(),(0,l.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),f||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(f,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const b=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||f!==this._cachedSearchTerm||b)&&this._highlightAllMatches(f,g);const x=this._findNextAndSelect(f,g);return this._fireResults(g),this._cachedSearchTerm=f,x}_highlightAllMatches(f,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!f||f.length===0)return void this.clearDecorations();g=g||{},this.clearDecorations(!0);const b=[];let x,v=this._find(f,0,0,g);for(;v&&((x==null?void 0:x.row)!==v.row||(x==null?void 0:x.col)!==v.col)&&!(b.length>=this._highlightLimit);)x=v,b.push(x),v=this._find(f,x.col+x.term.length>=this._terminal.cols?x.row+1:x.row,x.col+x.term.length>=this._terminal.cols?0:x.col+1,g);for(const m of b){const p=this._createResultDecoration(m,g.decorations);p&&(this._highlightedLines.add(p.marker.line),this._highlightDecorations.push({decoration:p,match:m,dispose(){p.dispose()}}))}}_find(f,g,b,x){var p;if(!this._terminal||!f||f.length===0)return(p=this._terminal)==null||p.clearSelection(),void this.clearDecorations();if(b>this._terminal.cols)throw new Error(`Invalid col: ${b} to search in terminal of ${this._terminal.cols} cols`);let v;this._initLinesCache();const m={startRow:g,startCol:b};if(v=this._findInLine(f,m,x),!v)for(let y=g+1;y<this._terminal.buffer.active.baseY+this._terminal.rows&&(m.startRow=y,m.startCol=0,v=this._findInLine(f,m,x),!v);y++);return v}_findNextAndSelect(f,g){var y;if(!this._terminal||!f||f.length===0)return(y=this._terminal)==null||y.clearSelection(),this.clearDecorations(),!1;const b=this._terminal.getSelectionPosition();this._terminal.clearSelection();let x=0,v=0;b&&(this._cachedSearchTerm===f?(x=b.end.x,v=b.end.y):(x=b.start.x,v=b.start.y)),this._initLinesCache();const m={startRow:v,startCol:x};let p=this._findInLine(f,m,g);if(!p)for(let _=v+1;_<this._terminal.buffer.active.baseY+this._terminal.rows&&(m.startRow=_,m.startCol=0,p=this._findInLine(f,m,g),!p);_++);if(!p&&v!==0)for(let _=0;_<v&&(m.startRow=_,m.startCol=0,p=this._findInLine(f,m,g),!p);_++);return!p&&b&&(m.startRow=b.start.y,m.startCol=0,p=this._findInLine(f,m,g)),this._selectResult(p,g==null?void 0:g.decorations,g==null?void 0:g.noScroll)}findPrevious(f,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const b=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||f!==this._cachedSearchTerm||b)&&this._highlightAllMatches(f,g);const x=this._findPreviousAndSelect(f,g);return this._fireResults(g),this._cachedSearchTerm=f,x}_didOptionsChange(f,g){return!!g&&(f.caseSensitive!==g.caseSensitive||f.regex!==g.regex||f.wholeWord!==g.wholeWord)}_fireResults(f){if(f!=null&&f.decorations){let g=-1;if(this._selectedDecoration.value){const b=this._selectedDecoration.value.match;for(let x=0;x<this._highlightDecorations.length;x++){const v=this._highlightDecorations[x].match;if(v.row===b.row&&v.col===b.col&&v.size===b.size){g=x;break}}}this._onDidChangeResults.fire({resultIndex:g,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(f,g){var _;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!f||f.length===0)return(_=this._terminal)==null||_.clearSelection(),this.clearDecorations(),!1;const b=this._terminal.getSelectionPosition();this._terminal.clearSelection();let x=this._terminal.buffer.active.baseY+this._terminal.rows-1,v=this._terminal.cols;const m=!0;this._initLinesCache();const p={startRow:x,startCol:v};let y;if(b&&(p.startRow=x=b.start.y,p.startCol=v=b.start.x,this._cachedSearchTerm!==f&&(y=this._findInLine(f,p,g,!1),y||(p.startRow=x=b.end.y,p.startCol=v=b.end.x))),y||(y=this._findInLine(f,p,g,m)),!y){p.startCol=Math.max(p.startCol,this._terminal.cols);for(let C=x-1;C>=0&&(p.startRow=C,y=this._findInLine(f,p,g,m),!y);C--);}if(!y&&x!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let C=this._terminal.buffer.active.baseY+this._terminal.rows-1;C>=x&&(p.startRow=C,y=this._findInLine(f,p,g,m),!y);C--);return this._selectResult(y,g==null?void 0:g.decorations,g==null?void 0:g.noScroll)}_initLinesCache(){const f=this._terminal;this._linesCache||(this._linesCache=new Array(f.buffer.active.length),this._linesCacheDisposables.value=(0,l.getDisposeArrayDisposable)([f.onLineFeed(()=>this._destroyLinesCache()),f.onCursorMove(()=>this._destroyLinesCache()),f.onResize(()=>this._destroyLinesCache())])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(f,g,b){return(f===0||u.includes(g[f-1]))&&(f+b.length===g.length||u.includes(g[f+b.length]))}_findInLine(f,g,b={},x=!1){var M;const v=this._terminal,m=g.startRow,p=g.startCol,y=v.buffer.active.getLine(m);if(y!=null&&y.isWrapped)return x?void(g.startCol+=v.cols):(g.startRow--,g.startCol+=v.cols,this._findInLine(f,g,b));let _=(M=this._linesCache)==null?void 0:M[m];_||(_=this._translateBufferLineToStringWithWrap(m,!0),this._linesCache&&(this._linesCache[m]=_));const[C,S]=_,E=this._bufferColsToStringOffset(m,p),k=b.caseSensitive?f:f.toLowerCase(),T=b.caseSensitive?C:C.toLowerCase();let A=-1;if(b.regex){const D=RegExp(k,"g");let L;if(x)for(;L=D.exec(T.slice(0,E));)A=D.lastIndex-L[0].length,f=L[0],D.lastIndex-=f.length-1;else L=D.exec(T.slice(E)),L&&L[0].length>0&&(A=E+(D.lastIndex-L[0].length),f=L[0])}else x?E-k.length>=0&&(A=T.lastIndexOf(k,E-k.length)):A=T.indexOf(k,E);if(A>=0){if(b.wholeWord&&!this._isWholeWord(A,T,f))return;let D=0;for(;D<S.length-1&&A>=S[D+1];)D++;let L=D;for(;L<S.length-1&&A+f.length>=S[L+1];)L++;const N=A-S[D],O=A+f.length-S[L],B=this._stringLengthToBufferSize(m+D,N);return{term:f,col:B,row:m+D,size:this._stringLengthToBufferSize(m+L,O)-B+v.cols*(L-D)}}}_stringLengthToBufferSize(f,g){const b=this._terminal.buffer.active.getLine(f);if(!b)return 0;for(let x=0;x<g;x++){const v=b.getCell(x);if(!v)break;const m=v.getChars();m.length>1&&(g-=m.length-1);const p=b.getCell(x+1);p&&p.getWidth()===0&&g++}return g}_bufferColsToStringOffset(f,g){const b=this._terminal;let x=f,v=0,m=b.buffer.active.getLine(x);for(;g>0&&m;){for(let p=0;p<g&&p<b.cols;p++){const y=m.getCell(p);if(!y)break;y.getWidth()&&(v+=y.getCode()===0?1:y.getChars().length)}if(x++,m=b.buffer.active.getLine(x),m&&!m.isWrapped)break;g-=b.cols}return v}_translateBufferLineToStringWithWrap(f,g){var p;const b=this._terminal,x=[],v=[0];let m=b.buffer.active.getLine(f);for(;m;){const y=b.buffer.active.getLine(f+1),_=!!y&&y.isWrapped;let C=m.translateToString(!_&&g);if(_&&y){const S=m.getCell(m.length-1);S&&S.getCode()===0&&S.getWidth()===1&&((p=y.getCell(0))==null?void 0:p.getWidth())===2&&(C=C.slice(0,-1))}if(x.push(C),!_)break;v.push(v[v.length-1]+C.length),f++,m=y}return[x.join(""),v]}_selectResult(f,g,b){const x=this._terminal;if(this._selectedDecoration.clear(),!f)return x.clearSelection(),!1;if(x.select(f.col,f.row,f.size),g){const v=x.registerMarker(-x.buffer.active.baseY-x.buffer.active.cursorY+f.row);if(v){const m=x.registerDecoration({marker:v,x:f.col,width:f.size,backgroundColor:g.activeMatchBackground,layer:"top",overviewRulerOptions:{color:g.activeMatchColorOverviewRuler}});if(m){const p=[];p.push(v),p.push(m.onRender(y=>this._applyStyles(y,g.activeMatchBorder,!0))),p.push(m.onDispose(()=>(0,l.disposeArray)(p))),this._selectedDecoration.value={decoration:m,match:f,dispose(){m.dispose()}}}}}if(!b&&(f.row>=x.buffer.active.viewportY+x.rows||f.row<x.buffer.active.viewportY)){let v=f.row-x.buffer.active.viewportY;v-=Math.floor(x.rows/2),x.scrollLines(v)}return!0}_applyStyles(f,g,b){f.classList.contains("xterm-find-result-decoration")||(f.classList.add("xterm-find-result-decoration"),g&&(f.style.outline=`1px solid ${g}`)),b&&f.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(f,g){const b=this._terminal,x=b.registerMarker(-b.buffer.active.baseY-b.buffer.active.cursorY+f.row);if(!x)return;const v=b.registerDecoration({marker:x,x:f.col,width:f.size,backgroundColor:g.matchBackground,overviewRulerOptions:this._highlightedLines.has(x.line)?void 0:{color:g.matchOverviewRuler,position:"center"}});if(v){const m=[];m.push(x),m.push(v.onRender(p=>this._applyStyles(p,g.matchBorder,!1))),m.push(v.onDispose(()=>(0,l.disposeArray)(m)))}return v}}a.SearchAddon=h})(),s})())})(Q8);var Z8=Q8.exports,eP={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={6:(a,o)=>{function l(h){try{const d=new URL(h),f=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return h.toLocaleLowerCase().startsWith(f.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(h,d,f,g={}){this._terminal=h,this._regex=d,this._handler=f,this._options=g}provideLinks(h,d){const f=u.computeLink(h,this._regex,this._terminal,this._handler);d(this._addCallbacks(f))}_addCallbacks(h){return h.map(d=>(d.leave=this._options.leave,d.hover=(f,g)=>{if(this._options.hover){const{range:b}=d;this._options.hover(f,g,b)}},d))}};class u{static computeLink(d,f,g,b){const x=new RegExp(f.source,(f.flags||"")+"g"),[v,m]=u._getWindowedLineStrings(d-1,g),p=v.join("");let y;const _=[];for(;y=x.exec(p);){const C=y[0];if(!l(C))continue;const[S,E]=u._mapStrIdx(g,m,0,y.index),[k,T]=u._mapStrIdx(g,S,E,C.length);if(S===-1||E===-1||k===-1||T===-1)continue;const A={start:{x:E+1,y:S+1},end:{x:T,y:k+1}};_.push({range:A,text:C,activate:b})}return _}static _getWindowedLineStrings(d,f){let g,b=d,x=d,v=0,m="";const p=[];if(g=f.buffer.active.getLine(d)){const y=g.translateToString(!0);if(g.isWrapped&&y[0]!==" "){for(v=0;(g=f.buffer.active.getLine(--b))&&v<2048&&(m=g.translateToString(!0),v+=m.length,p.push(m),g.isWrapped&&m.indexOf(" ")===-1););p.reverse()}for(p.push(y),v=0;(g=f.buffer.active.getLine(++x))&&g.isWrapped&&v<2048&&(m=g.translateToString(!0),v+=m.length,p.push(m),m.indexOf(" ")===-1););}return[p,b]}static _mapStrIdx(d,f,g,b){const x=d.buffer.active,v=x.getNullCell();let m=g;for(;b;){const p=x.getLine(f);if(!p)return[-1,-1];for(let y=m;y<p.length;++y){p.getCell(y,v);const _=v.getChars();if(v.getWidth()&&(b-=_.length||1,y===p.length-1&&_==="")){const C=x.getLine(f+1);C&&C.isWrapped&&(C.getCell(0,v),v.getWidth()===2&&(b+=1))}if(b<0)return[f,y]}f++,m=0}return[f,m]}}o.LinkComputer=u}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=i(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(h,d){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(h=u,d={}){this._handler=h,this._options=d}activate(h){this._terminal=h;const d=this._options,f=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,f,this._handler,d))}dispose(){var h;(h=this._linkProvider)==null||h.dispose()}}})(),s})())})(eP);var tP=eP.exports;const Hd={SMALL:2500,MEDIUM:5e3,LARGE:1e4},lC={COMPACT:{fontSize:12,lineHeight:1,letterSpacing:.5},COMFORTABLE:{fontSize:14,lineHeight:1.1,letterSpacing:.8},SPACIOUS:{fontSize:16,lineHeight:1.1,letterSpacing:.8}},Vse={DEFAULT:"default",FORCE12H:"force12h",FORCE24H:"force24h",DISABLED:"disabled"},bh={density:"COMFORTABLE",scrollback:Hd.MEDIUM,timestamp:"DEFAULT",copyTimestamp:!1,copyChannel:!0},nP={convertEol:!0,cursorBlink:!0,cursorStyle:"bar",disableStdin:!0,drawBoldTextInBrightColors:!1,fontFamily:"JetBrains Mono Variable, monospace",fontWeight:"300",fontWeightBold:"600",allowProposedApi:!0,allowTransparency:!0,overviewRulerWidth:15,...bh,...lC[bh.density]},qse=e=>{const t=bh;if(!e||typeof e!="object")return t;const n=e,r={density:t.density,scrollback:t.scrollback,timestamp:t.timestamp,copyTimestamp:t.copyTimestamp,copyChannel:t.copyChannel};return typeof n.density=="string"&&Object.keys(lC).includes(n.density)&&(r.density=n.density),typeof n.scrollback=="number"&&Object.values(Hd).includes(n.scrollback)&&(r.scrollback=n.scrollback),typeof n.timestamp=="string"&&Object.keys(Vse).includes(n.timestamp)&&(r.timestamp=n.timestamp),typeof n.copyTimestamp=="boolean"&&(r.copyTimestamp=n.copyTimestamp),typeof n.copyChannel=="boolean"&&(r.copyChannel=n.copyChannel),r},Gse=vS(_r.LiveConsoleOptions,bh,uS(qse,bh)),Kse=vS(_r.LiveConsoleHistory,[],uS(yD,[])),Yse=vS(_r.LiveConsoleBookmarks,[],uS(yD,[])),Xse=50,Jse=()=>{const[e,t]=sr(Gse);return{options:e,updateOptions:n=>{t(r=>({...r,...n}))}}},rP=()=>{const[e,t]=sr(Kse);return{history:e,setHistory:t,appendHistory:n=>{const r=e.filter(i=>i!==n);r.unshift(n)>Xse&&r.pop(),t(r)},wipeHistory:()=>{t([])}}},Qse=()=>{const[e,t]=sr(Yse);return{bookmarks:e,addBookmark:n=>{e.includes(n)||t([n,...e])},removeBookmark:n=>{t(e.filter(r=>r!==n))}}};function _p({icon:e,title:t,disabled:n,onClick:r}){return c.jsxs("div",{tabIndex:0,className:Y("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 transition-all ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n&&"opacity-50 pointer-events-none"),onClick:()=>!n&&r(),onKeyDown:i=>(i.code==="Enter"||i.code==="Space")&&!n&&r(),children:[c.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"}),c.jsx("span",{className:"hidden 2xl:inline ml-1 align-middle",children:t})]})}function Zse(e){const{history:t,appendHistory:n}=rP(),[r,i]=w.useState(-1),s=w.useRef(""),a=e.termInputRef,{hasPerm:o}=Xn(),l=o("console.write"),u=nt(AD);w.useEffect(()=>{e.isConnected&&a.current&&a.current.focus()},[e.isConnected,a]);const h=()=>{if(!a.current)return;r===-1&&(s.current=a.current.value??"");const x=r+1;t[x]&&(a.current.value=t[x],i(x))},d=()=>{if(!a.current)return;const x=r-1;x===-1?(a.current.value=s.current,i(x)):t[x]&&(a.current.value=t[x],i(x))},f=()=>{if(!a.current)return;const x=a.current.value.trim();i(-1),a.current.value="",s.current="",x?(n(x),e.consoleWrite(x)):e.consoleWrite(`
`)},g=x=>{e.isConnected&&(x.key==="ArrowUp"?(h(),x.preventDefault()):x.key==="ArrowDown"?(d(),x.preventDefault()):x.key==="Enter"&&(f(),x.preventDefault()))};let b;return l?u.isChildAlive?e.isConnected||(b="Socket connection lost."):b="The server is not running.":b="You do not have permission to write to the console.",c.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:[c.jsxs("div",{className:"flex items-center grow",children:[c.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:c.jsx("path",{d:"m9 18 6-6-6-6"})}),c.jsx(yt,{ref:a,className:Y("w-full",!!b&&"placeholder:text-destructive placeholder:opacity-100"),placeholder:b??"Type a command...",type:"text",disabled:!!b,onKeyDown:g,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})]}),c.jsxs("div",{className:"flex flex-row justify-evenly gap-3 2xl:gap-1 select-none",children:[c.jsx(_p,{icon:ZY,title:"Saved",onClick:e.toggleSaveSheet}),c.jsx(_p,{icon:qX,title:"Search",disabled:!e.isConnected,onClick:e.toggleSearchBar}),c.jsx(_p,{icon:iL,title:"Clear",disabled:!e.isConnected,onClick:e.consoleClear}),c.jsx(_p,{icon:_X,title:"Download",disabled:!e.isConnected,onClick:()=>{nu("/fxserver/downloadLog")}})]})]})}var cC=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),s=i.find(toe);if(s){const a=s.props.children,o=i.map(l=>l===s?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return c.jsx(M_,{...r,ref:t,children:w.isValidElement(a)?w.cloneElement(a,void 0,o):null})}return c.jsx(M_,{...r,ref:t,children:n})});cC.displayName="Slot";var M_=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const i=roe(n),s=noe(r,n.props);return n.type!==w.Fragment&&(s.ref=t?Qc(t,i):i),w.cloneElement(n,s)}return w.Children.count(n)>1?w.Children.only(null):null});M_.displayName="SlotClone";var eoe=({children:e})=>c.jsx(c.Fragment,{children:e});function toe(e){return w.isValidElement(e)&&e.type===eoe}function noe(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{s(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function roe(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ioe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ws=ioe.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?cC:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(o,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function soe(e,t){e&&mr.flushSync(()=>e.dispatchEvent(t))}function iP(e,t=globalThis==null?void 0:globalThis.document){const n=xt(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ooe="DismissableLayer",j_="dismissableLayer.update",aoe="dismissableLayer.pointerDownOutside",loe="dismissableLayer.focusOutside",tT,sP=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oP=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=e,u=w.useContext(sP),[h,d]=w.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=w.useState({}),b=Le(t,E=>d(E)),x=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=x.indexOf(v),p=h?x.indexOf(h):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,_=p>=m,C=doe(E=>{const k=E.target,T=[...u.branches].some(A=>A.contains(k));!_||T||(i==null||i(E),a==null||a(E),E.defaultPrevented||o==null||o())},f),S=hoe(E=>{const k=E.target;[...u.branches].some(A=>A.contains(k))||(s==null||s(E),a==null||a(E),E.defaultPrevented||o==null||o())},f);return iP(E=>{p===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&o&&(E.preventDefault(),o()))},f),w.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(tT=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),nT(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=tT)}},[h,f,n,u]),w.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),nT())},[h,u]),w.useEffect(()=>{const E=()=>g({});return document.addEventListener(j_,E),()=>document.removeEventListener(j_,E)},[]),c.jsx(Ws.div,{...l,ref:b,style:{pointerEvents:y?_?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,C.onPointerDownCapture)})});oP.displayName=ooe;var coe="DismissableLayerBranch",uoe=w.forwardRef((e,t)=>{const n=w.useContext(sP),r=w.useRef(null),i=Le(t,r);return w.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(Ws.div,{...e,ref:i})});uoe.displayName=coe;function doe(e,t=globalThis==null?void 0:globalThis.document){const n=xt(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){aP(aoe,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function hoe(e,t=globalThis==null?void 0:globalThis.document){const n=xt(e),r=w.useRef(!1);return w.useEffect(()=>{const i=s=>{s.target&&!r.current&&aP(loe,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function nT(){const e=new CustomEvent(j_);document.dispatchEvent(e)}function aP(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?soe(i,s):i.dispatchEvent(s)}var ry=0;function u0(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??rT()),document.body.insertAdjacentElement("beforeend",e[1]??rT()),ry++,()=>{ry===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ry--}},[])}function rT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var iy="focusScope.autoFocusOnMount",sy="focusScope.autoFocusOnUnmount",iT={bubbles:!1,cancelable:!0},foe="FocusScope",lP=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,l]=w.useState(null),u=xt(i),h=xt(s),d=w.useRef(null),f=Le(t,x=>l(x)),g=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let x=function(y){if(g.paused||!o)return;const _=y.target;o.contains(_)?d.current=_:no(d.current,{select:!0})},v=function(y){if(g.paused||!o)return;const _=y.relatedTarget;_!==null&&(o.contains(_)||no(d.current,{select:!0}))},m=function(y){if(document.activeElement===document.body)for(const C of y)C.removedNodes.length>0&&no(o)};document.addEventListener("focusin",x),document.addEventListener("focusout",v);const p=new MutationObserver(m);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",v),p.disconnect()}}},[r,o,g.paused]),w.useEffect(()=>{if(o){oT.add(g);const x=document.activeElement;if(!o.contains(x)){const m=new CustomEvent(iy,iT);o.addEventListener(iy,u),o.dispatchEvent(m),m.defaultPrevented||(poe(yoe(cP(o)),{select:!0}),document.activeElement===x&&no(o))}return()=>{o.removeEventListener(iy,u),setTimeout(()=>{const m=new CustomEvent(sy,iT);o.addEventListener(sy,h),o.dispatchEvent(m),m.defaultPrevented||no(x??document.body,{select:!0}),o.removeEventListener(sy,h),oT.remove(g)},0)}}},[o,u,h,g]);const b=w.useCallback(x=>{if(!n&&!r||g.paused)return;const v=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,m=document.activeElement;if(v&&m){const p=x.currentTarget,[y,_]=moe(p);y&&_?!x.shiftKey&&m===_?(x.preventDefault(),n&&no(y,{select:!0})):x.shiftKey&&m===y&&(x.preventDefault(),n&&no(_,{select:!0})):m===p&&x.preventDefault()}},[n,r,g.paused]);return c.jsx(Ws.div,{tabIndex:-1,...a,ref:f,onKeyDown:b})});lP.displayName=foe;function poe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(no(r,{select:t}),document.activeElement!==n)return}function moe(e){const t=cP(e),n=sT(t,e),r=sT(t.reverse(),e);return[n,r]}function cP(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 sT(e,t){for(const n of e)if(!goe(n,{upTo:t}))return n}function goe(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 voe(e){return e instanceof HTMLInputElement&&"select"in e}function no(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&voe(e)&&t&&e.select()}}var oT=xoe();function xoe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=aT(e,t),e.unshift(t)},remove(t){var n;e=aT(e,t),(n=e[0])==null||n.resume()}}}function aT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yoe(e){return e.filter(t=>t.tagName!=="A")}var boe=xj.useId||(()=>{}),_oe=0;function yr(e){const[t,n]=w.useState(boe());return Xt(()=>{n(r=>r??String(_oe++))},[e]),t?`radix-${t}`:""}const woe=["top","right","bottom","left"],$o=Math.min,Ar=Math.max,Eg=Math.round,wp=Math.floor,Xi=e=>({x:e,y:e}),Soe={left:"right",right:"left",bottom:"top",top:"bottom"},Coe={start:"end",end:"start"};function N_(e,t,n){return Ar(e,$o(t,n))}function Ls(e,t){return typeof e=="function"?e(t):e}function Ps(e){return e.split("-")[0]}function iu(e){return e.split("-")[1]}function uC(e){return e==="x"?"y":"x"}function dC(e){return e==="y"?"height":"width"}function Bo(e){return["top","bottom"].includes(Ps(e))?"y":"x"}function hC(e){return uC(Bo(e))}function koe(e,t,n){n===void 0&&(n=!1);const r=iu(e),i=hC(e),s=dC(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Tg(a)),[a,Tg(a)]}function Eoe(e){const t=Tg(e);return[D_(e),t,D_(t)]}function D_(e){return e.replace(/start|end/g,t=>Coe[t])}function Toe(e,t,n){const r=["left","right"],i=["right","left"],s=["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?s:a;default:return[]}}function Aoe(e,t,n,r){const i=iu(e);let s=Toe(Ps(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(D_)))),s}function Tg(e){return e.replace(/left|right|bottom|top/g,t=>Soe[t])}function Roe(e){return{top:0,right:0,bottom:0,left:0,...e}}function uP(e){return typeof e!="number"?Roe(e):{top:e,right:e,bottom:e,left:e}}function Ag(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function lT(e,t,n){let{reference:r,floating:i}=e;const s=Bo(t),a=hC(t),o=dC(a),l=Ps(t),u=s==="y",h=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let g;switch(l){case"top":g={x:h,y:r.y-i.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-i.width,y:d};break;default:g={x:r.x,y:r.y}}switch(iu(t)){case"start":g[a]-=f*(n&&u?-1:1);break;case"end":g[a]+=f*(n&&u?-1:1);break}return g}const Moe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:d}=lT(u,r,l),f=r,g={},b=0;for(let x=0;x<o.length;x++){const{name:v,fn:m}=o[x],{x:p,y,data:_,reset:C}=await m({x:h,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:g,rects:u,platform:a,elements:{reference:e,floating:t}});h=p??h,d=y??d,g={...g,[v]:{...g[v],..._}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:h,y:d}=lT(u,f,l)),x=-1)}return{x:h,y:d,placement:f,strategy:i,middlewareData:g}};async function _h(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:g=0}=Ls(t,e),b=uP(g),v=o[f?d==="floating"?"reference":"floating":d],m=Ag(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:h,strategy:l})),p=d==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),_=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},C=Ag(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:p,offsetParent:y,strategy:l}):p);return{top:(m.top-C.top+b.top)/_.y,bottom:(C.bottom-m.bottom+b.bottom)/_.y,left:(m.left-C.left+b.left)/_.x,right:(C.right-m.right+b.right)/_.x}}const joe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:l}=t,{element:u,padding:h=0}=Ls(e,t)||{};if(u==null)return{};const d=uP(h),f={x:n,y:r},g=hC(i),b=dC(g),x=await a.getDimensions(u),v=g==="y",m=v?"top":"left",p=v?"bottom":"right",y=v?"clientHeight":"clientWidth",_=s.reference[b]+s.reference[g]-f[g]-s.floating[b],C=f[g]-s.reference[g],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let E=S?S[y]:0;(!E||!await(a.isElement==null?void 0:a.isElement(S)))&&(E=o.floating[y]||s.floating[b]);const k=_/2-C/2,T=E/2-x[b]/2-1,A=$o(d[m],T),M=$o(d[p],T),D=A,L=E-x[b]-M,N=E/2-x[b]/2+k,O=N_(D,N,L),B=!l.arrow&&iu(i)!=null&&N!==O&&s.reference[b]/2-(N<D?A:M)-x[b]/2<0,z=B?N<D?N-D:N-L:0;return{[g]:f[g]+z,data:{[g]:O,centerOffset:N-O-z,...B&&{alignmentOffset:z}},reset:B}}}),Noe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...v}=Ls(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const m=Ps(i),p=Bo(o),y=Ps(o)===o,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=f||(y||!x?[Tg(o)]:Eoe(o)),S=b!=="none";!f&&S&&C.push(...Aoe(o,x,b,_));const E=[o,...C],k=await _h(t,v),T=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&T.push(k[m]),d){const N=koe(i,a,_);T.push(k[N[0]],k[N[1]])}if(A=[...A,{placement:i,overflows:T}],!T.every(N=>N<=0)){var M,D;const N=(((M=s.flip)==null?void 0:M.index)||0)+1,O=E[N];if(O)return{data:{index:N,overflows:A},reset:{placement:O}};let B=(D=A.filter(z=>z.overflows[0]<=0).sort((z,P)=>z.overflows[1]-P.overflows[1])[0])==null?void 0:D.placement;if(!B)switch(g){case"bestFit":{var L;const z=(L=A.filter(P=>{if(S){const j=Bo(P.placement);return j===p||j==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(j=>j>0).reduce((j,R)=>j+R,0)]).sort((P,j)=>P[1]-j[1])[0])==null?void 0:L[0];z&&(B=z);break}case"initialPlacement":B=o;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function cT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uT(e){return woe.some(t=>e[t]>=0)}const Doe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ls(e,t);switch(r){case"referenceHidden":{const s=await _h(t,{...i,elementContext:"reference"}),a=cT(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:uT(a)}}}case"escaped":{const s=await _h(t,{...i,altBoundary:!0}),a=cT(s,n.floating);return{data:{escapedOffsets:a,escaped:uT(a)}}}default:return{}}}}};async function Loe(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Ps(n),o=iu(n),l=Bo(n)==="y",u=["left","top"].includes(a)?-1:1,h=s&&l?-1:1,d=Ls(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof b=="number"&&(g=o==="end"?b*-1:b),l?{x:g*h,y:f*u}:{x:f*u,y:g*h}}const Poe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:a,middlewareData:o}=t,l=await Loe(t,e);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:a}}}}},Ooe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:v=>{let{x:m,y:p}=v;return{x:m,y:p}}},...l}=Ls(e,t),u={x:n,y:r},h=await _h(t,l),d=Bo(Ps(i)),f=uC(d);let g=u[f],b=u[d];if(s){const v=f==="y"?"top":"left",m=f==="y"?"bottom":"right",p=g+h[v],y=g-h[m];g=N_(p,g,y)}if(a){const v=d==="y"?"top":"left",m=d==="y"?"bottom":"right",p=b+h[v],y=b-h[m];b=N_(p,b,y)}const x=o.fn({...t,[f]:g,[d]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[f]:s,[d]:a}}}}}},Ioe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=t,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=Ls(e,t),h={x:n,y:r},d=Bo(i),f=uC(d);let g=h[f],b=h[d];const x=Ls(o,t),v=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const y=f==="y"?"height":"width",_=s.reference[f]-s.floating[y]+v.mainAxis,C=s.reference[f]+s.reference[y]-v.mainAxis;g<_?g=_:g>C&&(g=C)}if(u){var m,p;const y=f==="y"?"width":"height",_=["top","left"].includes(Ps(i)),C=s.reference[d]-s.floating[y]+(_&&((m=a.offset)==null?void 0:m[d])||0)+(_?0:v.crossAxis),S=s.reference[d]+s.reference[y]+(_?0:((p=a.offset)==null?void 0:p[d])||0)-(_?v.crossAxis:0);b<C?b=C:b>S&&(b=S)}return{[f]:g,[d]:b}}}},$oe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:a,elements:o}=t,{apply:l=()=>{},...u}=Ls(e,t),h=await _h(t,u),d=Ps(i),f=iu(i),g=Bo(i)==="y",{width:b,height:x}=s.floating;let v,m;d==="top"||d==="bottom"?(v=d,m=f===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(m=d,v=f==="end"?"top":"bottom");const p=x-h.top-h.bottom,y=b-h.left-h.right,_=$o(x-h[v],p),C=$o(b-h[m],y),S=!t.middlewareData.shift;let E=_,k=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=p),S&&!f){const A=Ar(h.left,0),M=Ar(h.right,0),D=Ar(h.top,0),L=Ar(h.bottom,0);g?k=b-2*(A!==0||M!==0?A+M:Ar(h.left,h.right)):E=x-2*(D!==0||L!==0?D+L:Ar(h.top,h.bottom))}await l({...t,availableWidth:k,availableHeight:E});const T=await a.getDimensions(o.floating);return b!==T.width||x!==T.height?{reset:{rects:!0}}:{}}}};function d0(){return typeof window<"u"}function su(e){return dP(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function os(e){var t;return(t=(dP(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dP(e){return d0()?e instanceof Node||e instanceof Dr(e).Node:!1}function Ai(e){return d0()?e instanceof Element||e instanceof Dr(e).Element:!1}function Zi(e){return d0()?e instanceof HTMLElement||e instanceof Dr(e).HTMLElement:!1}function dT(e){return!d0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}function mf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ri(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Boe(e){return["table","td","th"].includes(su(e))}function h0(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function fC(e){const t=pC(),n=Ai(e)?Ri(e):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 Foe(e){let t=Fo(e);for(;Zi(t)&&!jc(t);){if(fC(t))return t;if(h0(t))return null;t=Fo(t)}return null}function pC(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jc(e){return["html","body","#document"].includes(su(e))}function Ri(e){return Dr(e).getComputedStyle(e)}function f0(e){return Ai(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fo(e){if(su(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dT(e)&&e.host||os(e);return dT(t)?t.host:t}function hP(e){const t=Fo(e);return jc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zi(t)&&mf(t)?t:hP(t)}function wh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=hP(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=Dr(i);if(s){const o=L_(a);return t.concat(a,a.visualViewport||[],mf(i)?i:[],o&&n?wh(o):[])}return t.concat(i,wh(i,[],n))}function L_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fP(e){const t=Ri(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Zi(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,o=Eg(n)!==s||Eg(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function mC(e){return Ai(e)?e:e.contextElement}function ac(e){const t=mC(e);if(!Zi(t))return Xi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=fP(t);let a=(s?Eg(n.width):n.width)/r,o=(s?Eg(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const zoe=Xi(0);function pP(e){const t=Dr(e);return!pC()||!t.visualViewport?zoe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hoe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function Oa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=mC(e);let a=Xi(1);t&&(r?Ai(r)&&(a=ac(r)):a=ac(e));const o=Hoe(s,n,r)?pP(s):Xi(0);let l=(i.left+o.x)/a.x,u=(i.top+o.y)/a.y,h=i.width/a.x,d=i.height/a.y;if(s){const f=Dr(s),g=r&&Ai(r)?Dr(r):r;let b=f,x=L_(b);for(;x&&r&&g!==b;){const v=ac(x),m=x.getBoundingClientRect(),p=Ri(x),y=m.left+(x.clientLeft+parseFloat(p.paddingLeft))*v.x,_=m.top+(x.clientTop+parseFloat(p.paddingTop))*v.y;l*=v.x,u*=v.y,h*=v.x,d*=v.y,l+=y,u+=_,b=Dr(x),x=L_(b)}}return Ag({width:h,height:d,x:l,y:u})}function gC(e,t){const n=f0(e).scrollLeft;return t?t.left+n:Oa(os(e)).left+n}function mP(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:gC(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function Woe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=os(r),o=t?h0(t.floating):!1;if(r===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Xi(1);const h=Xi(0),d=Zi(r);if((d||!d&&!s)&&((su(r)!=="body"||mf(a))&&(l=f0(r)),Zi(r))){const g=Oa(r);u=ac(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const f=a&&!d&&!s?mP(a,l,!0):Xi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+h.x+f.x,y:n.y*u.y-l.scrollTop*u.y+h.y+f.y}}function Uoe(e){return Array.from(e.getClientRects())}function Voe(e){const t=os(e),n=f0(e),r=e.ownerDocument.body,i=Ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+gC(e);const o=-n.scrollTop;return Ri(r).direction==="rtl"&&(a+=Ar(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function qoe(e,t){const n=Dr(e),r=os(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;const u=pC();(!u||u&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}function Goe(e,t){const n=Oa(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Zi(e)?ac(e):Xi(1),a=e.clientWidth*s.x,o=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:a,height:o,x:l,y:u}}function hT(e,t,n){let r;if(t==="viewport")r=qoe(e,n);else if(t==="document")r=Voe(os(e));else if(Ai(t))r=Goe(t,n);else{const i=pP(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ag(r)}function gP(e,t){const n=Fo(e);return n===t||!Ai(n)||jc(n)?!1:Ri(n).position==="fixed"||gP(n,t)}function Koe(e,t){const n=t.get(e);if(n)return n;let r=wh(e,[],!1).filter(o=>Ai(o)&&su(o)!=="body"),i=null;const s=Ri(e).position==="fixed";let a=s?Fo(e):e;for(;Ai(a)&&!jc(a);){const o=Ri(a),l=fC(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||mf(a)&&!l&&gP(e,a))?r=r.filter(h=>h!==a):i=o,a=Fo(a)}return t.set(e,r),r}function Yoe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?h0(t)?[]:Koe(t,this._c):[].concat(n),r],o=a[0],l=a.reduce((u,h)=>{const d=hT(t,h,i);return u.top=Ar(d.top,u.top),u.right=$o(d.right,u.right),u.bottom=$o(d.bottom,u.bottom),u.left=Ar(d.left,u.left),u},hT(t,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Xoe(e){const{width:t,height:n}=fP(e);return{width:t,height:n}}function Joe(e,t,n){const r=Zi(t),i=os(t),s=n==="fixed",a=Oa(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=Xi(0);if(r||!r&&!s)if((su(t)!=="body"||mf(i))&&(o=f0(t)),r){const f=Oa(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=gC(i));const u=i&&!r&&!s?mP(i,o):Xi(0),h=a.left+o.scrollLeft-l.x-u.x,d=a.top+o.scrollTop-l.y-u.y;return{x:h,y:d,width:a.width,height:a.height}}function oy(e){return Ri(e).position==="static"}function fT(e,t){if(!Zi(e)||Ri(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return os(e)===n&&(n=n.ownerDocument.body),n}function vP(e,t){const n=Dr(e);if(h0(e))return n;if(!Zi(e)){let i=Fo(e);for(;i&&!jc(i);){if(Ai(i)&&!oy(i))return i;i=Fo(i)}return n}let r=fT(e,t);for(;r&&Boe(r)&&oy(r);)r=fT(r,t);return r&&jc(r)&&oy(r)&&!fC(r)?n:r||Foe(e)||n}const Qoe=async function(e){const t=this.getOffsetParent||vP,n=this.getDimensions,r=await n(e.floating);return{reference:Joe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zoe(e){return Ri(e).direction==="rtl"}const eae={convertOffsetParentRelativeRectToViewportRelativeRect:Woe,getDocumentElement:os,getClippingRect:Yoe,getOffsetParent:vP,getElementRects:Qoe,getClientRects:Uoe,getDimensions:Xoe,getScale:ac,isElement:Ai,isRTL:Zoe};function tae(e,t){let n=null,r;const i=os(e);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const{left:u,top:h,width:d,height:f}=e.getBoundingClientRect();if(o||t(),!d||!f)return;const g=wp(h),b=wp(i.clientWidth-(u+d)),x=wp(i.clientHeight-(h+f)),v=wp(u),p={rootMargin:-g+"px "+-b+"px "+-x+"px "+-v+"px",threshold:Ar(0,$o(1,l))||1};let y=!0;function _(C){const S=C[0].intersectionRatio;if(S!==l){if(!y)return a();S?a(!1,S):r=setTimeout(()=>{a(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(_,{...p,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,p)}n.observe(e)}return a(!0),s}function xP(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=mC(e),h=i||s?[...u?wh(u):[],...wh(t)]:[];h.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),s&&m.addEventListener("resize",n)});const d=u&&o?tae(u,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(m=>{let[p]=m;p&&p.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let b,x=l?Oa(e):null;l&&v();function v(){const m=Oa(e);x&&(m.x!==x.x||m.y!==x.y||m.width!==x.width||m.height!==x.height)&&n(),x=m,b=requestAnimationFrame(v)}return n(),()=>{var m;h.forEach(p=>{i&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),d==null||d(),(m=g)==null||m.disconnect(),g=null,l&&cancelAnimationFrame(b)}}const nae=Poe,rae=Ooe,iae=Noe,sae=$oe,oae=Doe,pT=joe,aae=Ioe,lae=(e,t,n)=>{const r=new Map,i={platform:eae,...n},s={...i.platform,_c:r};return Moe(e,t,{...i,platform:s})};var xm=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Rg(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(!Rg(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 s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!Rg(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function yP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mT(e,t){const n=yP(e);return Math.round(t*n)/n}function ay(e){const t=w.useRef(e);return xm(()=>{t.current=e}),t}function bP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:l,open:u}=e,[h,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=w.useState(r);Rg(f,r)||g(r);const[b,x]=w.useState(null),[v,m]=w.useState(null),p=w.useCallback(P=>{P!==S.current&&(S.current=P,x(P))},[]),y=w.useCallback(P=>{P!==E.current&&(E.current=P,m(P))},[]),_=s||b,C=a||v,S=w.useRef(null),E=w.useRef(null),k=w.useRef(h),T=l!=null,A=ay(l),M=ay(i),D=ay(u),L=w.useCallback(()=>{if(!S.current||!E.current)return;const P={placement:t,strategy:n,middleware:f};M.current&&(P.platform=M.current),lae(S.current,E.current,P).then(j=>{const R={...j,isPositioned:D.current!==!1};N.current&&!Rg(k.current,R)&&(k.current=R,mr.flushSync(()=>{d(R)}))})},[f,t,n,M,D]);xm(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[u]);const N=w.useRef(!1);xm(()=>(N.current=!0,()=>{N.current=!1}),[]),xm(()=>{if(_&&(S.current=_),C&&(E.current=C),_&&C){if(A.current)return A.current(_,C,L);L()}},[_,C,L,A,T]);const O=w.useMemo(()=>({reference:S,floating:E,setReference:p,setFloating:y}),[p,y]),B=w.useMemo(()=>({reference:_,floating:C}),[_,C]),z=w.useMemo(()=>{const P={position:n,left:0,top:0};if(!B.floating)return P;const j=mT(B.floating,h.x),R=mT(B.floating,h.y);return o?{...P,transform:"translate("+j+"px, "+R+"px)",...yP(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:R}},[n,o,B.floating,h.x,h.y]);return w.useMemo(()=>({...h,update:L,refs:O,elements:B,floatingStyles:z}),[h,L,O,B,z])}const cae=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?pT({element:r.current,padding:i}).fn(n):{}:r?pT({element:r,padding:i}).fn(n):{}}}},_P=(e,t)=>({...nae(e),options:[e,t]}),wP=(e,t)=>({...rae(e),options:[e,t]}),SP=(e,t)=>({...aae(e),options:[e,t]}),CP=(e,t)=>({...iae(e),options:[e,t]}),kP=(e,t)=>({...sae(e),options:[e,t]}),EP=(e,t)=>({...oae(e),options:[e,t]}),TP=(e,t)=>({...cae(e),options:[e,t]});var uae="Arrow",AP=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return c.jsx(Ws.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});AP.displayName=uae;var dae=AP;function gf(e){const[t,n]=w.useState(void 0);return Xt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,o=u.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var vC="Popper",[RP,MP]=Cn(vC),[hae,jP]=RP(vC),NP=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return c.jsx(hae,{scope:t,anchor:r,onAnchorChange:i,children:n})};NP.displayName=vC;var DP="PopperAnchor",LP=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=jP(DP,n),a=w.useRef(null),o=Le(t,a);return w.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:c.jsx(Ws.div,{...i,ref:o})});LP.displayName=DP;var xC="PopperContent",[fae,pae]=RP(xC),PP=w.forwardRef((e,t)=>{var W,$,V,U,X,q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:b,...x}=e,v=jP(xC,n),[m,p]=w.useState(null),y=Le(t,ne=>p(ne)),[_,C]=w.useState(null),S=gf(_),E=(S==null?void 0:S.width)??0,k=(S==null?void 0:S.height)??0,T=r+(s!=="center"?"-"+s:""),A=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(u)?u:[u],D=M.length>0,L={padding:A,boundary:M.filter(gae),altBoundary:D},{refs:N,floatingStyles:O,placement:B,isPositioned:z,middlewareData:P}=bP({strategy:"fixed",placement:T,whileElementsMounted:(...ne)=>xP(...ne,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[_P({mainAxis:i+k,alignmentAxis:a}),l&&wP({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?SP():void 0,...L}),l&&CP({...L}),kP({...L,apply:({elements:ne,rects:te,availableWidth:le,availableHeight:xe})=>{const{width:ie,height:Te}=te.reference,Ae=ne.floating.style;Ae.setProperty("--radix-popper-available-width",`${le}px`),Ae.setProperty("--radix-popper-available-height",`${xe}px`),Ae.setProperty("--radix-popper-anchor-width",`${ie}px`),Ae.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),_&&TP({element:_,padding:o}),vae({arrowWidth:E,arrowHeight:k}),f&&EP({strategy:"referenceHidden",...L})]}),[j,R]=$P(B),I=xt(b);Xt(()=>{z&&(I==null||I())},[z,I]);const H=(W=P.arrow)==null?void 0:W.x,F=($=P.arrow)==null?void 0:$.y,G=((V=P.arrow)==null?void 0:V.centerOffset)!==0,[Z,J]=w.useState();return Xt(()=>{m&&J(window.getComputedStyle(m).zIndex)},[m]),c.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:z?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(U=P.transformOrigin)==null?void 0:U.x,(X=P.transformOrigin)==null?void 0:X.y].join(" "),...((q=P.hide)==null?void 0:q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(fae,{scope:n,placedSide:j,onArrowChange:C,arrowX:H,arrowY:F,shouldHideArrow:G,children:c.jsx(Ws.div,{"data-side":j,"data-align":R,...x,ref:y,style:{...x.style,animation:z?void 0:"none"}})})})});PP.displayName=xC;var OP="PopperArrow",mae={top:"bottom",right:"left",bottom:"top",left:"right"},IP=w.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=pae(OP,r),a=mae[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(dae,{...i,ref:n,style:{...i.style,display:"block"}})})});IP.displayName=OP;function gae(e){return e!==null}var vae=e=>({name:"transformOrigin",options:e,fn(t){var v,m,p;const{placement:n,rects:r,middlewareData:i}=t,a=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,h]=$P(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((m=i.arrow)==null?void 0:m.x)??0)+o/2,g=(((p=i.arrow)==null?void 0:p.y)??0)+l/2;let b="",x="";return u==="bottom"?(b=a?d:`${f}px`,x=`${-l}px`):u==="top"?(b=a?d:`${f}px`,x=`${r.floating.height+l}px`):u==="right"?(b=`${-l}px`,x=a?d:`${g}px`):u==="left"&&(b=`${r.floating.width+l}px`,x=a?d:`${g}px`),{data:{x:b,y:x}}}});function $P(e){const[t,n="center"]=e.split("-");return[t,n]}var xae=NP,BP=LP,yae=PP,bae=IP,_ae="Portal",FP=w.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,s]=w.useState(!1);Xt(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?G2.createPortal(c.jsx(Ws.div,{...r,ref:t}),a):null});FP.displayName=_ae;function Pr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=wae({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:r,o=xt(n),l=w.useCallback(u=>{if(s){const d=typeof u=="function"?u(e):u;d!==e&&o(d)}else i(u)},[s,e,i,o]);return[a,l]}function wae({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),s=xt(t);return w.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var Sae=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Cl=new WeakMap,Sp=new WeakMap,Cp={},ly=0,zP=function(e){return e&&(e.host||zP(e.parentNode))},Cae=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=zP(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})},kae=function(e,t,n,r){var i=Cae(t,Array.isArray(e)?e:[e]);Cp[n]||(Cp[n]=new WeakMap);var s=Cp[n],a=[],o=new Set,l=new Set(i),u=function(d){!d||o.has(d)||(o.add(d),u(d.parentNode))};i.forEach(u);var h=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(o.has(f))h(f);else try{var g=f.getAttribute(r),b=g!==null&&g!=="false",x=(Cl.get(f)||0)+1,v=(s.get(f)||0)+1;Cl.set(f,x),s.set(f,v),a.push(f),x===1&&b&&Sp.set(f,!0),v===1&&f.setAttribute(n,"true"),b||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return h(t),o.clear(),ly++,function(){a.forEach(function(d){var f=Cl.get(d)-1,g=s.get(d)-1;Cl.set(d,f),s.set(d,g),f||(Sp.has(d)||d.removeAttribute(r),Sp.delete(d)),g||d.removeAttribute(n)}),ly--,ly||(Cl=new WeakMap,Cl=new WeakMap,Sp=new WeakMap,Cp={})}},p0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Sae(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),kae(r,i,n,"aria-hidden")):function(){return null}},Wi=function(){return Wi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Wi.apply(this,arguments)};function HP(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 Eae(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var ym="right-scroll-bar-position",bm="width-before-scroll-bar",Tae="with-scroll-bars-hidden",Aae="--removed-body-scroll-bar-size";function cy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Rae(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Mae=typeof window<"u"?w.useLayoutEffect:w.useEffect,gT=new WeakMap;function jae(e,t){var n=Rae(null,function(r){return e.forEach(function(i){return cy(i,r)})});return Mae(function(){var r=gT.get(n);if(r){var i=new Set(r),s=new Set(e),a=n.current;i.forEach(function(o){s.has(o)||cy(o,null)}),s.forEach(function(o){i.has(o)||cy(o,a)})}gT.set(n,e)},[e]),n}function Nae(e){return e}function Dae(e,t){t===void 0&&(t=Nae);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(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(o){return s(o)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(s),a=n}var l=function(){var h=a;a=[],h.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(h){a.push(h),u()},filter:function(h){return a=a.filter(h),n}}}};return i}function Lae(e){e===void 0&&(e={});var t=Dae(null);return t.options=Wi({async:!0,ssr:!1},e),t}var WP=function(e){var t=e.sideCar,n=HP(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 w.createElement(r,Wi({},n))};WP.isSideCarExport=!0;function Pae(e,t){return e.useMedium(t),WP}var UP=Lae(),uy=function(){},m0=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:uy,onWheelCapture:uy,onTouchMoveCapture:uy}),i=r[0],s=r[1],a=e.forwardProps,o=e.children,l=e.className,u=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,g=e.noIsolation,b=e.inert,x=e.allowPinchZoom,v=e.as,m=v===void 0?"div":v,p=e.gapMode,y=HP(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=f,C=jae([n,t]),S=Wi(Wi({},y),i);return w.createElement(w.Fragment,null,h&&w.createElement(_,{sideCar:UP,removeScrollBar:u,shards:d,noIsolation:g,inert:b,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:p}),a?w.cloneElement(w.Children.only(o),Wi(Wi({},S),{ref:C})):w.createElement(m,Wi({},S,{className:l,ref:C}),o))});m0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};m0.classNames={fullWidth:bm,zeroRight:ym};var Oae=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Iae(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Oae();return t&&e.setAttribute("nonce",t),e}function $ae(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Bae(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Fae=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Iae())&&($ae(t,n),Bae(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zae=function(){var e=Fae();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},VP=function(){var e=zae(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Hae={left:0,top:0,right:0,gap:0},dy=function(e){return parseInt(e||"",10)||0},Wae=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[dy(n),dy(r),dy(i)]},Uae=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Hae;var t=Wae(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])}},Vae=VP(),lc="data-scroll-locked",qae=function(e,t,n,r){var i=e.left,s=e.top,a=e.right,o=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(Tae,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(o,"px ").concat(r,`;
  }
  body[`).concat(lc,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(s,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(o,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(ym,` {
    right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(bm,` {
    margin-right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(ym," .").concat(ym,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(bm," .").concat(bm,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(lc,`] {
    `).concat(Aae,": ").concat(o,`px;
  }
`)},vT=function(){var e=parseInt(document.body.getAttribute(lc)||"0",10);return isFinite(e)?e:0},Gae=function(){w.useEffect(function(){return document.body.setAttribute(lc,(vT()+1).toString()),function(){var e=vT()-1;e<=0?document.body.removeAttribute(lc):document.body.setAttribute(lc,e.toString())}},[])},Kae=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Gae();var s=w.useMemo(function(){return Uae(i)},[i]);return w.createElement(Vae,{styles:qae(s,!t,i,n?"":"!important")})},P_=!1;if(typeof window<"u")try{var kp=Object.defineProperty({},"passive",{get:function(){return P_=!0,!0}});window.addEventListener("test",kp,kp),window.removeEventListener("test",kp,kp)}catch{P_=!1}var kl=P_?{passive:!1}:!1,Yae=function(e){return e.tagName==="TEXTAREA"},qP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yae(e)&&n[t]==="visible")},Xae=function(e){return qP(e,"overflowY")},Jae=function(e){return qP(e,"overflowX")},xT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=GP(e,r);if(i){var s=KP(e,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qae=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Zae=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},GP=function(e,t){return e==="v"?Xae(t):Jae(t)},KP=function(e,t){return e==="v"?Qae(t):Zae(t)},ele=function(e,t){return e==="h"&&t==="rtl"?-1:1},tle=function(e,t,n,r,i){var s=ele(e,window.getComputedStyle(t).direction),a=s*r,o=n.target,l=t.contains(o),u=!1,h=a>0,d=0,f=0;do{var g=KP(e,o),b=g[0],x=g[1],v=g[2],m=x-v-s*b;(b||m)&&GP(e,o)&&(d+=m,f+=b),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(h&&(Math.abs(d)<1||!i)||!h&&(Math.abs(f)<1||!i))&&(u=!0),u},Ep=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yT=function(e){return[e.deltaX,e.deltaY]},bT=function(e){return e&&"current"in e?e.current:e},nle=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rle=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},ile=0,El=[];function sle(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(ile++)[0],s=w.useState(VP)[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=Eae([e.lockRef.current],(e.shards||[]).map(bT),!0).filter(Boolean);return x.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=w.useCallback(function(x,v){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var m=Ep(x),p=n.current,y="deltaX"in x?x.deltaX:p[0]-m[0],_="deltaY"in x?x.deltaY:p[1]-m[1],C,S=x.target,E=Math.abs(y)>Math.abs(_)?"h":"v";if("touches"in x&&E==="h"&&S.type==="range")return!1;var k=xT(E,S);if(!k)return!0;if(k?C=E:(C=E==="v"?"h":"v",k=xT(E,S)),!k)return!1;if(!r.current&&"changedTouches"in x&&(y||_)&&(r.current=C),!C)return!0;var T=r.current||C;return tle(T,v,x,T==="h"?y:_,!0)},[]),l=w.useCallback(function(x){var v=x;if(!(!El.length||El[El.length-1]!==s)){var m="deltaY"in v?yT(v):Ep(v),p=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&nle(C.delta,m)})[0];if(p&&p.should){v.cancelable&&v.preventDefault();return}if(!p){var y=(a.current.shards||[]).map(bT).filter(Boolean).filter(function(C){return C.contains(v.target)}),_=y.length>0?o(v,y[0]):!a.current.noIsolation;_&&v.cancelable&&v.preventDefault()}}},[]),u=w.useCallback(function(x,v,m,p){var y={name:x,delta:v,target:m,should:p,shadowParent:ole(m)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(_){return _!==y})},1)},[]),h=w.useCallback(function(x){n.current=Ep(x),r.current=void 0},[]),d=w.useCallback(function(x){u(x.type,yT(x),x.target,o(x,e.lockRef.current))},[]),f=w.useCallback(function(x){u(x.type,Ep(x),x.target,o(x,e.lockRef.current))},[]);w.useEffect(function(){return El.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,kl),document.addEventListener("touchmove",l,kl),document.addEventListener("touchstart",h,kl),function(){El=El.filter(function(x){return x!==s}),document.removeEventListener("wheel",l,kl),document.removeEventListener("touchmove",l,kl),document.removeEventListener("touchstart",h,kl)}},[]);var g=e.removeScrollBar,b=e.inert;return w.createElement(w.Fragment,null,b?w.createElement(s,{styles:rle(i)}):null,g?w.createElement(Kae,{gapMode:e.gapMode}):null)}function ole(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ale=Pae(UP,sle);var vf=w.forwardRef(function(e,t){return w.createElement(m0,Wi({},e,{ref:t,sideCar:ale}))});vf.classNames=m0.classNames;var yC="Popover",[YP,qIe]=Cn(yC,[MP]),xf=MP(),[lle,Jo]=YP(yC),XP=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!1}=e,o=xf(t),l=w.useRef(null),[u,h]=w.useState(!1),[d=!1,f]=Pr({prop:r,defaultProp:i,onChange:s});return c.jsx(xae,{...o,children:c.jsx(lle,{scope:t,contentId:yr(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(g=>!g),[f]),hasCustomAnchor:u,onCustomAnchorAdd:w.useCallback(()=>h(!0),[]),onCustomAnchorRemove:w.useCallback(()=>h(!1),[]),modal:a,children:n})})};XP.displayName=yC;var JP="PopoverAnchor",cle=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Jo(JP,n),s=xf(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=i;return w.useEffect(()=>(a(),()=>o()),[a,o]),c.jsx(BP,{...s,...r,ref:t})});cle.displayName=JP;var QP="PopoverTrigger",ZP=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Jo(QP,n),s=xf(n),a=Le(t,i.triggerRef),o=c.jsx(Ws.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":i7(i.open),...r,ref:a,onClick:ae(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:c.jsx(BP,{asChild:!0,...s,children:o})});ZP.displayName=QP;var bC="PopoverPortal",[ule,dle]=YP(bC,{forceMount:void 0}),e7=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=Jo(bC,t);return c.jsx(ule,{scope:t,forceMount:n,children:c.jsx(on,{present:n||s.open,children:c.jsx(FP,{asChild:!0,container:i,children:r})})})};e7.displayName=bC;var Nc="PopoverContent",t7=w.forwardRef((e,t)=>{const n=dle(Nc,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=Jo(Nc,e.__scopePopover);return c.jsx(on,{present:r||s.open,children:s.modal?c.jsx(hle,{...i,ref:t}):c.jsx(fle,{...i,ref:t})})});t7.displayName=Nc;var hle=w.forwardRef((e,t)=>{const n=Jo(Nc,e.__scopePopover),r=w.useRef(null),i=Le(t,r),s=w.useRef(!1);return w.useEffect(()=>{const a=r.current;if(a)return p0(a)},[]),c.jsx(vf,{as:cC,allowPinchZoom:!0,children:c.jsx(n7,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),s.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0,u=o.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ae(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),fle=w.forwardRef((e,t)=>{const n=Jo(Nc,e.__scopePopover),r=w.useRef(!1),i=w.useRef(!1);return c.jsx(n7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),n7=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...d}=e,f=Jo(Nc,n),g=xf(n);return u0(),c.jsx(lP,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx(oP,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(yae,{"data-state":i7(f.open),role:"dialog",id:f.contentId,...g,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),r7="PopoverClose",ple=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Jo(r7,n);return c.jsx(Ws.button,{type:"button",...r,ref:t,onClick:ae(e.onClick,()=>i.onOpenChange(!1))})});ple.displayName=r7;var mle="PopoverArrow",gle=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=xf(n);return c.jsx(bae,{...i,...r,ref:t})});gle.displayName=mle;function i7(e){return e?"open":"closed"}var vle=XP,xle=ZP,yle=e7,s7=t7;const o7=vle,a7=xle,_C=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>c.jsx(yle,{children:c.jsx(s7,{ref:i,align:t,sideOffset:n,className:Y("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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),...r})}));_C.displayName=s7.displayName;function yf(e){const t=e+"CollectionProvider",[n,r]=Cn(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:b,children:x}=g,v=ot.useRef(null),m=ot.useRef(new Map).current;return c.jsx(i,{scope:b,itemMap:m,collectionRef:v,children:x})};a.displayName=t;const o=e+"CollectionSlot",l=ot.forwardRef((g,b)=>{const{scope:x,children:v}=g,m=s(o,x),p=Le(b,m.collectionRef);return c.jsx(Po,{ref:p,children:v})});l.displayName=o;const u=e+"CollectionItemSlot",h="data-radix-collection-item",d=ot.forwardRef((g,b)=>{const{scope:x,children:v,...m}=g,p=ot.useRef(null),y=Le(b,p),_=s(u,x);return ot.useEffect(()=>(_.itemMap.set(p,{ref:p,...m}),()=>void _.itemMap.delete(p))),c.jsx(Po,{[h]:"",ref:y,children:v})});d.displayName=u;function f(g){const b=s(e+"CollectionConsumer",g);return ot.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const m=Array.from(v.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((_,C)=>m.indexOf(_.ref.current)-m.indexOf(C.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,r]}var ble="DismissableLayer",O_="dismissableLayer.update",_le="dismissableLayer.pointerDownOutside",wle="dismissableLayer.focusOutside",_T,l7=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ou=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=e,u=w.useContext(l7),[h,d]=w.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=w.useState({}),b=Le(t,E=>d(E)),x=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=x.indexOf(v),p=h?x.indexOf(h):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,_=p>=m,C=kle(E=>{const k=E.target,T=[...u.branches].some(A=>A.contains(k));!_||T||(i==null||i(E),a==null||a(E),E.defaultPrevented||o==null||o())},f),S=Ele(E=>{const k=E.target;[...u.branches].some(A=>A.contains(k))||(s==null||s(E),a==null||a(E),E.defaultPrevented||o==null||o())},f);return iP(E=>{p===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&o&&(E.preventDefault(),o()))},f),w.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(_T=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),wT(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=_T)}},[h,f,n,u]),w.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),wT())},[h,u]),w.useEffect(()=>{const E=()=>g({});return document.addEventListener(O_,E),()=>document.removeEventListener(O_,E)},[]),c.jsx(Ce.div,{...l,ref:b,style:{pointerEvents:y?_?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,C.onPointerDownCapture)})});ou.displayName=ble;var Sle="DismissableLayerBranch",Cle=w.forwardRef((e,t)=>{const n=w.useContext(l7),r=w.useRef(null),i=Le(t,r);return w.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(Ce.div,{...e,ref:i})});Cle.displayName=Sle;function kle(e,t=globalThis==null?void 0:globalThis.document){const n=xt(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){c7(_le,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ele(e,t=globalThis==null?void 0:globalThis.document){const n=xt(e),r=w.useRef(!1);return w.useEffect(()=>{const i=s=>{s.target&&!r.current&&c7(wle,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wT(){const e=new CustomEvent(O_);document.dispatchEvent(e)}function c7(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?og(i,s):i.dispatchEvent(s)}function Tle(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function u7(...e){return t=>e.forEach(n=>Tle(n,t))}function Ale(...e){return w.useCallback(u7(...e),e)}var d7=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),s=i.find(Mle);if(s){const a=s.props.children,o=i.map(l=>l===s?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return c.jsx(I_,{...r,ref:t,children:w.isValidElement(a)?w.cloneElement(a,void 0,o):null})}return c.jsx(I_,{...r,ref:t,children:n})});d7.displayName="Slot";var I_=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const i=Nle(n);return w.cloneElement(n,{...jle(r,n.props),ref:t?u7(t,i):i})}return w.Children.count(n)>1?w.Children.only(null):null});I_.displayName="SlotClone";var Rle=({children:e})=>c.jsx(c.Fragment,{children:e});function Mle(e){return w.isValidElement(e)&&e.type===Rle}function jle(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{s(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Nle(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Lle=Dle.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?d7:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(o,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),hy="focusScope.autoFocusOnMount",fy="focusScope.autoFocusOnUnmount",ST={bubbles:!1,cancelable:!0},Ple="FocusScope",g0=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,l]=w.useState(null),u=xt(i),h=xt(s),d=w.useRef(null),f=Ale(t,x=>l(x)),g=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let x=function(y){if(g.paused||!o)return;const _=y.target;o.contains(_)?d.current=_:ro(d.current,{select:!0})},v=function(y){if(g.paused||!o)return;const _=y.relatedTarget;_!==null&&(o.contains(_)||ro(d.current,{select:!0}))},m=function(y){if(document.activeElement===document.body)for(const C of y)C.removedNodes.length>0&&ro(o)};document.addEventListener("focusin",x),document.addEventListener("focusout",v);const p=new MutationObserver(m);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",v),p.disconnect()}}},[r,o,g.paused]),w.useEffect(()=>{if(o){kT.add(g);const x=document.activeElement;if(!o.contains(x)){const m=new CustomEvent(hy,ST);o.addEventListener(hy,u),o.dispatchEvent(m),m.defaultPrevented||(Ole(zle(h7(o)),{select:!0}),document.activeElement===x&&ro(o))}return()=>{o.removeEventListener(hy,u),setTimeout(()=>{const m=new CustomEvent(fy,ST);o.addEventListener(fy,h),o.dispatchEvent(m),m.defaultPrevented||ro(x??document.body,{select:!0}),o.removeEventListener(fy,h),kT.remove(g)},0)}}},[o,u,h,g]);const b=w.useCallback(x=>{if(!n&&!r||g.paused)return;const v=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,m=document.activeElement;if(v&&m){const p=x.currentTarget,[y,_]=Ile(p);y&&_?!x.shiftKey&&m===_?(x.preventDefault(),n&&ro(y,{select:!0})):x.shiftKey&&m===y&&(x.preventDefault(),n&&ro(_,{select:!0})):m===p&&x.preventDefault()}},[n,r,g.paused]);return c.jsx(Lle.div,{tabIndex:-1,...a,ref:f,onKeyDown:b})});g0.displayName=Ple;function Ole(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ro(r,{select:t}),document.activeElement!==n)return}function Ile(e){const t=h7(e),n=CT(t,e),r=CT(t.reverse(),e);return[n,r]}function h7(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 CT(e,t){for(const n of e)if(!$le(n,{upTo:t}))return n}function $le(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 Ble(e){return e instanceof HTMLInputElement&&"select"in e}function ro(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ble(e)&&t&&e.select()}}var kT=Fle();function Fle(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ET(e,t),e.unshift(t)},remove(t){var n;e=ET(e,t),(n=e[0])==null||n.resume()}}}function ET(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zle(e){return e.filter(t=>t.tagName!=="A")}var Hle="Arrow",f7=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return c.jsx(Ce.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});f7.displayName=Hle;var Wle=f7,wC="Popper",[p7,au]=Cn(wC),[Ule,m7]=p7(wC),g7=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return c.jsx(Ule,{scope:t,anchor:r,onAnchorChange:i,children:n})};g7.displayName=wC;var v7="PopperAnchor",x7=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=m7(v7,n),a=w.useRef(null),o=Le(t,a);return w.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:c.jsx(Ce.div,{...i,ref:o})});x7.displayName=v7;var SC="PopperContent",[Vle,qle]=p7(SC),y7=w.forwardRef((e,t)=>{var W,$,V,U,X,q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:b,...x}=e,v=m7(SC,n),[m,p]=w.useState(null),y=Le(t,ne=>p(ne)),[_,C]=w.useState(null),S=gf(_),E=(S==null?void 0:S.width)??0,k=(S==null?void 0:S.height)??0,T=r+(s!=="center"?"-"+s:""),A=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(u)?u:[u],D=M.length>0,L={padding:A,boundary:M.filter(Kle),altBoundary:D},{refs:N,floatingStyles:O,placement:B,isPositioned:z,middlewareData:P}=bP({strategy:"fixed",placement:T,whileElementsMounted:(...ne)=>xP(...ne,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[_P({mainAxis:i+k,alignmentAxis:a}),l&&wP({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?SP():void 0,...L}),l&&CP({...L}),kP({...L,apply:({elements:ne,rects:te,availableWidth:le,availableHeight:xe})=>{const{width:ie,height:Te}=te.reference,Ae=ne.floating.style;Ae.setProperty("--radix-popper-available-width",`${le}px`),Ae.setProperty("--radix-popper-available-height",`${xe}px`),Ae.setProperty("--radix-popper-anchor-width",`${ie}px`),Ae.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),_&&TP({element:_,padding:o}),Yle({arrowWidth:E,arrowHeight:k}),f&&EP({strategy:"referenceHidden",...L})]}),[j,R]=w7(B),I=xt(b);Xt(()=>{z&&(I==null||I())},[z,I]);const H=(W=P.arrow)==null?void 0:W.x,F=($=P.arrow)==null?void 0:$.y,G=((V=P.arrow)==null?void 0:V.centerOffset)!==0,[Z,J]=w.useState();return Xt(()=>{m&&J(window.getComputedStyle(m).zIndex)},[m]),c.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:z?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(U=P.transformOrigin)==null?void 0:U.x,(X=P.transformOrigin)==null?void 0:X.y].join(" "),...((q=P.hide)==null?void 0:q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Vle,{scope:n,placedSide:j,onArrowChange:C,arrowX:H,arrowY:F,shouldHideArrow:G,children:c.jsx(Ce.div,{"data-side":j,"data-align":R,...x,ref:y,style:{...x.style,animation:z?void 0:"none"}})})})});y7.displayName=SC;var b7="PopperArrow",Gle={top:"bottom",right:"left",bottom:"top",left:"right"},_7=w.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=qle(b7,r),a=Gle[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(Wle,{...i,ref:n,style:{...i.style,display:"block"}})})});_7.displayName=b7;function Kle(e){return e!==null}var Yle=e=>({name:"transformOrigin",options:e,fn(t){var v,m,p;const{placement:n,rects:r,middlewareData:i}=t,a=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,h]=w7(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((m=i.arrow)==null?void 0:m.x)??0)+o/2,g=(((p=i.arrow)==null?void 0:p.y)??0)+l/2;let b="",x="";return u==="bottom"?(b=a?d:`${f}px`,x=`${-l}px`):u==="top"?(b=a?d:`${f}px`,x=`${r.floating.height+l}px`):u==="right"?(b=`${-l}px`,x=a?d:`${g}px`):u==="left"&&(b=`${r.floating.width+l}px`,x=a?d:`${g}px`),{data:{x:b,y:x}}}});function w7(e){const[t,n="center"]=e.split("-");return[t,n]}var CC=g7,kC=x7,EC=y7,TC=_7,Xle="Portal",v0=w.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,s]=w.useState(!1);Xt(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?G2.createPortal(c.jsx(Ce.div,{...r,ref:t}),a):null});v0.displayName=Xle;function bf(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Jle="VisuallyHidden",AC=w.forwardRef((e,t)=>c.jsx(Ce.span,{...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}}));AC.displayName=Jle;var S7=AC,Qle=[" ","Enter","ArrowUp","ArrowDown"],Zle=[" ","Enter"],_f="Select",[x0,y0,ece]=yf(_f),[lu,GIe]=Cn(_f,[ece,au]),b0=au(),[tce,Qo]=lu(_f),[nce,rce]=lu(_f),C7=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:l,dir:u,name:h,autoComplete:d,disabled:f,required:g,form:b}=e,x=b0(t),[v,m]=w.useState(null),[p,y]=w.useState(null),[_,C]=w.useState(!1),S=Ja(u),[E=!1,k]=Pr({prop:r,defaultProp:i,onChange:s}),[T,A]=Pr({prop:a,defaultProp:o,onChange:l}),M=w.useRef(null),D=v?b||!!v.closest("form"):!0,[L,N]=w.useState(new Set),O=Array.from(L).map(B=>B.props.value).join(";");return c.jsx(CC,{...x,children:c.jsxs(tce,{required:g,scope:t,trigger:v,onTriggerChange:m,valueNode:p,onValueNodeChange:y,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:yr(),value:T,onValueChange:A,open:E,onOpenChange:k,dir:S,triggerPointerDownPosRef:M,disabled:f,children:[c.jsx(x0.Provider,{scope:t,children:c.jsx(nce,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(B=>{N(z=>new Set(z).add(B))},[]),onNativeOptionRemove:w.useCallback(B=>{N(z=>{const P=new Set(z);return P.delete(B),P})},[]),children:n})}),D?c.jsxs(Y7,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:d,value:T,onChange:B=>A(B.target.value),disabled:f,form:b,children:[T===void 0?c.jsx("option",{value:""}):null,Array.from(L)]},O):null]})})};C7.displayName=_f;var k7="SelectTrigger",E7=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=b0(n),a=Qo(k7,n),o=a.disabled||r,l=Le(t,a.onTriggerChange),u=y0(n),h=w.useRef("touch"),[d,f,g]=X7(x=>{const v=u().filter(y=>!y.disabled),m=v.find(y=>y.value===a.value),p=J7(v,x,m);p!==void 0&&a.onValueChange(p.value)}),b=x=>{o||(a.onOpenChange(!0),g()),x&&(a.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return c.jsx(kC,{asChild:!0,...s,children:c.jsx(Ce.button,{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:o,"data-disabled":o?"":void 0,"data-placeholder":K7(a.value)?"":void 0,...i,ref:l,onClick:ae(i.onClick,x=>{x.currentTarget.focus(),h.current!=="mouse"&&b(x)}),onPointerDown:ae(i.onPointerDown,x=>{h.current=x.pointerType;const v=x.target;v.hasPointerCapture(x.pointerId)&&v.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(b(x),x.preventDefault())}),onKeyDown:ae(i.onKeyDown,x=>{const v=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&f(x.key),!(v&&x.key===" ")&&Qle.includes(x.key)&&(b(),x.preventDefault())})})})});E7.displayName=k7;var T7="SelectValue",A7=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...o}=e,l=Qo(T7,n),{onValueNodeHasChildrenChange:u}=l,h=s!==void 0,d=Le(t,l.onValueNodeChange);return Xt(()=>{u(h)},[u,h]),c.jsx(Ce.span,{...o,ref:d,style:{pointerEvents:"none"},children:K7(l.value)?c.jsx(c.Fragment,{children:a}):s})});A7.displayName=T7;var ice="SelectIcon",R7=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(Ce.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});R7.displayName=ice;var sce="SelectPortal",M7=e=>c.jsx(v0,{asChild:!0,...e});M7.displayName=sce;var Ia="SelectContent",j7=w.forwardRef((e,t)=>{const n=Qo(Ia,e.__scopeSelect),[r,i]=w.useState();if(Xt(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?mr.createPortal(c.jsx(N7,{scope:e.__scopeSelect,children:c.jsx(x0.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(D7,{...e,ref:t})});j7.displayName=Ia;var ui=10,[N7,Zo]=lu(Ia),oce="SelectContentImpl",D7=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:l,align:u,alignOffset:h,arrowPadding:d,collisionBoundary:f,collisionPadding:g,sticky:b,hideWhenDetached:x,avoidCollisions:v,...m}=e,p=Qo(Ia,n),[y,_]=w.useState(null),[C,S]=w.useState(null),E=Le(t,W=>_(W)),[k,T]=w.useState(null),[A,M]=w.useState(null),D=y0(n),[L,N]=w.useState(!1),O=w.useRef(!1);w.useEffect(()=>{if(y)return p0(y)},[y]),u0();const B=w.useCallback(W=>{const[$,...V]=D().map(q=>q.ref.current),[U]=V.slice(-1),X=document.activeElement;for(const q of W)if(q===X||(q==null||q.scrollIntoView({block:"nearest"}),q===$&&C&&(C.scrollTop=0),q===U&&C&&(C.scrollTop=C.scrollHeight),q==null||q.focus(),document.activeElement!==X))return},[D,C]),z=w.useCallback(()=>B([k,y]),[B,k,y]);w.useEffect(()=>{L&&z()},[L,z]);const{onOpenChange:P,triggerPointerDownPosRef:j}=p;w.useEffect(()=>{if(y){let W={x:0,y:0};const $=U=>{var X,q;W={x:Math.abs(Math.round(U.pageX)-(((X=j.current)==null?void 0:X.x)??0)),y:Math.abs(Math.round(U.pageY)-(((q=j.current)==null?void 0:q.y)??0))}},V=U=>{W.x<=10&&W.y<=10?U.preventDefault():y.contains(U.target)||P(!1),document.removeEventListener("pointermove",$),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",V,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",V,{capture:!0})}}},[y,P,j]),w.useEffect(()=>{const W=()=>P(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[P]);const[R,I]=X7(W=>{const $=D().filter(X=>!X.disabled),V=$.find(X=>X.ref.current===document.activeElement),U=J7($,W,V);U&&setTimeout(()=>U.ref.current.focus())}),H=w.useCallback((W,$,V)=>{const U=!O.current&&!V;(p.value!==void 0&&p.value===$||U)&&(T(W),U&&(O.current=!0))},[p.value]),F=w.useCallback(()=>y==null?void 0:y.focus(),[y]),G=w.useCallback((W,$,V)=>{const U=!O.current&&!V;(p.value!==void 0&&p.value===$||U)&&M(W)},[p.value]),Z=r==="popper"?$_:L7,J=Z===$_?{side:o,sideOffset:l,align:u,alignOffset:h,arrowPadding:d,collisionBoundary:f,collisionPadding:g,sticky:b,hideWhenDetached:x,avoidCollisions:v}:{};return c.jsx(N7,{scope:n,content:y,viewport:C,onViewportChange:S,itemRefCallback:H,selectedItem:k,onItemLeave:F,itemTextRefCallback:G,focusSelectedItem:z,selectedItemText:A,position:r,isPositioned:L,searchRef:R,children:c.jsx(vf,{as:Po,allowPinchZoom:!0,children:c.jsx(g0,{asChild:!0,trapped:p.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:ae(i,W=>{var $;($=p.trigger)==null||$.focus({preventScroll:!0}),W.preventDefault()}),children:c.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:c.jsx(Z,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:W=>W.preventDefault(),...m,...J,onPlaced:()=>N(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:ae(m.onKeyDown,W=>{const $=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!$&&W.key.length===1&&I(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let U=D().filter(X=>!X.disabled).map(X=>X.ref.current);if(["ArrowUp","End"].includes(W.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const X=W.target,q=U.indexOf(X);U=U.slice(q+1)}setTimeout(()=>B(U)),W.preventDefault()}})})})})})})});D7.displayName=oce;var ace="SelectItemAlignedPosition",L7=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=Qo(Ia,n),a=Zo(Ia,n),[o,l]=w.useState(null),[u,h]=w.useState(null),d=Le(t,E=>h(E)),f=y0(n),g=w.useRef(!1),b=w.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:m,focusSelectedItem:p}=a,y=w.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&u&&x&&v&&m){const E=s.trigger.getBoundingClientRect(),k=u.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),A=m.getBoundingClientRect();if(s.dir!=="rtl"){const X=A.left-k.left,q=T.left-X,ne=E.left-q,te=E.width+ne,le=Math.max(te,k.width),xe=window.innerWidth-ui,ie=Zb(q,[ui,Math.max(ui,xe-le)]);o.style.minWidth=te+"px",o.style.left=ie+"px"}else{const X=k.right-A.right,q=window.innerWidth-T.right-X,ne=window.innerWidth-E.right-q,te=E.width+ne,le=Math.max(te,k.width),xe=window.innerWidth-ui,ie=Zb(q,[ui,Math.max(ui,xe-le)]);o.style.minWidth=te+"px",o.style.right=ie+"px"}const M=f(),D=window.innerHeight-ui*2,L=x.scrollHeight,N=window.getComputedStyle(u),O=parseInt(N.borderTopWidth,10),B=parseInt(N.paddingTop,10),z=parseInt(N.borderBottomWidth,10),P=parseInt(N.paddingBottom,10),j=O+B+L+P+z,R=Math.min(v.offsetHeight*5,j),I=window.getComputedStyle(x),H=parseInt(I.paddingTop,10),F=parseInt(I.paddingBottom,10),G=E.top+E.height/2-ui,Z=D-G,J=v.offsetHeight/2,W=v.offsetTop+J,$=O+B+W,V=j-$;if($<=G){const X=M.length>0&&v===M[M.length-1].ref.current;o.style.bottom="0px";const q=u.clientHeight-x.offsetTop-x.offsetHeight,ne=Math.max(Z,J+(X?F:0)+q+z),te=$+ne;o.style.height=te+"px"}else{const X=M.length>0&&v===M[0].ref.current;o.style.top="0px";const ne=Math.max(G,O+x.offsetTop+(X?H:0)+J)+V;o.style.height=ne+"px",x.scrollTop=$-G+x.offsetTop}o.style.margin=`${ui}px 0`,o.style.minHeight=R+"px",o.style.maxHeight=D+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[f,s.trigger,s.valueNode,o,u,x,v,m,s.dir,r]);Xt(()=>y(),[y]);const[_,C]=w.useState();Xt(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const S=w.useCallback(E=>{E&&b.current===!0&&(y(),p==null||p(),b.current=!1)},[y,p]);return c.jsx(cce,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:g,onScrollButtonChange:S,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:c.jsx(Ce.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});L7.displayName=ace;var lce="SelectPopperPosition",$_=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ui,...s}=e,a=b0(n);return c.jsx(EC,{...a,...s,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})});$_.displayName=lce;var[cce,RC]=lu(Ia,{}),B_="SelectViewport",P7=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,s=Zo(B_,n),a=RC(B_,n),o=Le(t,s.onViewportChange),l=w.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(x0.Slot,{scope:n,children:c.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ae(i.onScroll,u=>{const h=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const g=Math.abs(l.current-h.scrollTop);if(g>0){const b=window.innerHeight-ui*2,x=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),m=Math.max(x,v);if(m<b){const p=m+g,y=Math.min(b,p),_=p-y;d.style.height=y+"px",d.style.bottom==="0px"&&(h.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}l.current=h.scrollTop})})})]})});P7.displayName=B_;var O7="SelectGroup",[uce,dce]=lu(O7),hce=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=yr();return c.jsx(uce,{scope:n,id:i,children:c.jsx(Ce.div,{role:"group","aria-labelledby":i,...r,ref:t})})});hce.displayName=O7;var I7="SelectLabel",$7=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=dce(I7,n);return c.jsx(Ce.div,{id:i.id,...r,ref:t})});$7.displayName=I7;var Mg="SelectItem",[fce,B7]=lu(Mg),F7=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=e,o=Qo(Mg,n),l=Zo(Mg,n),u=o.value===r,[h,d]=w.useState(s??""),[f,g]=w.useState(!1),b=Le(t,p=>{var y;return(y=l.itemRefCallback)==null?void 0:y.call(l,p,r,i)}),x=yr(),v=w.useRef("touch"),m=()=>{i||(o.onValueChange(r),o.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 c.jsx(fce,{scope:n,value:r,disabled:i,textId:x,isSelected:u,onItemTextChange:w.useCallback(p=>{d(y=>y||((p==null?void 0:p.textContent)??"").trim())},[]),children:c.jsx(x0.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:c.jsx(Ce.div,{role:"option","aria-labelledby":x,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:b,onFocus:ae(a.onFocus,()=>g(!0)),onBlur:ae(a.onBlur,()=>g(!1)),onClick:ae(a.onClick,()=>{v.current!=="mouse"&&m()}),onPointerUp:ae(a.onPointerUp,()=>{v.current==="mouse"&&m()}),onPointerDown:ae(a.onPointerDown,p=>{v.current=p.pointerType}),onPointerMove:ae(a.onPointerMove,p=>{var y;v.current=p.pointerType,i?(y=l.onItemLeave)==null||y.call(l):v.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ae(a.onPointerLeave,p=>{var y;p.currentTarget===document.activeElement&&((y=l.onItemLeave)==null||y.call(l))}),onKeyDown:ae(a.onKeyDown,p=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&p.key===" "||(Zle.includes(p.key)&&m(),p.key===" "&&p.preventDefault())})})})})});F7.displayName=Mg;var vd="SelectItemText",z7=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,a=Qo(vd,n),o=Zo(vd,n),l=B7(vd,n),u=rce(vd,n),[h,d]=w.useState(null),f=Le(t,m=>d(m),l.onItemTextChange,m=>{var p;return(p=o.itemTextRefCallback)==null?void 0:p.call(o,m,l.value,l.disabled)}),g=h==null?void 0:h.textContent,b=w.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return Xt(()=>(x(b),()=>v(b)),[x,v,b]),c.jsxs(c.Fragment,{children:[c.jsx(Ce.span,{id:l.textId,...s,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?mr.createPortal(s.children,a.valueNode):null]})});z7.displayName=vd;var H7="SelectItemIndicator",W7=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return B7(H7,n).isSelected?c.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});W7.displayName=H7;var F_="SelectScrollUpButton",U7=w.forwardRef((e,t)=>{const n=Zo(F_,e.__scopeSelect),r=RC(F_,e.__scopeSelect),[i,s]=w.useState(!1),a=Le(t,r.onScrollButtonChange);return Xt(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?c.jsx(q7,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});U7.displayName=F_;var z_="SelectScrollDownButton",V7=w.forwardRef((e,t)=>{const n=Zo(z_,e.__scopeSelect),r=RC(z_,e.__scopeSelect),[i,s]=w.useState(!1),a=Le(t,r.onScrollButtonChange);return Xt(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollHeight-l.clientHeight,h=Math.ceil(l.scrollTop)<u;s(h)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?c.jsx(q7,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});V7.displayName=z_;var q7=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=Zo("SelectScrollButton",n),a=w.useRef(null),o=y0(n),l=w.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Xt(()=>{var h;const u=o().find(d=>d.ref.current===document.activeElement);(h=u==null?void 0:u.ref.current)==null||h.scrollIntoView({block:"nearest"})},[o]),c.jsx(Ce.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ae(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ae(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ae(i.onPointerLeave,()=>{l()})})}),pce="SelectSeparator",G7=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});G7.displayName=pce;var H_="SelectArrow",mce=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=b0(n),s=Qo(H_,n),a=Zo(H_,n);return s.open&&a.position==="popper"?c.jsx(TC,{...i,...r,ref:t}):null});mce.displayName=H_;function K7(e){return e===""||e===void 0}var Y7=w.forwardRef((e,t)=>{const{value:n,...r}=e,i=w.useRef(null),s=Le(t,i),a=bf(n);return w.useEffect(()=>{const o=i.current,l=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&h){const d=new Event("change",{bubbles:!0});h.call(o,n),o.dispatchEvent(d)}},[a,n]),c.jsx(AC,{asChild:!0,children:c.jsx("select",{...r,ref:s,defaultValue:n})})});Y7.displayName="BubbleSelect";function X7(e){const t=xt(e),n=w.useRef(""),r=w.useRef(0),i=w.useCallback(a=>{const o=n.current+a;t(o),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[t]),s=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function J7(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=gce(e,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function gce(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q7=C7,_0=E7,vce=A7,xce=R7,Z7=M7,w0=j7,eO=P7,tO=$7,S0=F7,nO=z7,yce=W7,C0=U7,k0=V7,rO=G7;const gn=Q7,vn=vce,un=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(_0,{ref:r,className:Y("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,c.jsx(xce,{asChild:!0,children:c.jsx(Za,{className:"h-4 w-4 opacity-50"})})]}));un.displayName=_0.displayName;const iO=w.forwardRef(({className:e,...t},n)=>c.jsx(C0,{ref:n,className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(CS,{className:"h-4 w-4"})}));iO.displayName=C0.displayName;const sO=w.forwardRef(({className:e,...t},n)=>c.jsx(k0,{ref:n,className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Za,{className:"h-4 w-4"})}));sO.displayName=k0.displayName;const dn=w.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>c.jsx(Z7,{children:c.jsxs(w0,{ref:i,className:Y("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:[c.jsx(iO,{}),c.jsx(eO,{className:Y("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(sO,{})]})}));dn.displayName=w0.displayName;const bce=w.forwardRef(({className:e,...t},n)=>c.jsx(tO,{ref:n,className:Y("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));bce.displayName=tO.displayName;const ye=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(S0,{ref:r,className:Y("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:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(yce,{children:c.jsx(wS,{className:"h-4 w-4"})})}),c.jsx(nO,{children:t})]}));ye.displayName=S0.displayName;const MC=w.forwardRef(({className:e,...t},n)=>c.jsx(rO,{ref:n,className:Y("-mx-1 my-1 h-px bg-muted",e),...t}));MC.displayName=rO.displayName;var jC="Switch",[_ce,KIe]=Cn(jC),[wce,Sce]=_ce(jC),oO=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:u,form:h,...d}=e,[f,g]=w.useState(null),b=Le(t,y=>g(y)),x=w.useRef(!1),v=f?h||!!f.closest("form"):!0,[m=!1,p]=Pr({prop:i,defaultProp:s,onChange:u});return c.jsxs(wce,{scope:n,checked:m,disabled:o,children:[c.jsx(Ce.button,{type:"button",role:"switch","aria-checked":m,"aria-required":a,"data-state":cO(m),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:b,onClick:ae(e.onClick,y=>{p(_=>!_),v&&(x.current=y.isPropagationStopped(),x.current||y.stopPropagation())})}),v&&c.jsx(Cce,{control:f,bubbles:!x.current,name:r,value:l,checked:m,required:a,disabled:o,form:h,style:{transform:"translateX(-100%)"}})]})});oO.displayName=jC;var aO="SwitchThumb",lO=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Sce(aO,n);return c.jsx(Ce.span,{"data-state":cO(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});lO.displayName=aO;var Cce=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,s=w.useRef(null),a=bf(n),o=gf(t);return w.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...e.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function cO(e){return e?"checked":"unchecked"}var uO=oO,kce=lO;const jg=w.forwardRef(({className:e,...t},n)=>c.jsx(uO,{className:Y("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:c.jsx(kce,{className:Y("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));jg.displayName=uO.displayName;var Ece="Separator",TT="horizontal",Tce=["horizontal","vertical"],dO=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=TT,...i}=e,s=Ace(r)?r:TT,o=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(Ce.div,{"data-orientation":s,...o,...i,ref:t})});dO.displayName=Ece;function Ace(e){return Tce.includes(e)}var hO=dO;const fO=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>c.jsx(hO,{ref:i,decorative:n,orientation:t,className:Y("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));fO.displayName=hO.displayName;function Rce({options:e,setOptions:t,setHasPendingRefresh:n}){return c.jsx(_C,{className:"w-96",children:c.jsxs("div",{className:"grid gap-6",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("h4",{className:"font-medium leading-none",children:"Live Console Settings"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the appearance and behavior of your live console. These settings will be saved."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("h5",{className:"text-sm font-medium leading-none",children:"Display Options"}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[c.jsx(Yt,{htmlFor:"density",className:"col-span-1",children:"Font Size"}),c.jsx("div",{className:"col-span-3",children:c.jsxs(gn,{value:e.density,onValueChange:r=>t({density:r}),children:[c.jsx(un,{children:c.jsx(vn,{placeholder:"Select density"})}),c.jsxs(dn,{children:[c.jsx(ye,{value:"SPACIOUS",children:"Large"}),c.jsx(ye,{value:"COMFORTABLE",children:"Medium"}),c.jsx(ye,{value:"COMPACT",children:"Small"})]})]})})]}),c.jsx("div",{className:"grid gap-4",children:c.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[c.jsx(Yt,{htmlFor:"timestamp",className:"col-span-1",children:"Timestamp"}),c.jsx("div",{className:"col-span-3",children:c.jsxs(gn,{value:e.timestamp,onValueChange:r=>{n(!0),t({timestamp:r})},children:[c.jsx(un,{children:c.jsx(vn,{placeholder:"Select timestamp mode"})}),c.jsxs(dn,{children:[c.jsx(ye,{value:"DEFAULT",children:"System Default"}),c.jsx(ye,{value:"FORCE12H",children:"Force 12h Mode"}),c.jsx(ye,{value:"FORCE24H",children:"Force 24h Mode"}),c.jsx(ye,{value:"DISABLED",children:"Disabled"})]})]})})]})}),c.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[c.jsx(Yt,{htmlFor:"scrollback",className:"col-span-1",children:"Scrollback"}),c.jsx("div",{className:"col-span-3",children:c.jsxs(gn,{value:e.scrollback.toString(),onValueChange:r=>t({scrollback:Number(r)}),children:[c.jsx(un,{children:c.jsx(vn,{placeholder:"Select size"})}),c.jsxs(dn,{children:[c.jsx(ye,{value:Hd.LARGE.toString(),children:"10k lines"}),c.jsx(ye,{value:Hd.MEDIUM.toString(),children:"5k lines (default)"}),c.jsx(ye,{value:Hd.SMALL.toString(),children:"2.5k lines"})]})]})})]})]})]}),c.jsx(fO,{className:"my-1"}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("h5",{className:"text-sm font-medium leading-none",children:"Copy Options"}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Yt,{htmlFor:"copyTimestamp",children:"Include Timestamp"}),c.jsx(jg,{id:"copyTimestamp",checked:e.copyTimestamp,onCheckedChange:r=>t({copyTimestamp:r})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Yt,{htmlFor:"copyChannel",children:"Include Channel"}),c.jsx(jg,{id:"copyChannel",checked:e.copyChannel,onCheckedChange:r=>t({copyChannel:r})})]})]})]})]})})}const Mce=si("rounded bg-accent text-accent-foreground font-semibold self-center",{variants:{size:{xs:"px-1 ml-1 text-[0.5rem] tracking-[0.2em] leading-loose",md:"px-1 ml-1.5 text-2xs tracking-wider"}},defaultVariants:{size:"md"}});function pO({featName:e,durationDays:t,children:n}){const r=_r.NewFeatureSeenTs+e,i=parseInt(localStorage.getItem(r)??"");if(isNaN(i)||window.txConsts.showAdvanced)localStorage.setItem(r,Date.now().toString());else{const s=(t??3)*24*60*60*1e3;if(i+s<Date.now())return null}return n}const jce=ot.memo(pO);function Nce({badgeText:e,featName:t,durationDays:n,className:r,size:i}){return c.jsx(pO,{featName:t,durationDays:n,children:c.jsx("span",{className:Y(r,Mce({size:i})),children:e??"NEW"})})}const mO=ot.memo(Nce);function Dce(e){const[t,n]=w.useState(!1),r=of();return c.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.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:[c.jsx("polyline",{points:"4 17 10 11 4 5"}),c.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),c.jsx("p",{className:"font-mono text-sm",children:"Live Console"})]}),c.jsx("div",{className:"flex items-center space-x-1",children:c.jsxs(o7,{onOpenChange:i=>{!i&&t&&(r(),n(!1))},children:[c.jsx(mO,{featName:"liveConsoleOptions",size:"md"}),c.jsx(a7,{asChild:!0,children:c.jsx("button",{className:"p-2 hover:bg-accent rounded-md",children:c.jsx(QD,{className:"w-4 h-4"})})}),c.jsx(Rce,{options:e.options,setOptions:e.setOptions,setHasPendingRefresh:n})]})})]})})}function Tl({title:e,onClick:t,isActive:n,children:r}){return c.jsx("button",{title:e,className:Y("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 py="No results",Lce={activeMatchBackground:"#FF00DC",activeMatchColorOverviewRuler:"#FF00DC",matchBackground:"#732268",matchOverviewRuler:"#732268"};function gO({show:e,setShow:t,searchAddon:n}){const[r,i]=w.useState(!1),[s,a]=w.useState(!1),[o,l]=w.useState(!1),u=w.useRef(null),[h,d]=w.useState(py),f=C=>{n.clearDecorations(),C&&d(C)},g=C=>({decorations:Lce,caseSensitive:r,wholeWord:s,regex:o,...C});w.useEffect(()=>{var C;e?(C=u.current)==null||C.focus():f(py)},[e]),w.useEffect(()=>{if(!n)return;const C=n.onDidChangeResults(({resultIndex:S,resultCount:E})=>{d(S===-1?py:`${S+1}/${E}`)});return()=>{C.dispose()}},[]);const b=()=>{!u.current||!u.current.value||(console.log("backward search for",u.current.value),n.findPrevious(u.current.value,g()))},x=()=>{!u.current||!u.current.value||(console.log("forward search for",u.current.value),n.findNext(u.current.value,g()))},v=C=>{u.current&&(console.log("search input keydown",C.code),C.code==="Enter"&&(C.shiftKey?b():x(),C.preventDefault()))},m=C=>{u.current&&x()},p=()=>{u.current&&(i(!r),f(),n.findNext(u.current.value,g({caseSensitive:!r})))},y=()=>{u.current&&(a(!s),f(),n.findNext(u.current.value,g({wholeWord:!s})))},_=()=>{u.current&&(l(!o),f(),n.findNext(u.current.value,g({regex:!o})))};return Ei("message",C=>{var S;C.data.type==="liveConsoleSearchHotkey"&&(C.data.action==="previous"?b():C.data.action==="next"?x():C.data.action==="focus"&&((S=u.current)==null||S.focus()))}),e?c.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:[c.jsxs("div",{className:"relative",children:[c.jsx(yt,{ref:u,className:"h-8",placeholder:"Search string",onKeyDown:v,onChange:m,onBlur:()=>{n.clearActiveDecoration()}}),c.jsxs("div",{className:"absolute top-1/2 right-1 transform -translate-y-1/2 flex text-muted-foreground gap-2",children:[c.jsx(Tl,{title:"Case Sensitive",isActive:r,onClick:p,children:c.jsx(nX,{className:"h-5 w-5"})}),c.jsx(Tl,{title:"Whole Word",isActive:s,onClick:y,children:c.jsx(oJ,{className:"h-5 w-5"})}),c.jsx(Tl,{title:"Regex",isActive:o,onClick:_,children:c.jsx(WX,{className:"h-4 w-5"})})]})]}),c.jsx("div",{className:"flex grow text-sm text-muted-foreground whitespace-nowrap min-w-[8ch]",children:h}),c.jsxs("div",{className:"flex gap-2 text-muted-foreground",children:[c.jsx(Tl,{title:"Previous",onClick:b,children:c.jsx(JY,{className:"h-5 w-5"})}),c.jsx(Tl,{title:"Next",onClick:x,children:c.jsx(YY,{className:"h-5 w-5"})}),c.jsx(Tl,{title:"Close",onClick:()=>{t(!1)},children:c.jsx(Kn,{className:"h-5 w-5"})})]})]}):null}function Pce({isOpen:e,closeSheet:t}){return c.jsx("div",{className:Y("absolute inset-0 z-20","bg-black/60 duration-300","data-[state=open]:pointer-events-auto data-[state=closed]:pointer-events-none","data-[state=open]:opacity-100","data-[state=closed]:opacity-0"),"data-state":e?"open":"closed",onClick:t})}function Oce({closeSheet:e}){return c.jsx("button",{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-0 transition-opacity hover:opacity-100 focus:outline-none cursor-pointer",onClick:e,title:"Close",children:c.jsx(Kn,{className:"h-8 w-8"})})}function AT({cmd:e,type:t,onClick:n,onFavAction:r}){const i=s=>{s.stopPropagation(),r()};return c.jsxs("div",{onClick:n,className:"px-2 py-1 flex justify-between items-center rounded-lg bg-card hover:bg-muted cursor-pointer group",children:[c.jsx("span",{className:"py-1 line-clamp-4 font-mono group-hover:text-primary",children:e}),c.jsx("div",{className:"min-w-max",children:c.jsx("button",{className:"size-7 rounded-lg flex items-center justify-center hover:bg-primary hover:text-primary-foreground invisible group-hover:visible",onClick:i,children:t==="history"?c.jsxs(c.Fragment,{children:[c.jsx(ZX,{className:"size-5"}),c.jsx("span",{className:"sr-only",children:"Save"})]}):c.jsxs(c.Fragment,{children:[c.jsx(QX,{className:"size-5"}),c.jsx("span",{className:"sr-only",children:"Remove"})]})})})]})}function Ice({toTermInput:e}){const{history:t,wipeHistory:n}=rP(),{bookmarks:r,addBookmark:i,removeBookmark:s}=Qse(),a=af(),o=()=>{ze.success("History cleared"),n()},l=()=>{a({title:"Save Command",message:"Enter the command to save:",submitLabel:"Save",onSubmit:u=>{u&&i(u)}})};return c.jsxs("div",{className:"flex flex-row gap-4 max-h-full",children:[c.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[c.jsx("h2",{className:"text-xl font-bold",children:"History"}),c.jsxs(ii,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[c.jsx("button",{onClick:o,className:"w-full py-2 rounded-lg bg-secondary hover:bg-primary hover:text-primary-foreground font-sans tracking-wider mb-2",children:c.jsxs("div",{className:"flex items-center justify-center gap-2",children:[c.jsx(Kn,{className:"w-4 h-4 inline"}),"Clear History"]})}),c.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:t.map((u,h)=>c.jsx(AT,{cmd:u,type:"history",onClick:()=>e(u),onFavAction:()=>i(u)},h))}),t.length===0&&c.jsx("div",{className:"w-full h-auto text-center italic tracking-wider",children:"The command history is empty."})]})]}),c.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[c.jsx("h2",{className:"text-xl font-bold",children:"Saved"}),c.jsxs(ii,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[c.jsx("button",{onClick:l,className:"w-full py-2 rounded-lg bg-secondary hover:bg-primary hover:text-primary-foreground font-sans tracking-wider mb-2",children:c.jsxs("div",{className:"flex items-center justify-center gap-2",children:[c.jsx(TS,{className:"w-4 h-4 inline"}),"Add New"]})}),c.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:r.map((u,h)=>c.jsx(AT,{cmd:u,type:"saved",onClick:()=>e(u),onFavAction:()=>s(u)},h))}),r.length===0&&c.jsxs("div",{className:"w-full h-auto text-center italic tracking-wider",children:["There are no saved commands. ",c.jsx("br",{}),"To save a command, click the star icon next to it."]})]})]})]})}function $ce({isOpen:e,closeSheet:t,toTermInput:n}){return c.jsxs(c.Fragment,{children:[c.jsx(Pce,{isOpen:e,closeSheet:t}),c.jsxs("div",{"data-state":e?"open":"closed",className:Y("absolute z-20 inset-y-0 w-full md:max-w-2xl","bg-background px-4 pt-6 shadow-lg border-l","data-[state=open]:pointer-events-auto data-[state=closed]:pointer-events-none","transition-all duration-300 ease-in-out",e?"right-0 opacity-100":"-right-full opacity-0"),children:[c.jsx(Oce,{closeSheet:t}),c.jsx(Ice,{toTermInput:n})]})]})}class vO{constructor(t,n){_l(this,"btnRef");_l(this,"containerElement");_l(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 Yl={ORANGE:"\x1B[1;38;5;202m",TS_STRONG:"\x1B[1;37m",TS_WEAK:"\x1B[2;37m",RESET:"\x1B[0m"},Bce={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"},Fce={background:"#222326",foreground:"#F8F8F8"},Ng={...Fce,...Bce},zce={black:"#FFFFFF",brightBlack:"#AAAAAA",red:"#AB0420",brightRed:"#CC0829",green:"#65A509",brightGreen:"#74BA0E",yellow:"#C8B60B",brightYellow:"#CC880B",blue:"#063EB5",brightBlue:"#0D4ACC",magenta:"#960D83",brightMagenta:"#770FBB",cyan:"#05A9CA",brightCyan:"#0E95CC",white:"#2F2F2F",brightWhite:"#0D0D0D"},Hce=["#FFFFFF","#00003E","#000058","#000072","#00008C","#0000A6","#003E00","#003E3E","#003E58","#003E72","#003E8C","#003EA6","#005800","#00583E","#005858","#005872","#00588C","#0058A6","#007200","#00723E","#007258","#007272","#00728C","#0072A6","#008C00","#008C3E","#008C58","#008C72","#008C8C","#008CA6","#00A600","#00A63E","#00A658","#00A672","#00A68C","#00A6A6","#3E0000","#3E003E","#3E0058","#3E0072","#3E008C","#3E00A6","#3E3E00","#A0A0A0","#131358","#131372","#13138C","#1313A6","#3E5800","#135813","#135858","#134272","#133B8C","#1338A6","#3E7200","#137213","#137242","#137272","#13638C","#135CA6","#3E8C00","#138C13","#138C3B","#138C63","#138C8C","#1381A6","#3EA600","#13A613","#13A638","#13A65C","#13A681","#13A6A6","#580000","#58003E","#580058","#580072","#58008C","#5800A6","#583E00","#581313","#581358","#421372","#3B138C","#3813A6","#585800","#585813","#787878","#1B1B72","#1B1B8C","#1B1BA6","#587200","#427213","#1B721B","#1B7272","#1B538C","#1B49A6","#588C00","#3B8C13","#1B8C1B","#1B8C53","#1B8C8C","#1B77A6","#58A600","#38A613","#1BA61B","#1BA649","#1BA677","#1BA6A6","#720000","#72003E","#720058","#720072","#72008C","#7200A6","#723E00","#721313","#721342","#721372","#64138C","#5C13A6","#725800","#724213","#721B1B","#721B72","#531B8C","#491BA6","#727200","#727213","#72721B","#505050","#23238C","#2323A6","#728C00","#638C13","#538C1B","#238C23","#238C8C","#2364A6","#72A601","#5CA613","#49A61B","#23A623","#23A664","#23A6A6","#8C0000","#8C003E","#8C0058","#8C0072","#8C008C","#8C00A6","#8C3E00","#8C1313","#8C133B","#8C1364","#8C138C","#8113A6","#8C5800","#8C3B13","#8C1B1B","#8C1B53","#8C1B8c","#781BA6","#8C7200","#8C6413","#8C531B","#8C2323","#8C238C","#6423A6","#8C8C00","#8C8C13","#8C8C1B","#8C8C23","#282828","#2B2BA6","#8CA600","#81A613","#77A61B","#64A623","#2BA62B","#2BA6A6","#A60000","#A6003E","#A60058","#A60072","#A6008C","#A600A6","#A63E00","#A61313","#A61338","#A6135C","#A61381","#A613A6","#A65800","#A63813","#A61B1B","#A61B49","#A61B78","#A61BA6","#A67200","#A65C13","#A6491B","#A62323","#A62364","#A623A6","#A68C00","#A68113","#A6781B","#A66423","#A62B2B","#A62BA6","#A6A600","#A6A613","#A6A61B","#A6A623","#A6A62B","#0D0D0D","#F7F7F7","#EDEDED","#E3E3E3","#D9D9D9","#CFCFCF","#C5C5C5","#BBBBBB","#B1B1B1","#A7A7A7","#9D9D9D","#939393","#898989","#7F7F7F","#757575","#6B6B6B","#616161","#575757","#4D4D4D","#434343","#393939","#2F2F2F","#252525","#1B1B1B","#111111"],Wce={background:"#F0F1F4",foreground:"#16171B"},Dg={...Wce,...zce,extendedAnsi:Hce},Uce=/[\x00-\x08\x0B-\x1A\x1C-\x1F\x7F]|(?:\x1B\[|\x9B)[\d;]+[@-K]/g,Vce=/\x1B[^m]*?m/g,NC=e=>e.replace(Uce,"").replace(Vce,""),qce=e=>/^{§[0-9a-f]{8}}/.test(e)?{ts:parseInt(e.slice(2,10),16),content:e.slice(11)}:{ts:null,content:e},xO=(e,t)=>t==="DISABLED"?Yl.RESET:new Date(e*1e3).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:t==="FORCE12H"?!0:t==="FORCE24H"?!1:window.txBrowserHour12})+Yl.RESET+" ",RT=e=>xO(Date.now(),e).replace(/\w/g,"-"),Gce=(e,t,n)=>{if(t&&n)return e;const r=/^(?<ts>\d{2}:\d{2}:\d{2}(?: [AP]M)? )?(?<tag>\[.{20}] )?(?<content>.*)?/,i=e.match(r);if(!i)return e;const{ts:s,tag:a,content:o}=i.groups??{};let l="";return t&&(l+=s??""),n&&(l+=a??""),l+(o??"").trimEnd()},Kce=async(e,t,n,r,i=null)=>{const s=e.split(/\r?\n/).map(a=>Gce(a,n,r)).join(`\r
`).replace(/(\r?\n)+$/,`\r
`);return eD(s,t,i)},MT=(e,t)=>{console.groupCollapsed("getNumFontVariantsLoaded:",t);const n=s=>s.toLowerCase().replace(/^["']|["']$/g,""),r=n(getComputedStyle(document.documentElement).getPropertyValue(e));if(!r)return console.error("No --font-mono value found"),0;console.log("--font-mono:",r);let i=0;for(const s of document.fonts){if(n(s.family)!==r)continue;const a=s.status==="loaded",o=a?"green":"red";console.log(`%c${s.status}:`,`color: ${o}`,s.unicodeRange),a&&i++}return console.log("Loaded:",i),console.groupEnd(),i},Yce=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]{3,}/,yO="\x1B[3m",Xce=e=>{if(Yce.test(e))return{markerData:{classes:"bg-warning text-warning-foreground",labelShort:"RTL",labelLong:"VIEW RIGHT-TO-LEFT TEXT",onClick:()=>{ze.warning({title:"Bidirectional Text Detected:",md:!0,msg:`Due to limitations, the terminal cannot display RTL text.
This is what the text is supposed to look like:

${NC(e)}`},{duration:7500})}}}},bO=e=>JSON.parse(e.replace(/\u037e/g,";").replace(/\\"/g,'"')),Jce=e=>{const t=NC(e),n=/^(?<bar>.)\s+TXADMIN\1 txaEvent "(?<arg0>\w+)" "(?<arg1>.*)"$/,r=t.match(n);if(!r||!r.groups)return;const{arg0:i,arg1:s}=r.groups,a=bO(s),o=`txaEvent "${i}" "${s}"`,l=`${yO}<broadcasting txAdmin:events:${i}>`;return{newLine:e.replace(o,l),markerData:{classes:"bg-info text-info-foreground",labelShort:"EVENT",labelLong:"VIEW EVENT",onClick:()=>{ze.info({title:`txAdmin:events:${i}:`,md:!0,msg:"```json\n"+JSON.stringify(a,null,2)+"\n```"},{duration:7500})}}}},Qce=e=>{const t=NC(e),n=/^(?<bar>.)\s+TXADMIN\1 txaInitialData "(?<arg0>.*)"$/,r=t.match(n);if(!r||!r.groups)return;console.log("getTermLineInitialData",r.groups);const{arg0:i}=r.groups,s=bO(i),a=`txaInitialData "${i}"`,o=`${yO}<txaInitialData>`;return{newLine:e.replace(a,o),markerData:{classes:"bg-info text-info-foreground",labelShort:"CMD",labelLong:"VIEW COMMAND",onClick:()=>{ze.info({title:"Initial Player Data:",md:!0,msg:"```json\n"+JSON.stringify(s,null,2)+"\n```"},{duration:7500})}}}},Zce=(e,t)=>{const n=e.registerMarker(-1),r=e.registerDecoration({layer:"top",marker:n});return r&&r.onRender(i=>{if(i.innerHTML)return;const s="rgba(255,255,255, 0.01)",a="rgba(255,255,255, 0.05)",o=document.createElement("button");o.className=Y("absolute right-0 px-1 py-0 text-2xs rounded overflow-hidden text-nowrap transition-all",t.classes),o.innerText=t.labelShort,o.onclick=t.onClick;const l=()=>{o.style.width=`calc(${o.innerText.length+1}ch + 0.5rem)`};o.onmouseenter=()=>{o.innerText=t.labelLong,l(),i.style.backgroundColor=a},o.onmouseleave=()=>{o.innerText=t.labelShort,l(),i.style.backgroundColor=s},l(),i.classList.add("rounded"),i.style.backgroundColor=s,i.style.width="100%",i.replaceChildren(o)}),!!r},Tp="123456789ABCDEFGHJKLMNPQRSTUVWXYZ",jT=/^\d{17,20}$/,Tr={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}$/},validIdentifierParts:{discord:jT,fivem:/^\d{1,8}$/,license:/^[0-9A-Fa-f]{40}$/,license2:/^[0-9A-Fa-f]{40}$/,live:/^\d{14,20}$/,steam:/^1100001[0-9A-Fa-f]{8}$/,xbl:/^\d{14,20}$/},adminPasswordMinLength:6,adminPasswordMaxLength:128,regexValidFivemUsername:/^\w[\w.-]{1,18}\w$/,regexActionID:new RegExp(`^[${Tp}]{4}-[${Tp}]{4}$`),regexWhitelistReqID:new RegExp(`R[${Tp}]{4}`),regexDiscordSnowflake:jT,regexSvLicenseOld:/^\w{32}$/,regexSvLicenseNew:/^cfxk_\w{1,60}_\w{1,20}$/,regexValidIP:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,actionIdAlphabet:Tp,nuiWebpipePath:"https://monitor/WebPipe/",regexCustomThemeName:/^[a-z0-9]+(-[a-z0-9]+)*$/,cookies:{theme:"txa:theme",session:"txa:sess"}},Wd=window.document.documentElement,_O=window.txConsts.customThemes.map(e=>e.name),eue=window.txConsts.customThemes.map(e=>`theme-${e.name}`),DC=["dark","light"],wO=_O.find(e=>Wd.classList.contains(`theme-${e}`))??DC.find(e=>Wd.classList.contains(e))??window.txConsts.defaultTheme,SO=e=>{document.cookie=`${Tr.cookies.theme}=${e};path=/;SameSite=Lax;max-age=31536000;`},CO=e=>{if(DC.includes(e))return{isInvalid:!1,isDefault:!0,isDarkScheme:e==="dark",lightDarkClass:e,customClass:void 0};if(_O.includes(e)){const t=window.txConsts.customThemes.find(n=>n.name===e);if(t){const n=t.isDark;return{isInvalid:!1,isDefault:!1,isDarkScheme:n,lightDarkClass:n?"dark":"light",customClass:`theme-${e}`}}}return console.warn(`Could not find theme'${e}', defaulting to dark.`),{isInvalid:!0,isDefault:!1,isDarkScheme:!0,lightDarkClass:"dark",customClass:void 0}},LC=Ze(wO),kO=Ze(e=>{const t=e(LC);return CO(t).isDarkScheme});SO(wO);const W_=(e,t)=>{var l,u;const{isInvalid:n,isDefault:r,isDarkScheme:i,lightDarkClass:s,customClass:a}=CO(t);if(n)throw new Error(`invalid theme ${t}`);Wd.classList.remove(...DC,...eue),Wd.classList.add(s),a&&Wd.classList.add(a);const o=(u=(l=document.getElementById("legacyPageIframe"))==null?void 0:l.contentDocument)==null?void 0:u.body;o&&(i?o.classList.add("theme--dark"):o.classList.remove("theme--dark")),SO(t),console.log(`Changed theme from '${e}' to '${t}'.`)},EO=()=>{const[e,t]=sr(LC);return{theme:e,setTheme:r=>{r!==e&&(W_(e,r),t(r))}}},tue=()=>{const e=rt(LC);return()=>e(t=>t==="dark"?(W_(t,"light"),"light"):t==="light"?(W_(t,"dark"),"dark"):(console.log("invalid theme",t),t))},cu=()=>nt(kO),nue=e=>{const t=nt(kO);if(typeof e=="string")return e.replace(/{theme}/g,t?"dark":"light")},qu=150;function rue(){const[e,t]=w.useState(!1),[n,r]=w.useState(!1),[i,s]=w.useState(!1),{options:a,updateOptions:o}=Jse(),l=w.useRef({...a}),u=w.useRef(null),h=w.useRef({ts:0,lastEol:!0,prefix:RT(l.current.timestamp)}),d=of(),f=cu();w.useEffect(()=>{l.current={...a}},[a]);const g=w.useRef(null),b=w.useRef(null),x=w.useMemo(()=>new q8.Terminal({...nP,...a,theme:f?Ng:Dg}),[]),v=w.useMemo(()=>new J8.FitAddon,[]),m=w.useMemo(()=>new Z8.SearchAddon,[]),p=(N,O)=>{nu(O)},y=w.useMemo(()=>new tP.WebLinksAddon(p),[]),_=Un(qu,N=>{window.postMessage({type:"liveConsoleSearchHotkey",action:N})},{noTrailing:!0}),C=()=>{if(!b.current||!x.element||!v){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const N=v.proposeDimensions();N?x.resize(N.cols,N.rows):console.log("refitTerminal: no proposed dimensions")};Ei("resize",hS(100,C)),w.useEffect(()=>{if(x.element){const N=lC[a.density];Object.assign(x.options,{theme:f?Ng:Dg,scrollback:a.scrollback,fontSize:N.fontSize,lineHeight:N.lineHeight,letterSpacing:N.letterSpacing}),C(),x.refresh(0,x.rows-1)}},[x,f,a]),w.useEffect(()=>{if(b.current&&g.current&&!x.element){console.log("Live Console xterm.js init"),b.current.innerHTML="",x.loadAddon(v),x.loadAddon(m),x.loadAddon(y),x.loadAddon(new Y8.CanvasAddon),x.loadAddon(new vO(g.current,b.current)),x.open(b.current),x.write("\x1B[?25l"),C();const N=Un(qu,()=>{x.scrollLines(Math.min(1,2-x.rows))},{noTrailing:!0}),O=Un(qu,()=>{x.scrollLines(Math.max(1,x.rows-2))},{noTrailing:!0}),B=Un(qu,()=>{x.scrollToTop()},{noTrailing:!0}),z=Un(qu,()=>{x.scrollToBottom()},{noTrailing:!0});x.attachCustomKeyEventHandler(P=>{if(P.code==="F5"&&!P.ctrlKey)return!1;if(P.code==="Escape")return!1;if(P.code==="KeyF"&&(P.ctrlKey||P.metaKey))return!1;if(P.code==="F3")return!1;if(P.code==="KeyC"&&(P.ctrlKey||P.metaKey)){const j=x.getSelection();return j&&(Kce(j,x.element,l.current.copyTimestamp,l.current.copyChannel,u.current).then(R=>{R===!1&&ze.error("Failed to copy to clipboard :(")}).catch(R=>{ze.error({title:"Failed to copy to clipboard:",msg:R.message})}),x.clearSelection()),!1}else{if(P.code==="PageUp")return N(),!1;if(P.code==="PageDown")return O(),!1;if(P.code==="Home")return B(),!1;if(P.code==="End")return z(),!1;if(aC(P))return!1}return!0})}},[x]),Ei("keydown",N=>{N.code==="F5"&&!N.ctrlKey?n&&(d(),N.preventDefault()):N.code==="Escape"?(m.clearDecorations(),s(!1)):N.code==="KeyF"&&(N.ctrlKey||N.metaKey)?(i?_("focus"):s(!0),N.preventDefault()):N.code==="F3"&&(_(N.shiftKey?"previous":"next"),N.preventDefault())});const S=N=>{const O=N.split(/\r?\n/);let B=!1;O.length&&!O[O.length-1]&&(O.pop(),B=!0);let z=!1;for(let P=0;P<O.length;P++){z=!1;let j=O[P];try{const{ts:G,content:Z}=qce(j);G&&(z=!0,j=Z,h.current.ts=G,h.current.prefix=xO(G,l.current.timestamp))}catch(G){h.current.prefix=RT(l.current.timestamp),console.warn("Failed to parse timestamp from:",j,G.message)}let R;try{const G=Jce(j)??Qce(j)??Xce(j);G&&G.markerData&&(R=()=>Zce(x,G.markerData)),G&&G.newLine&&(j=G.newLine)}catch(G){console.error("Failed to process marker:",G.message)}const I=z?Yl.TS_STRONG:Yl.TS_WEAK,F=(h.current.lastEol?I+h.current.prefix:"")+j;P<O.length-1||B?(x.writeln(F,R),h.current.lastEol=!0):(x.write(F,R),h.current.lastEol=!1)}},E=w.useRef(0),k=w.useRef(null);w.useEffect(()=>(k.current=iS(["liveconsole"]),k.current.on("connect",()=>{console.log("LiveConsole Socket.IO Connected."),r(!0)}),k.current.on("disconnect",N=>{console.log("LiveConsole Socket.IO Disonnected:",N);const O=E.current+1;E.current=O,setTimeout(()=>{E.current===O&&r(!1)},500)}),k.current.on("error",N=>{console.log("LiveConsole Socket.IO",N)}),k.current.on("consoleData",function(N){S(N)}),()=>{var N,O;(N=k.current)==null||N.removeAllListeners(),(O=k.current)==null||O.disconnect()}),[]),w.useEffect(()=>{if(MT("--font-mono","INITIAL EFFECT"))return;const N=()=>{MT("--font-mono","ON FONT LOADING DONE"),d()};return document.fonts.addEventListener("loadingdone",N),()=>{document.fonts.removeEventListener("loadingdone",N)}},[]);const T=N=>{!n||!k.current||((N==="cls"||N==="clear")&&A(),N===`
`?x.write(`
`):k.current.emit("consoleCommand",N))},A=()=>{x.clear(),m.clearDecorations(),s(!1),x.write(`${Yl.ORANGE}[console cleared]${Yl.RESET}
`)},M=()=>{s(!i)},D=()=>{t(!e)},L=N=>{u.current&&(u.current.value=N,u.current.focus()),t(!1)};return c.jsxs("div",{className:"text-primary flex flex-col h-contentvh w-full bg-card border md:rounded-xl overflow-clip",children:[c.jsx(Dce,{options:a,setOptions:o}),c.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[n?null:c.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[c.jsx(qt,{className:"w-16 h-16 animate-spin"}),c.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Connecting..."})]})}),c.jsx($ce,{isOpen:e,closeSheet:()=>t(!1),toTermInput:N=>L(N)}),c.jsx("div",{ref:b,className:"absolute top-1 left-2 right-0 bottom-0"}),c.jsx(gO,{show:i,setShow:s,searchAddon:m}),c.jsx("button",{ref:g,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{x.scrollToBottom()},children:c.jsx(qD,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]}),c.jsx(Zse,{termInputRef:u,isConnected:n,consoleWrite:T,consoleClear:A,toggleSaveSheet:D,toggleSearchBar:M})]})}const iue=e=>1- --e*e*e*e,NT=1e3/60,Ap=({countTo:e,duration:t=1250})=>{const[n,r]=w.useState(0);return w.useEffect(()=>{let i=0;const s=Math.round(t/NT),a=setInterval(()=>{i++;const o=iue(i/s);r(e*o),i===s&&clearInterval(a)},NT)},[]),Math.floor(n).toLocaleString("en-US")};function Rp(){return c.jsx("div",{className:"h-7 w-28 animate-pulse rounded-md bg-muted"})}function TO({callouts:e}){return e.length!==4?null:c.jsxs("div",{className:"grid px-2 md:px-0 gap-2 xs:gap-4 grid-cols-2 lg:grid-cols-4 mb-4 md:mb-6",children:[c.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[c.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[c.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[0].label}),c.jsx("div",{className:"hidden xs:block",children:e[0].icon})]}),e[0].value===!1?c.jsx(Rp,{}):c.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[0].prefix,c.jsx(Ap,{countTo:e[0].value})]})]}),c.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[c.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[c.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[1].label}),c.jsx("div",{className:"hidden xs:block",children:e[1].icon})]}),e[1].value===!1?c.jsx(Rp,{}):c.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[1].prefix,c.jsx(Ap,{countTo:e[1].value})]})]}),c.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[c.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[c.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[2].label}),c.jsx("div",{className:"hidden xs:block",children:e[2].icon})]}),e[2].value===!1?c.jsx(Rp,{}):c.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[2].prefix,c.jsx(Ap,{countTo:e[2].value})]})]}),c.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[c.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[c.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[3].label}),c.jsx("div",{className:"hidden xs:block",children:e[3].icon})]}),e[3].value===!1?c.jsx(Rp,{}):c.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[3].prefix,c.jsx(Ap,{countTo:e[3].value})]})]})]})}var my="rovingFocusGroup.onEntryFocus",sue={bubbles:!1,cancelable:!0},E0="RovingFocusGroup",[U_,AO,oue]=yf(E0),[aue,uu]=Cn(E0,[oue]),[lue,cue]=aue(E0),RO=w.forwardRef((e,t)=>c.jsx(U_.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(U_.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(uue,{...e,ref:t})})}));RO.displayName=E0;var uue=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...d}=e,f=w.useRef(null),g=Le(t,f),b=Ja(s),[x=null,v]=Pr({prop:a,defaultProp:o,onChange:l}),[m,p]=w.useState(!1),y=xt(u),_=AO(n),C=w.useRef(!1),[S,E]=w.useState(0);return w.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(my,y),()=>k.removeEventListener(my,y)},[y]),c.jsx(lue,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:x,onItemFocus:w.useCallback(k=>v(k),[v]),onItemShiftTab:w.useCallback(()=>p(!0),[]),onFocusableItemAdd:w.useCallback(()=>E(k=>k+1),[]),onFocusableItemRemove:w.useCallback(()=>E(k=>k-1),[]),children:c.jsx(Ce.div,{tabIndex:m||S===0?-1:0,"data-orientation":r,...d,ref:g,style:{outline:"none",...e.style},onMouseDown:ae(e.onMouseDown,()=>{C.current=!0}),onFocus:ae(e.onFocus,k=>{const T=!C.current;if(k.target===k.currentTarget&&T&&!m){const A=new CustomEvent(my,sue);if(k.currentTarget.dispatchEvent(A),!A.defaultPrevented){const M=_().filter(B=>B.focusable),D=M.find(B=>B.active),L=M.find(B=>B.id===x),O=[D,L,...M].filter(Boolean).map(B=>B.ref.current);NO(O,h)}}C.current=!1}),onBlur:ae(e.onBlur,()=>p(!1))})})}),MO="RovingFocusGroupItem",jO=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...a}=e,o=yr(),l=s||o,u=cue(MO,n),h=u.currentTabStopId===l,d=AO(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=u;return w.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),c.jsx(U_.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:c.jsx(Ce.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:ae(e.onMouseDown,b=>{r?u.onItemFocus(l):b.preventDefault()}),onFocus:ae(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:ae(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=fue(b,u.orientation,u.dir);if(x!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let m=d().filter(p=>p.focusable).map(p=>p.ref.current);if(x==="last")m.reverse();else if(x==="prev"||x==="next"){x==="prev"&&m.reverse();const p=m.indexOf(b.currentTarget);m=u.loop?pue(m,p+1):m.slice(p+1)}setTimeout(()=>NO(m))}})})})});jO.displayName=MO;var due={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hue(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function fue(e,t,n){const r=hue(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return due[r]}function NO(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function pue(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var PC=RO,OC=jO,V_=["Enter"," "],mue=["ArrowDown","PageUp","Home"],DO=["ArrowUp","PageDown","End"],gue=[...mue,...DO],vue={ltr:[...V_,"ArrowRight"],rtl:[...V_,"ArrowLeft"]},xue={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wf="Menu",[Sh,yue,bue]=yf(wf),[il,LO]=Cn(wf,[bue,au,uu]),T0=au(),PO=uu(),[_ue,sl]=il(wf),[wue,Sf]=il(wf),OO=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:a=!0}=e,o=T0(t),[l,u]=w.useState(null),h=w.useRef(!1),d=xt(s),f=Ja(i);return w.useEffect(()=>{const g=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),c.jsx(CC,{...o,children:c.jsx(_ue,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:c.jsx(wue,{scope:t,onClose:w.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:f,modal:a,children:r})})})};OO.displayName=wf;var Sue="MenuAnchor",IC=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=T0(n);return c.jsx(kC,{...i,...r,ref:t})});IC.displayName=Sue;var $C="MenuPortal",[Cue,IO]=il($C,{forceMount:void 0}),$O=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=sl($C,t);return c.jsx(Cue,{scope:t,forceMount:n,children:c.jsx(on,{present:n||s.open,children:c.jsx(v0,{asChild:!0,container:i,children:r})})})};$O.displayName=$C;var Zr="MenuContent",[kue,BC]=il(Zr),BO=w.forwardRef((e,t)=>{const n=IO(Zr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=sl(Zr,e.__scopeMenu),a=Sf(Zr,e.__scopeMenu);return c.jsx(Sh.Provider,{scope:e.__scopeMenu,children:c.jsx(on,{present:r||s.open,children:c.jsx(Sh.Slot,{scope:e.__scopeMenu,children:a.modal?c.jsx(Eue,{...i,ref:t}):c.jsx(Tue,{...i,ref:t})})})})}),Eue=w.forwardRef((e,t)=>{const n=sl(Zr,e.__scopeMenu),r=w.useRef(null),i=Le(t,r);return w.useEffect(()=>{const s=r.current;if(s)return p0(s)},[]),c.jsx(FC,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ae(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Tue=w.forwardRef((e,t)=>{const n=sl(Zr,e.__scopeMenu);return c.jsx(FC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),FC=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:f,onDismiss:g,disableOutsideScroll:b,...x}=e,v=sl(Zr,n),m=Sf(Zr,n),p=T0(n),y=PO(n),_=yue(n),[C,S]=w.useState(null),E=w.useRef(null),k=Le(t,E,v.onContentChange),T=w.useRef(0),A=w.useRef(""),M=w.useRef(0),D=w.useRef(null),L=w.useRef("right"),N=w.useRef(0),O=b?vf:w.Fragment,B=b?{as:Po,allowPinchZoom:!0}:void 0,z=j=>{var W,$;const R=A.current+j,I=_().filter(V=>!V.disabled),H=document.activeElement,F=(W=I.find(V=>V.ref.current===H))==null?void 0:W.textValue,G=I.map(V=>V.textValue),Z=Bue(G,R,F),J=($=I.find(V=>V.textValue===Z))==null?void 0:$.ref.current;(function V(U){A.current=U,window.clearTimeout(T.current),U!==""&&(T.current=window.setTimeout(()=>V(""),1e3))})(R),J&&setTimeout(()=>J.focus())};w.useEffect(()=>()=>window.clearTimeout(T.current),[]),u0();const P=w.useCallback(j=>{var I,H;return L.current===((I=D.current)==null?void 0:I.side)&&zue(j,(H=D.current)==null?void 0:H.area)},[]);return c.jsx(kue,{scope:n,searchRef:A,onItemEnter:w.useCallback(j=>{P(j)&&j.preventDefault()},[P]),onItemLeave:w.useCallback(j=>{var R;P(j)||((R=E.current)==null||R.focus(),S(null))},[P]),onTriggerLeave:w.useCallback(j=>{P(j)&&j.preventDefault()},[P]),pointerGraceTimerRef:M,onPointerGraceIntentChange:w.useCallback(j=>{D.current=j},[]),children:c.jsx(O,{...B,children:c.jsx(g0,{asChild:!0,trapped:i,onMountAutoFocus:ae(s,j=>{var R;j.preventDefault(),(R=E.current)==null||R.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:c.jsx(ou,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:f,onDismiss:g,children:c.jsx(PC,{asChild:!0,...y,dir:m.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:S,onEntryFocus:ae(l,j=>{m.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(EC,{role:"menu","aria-orientation":"vertical","data-state":tI(v.open),"data-radix-menu-content":"",dir:m.dir,...p,...x,ref:k,style:{outline:"none",...x.style},onKeyDown:ae(x.onKeyDown,j=>{const I=j.target.closest("[data-radix-menu-content]")===j.currentTarget,H=j.ctrlKey||j.altKey||j.metaKey,F=j.key.length===1;I&&(j.key==="Tab"&&j.preventDefault(),!H&&F&&z(j.key));const G=E.current;if(j.target!==G||!gue.includes(j.key))return;j.preventDefault();const J=_().filter(W=>!W.disabled).map(W=>W.ref.current);DO.includes(j.key)&&J.reverse(),Iue(J)}),onBlur:ae(e.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(T.current),A.current="")}),onPointerMove:ae(e.onPointerMove,Ch(j=>{const R=j.target,I=N.current!==j.clientX;if(j.currentTarget.contains(R)&&I){const H=j.clientX>N.current?"right":"left";L.current=H,N.current=j.clientX}}))})})})})})})});BO.displayName=Zr;var Aue="MenuGroup",zC=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ce.div,{role:"group",...r,ref:t})});zC.displayName=Aue;var Rue="MenuLabel",FO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ce.div,{...r,ref:t})});FO.displayName=Rue;var Lg="MenuItem",DT="menu.itemSelect",A0=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=w.useRef(null),a=Sf(Lg,e.__scopeMenu),o=BC(Lg,e.__scopeMenu),l=Le(t,s),u=w.useRef(!1),h=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(DT,{bubbles:!0,cancelable:!0});d.addEventListener(DT,g=>r==null?void 0:r(g),{once:!0}),og(d,f),f.defaultPrevented?u.current=!1:a.onClose()}};return c.jsx(zO,{...i,ref:l,disabled:n,onClick:ae(e.onClick,h),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),u.current=!0},onPointerUp:ae(e.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:ae(e.onKeyDown,d=>{const f=o.searchRef.current!=="";n||f&&d.key===" "||V_.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});A0.displayName=Lg;var zO=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,a=BC(Lg,n),o=PO(n),l=w.useRef(null),u=Le(t,l),[h,d]=w.useState(!1),[f,g]=w.useState("");return w.useEffect(()=>{const b=l.current;b&&g((b.textContent??"").trim())},[s.children]),c.jsx(Sh.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:c.jsx(OC,{asChild:!0,...o,focusable:!r,children:c.jsx(Ce.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:ae(e.onPointerMove,Ch(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ae(e.onPointerLeave,Ch(b=>a.onItemLeave(b))),onFocus:ae(e.onFocus,()=>d(!0)),onBlur:ae(e.onBlur,()=>d(!1))})})})}),Mue="MenuCheckboxItem",HO=w.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return c.jsx(GO,{scope:e.__scopeMenu,checked:n,children:c.jsx(A0,{role:"menuitemcheckbox","aria-checked":Pg(n)?"mixed":n,...i,ref:t,"data-state":WC(n),onSelect:ae(i.onSelect,()=>r==null?void 0:r(Pg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});HO.displayName=Mue;var WO="MenuRadioGroup",[jue,Nue]=il(WO,{value:void 0,onValueChange:()=>{}}),UO=w.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=xt(r);return c.jsx(jue,{scope:e.__scopeMenu,value:n,onValueChange:s,children:c.jsx(zC,{...i,ref:t})})});UO.displayName=WO;var VO="MenuRadioItem",qO=w.forwardRef((e,t)=>{const{value:n,...r}=e,i=Nue(VO,e.__scopeMenu),s=n===i.value;return c.jsx(GO,{scope:e.__scopeMenu,checked:s,children:c.jsx(A0,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":WC(s),onSelect:ae(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});qO.displayName=VO;var HC="MenuItemIndicator",[GO,Due]=il(HC,{checked:!1}),KO=w.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=Due(HC,n);return c.jsx(on,{present:r||Pg(s.checked)||s.checked===!0,children:c.jsx(Ce.span,{...i,ref:t,"data-state":WC(s.checked)})})});KO.displayName=HC;var Lue="MenuSeparator",YO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ce.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});YO.displayName=Lue;var Pue="MenuArrow",XO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=T0(n);return c.jsx(TC,{...i,...r,ref:t})});XO.displayName=Pue;var Oue="MenuSub",[YIe,JO]=il(Oue),xd="MenuSubTrigger",QO=w.forwardRef((e,t)=>{const n=sl(xd,e.__scopeMenu),r=Sf(xd,e.__scopeMenu),i=JO(xd,e.__scopeMenu),s=BC(xd,e.__scopeMenu),a=w.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},h=w.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return w.useEffect(()=>h,[h]),w.useEffect(()=>{const d=o.current;return()=>{window.clearTimeout(d),l(null)}},[o,l]),c.jsx(IC,{asChild:!0,...u,children:c.jsx(zO,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":tI(n.open),...e,ref:Qc(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ae(e.onPointerMove,Ch(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:ae(e.onPointerLeave,Ch(d=>{var g,b;h();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const x=(b=n.content)==null?void 0:b.dataset.side,v=x==="right",m=v?-5:5,p=f[v?"left":"right"],y=f[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x:p,y:f.top},{x:y,y:f.top},{x:y,y:f.bottom},{x:p,y:f.bottom}],side:x}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ae(e.onKeyDown,d=>{var g;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||vue[r.dir].includes(d.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),d.preventDefault())})})})});QO.displayName=xd;var ZO="MenuSubContent",eI=w.forwardRef((e,t)=>{const n=IO(Zr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=sl(Zr,e.__scopeMenu),a=Sf(Zr,e.__scopeMenu),o=JO(ZO,e.__scopeMenu),l=w.useRef(null),u=Le(t,l);return c.jsx(Sh.Provider,{scope:e.__scopeMenu,children:c.jsx(on,{present:r||s.open,children:c.jsx(Sh.Slot,{scope:e.__scopeMenu,children:c.jsx(FC,{id:o.contentId,"aria-labelledby":o.triggerId,...i,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:ae(e.onFocusOutside,h=>{h.target!==o.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ae(e.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:ae(e.onKeyDown,h=>{var g;const d=h.currentTarget.contains(h.target),f=xue[a.dir].includes(h.key);d&&f&&(s.onOpenChange(!1),(g=o.trigger)==null||g.focus(),h.preventDefault())})})})})})});eI.displayName=ZO;function tI(e){return e?"open":"closed"}function Pg(e){return e==="indeterminate"}function WC(e){return Pg(e)?"indeterminate":e?"checked":"unchecked"}function Iue(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $ue(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Bue(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=$ue(e,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Fue(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const o=t[s].x,l=t[s].y,u=t[a].x,h=t[a].y;l>r!=h>r&&n<(u-o)*(r-l)/(h-l)+o&&(i=!i)}return i}function zue(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Fue(n,t)}function Ch(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Hue=OO,Wue=IC,Uue=$O,Vue=BO,que=zC,Gue=FO,Kue=A0,Yue=HO,Xue=UO,Jue=qO,Que=KO,Zue=YO,ede=XO,tde=QO,nde=eI,UC="DropdownMenu",[rde,XIe]=Cn(UC,[LO]),lr=LO(),[ide,nI]=rde(UC),rI=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=lr(t),u=w.useRef(null),[h=!1,d]=Pr({prop:i,defaultProp:s,onChange:a});return c.jsx(ide,{scope:t,triggerId:yr(),triggerRef:u,contentId:yr(),open:h,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(f=>!f),[d]),modal:o,children:c.jsx(Hue,{...l,open:h,onOpenChange:d,dir:r,modal:o,children:n})})};rI.displayName=UC;var iI="DropdownMenuTrigger",sI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=nI(iI,n),a=lr(n);return c.jsx(Wue,{asChild:!0,...a,children:c.jsx(Ce.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Qc(t,s.triggerRef),onPointerDown:ae(e.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(s.onOpenToggle(),s.open||o.preventDefault())}),onKeyDown:ae(e.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&s.onOpenToggle(),o.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});sI.displayName=iI;var sde="DropdownMenuPortal",oI=e=>{const{__scopeDropdownMenu:t,...n}=e,r=lr(t);return c.jsx(Uue,{...r,...n})};oI.displayName=sde;var aI="DropdownMenuContent",lI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=nI(aI,n),s=lr(n),a=w.useRef(!1);return c.jsx(Vue,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:ae(e.onCloseAutoFocus,o=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:ae(e.onInteractOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,h=l.button===2||u;(!i.modal||h)&&(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)"}})});lI.displayName=aI;var ode="DropdownMenuGroup",ade=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(que,{...i,...r,ref:t})});ade.displayName=ode;var lde="DropdownMenuLabel",cI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(Gue,{...i,...r,ref:t})});cI.displayName=lde;var cde="DropdownMenuItem",uI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(Kue,{...i,...r,ref:t})});uI.displayName=cde;var ude="DropdownMenuCheckboxItem",dI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(Yue,{...i,...r,ref:t})});dI.displayName=ude;var dde="DropdownMenuRadioGroup",hI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(Xue,{...i,...r,ref:t})});hI.displayName=dde;var hde="DropdownMenuRadioItem",fI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(Jue,{...i,...r,ref:t})});fI.displayName=hde;var fde="DropdownMenuItemIndicator",pI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(Que,{...i,...r,ref:t})});pI.displayName=fde;var pde="DropdownMenuSeparator",mI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(Zue,{...i,...r,ref:t})});mI.displayName=pde;var mde="DropdownMenuArrow",gde=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(ede,{...i,...r,ref:t})});gde.displayName=mde;var vde="DropdownMenuSubTrigger",gI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(tde,{...i,...r,ref:t})});gI.displayName=vde;var xde="DropdownMenuSubContent",vI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=lr(n);return c.jsx(nde,{...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)"}})});vI.displayName=xde;var yde=rI,bde=sI,_de=oI,xI=lI,yI=cI,bI=uI,_I=dI,wde=hI,wI=fI,SI=pI,CI=mI,kI=gI,EI=vI;const cc=yde,uc=bde,TI=wde,Sde=w.forwardRef(({className:e,inset:t,children:n,...r},i)=>c.jsxs(kI,{ref:i,className:Y("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,c.jsx(SS,{className:"ml-auto"})]}));Sde.displayName=kI.displayName;const Cde=w.forwardRef(({className:e,...t},n)=>c.jsx(EI,{ref:n,className:Y("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}));Cde.displayName=EI.displayName;const Ca=w.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(_de,{children:c.jsx(xI,{ref:r,sideOffset:t,className:Y("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})}));Ca.displayName=xI.displayName;const Vi=w.forwardRef(({className:e,inset:t,...n},r)=>c.jsx(bI,{ref:r,className:Y("relative flex cursor-default select-none items-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));Vi.displayName=bI.displayName;const q_=w.forwardRef(({className:e,children:t,checked:n,...r},i)=>c.jsxs(_I,{ref:i,className:Y("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:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(SI,{children:c.jsx(wS,{className:"h-4 w-4"})})}),t]}));q_.displayName=_I.displayName;const VC=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(wI,{ref:r,className:Y("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:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(SI,{children:c.jsx(GD,{className:"h-2 w-2 fill-current"})})}),t]}));VC.displayName=wI.displayName;const Og=w.forwardRef(({className:e,inset:t,...n},r)=>c.jsx(yI,{ref:r,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Og.displayName=yI.displayName;const ga=w.forwardRef(({className:e,...t},n)=>c.jsx(CI,{ref:n,className:Y("-mx-1 my-1 h-px bg-muted",e),...t}));ga.displayName=CI.displayName;const kh=[{value:"playerName",label:"Name",placeholder:"Enter a player name",description:"Search players by their last display name."},{value:"playerNotes",label:"Notes",placeholder:"Enter part of the note to search for",description:"Search players by their profile notes contents."},{value:"playerIds",label:"Player IDs",placeholder:"License, Discord, Steam, etc.",description:"Search players by their IDs separated by a comma."}],AI=[{label:"Is Admin",value:"isAdmin"},{label:"Is Online",value:"isOnline"},{label:"Has Whitelisted ID",value:"isWhitelisted"},{label:"Has Profile Notes",value:"hasNote"}],Mp=Un(1250,e=>{e()},{noLeading:!0});function kde({doSearch:e,initialState:t}){const n=w.useRef(null),[r,i]=w.useState(!1),[s,a]=w.useState(!1),[o,l]=w.useState(t.search.type),[u,h]=w.useState(t.filters),[d,f]=w.useState(!!t.search.value),[g,b]=w.useState(t.rememberSearchType),x=()=>{if(!n.current)return;const C=n.current.value.trim();e({value:C,type:o},u,g)};w.useEffect(()=>{x()},[o,u]);const v=C=>{C.key==="Enter"?(Mp.cancel({upcomingOnly:!0}),x()):C.key==="Escape"?(n.current.value="",Mp(x),f(!1)):(Mp(x),f(!0))},m=()=>{n.current.value="",Mp.cancel({upcomingOnly:!0}),x(),f(!1)},p=(C,S)=>{h(S?E=>[...E,C]:E=>E.filter(k=>k!==C))};Ei("keydown",C=>{var S;C.code==="KeyF"&&(C.ctrlKey||C.metaKey)&&((S=n.current)==null||S.focus(),C.preventDefault())});const y=kh.find(C=>C.value===o);if(!y)throw new Error(`Invalid search type: ${o}`);const _=u.length?`${u.length} Filter${u.length>1?"s":""}`:"No filters";return c.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[c.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[c.jsxs("div",{className:"relative min-w-44 grow",children:[c.jsx(yt,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:n,placeholder:y.placeholder,defaultValue:t.search.value,onKeyDown:v}),d?c.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:m,children:c.jsx(Kn,{})}):c.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:c.jsx(Be,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),c.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[c.jsxs(cc,{children:[c.jsx(uc,{asChild:!0,children:c.jsxs(Re,{variant:"outline",role:"combobox","aria-expanded":r,onClick:()=>i(!r),className:"xs:w-48 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:["Search by ",y.label,c.jsx(n_,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),c.jsxs(Ca,{className:"w-48",children:[c.jsx(Og,{children:"Search Type"}),c.jsx(ga,{}),c.jsx(TI,{value:o,onValueChange:l,children:kh.map(C=>c.jsx(VC,{value:C.value,className:"cursor-pointer",children:C.label},C.value))}),c.jsx(ga,{}),c.jsx(q_,{checked:g,className:"cursor-pointer",onCheckedChange:b,children:"Remember Option"})]})]}),c.jsxs(cc,{children:[c.jsx(uc,{asChild:!0,children:c.jsxs(Re,{variant:"outline",role:"combobox","aria-expanded":s,onClick:()=>a(!s),className:"xs:w-44 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:[_,c.jsx(n_,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),c.jsxs(Ca,{className:"w-44",children:[c.jsx(Og,{children:"Search Filters"}),c.jsx(ga,{}),AI.map(C=>c.jsx(q_,{checked:u.includes(C.value),className:"cursor-pointer",onCheckedChange:S=>{p(C.value,S)},children:C.label},C.value)),c.jsx(ga,{}),c.jsxs(Vi,{className:"cursor-pointer",onClick:()=>h([]),children:[c.jsx(CX,{className:"mr-2 h-4 w-4"}),"Clear Filters"]})]})]}),c.jsx("div",{className:"flex justify-end flex-grow",children:c.jsxs(cc,{children:[c.jsx(uc,{asChild:!0,children:c.jsxs(Re,{variant:"outline",className:"grow md:grow-0",children:["More",c.jsx(Za,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),c.jsxs(Ca,{children:[c.jsx(Vi,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:c.jsxs(Ti,{href:"/ban-identifiers",className:"cursor-pointer",children:[c.jsx(La,{className:"inline mr-1 h-4"}),"Ban Identifiers"]})}),c.jsx(Vi,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:c.jsxs(Ti,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[c.jsx(La,{className:"inline mr-1 h-4"}),"Prune Players/HWIDs"]})})]})]})})]})]}),c.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:y.description})]})}function Al(e,t,n){let r=n.initialDeps??[],i;return()=>{var s,a,o,l;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());const h=e();if(!(h.length!==r.length||h.some((g,b)=>r[b]!==g)))return i;r=h;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),i=t(...h),n.key&&((o=n.debug)!=null&&o.call(n))){const g=Math.round((Date.now()-u)*100)/100,b=Math.round((Date.now()-f)*100)/100,x=b/16,v=(m,p)=>{for(m=String(m);m.length<p;)m=" "+m;return m};console.info(`%c⏱ ${v(b,5)} /${v(g,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,i),i}}function gy(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Ede=(e,t)=>Math.abs(e-t)<1,Tde=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Ade=e=>e,Rde=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},Mde=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:o,height:l}=a;t({width:Math.round(o),height:Math.round(l)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(a=>{const o=a[0];if(o!=null&&o.borderBoxSize){const l=o.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(n.getBoundingClientRect())});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},LT={passive:!0},jde=typeof window>"u"?!0:"onscrollend"in window,Nde=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const s=e.options.useScrollendEvent&&jde?()=>{}:Tde(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=u=>()=>{const{horizontal:h,isRtl:d}=e.options;i=h?n.scrollLeft*(d&&-1||1):n.scrollTop,s(),t(i,u)},o=a(!0),l=a(!1);return l(),n.addEventListener("scroll",o,LT),n.addEventListener("scrollend",l,LT),()=>{n.removeEventListener("scroll",o),n.removeEventListener("scrollend",l)}},Dde=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},Lde=(e,{adjustments:t=0,behavior:n},r)=>{var i,s;const a=e+t;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class Pde{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{this._measureElement(s.target,s)})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ade,rangeExtractor:Rde,onChange:()=>{},measureElement:Dde,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Al(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,s=new Map;for(let a=r-1;a>=0;a--){const o=n[a];if(i.has(o.lane))continue;const l=s.get(o.lane);if(l==null||o.end>l.end?s.set(o.lane,o):o.end<l.end&&i.set(o.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=Al(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,i,s,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a}),{key:!1}),this.getMeasurements=Al(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let h=l;h<n;h++){const d=s(h),f=this.options.lanes===1?u[h-1]:this.getFurthestMeasurement(u,h),g=f?f.end+this.options.gap:r+i,b=o.get(d),x=typeof b=="number"?b:this.options.estimateSize(h),v=g+x,m=f?f.lane:h%this.options.lanes;u[h]={index:h,start:g,size:x,end:v,key:d,lane:m}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Al(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,i)=>this.range=n.length>0&&r>0?Ode({measurements:n,outerSize:r,scrollOffset:i}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=Al(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,i,s)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:i,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),s=this.measurementsCache[i];if(!s)return;const a=s.key,o=this.elementsCache.get(a);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const s=this.itemSizeCache.get(i.key)??i.size,a=r-s;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,a,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=Al(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;s<a;s++){const o=n[s],l=r[o];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return gy(r[RI(0,r.length-1,i=>gy(r[i]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&n>=s+i&&(r="end"),r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const s=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(i.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const o=i.start-this.options.scrollPaddingStart+(i.size-s)/2;switch(r){case"center":return[this.getOffsetForAlignment(o,r),r];case"end":return[this.getOffsetForAlignment(i.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(i.start-this.options.scrollPaddingStart,r),r]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const s=this.getOffsetForIndex(n,r);if(!s)return;const[a,o]=s;this._scrollToOffset(a,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[u]=gy(this.getOffsetForIndex(n,o));Ede(u,this.getScrollOffset())||this.scrollToIndex(n,{align:o,behavior:i})}else this.scrollToIndex(n,{align:o,behavior:i})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;return r.length===0?i=this.options.paddingStart:i=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(s=>s.end)),Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const RI=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(s<r)e=i+1;else if(s>r)t=i-1;else return i}return e>0?e-1:0};function Ode({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,s=RI(0,r,o=>e[o].start,n);let a=s;for(;a<r&&e[a].end<n+t;)a++;return{startIndex:s,endIndex:a}}const PT=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ide(e){const t=w.useReducer(()=>({}),{})[1],n={...e,onChange:(i,s)=>{var a;s?mr.flushSync(t):t(),(a=e.onChange)==null||a.call(e,i,s)}},[r]=w.useState(()=>new Pde(n));return r.setOptions(n),PT(()=>r._didMount(),[]),PT(()=>r._willUpdate()),r}function qC(e){return Ide({observeElementRect:Mde,observeElementOffset:Nde,scrollToFn:Lde,...e})}const $de=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:n,className:Y("w-full caption-bottom text-sm",e),...t})}));$de.displayName="Table";const GC=w.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:Y("[&_tr]:border-b",e),...t}));GC.displayName="TableHeader";const KC=w.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:Y("[&_tr:last-child]:border-0",e),...t}));KC.displayName="TableBody";const Bde=w.forwardRef(({className:e,...t},n)=>c.jsx("tfoot",{ref:n,className:Y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Bde.displayName="TableFooter";const Cf=w.forwardRef(({className:e,...t},n)=>c.jsx("tr",{ref:n,className:Y("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Cf.displayName="TableRow";const Fde=w.forwardRef(({className:e,...t},n)=>c.jsx("th",{ref:n,className:Y("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Fde.displayName="TableHead";const qr=w.forwardRef(({className:e,...t},n)=>c.jsx("td",{ref:n,className:Y("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));qr.displayName="TableCell";const zde=w.forwardRef(({className:e,...t},n)=>c.jsx("caption",{ref:n,className:Y("mt-4 text-sm text-muted-foreground",e),...t}));zde.displayName="TableCaption";function Hde({rowData:e,modalOpener:t}){const n=()=>{t({license:e.license})};return c.jsxs(Cf,{onClick:n,className:"cursor-pointer",children:[c.jsxs(qr,{className:"px-4 py-2 flex justify-between border-r",children:[c.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.displayName}),c.jsxs("div",{className:"hidden md:inline-flex items-center gap-1",children:[c.jsx(KX,{className:Y("h-5",e.isOnline?"text-success-inline animate-pulse":"text-muted")}),c.jsx(tL,{className:Y("h-5",e.isAdmin?"text-warning-inline":"text-muted")}),c.jsx(SX,{className:Y("h-5",e.notes?"text-secondary-foreground":"text-muted")})]})]}),c.jsx(qr,{className:"min-w-[8rem] px-4 py-2 border-r",children:hf(e.playTime*6e4)}),c.jsx(qr,{className:"min-w-[10rem] px-4 py-2 border-r",children:y_(e.tsJoined)}),c.jsx(qr,{className:"min-w-[10rem] px-4 py-2",children:y_(e.tsLastConnection)})]})}function Wde({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=c.jsx(qt,{className:"mx-auto animate-spin"}):r?s=c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),c.jsx("br",{}),c.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=c.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No players found."}):s=c.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",c.jsx("br",{}),c.jsxs("i",{children:["(this is a bug, please report it in ",c.jsx(pn,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),c.jsx(Cf,{children:c.jsx(qr,{colSpan:4,className:"px-4 py-2 text-center",children:s})})}function vy({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":c.jsx(c.Fragment,{}),l=u=>{u.preventDefault(),r({key:t,desc:s?!a:!0})};return c.jsxs("th",{onClick:l,className:Y("py-2 px-4 text-left font-light tracking-wider cursor-pointer hover:bg-zinc-300 hover:dark:bg-zinc-600",s&&"font-medium dark:bg-zinc-700",i),children:[e,c.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function Ude({search:e,filters:t}){const n=w.useRef(null),[r,i]=w.useState([]),[s,a]=w.useState(!1),[o,l]=w.useState(!0),[u,h]=w.useState(null),[d,f]=w.useState({key:"tsJoined",desc:!0}),[g,b]=w.useState(!1),x=l0(),v=bt({method:"GET",path:"/player/search",abortOnUnmount:!0}),m=async E=>{l(!0),h(null),E&&b(!0);const k=T=>{h(T),E&&i([])};try{const T={sortingKey:d.key,sortingDesc:d.desc};e.value&&(T.searchValue=e.value,T.searchType=e.type),t.length&&(T.filters=t.join(",")),!E&&r.length&&(T.offsetParam=r[r.length-1][d.key],T.offsetLicense=r[r.length-1].license);const A=await v({queryParams:T});if(A===void 0)return k("Request failed.");if("error"in A)return k(`Request failed: ${A.error}`);h(null),a(A.hasReachedEnd),b(!1),A.players.length?i(M=>E?A.players:[...M,...A.players]):i([])}catch(T){k(`Failed to fetch more data: ${T.message}`)}finally{l(!1),b(!1)}},p=qC({isScrollingResetDelay:0,count:r.length+1,getScrollElement:()=>{var E;return(E=n.current)==null?void 0:E.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),y=p.getVirtualItems(),_=p.getTotalSize();let C=null,S=null;if(y.length>0){const E=y[0].start-p.options.scrollMargin;E>0&&(C=c.jsx("tr",{children:c.jsx("td",{colSpan:3,style:{height:E}})}));const k=_-y[y.length-1].end;k>0&&(S=c.jsx("tr",{children:c.jsx("td",{colSpan:3,style:{height:k}})}))}return w.useEffect(()=>{if(!r.length||!y.length)return;const E=y[y.length-1].index;r.length<=E&&!s&&!o&&m()},[r,y,s,o]),w.useEffect(()=>{p.scrollToIndex(0),m(!0)},[e,t,d]),c.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:c.jsx(ii,{className:"h-full",ref:n,children:c.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[c.jsx(GC,{children:c.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[c.jsx("th",{className:"py-2 px-4 font-light tracking-wider text-left text-muted-foreground",children:"Display Name"}),c.jsx(vy,{label:"Play Time",sortKey:"playTime",sortingState:d,setSorting:f}),c.jsx(vy,{label:"First Joined",sortKey:"tsJoined",sortingState:d,setSorting:f}),c.jsx(vy,{label:"Last Connection",sortKey:"tsLastConnection",sortingState:d,setSorting:f})]})}),c.jsxs(KC,{className:Y(g&&"opacity-25"),children:[C,y.map(E=>E.index>r.length-1?c.jsx(Wde,{playersCount:r.length,hasReachedEnd:s,loadError:u,isFetching:o,retryFetch:m},E.key):c.jsx(Hde,{rowData:r[E.index],modalOpener:x},E.key)),S]})]})})})}const Vde=w.memo(kde),qde=w.memo(Ude),Gde=w.memo(TO),Kde=()=>{const e=localStorage.getItem(_r.PlayersPageSearchType);return!e||!kh.some(t=>t.value===e)?!1:e},Yde=e=>{e?localStorage.setItem(_r.PlayersPageSearchType,e):localStorage.removeItem(_r.PlayersPageSearchType)},Xde=(e,t)=>{const n=new URL(window.location.toString());e&&e.value&&e.type?(n.searchParams.set("searchType",e.type),n.searchParams.set("searchQuery",e.value)):(n.searchParams.delete("searchType"),n.searchParams.delete("searchQuery")),t.length?n.searchParams.set("filters",t.join(",")):n.searchParams.delete("filters"),window.history.replaceState({},"",n)},Jde=()=>{var l;const e=new URLSearchParams(window.location.search),t=kh.map(u=>u.value),n=e.get("searchType"),r=e.get("searchQuery"),i=AI.map(u=>u.value),s=(l=e.get("filters"))==null?void 0:l.split(",").filter(u=>i.includes(u));let a=kh[0].value,o=!1;try{const u=Kde();u&&(a=u,o=!0)}catch(u){console.error("Failed to get stored search type:",u)}return{search:r&&n&&t.includes(n)?{type:n,value:r}:{type:a,value:""},filters:s??[],rememberSearchType:o}};function Qde(){const[e,t]=w.useState(void 0),[n,r]=w.useState(void 0),i=bt({method:"GET",path:"/player/stats",abortOnUnmount:!0});w.useEffect(()=>{i({success(l,u){t(l)}})},[]);const s=w.useCallback((l,u,h)=>{r({search:l,filters:u}),Xde(l,u);try{Yde(h?l.type:!1)}catch(d){console.error("Failed to set stored search type:",d)}},[]),a=w.useMemo(Jde,[]),o=w.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Players",value:l?e.total:!1,icon:c.jsx(MS,{})},{label:"Players Last 24h",value:l?e.playedLast24h:!1,icon:c.jsx(eX,{})},{label:"New Players Last 24h",value:l?e.joinedLast24h:!1,icon:c.jsx(Y3,{}),prefix:"+"},{label:"New Players Last 7d",value:l?e.joinedLast7d:!1,icon:c.jsx(Y3,{}),prefix:"+"}]},[e]);return c.jsxs("div",{className:"flex flex-col min-w-96 w-full h-contentvh",children:[c.jsx(Gde,{callouts:o}),c.jsx(Vde,{doSearch:s,initialState:a}),n?c.jsx(qde,{search:n.search,filters:n.filters}):null]})}const Ig=[{value:"actionId",label:"Action ID",placeholder:"XXXX-XXXX",description:"Search actions by their ID."},{value:"reason",label:"Reason",placeholder:"Enter part of the reason to search for",description:"Search actions by their reason contents."},{value:"identifiers",label:"Player IDs",placeholder:"License, Discord, Steam, etc.",description:"Search actions by their player IDs separated by a comma."}],go="!any",jp=Un(1250,e=>{e()},{noLeading:!0});function Zde({doSearch:e,initialState:t,adminStats:n}){const{authData:r}=rl(),i=w.useRef(null),[s,a]=w.useState(!1),[o,l]=w.useState(t.search.type),[u,h]=w.useState(!!t.search.value),[d,f]=w.useState(t.filterbyType),[g,b]=w.useState(t.filterbyAdmin),x=()=>{if(!i.current)return;const C=i.current.value.trim();e({value:C,type:o},d!==go?d:void 0,g!==go?g:void 0)};w.useEffect(()=>{x()},[o,d,g]);const v=C=>{C.key==="Enter"?(jp.cancel({upcomingOnly:!0}),x()):C.key==="Escape"?(i.current.value="",jp(x),h(!1)):(jp(x),h(!0))},m=()=>{i.current.value="",jp.cancel({upcomingOnly:!0}),x(),h(!1)};Ei("keydown",C=>{var S;C.code==="KeyF"&&(C.ctrlKey||C.metaKey)&&((S=i.current)==null||S.focus(),C.preventDefault())});const p=Ig.find(C=>C.value===o);if(!p)throw new Error(`Invalid search type: ${o}`);if(!r)throw new Error("authData is not available");const y=w.useMemo(()=>n.filter(C=>C.name!==r.name),[n,r.name]),_=w.useMemo(()=>{var C;return((C=n.find(S=>S.name===r.name))==null?void 0:C.actions)||0},[n,r.name]);return c.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[c.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[c.jsxs("div",{className:"relative min-w-44 grow",children:[c.jsx(yt,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:i,placeholder:p.placeholder,defaultValue:t.search.value,onKeyDown:v}),u?c.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:m,children:c.jsx(Kn,{})}):c.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:c.jsx(Be,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),c.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[c.jsxs(cc,{children:[c.jsx(uc,{asChild:!0,children:c.jsxs(Re,{variant:"outline",role:"combobox","aria-expanded":s,onClick:()=>a(!s),className:"xs:w-48 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:["Search by ",p.label,c.jsx(n_,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),c.jsxs(Ca,{className:"w-48",children:[c.jsx(Og,{children:"Search Type"}),c.jsx(ga,{}),c.jsx(TI,{value:o,onValueChange:l,children:Ig.map(C=>c.jsx(VC,{value:C.value,className:"cursor-pointer",children:C.label},C.value))})]})]}),c.jsxs(gn,{defaultValue:d,onValueChange:f,children:[c.jsx(un,{className:"w-36 grow md:grow-0",children:c.jsx(vn,{placeholder:"Filter by admin"})}),c.jsxs(dn,{className:"px-0",children:[c.jsx(ye,{value:go,className:"cursor-pointer",children:"Any type"}),c.jsx(ye,{value:"ban",className:"cursor-pointer",children:"Bans"}),c.jsx(ye,{value:"warn",className:"cursor-pointer",children:"Warns"})]})]}),c.jsxs(gn,{defaultValue:g,onValueChange:b,children:[c.jsx(un,{className:"w-36 grow md:grow-0",children:c.jsx(vn,{placeholder:"Filter by admin"})}),c.jsxs(dn,{className:"px-0",children:[c.jsx(ye,{value:go,className:"cursor-pointer",children:"By any admin"}),c.jsxs(ye,{value:r.name,className:"cursor-pointer",children:[r.name," ",c.jsxs("span",{className:"opacity-50",children:["(",_,")"]})]}),c.jsx(MC,{}),y.map(C=>c.jsxs(ye,{className:"cursor-pointer",value:C.name,children:[C.name," ",c.jsxs("span",{className:"opacity-50",children:["(",C.actions,")"]})]},C.name))]})]}),c.jsx("div",{className:"flex justify-end flex-grow",children:c.jsxs(cc,{children:[c.jsx(uc,{asChild:!0,children:c.jsxs(Re,{variant:"outline",className:"grow md:grow-0",children:["More",c.jsx(Za,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),c.jsxs(Ca,{children:[c.jsx(Vi,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:c.jsxs(Ti,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[c.jsx(La,{className:"inline mr-1 h-4"}),"Bulk Remove"]})}),c.jsx(Vi,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:c.jsxs(Ti,{href:"/settings/ban-templates",className:"cursor-pointer",children:[c.jsx(La,{className:"inline mr-1 h-4"}),"Ban Templates"]})})]})]})})]})]}),c.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:p.description})]})}function ehe({action:e,modalOpener:t}){const n=()=>{t(e.id)};let r,i;if(e.type==="warn")r=c.jsx("div",{className:"flex items-center px-1 bg-warning-hint text-warning",children:c.jsx(pg,{className:"size-5"})}),i=c.jsx("span",{className:"tracking-wider text-warning",children:e.id});else if(e.type==="ban")r=c.jsx("div",{className:"flex items-center px-1 bg-destructive-hint text-destructive",children:c.jsx(hg,{className:"size-5"})}),i=c.jsx("span",{className:"tracking-wider text-destructive",children:e.id});else throw new Error(`Invalid action type: ${e.type}`);let s;return e.isRevoked?s=c.jsx(RS,{className:"size-4"}):e.banExpiration?e.banExpiration==="permanent"?s=c.jsx(tJ,{className:"size-4"}):e.banExpiration==="active"&&(s=c.jsx(rL,{className:"size-4"})):e.type==="warn"&&!e.warnAcked&&(s=c.jsx(XD,{className:"size-4"})),c.jsxs(Cf,{onClick:n,className:"cursor-pointer",children:[c.jsx(qr,{className:Y("w-[10.4rem] border-r p-0",e.isRevoked&&"opacity-40"),children:c.jsxs("div",{className:"flex justify-start gap-2",children:[r,c.jsx("div",{className:"p-2 font-mono",children:i}),c.jsx("div",{className:"flex-grow flex justify-end items-center my-auto pr-2 text-muted-foreground",children:s})]})}),c.jsx(qr,{className:"px-4 py-2 border-r",children:c.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.playerName?e.playerName:c.jsx("span",{className:"text-muted-foreground italic",children:"unknown"})})}),c.jsx(qr,{className:"px-4 py-2 border-r",children:c.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.reason})}),c.jsx(qr,{className:"px-4 py-2 border-r",children:c.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.author})}),c.jsx(qr,{className:"min-w-[10rem] px-4 py-2",children:c.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:y_(e.timestamp)})})]})}function the({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=c.jsx(qt,{className:"mx-auto animate-spin"}):r?s=c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),c.jsx("br",{}),c.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=c.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No actions found."}):s=c.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",c.jsx("br",{}),c.jsxs("i",{children:["(this is a bug, please report it in ",c.jsx(pn,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),c.jsx(Cf,{children:c.jsx(qr,{colSpan:5,className:"px-4 py-2 text-center",children:s})})}function nhe({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":c.jsx(c.Fragment,{}),l=u=>{u.preventDefault(),r({key:t,desc:s?!a:!0})};return c.jsxs("th",{onClick:l,className:Y("py-2 px-4 text-left font-light tracking-wider cursor-pointer hover:bg-zinc-300 hover:dark:bg-zinc-600",s&&"font-medium dark:bg-zinc-700",i),children:[e,c.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function Np({label:e,className:t}){return c.jsx("th",{className:Y("py-2 px-4 font-light tracking-wider text-left text-muted-foreground",t),children:e})}function rhe({search:e,filterbyType:t,filterbyAdmin:n}){const r=w.useRef(null),[i,s]=w.useState([]),[a,o]=w.useState(!1),[l,u]=w.useState(!1),[h,d]=w.useState(null),[f,g]=w.useState({key:"timestamp",desc:!0}),[b,x]=w.useState(!1),v=rC(),m=bt({method:"GET",path:"/history/search",abortOnUnmount:!0}),p=async k=>{u(!0),d(null),k&&x(!0);const T=A=>{d(A),k&&s([])};try{const A={sortingKey:f.key,sortingDesc:f.desc};e.value&&(A.searchValue=e.value,A.searchType=e.type),t&&t!==go&&(A.filterbyType=t),n&&n!==go&&(A.filterbyAdmin=n),!k&&i.length&&(A.offsetParam=i[i.length-1][f.key],A.offsetActionId=i[i.length-1].id);const M=await m({queryParams:A});if(M===void 0)return T("Request failed.");if("error"in M)return T(`Request failed: ${M.error}`);d(null),o(M.hasReachedEnd),x(!1),M.history.length?s(D=>k?M.history:[...D,...M.history]):s([])}catch(A){T(`Failed to fetch more data: ${A.message}`)}finally{u(!1),x(!1)}},y=qC({isScrollingResetDelay:0,count:i.length+1,getScrollElement:()=>{var k;return(k=r.current)==null?void 0:k.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),_=y.getVirtualItems(),C=y.getTotalSize();let S=null,E=null;if(_.length>0){const k=_[0].start-y.options.scrollMargin;k>0&&(S=c.jsx("tr",{children:c.jsx("td",{colSpan:3,style:{height:k}})}));const T=C-_[_.length-1].end;T>0&&(E=c.jsx("tr",{children:c.jsx("td",{colSpan:3,style:{height:T}})}))}return w.useEffect(()=>{if(!i.length||!_.length)return;const k=_[_.length-1].index;i.length<=k&&!a&&!l&&p()},[i,_,a,l]),w.useEffect(()=>{y.scrollToIndex(0),p(!0)},[e,t,n,f]),c.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:c.jsx(ii,{className:"h-full",ref:r,children:c.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[c.jsx(GC,{children:c.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[c.jsx(Np,{label:"Action"}),c.jsx(Np,{label:"Player"}),c.jsx(Np,{label:"Reason"}),c.jsx(Np,{label:"Author"}),c.jsx(nhe,{label:"Date Time",sortKey:"timestamp",sortingState:f,setSorting:g})]})}),c.jsxs(KC,{className:Y(b&&"opacity-25"),children:[S,_.map(k=>k.index>i.length-1?c.jsx(the,{playersCount:i.length,hasReachedEnd:a,loadError:h,isFetching:l,retryFetch:p},k.key):c.jsx(ehe,{action:i[k.index],modalOpener:v},k.key)),E]})]})})})}const ihe=w.memo(Zde),she=w.memo(rhe),ohe=w.memo(TO),ahe=(e,t,n)=>{const r=new URL(window.location.toString());e&&e.type&&e.value?(r.searchParams.set("searchType",e.type),r.searchParams.set("searchQuery",e.value)):(r.searchParams.delete("searchType"),r.searchParams.delete("searchQuery")),t&&t!=="!any"?r.searchParams.set("filterbyType",t):r.searchParams.delete("filterbyType"),n&&n!=="!any"?r.searchParams.set("filterbyAdmin",n):r.searchParams.delete("filterbyAdmin"),window.history.replaceState({},"",r)},lhe=()=>{const e=new URLSearchParams(window.location.search),t=Ig.map(i=>i.value),n=e.get("searchType"),r=e.get("searchQuery");return{search:r&&n&&t.includes(n)?{type:n,value:r}:{type:Ig[0].value,value:""},filterbyType:e.get("filterbyType")??go,filterbyAdmin:e.get("filterbyAdmin")??go}};function che(){const[e,t]=w.useState(void 0),[n,r]=w.useState(void 0),i=bt({method:"GET",path:"/history/stats",abortOnUnmount:!0});w.useEffect(()=>{i({success(l,u){t(l)}})},[]);const s=w.useCallback((l,u,h)=>{r({search:l,filterbyType:u,filterbyAdmin:h}),ahe(l,u,h)},[]),a=w.useMemo(lhe,[]),o=w.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Warns",value:l?e.totalWarns:!1,icon:c.jsx(pg,{})},{label:"New Warns Last 7d",value:l?e.warnsLast7d:!1,icon:c.jsx(pg,{}),prefix:"+"},{label:"Total Bans",value:l?e.totalBans:!1,icon:c.jsx(hg,{})},{label:"New Bans Last 7d",value:l?e.bansLast7d:!1,icon:c.jsx(hg,{}),prefix:"+"}]},[e]);return c.jsxs("div",{className:"flex flex-col min-w-96 w-full h-contentvh",children:[c.jsx(ohe,{callouts:o}),e&&!("error"in e)?c.jsx(ihe,{doSearch:s,initialState:a,adminStats:e.groupedByAdmins}):null,n?c.jsx(she,{search:n.search,filterbyType:n.filterbyType,filterbyAdmin:n.filterbyAdmin}):null]})}var YC="Dialog",[MI,jI]=Cn(YC),[uhe,Ni]=MI(YC),NI=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=w.useRef(null),l=w.useRef(null),[u=!1,h]=Pr({prop:r,defaultProp:i,onChange:s});return c.jsx(uhe,{scope:t,triggerRef:o,contentRef:l,contentId:yr(),titleId:yr(),descriptionId:yr(),open:u,onOpenChange:h,onOpenToggle:w.useCallback(()=>h(d=>!d),[h]),modal:a,children:n})};NI.displayName=YC;var DI="DialogTrigger",LI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ni(DI,n),s=Le(t,i.triggerRef);return c.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":QC(i.open),...r,ref:s,onClick:ae(e.onClick,i.onOpenToggle)})});LI.displayName=DI;var XC="DialogPortal",[dhe,PI]=MI(XC,{forceMount:void 0}),OI=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Ni(XC,t);return c.jsx(dhe,{scope:t,forceMount:n,children:w.Children.map(r,a=>c.jsx(on,{present:n||s.open,children:c.jsx(v0,{asChild:!0,container:i,children:a})}))})};OI.displayName=XC;var $g="DialogOverlay",II=w.forwardRef((e,t)=>{const n=PI($g,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ni($g,e.__scopeDialog);return s.modal?c.jsx(on,{present:r||s.open,children:c.jsx(hhe,{...i,ref:t})}):null});II.displayName=$g;var hhe=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ni($g,n);return c.jsx(vf,{as:Po,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(Ce.div,{"data-state":QC(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$a="DialogContent",$I=w.forwardRef((e,t)=>{const n=PI($a,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ni($a,e.__scopeDialog);return c.jsx(on,{present:r||s.open,children:s.modal?c.jsx(fhe,{...i,ref:t}):c.jsx(phe,{...i,ref:t})})});$I.displayName=$a;var fhe=w.forwardRef((e,t)=>{const n=Ni($a,e.__scopeDialog),r=w.useRef(null),i=Le(t,n.contentRef,r);return w.useEffect(()=>{const s=r.current;if(s)return p0(s)},[]),c.jsx(BI,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:ae(e.onFocusOutside,s=>s.preventDefault())})}),phe=w.forwardRef((e,t)=>{const n=Ni($a,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return c.jsx(BI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),BI=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=Ni($a,n),l=w.useRef(null),u=Le(t,l);return u0(),c.jsxs(c.Fragment,{children:[c.jsx(g0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx(ou,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":QC(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(ghe,{titleId:o.titleId}),c.jsx(xhe,{contentRef:l,descriptionId:o.descriptionId})]})]})}),JC="DialogTitle",FI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ni(JC,n);return c.jsx(Ce.h2,{id:i.titleId,...r,ref:t})});FI.displayName=JC;var zI="DialogDescription",HI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ni(zI,n);return c.jsx(Ce.p,{id:i.descriptionId,...r,ref:t})});HI.displayName=zI;var WI="DialogClose",UI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ni(WI,n);return c.jsx(Ce.button,{type:"button",...r,ref:t,onClick:ae(e.onClick,()=>i.onOpenChange(!1))})});UI.displayName=WI;function QC(e){return e?"open":"closed"}var VI="DialogTitleWarning",[mhe,qI]=YK(VI,{contentName:$a,titleName:JC,docsSlug:"dialog"}),ghe=({titleId:e})=>{const t=qI(VI),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vhe="DialogDescriptionWarning",xhe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qI(vhe).contentName}}.`;return w.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ZC=NI,yhe=LI,ek=OI,kf=II,Ef=$I,Tf=FI,Af=HI,R0=UI;const ea=ZC,bhe=ek,GI=w.forwardRef(({className:e,...t},n)=>c.jsx(kf,{ref:n,className:Y("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));GI.displayName=kf.displayName;const Us=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(bhe,{children:[c.jsx(GI,{}),c.jsxs(Ef,{ref:r,className:Y("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,c.jsxs(R0,{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:[c.jsx(Kn,{className:"h-6 w-6"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Us.displayName=Ef.displayName;const Vs=({className:e,...t})=>c.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Vs.displayName="DialogHeader";const du=({className:e,...t})=>c.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});du.displayName="DialogFooter";const qs=w.forwardRef(({className:e,...t},n)=>c.jsx(Tf,{ref:n,className:Y("text-lg font-semibold leading-none tracking-tight","attempt-word-wrap",e),...t}));qs.displayName=Tf.displayName;const KI=w.forwardRef(({className:e,...t},n)=>c.jsx(Af,{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));KI.displayName=Af.displayName;const _he=({textAreaRef:e,softMaxLength:t,triggerUpdateVal:n})=>w.useMemo(()=>{if(!e||!t)return null;const i=e.value.length;return i>=t*.8?{text:`${i}/${t}`,isOverLimit:i>=t}:null},[e,t,n]),whe=({textAreaRef:e,triggerUpdateVal:t,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[i,s]=w.useState(!0);w.useEffect(()=>{if(e){i&&(e.style.minHeight=`${r+2}px`,n>r&&(e.style.maxHeight=`${n}px`),s(!1)),e.style.height=`${r+2}px`;const o=e.scrollHeight;o>n?e.style.height=`${n}px`:e.style.height=`${o+2}px`}},[e,t])},Rf=w.forwardRef(({maxHeight:e=Number.MAX_SAFE_INTEGER,minHeight:t=52,softMaxLength:n,maxLength:r,className:i,onChange:s,value:a,...o},l)=>{const u=w.useRef(null),[h,d]=w.useState("");whe({textAreaRef:u.current,triggerUpdateVal:h,maxHeight:e,minHeight:t}),w.useImperativeHandle(l,()=>({textArea:u.current,maxHeight:e,minHeight:t})),w.useEffect(()=>{d(a)},[a,o==null?void 0:o.defaultValue,o==null?void 0:o.placeholder]);const f=_he({textAreaRef:u.current,softMaxLength:n,triggerUpdateVal:h});return c.jsxs("div",{className:"relative w-full",children:[f&&c.jsx("span",{className:Y("absolute bottom-1 right-4 text-xs tabular-nums pointer-events-none select-none bg-background px-1 py-0.5 rounded-md",f.isOverLimit?"text-destructive":"text-muted-foreground"),children:f.text}),c.jsx("textarea",{...o,value:a,maxLength:r,ref:u,className:Y("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 placeholder:opacity-50",i),onChange:g=>{d(g.target.value),s==null||s(g)}})]})});Rf.displayName="AutosizeTextarea";const She=["2 hours","8 hours","1 days","2 days","1 weeks","2 weeks","permanent"];function Che({reasonData:e,onSave:t,isDialogOpen:n,setIsDialogOpen:r}){let i="",s="2 days",a,o="days";e&&(i=e.reason,She.includes(rg(e.duration))||e.duration==="permanent"?s=rg(e.duration):(s="custom",a=e.duration.value,o=e.duration.unit));const l=w.useRef(null),u=w.useRef(null),[h,d]=w.useState(s),[f,g]=w.useState(o);w.useEffect(()=>{const x=setTimeout(()=>{n||(d(s),g(o),l.current&&(l.current.textArea.value=""),u.current&&(u.current.value=""))},500);return()=>clearTimeout(x)},[n]);const b=x=>{x.preventDefault();const v=x.currentTarget,m=(e==null?void 0:e.id)||null,p=v.reason.value.trim();if(v.reason.value=p,p.length<3)return v.reason.focus(),ze.warning("Reason must be at least 3 characters long");let y;if(h==="permanent")y="permanent";else if(h==="custom"){if(v.durationMultiplier.value<=0)return v.durationMultiplier.focus(),ze.warning("Custom duration must be a positive number");y={value:parseInt(v.durationMultiplier.value),unit:f}}else{const[_,C]=h.split(" ");y={value:parseInt(_),unit:C}}t({id:m,reason:p,duration:y})};return c.jsx(ea,{open:n,onOpenChange:r,children:c.jsx(Us,{className:"md:max-w-xl",children:c.jsx("form",{onSubmit:b,children:c.jsxs("div",{className:"space-y-4",children:[c.jsx(Vs,{children:c.jsxs(qs,{children:[e?"Edit":"Add"," Template"]})}),c.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[c.jsx(Yt,{htmlFor:"banReason",className:"col-span-6 sm:col-auto",children:"Reason"}),c.jsx(Rf,{id:"reason",placeholder:"The reason for the ban, rule violated, etc.",className:"col-span-full sm:col-span-5",defaultValue:i,ref:l,maxHeight:160,minLength:3,autoFocus:!0,required:!0,onChangeCapture:x=>{const v=x.target;v.value.includes(`
`)&&(v.value=v.value.replace(/\s*\r*\n+\s*/g," "))}})]}),c.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[c.jsx(Yt,{htmlFor:"durationSelect",className:"col-span-6 sm:col-auto",children:"Duration"}),c.jsxs("div",{className:"col-span-full sm:col-span-5 space-y-1",children:[c.jsxs(gn,{onValueChange:d,defaultValue:h,children:[c.jsx(un,{id:"durationSelect",className:"tracking-wide",children:c.jsx(vn,{placeholder:"Select Duration"})}),c.jsxs(dn,{className:"tracking-wide",children:[c.jsx(ye,{value:"custom",className:"font-bold",children:"Custom (set below)"}),c.jsx(ye,{value:"2 hours",children:"2 HOURS"}),c.jsx(ye,{value:"8 hours",children:"8 HOURS"}),c.jsx(ye,{value:"1 days",children:"1 DAY"}),c.jsx(ye,{value:"2 days",children:"2 DAYS"}),c.jsx(ye,{value:"1 weeks",children:"1 WEEK"}),c.jsx(ye,{value:"2 weeks",children:"2 WEEKS"}),c.jsx(ye,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),c.jsxs("div",{className:"flex flex-row gap-2",children:[c.jsx(yt,{id:"durationMultiplier",type:"number",placeholder:"123",defaultValue:a,disabled:h!=="custom",ref:u,min:1,max:99,required:!0}),c.jsxs(gn,{onValueChange:g,defaultValue:f,children:[c.jsx(un,{id:"durationUnits",className:"tracking-wide",disabled:h!=="custom",children:c.jsx(vn,{})}),c.jsxs(dn,{className:"tracking-wide",children:[c.jsx(ye,{value:"hours",children:"HOURS"}),c.jsx(ye,{value:"days",children:"DAYS"}),c.jsx(ye,{value:"weeks",children:"WEEKS"}),c.jsx(ye,{value:"months",children:"MONTHS"})]})]})]})]})]}),c.jsx(du,{children:c.jsx(Re,{type:"submit",children:"Save changes"})})]})})})})}function khe({id:e,reason:t,duration:n,onEdit:r,onRemove:i,disabled:s}){return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grow sm:flex items-center justify-items-start gap-2",children:[c.jsx("span",{className:"line-clamp-5 md:line-clamp-3",children:t}),c.jsx("div",{className:Y("bg-black/5 dark:bg-black/40 px-2 py-0.5 my-1 sm:my-0 border text-sm rounded w-max shrink-0 uppercase select-none",n==="permanent"?"border-destructive bg-destructive-hint text-destructive":"border-primary text-primary opacity-85"),children:rg(n)})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{className:Y("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-primary hover:scale-110"),onClick:()=>r(e),disabled:s,children:c.jsx(AS,{className:"size-6"})}),c.jsx("button",{className:Y("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-destructive hover:scale-110"),onClick:()=>i(e),disabled:s,children:c.jsx(Kn,{className:"size-6"})})]})]})}function Ehe({onClick:e,disabled:t}){return c.jsxs("li",{onClick:e,className:Y("rounded-lg bg-card border px-2 py-3 flex gap-3",t?"opacity-50 cursor-not-allowed":"hover:bg-primary hover:text-primary-foreground cursor-pointer"),children:[c.jsx(TS,{className:"size-6"}),c.jsx("span",{children:"Add New Reason"})]})}function The(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return w.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const M0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function hu(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function tk(e){return"nodeType"in e}function wr(e){var t,n;return e?hu(e)?e:tk(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function nk(e){const{Document:t}=wr(e);return e instanceof t}function Mf(e){return hu(e)?!1:e instanceof wr(e).HTMLElement}function YI(e){return e instanceof wr(e).SVGElement}function fu(e){return e?hu(e)?e.document:tk(e)?nk(e)?e:Mf(e)||YI(e)?e.ownerDocument:document:document:document}const es=M0?w.useLayoutEffect:w.useEffect;function rk(e){const t=w.useRef(e);return es(()=>{t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function Ahe(){const e=w.useRef(null),t=w.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=w.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Eh(e,t){t===void 0&&(t=[e]);const n=w.useRef(e);return es(()=>{n.current!==e&&(n.current=e)},t),n}function jf(e,t){const n=w.useRef();return w.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Bg(e){const t=rk(e),n=w.useRef(null),r=w.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function G_(e){const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current}let xy={};function Nf(e,t){return w.useMemo(()=>{if(t)return t;const n=xy[e]==null?0:xy[e]+1;return xy[e]=n,e+"-"+n},[e,t])}function XI(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,a)=>{const o=Object.entries(a);for(const[l,u]of o){const h=s[l];h!=null&&(s[l]=h+e*u)}return s},{...t})}}const dc=XI(1),Th=XI(-1);function Rhe(e){return"clientX"in e&&"clientY"in e}function ik(e){if(!e)return!1;const{KeyboardEvent:t}=wr(e.target);return t&&e instanceof t}function Mhe(e){if(!e)return!1;const{TouchEvent:t}=wr(e.target);return t&&e instanceof t}function K_(e){if(Mhe(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Rhe(e)?{x:e.clientX,y:e.clientY}:null}const Ah=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ah.Translate.toString(e),Ah.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),OT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function jhe(e){return e.matches(OT)?e:e.querySelector(OT)}const Nhe={display:"none"};function Dhe(e){let{id:t,value:n}=e;return ot.createElement("div",{id:t,style:Nhe},n)}function Lhe(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ot.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function Phe(){const[e,t]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const JI=w.createContext(null);function Ohe(e){const t=w.useContext(JI);w.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Ihe(){const[e]=w.useState(()=>new Set),t=w.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[w.useCallback(r=>{let{type:i,event:s}=r;e.forEach(a=>{var o;return(o=a[i])==null?void 0:o.call(a,s)})},[e]),t]}const $he={draggable:`
    To pick up a draggable item, press the space bar.
    While dragging, use the arrow keys to move the item.
    Press space again to drop the item in its new position, or press escape to cancel.
  `},Bhe={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Fhe(e){let{announcements:t=Bhe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=$he}=e;const{announce:s,announcement:a}=Phe(),o=Nf("DndLiveRegion"),[l,u]=w.useState(!1);if(w.useEffect(()=>{u(!0)},[]),Ohe(w.useMemo(()=>({onDragStart(d){let{active:f}=d;s(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:g}=d;t.onDragMove&&s(t.onDragMove({active:f,over:g}))},onDragOver(d){let{active:f,over:g}=d;s(t.onDragOver({active:f,over:g}))},onDragEnd(d){let{active:f,over:g}=d;s(t.onDragEnd({active:f,over:g}))},onDragCancel(d){let{active:f,over:g}=d;s(t.onDragCancel({active:f,over:g}))}}),[s,t])),!l)return null;const h=ot.createElement(ot.Fragment,null,ot.createElement(Dhe,{id:r,value:i.draggable}),ot.createElement(Lhe,{id:o,announcement:a}));return n?mr.createPortal(h,n):h}var _n;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(_n||(_n={}));function Fg(){}function IT(e,t){return w.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function zhe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return w.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Mi=Object.freeze({x:0,y:0});function QI(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ZI(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Hhe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function $T(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function e9(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function BT(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Whe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=BT(t,t.left,t.top),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const u=QI(BT(l),i);s.push({id:o,data:{droppableContainer:a,value:u}})}}return s.sort(ZI)},Uhe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=$T(t),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const u=$T(l),h=i.reduce((f,g,b)=>f+QI(u[b],g),0),d=Number((h/4).toFixed(4));s.push({id:o,data:{droppableContainer:a,value:d}})}}return s.sort(ZI)};function Vhe(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=i-r,o=s-n;if(r<i&&n<s){const l=t.width*t.height,u=e.width*e.height,h=a*o,d=h/(l+u-h);return Number(d.toFixed(4))}return 0}const qhe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const s of r){const{id:a}=s,o=n.get(a);if(o){const l=Vhe(o,t);l>0&&i.push({id:a,data:{droppableContainer:s,value:l}})}}return i.sort(Hhe)};function Ghe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function t9(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Mi}function Khe(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((a,o)=>({...a,top:a.top+e*o.y,bottom:a.bottom+e*o.y,left:a.left+e*o.x,right:a.right+e*o.x}),{...n})}}const Yhe=Khe(1);function Xhe(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Jhe(e,t,n){const r=Xhe(t);if(!r)return e;const{scaleX:i,scaleY:s,x:a,y:o}=r,l=e.left-a-(1-i)*parseFloat(n),u=e.top-o-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=i?e.width/i:e.width,d=s?e.height/s:e.height;return{width:h,height:d,top:u,right:l+h,bottom:u+d,left:l}}const Qhe={ignoreTransform:!1};function pu(e,t){t===void 0&&(t=Qhe);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:h}=wr(e).getComputedStyle(e);u&&(n=Jhe(n,u,h))}const{top:r,left:i,width:s,height:a,bottom:o,right:l}=n;return{top:r,left:i,width:s,height:a,bottom:o,right:l}}function FT(e){return pu(e,{ignoreTransform:!0})}function Zhe(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function efe(e,t){return t===void 0&&(t=wr(e).getComputedStyle(e)),t.position==="fixed"}function tfe(e,t){t===void 0&&(t=wr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function j0(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(nk(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Mf(i)||YI(i)||n.includes(i))return n;const s=wr(e).getComputedStyle(i);return i!==e&&tfe(i,s)&&n.push(i),efe(i,s)?n:r(i.parentNode)}return e?r(e):n}function n9(e){const[t]=j0(e,1);return t??null}function yy(e){return!M0||!e?null:hu(e)?e:tk(e)?nk(e)||e===fu(e).scrollingElement?window:Mf(e)?e:null:null}function r9(e){return hu(e)?e.scrollX:e.scrollLeft}function i9(e){return hu(e)?e.scrollY:e.scrollTop}function Y_(e){return{x:r9(e),y:i9(e)}}var Tn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Tn||(Tn={}));function s9(e){return!M0||!e?!1:e===document.scrollingElement}function o9(e){const t={x:0,y:0},n=s9(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,o=e.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:a,isRight:o,maxScroll:r,minScroll:t}}const nfe={x:.2,y:.2};function rfe(e,t,n,r,i){let{top:s,left:a,right:o,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=nfe);const{isTop:u,isBottom:h,isLeft:d,isRight:f}=o9(e),g={x:0,y:0},b={x:0,y:0},x={height:t.height*i.y,width:t.width*i.x};return!u&&s<=t.top+x.height?(g.y=Tn.Backward,b.y=r*Math.abs((t.top+x.height-s)/x.height)):!h&&l>=t.bottom-x.height&&(g.y=Tn.Forward,b.y=r*Math.abs((t.bottom-x.height-l)/x.height)),!f&&o>=t.right-x.width?(g.x=Tn.Forward,b.x=r*Math.abs((t.right-x.width-o)/x.width)):!d&&a<=t.left+x.width&&(g.x=Tn.Backward,b.x=r*Math.abs((t.left+x.width-a)/x.width)),{direction:g,speed:b}}function ife(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function a9(e){return e.reduce((t,n)=>dc(t,Y_(n)),Mi)}function sfe(e){return e.reduce((t,n)=>t+r9(n),0)}function ofe(e){return e.reduce((t,n)=>t+i9(n),0)}function afe(e,t){if(t===void 0&&(t=pu),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);n9(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const lfe=[["x",["left","right"],sfe],["y",["top","bottom"],ofe]];class sk{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=j0(n),i=a9(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,o]of lfe)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=o(r),h=i[s]-u;return this.rect[l]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ud{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function cfe(e){const{EventTarget:t}=wr(e);return e instanceof t?e:fu(e)}function by(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Fr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Fr||(Fr={}));function zT(e){e.preventDefault()}function ufe(e){e.stopPropagation()}var st;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(st||(st={}));const l9={start:[st.Space,st.Enter],cancel:[st.Esc],end:[st.Space,st.Enter,st.Tab]},dfe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case st.Right:return{...n,x:n.x+25};case st.Left:return{...n,x:n.x-25};case st.Down:return{...n,y:n.y+25};case st.Up:return{...n,y:n.y-25}}};class ok{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ud(fu(n)),this.windowListeners=new Ud(wr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fr.Resize,this.handleCancel),this.windowListeners.add(Fr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&afe(r),n(Mi)}handleKeyDown(t){if(ik(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=l9,coordinateGetter:a=dfe,scrollBehavior:o="smooth"}=i,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,h=u?{x:u.left,y:u.top}:Mi;this.referenceCoordinates||(this.referenceCoordinates=h);const d=a(t,{active:n,context:r.current,currentCoordinates:h});if(d){const f=Th(d,h),g={x:0,y:0},{scrollableAncestors:b}=r.current;for(const x of b){const v=t.code,{isTop:m,isRight:p,isLeft:y,isBottom:_,maxScroll:C,minScroll:S}=o9(x),E=ife(x),k={x:Math.min(v===st.Right?E.right-E.width/2:E.right,Math.max(v===st.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(v===st.Down?E.bottom-E.height/2:E.bottom,Math.max(v===st.Down?E.top:E.top+E.height/2,d.y))},T=v===st.Right&&!p||v===st.Left&&!y,A=v===st.Down&&!_||v===st.Up&&!m;if(T&&k.x!==d.x){const M=x.scrollLeft+f.x,D=v===st.Right&&M<=C.x||v===st.Left&&M>=S.x;if(D&&!f.y){x.scrollTo({left:M,behavior:o});return}D?g.x=x.scrollLeft-M:g.x=v===st.Right?x.scrollLeft-C.x:x.scrollLeft-S.x,g.x&&x.scrollBy({left:-g.x,behavior:o});break}else if(A&&k.y!==d.y){const M=x.scrollTop+f.y,D=v===st.Down&&M<=C.y||v===st.Up&&M>=S.y;if(D&&!f.x){x.scrollTo({top:M,behavior:o});return}D?g.y=x.scrollTop-M:g.y=v===st.Down?x.scrollTop-C.y:x.scrollTop-S.y,g.y&&x.scrollBy({top:-g.y,behavior:o});break}}this.handleMove(t,dc(Th(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}ok.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=l9,onActivation:i}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const o=s.activatorNode.current;return o&&e.target!==o?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function HT(e){return!!(e&&"distance"in e)}function WT(e){return!!(e&&"delay"in e)}class ak{constructor(t,n,r){var i;r===void 0&&(r=cfe(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=fu(a),this.documentListeners=new Ud(this.document),this.listeners=new Ud(r),this.windowListeners=new Ud(wr(a)),this.initialCoordinates=(i=K_(s))!=null?i:Mi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Fr.Resize,this.handleCancel),this.windowListeners.add(Fr.DragStart,zT),this.windowListeners.add(Fr.VisibilityChange,this.handleCancel),this.windowListeners.add(Fr.ContextMenu,zT),this.documentListeners.add(Fr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(WT(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(HT(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Fr.Click,ufe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:a,options:{activationConstraint:o}}=s;if(!i)return;const l=(n=K_(t))!=null?n:Mi,u=Th(i,l);if(!r&&o){if(HT(o)){if(o.tolerance!=null&&by(u,o.tolerance))return this.handleCancel();if(by(u,o.distance))return this.handleStart()}if(WT(o)&&by(u,o.tolerance))return this.handleCancel();this.handlePending(o,u);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===st.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const hfe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class lk extends ak{constructor(t){const{event:n}=t,r=fu(n.target);super(t,hfe,r)}}lk.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const ffe={move:{name:"mousemove"},end:{name:"mouseup"}};var X_;(function(e){e[e.RightClick=2]="RightClick"})(X_||(X_={}));class pfe extends ak{constructor(t){super(t,ffe,fu(t.event.target))}}pfe.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===X_.RightClick?!1:(r==null||r({event:n}),!0)}}];const _y={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class mfe extends ak{constructor(t){super(t,_y)}static setup(){return window.addEventListener(_y.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(_y.move.name,t)};function t(){}}}mfe.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Vd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Vd||(Vd={}));var zg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(zg||(zg={}));function gfe(e){let{acceleration:t,activator:n=Vd.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:o=zg.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:h,delta:d,threshold:f}=e;const g=xfe({delta:d,disabled:!s}),[b,x]=Ahe(),v=w.useRef({x:0,y:0}),m=w.useRef({x:0,y:0}),p=w.useMemo(()=>{switch(n){case Vd.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Vd.DraggableRect:return i}},[n,i,l]),y=w.useRef(null),_=w.useCallback(()=>{const S=y.current;if(!S)return;const E=v.current.x*m.current.x,k=v.current.y*m.current.y;S.scrollBy(E,k)},[]),C=w.useMemo(()=>o===zg.TreeOrder?[...u].reverse():u,[o,u]);w.useEffect(()=>{if(!s||!u.length||!p){x();return}for(const S of C){if((r==null?void 0:r(S))===!1)continue;const E=u.indexOf(S),k=h[E];if(!k)continue;const{direction:T,speed:A}=rfe(S,k,p,t,f);for(const M of["x","y"])g[M][T[M]]||(A[M]=0,T[M]=0);if(A.x>0||A.y>0){x(),y.current=S,b(_,a),v.current=A,m.current=T;return}}v.current={x:0,y:0},m.current={x:0,y:0},x()},[t,_,r,x,s,a,JSON.stringify(p),JSON.stringify(g),b,u,C,h,JSON.stringify(f)])}const vfe={x:{[Tn.Backward]:!1,[Tn.Forward]:!1},y:{[Tn.Backward]:!1,[Tn.Forward]:!1}};function xfe(e){let{delta:t,disabled:n}=e;const r=G_(t);return jf(i=>{if(n||!r||!i)return vfe;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Tn.Backward]:i.x[Tn.Backward]||s.x===-1,[Tn.Forward]:i.x[Tn.Forward]||s.x===1},y:{[Tn.Backward]:i.y[Tn.Backward]||s.y===-1,[Tn.Forward]:i.y[Tn.Forward]||s.y===1}}},[n,t,r])}function yfe(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return jf(i=>{var s;return t==null?null:(s=r??i)!=null?s:null},[r,t])}function bfe(e,t){return w.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...s]},[]),[e,t])}var Rh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Rh||(Rh={}));var J_;(function(e){e.Optimized="optimized"})(J_||(J_={}));const UT=new Map;function _fe(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,a]=w.useState(null),{frequency:o,measure:l,strategy:u}=i,h=w.useRef(e),d=v(),f=Eh(d),g=w.useCallback(function(m){m===void 0&&(m=[]),!f.current&&a(p=>p===null?m:p.concat(m.filter(y=>!p.includes(y))))},[f]),b=w.useRef(null),x=jf(m=>{if(d&&!n)return UT;if(!m||m===UT||h.current!==e||s!=null){const p=new Map;for(let y of e){if(!y)continue;if(s&&s.length>0&&!s.includes(y.id)&&y.rect.current){p.set(y.id,y.rect.current);continue}const _=y.node.current,C=_?new sk(l(_),_):null;y.rect.current=C,C&&p.set(y.id,C)}return p}return m},[e,s,n,d,l]);return w.useEffect(()=>{h.current=e},[e]),w.useEffect(()=>{d||g()},[n,d]),w.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),w.useEffect(()=>{d||typeof o!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},o))},[o,d,g,...r]),{droppableRects:x,measureDroppableContainers:g,measuringScheduled:s!=null};function v(){switch(u){case Rh.Always:return!1;case Rh.BeforeDragging:return n;default:return!n}}}function c9(e,t){return jf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function wfe(e,t){return c9(e,t)}function Sfe(e){let{callback:t,disabled:n}=e;const r=rk(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function N0(e){let{callback:t,disabled:n}=e;const r=rk(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Cfe(e){return new sk(pu(e),e)}function VT(e,t,n){t===void 0&&(t=Cfe);const[r,i]=w.useState(null);function s(){i(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const h=t(e);return JSON.stringify(l)===JSON.stringify(h)?l:h})}const a=Sfe({callback(l){if(e)for(const u of l){const{type:h,target:d}=u;if(h==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),o=N0({callback:s});return es(()=>{s(),e?(o==null||o.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),a==null||a.disconnect())},[e]),r}function kfe(e){const t=c9(e);return t9(e,t)}const qT=[];function Efe(e){const t=w.useRef(e),n=jf(r=>e?r&&r!==qT&&e&&t.current&&e.parentNode===t.current.parentNode?r:j0(e):qT,[e]);return w.useEffect(()=>{t.current=e},[e]),n}function Tfe(e){const[t,n]=w.useState(null),r=w.useRef(e),i=w.useCallback(s=>{const a=yy(s.target);a&&n(o=>o?(o.set(a,Y_(a)),new Map(o)):null)},[]);return w.useEffect(()=>{const s=r.current;if(e!==s){a(s);const o=e.map(l=>{const u=yy(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Y_(u)]):null}).filter(l=>l!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(s)};function a(o){o.forEach(l=>{const u=yy(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),w.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>dc(s,a),Mi):a9(e):Mi,[e,t])}function GT(e,t){t===void 0&&(t=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},t),w.useEffect(()=>{const r=e!==Mi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Th(e,n.current):Mi}function Afe(e){w.useEffect(()=>{if(!M0)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Rfe(e,t){return w.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=a=>{s(a,t)},n},{}),[e,t])}function u9(e){return w.useMemo(()=>e?Zhe(e):null,[e])}const KT=[];function Mfe(e,t){t===void 0&&(t=pu);const[n]=e,r=u9(n?wr(n):null),[i,s]=w.useState(KT);function a(){s(()=>e.length?e.map(l=>s9(l)?r:new sk(t(l),l)):KT)}const o=N0({callback:a});return es(()=>{o==null||o.disconnect(),a(),e.forEach(l=>o==null?void 0:o.observe(l))},[e]),i}function jfe(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Mf(t)?t:e}function Nfe(e){let{measure:t}=e;const[n,r]=w.useState(null),i=w.useCallback(u=>{for(const{target:h}of u)if(Mf(h)){r(d=>{const f=t(h);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),s=N0({callback:i}),a=w.useCallback(u=>{const h=jfe(u);s==null||s.disconnect(),h&&(s==null||s.observe(h)),r(h?t(h):null)},[t,s]),[o,l]=Bg(a);return w.useMemo(()=>({nodeRef:o,rect:n,setRef:l}),[n,o,l])}const Dfe=[{sensor:lk,options:{}},{sensor:ok,options:{}}],Lfe={current:{}},_m={draggable:{measure:FT},droppable:{measure:FT,strategy:Rh.WhileDragging,frequency:J_.Optimized},dragOverlay:{measure:pu}};class qd extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Pfe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new qd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Fg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:_m,measureDroppableContainers:Fg,windowRect:null,measuringScheduled:!1},Ofe={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Fg,draggableNodes:new Map,over:null,measureDroppableContainers:Fg},D0=w.createContext(Ofe),d9=w.createContext(Pfe);function Ife(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new qd}}}function $fe(e,t){switch(t.type){case _n.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case _n.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case _n.DragEnd:case _n.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case _n.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new qd(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case _n.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new qd(e.droppable.containers);return a.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case _n.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new qd(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Bfe(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=w.useContext(D0),s=G_(r),a=G_(n==null?void 0:n.id);return w.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!ik(s)||document.activeElement===s.target)return;const o=i.get(a);if(!o)return;const{activatorNode:l,node:u}=o;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const h of[l.current,u.current]){if(!h)continue;const d=jhe(h);if(d){d.focus();break}}})}},[r,t,i,a,s]),null}function Ffe(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function zfe(e){return w.useMemo(()=>({draggable:{..._m.draggable,...e==null?void 0:e.draggable},droppable:{..._m.droppable,...e==null?void 0:e.droppable},dragOverlay:{..._m.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Hfe(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=w.useRef(!1),{x:a,y:o}=typeof i=="boolean"?{x:i,y:i}:i;es(()=>{if(!a&&!o||!t){s.current=!1;return}if(s.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const h=n(u),d=t9(h,r);if(a||(d.x=0),o||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=n9(u);f&&f.scrollBy({top:d.y,left:d.x})}},[t,a,o,r,n])}const h9=w.createContext({...Mi,scaleX:1,scaleY:1});var oo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(oo||(oo={}));const Wfe=w.memo(function(t){var n,r,i,s;let{id:a,accessibility:o,autoScroll:l=!0,children:u,sensors:h=Dfe,collisionDetection:d=qhe,measuring:f,modifiers:g,...b}=t;const x=w.useReducer($fe,void 0,Ife),[v,m]=x,[p,y]=Ihe(),[_,C]=w.useState(oo.Uninitialized),S=_===oo.Initialized,{draggable:{active:E,nodes:k,translate:T},droppable:{containers:A}}=v,M=E!=null?k.get(E):null,D=w.useRef({initial:null,translated:null}),L=w.useMemo(()=>{var Je;return E!=null?{id:E,data:(Je=M==null?void 0:M.data)!=null?Je:Lfe,rect:D}:null},[E,M]),N=w.useRef(null),[O,B]=w.useState(null),[z,P]=w.useState(null),j=Eh(b,Object.values(b)),R=Nf("DndDescribedBy",a),I=w.useMemo(()=>A.getEnabled(),[A]),H=zfe(f),{droppableRects:F,measureDroppableContainers:G,measuringScheduled:Z}=_fe(I,{dragging:S,dependencies:[T.x,T.y],config:H.droppable}),J=yfe(k,E),W=w.useMemo(()=>z?K_(z):null,[z]),$=ht(),V=wfe(J,H.draggable.measure);Hfe({activeNode:E!=null?k.get(E):null,config:$.layoutShiftCompensation,initialRect:V,measure:H.draggable.measure});const U=VT(J,H.draggable.measure,V),X=VT(J?J.parentElement:null),q=w.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ne=A.getNodeFor((n=q.current.over)==null?void 0:n.id),te=Nfe({measure:H.dragOverlay.measure}),le=(r=te.nodeRef.current)!=null?r:J,xe=S?(i=te.rect)!=null?i:U:null,ie=!!(te.nodeRef.current&&te.rect),Te=kfe(ie?null:U),Ae=u9(le?wr(le):null),be=Efe(S?ne??J:null),we=Mfe(be),_e=Ffe(g,{transform:{x:T.x-Te.x,y:T.y-Te.y,scaleX:1,scaleY:1},activatorEvent:z,active:L,activeNodeRect:U,containerNodeRect:X,draggingNodeRect:xe,over:q.current.over,overlayNodeRect:te.rect,scrollableAncestors:be,scrollableAncestorRects:we,windowRect:Ae}),de=W?dc(W,T):null,se=Tfe(be),me=GT(se),K=GT(se,[U]),Q=dc(_e,me),re=xe?Yhe(xe,_e):null,ce=L&&re?d({active:L,collisionRect:re,droppableRects:F,droppableContainers:I,pointerCoordinates:de}):null,ve=e9(ce,"id"),[ge,pe]=w.useState(null),Ue=ie?_e:dc(_e,K),Fe=Ghe(Ue,(s=ge==null?void 0:ge.rect)!=null?s:null,U),He=w.useRef(null),$e=w.useCallback((Je,at)=>{let{sensor:Ct,options:an}=at;if(N.current==null)return;const Nt=k.get(N.current);if(!Nt)return;const $t=Je.nativeEvent,Bt=new Ct({active:N.current,activeNode:Nt,event:$t,options:an,context:q,onAbort(kt){if(!k.get(kt))return;const{onDragAbort:Qe}=j.current,Ke={id:kt};Qe==null||Qe(Ke),p({type:"onDragAbort",event:Ke})},onPending(kt,ln,Qe,Ke){if(!k.get(kt))return;const{onDragPending:wt}=j.current,nn={id:kt,constraint:ln,initialCoordinates:Qe,offset:Ke};wt==null||wt(nn),p({type:"onDragPending",event:nn})},onStart(kt){const ln=N.current;if(ln==null)return;const Qe=k.get(ln);if(!Qe)return;const{onDragStart:Ke}=j.current,Ve={activatorEvent:$t,active:{id:ln,data:Qe.data,rect:D}};mr.unstable_batchedUpdates(()=>{Ke==null||Ke(Ve),C(oo.Initializing),m({type:_n.DragStart,initialCoordinates:kt,active:ln}),p({type:"onDragStart",event:Ve}),B(He.current),P($t)})},onMove(kt){m({type:_n.DragMove,coordinates:kt})},onEnd:yn(_n.DragEnd),onCancel:yn(_n.DragCancel)});He.current=Bt;function yn(kt){return async function(){const{active:Qe,collisions:Ke,over:Ve,scrollAdjustedTranslate:wt}=q.current;let nn=null;if(Qe&&wt){const{cancelDrop:rn}=j.current;nn={activatorEvent:$t,active:Qe,collisions:Ke,delta:wt,over:Ve},kt===_n.DragEnd&&typeof rn=="function"&&await Promise.resolve(rn(nn))&&(kt=_n.DragCancel)}N.current=null,mr.unstable_batchedUpdates(()=>{m({type:kt}),C(oo.Uninitialized),pe(null),B(null),P(null),He.current=null;const rn=kt===_n.DragEnd?"onDragEnd":"onDragCancel";if(nn){const jn=j.current[rn];jn==null||jn(nn),p({type:rn,event:nn})}})}}},[k]),dt=w.useCallback((Je,at)=>(Ct,an)=>{const Nt=Ct.nativeEvent,$t=k.get(an);if(N.current!==null||!$t||Nt.dndKit||Nt.defaultPrevented)return;const Bt={active:$t};Je(Ct,at.options,Bt)===!0&&(Nt.dndKit={capturedBy:at.sensor},N.current=an,$e(Ct,at))},[k,$e]),Ee=bfe(h,dt);Afe(h),es(()=>{U&&_===oo.Initializing&&C(oo.Initialized)},[U,_]),w.useEffect(()=>{const{onDragMove:Je}=j.current,{active:at,activatorEvent:Ct,collisions:an,over:Nt}=q.current;if(!at||!Ct)return;const $t={active:at,activatorEvent:Ct,collisions:an,delta:{x:Q.x,y:Q.y},over:Nt};mr.unstable_batchedUpdates(()=>{Je==null||Je($t),p({type:"onDragMove",event:$t})})},[Q.x,Q.y]),w.useEffect(()=>{const{active:Je,activatorEvent:at,collisions:Ct,droppableContainers:an,scrollAdjustedTranslate:Nt}=q.current;if(!Je||N.current==null||!at||!Nt)return;const{onDragOver:$t}=j.current,Bt=an.get(ve),yn=Bt&&Bt.rect.current?{id:Bt.id,rect:Bt.rect.current,data:Bt.data,disabled:Bt.disabled}:null,kt={active:Je,activatorEvent:at,collisions:Ct,delta:{x:Nt.x,y:Nt.y},over:yn};mr.unstable_batchedUpdates(()=>{pe(yn),$t==null||$t(kt),p({type:"onDragOver",event:kt})})},[ve]),es(()=>{q.current={activatorEvent:z,active:L,activeNode:J,collisionRect:re,collisions:ce,droppableRects:F,draggableNodes:k,draggingNode:le,draggingNodeRect:xe,droppableContainers:A,over:ge,scrollableAncestors:be,scrollAdjustedTranslate:Q},D.current={initial:xe,translated:re}},[L,J,ce,re,k,le,xe,F,A,ge,be,Q]),gfe({...$,delta:T,draggingRect:re,pointerCoordinates:de,scrollableAncestors:be,scrollableAncestorRects:we});const Me=w.useMemo(()=>({active:L,activeNode:J,activeNodeRect:U,activatorEvent:z,collisions:ce,containerNodeRect:X,dragOverlay:te,draggableNodes:k,droppableContainers:A,droppableRects:F,over:ge,measureDroppableContainers:G,scrollableAncestors:be,scrollableAncestorRects:we,measuringConfiguration:H,measuringScheduled:Z,windowRect:Ae}),[L,J,U,z,ce,X,te,k,A,F,ge,G,be,we,H,Z,Ae]),Ie=w.useMemo(()=>({activatorEvent:z,activators:Ee,active:L,activeNodeRect:U,ariaDescribedById:{draggable:R},dispatch:m,draggableNodes:k,over:ge,measureDroppableContainers:G}),[z,Ee,L,U,m,R,k,ge,G]);return ot.createElement(JI.Provider,{value:y},ot.createElement(D0.Provider,{value:Ie},ot.createElement(d9.Provider,{value:Me},ot.createElement(h9.Provider,{value:Fe},u)),ot.createElement(Bfe,{disabled:(o==null?void 0:o.restoreFocus)===!1})),ot.createElement(Fhe,{...o,hiddenTextDescribedById:R}));function ht(){const Je=(O==null?void 0:O.autoScrollEnabled)===!1,at=typeof l=="object"?l.enabled===!1:l===!1,Ct=S&&!Je&&!at;return typeof l=="object"?{...l,enabled:Ct}:{enabled:Ct}}}),Ufe=w.createContext(null),YT="button",Vfe="Draggable";function qfe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=Nf(Vfe),{activators:a,activatorEvent:o,active:l,activeNodeRect:u,ariaDescribedById:h,draggableNodes:d,over:f}=w.useContext(D0),{role:g=YT,roleDescription:b="draggable",tabIndex:x=0}=i??{},v=(l==null?void 0:l.id)===t,m=w.useContext(v?h9:Ufe),[p,y]=Bg(),[_,C]=Bg(),S=Rfe(a,t),E=Eh(n);es(()=>(d.set(t,{id:t,key:s,node:p,activatorNode:_,data:E}),()=>{const T=d.get(t);T&&T.key===s&&d.delete(t)}),[d,t]);const k=w.useMemo(()=>({role:g,tabIndex:x,"aria-disabled":r,"aria-pressed":v&&g===YT?!0:void 0,"aria-roledescription":b,"aria-describedby":h.draggable}),[r,g,x,v,b,h.draggable]);return{active:l,activatorEvent:o,activeNodeRect:u,attributes:k,isDragging:v,listeners:r?void 0:S,node:p,over:f,setNodeRef:y,setActivatorNodeRef:C,transform:m}}function Gfe(){return w.useContext(d9)}const Kfe="Droppable",Yfe={timeout:25};function Xfe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=Nf(Kfe),{active:a,dispatch:o,over:l,measureDroppableContainers:u}=w.useContext(D0),h=w.useRef({disabled:n}),d=w.useRef(!1),f=w.useRef(null),g=w.useRef(null),{disabled:b,updateMeasurementsFor:x,timeout:v}={...Yfe,...i},m=Eh(x??r),p=w.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(m.current)?m.current:[m.current]),g.current=null},v)},[v]),y=N0({callback:p,disabled:b||!a}),_=w.useCallback((k,T)=>{y&&(T&&(y.unobserve(T),d.current=!1),k&&y.observe(k))},[y]),[C,S]=Bg(_),E=Eh(t);return w.useEffect(()=>{!y||!C.current||(y.disconnect(),d.current=!1,y.observe(C.current))},[C,y]),w.useEffect(()=>(o({type:_n.RegisterDroppable,element:{id:r,key:s,disabled:n,node:C,rect:f,data:E}}),()=>o({type:_n.UnregisterDroppable,key:s,id:r})),[r]),w.useEffect(()=>{n!==h.current.disabled&&(o({type:_n.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,o]),{active:a,rect:f,isOver:(l==null?void 0:l.id)===r,node:C,over:l,setNodeRef:S}}function ck(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Jfe(e,t){return e.reduce((n,r,i)=>{const s=t.get(r);return s&&(n[i]=s),n},Array(e.length))}function Dp(e){return e!==null&&e>=0}function Qfe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Zfe(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const f9=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const s=ck(t,r,n),a=t[i],o=s[i];return!o||!a?null:{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}},Lp={scaleX:1,scaleY:1},epe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:s,overIndex:a}=e;const o=(t=s[n])!=null?t:r;if(!o)return null;if(i===n){const u=s[a];return u?{x:0,y:n<a?u.top+u.height-(o.top+o.height):u.top-o.top,...Lp}:null}const l=tpe(s,i,n);return i>n&&i<=a?{x:0,y:-o.height-l,...Lp}:i<n&&i>=a?{x:0,y:o.height+l,...Lp}:{x:0,y:0,...Lp}};function tpe(e,t,n){const r=e[t],i=e[t-1],s=e[t+1];return r?n<t?i?r.top-(i.top+i.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const p9="Sortable",m9=ot.createContext({activeIndex:-1,containerId:p9,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:f9,disabled:{draggable:!1,droppable:!1}});function npe(e){let{children:t,id:n,items:r,strategy:i=f9,disabled:s=!1}=e;const{active:a,dragOverlay:o,droppableRects:l,over:u,measureDroppableContainers:h}=Gfe(),d=Nf(p9,n),f=o.rect!==null,g=w.useMemo(()=>r.map(S=>typeof S=="object"&&"id"in S?S.id:S),[r]),b=a!=null,x=a?g.indexOf(a.id):-1,v=u?g.indexOf(u.id):-1,m=w.useRef(g),p=!Qfe(g,m.current),y=v!==-1&&x===-1||p,_=Zfe(s);es(()=>{p&&b&&h(g)},[p,g,b,h]),w.useEffect(()=>{m.current=g},[g]);const C=w.useMemo(()=>({activeIndex:x,containerId:d,disabled:_,disableTransforms:y,items:g,overIndex:v,useDragOverlay:f,sortedRects:Jfe(g,l),strategy:i}),[x,d,_.draggable,_.droppable,y,g,v,l,f,i]);return ot.createElement(m9.Provider,{value:C},t)}const rpe=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return ck(n,r,i).indexOf(t)},ipe=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:s,newIndex:a,previousItems:o,previousContainerId:l,transition:u}=e;return!u||!r||o!==s&&i===a?!1:n?!0:a!==i&&t===l},spe={duration:200,easing:"ease"},g9="transform",ope=Ah.Transition.toString({property:g9,duration:0,easing:"linear"}),ape={roleDescription:"sortable"};function lpe(e){let{disabled:t,index:n,node:r,rect:i}=e;const[s,a]=w.useState(null),o=w.useRef(n);return es(()=>{if(!t&&n!==o.current&&r.current){const l=i.current;if(l){const u=pu(r.current,{ignoreTransform:!0}),h={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(h.x||h.y)&&a(h)}}n!==o.current&&(o.current=n)},[t,n,r,i]),w.useEffect(()=>{s&&a(null)},[s]),s}function cpe(e){let{animateLayoutChanges:t=ipe,attributes:n,disabled:r,data:i,getNewIndex:s=rpe,id:a,strategy:o,resizeObserverConfig:l,transition:u=spe}=e;const{items:h,containerId:d,activeIndex:f,disabled:g,disableTransforms:b,sortedRects:x,overIndex:v,useDragOverlay:m,strategy:p}=w.useContext(m9),y=upe(r,g),_=h.indexOf(a),C=w.useMemo(()=>({sortable:{containerId:d,index:_,items:h},...i}),[d,i,_,h]),S=w.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:E,node:k,isOver:T,setNodeRef:A}=Xfe({id:a,data:C,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...l}}),{active:M,activatorEvent:D,activeNodeRect:L,attributes:N,setNodeRef:O,listeners:B,isDragging:z,over:P,setActivatorNodeRef:j,transform:R}=qfe({id:a,data:C,attributes:{...ape,...n},disabled:y.draggable}),I=The(A,O),H=!!M,F=H&&!b&&Dp(f)&&Dp(v),G=!m&&z,Z=G&&F?R:null,W=F?Z??(o??p)({rects:x,activeNodeRect:L,activeIndex:f,overIndex:v,index:_}):null,$=Dp(f)&&Dp(v)?s({id:a,items:h,activeIndex:f,overIndex:v}):_,V=M==null?void 0:M.id,U=w.useRef({activeId:V,items:h,newIndex:$,containerId:d}),X=h!==U.current.items,q=t({active:M,containerId:d,isDragging:z,isSorting:H,id:a,index:_,items:h,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:u,wasDragging:U.current.activeId!=null}),ne=lpe({disabled:!q,index:_,node:k,rect:E});return w.useEffect(()=>{H&&U.current.newIndex!==$&&(U.current.newIndex=$),d!==U.current.containerId&&(U.current.containerId=d),h!==U.current.items&&(U.current.items=h)},[H,$,d,h]),w.useEffect(()=>{if(V===U.current.activeId)return;if(V&&!U.current.activeId){U.current.activeId=V;return}const le=setTimeout(()=>{U.current.activeId=V},50);return()=>clearTimeout(le)},[V]),{active:M,activeIndex:f,attributes:N,data:C,rect:E,index:_,newIndex:$,items:h,isOver:T,isSorting:H,isDragging:z,listeners:B,node:k,overIndex:v,over:P,setNodeRef:I,setActivatorNodeRef:j,setDroppableNodeRef:A,setDraggableNodeRef:O,transform:ne??W,transition:te()};function te(){if(ne||X&&U.current.newIndex===_)return ope;if(!(G&&!ik(D)||!u)&&(H||q))return Ah.Transition.toString({...u,property:g9})}}function upe(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Hg(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const dpe=[st.Down,st.Right,st.Up,st.Left],hpe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:s,over:a,scrollableAncestors:o}}=t;if(dpe.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const f=i.get(d.id);if(f)switch(e.code){case st.Down:r.top<f.top&&l.push(d);break;case st.Up:r.top>f.top&&l.push(d);break;case st.Left:r.left>f.left&&l.push(d);break;case st.Right:r.left<f.left&&l.push(d);break}});const u=Uhe({active:n,collisionRect:r,droppableRects:i,droppableContainers:l,pointerCoordinates:null});let h=e9(u,"id");if(h===(a==null?void 0:a.id)&&u.length>1&&(h=u[1].id),h!=null){const d=s.get(n.id),f=s.get(h),g=f?i.get(f.id):null,b=f==null?void 0:f.node.current;if(b&&g&&d&&f){const v=j0(b).some((S,E)=>o[E]!==S),m=v9(d,f),p=fpe(d,f),y=v||!m?{x:0,y:0}:{x:p?r.width-g.width:0,y:p?r.height-g.height:0},_={x:g.left,y:g.top};return y.x&&y.y?_:Th(_,y)}}}};function v9(e,t){return!Hg(e)||!Hg(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function fpe(e,t){return!Hg(e)||!Hg(t)||!v9(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const x9=new Set,br=new WeakMap,Dc=new WeakMap,Ba=new WeakMap,Q_=new WeakMap,ppe=new WeakMap,Lc=new WeakMap,Wg=new WeakMap,yd=new WeakSet;let zo,uk=0,dk=0;const Ss="__aa_tgt",Mh="__aa_del",Ug="__aa_new",mpe=e=>{const t=_pe(e);t&&t.forEach(n=>wpe(n))},gpe=e=>{e.forEach(t=>{t.target===zo&&xpe(),br.has(t.target)&&ol(t.target)})};function vpe(e){const t=Q_.get(e);t==null||t.disconnect();let n=br.get(e),r=0;const i=5;n||(n=Pc(e),br.set(e,n));const{offsetWidth:s,offsetHeight:a}=zo,l=[n.top-i,s-(n.left+i+n.width),a-(n.top+i+n.height),n.left-i].map(h=>`${-1*Math.floor(h)}px`).join(" "),u=new IntersectionObserver(()=>{++r>1&&ol(e)},{root:zo,threshold:1,rootMargin:l});u.observe(e),Q_.set(e,u)}function ol(e){clearTimeout(Wg.get(e));const t=L0(e),n=jh(t)?500:t.duration;Wg.set(e,setTimeout(async()=>{const r=Ba.get(e);try{await(r==null?void 0:r.finished),br.set(e,Pc(e)),vpe(e)}catch{}},n))}function xpe(){clearTimeout(Wg.get(zo)),Wg.set(zo,setTimeout(()=>{x9.forEach(e=>w9(e,t=>y9(()=>ol(t))))},100))}function ype(e){setTimeout(()=>{ppe.set(e,setInterval(()=>y9(ol.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function y9(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Z_,Xl;const bpe=typeof window<"u"&&"ResizeObserver"in window;bpe&&(zo=document.documentElement,Z_=new MutationObserver(mpe),Xl=new ResizeObserver(gpe),window.addEventListener("scroll",()=>{dk=window.scrollY,uk=window.scrollX}),Xl.observe(zo));function _pe(e){return e.reduce((r,i)=>[...r,...Array.from(i.addedNodes),...Array.from(i.removedNodes)],[]).every(r=>r.nodeName==="#comment")?!1:e.reduce((r,i)=>{if(r===!1)return!1;if(i.target instanceof Element){if(wy(i.target),!r.has(i.target)){r.add(i.target);for(let s=0;s<i.target.children.length;s++){const a=i.target.children.item(s);if(a){if(Mh in a)return!1;wy(i.target,a),r.add(a)}}}if(i.removedNodes.length)for(let s=0;s<i.removedNodes.length;s++){const a=i.removedNodes[s];if(Mh in a)return!1;a instanceof Element&&(r.add(a),wy(i.target,a),Dc.set(a,[i.previousSibling,i.nextSibling]))}}return r},new Set)}function wy(e,t){!t&&!(Ss in e)?Object.defineProperty(e,Ss,{value:e}):t&&!(Ss in t)&&Object.defineProperty(t,Ss,{value:e})}function wpe(e){var t;const n=e.isConnected,r=br.has(e);n&&Dc.has(e)&&Dc.delete(e),Ba.has(e)&&((t=Ba.get(e))===null||t===void 0||t.cancel()),Ug in e?XT(e):r&&n?Cpe(e):r&&!n?kpe(e):XT(e)}function Bi(e){return Number(e.replace(/[^0-9.\-]/g,""))}function Spe(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function Pc(e){const t=e.getBoundingClientRect(),{x:n,y:r}=Spe(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function b9(e,t,n){let r=t.width,i=t.height,s=n.width,a=n.height;const o=getComputedStyle(e);if(o.getPropertyValue("box-sizing")==="content-box"){const u=Bi(o.paddingTop)+Bi(o.paddingBottom)+Bi(o.borderTopWidth)+Bi(o.borderBottomWidth),h=Bi(o.paddingLeft)+Bi(o.paddingRight)+Bi(o.borderRightWidth)+Bi(o.borderLeftWidth);r-=h,s-=h,i-=u,a-=u}return[r,s,i,a].map(Math.round)}function L0(e){return Ss in e&&Lc.has(e[Ss])?Lc.get(e[Ss]):{duration:250,easing:"ease-in-out"}}function _9(e){if(Ss in e)return e[Ss]}function hk(e){const t=_9(e);return t?yd.has(t):!1}function w9(e,...t){t.forEach(n=>n(e,Lc.has(e)));for(let n=0;n<e.children.length;n++){const r=e.children.item(n);r&&t.forEach(i=>i(r,Lc.has(r)))}}function fk(e){return Array.isArray(e)?e:[e]}function jh(e){return typeof e=="function"}function Cpe(e){const t=br.get(e),n=Pc(e);if(!hk(e))return br.set(e,n);let r;if(!t)return;const i=L0(e);if(typeof i!="function"){const s=t.left-n.left,a=t.top-n.top,[o,l,u,h]=b9(e,t,n),d={transform:`translate(${s}px, ${a}px)`},f={transform:"translate(0, 0)"};o!==l&&(d.width=`${o}px`,f.width=`${l}px`),u!==h&&(d.height=`${u}px`,f.height=`${h}px`),r=e.animate([d,f],{duration:i.duration,easing:i.easing})}else{const[s]=fk(i(e,"remain",t,n));r=new Animation(s),r.play()}Ba.set(e,r),br.set(e,n),r.addEventListener("finish",ol.bind(null,e))}function XT(e){Ug in e&&delete e[Ug];const t=Pc(e);br.set(e,t);const n=L0(e);if(!hk(e))return;let r;if(typeof n!="function")r=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"});else{const[i]=fk(n(e,"add",t));r=new Animation(i),r.play()}Ba.set(e,r),r.addEventListener("finish",ol.bind(null,e))}function JT(e,t){var n;e.remove(),br.delete(e),Dc.delete(e),Ba.delete(e),(n=Q_.get(e))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(Mh in e&&delete e[Mh],Object.defineProperty(e,Ug,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function kpe(e){var t;if(!Dc.has(e)||!br.has(e))return;const[n,r]=Dc.get(e);Object.defineProperty(e,Mh,{value:!0,configurable:!0});const i=window.scrollX,s=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=_9(e))===null||t===void 0||t.appendChild(e),!hk(e))return JT(e);const[a,o,l,u]=Tpe(e),h=L0(e),d=br.get(e);(i!==uk||s!==dk)&&Epe(e,i,s,h);let f,g={position:"absolute",top:`${a}px`,left:`${o}px`,width:`${l}px`,height:`${u}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!jh(h))Object.assign(e.style,g),f=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:h.duration,easing:"ease-out"});else{const[b,x]=fk(h(e,"remove",d));(x==null?void 0:x.styleReset)!==!1&&(g=(x==null?void 0:x.styleReset)||g,Object.assign(e.style,g)),f=new Animation(b),f.play()}Ba.set(e,f),f.addEventListener("finish",JT.bind(null,e,g))}function Epe(e,t,n,r){const i=uk-t,s=dk-n,a=document.documentElement.style.scrollBehavior;if(getComputedStyle(zo).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+i,window.scrollY+s),!e.parentElement)return;const l=e.parentElement;let u=l.clientHeight,h=l.clientWidth;const d=performance.now();function f(){requestAnimationFrame(()=>{if(!jh(r)){const g=u-l.clientHeight,b=h-l.clientWidth;d+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-b,top:window.scrollY-g}),u=l.clientHeight,h=l.clientWidth,f()):document.documentElement.style.scrollBehavior=a}})}f()}function Tpe(e){const t=br.get(e),[n,,r]=b9(e,t,Pc(e));let i=e.parentElement;for(;i&&(getComputedStyle(i).position==="static"||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const s=getComputedStyle(i),a=br.get(i)||Pc(i),o=Math.round(t.top-a.top)-Bi(s.borderTopWidth),l=Math.round(t.left-a.left)-Bi(s.borderLeftWidth);return[o,l,n,r]}function Ape(e,t={}){return Z_&&Xl&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!jh(t)&&!t.disrespectUserMotionPreference||(yd.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),w9(e,ol,ype,i=>Xl==null?void 0:Xl.observe(i)),jh(t)?Lc.set(e,t):Lc.set(e,{duration:250,easing:"ease-in-out",...t}),Z_.observe(e,{childList:!0}),x9.add(e))),Object.freeze({parent:e,enable:()=>{yd.add(e)},disable:()=>{yd.delete(e)},isEnabled:()=>yd.has(e)})}function pk(e){const[t,n]=w.useState(),r=w.useMemo(()=>e,[]),i=w.useCallback(a=>{a instanceof HTMLElement?n(Ape(a,r)):n(void 0)},[r]),s=w.useCallback(a=>{t&&(a?t.enable():t.disable())},[t]);return[i,s]}function Rpe({id:e,disabled:t,className:n,children:r}){const{attributes:i,listeners:s,setNodeRef:a,transform:o,transition:l}=cpe({id:e,disabled:t});i.role="listitem";const u={transform:Ah.Transform.toString(o&&{...o,scaleY:1}),transition:l};return c.jsxs("li",{ref:a,style:u,...i,className:Y("bg-card rounded-lg border px-2 py-3 flex gap-3 relative aria-pressed:z-50 aria-pressed:opacity-85 aria-pressed:shadow-xl",n),children:[c.jsx("div",{...s,title:"Drag to reorder",className:Y("text-muted-foreground my-auto",t?"cursor-not-allowed opacity-50":"cursor-grab hover:text-primary hover:scale-110"),children:c.jsx(EX,{className:"size-6"})}),r]})}function Mpe({onDragEnd:e,className:t,children:n,ids:r}){const[i,s]=pk(),a=zhe(IT(lk),IT(ok,{coordinateGetter:hpe})),o=l=>{e(l),setTimeout(()=>{s(!0)},1)};return c.jsx(Wfe,{sensors:a,collisionDetection:Whe,onDragStart:()=>s(!1),onDragCancel:()=>s(!0),onDragEnd:o,children:c.jsx(npe,{items:r,strategy:epe,children:c.jsx("ol",{ref:i,className:t,children:n})})})}var S9="abcdefghijklmnopqrstuvwxyz",C9="ABCDEFGHIJKLMNOPQRSTUVWXYZ",k9="0123456789",jpe="346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz",Npe="6789BCDFGHJKLMNPQRTWbcdfghjkmnpqrtwz";const Dpe=k9,Lpe=S9,Ppe=C9;var Ope=Dpe+Lpe+Ppe,Ipe={lowercase:S9,uppercase:C9,numbers:k9,nolookalikes:jpe,nolookalikesSafe:Npe,alphanumeric:Ope};let $pe=e=>crypto.getRandomValues(new Uint8Array(e)),Bpe=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,i=-~(1.6*r*t/e.length);return(s=t)=>{let a="";for(;;){let o=n(i),l=i|0;for(;l--;)if(a+=e[o[l]&r]||"",a.length>=s)return a}}},Fpe=(e,t=21)=>Bpe(e,t|0,$pe);function zpe({changelogData:e}){const[t,n]=w.useState(!1),r=w.useMemo(()=>{if(!(e!=null&&e.length))return null;const o=e[e.length-1],l=new Date(o.ts),u=Rc(l,"2-digit","2-digit"),h=Mc(l,"long"),d=vh(l)?u:h;return{author:o.author,dateTime:d}},[e]),i=w.useMemo(()=>e?[...e].reverse():null,[e]),s=()=>{n(!0)},a=Array.isArray(e)?"No changes yet":"loading...";return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex xs:flex-col max-xs:items-center max-xs:gap-2 max-xs:w-full px-2 py-1 rounded-lg text-muted-foreground group relative",children:[i!=null&&i.length?c.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-[inherit] bg-card opacity-0 border group-hover:opacity-100 transition-opacity text-primary group-active:bg-primary group-active:text-primary-foreground group-active:border-none select-none cursor-pointer",onClick:s,children:"View Changelog"}):null,c.jsxs("div",{className:"tracking-wider leading-3 font-semibold",children:[c.jsx(UX,{className:"max-xs:hidden size-4 inline-block align-text-bottom"})," Last Updated",c.jsx("span",{className:"xs:hidden",children:":"})]}),c.jsxs("div",{className:"text-xs",children:[c.jsx(tX,{className:"size-4 inline-block align-text-bottom"})," ",(r==null?void 0:r.dateTime)??a]})]}),c.jsx(ea,{open:t,onOpenChange:n,children:c.jsxs(Us,{className:"max-sm:p-4 max-w-xl",children:[c.jsx(Vs,{children:c.jsx(qs,{children:"Recent Changes"})}),c.jsx("div",{className:"pr-3 max-h-[80vh] overflow-auto space-y-3",style:{scrollbarWidth:"thin"},children:i==null?void 0:i.map((o,l)=>c.jsx(Hpe,{entry:o},l))})]})})]})}function Hpe({entry:e}){return c.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-md border odd:bg-card/75",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsxs("div",{className:"font-semibold text-accent",children:[c.jsx(sJ,{className:"size-5 mr-2 inline-block align-text-bottom opacity-65"}),e.author]}),c.jsx("div",{className:"text-sm text-muted-foreground",children:ws(e.ts,"short","short")})]}),c.jsx("div",{className:"flex gap-1 flex-wrap text-sm",children:e.keys.length?e.keys.map((t,n)=>c.jsxs("span",{children:[c.jsx("div",{className:"inline px-1 py-0.5 font-mono tracking-wide rounded bg-secondary/50",children:t},t),n<e.keys.length-1&&","]})):c.jsx("div",{className:"italic",children:"No changes"})})]})}function E9(e){const t=w.useMemo(()=>e.parentName&&e.parentLink?c.jsxs(c.Fragment,{children:[c.jsx(Ti,{href:e.parentLink,className:"hover:text-secondary-foreground hover:underline",children:e.parentName}),c.jsx(SS,{className:"opacity-75"}),c.jsx("li",{className:"text-secondary-foreground",children:e.title})]}):c.jsx("li",{className:"text-secondary-foreground",children:e.title}),[e]);return c.jsx("header",{className:"border-b mb-4",children:c.jsxs("div",{className:"xbg-blue-700 max-xs:pb-2 xs:min-h-16 flex max-xs:flex-col gap-2 xs:gap-4 max-xs:items-start justify-between items-center px-4 py-2",children:[c.jsxs("ol",{className:"xbg-green-500 flex flex-wrap items-center gap-1 sm:gap-2.5 text-2xl text-muted-foreground leading-none",children:[c.jsx("span",{className:"opacity-75",children:e.icon}),t]}),e.children]})})}const Wpe=Fpe(Ipe.alphanumeric,21);function Upe(){var E,k;const[e,t]=w.useState(!1),[n,r]=w.useState(),i=Yv(),{hasPerm:s}=Xn(),[a,o]=w.useState(!1),[l,u]=w.useState(null),[h,d]=w.useState(!1),f=bt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),g=bt({method:"POST",path:"/settings/banTemplates",throwGenericErrors:!0}),b=nl("/settings/banTemplates",async()=>{const T=await f({});if(!T)throw new Error("No data returned");return T},{isPaused:()=>a||!!l||e}),x=async T=>{o(!0),u(null),d(!1);try{const A=await b.mutate(T,!1);if(!await g({data:A}))throw new Error("No data returned");d(!0)}catch(A){A instanceof b_||A instanceof Error?u(A.message):u(JSON.stringify(A))}finally{o(!1)}};w.useEffect(()=>{if(!h)return;const T=setTimeout(()=>{d(!1)},5e3);return()=>clearTimeout(T)},[h]);const v=T=>{const{active:A,over:M}=T;M&&A.id!==M.id&&x(D=>{const L=D.findIndex(O=>O.id===A.id),N=D.findIndex(O=>O.id===M.id);return ck(D,L,N)})},m=({id:T,reason:A,duration:M})=>{x(T?D=>D.map(L=>L.id===T?{id:T,reason:A,duration:M}:L):D=>[...D,{id:Wpe(21),reason:A,duration:M}]),t(!1),r(void 0)},p=T=>{if(!T||!b.data)return;const A=b.data.find(M=>M.id===T);A&&i({title:"Remove Template",actionLabel:"Remove",confirmBtnVariant:"destructive",message:c.jsxs(c.Fragment,{children:["Are you sure you want to remove this ban template? ",c.jsx("br",{}),c.jsx("blockquote",{className:"opacity-70 italic border-l-4 pl-2",children:A.reason})]}),onConfirm:()=>{console.log("Remove confirmed",T),x(M=>M.filter(D=>D.id!==T))}})},y=T=>{!T||!b.data||(console.log("Edit item",T),r(b.data.find(A=>A.id===T)),t(!0))},_=()=>{r(void 0),t(!0)};let C;if(b.error){const T=()=>b.mutate(),A=((E=b==null?void 0:b.error)==null?void 0:E.message)??"unknown error";C=c.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[c.jsxs("span",{className:"text-destructive-inline",children:["Error loading: ",A]}),c.jsx("br",{}),c.jsx("button",{className:"underline hover:text-accent",onClick:T,children:"Try again?"})]})}else if(a)C=c.jsx("span",{className:"text-success-inlinex animate-pulse",children:"Saving..."});else if(l){const T=()=>{b.data&&x(()=>b.data)},A=l??"unknown error";C=c.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[c.jsxs("span",{className:"text-destructive-inline",children:["Error saving: ",A]}),c.jsx("br",{}),c.jsx("button",{className:"underline hover:text-accent",onClick:T,children:"Try again?"})]})}else h?C=c.jsx("span",{className:"text-success-inline",children:"Saved."}):(b.isLoading||b.isValidating)&&(C=c.jsx("span",{className:"text-muted-foreground",children:"Loading..."}));const S=s("settings.write");return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto",children:[c.jsxs("p",{className:"px-2 md:px-0",children:["Here you can configure ban reasons and durations that will appear as dropdown options when banning a player. ",c.jsx("br",{}),"This is useful for common reasons that happen frequently, like violation of your server rules. ",c.jsx("br",{}),S?c.jsxs("span",{className:"text-muted-foreground italic",children:["TIP: You can also drag and drop to reorder the list. ",c.jsx("br",{})]}):c.jsxs("span",{className:"text-warning-inline",children:["You need the ",c.jsx(Be,{className:"text-warning-inline",children:"Settings: Change"})," permission to edit these reasons."]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap justify-between text-muted-foreground px-2 md:px-0",children:[c.jsxs("span",{className:"shrink-0",children:["Configured reasons: ",((k=b.data)==null?void 0:k.length)??0]}),C]}),!b.data&&!l&&c.jsxs("div",{className:"text-muted-foreground text-lg md:text-2xl text-center my-4 px-2 md:px-0",children:[c.jsx(qt,{className:"inline animate-spin h-8"}),"Loading..."]}),b.data&&c.jsxs(Mpe,{className:"space-y-2 border p-2 xs:rounded-lg",ids:b.data.map(T=>T.id),onDragEnd:v,children:[b.data.length?b.data.map(T=>c.jsx(Rpe,{id:T.id,disabled:!S,children:c.jsx(khe,{onEdit:y,onRemove:p,disabled:!S,...T})},T.id)):c.jsx("div",{className:"text-muted-foreground text-lg md:text-2xl text-center my-4 px-2 md:px-0",children:"No reasons configured yet."}),c.jsx(Ehe,{onClick:_,disabled:!S})]})]})]}),c.jsx(Che,{reasonData:n,onSave:m,isDialogOpen:e,setIsDialogOpen:t},n==null?void 0:n.id)]})}function Vpe(){return c.jsxs("div",{className:"w-full mb-10",children:[c.jsx(E9,{icon:c.jsx(AS,{}),title:"Ban Templates",parentName:"Settings",parentLink:"/settings"}),c.jsx("div",{className:"px-0 xs:px-3 md:px-0 flex flex-row gap-2 w-full",children:c.jsx(Upe,{})})]})}const Gu=150;function QT({pageName:e}){const[t,n]=w.useState(!0),[r,i]=w.useState(""),[s,a]=w.useState(!1),o=cu(),l=of(),u=bt({method:"GET",path:`/systemLog/${e}`,throwGenericErrors:!0}),h=w.useRef(null),d=w.useRef(null),f=w.useMemo(()=>new q8.Terminal({...nP,theme:o?Ng:Dg}),[]),g=w.useMemo(()=>new J8.FitAddon,[]),b=w.useMemo(()=>new Z8.SearchAddon,[]),x=(S,E)=>{nu(E)},v=w.useMemo(()=>new tP.WebLinksAddon(x),[]),m=Un(Gu,S=>{window.postMessage({type:"liveConsoleSearchHotkey",action:S})},{noTrailing:!0}),p=()=>{if(!d.current||!f.element||!g){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const S=g.proposeDimensions();S?f.resize(S.cols,S.rows):console.log("refitTerminal: no proposed dimensions")};Ei("resize",hS(100,p)),w.useEffect(()=>{f.element&&(f.options.theme=o?Ng:Dg,f.refresh(0,f.rows-1),p())},[f,o]),w.useEffect(()=>{if(d.current&&h.current&&!f.element){console.log("xterm init"),d.current.innerHTML="",f.loadAddon(g),f.loadAddon(b),f.loadAddon(v),f.loadAddon(new Y8.CanvasAddon),f.loadAddon(new vO(h.current,d.current)),f.open(d.current),f.write("\x1B[?25l"),p();const S=Un(Gu,()=>{f.scrollLines(Math.min(1,2-f.rows))},{noTrailing:!0}),E=Un(Gu,()=>{f.scrollLines(Math.max(1,f.rows-2))},{noTrailing:!0}),k=Un(Gu,()=>{f.scrollToTop()},{noTrailing:!0}),T=Un(Gu,()=>{f.scrollToBottom()},{noTrailing:!0});f.attachCustomKeyEventHandler(A=>A.code==="F5"||A.code==="Escape"||A.code==="KeyF"&&(A.ctrlKey||A.metaKey)||A.code==="F3"?!1:A.code==="KeyC"&&(A.ctrlKey||A.metaKey)?(document.execCommand("copy"),f.clearSelection(),!1):A.code==="PageUp"?(S(),!1):A.code==="PageDown"?(E(),!1):A.code==="Home"?(k(),!1):A.code==="End"?(T(),!1):!aC(A)),u({success:(A,M)=>{n(!1),y(A.data),f.writeln(""),f.writeln("\x1B[33m[END OF LOG - REFRESH THE PAGE TO LOAD MORE]\x1B")},error:(A,M)=>{n(!1),i(A)}})}},[f]),Ei("keydown",S=>{S.code==="F5"?t&&(l(),S.preventDefault()):S.code==="Escape"?(b.clearDecorations(),a(!1)):S.code==="KeyF"&&(S.ctrlKey||S.metaKey)?(s?m("focus"):a(!0),S.preventDefault()):S.code==="F3"&&(m(S.shiftKey?"previous":"next"),S.preventDefault())});const y=S=>{const E=S.split(/\r?\n/);E.length&&!E[E.length-1]&&E.pop();for(const k of E)f.writeln(k)};let _="Console Log",C="Output of txAdmin to it's parent terminal, including usually hidden debug messages.";return e==="action"&&(_="Action Log",C="Log of all actions taken by txAdmin or any admin."),c.jsxs("div",{className:"text-primary flex flex-col h-full w-full bg-card border md:rounded-xl overflow-clip",children:[c.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.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:[c.jsx("polyline",{points:"4 17 10 11 4 5"}),c.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),c.jsxs("p",{className:"font-mono text-sm",children:[_," - ",c.jsx("span",{className:"text-muted-foreground",children:C})]})]})}),c.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[t&&!r?c.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[c.jsx(qt,{className:"w-16 h-16 animate-spin"}),c.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Loading..."})]})}):null,r&&c.jsxs("div",{className:"absolute inset-0 z-20 bg-black/60 flex flex-col gap-4 items-center justify-center",children:[c.jsxs("h2",{className:"text-2xl tracking-wider font-light text-muted-foreground select-none",children:["Error fetching ",_,":"]}),c.jsx("p",{className:"mx-8 max-w-screen-md text-destructive-inline font-mono",children:r})]}),c.jsx("div",{ref:d,className:"absolute top-1 left-2 right-0 bottom-0"}),c.jsx(gO,{show:s,setShow:a,searchAddon:b}),c.jsx("button",{ref:h,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{f.scrollToBottom()},children:c.jsx(qD,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]})]})}const Oc=w.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:Y("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 placeholder:opacity-50",e),ref:n,...t}));Oc.displayName="Textarea";const qpe=Q7,T9=w.forwardRef(({children:e},t)=>c.jsx(_0,{ref:t,asChild:!0,children:e}));T9.displayName=_0.displayName;const A9=w.forwardRef(({className:e,...t},n)=>c.jsx(C0,{ref:n,className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(CS,{className:"h-4 w-4"})}));A9.displayName=C0.displayName;const R9=w.forwardRef(({className:e,...t},n)=>c.jsx(k0,{ref:n,className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Za,{className:"h-4 w-4"})}));R9.displayName=k0.displayName;const M9=w.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>c.jsx(Z7,{children:c.jsxs(w0,{ref:i,className:Y("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:[c.jsx(A9,{}),c.jsx(eO,{className:Y("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(R9,{})]})}));M9.displayName=w0.displayName;const ew=w.forwardRef(({className:e,children:t,...n},r)=>c.jsx(S0,{ref:r,className:Y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 px-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:c.jsx(nO,{children:t})}));ew.displayName=S0.displayName;const ZT=150,eA="!add-new",Gpe=["permanent","2 hours","8 hours","1 day","2 days","1 week","2 weeks"],j9=w.forwardRef(function({banTemplates:t,disabled:n,onNavigateAway:r},i){const s=w.useRef(null),a=w.useRef(null),o=zs()[1],[l,u]=w.useState("2 days"),[h,d]=w.useState("days"),f=tC();w.useImperativeHandle(i,()=>({getData:()=>{var v,m;return{reason:(v=s.current)==null?void 0:v.value.trim(),duration:l==="custom"?`${(m=a.current)==null?void 0:m.value} ${h}`:l}},clearData:()=>{!s.current||!a.current||(s.current.value="",a.current.value="",u("2 days"),d("days"))},focusReason:()=>{var v;(v=s.current)==null||v.focus()}}),[s,a,l,h]);const g=v=>{if(v===eA)o("/settings/ban-templates"),r==null||r();else{if(!t)return;const m=t.find(y=>y.id===v);if(!m)return;const p=rg(m.duration);Gpe.includes(p)?u(p):typeof m.duration=="object"&&(u("custom"),a.current.value=m.duration.value.toString(),d(m.duration.unit)),s.current.value=m.reason,setTimeout(()=>{s.current.focus()},50)}},b=w.useMemo(()=>{if(t)return t.map((v,m)=>{const p=NK(v.duration),y=v.reason.length>ZT?v.reason.slice(0,ZT-3)+"...":v.reason;return c.jsxs(ew,{value:v.id,className:"focus:bg-secondary focus:text-secondary-foreground",children:[c.jsx("span",{className:"inline-block pr-1 font-mono opacity-75 min-w-[4ch]",children:p})," ",y]},m)})},[t]);let x;return Array.isArray(t)?t.length?x=c.jsxs(c.Fragment,{children:[b,c.jsxs(ew,{value:eA,className:"font-bold text-warning-inline",children:["Add Ban Template",c.jsx(La,{className:"inline mr-1 h-4"})]})]}):x=c.jsxs("div",{className:"text-warning-inline text-center p-4",children:["You do not have any template configured. ",c.jsx("br",{}),c.jsxs(Ti,{href:"/settings/ban-templates",className:"cursor-pointer underline hover:text-accent",onClick:()=>{f()},children:["Add Ban Template",c.jsx(La,{className:"inline mr-1 h-4"})]})]}):x=c.jsx("div",{className:"text-secondary-foreground text-center p-4",children:c.jsx(qt,{className:"inline animate-spin size-6"})}),c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx(Yt,{htmlFor:"banReason",children:"Reason"}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx(yt,{id:"banReason",ref:s,placeholder:"The reason for the ban, rule violated, etc.",className:"w-full",disabled:n,autoFocus:!0}),c.jsxs(qpe,{onValueChange:g,disabled:n,children:[c.jsx(T9,{className:"tracking-wide",children:c.jsx("button",{className:Y("size-10 inline-flex justify-center items-center rounded-md shrink-0","ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","border bg-black/20 shadow-sm","hover:bg-primary hover:text-primary-foreground hover:border-primary","disabled:opacity-50 disabled:cursor-not-allowed"),children:c.jsx(fX,{className:"size-5"})})}),c.jsx(M9,{className:"tracking-wide w-[calc(100vw-1rem)] sm:max-w-screen-sm",align:"end",children:x})]})]})]}),c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx(Yt,{htmlFor:"durationSelect",children:"Duration"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs(gn,{onValueChange:u,value:l,disabled:n,children:[c.jsx(un,{id:"durationSelect",className:"tracking-wide",children:c.jsx(vn,{placeholder:"Select Duration"})}),c.jsxs(dn,{className:"tracking-wide",children:[c.jsx(ye,{value:"custom",className:"font-bold",children:"Custom (set below)"}),c.jsx(ye,{value:"2 hours",children:"2 HOURS"}),c.jsx(ye,{value:"8 hours",children:"8 HOURS"}),c.jsx(ye,{value:"1 day",children:"1 DAY"}),c.jsx(ye,{value:"2 days",children:"2 DAYS"}),c.jsx(ye,{value:"1 week",children:"1 WEEK"}),c.jsx(ye,{value:"2 weeks",children:"2 WEEKS"}),c.jsx(ye,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),c.jsxs("div",{className:"flex flex-row gap-2",children:[c.jsx(yt,{id:"durationMultiplier",type:"number",placeholder:"123",required:!0,disabled:l!=="custom"||n,ref:a}),c.jsxs(gn,{onValueChange:d,value:h,children:[c.jsx(un,{className:"tracking-wide",id:"durationUnits",disabled:l!=="custom"||n,children:c.jsx(vn,{})}),c.jsxs(dn,{className:"tracking-wide",children:[c.jsx(ye,{value:"hours",children:"HOURS"}),c.jsx(ye,{value:"days",children:"DAYS"}),c.jsx(ye,{value:"weeks",children:"WEEKS"}),c.jsx(ye,{value:"months",children:"MONTHS"})]})]})]})]})]})]})});function Kpe(){const e=w.useRef(null),t=w.useRef(null),[n,r]=w.useState(!1),{hasPerm:i}=Xn(),s=bt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),a=bt({method:"POST",path:"/history/addLegacyBan",throwGenericErrors:!0}),o=()=>{if(!e.current||!t.current)return;const{reason:h,duration:d}=t.current.getData();if(!h||h.length<3){ze.warning("The reason must be at least 3 characters long."),t.current.focusReason();return}const f=e.current.value;if(!f){ze.warning("You must enter at least one identifier."),e.current.focus();return}const g=f.toLowerCase().split(/[,;\s\n]+/g).map(b=>b.trim()).filter(Boolean);if(!g.length){ze.warning("You must enter at least one valid identifier."),e.current.focus();return}r(!0),a({data:{identifiers:g,reason:h,duration:d},toastLoadingMessage:"Banning identifiers...",genericHandler:{successMsg:"Identifiers banned."},finally:()=>r(!1),success:b=>{e.current.value="",e.current.focus()},error:b=>{e.current.focus()}})},l=nl("/settings/banTemplates",async()=>{const h=await s({});if(!h)throw new Error("No data returned");return h}),u=i("players.ban");return c.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto px-2 md:px-0",children:[c.jsxs("div",{className:"px-2 md:px-0",children:[c.jsx("h1",{className:"text-3xl mb-2",children:"Ban Identifiers"}),c.jsxs("p",{children:["Here you can ban specific player identifiers (like ",c.jsx(Be,{children:"license"})," and ",c.jsx(Be,{children:"discord"}),") without having to search for a registered player.",c.jsx("br",{}),"Bans without a single ",c.jsx(Be,{children:"license"})," identifier are considered ",c.jsx("em",{children:"Legacy Bans"})," and should be avoided if possible. ",c.jsx("br",{}),u?null:c.jsxs("span",{className:"text-warning-inline",children:["You need the ",c.jsx(Be,{className:"text-warning-inline",children:"Player: Ban"})," permission to use this feature."]})]})]}),c.jsxs("div",{className:"grid lg:grid-cols-2 gap-4 border bg-card p-4 rounded-lg",children:[c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx(Yt,{htmlFor:"banIdentifiers",children:"Identifiers"}),c.jsx(Oc,{ref:e,className:"h-full",disabled:n||!u,placeholder:"discord:xxxx, fivem:xxxx, license:xxxx, steam:xxxx, etc..."})]}),c.jsx(j9,{ref:t,banTemplates:l.data,disabled:n||!u})]}),c.jsxs("div",{className:"flex place-content-center gap-4",children:[c.jsx(Re,{size:"sm",variant:"outline",disabled:n||!u,onClick:()=>{var h;(h=t.current)==null||h.clearData()},children:"Clear"}),c.jsx(Re,{size:"sm",variant:"destructive",disabled:n||!u,onClick:o,children:n?c.jsxs("span",{className:"flex items-center leading-relaxed",children:[c.jsx(qt,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})]})]})}var N9={exports:{}},Ype="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Xpe=Ype,Jpe=Xpe;function D9(){}function L9(){}L9.resetWarningCache=D9;var Qpe=function(){function e(r,i,s,a,o,l){if(l!==Jpe){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:L9,resetWarningCache:D9};return n.PropTypes=n,n};N9.exports=Qpe();var Zpe=N9.exports;const ee=Rn(Zpe);var mk=Lf(),qe=e=>Df(e,mk),gk=Lf();qe.write=e=>Df(e,gk);var P0=Lf();qe.onStart=e=>Df(e,P0);var vk=Lf();qe.onFrame=e=>Df(e,vk);var xk=Lf();qe.onFinish=e=>Df(e,xk);var hc=[];qe.setTimeout=(e,t)=>{const n=qe.now()+t,r=()=>{const s=hc.findIndex(a=>a.cancel==r);~s&&hc.splice(s,1),xo-=~s?1:0},i={time:n,handler:e,cancel:r};return hc.splice(P9(n),0,i),xo+=1,O9(),i};var P9=e=>~(~hc.findIndex(t=>t.time>e)||~hc.length);qe.cancel=e=>{P0.delete(e),vk.delete(e),xk.delete(e),mk.delete(e),gk.delete(e)};qe.sync=e=>{tw=!0,qe.batchedUpdates(e),tw=!1};qe.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...i){t=i,qe.onStart(n)}return r.handler=e,r.cancel=()=>{P0.delete(n),t=null},r};var yk=typeof window<"u"?window.requestAnimationFrame:()=>{};qe.use=e=>yk=e;qe.now=typeof performance<"u"?()=>performance.now():Date.now;qe.batchedUpdates=e=>e();qe.catch=console.error;qe.frameLoop="always";qe.advance=()=>{qe.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):$9()};var vo=-1,xo=0,tw=!1;function Df(e,t){tw?(t.delete(e),e(0)):(t.add(e),O9())}function O9(){vo<0&&(vo=0,qe.frameLoop!=="demand"&&yk(I9))}function eme(){vo=-1}function I9(){~vo&&(yk(I9),qe.batchedUpdates($9))}function $9(){const e=vo;vo=qe.now();const t=P9(vo);if(t&&(B9(hc.splice(0,t),n=>n.handler()),xo-=t),!xo){eme();return}P0.flush(),mk.flush(e?Math.min(64,vo-e):16.667),vk.flush(),gk.flush(),xk.flush()}function Lf(){let e=new Set,t=e;return{add(n){xo+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return xo-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,xo-=t.size,B9(t,r=>r(n)&&e.add(r)),xo+=e.size,t=e)}}}function B9(e,t){e.forEach(n=>{try{t(n)}catch(r){qe.catch(r)}})}var tme=Object.defineProperty,nme=(e,t)=>{for(var n in t)tme(e,n,{get:t[n],enumerable:!0})},ji={};nme(ji,{assign:()=>ime,colors:()=>jo,createStringInterpolator:()=>_k,skipAnimation:()=>z9,to:()=>F9,willAdvance:()=>wk});function nw(){}var rme=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ue={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function ms(e,t){if(ue.arr(e)){if(!ue.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var We=(e,t)=>e.forEach(t);function ts(e,t,n){if(ue.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(const r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var rr=e=>ue.und(e)?[]:ue.arr(e)?e:[e];function Gd(e,t){if(e.size){const n=Array.from(e);e.clear(),We(n,t)}}var bd=(e,...t)=>Gd(e,n=>n(...t)),bk=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),_k,F9,jo=null,z9=!1,wk=nw,ime=e=>{e.to&&(F9=e.to),e.now&&(qe.now=e.now),e.colors!==void 0&&(jo=e.colors),e.skipAnimation!=null&&(z9=e.skipAnimation),e.createStringInterpolator&&(_k=e.createStringInterpolator),e.requestAnimationFrame&&qe.use(e.requestAnimationFrame),e.batchedUpdates&&(qe.batchedUpdates=e.batchedUpdates),e.willAdvance&&(wk=e.willAdvance),e.frameLoop&&(qe.frameLoop=e.frameLoop)},Kd=new Set,Gr=[],Sy=[],Vg=0,O0={get idle(){return!Kd.size&&!Gr.length},start(e){Vg>e.priority?(Kd.add(e),qe.onStart(sme)):(H9(e),qe(rw))},advance:rw,sort(e){if(Vg)qe.onFrame(()=>O0.sort(e));else{const t=Gr.indexOf(e);~t&&(Gr.splice(t,1),W9(e))}},clear(){Gr=[],Kd.clear()}};function sme(){Kd.forEach(H9),Kd.clear(),qe(rw)}function H9(e){Gr.includes(e)||W9(e)}function W9(e){Gr.splice(ome(Gr,t=>t.priority>e.priority),0,e)}function rw(e){const t=Sy;for(let n=0;n<Gr.length;n++){const r=Gr[n];Vg=r.priority,r.idle||(wk(r),r.advance(e),r.idle||t.push(r))}return Vg=0,Sy=Gr,Sy.length=0,Gr=t,Gr.length>0}function ome(e,t){const n=e.findIndex(t);return n<0?e.length:n}var ame=(e,t,n)=>Math.min(Math.max(n,e),t),lme={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},bi="[-+]?\\d*\\.?\\d+",qg=bi+"%";function I0(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var cme=new RegExp("rgb"+I0(bi,bi,bi)),ume=new RegExp("rgba"+I0(bi,bi,bi,bi)),dme=new RegExp("hsl"+I0(bi,qg,qg)),hme=new RegExp("hsla"+I0(bi,qg,qg,bi)),fme=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,pme=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,mme=/^#([0-9a-fA-F]{6})$/,gme=/^#([0-9a-fA-F]{8})$/;function vme(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=mme.exec(e))?parseInt(t[1]+"ff",16)>>>0:jo&&jo[e]!==void 0?jo[e]:(t=cme.exec(e))?(Rl(t[1])<<24|Rl(t[2])<<16|Rl(t[3])<<8|255)>>>0:(t=ume.exec(e))?(Rl(t[1])<<24|Rl(t[2])<<16|Rl(t[3])<<8|rA(t[4]))>>>0:(t=fme.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=gme.exec(e))?parseInt(t[1],16)>>>0:(t=pme.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=dme.exec(e))?(tA(nA(t[1]),Pp(t[2]),Pp(t[3]))|255)>>>0:(t=hme.exec(e))?(tA(nA(t[1]),Pp(t[2]),Pp(t[3]))|rA(t[4]))>>>0:null}function Cy(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function tA(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,s=Cy(i,r,e+1/3),a=Cy(i,r,e),o=Cy(i,r,e-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function Rl(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function nA(e){return(parseFloat(e)%360+360)%360/360}function rA(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Pp(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function iA(e){let t=vme(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,i=(t&65280)>>>8,s=(t&255)/255;return`rgba(${n}, ${r}, ${i}, ${s})`}var Nh=(e,t,n)=>{if(ue.fun(e))return e;if(ue.arr(e))return Nh({range:e,output:t,extrapolate:n});if(ue.str(e.output[0]))return _k(e);const r=e,i=r.output,s=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",o=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(u=>u);return u=>{const h=yme(u,s);return xme(u,s[h],s[h+1],i[h],i[h+1],l,a,o,r.map)}};function xme(e,t,n,r,i,s,a,o,l){let u=l?l(e):e;if(u<t){if(a==="identity")return u;a==="clamp"&&(u=t)}if(u>n){if(o==="identity")return u;o==="clamp"&&(u=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?u=-u:n===1/0?u=u-t:u=(u-t)/(n-t),u=s(u),r===-1/0?u=-u:i===1/0?u=u+r:u=u*(i-r)+r,u)}function yme(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var bme=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*e,i=t==="end"?Math.floor(r):Math.ceil(r);return ame(0,1,i/e)},Gg=1.70158,Op=Gg*1.525,sA=Gg+1,oA=2*Math.PI/3,aA=2*Math.PI/4.5,Ip=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,_me={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>sA*e*e*e-Gg*e*e,easeOutBack:e=>1+sA*Math.pow(e-1,3)+Gg*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((Op+1)*2*e-Op)/2:(Math.pow(2*e-2,2)*((Op+1)*(e*2-2)+Op)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*oA),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*oA)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*aA))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*aA)/2+1,easeInBounce:e=>1-Ip(1-e),easeOutBounce:Ip,easeInOutBounce:e=>e<.5?(1-Ip(1-2*e))/2:(1+Ip(2*e-1))/2,steps:bme},Dh=Symbol.for("FluidValue.get"),Ic=Symbol.for("FluidValue.observers"),Vr=e=>!!(e&&e[Dh]),ur=e=>e&&e[Dh]?e[Dh]():e,lA=e=>e[Ic]||null;function wme(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Lh(e,t){const n=e[Ic];n&&n.forEach(r=>{wme(r,t)})}var U9=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Sme(this,e)}},Sme=(e,t)=>V9(e,Dh,t);function mu(e,t){if(e[Dh]){let n=e[Ic];n||V9(e,Ic,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ph(e,t){const n=e[Ic];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[Ic]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var V9=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),wm=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Cme=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,cA=new RegExp(`(${wm.source})(%|[a-z]+)`,"i"),kme=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,$0=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,q9=e=>{const[t,n]=Eme(e);if(!t||bk())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(n);return i||e}else{if(n&&$0.test(n))return q9(n);if(n)return n}return e},Eme=e=>{const t=$0.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},ky,Tme=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,G9=e=>{ky||(ky=jo?new RegExp(`(${Object.keys(jo).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(s=>ur(s).replace($0,q9).replace(Cme,iA).replace(ky,iA)),n=t.map(s=>s.match(wm).map(Number)),i=n[0].map((s,a)=>n.map(o=>{if(!(a in o))throw Error('The arity of each "output" value must be equal');return o[a]})).map(s=>Nh({...e,output:s}));return s=>{var l;const a=!cA.test(t[0])&&((l=t.find(u=>cA.test(u)))==null?void 0:l.replace(wm,""));let o=0;return t[0].replace(wm,()=>`${i[o++](s)}${a||""}`).replace(kme,Tme)}},Sk="react-spring: ",K9=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${Sk}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},Ame=K9(console.warn);function Rme(){Ame(`${Sk}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var Mme=K9(console.warn);function jme(){Mme(`${Sk}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function B0(e){return ue.str(e)&&(e[0]=="#"||/\d/.test(e)||!bk()&&$0.test(e)||e in(jo||{}))}var va=bk()?w.useEffect:w.useLayoutEffect,Nme=()=>{const e=w.useRef(!1);return va(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Ck(){const e=w.useState()[1],t=Nme();return()=>{t.current&&e(Math.random())}}function Dme(e,t){const[n]=w.useState(()=>({inputs:t,result:e()})),r=w.useRef(),i=r.current;let s=i;return s?s.inputs&&Lme(t,s.inputs)||(s={inputs:t,result:e()}):s=n,w.useEffect(()=>{r.current=s,i==n&&(n.inputs=n.result=void 0)},[s]),s.result}function Lme(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var kk=e=>w.useEffect(e,Pme),Pme=[];function iw(e){const t=w.useRef();return w.useEffect(()=>{t.current=e}),t.current}var Oh=Symbol.for("Animated:node"),Ome=e=>!!e&&e[Oh]===e,Fi=e=>e&&e[Oh],Ek=(e,t)=>rme(e,Oh,t),F0=e=>e&&e[Oh]&&e[Oh].getPayload(),Y9=class{constructor(){Ek(this,this)}getPayload(){return this.payload||[]}},Pf=class extends Y9{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,ue.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Pf(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ue.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,ue.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Ih=class extends Pf{constructor(e){super(0),this._string=null,this._toString=Nh({output:[e,e]})}static create(e){return new Ih(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(ue.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Nh({output:[this.getValue(),e]})),this._value=0,super.reset()}},Kg={dependencies:null},z0=class extends Y9{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return ts(this.source,(n,r)=>{Ome(n)?t[r]=n.getValue(e):Vr(n)?t[r]=ur(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&We(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return ts(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Kg.dependencies&&Vr(e)&&Kg.dependencies.add(e);const t=F0(e);t&&We(t,n=>this.add(n))}},X9=class extends z0{constructor(e){super(e)}static create(e){return new X9(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(Ime)),!0)}};function Ime(e){return(B0(e)?Ih:Pf).create(e)}function sw(e){const t=Fi(e);return t?t.constructor:ue.arr(e)?X9:B0(e)?Ih:Pf}var uA=(e,t)=>{const n=!ue.fun(e)||e.prototype&&e.prototype.isReactComponent;return w.forwardRef((r,i)=>{const s=w.useRef(null),a=n&&w.useCallback(b=>{s.current=Fme(i,b)},[i]),[o,l]=Bme(r,t),u=Ck(),h=()=>{const b=s.current;if(n&&!b)return;(b?t.applyAnimatedValues(b,o.getValue(!0)):!1)===!1&&u()},d=new $me(h,l),f=w.useRef();va(()=>(f.current=d,We(l,b=>mu(b,d)),()=>{f.current&&(We(f.current.deps,b=>Ph(b,f.current)),qe.cancel(f.current.update))})),w.useEffect(h,[]),kk(()=>()=>{const b=f.current;We(b.deps,x=>Ph(x,b))});const g=t.getComponentProps(o.getValue());return w.createElement(e,{...g,ref:a})})},$me=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&qe.write(this.update)}};function Bme(e,t){const n=new Set;return Kg.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new z0(e),Kg.dependencies=null,[e,n]}function Fme(e,t){return e&&(ue.fun(e)?e(t):e.current=t),t}var dA=Symbol.for("AnimatedComponent"),zme=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=i=>new z0(i),getComponentProps:r=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},s=a=>{const o=hA(a)||"Anonymous";return ue.str(a)?a=s[a]||(s[a]=uA(a,i)):a=a[dA]||(a[dA]=uA(a,i)),a.displayName=`Animated(${o})`,a};return ts(e,(a,o)=>{ue.arr(e)&&(o=hA(a)),s[o]=s(a)}),{animated:s}},hA=e=>ue.str(e)?e:e&&ue.str(e.displayName)?e.displayName:ue.fun(e)&&e.name||null;function dr(e,...t){return ue.fun(e)?e(...t):e}var Yd=(e,t)=>e===!0||!!(t&&e&&(ue.fun(e)?e(t):rr(e).includes(t))),J9=(e,t)=>ue.obj(e)?t&&e[t]:e,Q9=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Hme=e=>e,H0=(e,t=Hme)=>{let n=Wme;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const i of n){const s=t(e[i],i);ue.und(s)||(r[i]=s)}return r},Wme=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Ume={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Vme(e){const t={};let n=0;if(ts(e,(r,i)=>{Ume[i]||(t[i]=r,n++)}),n)return t}function Tk(e){const t=Vme(e);if(t){const n={to:t};return ts(e,(r,i)=>i in t||(n[i]=r)),n}return{...e}}function $h(e){return e=ur(e),ue.arr(e)?e.map($h):B0(e)?ji.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Z9(e){for(const t in e)return!0;return!1}function ow(e){return ue.fun(e)||ue.arr(e)&&ue.obj(e[0])}function aw(e,t){var n;(n=e.ref)==null||n.delete(e),t==null||t.delete(e)}function e$(e,t){var n;t&&e.ref!==t&&((n=e.ref)==null||n.delete(e),t.add(e),e.ref=t)}var Ak={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},lw={...Ak.default,mass:1,damping:1,easing:_me.linear,clamp:!1},qme=class{constructor(){this.velocity=0,Object.assign(this,lw)}};function Gme(e,t,n){n&&(n={...n},fA(n,t),t={...n,...t}),fA(e,t),Object.assign(e,t);for(const a in lw)e[a]==null&&(e[a]=lw[a]);let{frequency:r,damping:i}=e;const{mass:s}=e;return ue.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/r,2)*s,e.friction=4*Math.PI*i*s/r),e}function fA(e,t){if(!ue.und(t.decay))e.duration=void 0;else{const n=!ue.und(t.tension)||!ue.und(t.friction);(n||!ue.und(t.frequency)||!ue.und(t.damping)||!ue.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var pA=[],Kme=class{constructor(){this.changed=!1,this.values=pA,this.toValues=null,this.fromValues=pA,this.config=new qme,this.immediate=!1}};function t$(e,{key:t,props:n,defaultProps:r,state:i,actions:s}){return new Promise((a,o)=>{let l,u,h=Yd(n.cancel??(r==null?void 0:r.cancel),t);if(h)g();else{ue.und(n.pause)||(i.paused=Yd(n.pause,t));let b=r==null?void 0:r.pause;b!==!0&&(b=i.paused||Yd(b,t)),l=dr(n.delay||0,t),b?(i.resumeQueue.add(f),s.pause()):(s.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(u),u.cancel(),l=u.time-qe.now()}function f(){l>0&&!ji.skipAnimation?(i.delayed=!0,u=qe.setTimeout(g,l),i.pauseQueue.add(d),i.timeouts.add(u)):g()}function g(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(u),e<=(i.cancelId||0)&&(h=!0);try{s.start({...n,callId:e,cancel:h},a)}catch(b){o(b)}}})}var Rk=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?fc(e.get()):t.every(n=>n.noop)?n$(e.get()):gi(e.get(),t.every(n=>n.finished)),n$=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),gi=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),fc=e=>({value:e,cancelled:!0,finished:!1});function r$(e,t,n,r){const{callId:i,parentId:s,onRest:a}=t,{asyncTo:o,promise:l}=n;return!s&&e===o&&!t.reset?l:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;const u=H0(t,(v,m)=>m==="onRest"?void 0:v);let h,d;const f=new Promise((v,m)=>(h=v,d=m)),g=v=>{const m=i<=(n.cancelId||0)&&fc(r)||i!==n.asyncId&&gi(r,!1);if(m)throw v.result=m,d(v),v},b=(v,m)=>{const p=new mA,y=new gA;return(async()=>{if(ji.skipAnimation)throw Bh(n),y.result=gi(r,!1),d(y),y;g(p);const _=ue.obj(v)?{...v}:{...m,to:v};_.parentId=i,ts(u,(S,E)=>{ue.und(_[E])&&(_[E]=S)});const C=await r.start(_);return g(p),n.paused&&await new Promise(S=>{n.resumeQueue.add(S)}),C})()};let x;if(ji.skipAnimation)return Bh(n),gi(r,!1);try{let v;ue.arr(e)?v=(async m=>{for(const p of m)await b(p)})(e):v=Promise.resolve(e(b,r.stop.bind(r))),await Promise.all([v.then(h),f]),x=gi(r.get(),!0,!1)}catch(v){if(v instanceof mA)x=v.result;else if(v instanceof gA)x=v.result;else throw v}finally{i==n.asyncId&&(n.asyncId=s,n.asyncTo=s?o:void 0,n.promise=s?l:void 0)}return ue.fun(a)&&qe.batchedUpdates(()=>{a(x,r,r.item)}),x})()}function Bh(e,t){Gd(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var mA=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},gA=class extends Error{constructor(){super("SkipAnimationSignal")}},cw=e=>e instanceof Mk,Yme=1,Mk=class extends U9{constructor(){super(...arguments),this.id=Yme++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Fi(this);return e&&e.getValue()}to(...e){return ji.to(this,e)}interpolate(...e){return Rme(),ji.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Lh(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||O0.sort(this),Lh(this,{type:"priority",parent:this,priority:e})}},Fa=Symbol.for("SpringPhase"),i$=1,uw=2,dw=4,Ey=e=>(e[Fa]&i$)>0,to=e=>(e[Fa]&uw)>0,Ku=e=>(e[Fa]&dw)>0,vA=(e,t)=>t?e[Fa]|=uw|i$:e[Fa]&=~uw,xA=(e,t)=>t?e[Fa]|=dw:e[Fa]&=~dw,Xme=class extends Mk{constructor(e,t){if(super(),this.animation=new Kme,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!ue.und(e)||!ue.und(t)){const n=ue.obj(e)?{...e}:{...t,from:e};ue.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(to(this)||this._state.asyncTo)||Ku(this)}get goal(){return ur(this.animation.to)}get velocity(){const e=Fi(this);return e instanceof Pf?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return Ey(this)}get isAnimating(){return to(this)}get isPaused(){return Ku(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:i}=r;const{config:s}=r,a=F0(r.to);!a&&Vr(r.to)&&(i=rr(ur(r.to))),r.values.forEach((u,h)=>{if(u.done)return;const d=u.constructor==Ih?1:a?a[h].lastPosition:i[h];let f=r.immediate,g=d;if(!f){if(g=u.lastPosition,s.tension<=0){u.done=!0;return}let b=u.elapsedTime+=e;const x=r.fromValues[h],v=u.v0!=null?u.v0:u.v0=ue.arr(s.velocity)?s.velocity[h]:s.velocity;let m;const p=s.precision||(x==d?.005:Math.min(1,Math.abs(d-x)*.001));if(ue.und(s.duration))if(s.decay){const y=s.decay===!0?.998:s.decay,_=Math.exp(-(1-y)*b);g=x+v/(1-y)*(1-_),f=Math.abs(u.lastPosition-g)<=p,m=v*_}else{m=u.lastVelocity==null?v:u.lastVelocity;const y=s.restVelocity||p/10,_=s.clamp?0:s.bounce,C=!ue.und(_),S=x==d?u.v0>0:x<d;let E,k=!1;const T=1,A=Math.ceil(e/T);for(let M=0;M<A&&(E=Math.abs(m)>y,!(!E&&(f=Math.abs(d-g)<=p,f)));++M){C&&(k=g==d||g>d==S,k&&(m=-m*_,g=d));const D=-s.tension*1e-6*(g-d),L=-s.friction*.001*m,N=(D+L)/s.mass;m=m+N*T,g=g+m*T}}else{let y=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,u.durationProgress>0&&(u.elapsedTime=s.duration*u.durationProgress,b=u.elapsedTime+=e)),y=(s.progress||0)+b/this._memoizedDuration,y=y>1?1:y<0?0:y,u.durationProgress=y),g=x+s.easing(y)*(d-x),m=(g-u.lastPosition)/e,f=y==1}u.lastVelocity=m,Number.isNaN(g)&&(console.warn("Got NaN while animating:",this),f=!0)}a&&!a[h].done&&(f=!1),f?u.done=!0:t=!1,u.setValue(g,s.round)&&(n=!0)});const o=Fi(this),l=o.getValue();if(t){const u=ur(r.to);(l!==u||n)&&!s.decay?(o.setValue(u),this._onChange(u)):n&&s.decay&&this._onChange(l),this._stop()}else n&&this._onChange(l)}set(e){return qe.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(to(this)){const{to:e,config:t}=this.animation;qe.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return ue.und(e)?(n=this.queue||[],this.queue=[]):n=[ue.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>Rk(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Bh(this._state,e&&this._lastCallId),qe.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=ue.obj(n)?n[t]:n,(n==null||ow(n))&&(n=void 0),r=ue.obj(r)?r[t]:r,r==null&&(r=void 0);const i={to:n,from:r};return Ey(this)||(e.reverse&&([n,r]=[r,n]),r=ur(r),ue.und(r)?Fi(this)||this._set(n):this._set(r)),i}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,H0(e,(a,o)=>/^on/.test(o)?J9(a,n):a)),bA(this,e,"onProps"),Xu(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return t$(++this._lastCallId,{key:n,props:e,defaultProps:r,state:s,actions:{pause:()=>{Ku(this)||(xA(this,!0),bd(s.pauseQueue),Xu(this,"onPause",gi(this,Yu(this,this.animation.to)),this))},resume:()=>{Ku(this)&&(xA(this,!1),to(this)&&this._resume(),bd(s.resumeQueue),Xu(this,"onResume",gi(this,Yu(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const o=s$(e);if(o)return this._update(o,!0)}return a})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(fc(this));const r=!ue.und(e.to),i=!ue.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(fc(this));const{key:s,defaultProps:a,animation:o}=this,{to:l,from:u}=o;let{to:h=l,from:d=u}=e;i&&!r&&(!t.default||ue.und(h))&&(h=d),t.reverse&&([h,d]=[d,h]);const f=!ms(d,u);f&&(o.from=d),d=ur(d);const g=!ms(h,l);g&&this._focus(h);const b=ow(t.to),{config:x}=o,{decay:v,velocity:m}=x;(r||i)&&(x.velocity=0),t.config&&!b&&Gme(x,dr(t.config,s),t.config!==a.config?dr(a.config,s):void 0);let p=Fi(this);if(!p||ue.und(h))return n(gi(this,!0));const y=ue.und(t.reset)?i&&!t.default:!ue.und(d)&&Yd(t.reset,s),_=y?d:this.get(),C=$h(h),S=ue.num(C)||ue.arr(C)||B0(C),E=!b&&(!S||Yd(a.immediate||t.immediate,s));if(g){const M=sw(h);if(M!==p.constructor)if(E)p=this._set(C);else throw Error(`Cannot animate between ${p.constructor.name} and ${M.name}, as the "to" prop suggests`)}const k=p.constructor;let T=Vr(h),A=!1;if(!T){const M=y||!Ey(this)&&f;(g||M)&&(A=ms($h(_),C),T=!A),(!ms(o.immediate,E)&&!E||!ms(x.decay,v)||!ms(x.velocity,m))&&(T=!0)}if(A&&to(this)&&(o.changed&&!y?T=!0:T||this._stop(l)),!b&&((T||Vr(l))&&(o.values=p.getPayload(),o.toValues=Vr(h)?null:k==Ih?[1]:rr(C)),o.immediate!=E&&(o.immediate=E,!E&&!y&&this._set(l)),T)){const{onRest:M}=o;We(Qme,L=>bA(this,t,L));const D=gi(this,Yu(this,l));bd(this._pendingCalls,D),this._pendingCalls.add(n),o.changed&&qe.batchedUpdates(()=>{var L;o.changed=!y,M==null||M(D,this),y?dr(a.onRest,D):(L=o.onStart)==null||L.call(o,D,this)})}y&&this._set(_),b?n(r$(t.to,t,this._state,this)):T?this._start():to(this)&&!g?this._pendingCalls.add(n):n(n$(_))}_focus(e){const t=this.animation;e!==t.to&&(lA(this)&&this._detach(),t.to=e,lA(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Vr(t)&&(mu(t,this),cw(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Vr(e)&&Ph(e,this)}_set(e,t=!0){const n=ur(e);if(!ue.und(n)){const r=Fi(this);if(!r||!ms(n,r.getValue())){const i=sw(n);!r||r.constructor!=i?Ek(this,i.create(n)):r.setValue(n),r&&qe.batchedUpdates(()=>{this._onChange(n,t)})}}return Fi(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Xu(this,"onStart",gi(this,Yu(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),dr(this.animation.onChange,e,this)),dr(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Fi(this).reset(ur(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),to(this)||(vA(this,!0),Ku(this)||this._resume())}_resume(){ji.skipAnimation?this.finish():O0.start(this)}_stop(e,t){if(to(this)){vA(this,!1);const n=this.animation;We(n.values,i=>{i.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Lh(this,{type:"idle",parent:this});const r=t?fc(this.get()):gi(this.get(),Yu(this,e??n.to));bd(this._pendingCalls,r),n.changed&&(n.changed=!1,Xu(this,"onRest",r,this))}}};function Yu(e,t){const n=$h(t),r=$h(e.get());return ms(r,n)}function s$(e,t=e.loop,n=e.to){const r=dr(t);if(r){const i=r!==!0&&Tk(r),s=(i||e).reverse,a=!i||i.reset;return Fh({...e,loop:t,default:!1,pause:void 0,to:!s||ow(n)?n:void 0,from:a?e.from:void 0,reset:a,...i})}}function Fh(e){const{to:t,from:n}=e=Tk(e),r=new Set;return ue.obj(t)&&yA(t,r),ue.obj(n)&&yA(n,r),e.keys=r.size?Array.from(r):null,e}function Jme(e){const t=Fh(e);return ue.und(t.default)&&(t.default=H0(t)),t}function yA(e,t){ts(e,(n,r)=>n!=null&&t.add(r))}var Qme=["onStart","onRest","onChange","onPause","onResume"];function bA(e,t,n){e.animation[n]=t[n]!==Q9(t,n)?J9(t[n],e.key):void 0}function Xu(e,t,...n){var r,i,s,a;(i=(r=e.animation)[t])==null||i.call(r,...n),(a=(s=e.defaultProps)[t])==null||a.call(s,...n)}var Zme=["onStart","onChange","onRest"],ege=1,o$=class{constructor(e,t){this.id=ege++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];ue.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Fh(e)),this}start(e){let{queue:t}=this;return e?t=rr(e).map(Fh):this.queue=[],this._flush?this._flush(this,t):(d$(this,t),hw(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;We(rr(t),r=>n[r].stop(!!e))}else Bh(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(ue.und(e))this.start({pause:!0});else{const t=this.springs;We(rr(e),n=>t[n].pause())}return this}resume(e){if(ue.und(e))this.start({pause:!1});else{const t=this.springs;We(rr(e),n=>t[n].resume())}return this}each(e){ts(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,Gd(e,([o,l])=>{l.value=this.get(),o(l,this,this._item)}));const s=!r&&this._started,a=i||s&&n.size?this.get():null;i&&t.size&&Gd(t,([o,l])=>{l.value=a,o(l,this,this._item)}),s&&(this._started=!1,Gd(n,([o,l])=>{l.value=a,o(l,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;qe.onFrame(this._onFrame)}};function hw(e,t){return Promise.all(t.map(n=>a$(e,n))).then(n=>Rk(e,n))}async function a$(e,t,n){const{keys:r,to:i,from:s,loop:a,onRest:o,onResolve:l}=t,u=ue.obj(t.default)&&t.default;a&&(t.loop=!1),i===!1&&(t.to=null),s===!1&&(t.from=null);const h=ue.arr(i)||ue.fun(i)?i:void 0;h?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):We(Zme,x=>{const v=t[x];if(ue.fun(v)){const m=e._events[x];t[x]=({finished:p,cancelled:y})=>{const _=m.get(v);_?(p||(_.finished=!1),y&&(_.cancelled=!0)):m.set(v,{value:null,finished:p||!1,cancelled:y||!1})},u&&(u[x]=t[x])}});const d=e._state;t.pause===!d.paused?(d.paused=t.pause,bd(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const f=(r||Object.keys(e.springs)).map(x=>e.springs[x].start(t)),g=t.cancel===!0||Q9(t,"cancel")===!0;(h||g&&d.asyncId)&&f.push(t$(++e._lastAsyncId,{props:t,state:d,actions:{pause:nw,resume:nw,start(x,v){g?(Bh(d,e._lastAsyncId),v(fc(e))):(x.onRest=o,v(r$(h,x,d,e)))}}})),d.paused&&await new Promise(x=>{d.resumeQueue.add(x)});const b=Rk(e,await Promise.all(f));if(a&&b.finished&&!(n&&b.noop)){const x=s$(t,a,i);if(x)return d$(e,[x]),a$(e,x,!0)}return l&&qe.batchedUpdates(()=>l(b,e,e.item)),b}function fw(e,t){const n={...e.springs};return t&&We(rr(t),r=>{ue.und(r.keys)&&(r=Fh(r)),ue.obj(r.to)||(r={...r,to:void 0}),u$(n,r,i=>c$(i))}),l$(e,n),n}function l$(e,t){ts(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,mu(n,e))})}function c$(e,t){const n=new Xme;return n.key=e,t&&mu(n,t),n}function u$(e,t,n){t.keys&&We(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function d$(e,t){We(t,n=>{u$(e.springs,n,r=>c$(r,e))})}var Of=({children:e,...t})=>{const n=w.useContext(Yg),r=t.pause||!!n.pause,i=t.immediate||!!n.immediate;t=Dme(()=>({pause:r,immediate:i}),[r,i]);const{Provider:s}=Yg;return w.createElement(s,{value:t},e)},Yg=tge(Of,{});Of.Provider=Yg.Provider;Of.Consumer=Yg.Consumer;function tge(e,t){return Object.assign(e,w.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var h$=()=>{const e=[],t=function(r){jme();const i=[];return We(e,(s,a)=>{if(ue.und(r))i.push(s.start());else{const o=n(r,s,a);o&&i.push(s.start(o))}}),i};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const i=e.indexOf(r);~i&&e.splice(i,1)},t.pause=function(){return We(e,r=>r.pause(...arguments)),this},t.resume=function(){return We(e,r=>r.resume(...arguments)),this},t.set=function(r){We(e,(i,s)=>{const a=ue.fun(r)?r(s,i):r;a&&i.set(a)})},t.start=function(r){const i=[];return We(e,(s,a)=>{if(ue.und(r))i.push(s.start());else{const o=this._getProps(r,s,a);o&&i.push(s.start(o))}}),i},t.stop=function(){return We(e,r=>r.stop(...arguments)),this},t.update=function(r){return We(e,(i,s)=>i.update(this._getProps(r,i,s))),this};const n=function(r,i,s){return ue.fun(r)?r(s,i):r};return t._getProps=n,t};function nge(e,t,n){const r=ue.fun(t)&&t;r&&!n&&(n=[]);const i=w.useMemo(()=>r||arguments.length==3?h$():void 0,[]),s=w.useRef(0),a=Ck(),o=w.useMemo(()=>({ctrls:[],queue:[],flush(m,p){const y=fw(m,p);return s.current>0&&!o.queue.length&&!Object.keys(y).some(C=>!m.springs[C])?hw(m,p):new Promise(C=>{l$(m,y),o.queue.push(()=>{C(hw(m,p))}),a()})}}),[]),l=w.useRef([...o.ctrls]),u=[],h=iw(e)||0;w.useMemo(()=>{We(l.current.slice(e,h),m=>{aw(m,i),m.stop(!0)}),l.current.length=e,d(h,e)},[e]),w.useMemo(()=>{d(0,Math.min(h,e))},n);function d(m,p){for(let y=m;y<p;y++){const _=l.current[y]||(l.current[y]=new o$(null,o.flush)),C=r?r(y,_):t[y];C&&(u[y]=Jme(C))}}const f=l.current.map((m,p)=>fw(m,u[p])),g=w.useContext(Of),b=iw(g),x=g!==b&&Z9(g);va(()=>{s.current++,o.ctrls=l.current;const{queue:m}=o;m.length&&(o.queue=[],We(m,p=>p())),We(l.current,(p,y)=>{i==null||i.add(p),x&&p.start({default:g});const _=u[y];_&&(e$(p,_.ref),p.ref?p.queue.push(_):p.start(_))})}),kk(()=>()=>{We(o.ctrls,m=>m.stop(!0))});const v=f.map(m=>({...m}));return i?[v,i]:v}function Gs(e,t){const n=ue.fun(e),[[r],i]=nge(1,n?e:[e],n?[]:t);return n||arguments.length==2?[r,i]:r}function al(e,t,n){const r=ue.fun(t)&&t,{reset:i,sort:s,trail:a=0,expires:o=!0,exitBeforeEnter:l=!1,onDestroyed:u,ref:h,config:d}=r?r():t,f=w.useMemo(()=>r||arguments.length==3?h$():void 0,[]),g=rr(e),b=[],x=w.useRef(null),v=i?null:x.current;va(()=>{x.current=b}),kk(()=>(We(b,N=>{f==null||f.add(N.ctrl),N.ctrl.ref=f}),()=>{We(x.current,N=>{N.expired&&clearTimeout(N.expirationId),aw(N.ctrl,f),N.ctrl.stop(!0)})}));const m=ige(g,r?r():t,v),p=i&&x.current||[];va(()=>We(p,({ctrl:N,item:O,key:B})=>{aw(N,f),dr(u,O,B)}));const y=[];if(v&&We(v,(N,O)=>{N.expired?(clearTimeout(N.expirationId),p.push(N)):(O=y[O]=m.indexOf(N.key),~O&&(b[O]=N))}),We(g,(N,O)=>{b[O]||(b[O]={key:m[O],item:N,phase:"mount",ctrl:new o$},b[O].ctrl.item=N)}),y.length){let N=-1;const{leave:O}=r?r():t;We(y,(B,z)=>{const P=v[z];~B?(N=b.indexOf(P),b[N]={...P,item:g[B]}):O&&b.splice(++N,0,P)})}ue.fun(s)&&b.sort((N,O)=>s(N.item,O.item));let _=-a;const C=Ck(),S=H0(t),E=new Map,k=w.useRef(new Map),T=w.useRef(!1);We(b,(N,O)=>{const B=N.key,z=N.phase,P=r?r():t;let j,R;const I=dr(P.delay||0,B);if(z=="mount")j=P.enter,R="enter";else{const Z=m.indexOf(B)<0;if(z!="leave")if(Z)j=P.leave,R="leave";else if(j=P.update)R="update";else return;else if(!Z)j=P.enter,R="enter";else return}if(j=dr(j,N.item,O),j=ue.obj(j)?Tk(j):{to:j},!j.config){const Z=d||S.config;j.config=dr(Z,N.item,O,R)}_+=a;const H={...S,delay:I+_,ref:h,immediate:P.immediate,reset:!1,...j};if(R=="enter"&&ue.und(H.from)){const Z=r?r():t,J=ue.und(Z.initial)||v?Z.from:Z.initial;H.from=dr(J,N.item,O)}const{onResolve:F}=H;H.onResolve=Z=>{dr(F,Z);const J=x.current,W=J.find($=>$.key===B);if(W&&!(Z.cancelled&&W.phase!="update")&&W.ctrl.idle){const $=J.every(V=>V.ctrl.idle);if(W.phase=="leave"){const V=dr(o,W.item);if(V!==!1){const U=V===!0?0:V;if(W.expired=!0,!$&&U>0){U<=2147483647&&(W.expirationId=setTimeout(C,U));return}}}$&&J.some(V=>V.expired)&&(k.current.delete(W),l&&(T.current=!0),C())}};const G=fw(N.ctrl,H);R==="leave"&&l?k.current.set(N,{phase:R,springs:G,payload:H}):E.set(N,{phase:R,springs:G,payload:H})});const A=w.useContext(Of),M=iw(A),D=A!==M&&Z9(A);va(()=>{D&&We(b,N=>{N.ctrl.start({default:A})})},[A]),We(E,(N,O)=>{if(k.current.size){const B=b.findIndex(z=>z.key===O.key);b.splice(B,1)}}),va(()=>{We(k.current.size?k.current:E,({phase:N,payload:O},B)=>{const{ctrl:z}=B;B.phase=N,f==null||f.add(z),D&&N=="enter"&&z.start({default:A}),O&&(e$(z,O.ref),(z.ref||f)&&!T.current?z.update(O):(z.start(O),T.current&&(T.current=!1)))})},i?void 0:n);const L=N=>w.createElement(w.Fragment,null,b.map((O,B)=>{const{springs:z}=E.get(O)||O.ctrl,P=N({...z},O.item,O,B);return P&&P.type?w.createElement(P.type,{...P.props,key:ue.str(O.key)||ue.num(O.key)?O.key:O.ctrl.id,ref:P.ref}):P}));return f?[L,f]:L}var rge=1;function ige(e,{key:t,keys:n=t},r){if(n===null){const i=new Set;return e.map(s=>{const a=r&&r.find(o=>o.item===s&&o.phase!=="leave"&&!i.has(o));return a?(i.add(a),a.key):rge++})}return ue.und(n)?e:ue.fun(n)?e.map(n):rr(n)}var f$=class extends Mk{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Nh(...t);const n=this._get(),r=sw(n);Ek(this,r.create(n))}advance(e){const t=this._get(),n=this.get();ms(t,n)||(Fi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&_A(this._active)&&Ty(this)}_get(){const e=ue.arr(this.source)?this.source.map(ur):rr(ur(this.source));return this.calc(...e)}_start(){this.idle&&!_A(this._active)&&(this.idle=!1,We(F0(this),e=>{e.done=!1}),ji.skipAnimation?(qe.batchedUpdates(()=>this.advance()),Ty(this)):O0.start(this))}_attach(){let e=1;We(rr(this.source),t=>{Vr(t)&&mu(t,this),cw(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){We(rr(this.source),e=>{Vr(e)&&Ph(e,this)}),this._active.clear(),Ty(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=rr(this.source).reduce((t,n)=>Math.max(t,(cw(n)?n.priority:0)+1),0))}};function sge(e){return e.idle!==!1}function _A(e){return!e.size||Array.from(e).every(sge)}function Ty(e){e.idle||(e.idle=!0,We(F0(e),t=>{t.done=!0}),Lh(e,{type:"idle",parent:e}))}var Ho=(e,...t)=>new f$(e,t);ji.assign({createStringInterpolator:G9,to:(e,t)=>new f$(e,t)});var p$=/^--/;function oge(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!p$.test(e)&&!(Xd.hasOwnProperty(e)&&Xd[e])?t+"px":(""+t).trim()}var wA={};function age(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:r,style:i,children:s,scrollTop:a,scrollLeft:o,viewBox:l,...u}=t,h=Object.values(u),d=Object.keys(u).map(f=>n||e.hasAttribute(f)?f:wA[f]||(wA[f]=f.replace(/([A-Z])/g,g=>"-"+g.toLowerCase())));s!==void 0&&(e.textContent=s);for(const f in i)if(i.hasOwnProperty(f)){const g=oge(f,i[f]);p$.test(f)?e.style.setProperty(f,g):e.style[f]=g}d.forEach((f,g)=>{e.setAttribute(f,h[g])}),r!==void 0&&(e.className=r),a!==void 0&&(e.scrollTop=a),o!==void 0&&(e.scrollLeft=o),l!==void 0&&e.setAttribute("viewBox",l)}var Xd={animationIterationCount:!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,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},lge=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),cge=["Webkit","Ms","Moz","O"];Xd=Object.keys(Xd).reduce((e,t)=>(cge.forEach(n=>e[lge(n,t)]=e[t]),e),Xd);var uge=/^(matrix|translate|scale|rotate|skew)/,dge=/^(translate)/,hge=/^(rotate|skew)/,Ay=(e,t)=>ue.num(e)&&e!==0?e+t:e,Sm=(e,t)=>ue.arr(e)?e.every(n=>Sm(n,t)):ue.num(e)?e===t:parseFloat(e)===t,fge=class extends z0{constructor({x:e,y:t,z:n,...r}){const i=[],s=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),s.push(a=>[`translate3d(${a.map(o=>Ay(o,"px")).join(",")})`,Sm(a,0)])),ts(r,(a,o)=>{if(o==="transform")i.push([a||""]),s.push(l=>[l,l===""]);else if(uge.test(o)){if(delete r[o],ue.und(a))return;const l=dge.test(o)?"px":hge.test(o)?"deg":"";i.push(rr(a)),s.push(o==="rotate3d"?([u,h,d,f])=>[`rotate3d(${u},${h},${d},${Ay(f,l)})`,Sm(f,0)]:u=>[`${o}(${u.map(h=>Ay(h,l)).join(",")})`,Sm(u,o.startsWith("scale")?1:0)])}}),i.length&&(r.transform=new pge(i,s)),super(r)}},pge=class extends U9{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return We(this.inputs,(n,r)=>{const i=ur(n[0]),[s,a]=this.transforms[r](ue.arr(i)?i:n.map(ur));e+=" "+s,t=t&&a}),t?"none":e}observerAdded(e){e==1&&We(this.inputs,t=>We(t,n=>Vr(n)&&mu(n,this)))}observerRemoved(e){e==0&&We(this.inputs,t=>We(t,n=>Vr(n)&&Ph(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Lh(this,e)}},mge=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];ji.assign({batchedUpdates:mr.unstable_batchedUpdates,createStringInterpolator:G9,colors:lme});var gge=zme(mge,{applyAnimatedValues:age,createAnimatedStyle:e=>new fge(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Tt=gge.animated;function za(){return za=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},za.apply(this,arguments)}var vge={pointerEvents:"none",position:"absolute",zIndex:10,top:0,left:0},SA=function(e,t){return"translate("+e+"px, "+t+"px)"},m$=w.memo(function(e){var t,n=e.position,r=e.anchor,i=e.children,s=Gt(),a=Cr(),o=a.animate,l=a.config,u=TF(),h=u[0],d=u[1],f=w.useRef(!1),g=void 0,b=!1,x=d.width>0&&d.height>0,v=Math.round(n[0]),m=Math.round(n[1]);x&&(r==="top"?(v-=d.width/2,m-=d.height+14):r==="right"?(v+=14,m-=d.height/2):r==="bottom"?(v-=d.width/2,m+=14):r==="left"?(v-=d.width+14,m-=d.height/2):r==="center"&&(v-=d.width/2,m-=d.height/2),g={transform:SA(v,m)},f.current||(b=!0),f.current=[v,m]);var p=Gs({to:g,config:l,immediate:!o||b}),y=za({},vge,s.tooltip.wrapper,{transform:(t=p.transform)!=null?t:SA(v,m),opacity:p.transform?1:0});return c.jsx(Tt.div,{ref:h,style:y,children:i})});m$.displayName="TooltipWrapper";var xge=w.memo(function(e){var t=e.size,n=t===void 0?12:t,r=e.color,i=e.style;return c.jsx("span",{style:za({display:"block",width:n,height:n,background:r},i===void 0?{}:i)})}),g$=w.memo(function(e){var t,n=e.id,r=e.value,i=e.format,s=e.enableChip,a=s!==void 0&&s,o=e.color,l=e.renderContent,u=Gt(),h=H1(i);if(typeof l=="function")t=l();else{var d=r;h!==void 0&&d!==void 0&&(d=h(d)),t=c.jsxs("div",{style:u.tooltip.basic,children:[a&&c.jsx(xge,{color:o,style:u.tooltip.chip}),d!==void 0?c.jsxs("span",{children:[n,": ",c.jsx("strong",{children:""+d})]}):n]})}return c.jsx("div",{style:u.tooltip.container,children:t})}),yge={width:"100%",borderCollapse:"collapse"},bge=w.memo(function(e){var t,n=e.title,r=e.rows,i=r===void 0?[]:r,s=e.renderContent,a=Gt();return i.length?(t=typeof s=="function"?s():c.jsxs("div",{children:[n&&n,c.jsx("table",{style:za({},yge,a.tooltip.table),children:c.jsx("tbody",{children:i.map(function(o,l){return c.jsx("tr",{children:o.map(function(u,h){return c.jsx("td",{style:a.tooltip.tableCell,children:u},h)})},l)})})})]}),c.jsx("div",{style:a.tooltip.container,children:t})):null});bge.displayName="TableTooltip";var pw=w.memo(function(e){var t=e.x0,n=e.x1,r=e.y0,i=e.y1,s=Gt(),a=Cr(),o=a.animate,l=a.config,u=w.useMemo(function(){return za({},s.crosshair.line,{pointerEvents:"none"})},[s.crosshair.line]),h=Gs({x1:t,x2:n,y1:r,y2:i,config:l,immediate:!o});return c.jsx(Tt.line,za({},h,{fill:"none",style:u}))});pw.displayName="CrosshairLine";var _ge=w.memo(function(e){var t,n,r=e.width,i=e.height,s=e.type,a=e.x,o=e.y;return s==="cross"?(t={x0:a,x1:a,y0:0,y1:i},n={x0:0,x1:r,y0:o,y1:o}):s==="top-left"?(t={x0:a,x1:a,y0:0,y1:o},n={x0:0,x1:a,y0:o,y1:o}):s==="top"?t={x0:a,x1:a,y0:0,y1:o}:s==="top-right"?(t={x0:a,x1:a,y0:0,y1:o},n={x0:a,x1:r,y0:o,y1:o}):s==="right"?n={x0:a,x1:r,y0:o,y1:o}:s==="bottom-right"?(t={x0:a,x1:a,y0:o,y1:i},n={x0:a,x1:r,y0:o,y1:o}):s==="bottom"?t={x0:a,x1:a,y0:o,y1:i}:s==="bottom-left"?(t={x0:a,x1:a,y0:o,y1:i},n={x0:0,x1:a,y0:o,y1:o}):s==="left"?n={x0:0,x1:a,y0:o,y1:o}:s==="x"?t={x0:a,x1:a,y0:0,y1:i}:s==="y"&&(n={x0:0,x1:r,y0:o,y1:o}),c.jsxs(c.Fragment,{children:[t&&c.jsx(pw,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}),n&&c.jsx(pw,{x0:n.x0,x1:n.x1,y0:n.y0,y1:n.y1})]})});_ge.displayName="Crosshair";var v$=w.createContext({showTooltipAt:function(){},showTooltipFromEvent:function(){},hideTooltip:function(){}}),mw={isVisible:!1,position:[null,null],content:null,anchor:null},x$=w.createContext(mw),wge=function(e){var t=w.useState(mw),n=t[0],r=t[1],i=w.useCallback(function(o,l,u){var h=l[0],d=l[1];u===void 0&&(u="top"),r({isVisible:!0,position:[h,d],anchor:u,content:o})},[r]),s=w.useCallback(function(o,l,u){u===void 0&&(u="top");var h=e.current.getBoundingClientRect(),d=e.current.offsetWidth,f=d===h.width?1:d/h.width,g="touches"in l?l.touches[0]:l,b=g.clientX,x=g.clientY,v=(b-h.left)*f,m=(x-h.top)*f;u!=="left"&&u!=="right"||(u=v<h.width/2?"right":"left"),r({isVisible:!0,position:[v,m],anchor:u,content:o})},[e,r]),a=w.useCallback(function(){r(mw)},[r]);return{actions:w.useMemo(function(){return{showTooltipAt:i,showTooltipFromEvent:s,hideTooltip:a}},[i,s,a]),state:n}},jk=function(){var e=w.useContext(v$);if(e===void 0)throw new Error("useTooltip must be used within a TooltipProvider");return e},Sge=function(){var e=w.useContext(x$);if(e===void 0)throw new Error("useTooltipState must be used within a TooltipProvider");return e},Cge=function(e){return e.isVisible},kge=function(){var e=Sge();return Cge(e)?c.jsx(m$,{position:e.position,anchor:e.anchor,children:e.content}):null},Ege=function(e){var t=e.container,n=e.children,r=wge(t),i=r.actions,s=r.state;return c.jsx(v$.Provider,{value:i,children:c.jsx(x$.Provider,{value:s,children:n})})};function Tge(){this.__data__=[],this.size=0}var Age=Tge;function Rge(e,t){return e===t||e!==e&&t!==t}var If=Rge,Mge=If;function jge(e,t){for(var n=e.length;n--;)if(Mge(e[n][0],t))return n;return-1}var W0=jge,Nge=W0,Dge=Array.prototype,Lge=Dge.splice;function Pge(e){var t=this.__data__,n=Nge(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Lge.call(t,n,1),--this.size,!0}var Oge=Pge,Ige=W0;function $ge(e){var t=this.__data__,n=Ige(t,e);return n<0?void 0:t[n][1]}var Bge=$ge,Fge=W0;function zge(e){return Fge(this.__data__,e)>-1}var Hge=zge,Wge=W0;function Uge(e,t){var n=this.__data__,r=Wge(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Vge=Uge,qge=Age,Gge=Oge,Kge=Bge,Yge=Hge,Xge=Vge;function gu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}gu.prototype.clear=qge;gu.prototype.delete=Gge;gu.prototype.get=Kge;gu.prototype.has=Yge;gu.prototype.set=Xge;var U0=gu,Jge=U0;function Qge(){this.__data__=new Jge,this.size=0}var Zge=Qge;function eve(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var tve=eve;function nve(e){return this.__data__.get(e)}var rve=nve;function ive(e){return this.__data__.has(e)}var sve=ive,ove=typeof Ui=="object"&&Ui&&Ui.Object===Object&&Ui,y$=ove,ave=y$,lve=typeof self=="object"&&self&&self.Object===Object&&self,cve=ave||lve||Function("return this")(),as=cve,uve=as,dve=uve.Symbol,vu=dve,CA=vu,b$=Object.prototype,hve=b$.hasOwnProperty,fve=b$.toString,Ju=CA?CA.toStringTag:void 0;function pve(e){var t=hve.call(e,Ju),n=e[Ju];try{e[Ju]=void 0;var r=!0}catch{}var i=fve.call(e);return r&&(t?e[Ju]=n:delete e[Ju]),i}var mve=pve,gve=Object.prototype,vve=gve.toString;function xve(e){return vve.call(e)}var yve=xve,kA=vu,bve=mve,_ve=yve,wve="[object Null]",Sve="[object Undefined]",EA=kA?kA.toStringTag:void 0;function Cve(e){return e==null?e===void 0?Sve:wve:EA&&EA in Object(e)?bve(e):_ve(e)}var ta=Cve;function kve(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ls=kve,Eve=ta,Tve=ls,Ave="[object AsyncFunction]",Rve="[object Function]",Mve="[object GeneratorFunction]",jve="[object Proxy]";function Nve(e){if(!Tve(e))return!1;var t=Eve(e);return t==Rve||t==Mve||t==Ave||t==jve}var V0=Nve;const _$=Rn(V0);var Dve=as,Lve=Dve["__core-js_shared__"],Pve=Lve,Ry=Pve,TA=function(){var e=/[^.]+$/.exec(Ry&&Ry.keys&&Ry.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ove(e){return!!TA&&TA in e}var Ive=Ove,$ve=Function.prototype,Bve=$ve.toString;function Fve(e){if(e!=null){try{return Bve.call(e)}catch{}try{return e+""}catch{}}return""}var w$=Fve,zve=V0,Hve=Ive,Wve=ls,Uve=w$,Vve=/[\\^$.*+?()[\]{}|]/g,qve=/^\[object .+?Constructor\]$/,Gve=Function.prototype,Kve=Object.prototype,Yve=Gve.toString,Xve=Kve.hasOwnProperty,Jve=RegExp("^"+Yve.call(Xve).replace(Vve,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Qve(e){if(!Wve(e)||Hve(e))return!1;var t=zve(e)?Jve:qve;return t.test(Uve(e))}var Zve=Qve;function e0e(e,t){return e==null?void 0:e[t]}var t0e=e0e,n0e=Zve,r0e=t0e;function i0e(e,t){var n=r0e(e,t);return n0e(n)?n:void 0}var ll=i0e,s0e=ll,o0e=as,a0e=s0e(o0e,"Map"),Nk=a0e,l0e=ll,c0e=l0e(Object,"create"),q0=c0e,AA=q0;function u0e(){this.__data__=AA?AA(null):{},this.size=0}var d0e=u0e;function h0e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var f0e=h0e,p0e=q0,m0e="__lodash_hash_undefined__",g0e=Object.prototype,v0e=g0e.hasOwnProperty;function x0e(e){var t=this.__data__;if(p0e){var n=t[e];return n===m0e?void 0:n}return v0e.call(t,e)?t[e]:void 0}var y0e=x0e,b0e=q0,_0e=Object.prototype,w0e=_0e.hasOwnProperty;function S0e(e){var t=this.__data__;return b0e?t[e]!==void 0:w0e.call(t,e)}var C0e=S0e,k0e=q0,E0e="__lodash_hash_undefined__";function T0e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=k0e&&t===void 0?E0e:t,this}var A0e=T0e,R0e=d0e,M0e=f0e,j0e=y0e,N0e=C0e,D0e=A0e;function xu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}xu.prototype.clear=R0e;xu.prototype.delete=M0e;xu.prototype.get=j0e;xu.prototype.has=N0e;xu.prototype.set=D0e;var L0e=xu,RA=L0e,P0e=U0,O0e=Nk;function I0e(){this.size=0,this.__data__={hash:new RA,map:new(O0e||P0e),string:new RA}}var $0e=I0e;function B0e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var F0e=B0e,z0e=F0e;function H0e(e,t){var n=e.__data__;return z0e(t)?n[typeof t=="string"?"string":"hash"]:n.map}var G0=H0e,W0e=G0;function U0e(e){var t=W0e(this,e).delete(e);return this.size-=t?1:0,t}var V0e=U0e,q0e=G0;function G0e(e){return q0e(this,e).get(e)}var K0e=G0e,Y0e=G0;function X0e(e){return Y0e(this,e).has(e)}var J0e=X0e,Q0e=G0;function Z0e(e,t){var n=Q0e(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var e1e=Z0e,t1e=$0e,n1e=V0e,r1e=K0e,i1e=J0e,s1e=e1e;function yu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yu.prototype.clear=t1e;yu.prototype.delete=n1e;yu.prototype.get=r1e;yu.prototype.has=i1e;yu.prototype.set=s1e;var Dk=yu,o1e=U0,a1e=Nk,l1e=Dk,c1e=200;function u1e(e,t){var n=this.__data__;if(n instanceof o1e){var r=n.__data__;if(!a1e||r.length<c1e-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new l1e(r)}return n.set(e,t),this.size=n.size,this}var d1e=u1e,h1e=U0,f1e=Zge,p1e=tve,m1e=rve,g1e=sve,v1e=d1e;function bu(e){var t=this.__data__=new h1e(e);this.size=t.size}bu.prototype.clear=f1e;bu.prototype.delete=p1e;bu.prototype.get=m1e;bu.prototype.has=g1e;bu.prototype.set=v1e;var K0=bu,x1e=ll,y1e=function(){try{var e=x1e(Object,"defineProperty");return e({},"",{}),e}catch{}}(),S$=y1e,MA=S$;function b1e(e,t,n){t=="__proto__"&&MA?MA(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Lk=b1e,_1e=Lk,w1e=If;function S1e(e,t,n){(n!==void 0&&!w1e(e[t],n)||n===void 0&&!(t in e))&&_1e(e,t,n)}var C$=S1e;function C1e(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(n(s[l],l,s)===!1)break}return t}}var k1e=C1e,E1e=k1e,T1e=E1e(),k$=T1e,Xg={exports:{}};Xg.exports;(function(e,t){var n=as,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,a=s?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;function l(u,h){if(h)return u.slice();var d=u.length,f=o?o(d):new u.constructor(d);return u.copy(f),f}e.exports=l})(Xg,Xg.exports);var E$=Xg.exports,A1e=as,R1e=A1e.Uint8Array,T$=R1e,jA=T$;function M1e(e){var t=new e.constructor(e.byteLength);return new jA(t).set(new jA(e)),t}var Pk=M1e,j1e=Pk;function N1e(e,t){var n=t?j1e(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var A$=N1e;function D1e(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var R$=D1e,L1e=ls,NA=Object.create,P1e=function(){function e(){}return function(t){if(!L1e(t))return{};if(NA)return NA(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),O1e=P1e;function I1e(e,t){return function(n){return e(t(n))}}var M$=I1e,$1e=M$,B1e=$1e(Object.getPrototypeOf,Object),Ok=B1e,F1e=Object.prototype;function z1e(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||F1e;return e===n}var Ik=z1e,H1e=O1e,W1e=Ok,U1e=Ik;function V1e(e){return typeof e.constructor=="function"&&!U1e(e)?H1e(W1e(e)):{}}var j$=V1e;function q1e(e){return e!=null&&typeof e=="object"}var Di=q1e,G1e=ta,K1e=Di,Y1e="[object Arguments]";function X1e(e){return K1e(e)&&G1e(e)==Y1e}var J1e=X1e,DA=J1e,Q1e=Di,N$=Object.prototype,Z1e=N$.hasOwnProperty,exe=N$.propertyIsEnumerable,txe=DA(function(){return arguments}())?DA:function(e){return Q1e(e)&&Z1e.call(e,"callee")&&!exe.call(e,"callee")},Y0=txe,nxe=Array.isArray,Sr=nxe,rxe=9007199254740991;function ixe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=rxe}var $k=ixe,sxe=V0,oxe=$k;function axe(e){return e!=null&&oxe(e.length)&&!sxe(e)}var _u=axe,lxe=_u,cxe=Di;function uxe(e){return cxe(e)&&lxe(e)}var D$=uxe,Jg={exports:{}};function dxe(){return!1}var hxe=dxe;Jg.exports;(function(e,t){var n=as,r=hxe,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===i,o=a?n.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||r;e.exports=u})(Jg,Jg.exports);var X0=Jg.exports,fxe=ta,pxe=Ok,mxe=Di,gxe="[object Object]",vxe=Function.prototype,xxe=Object.prototype,L$=vxe.toString,yxe=xxe.hasOwnProperty,bxe=L$.call(Object);function _xe(e){if(!mxe(e)||fxe(e)!=gxe)return!1;var t=pxe(e);if(t===null)return!0;var n=yxe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&L$.call(n)==bxe}var Bk=_xe;const Fk=Rn(Bk);var wxe=ta,Sxe=$k,Cxe=Di,kxe="[object Arguments]",Exe="[object Array]",Txe="[object Boolean]",Axe="[object Date]",Rxe="[object Error]",Mxe="[object Function]",jxe="[object Map]",Nxe="[object Number]",Dxe="[object Object]",Lxe="[object RegExp]",Pxe="[object Set]",Oxe="[object String]",Ixe="[object WeakMap]",$xe="[object ArrayBuffer]",Bxe="[object DataView]",Fxe="[object Float32Array]",zxe="[object Float64Array]",Hxe="[object Int8Array]",Wxe="[object Int16Array]",Uxe="[object Int32Array]",Vxe="[object Uint8Array]",qxe="[object Uint8ClampedArray]",Gxe="[object Uint16Array]",Kxe="[object Uint32Array]",Wt={};Wt[Fxe]=Wt[zxe]=Wt[Hxe]=Wt[Wxe]=Wt[Uxe]=Wt[Vxe]=Wt[qxe]=Wt[Gxe]=Wt[Kxe]=!0;Wt[kxe]=Wt[Exe]=Wt[$xe]=Wt[Txe]=Wt[Bxe]=Wt[Axe]=Wt[Rxe]=Wt[Mxe]=Wt[jxe]=Wt[Nxe]=Wt[Dxe]=Wt[Lxe]=Wt[Pxe]=Wt[Oxe]=Wt[Ixe]=!1;function Yxe(e){return Cxe(e)&&Sxe(e.length)&&!!Wt[wxe(e)]}var Xxe=Yxe;function Jxe(e){return function(t){return e(t)}}var $f=Jxe,Qg={exports:{}};Qg.exports;(function(e,t){var n=y$,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,a=s&&n.process,o=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=o})(Qg,Qg.exports);var J0=Qg.exports,Qxe=Xxe,Zxe=$f,LA=J0,PA=LA&&LA.isTypedArray,eye=PA?Zxe(PA):Qxe,zk=eye;function tye(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var P$=tye,nye=Lk,rye=If,iye=Object.prototype,sye=iye.hasOwnProperty;function oye(e,t,n){var r=e[t];(!(sye.call(e,t)&&rye(r,n))||n===void 0&&!(t in e))&&nye(e,t,n)}var Hk=oye,aye=Hk,lye=Lk;function cye(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),i?lye(n,o,l):aye(n,o,l)}return n}var wu=cye;function uye(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var dye=uye,hye=9007199254740991,fye=/^(?:0|[1-9]\d*)$/;function pye(e,t){var n=typeof e;return t=t??hye,!!t&&(n=="number"||n!="symbol"&&fye.test(e))&&e>-1&&e%1==0&&e<t}var Q0=pye,mye=dye,gye=Y0,vye=Sr,xye=X0,yye=Q0,bye=zk,_ye=Object.prototype,wye=_ye.hasOwnProperty;function Sye(e,t){var n=vye(e),r=!n&&gye(e),i=!n&&!r&&xye(e),s=!n&&!r&&!i&&bye(e),a=n||r||i||s,o=a?mye(e.length,String):[],l=o.length;for(var u in e)(t||wye.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yye(u,l)))&&o.push(u);return o}var O$=Sye;function Cye(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var kye=Cye,Eye=ls,Tye=Ik,Aye=kye,Rye=Object.prototype,Mye=Rye.hasOwnProperty;function jye(e){if(!Eye(e))return Aye(e);var t=Tye(e),n=[];for(var r in e)r=="constructor"&&(t||!Mye.call(e,r))||n.push(r);return n}var Nye=jye,Dye=O$,Lye=Nye,Pye=_u;function Oye(e){return Pye(e)?Dye(e,!0):Lye(e)}var Bf=Oye,Iye=wu,$ye=Bf;function Bye(e){return Iye(e,$ye(e))}var Fye=Bye,OA=C$,zye=E$,Hye=A$,Wye=R$,Uye=j$,IA=Y0,$A=Sr,Vye=D$,qye=X0,Gye=V0,Kye=ls,Yye=Bk,Xye=zk,BA=P$,Jye=Fye;function Qye(e,t,n,r,i,s,a){var o=BA(e,n),l=BA(t,n),u=a.get(l);if(u){OA(e,n,u);return}var h=s?s(o,l,n+"",e,t,a):void 0,d=h===void 0;if(d){var f=$A(l),g=!f&&qye(l),b=!f&&!g&&Xye(l);h=l,f||g||b?$A(o)?h=o:Vye(o)?h=Wye(o):g?(d=!1,h=zye(l,!0)):b?(d=!1,h=Hye(l,!0)):h=[]:Yye(l)||IA(l)?(h=o,IA(o)?h=Jye(o):(!Kye(o)||Gye(o))&&(h=Uye(l))):d=!1}d&&(a.set(l,h),i(h,l,r,s,a),a.delete(l)),OA(e,n,h)}var Zye=Qye,ebe=K0,tbe=C$,nbe=k$,rbe=Zye,ibe=ls,sbe=Bf,obe=P$;function I$(e,t,n,r,i){e!==t&&nbe(t,function(s,a){if(i||(i=new ebe),ibe(s))rbe(e,t,a,n,I$,r,i);else{var o=r?r(obe(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),tbe(e,a,o)}},sbe)}var abe=I$;function lbe(e){return e}var Z0=lbe;function cbe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var ube=cbe,dbe=ube,FA=Math.max;function hbe(e,t,n){return t=FA(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=FA(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),dbe(e,this,o)}}var $$=hbe;function fbe(e){return function(){return e}}var pbe=fbe,mbe=pbe,zA=S$,gbe=Z0,vbe=zA?function(e,t){return zA(e,"toString",{configurable:!0,enumerable:!1,value:mbe(t),writable:!0})}:gbe,xbe=vbe,ybe=800,bbe=16,_be=Date.now;function wbe(e){var t=0,n=0;return function(){var r=_be(),i=bbe-(r-n);if(n=r,i>0){if(++t>=ybe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Sbe=wbe,Cbe=xbe,kbe=Sbe,Ebe=kbe(Cbe),B$=Ebe,Tbe=Z0,Abe=$$,Rbe=B$;function Mbe(e,t){return Rbe(Abe(e,t,Tbe),e+"")}var Wk=Mbe,jbe=If,Nbe=_u,Dbe=Q0,Lbe=ls;function Pbe(e,t,n){if(!Lbe(n))return!1;var r=typeof t;return(r=="number"?Nbe(n)&&Dbe(t,n.length):r=="string"&&t in n)?jbe(n[t],e):!1}var F$=Pbe,Obe=Wk,Ibe=F$;function $be(e){return Obe(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&Ibe(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var Bbe=$be,Fbe=abe,zbe=Bbe,Hbe=zbe(function(e,t,n){Fbe(e,t,n)}),Wbe=Hbe;const Ube=Rn(Wbe);var Vbe=ta,qbe=Di,Gbe="[object Symbol]";function Kbe(e){return typeof e=="symbol"||qbe(e)&&Vbe(e)==Gbe}var e1=Kbe,Ybe=Sr,Xbe=e1,Jbe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qbe=/^\w*$/;function Zbe(e,t){if(Ybe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Xbe(e)?!0:Qbe.test(e)||!Jbe.test(e)||t!=null&&e in Object(t)}var Uk=Zbe,z$=Dk,e_e="Expected a function";function Vk(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(e_e);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(Vk.Cache||z$),n}Vk.Cache=z$;var t_e=Vk,n_e=t_e,r_e=500;function i_e(e){var t=n_e(e,function(r){return n.size===r_e&&n.clear(),r}),n=t.cache;return t}var s_e=i_e,o_e=s_e,a_e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l_e=/\\(\\)?/g,c_e=o_e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(a_e,function(n,r,i,s){t.push(i?s.replace(l_e,"$1"):r||n)}),t}),u_e=c_e;function d_e(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var t1=d_e,HA=vu,h_e=t1,f_e=Sr,p_e=e1,m_e=1/0,WA=HA?HA.prototype:void 0,UA=WA?WA.toString:void 0;function H$(e){if(typeof e=="string")return e;if(f_e(e))return h_e(e,H$)+"";if(p_e(e))return UA?UA.call(e):"";var t=e+"";return t=="0"&&1/e==-m_e?"-0":t}var g_e=H$,v_e=g_e;function x_e(e){return e==null?"":v_e(e)}var y_e=x_e,b_e=Sr,__e=Uk,w_e=u_e,S_e=y_e;function C_e(e,t){return b_e(e)?e:__e(e,t)?[e]:w_e(S_e(e))}var Su=C_e,k_e=e1,E_e=1/0;function T_e(e){if(typeof e=="string"||k_e(e))return e;var t=e+"";return t=="0"&&1/e==-E_e?"-0":t}var Cu=T_e,A_e=Su,R_e=Cu;function M_e(e,t){t=A_e(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[R_e(t[n++])];return n&&n==r?e:void 0}var Ff=M_e,j_e=Ff;function N_e(e,t,n){var r=e==null?void 0:j_e(e,t);return r===void 0?n:r}var W$=N_e;const Os=Rn(W$);var D_e=Hk,L_e=Su,P_e=Q0,VA=ls,O_e=Cu;function I_e(e,t,n,r){if(!VA(e))return e;t=L_e(t,e);for(var i=-1,s=t.length,a=s-1,o=e;o!=null&&++i<s;){var l=O_e(t[i]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=a){var h=o[l];u=r?r(h,l,o):void 0,u===void 0&&(u=VA(h)?h:P_e(t[i+1])?[]:{})}D_e(o,l,u),o=o[l]}return e}var U$=I_e,$_e=U$;function B_e(e,t,n){return e==null?e:$_e(e,t,n)}var F_e=B_e;const _d=Rn(F_e);function n1(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function qk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ku(){}var Ha=.7,$c=1/Ha,pc="\\s*([+-]?\\d+)\\s*",zh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z_e=/^#([0-9a-f]{3,8})$/,H_e=new RegExp(`^rgb\\(${pc},${pc},${pc}\\)$`),W_e=new RegExp(`^rgb\\(${Ji},${Ji},${Ji}\\)$`),U_e=new RegExp(`^rgba\\(${pc},${pc},${pc},${zh}\\)$`),V_e=new RegExp(`^rgba\\(${Ji},${Ji},${Ji},${zh}\\)$`),q_e=new RegExp(`^hsl\\(${zh},${Ji},${Ji}\\)$`),G_e=new RegExp(`^hsla\\(${zh},${Ji},${Ji},${zh}\\)$`),qA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};n1(ku,Is,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:GA,formatHex:GA,formatHex8:K_e,formatHsl:Y_e,formatRgb:KA,toString:KA});function GA(){return this.rgb().formatHex()}function K_e(){return this.rgb().formatHex8()}function Y_e(){return q$(this).formatHsl()}function KA(){return this.rgb().formatRgb()}function Is(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=z_e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?YA(t):n===3?new qn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$p(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$p(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=H_e.exec(e))?new qn(t[1],t[2],t[3],1):(t=W_e.exec(e))?new qn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=U_e.exec(e))?$p(t[1],t[2],t[3],t[4]):(t=V_e.exec(e))?$p(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=q_e.exec(e))?QA(t[1],t[2]/100,t[3]/100,1):(t=G_e.exec(e))?QA(t[1],t[2]/100,t[3]/100,t[4]):qA.hasOwnProperty(e)?YA(qA[e]):e==="transparent"?new qn(NaN,NaN,NaN,0):null}function YA(e){return new qn(e>>16&255,e>>8&255,e&255,1)}function $p(e,t,n,r){return r<=0&&(e=t=n=NaN),new qn(e,t,n,r)}function V$(e){return e instanceof ku||(e=Is(e)),e?(e=e.rgb(),new qn(e.r,e.g,e.b,e.opacity)):new qn}function Bc(e,t,n,r){return arguments.length===1?V$(e):new qn(e,t,n,r??1)}function qn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}n1(qn,Bc,qk(ku,{brighter(e){return e=e==null?$c:Math.pow($c,e),new qn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ha:Math.pow(Ha,e),new qn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qn(ka(this.r),ka(this.g),ka(this.b),Zg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:XA,formatHex:XA,formatHex8:X_e,formatRgb:JA,toString:JA}));function XA(){return`#${xa(this.r)}${xa(this.g)}${xa(this.b)}`}function X_e(){return`#${xa(this.r)}${xa(this.g)}${xa(this.b)}${xa((isNaN(this.opacity)?1:this.opacity)*255)}`}function JA(){const e=Zg(this.opacity);return`${e===1?"rgb(":"rgba("}${ka(this.r)}, ${ka(this.g)}, ${ka(this.b)}${e===1?")":`, ${e})`}`}function Zg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ka(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xa(e){return e=ka(e),(e<16?"0":"")+e.toString(16)}function QA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xi(e,t,n,r)}function q$(e){if(e instanceof xi)return new xi(e.h,e.s,e.l,e.opacity);if(e instanceof ku||(e=Is(e)),!e)return new xi;if(e instanceof xi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new xi(a,o,l,e.opacity)}function J_e(e,t,n,r){return arguments.length===1?q$(e):new xi(e,t,n,r??1)}function xi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}n1(xi,J_e,qk(ku,{brighter(e){return e=e==null?$c:Math.pow($c,e),new xi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ha:Math.pow(Ha,e),new xi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new qn(My(e>=240?e-240:e+120,i,r),My(e,i,r),My(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new xi(ZA(this.h),Bp(this.s),Bp(this.l),Zg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Zg(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${Bp(this.s)*100}%, ${Bp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function Bp(e){return Math.max(0,Math.min(1,e||0))}function My(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Q_e=Math.PI/180,Z_e=180/Math.PI;var G$=-.14861,Gk=1.78277,Kk=-.29227,r1=-.90649,Hh=1.97294,eR=Hh*r1,tR=Hh*Gk,nR=Gk*Kk-r1*G$;function ewe(e){if(e instanceof Ea)return new Ea(e.h,e.s,e.l,e.opacity);e instanceof qn||(e=V$(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(nR*r+eR*t-tR*n)/(nR+eR-tR),s=r-i,a=(Hh*(n-i)-Kk*s)/r1,o=Math.sqrt(a*a+s*s)/(Hh*i*(1-i)),l=o?Math.atan2(a,s)*Z_e-120:NaN;return new Ea(l<0?l+360:l,o,i,e.opacity)}function ns(e,t,n,r){return arguments.length===1?ewe(e):new Ea(e,t,n,r??1)}function Ea(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}n1(Ea,ns,qk(ku,{brighter(e){return e=e==null?$c:Math.pow($c,e),new Ea(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ha:Math.pow(Ha,e),new Ea(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Q_e,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new qn(255*(t+n*(G$*r+Gk*i)),255*(t+n*(Kk*r+r1*i)),255*(t+n*(Hh*r)),this.opacity)}}));function twe(e,t,n,r,i){var s=e*e,a=s*e;return((1-3*e+3*s-a)*t+(4-6*s+3*a)*n+(1+3*e+3*s-3*a)*r+a*i)/6}function nwe(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],s=e[r+1],a=r>0?e[r-1]:2*i-s,o=r<t-1?e[r+2]:2*s-i;return twe((n-r/t)*t,a,i,s,o)}}const i1=e=>()=>e;function K$(e,t){return function(n){return e+n*t}}function rwe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function iwe(e,t){var n=t-e;return n?K$(e,n>180||n<-180?n-360*Math.round(n/360):n):i1(isNaN(e)?t:e)}function swe(e){return(e=+e)==1?mc:function(t,n){return n-t?rwe(t,n,e):i1(isNaN(t)?n:t)}}function mc(e,t){var n=t-e;return n?K$(e,n):i1(isNaN(e)?t:e)}const ev=function e(t){var n=swe(t);function r(i,s){var a=n((i=Bc(i)).r,(s=Bc(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),u=mc(i.opacity,s.opacity);return function(h){return i.r=a(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return r.gamma=e,r}(1);function owe(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),s=new Array(n),a,o;for(a=0;a<n;++a)o=Bc(t[a]),r[a]=o.r||0,i[a]=o.g||0,s[a]=o.b||0;return r=e(r),i=e(i),s=e(s),o.opacity=1,function(l){return o.r=r(l),o.g=i(l),o.b=s(l),o+""}}}var awe=owe(nwe);function lwe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function cwe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uwe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=s1(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function dwe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function vi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function hwe(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=s1(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var gw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jy=new RegExp(gw.source,"g");function fwe(e){return function(){return e}}function pwe(e){return function(t){return e(t)+""}}function Yk(e,t){var n=gw.lastIndex=jy.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=gw.exec(e))&&(i=jy.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:vi(r,i)})),n=jy.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?pwe(l[0].x):fwe(t):(t=l.length,function(u){for(var h=0,d;h<t;++h)o[(d=l[h]).i]=d.x(u);return o.join("")})}function s1(e,t){var n=typeof t,r;return t==null||n==="boolean"?i1(t):(n==="number"?vi:n==="string"?(r=Is(t))?(t=r,ev):Yk:t instanceof Is?ev:t instanceof Date?dwe:cwe(t)?lwe:Array.isArray(t)?uwe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?hwe:vi)(e,t)}function Y$(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var rR=180/Math.PI,vw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function X$(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*rR,skewX:Math.atan(l)*rR,scaleX:a,scaleY:o}}var Fp;function mwe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?vw:X$(t.a,t.b,t.c,t.d,t.e,t.f)}function gwe(e){return e==null||(Fp||(Fp=document.createElementNS("http://www.w3.org/2000/svg","g")),Fp.setAttribute("transform",e),!(e=Fp.transform.baseVal.consolidate()))?vw:(e=e.matrix,X$(e.a,e.b,e.c,e.d,e.e,e.f))}function J$(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function s(u,h,d,f,g,b){if(u!==d||h!==f){var x=g.push("translate(",null,t,null,n);b.push({i:x-4,x:vi(u,d)},{i:x-2,x:vi(h,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function a(u,h,d,f){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:vi(u,h)})):h&&d.push(i(d)+"rotate("+h+r)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:vi(u,h)}):h&&d.push(i(d)+"skewX("+h+r)}function l(u,h,d,f,g,b){if(u!==d||h!==f){var x=g.push(i(g)+"scale(",null,",",null,")");b.push({i:x-4,x:vi(u,d)},{i:x-2,x:vi(h,f)})}else(d!==1||f!==1)&&g.push(i(g)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=e(u),h=e(h),s(u.translateX,u.translateY,h.translateX,h.translateY,d,f),a(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(g){for(var b=-1,x=f.length,v;++b<x;)d[(v=f[b]).i]=v.x(g);return d.join("")}}}var vwe=J$(mwe,"px, ","px)","deg)"),xwe=J$(gwe,", ",")",")"),ywe=1e-12;function iR(e){return((e=Math.exp(e))+1/e)/2}function bwe(e){return((e=Math.exp(e))-1/e)/2}function _we(e){return((e=Math.exp(2*e))-1)/(e+1)}const wwe=function e(t,n,r){function i(s,a){var o=s[0],l=s[1],u=s[2],h=a[0],d=a[1],f=a[2],g=h-o,b=d-l,x=g*g+b*b,v,m;if(x<ywe)m=Math.log(f/u)/t,v=function(E){return[o+E*g,l+E*b,u*Math.exp(t*E*m)]};else{var p=Math.sqrt(x),y=(f*f-u*u+r*x)/(2*u*n*p),_=(f*f-u*u-r*x)/(2*f*n*p),C=Math.log(Math.sqrt(y*y+1)-y),S=Math.log(Math.sqrt(_*_+1)-_);m=(S-C)/t,v=function(E){var k=E*m,T=iR(C),A=u/(n*p)*(T*_we(t*k+C)-bwe(C));return[o+A*g,l+A*b,u*T/iR(t*k+C)]}}return v.duration=m*1e3*t/Math.SQRT2,v}return i.rho=function(s){var a=Math.max(.001,+s),o=a*a,l=o*o;return e(a,o,l)},i}(Math.SQRT2,2,4);function Q$(e){return function t(n){n=+n;function r(i,s){var a=e((i=ns(i)).h,(s=ns(s)).h),o=mc(i.s,s.s),l=mc(i.l,s.l),u=mc(i.opacity,s.opacity);return function(h){return i.h=a(h),i.s=o(h),i.l=l(Math.pow(h,n)),i.opacity=u(h),i+""}}return r.gamma=t,r}(1)}Q$(iwe);var Xk=Q$(mc),Swe=ta,Cwe=Sr,kwe=Di,Ewe="[object String]";function Twe(e){return typeof e=="string"||!Cwe(e)&&kwe(e)&&Swe(e)==Ewe}var Awe=Twe;const Rwe=Rn(Awe);function Mwe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Z$=Mwe;const je=Rn(Z$);function gc(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jwe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zf(e){let t,n,r;e.length!==2?(t=gc,n=(o,l)=>gc(e(o),l),r=(o,l)=>e(o)-l):(t=e===gc||e===jwe?e:Nwe,n=e,r=e);function i(o,l,u=0,h=o.length){if(u<h){if(t(l,l)!==0)return h;do{const d=u+h>>>1;n(o[d],l)<0?u=d+1:h=d}while(u<h)}return u}function s(o,l,u=0,h=o.length){if(u<h){if(t(l,l)!==0)return h;do{const d=u+h>>>1;n(o[d],l)<=0?u=d+1:h=d}while(u<h)}return u}function a(o,l,u=0,h=o.length){const d=i(o,l,u,h-1);return d>u&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Nwe(){return 0}function Dwe(e){return e===null?NaN:+e}function*Lwe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Pwe=zf(gc),Owe=Pwe.right;zf(Dwe).center;class sR extends Map{constructor(t,n=Bwe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(oR(this,t))}has(t){return super.has(oR(this,t))}set(t,n){return super.set(Iwe(this,t),n)}delete(t){return super.delete($we(this,t))}}function oR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Iwe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function $we({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Bwe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Fwe(e=gc){if(e===gc)return eB;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function eB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const zwe=Math.sqrt(50),Hwe=Math.sqrt(10),Wwe=Math.sqrt(2);function tv(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=zwe?10:s>=Hwe?5:s>=Wwe?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(e*u),l=Math.round(t*u),o/u<e&&++o,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,o=Math.round(e/u),l=Math.round(t/u),o*u<e&&++o,l*u>t&&--l),l<o&&.5<=n&&n<2?tv(e,t,n*2):[o,l,u]}function xw(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?tv(t,e,n):tv(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let u=0;u<o;++u)l[u]=(s-u)/-a;else for(let u=0;u<o;++u)l[u]=(s-u)*a;else if(a<0)for(let u=0;u<o;++u)l[u]=(i+u)/-a;else for(let u=0;u<o;++u)l[u]=(i+u)*a;return l}function yw(e,t,n){return t=+t,e=+e,n=+n,tv(e,t,n)[2]}function bw(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?yw(t,e,n):yw(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ao(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function aR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function tB(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?eB:Fwe(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,h=Math.log(l),d=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*d*(l-d)/l)*(u-l/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/l+f)),b=Math.min(r,Math.floor(t+(l-u)*d/l+f));tB(e,t,g,b,i)}const s=e[t];let a=n,o=r;for(Qu(e,n,t),i(e[r],s)>0&&Qu(e,n,r);a<o;){for(Qu(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Qu(e,n,o):(++o,Qu(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Qu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Uwe(e,t,n){if(e=Float64Array.from(Lwe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return aR(e);if(t>=1)return ao(e);var r,i=(r-1)*t,s=Math.floor(i),a=ao(tB(e,s).subarray(0,s+1)),o=aR(e.subarray(s+1));return a+(o-a)*(i-s)}}function Jk(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function cl(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Vwe(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const lR=Symbol("implicit");function ya(){var e=new sR,t=[],n=[],r=lR;function i(s){let a=e.get(s);if(a===void 0){if(r!==lR)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new sR;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return ya(t,n).unknown(r)},cl.apply(i,arguments),i}function o1(){var e=ya().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,u=0,h=.5;delete e.unknown;function d(){var f=t().length,g=i<r,b=g?i:r,x=g?r:i;s=(x-b)/Math.max(1,f-l+u*2),o&&(s=Math.floor(s)),b+=(x-b-s*(f-l))*h,a=s*(1-l),o&&(b=Math.round(b),a=Math.round(a));var v=Jk(f).map(function(m){return b+s*m});return n(g?v.reverse():v)}return e.domain=function(f){return arguments.length?(t(f),d()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(f){return arguments.length?(o=!!f,d()):o},e.padding=function(f){return arguments.length?(l=Math.min(1,u=+f),d()):l},e.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),d()):l},e.paddingOuter=function(f){return arguments.length?(u=+f,d()):u},e.align=function(f){return arguments.length?(h=Math.max(0,Math.min(1,f)),d()):h},e.copy=function(){return o1(t(),[r,i]).round(o).paddingInner(l).paddingOuter(u).align(h)},cl.apply(d(),arguments)}function nB(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return nB(t())},e}function qwe(){return nB(o1.apply(null,arguments).paddingInner(1))}function Gwe(e){return function(){return e}}function Kwe(e){return+e}var cR=[0,1];function yo(e){return e}function _w(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Gwe(isNaN(t)?NaN:.5)}function Ywe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Xwe(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=_w(i,r),s=n(a,s)):(r=_w(r,i),s=n(s,a)),function(o){return s(r(o))}}function Jwe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=_w(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Owe(e,o,1,r)-1;return s[l](i[l](o))}}function a1(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Qk(){var e=cR,t=cR,n=s1,r,i,s,a=yo,o,l,u;function h(){var f=Math.min(e.length,t.length);return a!==yo&&(a=Ywe(e[0],e[f-1])),o=f>2?Jwe:Xwe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?s:(l||(l=o(e.map(r),t,n)))(r(a(f)))}return d.invert=function(f){return a(i((u||(u=o(t,e.map(r),vi)))(f)))},d.domain=function(f){return arguments.length?(e=Array.from(f,Kwe),h()):e.slice()},d.range=function(f){return arguments.length?(t=Array.from(f),h()):t.slice()},d.rangeRound=function(f){return t=Array.from(f),n=Y$,h()},d.clamp=function(f){return arguments.length?(a=f?!0:yo,h()):a!==yo},d.interpolate=function(f){return arguments.length?(n=f,h()):n},d.unknown=function(f){return arguments.length?(s=f,d):s},function(f,g){return r=f,i=g,h()}}function rB(){return Qk()(yo,yo)}function Qwe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function nv(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Fc(e){return e=nv(Math.abs(e)),e?e[1]:NaN}function Zwe(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function e2e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var t2e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Wh(e){if(!(t=t2e.exec(e)))throw new Error("invalid format: "+e);var t;return new Zk({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Wh.prototype=Zk.prototype;function Zk(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Zk.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function n2e(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var iB;function r2e(e,t){var n=nv(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(iB=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+nv(e,Math.max(0,t+s-1))[0]}function uR(e,t){var n=nv(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const dR={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:Qwe,e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return uR(e*100,t)},r:uR,s:r2e,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function hR(e){return e}var fR=Array.prototype.map,pR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function i2e(e){var t=e.grouping===void 0||e.thousands===void 0?hR:Zwe(fR.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?hR:e2e(fR.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"-":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d){d=Wh(d);var f=d.fill,g=d.align,b=d.sign,x=d.symbol,v=d.zero,m=d.width,p=d.comma,y=d.precision,_=d.trim,C=d.type;C==="n"?(p=!0,C="g"):dR[C]||(y===void 0&&(y=12),_=!0,C="g"),(v||f==="0"&&g==="=")&&(v=!0,f="0",g="=");var S=x==="$"?n:x==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",E=x==="$"?r:/[%p]/.test(C)?a:"",k=dR[C],T=/[defgprs%]/.test(C);y=y===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function A(M){var D=S,L=E,N,O,B;if(C==="c")L=k(M)+L,M="";else{M=+M;var z=M<0||1/M<0;if(M=isNaN(M)?l:k(Math.abs(M),y),_&&(M=n2e(M)),z&&+M==0&&b!=="+"&&(z=!1),D=(z?b==="("?b:o:b==="-"||b==="("?"":b)+D,L=(C==="s"?pR[8+iB/3]:"")+L+(z&&b==="("?")":""),T){for(N=-1,O=M.length;++N<O;)if(B=M.charCodeAt(N),48>B||B>57){L=(B===46?i+M.slice(N+1):M.slice(N))+L,M=M.slice(0,N);break}}}p&&!v&&(M=t(M,1/0));var P=D.length+M.length+L.length,j=P<m?new Array(m-P+1).join(f):"";switch(p&&v&&(M=t(j+M,j.length?m-L.length:1/0),j=""),g){case"<":M=D+M+L+j;break;case"=":M=D+j+M+L;break;case"^":M=j.slice(0,P=j.length>>1)+D+M+L+j.slice(P);break;default:M=j+D+M+L;break}return s(M)}return A.toString=function(){return d+""},A}function h(d,f){var g=u((d=Wh(d),d.type="f",d)),b=Math.max(-8,Math.min(8,Math.floor(Fc(f)/3)))*3,x=Math.pow(10,-b),v=pR[8+b/3];return function(m){return g(x*m)+v}}return{format:u,formatPrefix:h}}var zp,Hf,sB;s2e({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function s2e(e){return zp=i2e(e),Hf=zp.format,sB=zp.formatPrefix,zp}function o2e(e){return Math.max(0,-Fc(Math.abs(e)))}function a2e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fc(t)/3)))*3-Fc(Math.abs(e)))}function l2e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Fc(t)-Fc(e))+1}function c2e(e,t,n,r){var i=bw(e,t,n),s;switch(r=Wh(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=a2e(i,a))&&(r.precision=s),sB(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=l2e(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=o2e(i))&&(r.precision=s-(r.type==="%")*2);break}}return Hf(r)}function e5(e){var t=e.domain;return e.ticks=function(n){var r=t();return xw(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return c2e(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,u,h=10;for(o<a&&(u=a,a=o,o=u,u=i,i=s,s=u);h-- >0;){if(u=yw(a,o,n),u===l)return r[i]=a,r[s]=o,t(r);if(u>0)a=Math.floor(a/u)*u,o=Math.ceil(o/u)*u;else if(u<0)a=Math.ceil(a*u)/u,o=Math.floor(o*u)/u;else break;l=u}return e},e}function bo(){var e=rB();return e.copy=function(){return a1(e,bo())},cl.apply(e,arguments),e5(e)}function oB(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function mR(e){return Math.log(e)}function gR(e){return Math.exp(e)}function u2e(e){return-Math.log(-e)}function d2e(e){return-Math.exp(-e)}function h2e(e){return isFinite(e)?+("1e"+e):e<0?0:e}function f2e(e){return e===10?h2e:e===Math.E?Math.exp:t=>Math.pow(e,t)}function p2e(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function vR(e){return(t,n)=>-e(-t,n)}function m2e(e){const t=e(mR,gR),n=t.domain;let r=10,i,s;function a(){return i=p2e(r),s=f2e(r),n()[0]<0?(i=vR(i),s=vR(s),e(u2e,d2e)):e(mR,gR),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let u=l[0],h=l[l.length-1];const d=h<u;d&&([u,h]=[h,u]);let f=i(u),g=i(h),b,x;const v=o==null?10:+o;let m=[];if(!(r%1)&&g-f<v){if(f=Math.floor(f),g=Math.ceil(g),u>0){for(;f<=g;++f)for(b=1;b<r;++b)if(x=f<0?b/s(-f):b*s(f),!(x<u)){if(x>h)break;m.push(x)}}else for(;f<=g;++f)for(b=r-1;b>=1;--b)if(x=f>0?b/s(-f):b*s(f),!(x<u)){if(x>h)break;m.push(x)}m.length*2<v&&(m=xw(u,h,v))}else m=xw(f,g,Math.min(g-f,v)).map(s);return d?m.reverse():m},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Wh(l)).precision==null&&(l.trim=!0),l=Hf(l)),o===1/0)return l;const u=Math.max(1,r*o/t.ticks().length);return h=>{let d=h/s(Math.round(i(h)));return d*r<r-.5&&(d*=r),d<=u?l(h):""}},t.nice=()=>n(oB(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function aB(){const e=m2e(Qk()).domain([1,10]);return e.copy=()=>a1(e,aB()).base(e.base()),cl.apply(e,arguments),e}function xR(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function yR(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function g2e(e){var t=1,n=e(xR(t),yR(t));return n.constant=function(r){return arguments.length?e(xR(t=+r),yR(t)):t},e5(n)}function lB(){var e=g2e(Qk());return e.copy=function(){return a1(e,lB()).constant(e.constant())},cl.apply(e,arguments)}const Ny=new Date,Dy=new Date;function kn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let u;do l.push(u=new Date(+s)),t(s,o),e(s);while(u<s&&s<a);return l},i.filter=s=>kn(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(Ny.setTime(+s),Dy.setTime(+a),e(Ny),e(Dy),Math.floor(n(Ny,Dy))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const rv=kn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?kn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rv);rv.range;const Cs=1e3,Yr=Cs*60,ks=Yr*60,$s=ks*24,t5=$s*7,bR=$s*30,Ly=$s*365,ba=kn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Cs)},(e,t)=>(t-e)/Cs,e=>e.getUTCSeconds());ba.range;const n5=kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cs)},(e,t)=>{e.setTime(+e+t*Yr)},(e,t)=>(t-e)/Yr,e=>e.getMinutes());n5.range;const r5=kn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Yr)},(e,t)=>(t-e)/Yr,e=>e.getUTCMinutes());r5.range;const i5=kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cs-e.getMinutes()*Yr)},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getHours());i5.range;const s5=kn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getUTCHours());s5.range;const o5=kn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Yr)/$s,e=>e.getDate()-1);o5.range;const cB=kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$s,e=>e.getUTCDate()-1);cB.range;const uB=kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$s,e=>Math.floor(e/$s));uB.range;function ul(e){return kn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Yr)/t5)}const a5=ul(0),v2e=ul(1),x2e=ul(2),y2e=ul(3),b2e=ul(4),_2e=ul(5),w2e=ul(6);a5.range;v2e.range;x2e.range;y2e.range;b2e.range;_2e.range;w2e.range;function dl(e){return kn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/t5)}const l5=dl(0),S2e=dl(1),C2e=dl(2),k2e=dl(3),E2e=dl(4),T2e=dl(5),A2e=dl(6);l5.range;S2e.range;C2e.range;k2e.range;E2e.range;T2e.range;A2e.range;const c5=kn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());c5.range;const u5=kn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());u5.range;const l1=kn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());l1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:kn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});l1.range;const c1=kn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());c1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:kn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});c1.range;function dB(e,t,n,r,i,s){const a=[[ba,1,Cs],[ba,5,5*Cs],[ba,15,15*Cs],[ba,30,30*Cs],[s,1,Yr],[s,5,5*Yr],[s,15,15*Yr],[s,30,30*Yr],[i,1,ks],[i,3,3*ks],[i,6,6*ks],[i,12,12*ks],[r,1,$s],[r,2,2*$s],[n,1,t5],[t,1,bR],[t,3,3*bR],[e,1,Ly]];function o(u,h,d){const f=h<u;f&&([u,h]=[h,u]);const g=d&&typeof d.range=="function"?d:l(u,h,d),b=g?g.range(u,+h+1):[];return f?b.reverse():b}function l(u,h,d){const f=Math.abs(h-u)/d,g=zf(([,,v])=>v).right(a,f);if(g===a.length)return e.every(bw(u/Ly,h/Ly,d));if(g===0)return rv.every(Math.max(bw(u,h,d),1));const[b,x]=a[f/a[g-1][2]<a[g][2]/f?g-1:g];return b.every(x)}return[o,l]}const[R2e,M2e]=dB(c1,u5,l5,uB,s5,r5),[j2e,N2e]=dB(l1,c5,a5,o5,i5,n5);var Py=new Date,Oy=new Date;function xn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=function(s){return e(s=new Date(+s)),s},i.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},i.round=function(s){var a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=function(s,a){return t(s=new Date(+s),a==null?1:Math.floor(a)),s},i.range=function(s,a,o){var l=[],u;if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;do l.push(u=new Date(+s)),t(s,o),e(s);while(u<s&&s<a);return l},i.filter=function(s){return xn(function(a){if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},function(a,o){if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););})},n&&(i.count=function(s,a){return Py.setTime(+s),Oy.setTime(+a),e(Py),e(Oy),Math.floor(n(Py,Oy))},i.every=function(s){return s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?function(a){return r(a)%s===0}:function(a){return i.count(0,a)%s===0}):i}),i}var Uh=xn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});Uh.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?xn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):Uh};Uh.range;var iv=1e3,Wa=6e4,sv=36e5,hB=864e5,fB=6048e5,ww=xn(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*iv)},function(e,t){return(t-e)/iv},function(e){return e.getUTCSeconds()});ww.range;var pB=xn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*iv)},function(e,t){e.setTime(+e+t*Wa)},function(e,t){return(t-e)/Wa},function(e){return e.getMinutes()});pB.range;var mB=xn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*iv-e.getMinutes()*Wa)},function(e,t){e.setTime(+e+t*sv)},function(e,t){return(t-e)/sv},function(e){return e.getHours()});mB.range;var d5=xn(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Wa)/hB},function(e){return e.getDate()-1});d5.range;function hl(e){return xn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Wa)/fB})}var ov=hl(0),Vh=hl(1),gB=hl(2),vB=hl(3),Ua=hl(4),xB=hl(5),yB=hl(6);ov.range;Vh.range;gB.range;vB.range;Ua.range;xB.range;yB.range;var bB=xn(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});bB.range;var Wo=xn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});Wo.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:xn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};Wo.range;var _B=xn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*Wa)},function(e,t){return(t-e)/Wa},function(e){return e.getUTCMinutes()});_B.range;var wB=xn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*sv)},function(e,t){return(t-e)/sv},function(e){return e.getUTCHours()});wB.range;var h5=xn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/hB},function(e){return e.getUTCDate()-1});h5.range;function fl(e){return xn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/fB})}var av=fl(0),qh=fl(1),SB=fl(2),CB=fl(3),Va=fl(4),kB=fl(5),EB=fl(6);av.range;qh.range;SB.range;CB.range;Va.range;kB.range;EB.range;var TB=xn(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});TB.range;var Uo=xn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});Uo.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:xn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};Uo.range;function Iy(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function $y(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Zu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function D2e(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,u=ed(i),h=td(i),d=ed(s),f=td(s),g=ed(a),b=td(a),x=ed(o),v=td(o),m=ed(l),p=td(l),y={a:z,A:P,b:j,B:R,c:null,d:ER,e:ER,f:nSe,g:hSe,G:pSe,H:Z2e,I:eSe,j:tSe,L:AB,m:rSe,M:iSe,p:I,q:H,Q:RR,s:MR,S:sSe,u:oSe,U:aSe,V:lSe,w:cSe,W:uSe,x:null,X:null,y:dSe,Y:fSe,Z:mSe,"%":AR},_={a:F,A:G,b:Z,B:J,c:null,d:TR,e:TR,f:ySe,g:RSe,G:jSe,H:gSe,I:vSe,j:xSe,L:MB,m:bSe,M:_Se,p:W,q:$,Q:RR,s:MR,S:wSe,u:SSe,U:CSe,V:kSe,w:ESe,W:TSe,x:null,X:null,y:ASe,Y:MSe,Z:NSe,"%":AR},C={a:A,A:M,b:D,B:L,c:N,d:CR,e:CR,f:Y2e,g:SR,G:wR,H:kR,I:kR,j:V2e,L:K2e,m:U2e,M:q2e,p:T,q:W2e,Q:J2e,s:Q2e,S:G2e,u:$2e,U:B2e,V:F2e,w:I2e,W:z2e,x:O,X:B,y:SR,Y:wR,Z:H2e,"%":X2e};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),_.x=S(n,_),_.X=S(r,_),_.c=S(t,_);function S(V,U){return function(X){var q=[],ne=-1,te=0,le=V.length,xe,ie,Te;for(X instanceof Date||(X=new Date(+X));++ne<le;)V.charCodeAt(ne)===37&&(q.push(V.slice(te,ne)),(ie=_R[xe=V.charAt(++ne)])!=null?xe=V.charAt(++ne):ie=xe==="e"?" ":"0",(Te=U[xe])&&(xe=Te(X,ie)),q.push(xe),te=ne+1);return q.push(V.slice(te,ne)),q.join("")}}function E(V,U){return function(X){var q=Zu(1900,void 0,1),ne=k(q,V,X+="",0),te,le;if(ne!=X.length)return null;if("Q"in q)return new Date(q.Q);if("s"in q)return new Date(q.s*1e3+("L"in q?q.L:0));if(U&&!("Z"in q)&&(q.Z=0),"p"in q&&(q.H=q.H%12+q.p*12),q.m===void 0&&(q.m="q"in q?q.q:0),"V"in q){if(q.V<1||q.V>53)return null;"w"in q||(q.w=1),"Z"in q?(te=$y(Zu(q.y,0,1)),le=te.getUTCDay(),te=le>4||le===0?qh.ceil(te):qh(te),te=h5.offset(te,(q.V-1)*7),q.y=te.getUTCFullYear(),q.m=te.getUTCMonth(),q.d=te.getUTCDate()+(q.w+6)%7):(te=Iy(Zu(q.y,0,1)),le=te.getDay(),te=le>4||le===0?Vh.ceil(te):Vh(te),te=d5.offset(te,(q.V-1)*7),q.y=te.getFullYear(),q.m=te.getMonth(),q.d=te.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),le="Z"in q?$y(Zu(q.y,0,1)).getUTCDay():Iy(Zu(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(le+5)%7:q.w+q.U*7-(le+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,$y(q)):Iy(q)}}function k(V,U,X,q){for(var ne=0,te=U.length,le=X.length,xe,ie;ne<te;){if(q>=le)return-1;if(xe=U.charCodeAt(ne++),xe===37){if(xe=U.charAt(ne++),ie=C[xe in _R?U.charAt(ne++):xe],!ie||(q=ie(V,X,q))<0)return-1}else if(xe!=X.charCodeAt(q++))return-1}return q}function T(V,U,X){var q=u.exec(U.slice(X));return q?(V.p=h.get(q[0].toLowerCase()),X+q[0].length):-1}function A(V,U,X){var q=g.exec(U.slice(X));return q?(V.w=b.get(q[0].toLowerCase()),X+q[0].length):-1}function M(V,U,X){var q=d.exec(U.slice(X));return q?(V.w=f.get(q[0].toLowerCase()),X+q[0].length):-1}function D(V,U,X){var q=m.exec(U.slice(X));return q?(V.m=p.get(q[0].toLowerCase()),X+q[0].length):-1}function L(V,U,X){var q=x.exec(U.slice(X));return q?(V.m=v.get(q[0].toLowerCase()),X+q[0].length):-1}function N(V,U,X){return k(V,t,U,X)}function O(V,U,X){return k(V,n,U,X)}function B(V,U,X){return k(V,r,U,X)}function z(V){return a[V.getDay()]}function P(V){return s[V.getDay()]}function j(V){return l[V.getMonth()]}function R(V){return o[V.getMonth()]}function I(V){return i[+(V.getHours()>=12)]}function H(V){return 1+~~(V.getMonth()/3)}function F(V){return a[V.getUTCDay()]}function G(V){return s[V.getUTCDay()]}function Z(V){return l[V.getUTCMonth()]}function J(V){return o[V.getUTCMonth()]}function W(V){return i[+(V.getUTCHours()>=12)]}function $(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var U=S(V+="",y);return U.toString=function(){return V},U},parse:function(V){var U=E(V+="",!1);return U.toString=function(){return V},U},utcFormat:function(V){var U=S(V+="",_);return U.toString=function(){return V},U},utcParse:function(V){var U=E(V+="",!0);return U.toString=function(){return V},U}}}var _R={"-":"",_:" ",0:"0"},Mn=/^\s*\d+/,L2e=/^%/,P2e=/[\\^$*+?|[\]().{}]/g;function _t(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function O2e(e){return e.replace(P2e,"\\$&")}function ed(e){return new RegExp("^(?:"+e.map(O2e).join("|")+")","i")}function td(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function I2e(e,t,n){var r=Mn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function $2e(e,t,n){var r=Mn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function B2e(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function F2e(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function z2e(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function wR(e,t,n){var r=Mn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function SR(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function H2e(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function W2e(e,t,n){var r=Mn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function U2e(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function CR(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function V2e(e,t,n){var r=Mn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kR(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function q2e(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function G2e(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function K2e(e,t,n){var r=Mn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Y2e(e,t,n){var r=Mn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function X2e(e,t,n){var r=L2e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function J2e(e,t,n){var r=Mn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Q2e(e,t,n){var r=Mn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ER(e,t){return _t(e.getDate(),t,2)}function Z2e(e,t){return _t(e.getHours(),t,2)}function eSe(e,t){return _t(e.getHours()%12||12,t,2)}function tSe(e,t){return _t(1+d5.count(Wo(e),e),t,3)}function AB(e,t){return _t(e.getMilliseconds(),t,3)}function nSe(e,t){return AB(e,t)+"000"}function rSe(e,t){return _t(e.getMonth()+1,t,2)}function iSe(e,t){return _t(e.getMinutes(),t,2)}function sSe(e,t){return _t(e.getSeconds(),t,2)}function oSe(e){var t=e.getDay();return t===0?7:t}function aSe(e,t){return _t(ov.count(Wo(e)-1,e),t,2)}function RB(e){var t=e.getDay();return t>=4||t===0?Ua(e):Ua.ceil(e)}function lSe(e,t){return e=RB(e),_t(Ua.count(Wo(e),e)+(Wo(e).getDay()===4),t,2)}function cSe(e){return e.getDay()}function uSe(e,t){return _t(Vh.count(Wo(e)-1,e),t,2)}function dSe(e,t){return _t(e.getFullYear()%100,t,2)}function hSe(e,t){return e=RB(e),_t(e.getFullYear()%100,t,2)}function fSe(e,t){return _t(e.getFullYear()%1e4,t,4)}function pSe(e,t){var n=e.getDay();return e=n>=4||n===0?Ua(e):Ua.ceil(e),_t(e.getFullYear()%1e4,t,4)}function mSe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+_t(t/60|0,"0",2)+_t(t%60,"0",2)}function TR(e,t){return _t(e.getUTCDate(),t,2)}function gSe(e,t){return _t(e.getUTCHours(),t,2)}function vSe(e,t){return _t(e.getUTCHours()%12||12,t,2)}function xSe(e,t){return _t(1+h5.count(Uo(e),e),t,3)}function MB(e,t){return _t(e.getUTCMilliseconds(),t,3)}function ySe(e,t){return MB(e,t)+"000"}function bSe(e,t){return _t(e.getUTCMonth()+1,t,2)}function _Se(e,t){return _t(e.getUTCMinutes(),t,2)}function wSe(e,t){return _t(e.getUTCSeconds(),t,2)}function SSe(e){var t=e.getUTCDay();return t===0?7:t}function CSe(e,t){return _t(av.count(Uo(e)-1,e),t,2)}function jB(e){var t=e.getUTCDay();return t>=4||t===0?Va(e):Va.ceil(e)}function kSe(e,t){return e=jB(e),_t(Va.count(Uo(e),e)+(Uo(e).getUTCDay()===4),t,2)}function ESe(e){return e.getUTCDay()}function TSe(e,t){return _t(qh.count(Uo(e)-1,e),t,2)}function ASe(e,t){return _t(e.getUTCFullYear()%100,t,2)}function RSe(e,t){return e=jB(e),_t(e.getUTCFullYear()%100,t,2)}function MSe(e,t){return _t(e.getUTCFullYear()%1e4,t,4)}function jSe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Va(e):Va.ceil(e),_t(e.getUTCFullYear()%1e4,t,4)}function NSe(){return"+0000"}function AR(){return"%"}function RR(e){return+e}function MR(e){return Math.floor(+e/1e3)}var Ml,u1,NB,DB,LB;DSe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function DSe(e){return Ml=D2e(e),u1=Ml.format,NB=Ml.parse,DB=Ml.utcFormat,LB=Ml.utcParse,Ml}function LSe(e){return new Date(e)}function PSe(e){return e instanceof Date?+e:+new Date(+e)}function f5(e,t,n,r,i,s,a,o,l,u){var h=rB(),d=h.invert,f=h.domain,g=u(".%L"),b=u(":%S"),x=u("%I:%M"),v=u("%I %p"),m=u("%a %d"),p=u("%b %d"),y=u("%B"),_=u("%Y");function C(S){return(l(S)<S?g:o(S)<S?b:a(S)<S?x:s(S)<S?v:r(S)<S?i(S)<S?m:p:n(S)<S?y:_)(S)}return h.invert=function(S){return new Date(d(S))},h.domain=function(S){return arguments.length?f(Array.from(S,PSe)):f().map(LSe)},h.ticks=function(S){var E=f();return e(E[0],E[E.length-1],S??10)},h.tickFormat=function(S,E){return E==null?C:u(E)},h.nice=function(S){var E=f();return(!S||typeof S.range!="function")&&(S=t(E[0],E[E.length-1],S??10)),S?f(oB(E,S)):h},h.copy=function(){return a1(h,f5(e,t,n,r,i,s,a,o,l,u))},h}function p5(){return cl.apply(f5(j2e,N2e,l1,c5,a5,o5,i5,n5,ba,u1).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function OSe(){return cl.apply(f5(R2e,M2e,c1,u5,l5,cB,s5,r5,ba,DB).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ISe(){var e=0,t=1,n,r,i,s,a=yo,o=!1,l;function u(d){return d==null||isNaN(d=+d)?l:a(i===0?.5:(d=(s(d)-n)*i,o?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(d){return arguments.length?(o=!!d,u):o},u.interpolator=function(d){return arguments.length?(a=d,u):a};function h(d){return function(f){var g,b;return arguments.length?([g,b]=f,a=d(g,b),u):[a(0),a(1)]}}return u.range=h(s1),u.rangeRound=h(Y$),u.unknown=function(d){return arguments.length?(l=d,u):l},function(d){return s=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),u}}function $Se(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function PB(){var e=e5(ISe()(yo));return e.copy=function(){return $Se(e,PB())},Vwe.apply(e,arguments)}function Xe(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}const OB=Xe("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),IB=Xe("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),$B=Xe("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),BB=Xe("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),FB=Xe("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),zB=Xe("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),HB=Xe("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),WB=Xe("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),m5=Xe("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),BSe=Xe("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),jt=e=>awe(e[e.length-1]);var d1=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Xe);const FSe=jt(d1);var h1=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Xe);const zSe=jt(h1);var f1=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Xe);const HSe=jt(f1);var p1=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Xe);const WSe=jt(p1);var m1=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Xe);const USe=jt(m1);var g1=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Xe);const VSe=jt(g1);var v1=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Xe);const qSe=jt(v1);var x1=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Xe);const UB=jt(x1);var y1=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Xe);const GSe=jt(y1);var b1=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Xe);const KSe=jt(b1);var _1=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Xe);const YSe=jt(_1);var w1=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Xe);const XSe=jt(w1);var S1=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Xe);const JSe=jt(S1);var C1=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Xe);const QSe=jt(C1);var k1=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Xe);const ZSe=jt(k1);var E1=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Xe);const eCe=jt(E1);var T1=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Xe);const tCe=jt(T1);var A1=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Xe);const nCe=jt(A1);var R1=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Xe);const VB=jt(R1);var M1=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Xe);const rCe=jt(M1);var j1=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Xe);const qB=jt(j1);var N1=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Xe);const iCe=jt(N1);var D1=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Xe);const sCe=jt(D1);var L1=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Xe);const oCe=jt(L1);var P1=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Xe);const aCe=jt(P1);var O1=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Xe);const lCe=jt(O1);var I1=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Xe);const cCe=jt(I1);function uCe(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const dCe=Xk(ns(300,.5,0),ns(-240,.5,1));var hCe=Xk(ns(-100,.75,.35),ns(80,1.5,.8)),GB=Xk(ns(260,.75,.35),ns(80,1.5,.8)),Hp=ns();function fCe(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Hp.h=360*e-100,Hp.s=1.5-1.5*t,Hp.l=.8-.9*t,Hp+""}var Wp=Bc(),pCe=Math.PI/3,mCe=Math.PI*2/3;function gCe(e){var t;return e=(.5-e)*Math.PI,Wp.r=255*(t=Math.sin(e))*t,Wp.g=255*(t=Math.sin(e+pCe))*t,Wp.b=255*(t=Math.sin(e+mCe))*t,Wp+""}function vCe(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function $1(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const KB=$1(Xe("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var xCe=$1(Xe("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),yCe=$1(Xe("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),bCe=$1(Xe("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),_Ce="__lodash_hash_undefined__";function wCe(e){return this.__data__.set(e,_Ce),this}var SCe=wCe;function CCe(e){return this.__data__.has(e)}var kCe=CCe,ECe=Dk,TCe=SCe,ACe=kCe;function lv(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ECe;++t<n;)this.add(e[t])}lv.prototype.add=lv.prototype.push=TCe;lv.prototype.has=ACe;var g5=lv;function RCe(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var MCe=RCe;function jCe(e){return e!==e}var NCe=jCe;function DCe(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var LCe=DCe,PCe=MCe,OCe=NCe,ICe=LCe;function $Ce(e,t,n){return t===t?ICe(e,t,n):PCe(e,OCe,n)}var BCe=$Ce,FCe=BCe;function zCe(e,t){var n=e==null?0:e.length;return!!n&&FCe(e,t,0)>-1}var YB=zCe;function HCe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var XB=HCe;function WCe(e,t){return e.has(t)}var v5=WCe,UCe=g5,VCe=YB,qCe=XB,GCe=t1,KCe=$f,YCe=v5,XCe=200;function JCe(e,t,n,r){var i=-1,s=VCe,a=!0,o=e.length,l=[],u=t.length;if(!o)return l;n&&(t=GCe(t,KCe(n))),r?(s=qCe,a=!1):t.length>=XCe&&(s=YCe,a=!1,t=new UCe(t));e:for(;++i<o;){var h=e[i],d=n==null?h:n(h);if(h=r||h!==0?h:0,a&&d===d){for(var f=u;f--;)if(t[f]===d)continue e;l.push(h)}else s(t,d,r)||l.push(h)}return l}var QCe=JCe,ZCe=QCe,eke=Wk,tke=D$,nke=eke(function(e,t){return tke(e)?ZCe(e,t):[]}),rke=nke;const JB=Rn(rke);function Ut(e){return function(){return e}}const jR=Math.abs,Bn=Math.atan2,sa=Math.cos,ike=Math.max,By=Math.min,Oi=Math.sin,Jl=Math.sqrt,Fn=1e-12,Gh=Math.PI,cv=Gh/2,Cm=2*Gh;function ske(e){return e>1?0:e<-1?Gh:Math.acos(e)}function NR(e){return e>=1?cv:e<=-1?-cv:Math.asin(e)}const Sw=Math.PI,Cw=2*Sw,ca=1e-6,oke=Cw-ca;function QB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ake(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return QB;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class lke{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?QB:ake(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,u=i-n,h=a-t,d=o-n,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>ca)if(!(Math.abs(d*l-u*h)>ca)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-a,b=i-o,x=l*l+u*u,v=g*g+b*b,m=Math.sqrt(x),p=Math.sqrt(f),y=s*Math.tan((Sw-Math.acos((x+f-v)/(2*m*p)))/2),_=y/p,C=y/m;Math.abs(_-1)>ca&&this._append`L${t+_*h},${n+_*d}`,this._append`A${s},${s},0,0,${+(d*g>h*b)},${this._x1=t+C*l},${this._y1=n+C*u}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),u=t+o,h=n+l,d=1^a,f=a?i-s:s-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>ca||Math.abs(this._y1-h)>ca)&&this._append`L${u},${h}`,r&&(f<0&&(f=f%Cw+Cw),f>oke?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=u},${this._y1=h}`:f>ca&&this._append`A${r},${r},0,${+(f>=Sw)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function ZB(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new lke(t)}function cke(e){return e.innerRadius}function uke(e){return e.outerRadius}function dke(e){return e.startAngle}function hke(e){return e.endAngle}function fke(e){return e&&e.padAngle}function pke(e,t,n,r,i,s,a,o){var l=n-e,u=r-t,h=a-i,d=o-s,f=d*l-h*u;if(!(f*f<Fn))return f=(h*(t-s)-d*(e-i))/f,[e+f*l,t+f*u]}function Up(e,t,n,r,i,s,a){var o=e-n,l=t-r,u=(a?s:-s)/Jl(o*o+l*l),h=u*l,d=-u*o,f=e+h,g=t+d,b=n+h,x=r+d,v=(f+b)/2,m=(g+x)/2,p=b-f,y=x-g,_=p*p+y*y,C=i-s,S=f*x-b*g,E=(y<0?-1:1)*Jl(ike(0,C*C*_-S*S)),k=(S*y-p*E)/_,T=(-S*p-y*E)/_,A=(S*y+p*E)/_,M=(-S*p+y*E)/_,D=k-v,L=T-m,N=A-v,O=M-m;return D*D+L*L>N*N+O*O&&(k=A,T=M),{cx:k,cy:T,x01:-h,y01:-d,x11:k*(i/C-1),y11:T*(i/C-1)}}function mke(){var e=cke,t=uke,n=Ut(0),r=null,i=dke,s=hke,a=fke,o=null,l=ZB(u);function u(){var h,d,f=+e.apply(this,arguments),g=+t.apply(this,arguments),b=i.apply(this,arguments)-cv,x=s.apply(this,arguments)-cv,v=jR(x-b),m=x>b;if(o||(o=h=l()),g<f&&(d=g,g=f,f=d),!(g>Fn))o.moveTo(0,0);else if(v>Cm-Fn)o.moveTo(g*sa(b),g*Oi(b)),o.arc(0,0,g,b,x,!m),f>Fn&&(o.moveTo(f*sa(x),f*Oi(x)),o.arc(0,0,f,x,b,m));else{var p=b,y=x,_=b,C=x,S=v,E=v,k=a.apply(this,arguments)/2,T=k>Fn&&(r?+r.apply(this,arguments):Jl(f*f+g*g)),A=By(jR(g-f)/2,+n.apply(this,arguments)),M=A,D=A,L,N;if(T>Fn){var O=NR(T/f*Oi(k)),B=NR(T/g*Oi(k));(S-=O*2)>Fn?(O*=m?1:-1,_+=O,C-=O):(S=0,_=C=(b+x)/2),(E-=B*2)>Fn?(B*=m?1:-1,p+=B,y-=B):(E=0,p=y=(b+x)/2)}var z=g*sa(p),P=g*Oi(p),j=f*sa(C),R=f*Oi(C);if(A>Fn){var I=g*sa(y),H=g*Oi(y),F=f*sa(_),G=f*Oi(_),Z;if(v<Gh)if(Z=pke(z,P,F,G,I,H,j,R)){var J=z-Z[0],W=P-Z[1],$=I-Z[0],V=H-Z[1],U=1/Oi(ske((J*$+W*V)/(Jl(J*J+W*W)*Jl($*$+V*V)))/2),X=Jl(Z[0]*Z[0]+Z[1]*Z[1]);M=By(A,(f-X)/(U-1)),D=By(A,(g-X)/(U+1))}else M=D=0}E>Fn?D>Fn?(L=Up(F,G,z,P,g,D,m),N=Up(I,H,j,R,g,D,m),o.moveTo(L.cx+L.x01,L.cy+L.y01),D<A?o.arc(L.cx,L.cy,D,Bn(L.y01,L.x01),Bn(N.y01,N.x01),!m):(o.arc(L.cx,L.cy,D,Bn(L.y01,L.x01),Bn(L.y11,L.x11),!m),o.arc(0,0,g,Bn(L.cy+L.y11,L.cx+L.x11),Bn(N.cy+N.y11,N.cx+N.x11),!m),o.arc(N.cx,N.cy,D,Bn(N.y11,N.x11),Bn(N.y01,N.x01),!m))):(o.moveTo(z,P),o.arc(0,0,g,p,y,!m)):o.moveTo(z,P),!(f>Fn)||!(S>Fn)?o.lineTo(j,R):M>Fn?(L=Up(j,R,I,H,f,-M,m),N=Up(z,P,F,G,f,-M,m),o.lineTo(L.cx+L.x01,L.cy+L.y01),M<A?o.arc(L.cx,L.cy,M,Bn(L.y01,L.x01),Bn(N.y01,N.x01),!m):(o.arc(L.cx,L.cy,M,Bn(L.y01,L.x01),Bn(L.y11,L.x11),!m),o.arc(0,0,f,Bn(L.cy+L.y11,L.cx+L.x11),Bn(N.cy+N.y11,N.cx+N.x11),m),o.arc(N.cx,N.cy,M,Bn(N.y11,N.x11),Bn(N.y01,N.x01),!m))):o.arc(0,0,f,C,_,m)}if(o.closePath(),h)return o=null,h+""||null}return u.centroid=function(){var h=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Gh/2;return[sa(d)*h,Oi(d)*h]},u.innerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:Ut(+h),u):e},u.outerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:Ut(+h),u):t},u.cornerRadius=function(h){return arguments.length?(n=typeof h=="function"?h:Ut(+h),u):n},u.padRadius=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Ut(+h),u):r},u.startAngle=function(h){return arguments.length?(i=typeof h=="function"?h:Ut(+h),u):i},u.endAngle=function(h){return arguments.length?(s=typeof h=="function"?h:Ut(+h),u):s},u.padAngle=function(h){return arguments.length?(a=typeof h=="function"?h:Ut(+h),u):a},u.context=function(h){return arguments.length?(o=h??null,u):o},u}function x5(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eF(e){this._context=e}eF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function tF(e){return new eF(e)}function gke(e){return e[0]}function vke(e){return e[1]}function nF(e,t){var n=Ut(!0),r=null,i=tF,s=null,a=ZB(o);e=typeof e=="function"?e:e===void 0?gke:Ut(e),t=typeof t=="function"?t:t===void 0?vke:Ut(t);function o(l){var u,h=(l=x5(l)).length,d,f=!1,g;for(r==null&&(s=i(g=a())),u=0;u<=h;++u)!(u<h&&n(d=l[u],u,l))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(d,u,l),+t(d,u,l));if(g)return s=null,g+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Ut(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:Ut(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Ut(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function xke(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function yke(e){return e}function bke(){var e=yke,t=xke,n=null,r=Ut(0),i=Ut(Cm),s=Ut(0);function a(o){var l,u=(o=x5(o)).length,h,d,f=0,g=new Array(u),b=new Array(u),x=+r.apply(this,arguments),v=Math.min(Cm,Math.max(-Cm,i.apply(this,arguments)-x)),m,p=Math.min(Math.abs(v)/u,s.apply(this,arguments)),y=p*(v<0?-1:1),_;for(l=0;l<u;++l)(_=b[g[l]=l]=+e(o[l],l,o))>0&&(f+=_);for(t!=null?g.sort(function(C,S){return t(b[C],b[S])}):n!=null&&g.sort(function(C,S){return n(o[C],o[S])}),l=0,d=f?(v-u*y)/f:0;l<u;++l,x=m)h=g[l],_=b[h],m=x+(_>0?_*d:0)+y,b[h]={data:o[h],index:l,value:_,startAngle:x,endAngle:m,padAngle:p};return b}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:Ut(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:Ut(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Ut(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:Ut(+o),a):s},a}function Vo(){}function uv(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function B1(e){this._context=e}B1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:uv(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:uv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _ke(e){return new B1(e)}function rF(e){this._context=e}rF.prototype={areaStart:Vo,areaEnd:Vo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:uv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wke(e){return new rF(e)}function iF(e){this._context=e}iF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:uv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ske(e){return new iF(e)}function sF(e,t){this._basis=new B1(e),this._beta=t}sF.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Cke=function e(t){function n(r){return t===1?new B1(r):new sF(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function dv(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function y5(e,t){this._context=e,this._k=(1-t)/6}y5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:dv(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:dv(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const kke=function e(t){function n(r){return new y5(r,t)}return n.tension=function(r){return e(+r)},n}(0);function b5(e,t){this._context=e,this._k=(1-t)/6}b5.prototype={areaStart:Vo,areaEnd:Vo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:dv(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Eke=function e(t){function n(r){return new b5(r,t)}return n.tension=function(r){return e(+r)},n}(0);function _5(e,t){this._context=e,this._k=(1-t)/6}_5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:dv(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Tke=function e(t){function n(r){return new _5(r,t)}return n.tension=function(r){return e(+r)},n}(0);function w5(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Fn){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Fn){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*u+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/h}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function oF(e,t){this._context=e,this._alpha=t}oF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:w5(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ake=function e(t){function n(r){return t?new oF(r,t):new y5(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function aF(e,t){this._context=e,this._alpha=t}aF.prototype={areaStart:Vo,areaEnd:Vo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:w5(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Rke=function e(t){function n(r){return t?new aF(r,t):new b5(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function lF(e,t){this._context=e,this._alpha=t}lF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:w5(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Mke=function e(t){function n(r){return t?new lF(r,t):new _5(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function cF(e){this._context=e}cF.prototype={areaStart:Vo,areaEnd:Vo,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function jke(e){return new cF(e)}function DR(e){return e<0?-1:1}function LR(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(DR(s)+DR(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function PR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Fy(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function hv(e){this._context=e}hv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Fy(this,this._t0,PR(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Fy(this,PR(this,n=LR(this,e,t)),n);break;default:Fy(this,this._t0,n=LR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function uF(e){this._context=new dF(e)}(uF.prototype=Object.create(hv.prototype)).point=function(e,t){hv.prototype.point.call(this,t,e)};function dF(e){this._context=e}dF.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function Nke(e){return new hv(e)}function Dke(e){return new uF(e)}function hF(e){this._context=e}hF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=OR(e),i=OR(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function OR(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function Lke(e){return new hF(e)}function F1(e,t){this._context=e,this._t=t}F1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Pke(e){return new F1(e,.5)}function Oke(e){return new F1(e,0)}function Ike(e){return new F1(e,1)}function IR(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function $R(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function $ke(e,t){return e[t]}function Bke(e){const t=[];return t.key=e,t}function Fke(){var e=Ut([]),t=$R,n=IR,r=$ke;function i(s){var a=Array.from(e.apply(this,arguments),Bke),o,l=a.length,u=-1,h;for(const d of s)for(o=0,++u;o<l;++o)(a[o][u]=[0,+r(d,a[o].key,u,s)]).data=d;for(o=0,h=x5(t(a));o<l;++o)a[h[o]].index=o;return n(a,h),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Ut(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:Ut(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?$R:typeof s=="function"?s:Ut(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??IR,i):n},i}function zke(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,u=e[t[0]].length;r<u;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}var Hke=Ff,Wke=U$,Uke=Su;function Vke(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=Hke(e,a);n(o,a)&&Wke(s,Uke(a,e),o)}return s}var qke=Vke;function Gke(e,t){return e!=null&&t in Object(e)}var Kke=Gke,Yke=Su,Xke=Y0,Jke=Sr,Qke=Q0,Zke=$k,e5e=Cu;function t5e(e,t,n){t=Yke(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=e5e(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Zke(i)&&Qke(a,i)&&(Jke(e)||Xke(e)))}var n5e=t5e,r5e=Kke,i5e=n5e;function s5e(e,t){return e!=null&&i5e(e,t,r5e)}var fF=s5e,o5e=qke,a5e=fF;function l5e(e,t){return o5e(e,t,function(n,r){return a5e(e,r)})}var c5e=l5e;function u5e(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var S5=u5e,BR=vu,d5e=Y0,h5e=Sr,FR=BR?BR.isConcatSpreadable:void 0;function f5e(e){return h5e(e)||d5e(e)||!!(FR&&e&&e[FR])}var p5e=f5e,m5e=S5,g5e=p5e;function pF(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=g5e),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?pF(o,t-1,n,r,i):m5e(i,o):r||(i[i.length]=o)}return i}var mF=pF,v5e=mF;function x5e(e){var t=e==null?0:e.length;return t?v5e(e,1):[]}var y5e=x5e,b5e=y5e,_5e=$$,w5e=B$;function S5e(e){return w5e(_5e(e,void 0,b5e),e+"")}var gF=S5e,C5e=c5e,k5e=gF,E5e=k5e(function(e,t){return e==null?{}:C5e(e,t)}),T5e=E5e;const A5e=Rn(T5e);function R5e(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var M5e=R5e,j5e=g5,N5e=M5e,D5e=v5,L5e=1,P5e=2;function O5e(e,t,n,r,i,s){var a=n&L5e,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,f=!0,g=n&P5e?new j5e:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var b=e[d],x=t[d];if(r)var v=a?r(x,b,d,t,e,s):r(b,x,d,e,t,s);if(v!==void 0){if(v)continue;f=!1;break}if(g){if(!N5e(t,function(m,p){if(!D5e(g,p)&&(b===m||i(b,m,n,r,s)))return g.push(p)})){f=!1;break}}else if(!(b===x||i(b,x,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}var vF=O5e;function I5e(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var $5e=I5e;function B5e(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var C5=B5e,zR=vu,HR=T$,F5e=If,z5e=vF,H5e=$5e,W5e=C5,U5e=1,V5e=2,q5e="[object Boolean]",G5e="[object Date]",K5e="[object Error]",Y5e="[object Map]",X5e="[object Number]",J5e="[object RegExp]",Q5e="[object Set]",Z5e="[object String]",eEe="[object Symbol]",tEe="[object ArrayBuffer]",nEe="[object DataView]",WR=zR?zR.prototype:void 0,zy=WR?WR.valueOf:void 0;function rEe(e,t,n,r,i,s,a){switch(n){case nEe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case tEe:return!(e.byteLength!=t.byteLength||!s(new HR(e),new HR(t)));case q5e:case G5e:case X5e:return F5e(+e,+t);case K5e:return e.name==t.name&&e.message==t.message;case J5e:case Z5e:return e==t+"";case Y5e:var o=H5e;case Q5e:var l=r&U5e;if(o||(o=W5e),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=V5e,a.set(e,t);var h=z5e(o(e),o(t),r,i,s,a);return a.delete(e),h;case eEe:if(zy)return zy.call(e)==zy.call(t)}return!1}var iEe=rEe,sEe=S5,oEe=Sr;function aEe(e,t,n){var r=t(e);return oEe(e)?r:sEe(r,n(e))}var xF=aEe;function lEe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}var yF=lEe;function cEe(){return[]}var bF=cEe,uEe=yF,dEe=bF,hEe=Object.prototype,fEe=hEe.propertyIsEnumerable,UR=Object.getOwnPropertySymbols,pEe=UR?function(e){return e==null?[]:(e=Object(e),uEe(UR(e),function(t){return fEe.call(e,t)}))}:dEe,k5=pEe,mEe=M$,gEe=mEe(Object.keys,Object),vEe=gEe,xEe=Ik,yEe=vEe,bEe=Object.prototype,_Ee=bEe.hasOwnProperty;function wEe(e){if(!xEe(e))return yEe(e);var t=[];for(var n in Object(e))_Ee.call(e,n)&&n!="constructor"&&t.push(n);return t}var SEe=wEe,CEe=O$,kEe=SEe,EEe=_u;function TEe(e){return EEe(e)?CEe(e):kEe(e)}var Wf=TEe,AEe=xF,REe=k5,MEe=Wf;function jEe(e){return AEe(e,MEe,REe)}var _F=jEe,VR=_F,NEe=1,DEe=Object.prototype,LEe=DEe.hasOwnProperty;function PEe(e,t,n,r,i,s){var a=n&NEe,o=VR(e),l=o.length,u=VR(t),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in t:LEe.call(t,f)))return!1}var g=s.get(e),b=s.get(t);if(g&&b)return g==t&&b==e;var x=!0;s.set(e,t),s.set(t,e);for(var v=a;++d<l;){f=o[d];var m=e[f],p=t[f];if(r)var y=a?r(p,m,f,t,e,s):r(m,p,f,e,t,s);if(!(y===void 0?m===p||i(m,p,n,r,s):y)){x=!1;break}v||(v=f=="constructor")}if(x&&!v){var _=e.constructor,C=t.constructor;_!=C&&"constructor"in e&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof C=="function"&&C instanceof C)&&(x=!1)}return s.delete(e),s.delete(t),x}var OEe=PEe,IEe=ll,$Ee=as,BEe=IEe($Ee,"DataView"),FEe=BEe,zEe=ll,HEe=as,WEe=zEe(HEe,"Promise"),UEe=WEe,VEe=ll,qEe=as,GEe=VEe(qEe,"Set"),wF=GEe,KEe=ll,YEe=as,XEe=KEe(YEe,"WeakMap"),JEe=XEe,kw=FEe,Ew=Nk,Tw=UEe,Aw=wF,Rw=JEe,SF=ta,Eu=w$,qR="[object Map]",QEe="[object Object]",GR="[object Promise]",KR="[object Set]",YR="[object WeakMap]",XR="[object DataView]",ZEe=Eu(kw),e3e=Eu(Ew),t3e=Eu(Tw),n3e=Eu(Aw),r3e=Eu(Rw),ua=SF;(kw&&ua(new kw(new ArrayBuffer(1)))!=XR||Ew&&ua(new Ew)!=qR||Tw&&ua(Tw.resolve())!=GR||Aw&&ua(new Aw)!=KR||Rw&&ua(new Rw)!=YR)&&(ua=function(e){var t=SF(e),n=t==QEe?e.constructor:void 0,r=n?Eu(n):"";if(r)switch(r){case ZEe:return XR;case e3e:return qR;case t3e:return GR;case n3e:return KR;case r3e:return YR}return t});var z1=ua,Hy=K0,i3e=vF,s3e=iEe,o3e=OEe,JR=z1,QR=Sr,ZR=X0,a3e=zk,l3e=1,eM="[object Arguments]",tM="[object Array]",Vp="[object Object]",c3e=Object.prototype,nM=c3e.hasOwnProperty;function u3e(e,t,n,r,i,s){var a=QR(e),o=QR(t),l=a?tM:JR(e),u=o?tM:JR(t);l=l==eM?Vp:l,u=u==eM?Vp:u;var h=l==Vp,d=u==Vp,f=l==u;if(f&&ZR(e)){if(!ZR(t))return!1;a=!0,h=!1}if(f&&!h)return s||(s=new Hy),a||a3e(e)?i3e(e,t,n,r,i,s):s3e(e,t,l,n,r,i,s);if(!(n&l3e)){var g=h&&nM.call(e,"__wrapped__"),b=d&&nM.call(t,"__wrapped__");if(g||b){var x=g?e.value():e,v=b?t.value():t;return s||(s=new Hy),i(x,v,n,r,s)}}return f?(s||(s=new Hy),o3e(e,t,n,r,i,s)):!1}var d3e=u3e,h3e=d3e,rM=Di;function CF(e,t,n,r,i){return e===t?!0:e==null||t==null||!rM(e)&&!rM(t)?e!==e&&t!==t:h3e(e,t,n,r,CF,i)}var E5=CF,f3e=E5;function p3e(e,t){return f3e(e,t)}var m3e=p3e;const g3e=Rn(m3e);var v3e={background:"transparent",text:{fontFamily:"sans-serif",fontSize:11,fill:"#333333",outlineWidth:0,outlineColor:"transparent",outlineOpacity:1},axis:{domain:{line:{stroke:"transparent",strokeWidth:1}},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{}},legend:{text:{fontSize:12}}},grid:{line:{stroke:"#dddddd",strokeWidth:1}},legends:{hidden:{symbol:{fill:"#333333",opacity:.6},text:{fill:"#333333",opacity:.6}},text:{},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{fontSize:10}},title:{text:{}}},labels:{text:{}},markers:{lineColor:"#000000",lineStrokeWidth:1,text:{}},dots:{text:{}},tooltip:{container:{background:"white",color:"inherit",fontSize:"inherit",borderRadius:"2px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.25)",padding:"5px 9px"},basic:{whiteSpace:"pre",display:"flex",alignItems:"center"},chip:{marginRight:7},table:{},tableCell:{padding:"3px 5px"},tableCellValue:{fontWeight:"bold"}},crosshair:{line:{stroke:"#000000",strokeWidth:1,strokeOpacity:.75,strokeDasharray:"6 6"}},annotations:{text:{fontSize:13,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},link:{stroke:"#000000",strokeWidth:1,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},outline:{fill:"none",stroke:"#000000",strokeWidth:2,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},symbol:{fill:"#000000",outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1}}};function Ci(){return Ci=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},Ci.apply(this,arguments)}function T5(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var x3e=["axis.ticks.text","axis.legend.text","legends.title.text","legends.text","legends.ticks.text","legends.title.text","labels.text","dots.text","markers.text","annotations.text"],y3e=function(e,t){return Ci({},t,e)},b3e=function(e,t){var n=Ube({},e,t);return x3e.forEach(function(r){_d(n,r,y3e(Os(n,r),n.text))}),n},kF=w.createContext(),EF=function(e){var t=e.children,n=e.animate,r=n===void 0||n,i=e.config,s=i===void 0?"default":i,a=w.useMemo(function(){var o=Rwe(s)?Ak[s]:s;return{animate:r,config:o}},[r,s]);return c.jsx(kF.Provider,{value:a,children:t})},iM={animate:ee.bool,motionConfig:ee.oneOfType([ee.oneOf(Object.keys(Ak)),ee.shape({mass:ee.number,tension:ee.number,friction:ee.number,clamp:ee.bool,precision:ee.number,velocity:ee.number,duration:ee.number,easing:ee.func})])};EF.propTypes={children:ee.node.isRequired,animate:iM.animate,config:iM.motionConfig};var Cr=function(){return w.useContext(kF)},_3e=function(e){var t=Cr(),n=t.animate,r=t.config,i=function(o){var l=w.useRef();return w.useEffect(function(){l.current=o},[o]),l.current}(e),s=w.useMemo(function(){return Yk(i,e)},[i,e]),a=Gs({from:{value:0},to:{value:1},reset:!0,config:r,immediate:!n}).value;return Ho(a,s)},w3e={nivo:["#d76445","#f47560","#e8c1a0","#97e3d5","#61cdbb","#00b0a7"],BrBG:je(d1),PRGn:je(h1),PiYG:je(f1),PuOr:je(p1),RdBu:je(m1),RdGy:je(g1),RdYlBu:je(v1),RdYlGn:je(x1),spectral:je(y1),blues:je(N1),greens:je(D1),greys:je(L1),oranges:je(I1),purples:je(P1),reds:je(O1),BuGn:je(b1),BuPu:je(_1),GnBu:je(w1),OrRd:je(S1),PuBuGn:je(C1),PuBu:je(k1),PuRd:je(E1),RdPu:je(T1),YlGnBu:je(A1),YlGn:je(R1),YlOrBr:je(M1),YlOrRd:je(j1)},S3e=Object.keys(w3e);je(d1),je(h1),je(f1),je(p1),je(m1),je(g1),je(v1),je(x1),je(y1),je(N1),je(D1),je(L1),je(I1),je(P1),je(O1),je(b1),je(_1),je(w1),je(S1),je(C1),je(k1),je(E1),je(T1),je(A1),je(R1),je(M1),je(j1);ee.oneOfType([ee.oneOf(S3e),ee.func,ee.arrayOf(ee.string)]);var C3e={basis:_ke,basisClosed:wke,basisOpen:Ske,bundle:Cke,cardinal:kke,cardinalClosed:Eke,cardinalOpen:Tke,catmullRom:Ake,catmullRomClosed:Rke,catmullRomOpen:Mke,linear:tF,linearClosed:jke,monotoneX:Nke,monotoneY:Dke,natural:Lke,step:Pke,stepAfter:Ike,stepBefore:Oke},A5=Object.keys(C3e);A5.filter(function(e){return e.endsWith("Closed")});JB(A5,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");JB(A5,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");ee.shape({top:ee.number,right:ee.number,bottom:ee.number,left:ee.number}).isRequired;var k3e=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];ee.oneOf(k3e);ya(m5);var E3e={top:0,right:0,bottom:0,left:0},R5=function(e,t,n){return n===void 0&&(n={}),w.useMemo(function(){var r=Ci({},E3e,n);return{margin:r,innerWidth:e-r.left-r.right,innerHeight:t-r.top-r.bottom,outerWidth:e,outerHeight:t}},[e,t,n.top,n.right,n.bottom,n.left])},TF=function(){var e=w.useRef(null),t=w.useState({left:0,top:0,width:0,height:0}),n=t[0],r=t[1],i=w.useState(function(){return typeof ResizeObserver>"u"?null:new ResizeObserver(function(s){var a=s[0];return r(a.contentRect)})})[0];return w.useEffect(function(){return e.current&&i!==null&&i.observe(e.current),function(){i!==null&&i.disconnect()}},[]),[e,n]},T3e=function(e){return w.useMemo(function(){return b3e(v3e,e)},[e])},A3e=function(e){return typeof e=="function"?e:typeof e=="string"?e.indexOf("time:")===0?u1(e.slice("5")):Hf(e):function(t){return""+t}},H1=function(e){return w.useMemo(function(){return A3e(e)},[e])},AF=w.createContext(),R3e={},RF=function(e){var t=e.theme,n=t===void 0?R3e:t,r=e.children,i=T3e(n);return c.jsx(AF.Provider,{value:i,children:r})};RF.propTypes={children:ee.node.isRequired,theme:ee.object};var Gt=function(){return w.useContext(AF)},M3e=["outlineWidth","outlineColor","outlineOpacity"],M5=function(e){return e.outlineWidth,e.outlineColor,e.outlineOpacity,T5(e,M3e)},MF=function(e){var t=e.children,n=e.condition,r=e.wrapper;return n?w.cloneElement(r,{},t):t};MF.propTypes={children:ee.node.isRequired,condition:ee.bool.isRequired,wrapper:ee.element.isRequired};var j3e={position:"relative"},W1=function(e){var t=e.children,n=e.theme,r=e.renderWrapper,i=r===void 0||r,s=e.isInteractive,a=s===void 0||s,o=e.animate,l=e.motionConfig,u=w.useRef(null);return c.jsx(RF,{theme:n,children:c.jsx(EF,{animate:o,config:l,children:c.jsx(Ege,{container:u,children:c.jsxs(MF,{condition:i,wrapper:c.jsx("div",{style:j3e,ref:u}),children:[t,a&&c.jsx(kge,{})]})})})})};W1.propTypes={children:ee.element.isRequired,isInteractive:ee.bool,renderWrapper:ee.bool,theme:ee.object,animate:ee.bool,motionConfig:ee.string};ee.func.isRequired,ee.bool,ee.bool,ee.object.isRequired,ee.bool.isRequired,ee.string;var jF=function(e){var t=e.children,n=TF(),r=n[0],i=n[1],s=i.width>0&&i.height>0;return c.jsx("div",{ref:r,style:{width:"100%",height:"100%"},children:s&&t({width:i.width,height:i.height})})};jF.propTypes={children:ee.func.isRequired};var N3e=["id","colors"],NF=function(e){var t=e.id,n=e.colors,r=T5(e,N3e);return c.jsx("linearGradient",Ci({id:t,x1:0,x2:0,y1:0,y2:1},r,{children:n.map(function(i){var s=i.offset,a=i.color,o=i.opacity;return c.jsx("stop",{offset:s+"%",stopColor:a,stopOpacity:o!==void 0?o:1},s)})}))};NF.propTypes={id:ee.string.isRequired,colors:ee.arrayOf(ee.shape({offset:ee.number.isRequired,color:ee.string.isRequired,opacity:ee.number})).isRequired,gradientTransform:ee.string};var DF={linearGradient:NF},nd={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},Mw=w.memo(function(e){var t=e.id,n=e.background,r=n===void 0?nd.background:n,i=e.color,s=i===void 0?nd.color:i,a=e.size,o=a===void 0?nd.size:a,l=e.padding,u=l===void 0?nd.padding:l,h=e.stagger,d=h===void 0?nd.stagger:h,f=o+u,g=o/2,b=u/2;return d===!0&&(f=2*o+2*u),c.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[c.jsx("rect",{width:f,height:f,fill:r}),c.jsx("circle",{cx:b+g,cy:b+g,r:g,fill:s}),d&&c.jsx("circle",{cx:1.5*u+o+g,cy:1.5*u+o+g,r:g,fill:s})]})});Mw.displayName="PatternDots",Mw.propTypes={id:ee.string.isRequired,color:ee.string.isRequired,background:ee.string.isRequired,size:ee.number.isRequired,padding:ee.number.isRequired,stagger:ee.bool.isRequired};var ei=function(e){return e*Math.PI/180},U1=function(e){return 180*e/Math.PI},D3e=function(e){return e.startAngle+(e.endAngle-e.startAngle)/2},Ta=function(e,t){return{x:Math.cos(e)*t,y:Math.sin(e)*t}},L3e=function(e){var t=e%360;return t<0&&(t+=360),t},P3e={svg:{align:{left:"start",center:"middle",right:"end",start:"start",middle:"middle",end:"end"},baseline:{top:"text-before-edge",center:"central",bottom:"alphabetic"}},canvas:{align:{left:"left",center:"center",right:"right",start:"left",middle:"center",end:"right"},baseline:{top:"top",center:"middle",bottom:"bottom"}}},rd={spacing:5,rotation:0,background:"#000000",color:"#ffffff",lineWidth:2},jw=w.memo(function(e){var t=e.id,n=e.spacing,r=n===void 0?rd.spacing:n,i=e.rotation,s=i===void 0?rd.rotation:i,a=e.background,o=a===void 0?rd.background:a,l=e.color,u=l===void 0?rd.color:l,h=e.lineWidth,d=h===void 0?rd.lineWidth:h,f=Math.round(s)%360,g=Math.abs(r);f>180?f-=360:f>90?f-=180:f<-180?f+=360:f<-90&&(f+=180);var b,x=g,v=g;return f===0?b=`
                M 0 0 L `+x+` 0
                M 0 `+v+" L "+x+" "+v+`
            `:f===90?b=`
                M 0 0 L 0 `+v+`
                M `+x+" 0 L "+x+" "+v+`
            `:(x=Math.abs(g/Math.sin(ei(f))),v=g/Math.sin(ei(90-f)),b=f>0?`
                    M 0 `+-v+" L "+2*x+" "+v+`
                    M `+-x+" "+-v+" L "+x+" "+v+`
                    M `+-x+" 0 L "+x+" "+2*v+`
                `:`
                    M `+-x+" "+v+" L "+x+" "+-v+`
                    M `+-x+" "+2*v+" L "+2*x+" "+-v+`
                    M 0 `+2*v+" L "+2*x+` 0
                `),c.jsxs("pattern",{id:t,width:x,height:v,patternUnits:"userSpaceOnUse",children:[c.jsx("rect",{width:x,height:v,fill:o,stroke:"rgba(255, 0, 0, 0.1)",strokeWidth:0}),c.jsx("path",{d:b,strokeWidth:d,stroke:u,strokeLinecap:"square"})]})});jw.displayName="PatternLines",jw.propTypes={id:ee.string.isRequired,spacing:ee.number.isRequired,rotation:ee.number.isRequired,background:ee.string.isRequired,color:ee.string.isRequired,lineWidth:ee.number.isRequired};var id={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},Nw=w.memo(function(e){var t=e.id,n=e.color,r=n===void 0?id.color:n,i=e.background,s=i===void 0?id.background:i,a=e.size,o=a===void 0?id.size:a,l=e.padding,u=l===void 0?id.padding:l,h=e.stagger,d=h===void 0?id.stagger:h,f=o+u,g=u/2;return d===!0&&(f=2*o+2*u),c.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[c.jsx("rect",{width:f,height:f,fill:s}),c.jsx("rect",{x:g,y:g,width:o,height:o,fill:r}),d&&c.jsx("rect",{x:1.5*u+o,y:1.5*u+o,width:o,height:o,fill:r})]})});Nw.displayName="PatternSquares",Nw.propTypes={id:ee.string.isRequired,color:ee.string.isRequired,background:ee.string.isRequired,size:ee.number.isRequired,padding:ee.number.isRequired,stagger:ee.bool.isRequired};var LF={patternDots:Mw,patternLines:jw,patternSquares:Nw},O3e=["type"],Dw=Ci({},DF,LF),PF=function(e){var t=e.defs;return!t||t.length<1?null:c.jsx("defs",{"aria-hidden":!0,children:t.map(function(n){var r=n.type,i=T5(n,O3e);return Dw[r]?w.createElement(Dw[r],Ci({key:i.id},i)):null})})};PF.propTypes={defs:ee.arrayOf(ee.shape({type:ee.oneOf(Object.keys(Dw)).isRequired,id:ee.string.isRequired}))};var I3e=w.memo(PF),j5=function(e){var t=e.width,n=e.height,r=e.margin,i=e.defs,s=e.children,a=e.role,o=e.ariaLabel,l=e.ariaLabelledBy,u=e.ariaDescribedBy,h=e.isFocusable,d=Gt();return c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,role:a,"aria-label":o,"aria-labelledby":l,"aria-describedby":u,focusable:h,tabIndex:h?0:void 0,children:[c.jsx(I3e,{defs:i}),c.jsx("rect",{width:t,height:n,fill:d.background}),c.jsx("g",{transform:"translate("+r.left+","+r.top+")",children:s})]})};j5.propTypes={width:ee.number.isRequired,height:ee.number.isRequired,margin:ee.shape({top:ee.number.isRequired,left:ee.number.isRequired}).isRequired,defs:ee.array,children:ee.oneOfType([ee.arrayOf(ee.node),ee.node]).isRequired,role:ee.string,isFocusable:ee.bool,ariaLabel:ee.string,ariaLabelledBy:ee.string,ariaDescribedBy:ee.string};var OF=function(e){var t=e.size,n=e.color,r=e.borderWidth,i=e.borderColor;return c.jsx("circle",{r:t/2,fill:n,stroke:i,strokeWidth:r,style:{pointerEvents:"none"}})};OF.propTypes={size:ee.number.isRequired,color:ee.string.isRequired,borderWidth:ee.number.isRequired,borderColor:ee.string.isRequired};var $3e=w.memo(OF),IF=function(e){var t=e.x,n=e.y,r=e.symbol,i=r===void 0?$3e:r,s=e.size,a=e.datum,o=e.color,l=e.borderWidth,u=e.borderColor,h=e.label,d=e.labelTextAnchor,f=d===void 0?"middle":d,g=e.labelYOffset,b=g===void 0?-12:g,x=Gt(),v=Cr(),m=v.animate,p=v.config,y=Gs({transform:"translate("+t+", "+n+")",config:p,immediate:!m});return c.jsxs(Tt.g,{transform:y.transform,style:{pointerEvents:"none"},children:[w.createElement(i,{size:s,color:o,datum:a,borderWidth:l,borderColor:u}),h&&c.jsx("text",{textAnchor:f,y:b,style:M5(x.dots.text),children:h})]})};IF.propTypes={x:ee.number.isRequired,y:ee.number.isRequired,datum:ee.object.isRequired,size:ee.number.isRequired,color:ee.string.isRequired,borderWidth:ee.number.isRequired,borderColor:ee.string.isRequired,symbol:ee.oneOfType([ee.func,ee.object]),label:ee.oneOfType([ee.string,ee.number]),labelTextAnchor:ee.oneOf(["start","middle","end"]),labelYOffset:ee.number};w.memo(IF);var $F=function(e){var t=e.width,n=e.height,r=e.axis,i=e.scale,s=e.value,a=e.lineStyle,o=e.textStyle,l=e.legend,u=e.legendPosition,h=u===void 0?"top-right":u,d=e.legendOffsetX,f=d===void 0?14:d,g=e.legendOffsetY,b=g===void 0?14:g,x=e.legendOrientation,v=x===void 0?"horizontal":x,m=Gt(),p=0,y=0,_=0,C=0;r==="y"?(_=i(s),y=t):(p=i(s),C=n);var S=null;if(l){var E=function(k){var T=k.axis,A=k.width,M=k.height,D=k.position,L=k.offsetX,N=k.offsetY,O=k.orientation,B=0,z=0,P=O==="vertical"?-90:0,j="start";if(T==="x")switch(D){case"top-left":B=-L,z=N,j="end";break;case"top":z=-N,j=O==="horizontal"?"middle":"start";break;case"top-right":B=L,z=N,j=O==="horizontal"?"start":"end";break;case"right":B=L,z=M/2,j=O==="horizontal"?"start":"middle";break;case"bottom-right":B=L,z=M-N,j="start";break;case"bottom":z=M+N,j=O==="horizontal"?"middle":"end";break;case"bottom-left":z=M-N,B=-L,j=O==="horizontal"?"end":"start";break;case"left":B=-L,z=M/2,j=O==="horizontal"?"end":"middle"}else switch(D){case"top-left":B=L,z=-N,j="start";break;case"top":B=A/2,z=-N,j=O==="horizontal"?"middle":"start";break;case"top-right":B=A-L,z=-N,j=O==="horizontal"?"end":"start";break;case"right":B=A+L,j=O==="horizontal"?"start":"middle";break;case"bottom-right":B=A-L,z=N,j="end";break;case"bottom":B=A/2,z=N,j=O==="horizontal"?"middle":"end";break;case"bottom-left":B=L,z=N,j=O==="horizontal"?"start":"end";break;case"left":B=-L,j=O==="horizontal"?"end":"middle"}return{x:B,y:z,rotation:P,textAnchor:j}}({axis:r,width:t,height:n,position:h,offsetX:f,offsetY:b,orientation:v});S=c.jsx("text",{transform:"translate("+E.x+", "+E.y+") rotate("+E.rotation+")",textAnchor:E.textAnchor,dominantBaseline:"central",style:o,children:l})}return c.jsxs("g",{transform:"translate("+p+", "+_+")",children:[c.jsx("line",{x1:0,x2:y,y1:0,y2:C,stroke:m.markers.lineColor,strokeWidth:m.markers.lineStrokeWidth,style:a}),S]})};$F.propTypes={width:ee.number.isRequired,height:ee.number.isRequired,axis:ee.oneOf(["x","y"]).isRequired,scale:ee.func.isRequired,value:ee.oneOfType([ee.number,ee.string,ee.instanceOf(Date)]).isRequired,lineStyle:ee.object,textStyle:ee.object,legend:ee.string,legendPosition:ee.oneOf(["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"]),legendOffsetX:ee.number.isRequired,legendOffsetY:ee.number.isRequired,legendOrientation:ee.oneOf(["horizontal","vertical"]).isRequired};var B3e=w.memo($F),BF=function(e){var t=e.markers,n=e.width,r=e.height,i=e.xScale,s=e.yScale;return t&&t.length!==0?t.map(function(a,o){return c.jsx(B3e,Ci({},a,{width:n,height:r,scale:a.axis==="y"?s:i}),o)}):null};BF.propTypes={width:ee.number.isRequired,height:ee.number.isRequired,xScale:ee.func.isRequired,yScale:ee.func.isRequired,markers:ee.arrayOf(ee.shape({axis:ee.oneOf(["x","y"]).isRequired,value:ee.oneOfType([ee.number,ee.string,ee.instanceOf(Date)]).isRequired,lineStyle:ee.object,textStyle:ee.object}))};var F3e=w.memo(BF),FF=function(e){return _$(e)?e:function(t){return Os(t,e)}},Aa=function(e){return w.useMemo(function(){return FF(e)},[e])},z3e=function(e,t,n,r,i,s){return e<=i&&i<=e+n&&t<=s&&s<=t+r},Wy=function(e,t){var n,r="touches"in t?t.touches[0]:t,i=r.clientX,s=r.clientY,a=e.getBoundingClientRect(),o=(n=e.getBBox!==void 0?e.getBBox():{width:e.offsetWidth||0,height:e.offsetHeight||0}).width===a.width?1:n.width/a.width;return[(i-a.left)*o,(s-a.top)*o]},H3e=Object.keys(DF),W3e=Object.keys(LF),U3e=function(e,t,n){if(e==="*")return!0;if(_$(e))return e(t);if(Fk(e)){var r=n?Os(t,n):t;return g3e(A5e(r,Object.keys(e)),e)}return!1},zF=function(e,t,n,r){var i=r===void 0?{}:r,s=i.dataKey,a=i.colorKey,o=a===void 0?"color":a,l=i.targetKey,u=l===void 0?"fill":l,h=[],d={};return e.length&&t.length&&(h=[].concat(e),t.forEach(function(f){for(var g=function(){var x=n[b],v=x.id,m=x.match;if(U3e(m,f,s)){var p=e.find(function(A){return A.id===v});if(p){if(W3e.includes(p.type))if(p.background==="inherit"||p.color==="inherit"){var y=Os(f,o),_=p.background,C=p.color,S=v;p.background==="inherit"&&(S=S+".bg."+y,_=y),p.color==="inherit"&&(S=S+".fg."+y,C=y),_d(f,u,"url(#"+S+")"),d[S]||(h.push(Ci({},p,{id:S,background:_,color:C})),d[S]=1)}else _d(f,u,"url(#"+v+")");else if(H3e.includes(p.type))if(p.colors.map(function(A){return A.color}).includes("inherit")){var E=Os(f,o),k=v,T=Ci({},p,{colors:p.colors.map(function(A,M){return A.color!=="inherit"?A:(k=k+"."+M+"."+E,Ci({},A,{color:A.color==="inherit"?E:A.color}))})});T.id=k,_d(f,u,"url(#"+k+")"),d[k]||(h.push(T),d[k]=1)}else _d(f,u,"url(#"+v+")")}return"break"}},b=0;b<n.length&&g()!=="break";b++);})),h};function V3e(){}var q3e=V3e,Uy=wF,G3e=q3e,K3e=C5,Y3e=1/0,X3e=Uy&&1/K3e(new Uy([,-0]))[1]==Y3e?function(e){return new Uy(e)}:G3e,J3e=X3e,Q3e=g5,Z3e=YB,e4e=XB,t4e=v5,n4e=J3e,r4e=C5,i4e=200;function s4e(e,t,n){var r=-1,i=Z3e,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=e4e;else if(s>=i4e){var u=t?null:n4e(e);if(u)return r4e(u);a=!1,i=t4e,l=new Q3e}else l=t?[]:o;e:for(;++r<s;){var h=e[r],d=t?t(h):h;if(h=n||h!==0?h:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),o.push(h)}else i(l,d,n)||(l!==o&&l.push(d),o.push(h))}return o}var o4e=s4e,a4e=K0,l4e=E5,c4e=1,u4e=2;function d4e(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var l=o[0],u=e[l],h=o[1];if(a&&o[2]){if(u===void 0&&!(l in e))return!1}else{var d=new a4e;if(r)var f=r(u,h,l,e,t,d);if(!(f===void 0?l4e(h,u,c4e|u4e,r,d):f))return!1}}return!0}var h4e=d4e,f4e=ls;function p4e(e){return e===e&&!f4e(e)}var HF=p4e,m4e=HF,g4e=Wf;function v4e(e){for(var t=g4e(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,m4e(i)]}return t}var x4e=v4e;function y4e(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var WF=y4e,b4e=h4e,_4e=x4e,w4e=WF;function S4e(e){var t=_4e(e);return t.length==1&&t[0][2]?w4e(t[0][0],t[0][1]):function(n){return n===e||b4e(n,e,t)}}var C4e=S4e,k4e=E5,E4e=W$,T4e=fF,A4e=Uk,R4e=HF,M4e=WF,j4e=Cu,N4e=1,D4e=2;function L4e(e,t){return A4e(e)&&R4e(t)?M4e(j4e(e),t):function(n){var r=E4e(n,e);return r===void 0&&r===t?T4e(n,e):k4e(t,r,N4e|D4e)}}var P4e=L4e;function O4e(e){return function(t){return t==null?void 0:t[e]}}var I4e=O4e,$4e=Ff;function B4e(e){return function(t){return $4e(t,e)}}var F4e=B4e,z4e=I4e,H4e=F4e,W4e=Uk,U4e=Cu;function V4e(e){return W4e(e)?z4e(U4e(e)):H4e(e)}var q4e=V4e,G4e=C4e,K4e=P4e,Y4e=Z0,X4e=Sr,J4e=q4e;function Q4e(e){return typeof e=="function"?e:e==null?Y4e:typeof e=="object"?X4e(e)?K4e(e[0],e[1]):G4e(e):J4e(e)}var N5=Q4e,Z4e=N5,eTe=o4e;function tTe(e,t){return e&&e.length?eTe(e,Z4e(t)):[]}var nTe=tTe;const sM=Rn(nTe);var rTe=k$,iTe=Wf;function sTe(e,t){return e&&rTe(e,t,iTe)}var oTe=sTe,aTe=_u;function lTe(e,t){return function(n,r){if(n==null)return n;if(!aTe(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var cTe=lTe,uTe=oTe,dTe=cTe,hTe=dTe(uTe),UF=hTe,fTe=UF,pTe=_u;function mTe(e,t){var n=-1,r=pTe(e)?Array(e.length):[];return fTe(e,function(i,s,a){r[++n]=t(i,s,a)}),r}var gTe=mTe;function vTe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var xTe=vTe,oM=e1;function yTe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,s=oM(e),a=t!==void 0,o=t===null,l=t===t,u=oM(t);if(!o&&!u&&!s&&e>t||s&&a&&l&&!o&&!u||r&&a&&l||!n&&l||!i)return 1;if(!r&&!s&&!u&&e<t||u&&n&&i&&!r&&!s||o&&n&&i||!a&&i||!l)return-1}return 0}var bTe=yTe,_Te=bTe;function wTe(e,t,n){for(var r=-1,i=e.criteria,s=t.criteria,a=i.length,o=n.length;++r<a;){var l=_Te(i[r],s[r]);if(l){if(r>=o)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return e.index-t.index}var STe=wTe,Vy=t1,CTe=Ff,kTe=N5,ETe=gTe,TTe=xTe,ATe=$f,RTe=STe,MTe=Z0,jTe=Sr;function NTe(e,t,n){t.length?t=Vy(t,function(s){return jTe(s)?function(a){return CTe(a,s.length===1?s[0]:s)}:s}):t=[MTe];var r=-1;t=Vy(t,ATe(kTe));var i=ETe(e,function(s,a,o){var l=Vy(t,function(u){return u(s)});return{criteria:l,index:++r,value:s}});return TTe(i,function(s,a){return RTe(s,a,n)})}var DTe=NTe,LTe=mF,PTe=DTe,OTe=Wk,aM=F$;OTe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&aM(e,t[0],t[1])?t=[]:n>2&&aM(t[0],t[1],t[2])&&(t=[t[0]]),PTe(e,LTe(t,1),[])});var lM=J0;lM&&lM.isDate;var jl=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],ITe={millisecond:[],second:jl.slice(0,1),minute:jl.slice(0,2),hour:jl.slice(0,3),day:jl.slice(0,4),month:jl.slice(0,5),year:jl.slice(0,6)},$Te=function(e){return function(t){return ITe[e].forEach(function(n){n(t)}),t}},BTe=function(e){var t=e.format,n=t===void 0?"native":t,r=e.precision,i=r===void 0?"millisecond":r,s=e.useUTC,a=s===void 0||s,o=$Te(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return o(l);var u=a?LB(n):NB(n);return o(u(l))}},FTe=function(e,t,n,r){var i,s,a,o,l=e.min,u=l===void 0?0:l,h=e.max,d=h===void 0?"auto":h,f=e.stacked,g=f!==void 0&&f,b=e.reverse,x=b!==void 0&&b,v=e.clamp,m=v!==void 0&&v,p=e.nice,y=p!==void 0&&p;u==="auto"?i=g===!0?(s=t.minStacked)!=null?s:0:t.min:i=u,d==="auto"?a=g===!0?(o=t.maxStacked)!=null?o:0:t.max:a=d;var _=bo().rangeRound(r==="x"?[0,n]:[n,0]).domain(x?[a,i]:[i,a]).clamp(m);return y===!0?_.nice():typeof y=="number"&&_.nice(y),zTe(_,g)},zTe=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},HTe=function(e,t,n){var r=qwe().range([0,n]).domain(t.all);return r.type="point",r},WTe=function(e,t,n,r){var i=e.round,s=i===void 0||i,a=o1().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(s);return UTe(a)},UTe=function(e){var t=e;return t.type="band",t},VTe=function(e,t,n){var r,i,s=e.format,a=s===void 0?"native":s,o=e.precision,l=o===void 0?"millisecond":o,u=e.min,h=u===void 0?"auto":u,d=e.max,f=d===void 0?"auto":d,g=e.useUTC,b=g===void 0||g,x=e.nice,v=x!==void 0&&x,m=BTe({format:a,precision:l,useUTC:b});r=h==="auto"?m(t.min):a!=="native"?m(h):h,i=f==="auto"?m(t.max):a!=="native"?m(f):f;var p=b?OSe():p5();p.range([0,n]),r&&i&&p.domain([r,i]),v===!0?p.nice():typeof v!="object"&&typeof v!="number"||p.nice(v);var y=p;return y.type="time",y.useUTC=b,y},qTe=function(e,t,n,r){var i,s=e.base,a=s===void 0?10:s,o=e.min,l=o===void 0?"auto":o,u=e.max,h=u===void 0?"auto":u;if(t.all.some(function(x){return x===0}))throw new Error("a log scale domain must not include or cross zero");var d,f,g=!1;if(t.all.filter(function(x){return x!=null}).forEach(function(x){g||(i===void 0?i=Math.sign(x):Math.sign(x)!==i&&(g=!0))}),g)throw new Error("a log scale domain must be strictly-positive or strictly-negative");d=l==="auto"?t.min:l,f=h==="auto"?t.max:h;var b=aB().domain([d,f]).rangeRound(r==="x"?[0,n]:[n,0]).base(a).nice();return b.type="log",b},GTe=function(e,t,n,r){var i,s,a=e.constant,o=a===void 0?1:a,l=e.min,u=l===void 0?"auto":l,h=e.max,d=h===void 0?"auto":h,f=e.reverse,g=f!==void 0&&f;i=u==="auto"?t.min:u,s=d==="auto"?t.max:d;var b=lB().constant(o).rangeRound(r==="x"?[0,n]:[n,0]).nice();g===!0?b.domain([s,i]):b.domain([i,s]);var x=b;return x.type="symlog",x};function D5(e,t,n,r){switch(e.type){case"linear":return FTe(e,t,n,r);case"point":return HTe(e,t,n);case"band":return WTe(e,t,n,r);case"time":return VTe(e,t,n);case"log":return qTe(e,t,n,r);case"symlog":return GTe(e,t,n,r);default:throw new Error("invalid scale spec")}}var VF=function(e){var t=e.bandwidth();if(t===0)return e;var n=t/2;return e.round()&&(n=Math.round(n)),function(r){var i;return((i=e(r))!=null?i:0)+n}},qF={millisecond:[Uh,Uh],second:[ww,ww],minute:[pB,_B],hour:[mB,wB],day:[xn(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),xn(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[ov,av],sunday:[ov,av],monday:[Vh,qh],tuesday:[gB,SB],wednesday:[vB,CB],thursday:[Ua,Va],friday:[xB,kB],saturday:[yB,EB],month:[bB,TB],year:[Wo,Uo]},KTe=Object.keys(qF),YTe=new RegExp("^every\\s*(\\d+)?\\s*("+KTe.join("|")+")s?$","i"),GF=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(YTe);if(n){var r=n[1],i=n[2],s=qF[i][e.useUTC?1:0];if(i==="day"){var a,o,l=e.domain(),u=l[0],h=l[1],d=new Date(h);return d.setDate(d.getDate()+1),(a=(o=s.every(Number(r??1)))==null?void 0:o.range(u,d))!=null?a:[]}if(r===void 0)return e.ticks(s);var f=s.every(Number(r));if(f)return e.ticks(f)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(g=t)=="number"&&isFinite(g)&&Math.floor(g)===g)return e.ticks(t)}var g;return e.domain()};function ti(){return ti=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},ti.apply(this,arguments)}var KF=function(e){var t,n=e.axis,r=e.scale,i=e.ticksPosition,s=e.tickValues,a=e.tickSize,o=e.tickPadding,l=e.tickRotation,u=e.truncateTickAt,h=e.engine,d=h===void 0?"svg":h,f=GF(r,s),g=P3e[d],b="bandwidth"in r?VF(r):r,x={lineX:0,lineY:0},v={textX:0,textY:0},m=typeof document=="object"&&document.dir==="rtl",p=g.align.center,y=g.baseline.center;return n==="x"?(t=function(_){var C;return{x:(C=b(_))!=null?C:0,y:0}},x.lineY=a*(i==="after"?1:-1),v.textY=(a+o)*(i==="after"?1:-1),y=i==="after"?g.baseline.top:g.baseline.bottom,l===0?p=g.align.center:i==="after"&&l<0||i==="before"&&l>0?(p=g.align[m?"left":"right"],y=g.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(p=g.align[m?"right":"left"],y=g.baseline.center)):(t=function(_){var C;return{x:0,y:(C=b(_))!=null?C:0}},x.lineX=a*(i==="after"?1:-1),v.textX=(a+o)*(i==="after"?1:-1),p=i==="after"?g.align.left:g.align.right),{ticks:f.map(function(_){var C=typeof _=="string"?function(S){var E=String(S).length;return u&&u>0&&E>u?""+String(S).slice(0,u).concat("..."):""+S}(_):_;return ti({key:_ instanceof Date?""+_.valueOf():""+_,value:C},t(_),x,v)}),textAlign:p,textBaseline:y}},YF=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=u1(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Hf(e)},Lw=function(e){var t,n=e.width,r=e.height,i=e.scale,s=e.axis,a=e.values,o=(t=a,(Array.isArray(t)?a:void 0)||GF(i,a)),l="bandwidth"in i?VF(i):i,u=s==="x"?o.map(function(h){var d,f;return{key:h instanceof Date?""+h.valueOf():""+h,x1:(d=l(h))!=null?d:0,x2:(f=l(h))!=null?f:0,y1:0,y2:r}}):o.map(function(h){var d,f;return{key:h instanceof Date?""+h.valueOf():""+h,x1:0,x2:n,y1:(d=l(h))!=null?d:0,y2:(f=l(h))!=null?f:0}});return u},XTe=w.memo(function(e){var t,n=e.value,r=e.format,i=e.lineX,s=e.lineY,a=e.onClick,o=e.textBaseline,l=e.textAnchor,u=e.animatedProps,h=Gt(),d=h.axis.ticks.line,f=h.axis.ticks.text,g=(t=r==null?void 0:r(n))!=null?t:n,b=w.useMemo(function(){var x={opacity:u.opacity};return a?{style:ti({},x,{cursor:"pointer"}),onClick:function(v){return a(v,g)}}:{style:x}},[u.opacity,a,g]);return c.jsxs(Tt.g,ti({transform:u.transform},b,{children:[c.jsx("line",{x1:0,x2:i,y1:0,y2:s,style:d}),f.outlineWidth>0&&c.jsx(Tt.text,{dominantBaseline:o,textAnchor:l,transform:u.textTransform,style:f,strokeWidth:2*f.outlineWidth,stroke:f.outlineColor,strokeLinejoin:"round",children:""+g}),c.jsx(Tt.text,{dominantBaseline:o,textAnchor:l,transform:u.textTransform,style:M5(f),children:""+g})]}))}),JTe=function(e){var t=e.axis,n=e.scale,r=e.x,i=r===void 0?0:r,s=e.y,a=s===void 0?0:s,o=e.length,l=e.ticksPosition,u=e.tickValues,h=e.tickSize,d=h===void 0?5:h,f=e.tickPadding,g=f===void 0?5:f,b=e.tickRotation,x=b===void 0?0:b,v=e.format,m=e.renderTick,p=m===void 0?XTe:m,y=e.truncateTickAt,_=e.legend,C=e.legendPosition,S=C===void 0?"end":C,E=e.legendOffset,k=E===void 0?0:E,T=e.onClick,A=e.ariaHidden,M=Gt(),D=M.axis.legend.text,L=w.useMemo(function(){return YF(v,n)},[v,n]),N=KF({axis:t,scale:n,ticksPosition:l,tickValues:u,tickSize:d,tickPadding:g,tickRotation:x,truncateTickAt:y}),O=N.ticks,B=N.textAlign,z=N.textBaseline,P=null;if(_!==void 0){var j,R=0,I=0,H=0;t==="y"?(H=-90,R=k,S==="start"?(j="start",I=o):S==="middle"?(j="middle",I=o/2):S==="end"&&(j="end")):(I=k,S==="start"?j="start":S==="middle"?(j="middle",R=o/2):S==="end"&&(j="end",R=o)),P=c.jsxs(c.Fragment,{children:[D.outlineWidth>0&&c.jsx("text",{transform:"translate("+R+", "+I+") rotate("+H+")",textAnchor:j,style:ti({dominantBaseline:"central"},D),strokeWidth:2*D.outlineWidth,stroke:D.outlineColor,strokeLinejoin:"round",children:_}),c.jsx("text",{transform:"translate("+R+", "+I+") rotate("+H+")",textAnchor:j,style:ti({dominantBaseline:"central"},D),children:_})]})}var F=Cr(),G=F.animate,Z=F.config,J=Gs({transform:"translate("+i+","+a+")",lineX2:t==="x"?o:0,lineY2:t==="x"?0:o,config:Z,immediate:!G}),W=w.useCallback(function(U){return{opacity:1,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+x+")"}},[x]),$=w.useCallback(function(U){return{opacity:0,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+x+")"}},[x]),V=al(O,{keys:function(U){return U.key},initial:W,from:$,enter:W,update:W,leave:{opacity:0},config:Z,immediate:!G});return c.jsxs(Tt.g,{transform:J.transform,"aria-hidden":A,children:[V(function(U,X,q,ne){return w.createElement(p,ti({tickIndex:ne,format:L,rotate:x,textBaseline:z,textAnchor:B,truncateTickAt:y,animatedProps:U},X,T?{onClick:T}:{}))}),c.jsx(Tt.line,{style:M.axis.domain.line,x1:0,x2:J.lineX2,y1:0,y2:J.lineY2}),P]})},QTe=w.memo(JTe),XF=["top","right","bottom","left"],ZTe=w.memo(function(e){var t=e.xScale,n=e.yScale,r=e.width,i=e.height,s={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return c.jsx(c.Fragment,{children:XF.map(function(a){var o=s[a];if(!o)return null;var l=a==="top"||a==="bottom";return c.jsx(QTe,ti({},o,{axis:l?"x":"y",x:a==="right"?r:0,y:a==="bottom"?i:0,scale:l?t:n,length:l?r:i,ticksPosition:a==="top"||a==="left"?"before":"after",truncateTickAt:o.truncateTickAt}),a)})})}),eAe=w.memo(function(e){var t=e.animatedProps,n=Gt();return c.jsx(Tt.line,ti({},t,n.grid.line))}),cM=w.memo(function(e){var t=e.lines,n=Cr(),r=n.animate,i=n.config,s=al(t,{keys:function(a){return a.key},initial:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},from:function(a){return{opacity:0,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},enter:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},update:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},leave:{opacity:0},config:i,immediate:!r});return c.jsx("g",{children:s(function(a,o){return w.createElement(eAe,ti({},o,{key:o.key,animatedProps:a}))})})}),tAe=w.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,s=e.xValues,a=e.yValues,o=w.useMemo(function(){return!!r&&Lw({width:t,height:n,scale:r,axis:"x",values:s})},[r,s,t,n]),l=w.useMemo(function(){return!!i&&Lw({width:t,height:n,scale:i,axis:"y",values:a})},[n,t,i,a]);return c.jsxs(c.Fragment,{children:[o&&c.jsx(cM,{lines:o}),l&&c.jsx(cM,{lines:l})]})}),nAe=function(e,t){var n,r=t.axis,i=t.scale,s=t.x,a=s===void 0?0:s,o=t.y,l=o===void 0?0:o,u=t.length,h=t.ticksPosition,d=t.tickValues,f=t.tickSize,g=f===void 0?5:f,b=t.tickPadding,x=b===void 0?5:b,v=t.tickRotation,m=v===void 0?0:v,p=t.format,y=t.legend,_=t.legendPosition,C=_===void 0?"end":_,S=t.legendOffset,E=S===void 0?0:S,k=t.theme,T=KF({axis:r,scale:i,ticksPosition:h,tickValues:d,tickSize:g,tickPadding:x,tickRotation:m,engine:"canvas"}),A=T.ticks,M=T.textAlign,D=T.textBaseline;e.save(),e.translate(a,l),e.textAlign=M,e.textBaseline=D;var L=k.axis.ticks.text;e.font=(L.fontWeight?L.fontWeight+" ":"")+L.fontSize+"px "+L.fontFamily,((n=k.axis.domain.line.strokeWidth)!=null?n:0)>0&&(e.lineWidth=Number(k.axis.domain.line.strokeWidth),e.lineCap="square",k.axis.domain.line.stroke&&(e.strokeStyle=k.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(r==="x"?u:0,r==="x"?0:u),e.stroke());var N=typeof p=="function"?p:function(j){return""+j};if(A.forEach(function(j){var R;((R=k.axis.ticks.line.strokeWidth)!=null?R:0)>0&&(e.lineWidth=Number(k.axis.ticks.line.strokeWidth),e.lineCap="square",k.axis.ticks.line.stroke&&(e.strokeStyle=k.axis.ticks.line.stroke),e.beginPath(),e.moveTo(j.x,j.y),e.lineTo(j.x+j.lineX,j.y+j.lineY),e.stroke());var I=N(j.value);e.save(),e.translate(j.x+j.textX,j.y+j.textY),e.rotate(ei(m)),L.outlineWidth>0&&(e.strokeStyle=L.outlineColor,e.lineWidth=2*L.outlineWidth,e.lineJoin="round",e.strokeText(""+I,0,0)),k.axis.ticks.text.fill&&(e.fillStyle=L.fill),e.fillText(""+I,0,0),e.restore()}),y!==void 0){var O=0,B=0,z=0,P="center";r==="y"?(z=-90,O=E,C==="start"?(P="start",B=u):C==="middle"?(P="center",B=u/2):C==="end"&&(P="end")):(B=E,C==="start"?P="start":C==="middle"?(P="center",O=u/2):C==="end"&&(P="end",O=u)),e.translate(O,B),e.rotate(ei(z)),e.font=(k.axis.legend.text.fontWeight?k.axis.legend.text.fontWeight+" ":"")+k.axis.legend.text.fontSize+"px "+k.axis.legend.text.fontFamily,k.axis.legend.text.fill&&(e.fillStyle=k.axis.legend.text.fill),e.textAlign=P,e.textBaseline="middle",e.fillText(y,0,0)}e.restore()},rAe=function(e,t){var n=t.xScale,r=t.yScale,i=t.width,s=t.height,a=t.top,o=t.right,l=t.bottom,u=t.left,h=t.theme,d={top:a,right:o,bottom:l,left:u};XF.forEach(function(f){var g=d[f];if(!g)return null;var b=f==="top"||f==="bottom",x=f==="top"||f==="left"?"before":"after",v=b?n:r,m=YF(g.format,v);nAe(e,ti({},g,{axis:b?"x":"y",x:f==="right"?i:0,y:f==="bottom"?s:0,scale:v,format:m,length:b?i:s,ticksPosition:x,theme:h}))})},uM=function(e,t){var n=t.width,r=t.height,i=t.scale,s=t.axis,a=t.values;Lw({width:n,height:r,scale:i,axis:s,values:a}).forEach(function(o){e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.stroke()})},iAe=UF;function sAe(e,t){var n=[];return iAe(e,function(r,i,s){t(r,i,s)&&n.push(r)}),n}var oAe=sAe,aAe=yF,lAe=oAe,cAe=N5,uAe=Sr;function dAe(e,t){var n=uAe(e)?aAe:lAe;return n(e,cAe(t))}var hAe=dAe;const fAe=Rn(hAe);var pAe=ta,mAe=Di,gAe="[object Number]";function vAe(e){return typeof e=="number"||mAe(e)&&pAe(e)==gAe}var xAe=vAe;const dM=Rn(xAe);function yAe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var bAe=yAe,_Ae=wu,wAe=Wf;function SAe(e,t){return e&&_Ae(t,wAe(t),e)}var CAe=SAe,kAe=wu,EAe=Bf;function TAe(e,t){return e&&kAe(t,EAe(t),e)}var AAe=TAe,RAe=wu,MAe=k5;function jAe(e,t){return RAe(e,MAe(e),t)}var NAe=jAe,DAe=S5,LAe=Ok,PAe=k5,OAe=bF,IAe=Object.getOwnPropertySymbols,$Ae=IAe?function(e){for(var t=[];e;)DAe(t,PAe(e)),e=LAe(e);return t}:OAe,JF=$Ae,BAe=wu,FAe=JF;function zAe(e,t){return BAe(e,FAe(e),t)}var HAe=zAe,WAe=xF,UAe=JF,VAe=Bf;function qAe(e){return WAe(e,VAe,UAe)}var QF=qAe,GAe=Object.prototype,KAe=GAe.hasOwnProperty;function YAe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&KAe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var XAe=YAe,JAe=Pk;function QAe(e,t){var n=t?JAe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var ZAe=QAe,eRe=/\w*$/;function tRe(e){var t=new e.constructor(e.source,eRe.exec(e));return t.lastIndex=e.lastIndex,t}var nRe=tRe,hM=vu,fM=hM?hM.prototype:void 0,pM=fM?fM.valueOf:void 0;function rRe(e){return pM?Object(pM.call(e)):{}}var iRe=rRe,sRe=Pk,oRe=ZAe,aRe=nRe,lRe=iRe,cRe=A$,uRe="[object Boolean]",dRe="[object Date]",hRe="[object Map]",fRe="[object Number]",pRe="[object RegExp]",mRe="[object Set]",gRe="[object String]",vRe="[object Symbol]",xRe="[object ArrayBuffer]",yRe="[object DataView]",bRe="[object Float32Array]",_Re="[object Float64Array]",wRe="[object Int8Array]",SRe="[object Int16Array]",CRe="[object Int32Array]",kRe="[object Uint8Array]",ERe="[object Uint8ClampedArray]",TRe="[object Uint16Array]",ARe="[object Uint32Array]";function RRe(e,t,n){var r=e.constructor;switch(t){case xRe:return sRe(e);case uRe:case dRe:return new r(+e);case yRe:return oRe(e,n);case bRe:case _Re:case wRe:case SRe:case CRe:case kRe:case ERe:case TRe:case ARe:return cRe(e,n);case hRe:return new r;case fRe:case gRe:return new r(e);case pRe:return aRe(e);case mRe:return new r;case vRe:return lRe(e)}}var MRe=RRe,jRe=z1,NRe=Di,DRe="[object Map]";function LRe(e){return NRe(e)&&jRe(e)==DRe}var PRe=LRe,ORe=PRe,IRe=$f,mM=J0,gM=mM&&mM.isMap,$Re=gM?IRe(gM):ORe,BRe=$Re,FRe=z1,zRe=Di,HRe="[object Set]";function WRe(e){return zRe(e)&&FRe(e)==HRe}var URe=WRe,VRe=URe,qRe=$f,vM=J0,xM=vM&&vM.isSet,GRe=xM?qRe(xM):VRe,KRe=GRe,YRe=K0,XRe=bAe,JRe=Hk,QRe=CAe,ZRe=AAe,eMe=E$,tMe=R$,nMe=NAe,rMe=HAe,iMe=_F,sMe=QF,oMe=z1,aMe=XAe,lMe=MRe,cMe=j$,uMe=Sr,dMe=X0,hMe=BRe,fMe=ls,pMe=KRe,mMe=Wf,gMe=Bf,vMe=1,xMe=2,yMe=4,ZF="[object Arguments]",bMe="[object Array]",_Me="[object Boolean]",wMe="[object Date]",SMe="[object Error]",ez="[object Function]",CMe="[object GeneratorFunction]",kMe="[object Map]",EMe="[object Number]",tz="[object Object]",TMe="[object RegExp]",AMe="[object Set]",RMe="[object String]",MMe="[object Symbol]",jMe="[object WeakMap]",NMe="[object ArrayBuffer]",DMe="[object DataView]",LMe="[object Float32Array]",PMe="[object Float64Array]",OMe="[object Int8Array]",IMe="[object Int16Array]",$Me="[object Int32Array]",BMe="[object Uint8Array]",FMe="[object Uint8ClampedArray]",zMe="[object Uint16Array]",HMe="[object Uint32Array]",Lt={};Lt[ZF]=Lt[bMe]=Lt[NMe]=Lt[DMe]=Lt[_Me]=Lt[wMe]=Lt[LMe]=Lt[PMe]=Lt[OMe]=Lt[IMe]=Lt[$Me]=Lt[kMe]=Lt[EMe]=Lt[tz]=Lt[TMe]=Lt[AMe]=Lt[RMe]=Lt[MMe]=Lt[BMe]=Lt[FMe]=Lt[zMe]=Lt[HMe]=!0;Lt[SMe]=Lt[ez]=Lt[jMe]=!1;function km(e,t,n,r,i,s){var a,o=t&vMe,l=t&xMe,u=t&yMe;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!fMe(e))return e;var h=uMe(e);if(h){if(a=aMe(e),!o)return tMe(e,a)}else{var d=oMe(e),f=d==ez||d==CMe;if(dMe(e))return eMe(e,o);if(d==tz||d==ZF||f&&!i){if(a=l||f?{}:cMe(e),!o)return l?rMe(e,ZRe(a,e)):nMe(e,QRe(a,e))}else{if(!Lt[d])return i?e:{};a=lMe(e,d,o)}}s||(s=new YRe);var g=s.get(e);if(g)return g;s.set(e,a),pMe(e)?e.forEach(function(v){a.add(km(v,t,n,v,e,s))}):hMe(e)&&e.forEach(function(v,m){a.set(m,km(v,t,n,m,e,s))});var b=u?l?sMe:iMe:l?gMe:mMe,x=h?void 0:b(e);return XRe(x||e,function(v,m){x&&(m=v,v=e[m]),JRe(a,m,km(v,t,n,m,e,s))}),a}var WMe=km;function UMe(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}var VMe=UMe,qMe=Ff,GMe=VMe;function KMe(e,t){return t.length<2?e:qMe(e,GMe(t,0,-1))}var YMe=KMe,XMe=Su,JMe=Z$,QMe=YMe,ZMe=Cu;function eje(e,t){return t=XMe(t,e),e=QMe(e,t),e==null||delete e[ZMe(JMe(t))]}var tje=eje,nje=Bk;function rje(e){return nje(e)?void 0:e}var ije=rje,sje=t1,oje=WMe,aje=tje,lje=Su,cje=wu,uje=ije,dje=gF,hje=QF,fje=1,pje=2,mje=4,gje=dje(function(e,t){var n={};if(e==null)return n;var r=!1;t=sje(t,function(s){return s=lje(s,e),r||(r=s.length>1),s}),cje(e,hje(e),n),r&&(n=oje(n,fje|pje|mje,uje));for(var i=t.length;i--;)aje(n,t[i]);return n}),vje=gje;const nz=Rn(vje);function rs(){return rs=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},rs.apply(this,arguments)}var Pw={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},xje=function(e){var t=typeof e;return w.isValidElement(e)||t==="string"||t==="function"||t==="object"},yje=function(e){var t=typeof e;return t==="string"||t==="function"},Kh=function(e){return e.type==="circle"},Ow=function(e){return e.type==="dot"},Yh=function(e){return e.type==="rect"},bje=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return n.reduce(function(s,a){var o=a.offset||0;return[].concat(s,fAe(t,a.match).map(function(l){var u=r(l),h=i(l);return(Kh(a)||Yh(a))&&(h.size=h.size+2*o,h.width=h.width+2*o,h.height=h.height+2*o),rs({},nz(a,["match","offset"]),u,h,{size:a.size||h.size,datum:l})}))},[])},_je=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return L3e(U1(i))},rz=function(e){var t,n,r=e.x,i=e.y,s=e.noteX,a=e.noteY,o=e.noteWidth,l=o===void 0?Pw.noteWidth:o,u=e.noteTextOffset,h=u===void 0?Pw.noteTextOffset:u;if(dM(s))t=r+s;else{if(s.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=s.abs}if(dM(a))n=i+a;else{if(a.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");n=a.abs}var d=r,f=i,g=_je(r,i,t,n);if(Kh(e)){var b=Ta(ei(g),e.size/2);d+=b.x,f+=b.y}if(Yh(e)){var x=Math.round((g+90)/45)%8;x===0&&(f-=e.height/2),x===1&&(d+=e.width/2,f-=e.height/2),x===2&&(d+=e.width/2),x===3&&(d+=e.width/2,f+=e.height/2),x===4&&(f+=e.height/2),x===5&&(d-=e.width/2,f+=e.height/2),x===6&&(d-=e.width/2),x===7&&(d-=e.width/2,f-=e.height/2)}var v=t,m=t;return(g+90)%360>180?(v-=l,m-=l):m+=l,{points:[[d,f],[t,n],[m,n]],text:[v,n-h],angle:g+90}},iz=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return w.useMemo(function(){return bje({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},wje=function(e){var t=e.annotations;return w.useMemo(function(){return t.map(function(n){return rs({},n,{computed:rz(rs({},n))})})},[t])},Sje=function(e){return w.useMemo(function(){return rz(e)},[e])},Cje=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=Gt(),a=Cr(),o=a.animate,l=a.config,u=Gs({x:n,y:r,config:l,immediate:!o});return typeof i=="function"?w.createElement(i,{x:n,y:r,datum:t}):c.jsxs(c.Fragment,{children:[s.annotations.text.outlineWidth>0&&c.jsx(Tt.text,{x:u.x,y:u.y,style:rs({},s.annotations.text,{strokeLinejoin:"round",strokeWidth:2*s.annotations.text.outlineWidth,stroke:s.annotations.text.outlineColor}),children:i}),c.jsx(Tt.text,{x:u.x,y:u.y,style:nz(s.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},yM=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=Gt(),s=w.useMemo(function(){var l=t[0];return t.slice(1).reduce(function(u,h){return u+" L"+h[0]+","+h[1]},"M"+l[0]+","+l[1])},[t]),a=_3e(s);if(r&&i.annotations.link.outlineWidth<=0)return null;var o=rs({},i.annotations.link);return r&&(o.strokeLinecap="square",o.strokeWidth=i.annotations.link.strokeWidth+2*i.annotations.link.outlineWidth,o.stroke=i.annotations.link.outlineColor,o.opacity=i.annotations.link.outlineOpacity),c.jsx(Tt.path,{fill:"none",d:a,style:o})},kje=function(e){var t=e.x,n=e.y,r=e.size,i=Gt(),s=Cr(),a=s.animate,o=s.config,l=Gs({x:t,y:n,radius:r/2,config:o,immediate:!a});return c.jsxs(c.Fragment,{children:[i.annotations.outline.outlineWidth>0&&c.jsx(Tt.circle,{cx:l.x,cy:l.y,r:l.radius,style:rs({},i.annotations.outline,{fill:"none",strokeWidth:i.annotations.outline.strokeWidth+2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),c.jsx(Tt.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},Eje=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?Pw.dotSize:r,s=Gt(),a=Cr(),o=a.animate,l=a.config,u=Gs({x:t,y:n,radius:i/2,config:l,immediate:!o});return c.jsxs(c.Fragment,{children:[s.annotations.outline.outlineWidth>0&&c.jsx(Tt.circle,{cx:u.x,cy:u.y,r:u.radius,style:rs({},s.annotations.outline,{fill:"none",strokeWidth:2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),c.jsx(Tt.circle,{cx:u.x,cy:u.y,r:u.radius,style:s.annotations.symbol})]})},Tje=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,s=e.borderRadius,a=s===void 0?6:s,o=Gt(),l=Cr(),u=l.animate,h=l.config,d=Gs({x:t-r/2,y:n-i/2,width:r,height:i,config:h,immediate:!u});return c.jsxs(c.Fragment,{children:[o.annotations.outline.outlineWidth>0&&c.jsx(Tt.rect,{x:d.x,y:d.y,rx:a,ry:a,width:d.width,height:d.height,style:rs({},o.annotations.outline,{fill:"none",strokeWidth:o.annotations.outline.strokeWidth+2*o.annotations.outline.outlineWidth,stroke:o.annotations.outline.outlineColor,opacity:o.annotations.outline.outlineOpacity})}),c.jsx(Tt.rect,{x:d.x,y:d.y,rx:a,ry:a,width:d.width,height:d.height,style:o.annotations.outline})]})},Aje=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=Sje(e);if(!xje(i))throw new Error("note should be a valid react element");return c.jsxs(c.Fragment,{children:[c.jsx(yM,{points:s.points,isOutline:!0}),Kh(e)&&c.jsx(kje,{x:n,y:r,size:e.size}),Ow(e)&&c.jsx(Eje,{x:n,y:r,size:e.size}),Yh(e)&&c.jsx(Tje,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),c.jsx(yM,{points:s.points}),c.jsx(Cje,{datum:t,x:s.text[0],y:s.text[1],note:i})]})},bM=function(e,t){t.forEach(function(n,r){var i=n[0],s=n[1];r===0?e.moveTo(i,s):e.lineTo(i,s)})},Rje=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!yje(i.note))throw new Error("note is invalid for canvas implementation");r.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=r.annotations.link.outlineColor,e.lineWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,e.beginPath(),bM(e,i.computed.points),e.stroke(),e.lineCap="butt"),Kh(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Ow(i)&&r.annotations.symbol.outlineWidth>0&&(e.strokeStyle=r.annotations.symbol.outlineColor,e.lineWidth=2*r.annotations.symbol.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Yh(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),e.strokeStyle=r.annotations.link.stroke,e.lineWidth=r.annotations.link.strokeWidth,e.beginPath(),bM(e,i.computed.points),e.stroke(),Kh(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Ow(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),Yh(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),typeof i.note=="function"?i.note(e,{datum:i.datum,x:i.computed.text[0],y:i.computed.text[1],theme:r}):(e.font=r.annotations.text.fontSize+"px "+r.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=r.annotations.text.fill,e.strokeStyle=r.annotations.text.outlineColor,e.lineWidth=2*r.annotations.text.outlineWidth,r.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(i.note,i.computed.text[0],i.computed.text[1]),e.lineJoin="miter"),e.fillText(i.note,i.computed.text[0],i.computed.text[1]))}),e.restore())};function fv(){return fv=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},fv.apply(this,arguments)}function _M(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mje(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(i,s){if(i){if(typeof i=="string")return _M(i,s);var a=Object.prototype.toString.call(i).slice(8,-1);return a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set"?Array.from(i):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_M(i,s):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var sz={nivo:["#e8c1a0","#f47560","#f1e15b","#e8a838","#61cdbb","#97e3d5"],category10:OB,accent:IB,dark2:$B,paired:BB,pastel1:FB,pastel2:zB,set1:HB,set2:WB,set3:m5,tableau10:BSe},jje=Object.keys(sz),oz={brown_blueGreen:d1,purpleRed_green:h1,pink_yellowGreen:f1,purple_orange:p1,red_blue:m1,red_grey:g1,red_yellow_blue:v1,red_yellow_green:x1,spectral:y1},Nje=Object.keys(oz),Dje={brown_blueGreen:FSe,purpleRed_green:zSe,pink_yellowGreen:HSe,purple_orange:WSe,red_blue:USe,red_grey:VSe,red_yellow_blue:qSe,red_yellow_green:UB,spectral:GSe},az={blues:N1,greens:D1,greys:L1,oranges:I1,purples:P1,reds:O1,blue_green:b1,blue_purple:_1,green_blue:w1,orange_red:S1,purple_blue_green:C1,purple_blue:k1,purple_red:E1,red_purple:T1,yellow_green_blue:A1,yellow_green:R1,yellow_orange_brown:M1,yellow_orange_red:j1},Lje=Object.keys(az),Pje={blues:iCe,greens:sCe,greys:oCe,oranges:cCe,purples:aCe,reds:lCe,turbo:vCe,viridis:KB,inferno:yCe,magma:xCe,plasma:bCe,cividis:uCe,warm:hCe,cool:GB,cubehelixDefault:dCe,blue_green:KSe,blue_purple:YSe,green_blue:XSe,orange_red:JSe,purple_blue_green:QSe,purple_blue:ZSe,purple_red:eCe,red_purple:tCe,yellow_green_blue:nCe,yellow_green:VB,yellow_orange_brown:rCe,yellow_orange_red:qB},qy=fv({},sz,oz,az),Oje=function(e){return jje.includes(e)},Ije=function(e){return Nje.includes(e)},$je=function(e){return Lje.includes(e)},Bje={rainbow:fCe,sinebow:gCe};fv({},Dje,Pje,Bje);var Fje=function(e,t){if(typeof e=="function")return e;if(Fk(e)){if(function(l){return l.theme!==void 0}(e)){if(t===void 0)throw new Error("Unable to use color from theme as no theme was provided");var n=Os(t,e.theme);if(n===void 0)throw new Error("Color from theme is undefined at path: '"+e.theme+"'");return function(){return n}}if(function(l){return l.from!==void 0}(e)){var r=function(l){return Os(l,e.from)};if(Array.isArray(e.modifiers)){for(var i,s=[],a=function(){var l=i.value,u=l[0],h=l[1];if(u==="brighter")s.push(function(d){return d.brighter(h)});else if(u==="darker")s.push(function(d){return d.darker(h)});else{if(u!=="opacity")throw new Error("Invalid color modifier: '"+u+"', must be one of: 'brighter', 'darker', 'opacity'");s.push(function(d){return d.opacity=h,d})}},o=Mje(e.modifiers);!(i=o()).done;)a();return s.length===0?r:function(l){return s.reduce(function(u,h){return h(u)},Bc(r(l))).toString()}}return r}throw new Error("Invalid color spec, you should either specify 'theme' or 'from' when using a config object")}return function(){return e}},zc=function(e,t){return w.useMemo(function(){return Fje(e,t)},[e,t])};ee.oneOfType([ee.string,ee.func,ee.shape({theme:ee.string.isRequired}),ee.shape({from:ee.string.isRequired,modifiers:ee.arrayOf(ee.array)})]);var zje=function(e,t){if(typeof e=="function")return e;var n=typeof t=="function"?t:function(d){return Os(d,t)};if(Array.isArray(e)){var r=ya(e),i=function(d){return r(n(d))};return i.scale=r,i}if(Fk(e)){if(function(d){return d.datum!==void 0}(e))return function(d){return Os(d,e.datum)};if(function(d){return d.scheme!==void 0}(e)){if(Oje(e.scheme)){var s=ya(qy[e.scheme]),a=function(d){return s(n(d))};return a.scale=s,a}if(Ije(e.scheme)){if(e.size!==void 0&&(e.size<3||e.size>11))throw new Error("Invalid size '"+e.size+"' for diverging color scheme '"+e.scheme+"', must be between 3~11");var o=ya(qy[e.scheme][e.size||11]),l=function(d){return o(n(d))};return l.scale=o,l}if($je(e.scheme)){if(e.size!==void 0&&(e.size<3||e.size>9))throw new Error("Invalid size '"+e.size+"' for sequential color scheme '"+e.scheme+"', must be between 3~9");var u=ya(qy[e.scheme][e.size||9]),h=function(d){return u(n(d))};return h.scale=u,h}}throw new Error("Invalid colors, when using an object, you should either pass a 'datum' or a 'scheme' property")}return function(){return e}},lz=function(e,t){return w.useMemo(function(){return zje(e,t)},[e,t])},Hje=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,u=e.borderColor;return c.jsx("circle",{r:r/2,cx:t+r/2,cy:n+r/2,fill:i,opacity:a,strokeWidth:l,stroke:u===void 0?"transparent":u,style:{pointerEvents:"none"}})},Wje=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,u=e.borderColor;return c.jsx("g",{transform:"translate("+t+","+n+")",children:c.jsx("path",{d:`
                    M`+r/2+` 0
                    L`+.8*r+" "+r/2+`
                    L`+r/2+" "+r+`
                    L`+.2*r+" "+r/2+`
                    L`+r/2+` 0
                `,fill:i,opacity:a,strokeWidth:l,stroke:u===void 0?"transparent":u,style:{pointerEvents:"none"}})})},Uje=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,u=e.borderColor;return c.jsx("rect",{x:t,y:n,fill:i,opacity:a,strokeWidth:l,stroke:u===void 0?"transparent":u,width:r,height:r,style:{pointerEvents:"none"}})},Vje=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,u=e.borderColor;return c.jsx("g",{transform:"translate("+t+","+n+")",children:c.jsx("path",{d:`
                M`+r/2+` 0
                L`+r+" "+r+`
                L0 `+r+`
                L`+r/2+` 0
            `,fill:i,opacity:a,strokeWidth:l,stroke:u===void 0?"transparent":u,style:{pointerEvents:"none"}})})};function _a(){return _a=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},_a.apply(this,arguments)}var qje={top:0,right:0,bottom:0,left:0},L5=function(e){var t,n=e.direction,r=e.itemsSpacing,i=e.padding,s=e.itemCount,a=e.itemWidth,o=e.itemHeight;if(typeof i!="number"&&(typeof(t=i)!="object"||Array.isArray(t)||t===null))throw new Error("Invalid property padding, must be one of: number, object");var l=typeof i=="number"?{top:i,right:i,bottom:i,left:i}:_a({},qje,i),u=l.left+l.right,h=l.top+l.bottom,d=a+u,f=o+h,g=(s-1)*r;return n==="row"?d=a*s+g+u:n==="column"&&(f=o*s+g+h),{width:d,height:f,padding:l}},cz=function(e){var t=e.anchor,n=e.translateX,r=e.translateY,i=e.containerWidth,s=e.containerHeight,a=e.width,o=e.height,l=n,u=r;switch(t){case"top":l+=(i-a)/2;break;case"top-right":l+=i-a;break;case"right":l+=i-a,u+=(s-o)/2;break;case"bottom-right":l+=i-a,u+=s-o;break;case"bottom":l+=(i-a)/2,u+=s-o;break;case"bottom-left":u+=s-o;break;case"left":u+=(s-o)/2;break;case"center":l+=(i-a)/2,u+=(s-o)/2}return{x:l,y:u}},uz=function(e){var t,n,r,i,s,a,o=e.direction,l=e.justify,u=e.symbolSize,h=e.symbolSpacing,d=e.width,f=e.height;switch(o){case"left-to-right":t=0,n=(f-u)/2,i=f/2,a="central",l?(r=d,s="end"):(r=u+h,s="start");break;case"right-to-left":t=d-u,n=(f-u)/2,i=f/2,a="central",l?(r=0,s="start"):(r=d-u-h,s="end");break;case"top-to-bottom":t=(d-u)/2,n=0,r=d/2,s="middle",l?(i=f,a="alphabetic"):(i=u+h,a="text-before-edge");break;case"bottom-to-top":t=(d-u)/2,n=f-u,r=d/2,s="middle",l?(i=0,a="text-before-edge"):(i=f-u-h,a="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:i,labelAnchor:s,labelAlignment:a}},Gje={circle:Hje,diamond:Wje,square:Uje,triangle:Vje},Kje=function(e){var t,n,r,i,s,a,o,l,u,h,d,f=e.x,g=e.y,b=e.width,x=e.height,v=e.data,m=e.direction,p=m===void 0?"left-to-right":m,y=e.justify,_=y!==void 0&&y,C=e.textColor,S=e.background,E=S===void 0?"transparent":S,k=e.opacity,T=k===void 0?1:k,A=e.symbolShape,M=A===void 0?"square":A,D=e.symbolSize,L=D===void 0?16:D,N=e.symbolSpacing,O=N===void 0?8:N,B=e.symbolBorderWidth,z=B===void 0?0:B,P=e.symbolBorderColor,j=P===void 0?"transparent":P,R=e.onClick,I=e.onMouseEnter,H=e.onMouseLeave,F=e.toggleSerie,G=e.effects,Z=w.useState({}),J=Z[0],W=Z[1],$=Gt(),V=w.useCallback(function(be){if(G){var we=G.filter(function(_e){return _e.on==="hover"}).reduce(function(_e,de){return _a({},_e,de.style)},{});W(we)}I==null||I(v,be)},[I,v,G]),U=w.useCallback(function(be){if(G){var we=G.filter(function(_e){return _e.on!=="hover"}).reduce(function(_e,de){return _a({},_e,de.style)},{});W(we)}H==null||H(v,be)},[H,v,G]),X=uz({direction:p,justify:_,symbolSize:(t=J.symbolSize)!=null?t:L,symbolSpacing:O,width:b,height:x}),q=X.symbolX,ne=X.symbolY,te=X.labelX,le=X.labelY,xe=X.labelAnchor,ie=X.labelAlignment,Te=[R,I,H,F].some(function(be){return be!==void 0}),Ae=typeof M=="function"?M:Gje[M];return c.jsxs("g",{transform:"translate("+f+","+g+")",style:{opacity:(n=J.itemOpacity)!=null?n:T},children:[c.jsx("rect",{width:b,height:x,fill:(r=J.itemBackground)!=null?r:E,style:{cursor:Te?"pointer":"auto"},onClick:function(be){R==null||R(v,be),F==null||F(v.id)},onMouseEnter:V,onMouseLeave:U}),w.createElement(Ae,_a({id:v.id,x:q,y:ne,size:(i=J.symbolSize)!=null?i:L,fill:(s=(a=v.fill)!=null?a:v.color)!=null?s:"black",borderWidth:(o=J.symbolBorderWidth)!=null?o:z,borderColor:(l=J.symbolBorderColor)!=null?l:j},v.hidden?$.legends.hidden.symbol:void 0)),c.jsx("text",{textAnchor:xe,style:_a({},M5($.legends.text),{fill:(u=(h=(d=J.itemTextColor)!=null?d:C)!=null?h:$.legends.text.fill)!=null?u:"black",dominantBaseline:ie,pointerEvents:"none",userSelect:"none"},v.hidden?$.legends.hidden.text:void 0),x:te,y:le,children:v.label})]})},Yje=function(e){var t=e.data,n=e.x,r=e.y,i=e.direction,s=e.padding,a=s===void 0?0:s,o=e.justify,l=e.effects,u=e.itemWidth,h=e.itemHeight,d=e.itemDirection,f=d===void 0?"left-to-right":d,g=e.itemsSpacing,b=g===void 0?0:g,x=e.itemTextColor,v=e.itemBackground,m=v===void 0?"transparent":v,p=e.itemOpacity,y=p===void 0?1:p,_=e.symbolShape,C=e.symbolSize,S=e.symbolSpacing,E=e.symbolBorderWidth,k=e.symbolBorderColor,T=e.onClick,A=e.onMouseEnter,M=e.onMouseLeave,D=e.toggleSerie,L=L5({itemCount:t.length,itemWidth:u,itemHeight:h,itemsSpacing:b,direction:i,padding:a}).padding,N=i==="row"?u+b:0,O=i==="column"?h+b:0;return c.jsx("g",{transform:"translate("+n+","+r+")",children:t.map(function(B,z){return c.jsx(Kje,{data:B,x:z*N+L.left,y:z*O+L.top,width:u,height:h,direction:f,justify:o,effects:l,textColor:x,background:m,opacity:y,symbolShape:_,symbolSize:C,symbolSpacing:S,symbolBorderWidth:E,symbolBorderColor:k,onClick:T,onMouseEnter:A,onMouseLeave:M,toggleSerie:D},z)})})},dz=function(e){var t=e.data,n=e.containerWidth,r=e.containerHeight,i=e.translateX,s=i===void 0?0:i,a=e.translateY,o=a===void 0?0:a,l=e.anchor,u=e.direction,h=e.padding,d=h===void 0?0:h,f=e.justify,g=e.itemsSpacing,b=g===void 0?0:g,x=e.itemWidth,v=e.itemHeight,m=e.itemDirection,p=e.itemTextColor,y=e.itemBackground,_=e.itemOpacity,C=e.symbolShape,S=e.symbolSize,E=e.symbolSpacing,k=e.symbolBorderWidth,T=e.symbolBorderColor,A=e.onClick,M=e.onMouseEnter,D=e.onMouseLeave,L=e.toggleSerie,N=e.effects,O=L5({itemCount:t.length,itemsSpacing:b,itemWidth:x,itemHeight:v,direction:u,padding:d}),B=O.width,z=O.height,P=cz({anchor:l,translateX:s,translateY:o,containerWidth:n,containerHeight:r,width:B,height:z}),j=P.x,R=P.y;return c.jsx(Yje,{data:t,x:j,y:R,direction:u,padding:d,justify:f,effects:N,itemsSpacing:b,itemWidth:x,itemHeight:v,itemDirection:m,itemTextColor:p,itemBackground:y,itemOpacity:_,symbolShape:C,symbolSize:S,symbolSpacing:E,symbolBorderWidth:k,symbolBorderColor:T,onClick:A,onMouseEnter:M,onMouseLeave:D,toggleSerie:typeof L=="boolean"?void 0:L})},Xje={start:"left",middle:"center",end:"right"},Jje=function(e,t){var n=t.data,r=t.containerWidth,i=t.containerHeight,s=t.translateX,a=s===void 0?0:s,o=t.translateY,l=o===void 0?0:o,u=t.anchor,h=t.direction,d=t.padding,f=d===void 0?0:d,g=t.justify,b=g!==void 0&&g,x=t.itemsSpacing,v=x===void 0?0:x,m=t.itemWidth,p=t.itemHeight,y=t.itemDirection,_=y===void 0?"left-to-right":y,C=t.itemTextColor,S=t.symbolSize,E=S===void 0?16:S,k=t.symbolSpacing,T=k===void 0?8:k,A=t.theme,M=L5({itemCount:n.length,itemWidth:m,itemHeight:p,itemsSpacing:v,direction:h,padding:f}),D=M.width,L=M.height,N=M.padding,O=cz({anchor:u,translateX:a,translateY:l,containerWidth:r,containerHeight:i,width:D,height:L}),B=O.x,z=O.y,P=h==="row"?m+v:0,j=h==="column"?p+v:0;e.save(),e.translate(B,z),e.font=A.legends.text.fontSize+"px "+(A.legends.text.fontFamily||"sans-serif"),n.forEach(function(R,I){var H,F,G=I*P+N.left,Z=I*j+N.top,J=uz({direction:_,justify:b,symbolSize:E,symbolSpacing:T,width:m,height:p}),W=J.symbolX,$=J.symbolY,V=J.labelX,U=J.labelY,X=J.labelAnchor,q=J.labelAlignment;e.fillStyle=(H=R.color)!=null?H:"black",e.fillRect(G+W,Z+$,E,E),e.textAlign=Xje[X],q==="central"&&(e.textBaseline="middle"),e.fillStyle=(F=C??A.legends.text.fill)!=null?F:"black",e.fillText(String(R.label),G+V,Z+U)}),e.restore()};function Et(){return Et=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},Et.apply(this,arguments)}function Tu(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var wM,Qje=function(e){var t=e.bars,n=e.annotations,r=iz({data:t,annotations:n,getPosition:function(i){return{x:i.x+i.width/2,y:i.y+i.height/2}},getDimensions:function(i){var s=i.height,a=i.width;return{width:a,height:s,size:Math.max(a,s)}}});return c.jsx(c.Fragment,{children:r.map(function(i,s){return c.jsx(Aje,Et({},i),s)})})},Zje=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return c.jsx(c.Fragment,{children:r.map(function(s,a){var o,l=s[0],u=s[1];return c.jsx(dz,Et({},l,{containerWidth:t,containerHeight:n,data:(o=l.data)!=null?o:u,toggleSerie:l.toggleSerie&&l.dataFrom==="keys"?i:void 0}),a)})})},e6e=["data"],t6e=function(e){var t,n=e.bar,r=n.data,i=Tu(n,e6e),s=e.style,a=s.borderColor,o=s.color,l=s.height,u=s.labelColor,h=s.labelOpacity,d=s.labelX,f=s.labelY,g=s.transform,b=s.width,x=e.borderRadius,v=e.borderWidth,m=e.label,p=e.shouldRenderLabel,y=e.isInteractive,_=e.onClick,C=e.onMouseEnter,S=e.onMouseLeave,E=e.tooltip,k=e.isFocusable,T=e.ariaLabel,A=e.ariaLabelledBy,M=e.ariaDescribedBy,D=Gt(),L=jk(),N=L.showTooltipFromEvent,O=L.showTooltipAt,B=L.hideTooltip,z=w.useMemo(function(){return function(){return w.createElement(E,Et({},i,r))}},[E,i,r]),P=w.useCallback(function(G){_==null||_(Et({color:i.color},r),G)},[i,r,_]),j=w.useCallback(function(G){return N(z(),G)},[N,z]),R=w.useCallback(function(G){C==null||C(r,G),N(z(),G)},[r,C,N,z]),I=w.useCallback(function(G){S==null||S(r,G),B()},[r,B,S]),H=w.useCallback(function(){O(z(),[i.absX+i.width/2,i.absY])},[O,z,i]),F=w.useCallback(function(){B()},[B]);return c.jsxs(Tt.g,{transform:g,children:[c.jsx(Tt.rect,{width:Ho(b,function(G){return Math.max(G,0)}),height:Ho(l,function(G){return Math.max(G,0)}),rx:x,ry:x,fill:(t=r.fill)!=null?t:o,strokeWidth:v,stroke:a,focusable:k,tabIndex:k?0:void 0,"aria-label":T?T(r):void 0,"aria-labelledby":A?A(r):void 0,"aria-describedby":M?M(r):void 0,onMouseEnter:y?R:void 0,onMouseMove:y?j:void 0,onMouseLeave:y?I:void 0,onClick:y?P:void 0,onFocus:y&&k?H:void 0,onBlur:y&&k?F:void 0}),p&&c.jsx(Tt.text,{x:d,y:f,textAnchor:"middle",dominantBaseline:"central",fillOpacity:h,style:Et({},D.labels.text,{pointerEvents:"none",fill:u}),children:m})]})},n6e=["color","label"],r6e=function(e){var t=e.color,n=e.label,r=Tu(e,n6e);return c.jsx(g$,{id:n,value:r.formattedValue,enableChip:!0,color:t})},Rt={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",reverse:!1,minValue:"auto",maxValue:"auto",valueScale:{type:"linear"},indexScale:{type:"band",round:!0},padding:.1,innerPadding:0,axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{from:"theme",theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:r6e,tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],markers:[],enableTotals:!1,totalsOffset:10},Ht=Et({},Rt,{layers:["grid","axes","bars","totals","markers","legends","annotations"],barComponent:t6e,defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),Dn=Et({},Rt,{layers:["grid","axes","bars","totals","legends","annotations"],pixelRatio:typeof window<"u"&&(wM=window.devicePixelRatio)!=null?wM:1}),hz=function(e,t,n,r,i,s){return D5(r,{all:e.map(t),min:0,max:0},i,s).padding(n)},fz=function(e,t){return e.map(function(n){return Et({},t.reduce(function(r,i){return r[i]=null,r},{}),n)})},V1=function(e){return Object.keys(e).reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},{})},q1=function(e){return[e,Number(e)]},i6e=["layout","minValue","maxValue","reverse","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],P5=function(e,t){return e>t},pz=function(e,t){return e<t},mz=function(e,t){return Array.from(" ".repeat(t-e),function(n,r){return e+r})},s6e=function(e){return P5(e,0)?0:e},o6e=function(e,t,n,r){var i=e.data,s=e.formatValue,a=e.getColor,o=e.getIndex,l=e.getTooltipLabel,u=e.innerPadding,h=u===void 0?0:u,d=e.keys,f=e.xScale,g=e.yScale,b=e.margin,x=n?pz:P5,v=i.map(V1),m=[];return d.forEach(function(p,y){return mz(0,f.domain().length).forEach(function(_){var C,S,E,k=q1(i[_][p]),T=k[0],A=k[1],M=o(i[_]),D=((C=f(M))!=null?C:0)+t*y+h*y,L=x(S=A,0)?(E=g(S))!=null?E:0:r,N=function(B,z){var P;return x(B,0)?r-z:((P=g(B))!=null?P:0)-r}(A,L),O={id:p,value:T===null?T:A,formattedValue:s(A),hidden:!1,index:_,indexValue:M,data:v[_]};m.push({key:p+"."+O.indexValue,index:m.length,data:O,x:D,y:L,absX:b.left+D,absY:b.top+L,width:t,height:N,color:a(O),label:l(O)})})}),m},a6e=function(e,t,n,r){var i=e.data,s=e.formatValue,a=e.getIndex,o=e.getColor,l=e.getTooltipLabel,u=e.keys,h=e.innerPadding,d=h===void 0?0:h,f=e.xScale,g=e.yScale,b=e.margin,x=n?pz:P5,v=i.map(V1),m=[];return u.forEach(function(p,y){return mz(0,g.domain().length).forEach(function(_){var C,S,E,k=q1(i[_][p]),T=k[0],A=k[1],M=a(i[_]),D=x(S=A,0)?r:(E=f(S))!=null?E:0,L=((C=g(M))!=null?C:0)+t*y+d*y,N=function(B,z){var P;return x(B,0)?((P=f(B))!=null?P:0)-r:r-z}(A,D),O={id:p,value:T===null?T:A,formattedValue:s(A),hidden:!1,index:_,indexValue:M,data:v[_]};m.push({key:p+"."+O.indexValue,index:m.length,data:O,x:D,y:L,absX:b.left+D,absY:b.top+L,width:N,height:t,color:o(O),label:l(O)})})}),m},l6e=function(e){var t,n,r=e.layout,i=e.minValue,s=e.maxValue,a=e.reverse,o=e.width,l=e.height,u=e.padding,h=u===void 0?0:u,d=e.innerPadding,f=d===void 0?0:d,g=e.valueScale,b=e.indexScale,x=e.hiddenIds,v=x===void 0?[]:x,m=Tu(e,i6e),p=m.keys.filter(function(R){return!v.includes(R)}),y=fz(m.data,p),_=r==="vertical"?["y","x",o]:["x","y",l],C=_[0],S=_[1],E=_[2],k=hz(y,m.getIndex,h,b,E,S),T=Et({max:s,min:i,reverse:a},g),A=T.min==="auto"?s6e:function(R){return R},M=y.reduce(function(R,I){return[].concat(R,p.map(function(H){return I[H]}))},[]).filter(Boolean),D=A(Math.min.apply(Math,M)),L=(n=Math.max.apply(Math,M),isFinite(n)?n:0),N=D5(T,{all:M,min:D,max:L},C==="x"?o:l,C),O=r==="vertical"?[k,N]:[N,k],B=O[0],z=O[1],P=(k.bandwidth()-f*(p.length-1))/p.length,j=[Et({},m,{data:y,keys:p,innerPadding:f,xScale:B,yScale:z}),P,T.reverse,(t=N(0))!=null?t:0];return{xScale:B,yScale:z,bars:P>0?r==="vertical"?o6e.apply(void 0,j):a6e.apply(void 0,j):[]}},c6e=["data","layout","minValue","maxValue","reverse","width","height","padding","valueScale","indexScale","hiddenIds"],u6e=function e(t){var n;return t.some(Array.isArray)?e((n=[]).concat.apply(n,t)):t},d6e=function(e,t,n){var r=e.formatValue,i=e.getColor,s=e.getIndex,a=e.getTooltipLabel,o=e.innerPadding,l=e.stackedData,u=e.xScale,h=e.yScale,d=e.margin,f=[];return l.forEach(function(g){return u.domain().forEach(function(b,x){var v,m,p=g[x],y=(v=u(s(p.data)))!=null?v:0,_=((m=function(A){return h(A[n?0:1])}(p))!=null?m:0)+.5*o,C=function(A,M){var D;return((D=h(A[n?1:0]))!=null?D:0)-M}(p,_)-o,S=q1(p.data[g.key]),E=S[0],k=S[1],T={id:g.key,value:E===null?E:k,formattedValue:r(k),hidden:!1,index:x,indexValue:b,data:V1(p.data)};f.push({key:g.key+"."+b,index:f.length,data:T,x:y,y:_,absX:d.left+y,absY:d.top+_,width:t,height:C,color:i(T),label:a(T)})})}),f},h6e=function(e,t,n){var r=e.formatValue,i=e.getColor,s=e.getIndex,a=e.getTooltipLabel,o=e.innerPadding,l=e.stackedData,u=e.xScale,h=e.yScale,d=e.margin,f=[];return l.forEach(function(g){return h.domain().forEach(function(b,x){var v,m,p=g[x],y=(v=h(s(p.data)))!=null?v:0,_=((m=function(A){return u(A[n?1:0])}(p))!=null?m:0)+.5*o,C=function(A,M){var D;return((D=u(A[n?0:1]))!=null?D:0)-M}(p,_)-o,S=q1(p.data[g.key]),E=S[0],k=S[1],T={id:g.key,value:E===null?E:k,formattedValue:r(k),hidden:!1,index:x,indexValue:b,data:V1(p.data)};f.push({key:g.key+"."+b,index:f.length,data:T,x:_,y,absX:d.left+_,absY:d.top+y,width:C,height:t,color:i(T),label:a(T)})})}),f},f6e=function(e){var t,n=e.data,r=e.layout,i=e.minValue,s=e.maxValue,a=e.reverse,o=e.width,l=e.height,u=e.padding,h=u===void 0?0:u,d=e.valueScale,f=e.indexScale,g=e.hiddenIds,b=g===void 0?[]:g,x=Tu(e,c6e),v=x.keys.filter(function(P){return!b.includes(P)}),m=Fke().keys(v).offset(zke)(fz(n,v)),p=r==="vertical"?["y","x",o]:["x","y",l],y=p[0],_=p[1],C=p[2],S=hz(n,x.getIndex,h,f,C,_),E=Et({max:s,min:i,reverse:a},d),k=(t=u6e(m),d.type==="log"?t.filter(function(P){return P!==0}):t),T=Math.min.apply(Math,k),A=Math.max.apply(Math,k),M=D5(E,{all:k,min:T,max:A},y==="x"?o:l,y),D=r==="vertical"?[S,M]:[M,S],L=D[0],N=D[1],O=x.innerPadding>0?x.innerPadding:0,B=S.bandwidth(),z=[Et({},x,{innerPadding:O,stackedData:m,xScale:L,yScale:N}),B,E.reverse];return{xScale:L,yScale:N,bars:B>0?r==="vertical"?d6e.apply(void 0,z):h6e.apply(void 0,z):[]}},p6e=function(e){var t=e.bars,n=e.direction,r=e.from,i=e.groupMode,s=e.layout,a=e.legendLabel,o=e.reverse,l=FF(a??(r==="indexes"?"indexValue":"id"));return r==="indexes"?function(u,h,d){var f=sM(u.map(function(g){var b,x;return{id:(b=g.data.indexValue)!=null?b:"",label:d(g.data),hidden:g.data.hidden,color:(x=g.color)!=null?x:"#000"}}),function(g){return g.id});return h==="horizontal"&&f.reverse(),f}(t,s,l):function(u,h,d,f,g,b){var x=sM(u.map(function(v){var m;return{id:v.data.id,label:b(v.data),hidden:v.data.hidden,color:(m=v.color)!=null?m:"#000"}}),function(v){return v.id});return(h==="vertical"&&f==="stacked"&&d==="column"&&g!==!0||h==="horizontal"&&f==="stacked"&&g===!0)&&x.reverse(),x}(t,s,n,i,o,l)},SM=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},m6e=function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},g6e=function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},v6e=function(e,t){var n=e.get(t)||0;e.set(t,n+1)},gz=function(e){var t=e.indexBy,n=t===void 0?Rt.indexBy:t,r=e.keys,i=r===void 0?Rt.keys:r,s=e.label,a=s===void 0?Rt.label:s,o=e.tooltipLabel,l=o===void 0?Rt.tooltipLabel:o,u=e.valueFormat,h=e.colors,d=h===void 0?Rt.colors:h,f=e.colorBy,g=f===void 0?Rt.colorBy:f,b=e.borderColor,x=b===void 0?Rt.borderColor:b,v=e.labelTextColor,m=v===void 0?Rt.labelTextColor:v,p=e.groupMode,y=p===void 0?Rt.groupMode:p,_=e.layout,C=_===void 0?Rt.layout:_,S=e.reverse,E=S===void 0?Rt.reverse:S,k=e.data,T=e.minValue,A=T===void 0?Rt.minValue:T,M=e.maxValue,D=M===void 0?Rt.maxValue:M,L=e.margin,N=e.width,O=e.height,B=e.padding,z=B===void 0?Rt.padding:B,P=e.innerPadding,j=P===void 0?Rt.innerPadding:P,R=e.valueScale,I=R===void 0?Rt.valueScale:R,H=e.indexScale,F=H===void 0?Rt.indexScale:H,G=e.initialHiddenIds,Z=G===void 0?Rt.initialHiddenIds:G,J=e.enableLabel,W=J===void 0?Rt.enableLabel:J,$=e.labelSkipWidth,V=$===void 0?Rt.labelSkipWidth:$,U=e.labelSkipHeight,X=U===void 0?Rt.labelSkipHeight:U,q=e.legends,ne=q===void 0?Rt.legends:q,te=e.legendLabel,le=e.totalsOffset,xe=le===void 0?Rt.totalsOffset:le,ie=w.useState(Z??[]),Te=ie[0],Ae=ie[1],be=w.useCallback(function(Ee){Ae(function(Me){return Me.indexOf(Ee)>-1?Me.filter(function(Ie){return Ie!==Ee}):[].concat(Me,[Ee])})},[]),we=Aa(n),_e=Aa(a),de=Aa(l),se=H1(u),me=Gt(),K=lz(d,g),Q=zc(x,me),re=zc(m,me),ce=(y==="grouped"?l6e:f6e)({layout:C,reverse:E,data:k,getIndex:we,keys:i,minValue:A,maxValue:D,width:N,height:O,getColor:K,padding:z,innerPadding:j,valueScale:I,indexScale:F,hiddenIds:Te,formatValue:se,getTooltipLabel:de,margin:L}),ve=ce.bars,ge=ce.xScale,pe=ce.yScale,Ue=w.useMemo(function(){return ve.filter(function(Ee){return Ee.data.value!==null}).map(function(Ee,Me){return Et({},Ee,{index:Me})})},[ve]),Fe=w.useCallback(function(Ee){var Me=Ee.width,Ie=Ee.height;return!!W&&!(V>0&&Me<V)&&!(X>0&&Ie<X)},[W,V,X]),He=w.useMemo(function(){return i.map(function(Ee){var Me=ve.find(function(Ie){return Ie.data.id===Ee});return Et({},Me,{data:Et({id:Ee},Me==null?void 0:Me.data,{hidden:Te.includes(Ee)})})})},[Te,i,ve]),$e=w.useMemo(function(){return ne.map(function(Ee){return[Ee,p6e({bars:Ee.dataFrom==="keys"?He:ve,direction:Ee.direction,from:Ee.dataFrom,groupMode:y,layout:C,legendLabel:te,reverse:E})]})},[ne,He,ve,y,C,te,E]),dt=w.useMemo(function(){return function(Ee,Me,Ie,ht,Je,at,Ct){ht===void 0&&(ht=Rt.layout),Je===void 0&&(Je=Rt.groupMode);var an=[];if(Ee.length===0)return an;var Nt=new Map,$t=Ee[0].width,Bt=Ee[0].height;if(Je==="stacked"){var yn=new Map;Ee.forEach(function(Qe){var Ke=Qe.data,Ve=Ke.indexValue,wt=Ke.value;SM(Nt,Ve,Number(wt)),m6e(yn,Ve,Number(wt))}),yn.forEach(function(Qe,Ke){var Ve,wt,nn,rn=Nt.get(Ke)||0;ht==="vertical"?(Ve=Me(Ke),wt=Ie(Qe),nn=Ie(Qe/2)):(Ve=Me(Qe),wt=Ie(Ke),nn=Me(Qe/2)),Ve+=ht==="vertical"?$t/2:at,wt+=ht==="vertical"?-at:Bt/2,an.push({key:"total_"+Ke,x:Ve,y:wt,value:rn,formattedValue:Ct(rn),animationOffset:nn})})}else if(Je==="grouped"){var kt=new Map,ln=new Map;Ee.forEach(function(Qe){var Ke=Qe.data,Ve=Ke.indexValue,wt=Ke.value;SM(Nt,Ve,Number(wt)),g6e(kt,Ve,Number(wt)),v6e(ln,Ve)}),kt.forEach(function(Qe,Ke){var Ve,wt,nn,rn=Nt.get(Ke)||0,jn=ln.get(Ke);ht==="vertical"?(Ve=Me(Ke),wt=Ie(Qe),nn=Ie(Qe/2)):(Ve=Me(Qe),wt=Ie(Ke),nn=Me(Qe/2)),Ve+=ht==="vertical"?jn*$t/2:at,wt+=ht==="vertical"?-at:jn*Bt/2,an.push({key:"total_"+Ke,x:Ve,y:wt,value:rn,formattedValue:Ct(rn),animationOffset:nn})})}return an}(ve,ge,pe,C,y,xe,se)},[ve,ge,pe,C,y,xe,se]);return{bars:ve,barsWithValue:Ue,xScale:ge,yScale:pe,getIndex:we,getLabel:_e,getTooltipLabel:de,formatValue:se,getColor:K,getBorderColor:Q,getLabelColor:re,shouldRenderBarLabel:Fe,hiddenIds:Te,toggleSerie:be,legendsWithData:$e,barTotals:dt}},x6e=function(e){var t=e.data,n=e.springConfig,r=e.animate,i=e.layout,s=i===void 0?Ht.layout:i,a=Gt();return al(t,{keys:function(o){return o.key},from:function(o){return{x:s==="vertical"?o.x:o.animationOffset,y:s==="vertical"?o.animationOffset:o.y,labelOpacity:0}},enter:function(o){return{x:o.x,y:o.y,labelOpacity:1}},update:function(o){return{x:o.x,y:o.y,labelOpacity:1}},leave:function(o){return{x:s==="vertical"?o.x:o.animationOffset,y:s==="vertical"?o.animationOffset:o.y,labelOpacity:0}},config:n,immediate:!r,initial:r?void 0:null})(function(o,l){return c.jsx(Tt.text,{x:o.x,y:o.y,fillOpacity:o.labelOpacity,style:Et({},a.labels.text,{pointerEvents:"none",fill:a.text.fill}),fontWeight:"bold",fontSize:a.labels.text.fontSize,fontFamily:a.labels.text.fontFamily,textAnchor:s==="vertical"?"middle":"start",alignmentBaseline:s==="vertical"?"alphabetic":"middle",children:l.formattedValue},l.key)})},y6e=["isInteractive","animate","motionConfig","theme","renderWrapper"],b6e=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,s=e.width,a=e.height,o=e.groupMode,l=e.layout,u=e.reverse,h=e.minValue,d=e.maxValue,f=e.valueScale,g=e.indexScale,b=e.padding,x=e.innerPadding,v=e.axisTop,m=e.axisRight,p=e.axisBottom,y=p===void 0?Ht.axisBottom:p,_=e.axisLeft,C=_===void 0?Ht.axisLeft:_,S=e.enableGridX,E=S===void 0?Ht.enableGridX:S,k=e.enableGridY,T=k===void 0?Ht.enableGridY:k,A=e.gridXValues,M=e.gridYValues,D=e.layers,L=D===void 0?Ht.layers:D,N=e.barComponent,O=N===void 0?Ht.barComponent:N,B=e.enableLabel,z=B===void 0?Ht.enableLabel:B,P=e.label,j=e.labelSkipWidth,R=j===void 0?Ht.labelSkipWidth:j,I=e.labelSkipHeight,H=I===void 0?Ht.labelSkipHeight:I,F=e.labelTextColor,G=e.markers,Z=G===void 0?Ht.markers:G,J=e.colorBy,W=e.colors,$=e.defs,V=$===void 0?Ht.defs:$,U=e.fill,X=U===void 0?Ht.fill:U,q=e.borderRadius,ne=q===void 0?Ht.borderRadius:q,te=e.borderWidth,le=te===void 0?Ht.borderWidth:te,xe=e.borderColor,ie=e.annotations,Te=ie===void 0?Ht.annotations:ie,Ae=e.legendLabel,be=e.tooltipLabel,we=e.valueFormat,_e=e.isInteractive,de=_e===void 0?Ht.isInteractive:_e,se=e.tooltip,me=se===void 0?Ht.tooltip:se,K=e.onClick,Q=e.onMouseEnter,re=e.onMouseLeave,ce=e.legends,ve=e.role,ge=ve===void 0?Ht.role:ve,pe=e.ariaLabel,Ue=e.ariaLabelledBy,Fe=e.ariaDescribedBy,He=e.isFocusable,$e=He===void 0?Ht.isFocusable:He,dt=e.barAriaLabel,Ee=e.barAriaLabelledBy,Me=e.barAriaDescribedBy,Ie=e.initialHiddenIds,ht=e.enableTotals,Je=ht===void 0?Ht.enableTotals:ht,at=e.totalsOffset,Ct=at===void 0?Ht.totalsOffset:at,an=Cr(),Nt=an.animate,$t=an.config,Bt=R5(s,a,i),yn=Bt.outerWidth,kt=Bt.outerHeight,ln=Bt.margin,Qe=Bt.innerWidth,Ke=Bt.innerHeight,Ve=gz({indexBy:n,label:P,tooltipLabel:be,valueFormat:we,colors:W,colorBy:J,borderColor:xe,labelTextColor:F,groupMode:o,layout:l,reverse:u,data:t,keys:r,minValue:h,maxValue:d,margin:ln,width:Qe,height:Ke,padding:b,innerPadding:x,valueScale:f,indexScale:g,enableLabel:z,labelSkipWidth:R,labelSkipHeight:H,legends:ce,legendLabel:Ae,initialHiddenIds:Ie,totalsOffset:Ct}),wt=Ve.bars,nn=Ve.barsWithValue,rn=Ve.xScale,jn=Ve.yScale,yl=Ve.getLabel,Pe=Ve.getTooltipLabel,Oe=Ve.getBorderColor,lt=Ve.getLabelColor,Dt=Ve.shouldRenderBarLabel,mt=Ve.toggleSerie,Jt=Ve.legendsWithData,At=Ve.barTotals,Qt=al(nn,{keys:function(ke){return ke.key},from:function(ke){return Et({borderColor:Oe(ke),color:ke.color,height:0,labelColor:lt(ke),labelOpacity:0,labelX:ke.width/2,labelY:ke.height/2,transform:"translate("+ke.x+", "+(ke.y+ke.height)+")",width:ke.width},l==="vertical"?{}:{height:ke.height,transform:"translate("+ke.x+", "+ke.y+")",width:0})},enter:function(ke){return{borderColor:Oe(ke),color:ke.color,height:ke.height,labelColor:lt(ke),labelOpacity:1,labelX:ke.width/2,labelY:ke.height/2,transform:"translate("+ke.x+", "+ke.y+")",width:ke.width}},update:function(ke){return{borderColor:Oe(ke),color:ke.color,height:ke.height,labelColor:lt(ke),labelOpacity:1,labelX:ke.width/2,labelY:ke.height/2,transform:"translate("+ke.x+", "+ke.y+")",width:ke.width}},leave:function(ke){return Et({borderColor:Oe(ke),color:ke.color,height:0,labelColor:lt(ke),labelOpacity:0,labelX:ke.width/2,labelY:0,transform:"translate("+ke.x+", "+(ke.y+ke.height)+")",width:ke.width},l==="vertical"?{}:{labelX:0,labelY:ke.height/2,height:ke.height,transform:"translate("+ke.x+", "+ke.y+")",width:0})},config:$t,immediate:!Nt,initial:Nt?void 0:null}),na=w.useMemo(function(){return{borderRadius:ne,borderWidth:le,enableLabel:z,isInteractive:de,labelSkipWidth:R,labelSkipHeight:H,onClick:K,onMouseEnter:Q,onMouseLeave:re,getTooltipLabel:Pe,tooltip:me,isFocusable:$e,ariaLabel:dt,ariaLabelledBy:Ee,ariaDescribedBy:Me}},[ne,le,z,Pe,de,H,R,K,Q,re,me,$e,dt,Ee,Me]),bl=zF(V,wt,X,{dataKey:"data",targetKey:"data.fill"}),Jn={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};L.includes("annotations")&&(Jn.annotations=c.jsx(Qje,{bars:wt,annotations:Te},"annotations")),L.includes("axes")&&(Jn.axes=c.jsx(ZTe,{xScale:rn,yScale:jn,width:Qe,height:Ke,top:v,right:m,bottom:y,left:C},"axes")),L.includes("bars")&&(Jn.bars=c.jsx(w.Fragment,{children:Qt(function(ke,us){return w.createElement(O,Et({},na,{bar:us,style:ke,shouldRenderLabel:Dt(us),label:yl(us.data)}))})},"bars")),L.includes("grid")&&(Jn.grid=c.jsx(tAe,{width:Qe,height:Ke,xScale:E?rn:null,yScale:T?jn:null,xValues:A,yValues:M},"grid")),L.includes("legends")&&(Jn.legends=c.jsx(Zje,{width:Qe,height:Ke,legends:Jt,toggleSerie:mt},"legends")),L.includes("markers")&&(Jn.markers=c.jsx(F3e,{markers:Z,width:Qe,height:Ke,xScale:rn,yScale:jn},"markers")),L.includes("totals")&&Je&&(Jn.totals=c.jsx(x6e,{data:At,springConfig:$t,animate:Nt,layout:l},"totals"));var Mu=w.useMemo(function(){return Et({},na,{margin:ln,width:s,height:a,innerWidth:Qe,innerHeight:Ke,bars:wt,legendData:Jt,enableLabel:z,xScale:rn,yScale:jn,tooltip:me,getTooltipLabel:Pe,onClick:K,onMouseEnter:Q,onMouseLeave:re})},[na,ln,s,a,Qe,Ke,wt,Jt,z,rn,jn,me,Pe,K,Q,re]);return c.jsx(j5,{width:yn,height:kt,margin:ln,defs:bl,role:ge,ariaLabel:pe,ariaLabelledBy:Ue,ariaDescribedBy:Fe,isFocusable:$e,children:L.map(function(ke,us){var Nn;return typeof ke=="function"?c.jsx(w.Fragment,{children:w.createElement(ke,Mu)},us):(Nn=Jn==null?void 0:Jn[ke])!=null?Nn:null})})},_6e=function(e){var t=e.isInteractive,n=t===void 0?Ht.isInteractive:t,r=e.animate,i=r===void 0?Ht.animate:r,s=e.motionConfig,a=s===void 0?Ht.motionConfig:s,o=e.theme,l=e.renderWrapper,u=Tu(e,y6e);return c.jsx(W1,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:o,children:c.jsx(b6e,Et({isInteractive:n},u))})},w6e=["isInteractive","renderWrapper","theme"],Gy=function(e,t,n,r){return e.find(function(i){return z3e(i.x+t.left,i.y+t.top,i.width,i.height,n,r)})},S6e=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,s=e.width,a=e.height,o=e.groupMode,l=e.layout,u=e.reverse,h=e.minValue,d=e.maxValue,f=e.valueScale,g=e.indexScale,b=e.padding,x=e.innerPadding,v=e.axisTop,m=e.axisRight,p=e.axisBottom,y=p===void 0?Dn.axisBottom:p,_=e.axisLeft,C=_===void 0?Dn.axisLeft:_,S=e.enableGridX,E=S===void 0?Dn.enableGridX:S,k=e.enableGridY,T=k===void 0?Dn.enableGridY:k,A=e.gridXValues,M=e.gridYValues,D=e.layers,L=D===void 0?Dn.layers:D,N=e.renderBar,O=N===void 0?function(Pe,Oe){var lt=Oe.bar,Dt=lt.color,mt=lt.height,Jt=lt.width,At=lt.x,Qt=lt.y,na=Oe.borderColor,bl=Oe.borderRadius,Jn=Oe.borderWidth,Mu=Oe.label,ke=Oe.labelColor,us=Oe.shouldRenderLabel;if(Pe.fillStyle=Dt,Jn>0&&(Pe.strokeStyle=na,Pe.lineWidth=Jn),Pe.beginPath(),bl>0){var Nn=Math.min(bl,mt);Pe.moveTo(At+Nn,Qt),Pe.lineTo(At+Jt-Nn,Qt),Pe.quadraticCurveTo(At+Jt,Qt,At+Jt,Qt+Nn),Pe.lineTo(At+Jt,Qt+mt-Nn),Pe.quadraticCurveTo(At+Jt,Qt+mt,At+Jt-Nn,Qt+mt),Pe.lineTo(At+Nn,Qt+mt),Pe.quadraticCurveTo(At,Qt+mt,At,Qt+mt-Nn),Pe.lineTo(At,Qt+Nn),Pe.quadraticCurveTo(At,Qt,At+Nn,Qt),Pe.closePath()}else Pe.rect(At,Qt,Jt,mt);Pe.fill(),Jn>0&&Pe.stroke(),us&&(Pe.textBaseline="middle",Pe.textAlign="center",Pe.fillStyle=ke,Pe.fillText(Mu,At+Jt/2,Qt+mt/2))}:N,B=e.enableLabel,z=B===void 0?Dn.enableLabel:B,P=e.label,j=e.labelSkipWidth,R=j===void 0?Dn.labelSkipWidth:j,I=e.labelSkipHeight,H=I===void 0?Dn.labelSkipHeight:I,F=e.labelTextColor,G=e.colorBy,Z=e.colors,J=e.borderRadius,W=J===void 0?Dn.borderRadius:J,$=e.borderWidth,V=$===void 0?Dn.borderWidth:$,U=e.borderColor,X=e.annotations,q=X===void 0?Dn.annotations:X,ne=e.legendLabel,te=e.tooltipLabel,le=e.valueFormat,xe=e.isInteractive,ie=xe===void 0?Dn.isInteractive:xe,Te=e.tooltip,Ae=Te===void 0?Dn.tooltip:Te,be=e.onClick,we=e.onMouseEnter,_e=e.onMouseLeave,de=e.legends,se=e.pixelRatio,me=se===void 0?Dn.pixelRatio:se,K=e.canvasRef,Q=e.enableTotals,re=Q===void 0?Dn.enableTotals:Q,ce=e.totalsOffset,ve=ce===void 0?Dn.totalsOffset:ce,ge=w.useRef(null),pe=Gt(),Ue=R5(s,a,i),Fe=Ue.margin,He=Ue.innerWidth,$e=Ue.innerHeight,dt=Ue.outerWidth,Ee=Ue.outerHeight,Me=gz({indexBy:n,label:P,tooltipLabel:te,valueFormat:le,colors:Z,colorBy:G,borderColor:U,labelTextColor:F,groupMode:o,layout:l,reverse:u,data:t,keys:r,minValue:h,maxValue:d,margin:Fe,width:He,height:$e,padding:b,innerPadding:x,valueScale:f,indexScale:g,enableLabel:z,labelSkipWidth:R,labelSkipHeight:H,legends:de,legendLabel:ne,totalsOffset:ve}),Ie=Me.bars,ht=Me.barsWithValue,Je=Me.xScale,at=Me.yScale,Ct=Me.getLabel,an=Me.getTooltipLabel,Nt=Me.getBorderColor,$t=Me.getLabelColor,Bt=Me.shouldRenderBarLabel,yn=Me.legendsWithData,kt=Me.barTotals,ln=jk(),Qe=ln.showTooltipFromEvent,Ke=ln.hideTooltip,Ve=wje({annotations:iz({data:Ie,annotations:q,getPosition:function(Pe){return{x:Pe.x,y:Pe.y}},getDimensions:function(Pe){var Oe=Pe.width,lt=Pe.height;return{width:Oe,height:lt,size:Math.max(Oe,lt)}}})}),wt=w.useMemo(function(){return{borderRadius:W,borderWidth:V,isInteractive:ie,isFocusable:!1,labelSkipWidth:R,labelSkipHeight:H,margin:Fe,width:s,height:a,innerWidth:He,innerHeight:$e,bars:Ie,legendData:yn,enableLabel:z,xScale:Je,yScale:at,tooltip:Ae,getTooltipLabel:an,onClick:be,onMouseEnter:we,onMouseLeave:_e}},[W,V,ie,R,H,Fe,s,a,He,$e,Ie,yn,z,Je,at,Ae,an,be,we,_e]),nn=H1(le);w.useEffect(function(){var Pe,Oe=(Pe=ge.current)==null?void 0:Pe.getContext("2d");ge.current&&Oe&&(ge.current.width=dt*me,ge.current.height=Ee*me,Oe.scale(me,me),Oe.fillStyle=pe.background,Oe.fillRect(0,0,dt,Ee),Oe.translate(Fe.left,Fe.top),L.forEach(function(lt){lt==="grid"?typeof pe.grid.line.strokeWidth=="number"&&pe.grid.line.strokeWidth>0&&(Oe.lineWidth=pe.grid.line.strokeWidth,Oe.strokeStyle=pe.grid.line.stroke,E&&uM(Oe,{width:He,height:$e,scale:Je,axis:"x",values:A}),T&&uM(Oe,{width:He,height:$e,scale:at,axis:"y",values:M})):lt==="axes"?rAe(Oe,{xScale:Je,yScale:at,width:He,height:$e,top:v,right:m,bottom:y,left:C,theme:pe}):lt==="bars"?ht.forEach(function(Dt){O(Oe,{bar:Dt,borderColor:Nt(Dt),borderRadius:W,borderWidth:V,label:Ct(Dt.data),labelColor:$t(Dt),shouldRenderLabel:Bt(Dt)})}):lt==="legends"?yn.forEach(function(Dt){var mt=Dt[0],Jt=Dt[1];Jje(Oe,Et({},mt,{data:Jt,containerWidth:He,containerHeight:$e,theme:pe}))}):lt==="annotations"?Rje(Oe,{annotations:Ve,theme:pe}):lt==="totals"&&re?function(Dt,mt,Jt,At){At===void 0&&(At=Dn.layout),Dt.fillStyle=Jt.text.fill,Dt.font="bold "+Jt.labels.text.fontSize+"px "+Jt.labels.text.fontFamily,Dt.textBaseline=At==="vertical"?"alphabetic":"middle",Dt.textAlign=At==="vertical"?"center":"start",mt.forEach(function(Qt){Dt.fillText(Qt.formattedValue,Qt.x,Qt.y)})}(Oe,kt,pe,l):typeof lt=="function"&&lt(Oe,wt)}),Oe.save())},[y,C,m,v,ht,W,V,Ve,E,T,Nt,Ct,$t,A,M,o,a,$e,He,wt,L,l,yn,Fe.left,Fe.top,Ee,dt,me,O,Je,at,u,Bt,pe,s,kt,re,nn]);var rn=w.useCallback(function(Pe){if(Ie&&ge.current){var Oe=Wy(ge.current,Pe),lt=Oe[0],Dt=Oe[1],mt=Gy(Ie,Fe,lt,Dt);mt!==void 0?(Qe(w.createElement(Ae,Et({},mt.data,{color:mt.color,label:mt.label,value:Number(mt.data.value)})),Pe),Pe.type==="mouseenter"&&(we==null||we(mt.data,Pe))):Ke()}},[Ke,Fe,we,Ie,Qe,Ae]),jn=w.useCallback(function(Pe){if(Ie&&ge.current){Ke();var Oe=Wy(ge.current,Pe),lt=Oe[0],Dt=Oe[1],mt=Gy(Ie,Fe,lt,Dt);mt&&(_e==null||_e(mt.data,Pe))}},[Ke,Fe,_e,Ie]),yl=w.useCallback(function(Pe){if(Ie&&ge.current){var Oe=Wy(ge.current,Pe),lt=Oe[0],Dt=Oe[1],mt=Gy(Ie,Fe,lt,Dt);mt!==void 0&&(be==null||be(Et({},mt.data,{color:mt.color}),Pe))}},[Fe,be,Ie]);return c.jsx("canvas",{ref:function(Pe){ge.current=Pe,K&&"current"in K&&(K.current=Pe)},width:dt*me,height:Ee*me,style:{width:dt,height:Ee,cursor:ie?"auto":"normal"},onMouseEnter:ie?rn:void 0,onMouseMove:ie?rn:void 0,onMouseLeave:ie?jn:void 0,onClick:ie?yl:void 0})},C6e=w.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,s=Tu(e,w6e);return c.jsx(W1,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:c.jsx(S6e,Et({},s,{canvasRef:t}))})});w.forwardRef(function(e,t){return c.jsx(jF,{children:function(n){var r=n.width,i=n.height;return c.jsx(C6e,Et({width:r,height:i},e,{ref:t}))}})});function k6e(e){return e}var Ky=1,Em=2,Iw=3,wd=4,CM=1e-6;function E6e(e){return"translate("+e+",0)"}function T6e(e){return"translate(0,"+e+")"}function A6e(e){return t=>+e(t)}function R6e(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function M6e(){return!this.__axis}function O5(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=e===Ky||e===wd?-1:1,h=e===wd||e===Em?"x":"y",d=e===Ky||e===Iw?E6e:T6e;function f(g){var b=r??(t.ticks?t.ticks.apply(t,n):t.domain()),x=i??(t.tickFormat?t.tickFormat.apply(t,n):k6e),v=Math.max(s,0)+o,m=t.range(),p=+m[0]+l,y=+m[m.length-1]+l,_=(t.bandwidth?R6e:A6e)(t.copy(),l),C=g.selection?g.selection():g,S=C.selectAll(".domain").data([null]),E=C.selectAll(".tick").data(b,t).order(),k=E.exit(),T=E.enter().append("g").attr("class","tick"),A=E.select("line"),M=E.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(T),A=A.merge(T.append("line").attr("stroke","currentColor").attr(h+"2",u*s)),M=M.merge(T.append("text").attr("fill","currentColor").attr(h,u*v).attr("dy",e===Ky?"0em":e===Iw?"0.71em":"0.32em")),g!==C&&(S=S.transition(g),E=E.transition(g),A=A.transition(g),M=M.transition(g),k=k.transition(g).attr("opacity",CM).attr("transform",function(D){return isFinite(D=_(D))?d(D+l):this.getAttribute("transform")}),T.attr("opacity",CM).attr("transform",function(D){var L=this.parentNode.__axis;return d((L&&isFinite(L=L(D))?L:_(D))+l)})),k.remove(),S.attr("d",e===wd||e===Em?a?"M"+u*a+","+p+"H"+l+"V"+y+"H"+u*a:"M"+l+","+p+"V"+y:a?"M"+p+","+u*a+"V"+l+"H"+y+"V"+u*a:"M"+p+","+l+"H"+y),E.attr("opacity",1).attr("transform",function(D){return d(_(D)+l)}),A.attr(h+"2",u*s),M.attr(h,u*v).text(x),C.filter(M6e).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Em?"start":e===wd?"end":"middle"),C.each(function(){this.__axis=_})}return f.scale=function(g){return arguments.length?(t=g,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(g){return arguments.length?(n=g==null?[]:Array.from(g),f):n.slice()},f.tickValues=function(g){return arguments.length?(r=g==null?null:Array.from(g),f):r&&r.slice()},f.tickFormat=function(g){return arguments.length?(i=g,f):i},f.tickSize=function(g){return arguments.length?(s=a=+g,f):s},f.tickSizeInner=function(g){return arguments.length?(s=+g,f):s},f.tickSizeOuter=function(g){return arguments.length?(a=+g,f):a},f.tickPadding=function(g){return arguments.length?(o=+g,f):o},f.offset=function(g){return arguments.length?(l=+g,f):l},f}function j6e(e){return O5(Em,e)}function vz(e){return O5(Iw,e)}function xz(e){return O5(wd,e)}var N6e={value:()=>{}};function I5(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Tm(n)}function Tm(e){this._=e}function D6e(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Tm.prototype=I5.prototype={constructor:Tm,on:function(e,t){var n=this._,r=D6e(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=L6e(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=kM(n[i],e.name,t);else if(t==null)for(i in n)n[i]=kM(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Tm(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function L6e(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function kM(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=N6e,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var $w="http://www.w3.org/1999/xhtml";const EM={svg:"http://www.w3.org/2000/svg",xhtml:$w,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function G1(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),EM.hasOwnProperty(t)?{space:EM[t],local:e}:e}function P6e(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$w&&t.documentElement.namespaceURI===$w?t.createElement(e):t.createElementNS(n,e)}}function O6e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yz(e){var t=G1(e);return(t.local?O6e:P6e)(t)}function I6e(){}function $5(e){return e==null?I6e:function(){return this.querySelector(e)}}function $6e(e){typeof e!="function"&&(e=$5(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,u,h=0;h<a;++h)(l=s[h])&&(u=e.call(l,l.__data__,h,s))&&("__data__"in l&&(u.__data__=l.__data__),o[h]=u);return new Or(r,this._parents)}function B6e(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function F6e(){return[]}function bz(e){return e==null?F6e:function(){return this.querySelectorAll(e)}}function z6e(e){return function(){return B6e(e.apply(this,arguments))}}function H6e(e){typeof e=="function"?e=z6e(e):e=bz(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,u=0;u<o;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new Or(r,i)}function _z(e){return function(){return this.matches(e)}}function wz(e){return function(t){return t.matches(e)}}var W6e=Array.prototype.find;function U6e(e){return function(){return W6e.call(this.children,e)}}function V6e(){return this.firstElementChild}function q6e(e){return this.select(e==null?V6e:U6e(typeof e=="function"?e:wz(e)))}var G6e=Array.prototype.filter;function K6e(){return Array.from(this.children)}function Y6e(e){return function(){return G6e.call(this.children,e)}}function X6e(e){return this.selectAll(e==null?K6e:Y6e(typeof e=="function"?e:wz(e)))}function J6e(e){typeof e!="function"&&(e=_z(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&o.push(l);return new Or(r,this._parents)}function Sz(e){return new Array(e.length)}function Q6e(){return new Or(this._enter||this._groups.map(Sz),this._parents)}function pv(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}pv.prototype={constructor:pv,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Z6e(e){return function(){return e}}function eNe(e,t,n,r,i,s){for(var a=0,o,l=t.length,u=s.length;a<u;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new pv(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function tNe(e,t,n,r,i,s,a){var o,l,u=new Map,h=t.length,d=s.length,f=new Array(h),g;for(o=0;o<h;++o)(l=t[o])&&(f[o]=g=a.call(l,l.__data__,o,t)+"",u.has(g)?i[o]=l:u.set(g,l));for(o=0;o<d;++o)g=a.call(e,s[o],o,s)+"",(l=u.get(g))?(r[o]=l,l.__data__=s[o],u.delete(g)):n[o]=new pv(e,s[o]);for(o=0;o<h;++o)(l=t[o])&&u.get(f[o])===l&&(i[o]=l)}function nNe(e){return e.__data__}function rNe(e,t){if(!arguments.length)return Array.from(this,nNe);var n=t?tNe:eNe,r=this._parents,i=this._groups;typeof e!="function"&&(e=Z6e(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),u=0;u<s;++u){var h=r[u],d=i[u],f=d.length,g=iNe(e.call(h,h&&h.__data__,u,r)),b=g.length,x=o[u]=new Array(b),v=a[u]=new Array(b),m=l[u]=new Array(f);n(h,d,x,v,m,g,t);for(var p=0,y=0,_,C;p<b;++p)if(_=x[p]){for(p>=y&&(y=p+1);!(C=v[y])&&++y<b;);_._next=C||null}}return a=new Or(a,r),a._enter=o,a._exit=l,a}function iNe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sNe(){return new Or(this._exit||this._groups.map(Sz),this._parents)}function oNe(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function aNe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var u=n[l],h=r[l],d=u.length,f=o[l]=new Array(d),g,b=0;b<d;++b)(g=u[b]||h[b])&&(f[b]=g);for(;l<i;++l)o[l]=n[l];return new Or(o,this._parents)}function lNe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function cNe(e){e||(e=uNe);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),u,h=0;h<o;++h)(u=a[h])&&(l[h]=u);l.sort(t)}return new Or(i,this._parents).order()}function uNe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dNe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function hNe(){return Array.from(this)}function fNe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function pNe(){let e=0;for(const t of this)++e;return e}function mNe(){return!this.node()}function gNe(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function vNe(e){return function(){this.removeAttribute(e)}}function xNe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yNe(e,t){return function(){this.setAttribute(e,t)}}function bNe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function _Ne(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function wNe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function SNe(e,t){var n=G1(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?xNe:vNe:typeof t=="function"?n.local?wNe:_Ne:n.local?bNe:yNe)(n,t))}function Cz(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function CNe(e){return function(){this.style.removeProperty(e)}}function kNe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ENe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function TNe(e,t,n){return arguments.length>1?this.each((t==null?CNe:typeof t=="function"?ENe:kNe)(e,t,n??"")):Hc(this.node(),e)}function Hc(e,t){return e.style.getPropertyValue(t)||Cz(e).getComputedStyle(e,null).getPropertyValue(t)}function ANe(e){return function(){delete this[e]}}function RNe(e,t){return function(){this[e]=t}}function MNe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function jNe(e,t){return arguments.length>1?this.each((t==null?ANe:typeof t=="function"?MNe:RNe)(e,t)):this.node()[e]}function kz(e){return e.trim().split(/^|\s+/)}function B5(e){return e.classList||new Ez(e)}function Ez(e){this._node=e,this._names=kz(e.getAttribute("class")||"")}Ez.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Tz(e,t){for(var n=B5(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Az(e,t){for(var n=B5(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function NNe(e){return function(){Tz(this,e)}}function DNe(e){return function(){Az(this,e)}}function LNe(e,t){return function(){(t.apply(this,arguments)?Tz:Az)(this,e)}}function PNe(e,t){var n=kz(e+"");if(arguments.length<2){for(var r=B5(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?LNe:t?NNe:DNe)(n,t))}function ONe(){this.textContent=""}function INe(e){return function(){this.textContent=e}}function $Ne(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function BNe(e){return arguments.length?this.each(e==null?ONe:(typeof e=="function"?$Ne:INe)(e)):this.node().textContent}function FNe(){this.innerHTML=""}function zNe(e){return function(){this.innerHTML=e}}function HNe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function WNe(e){return arguments.length?this.each(e==null?FNe:(typeof e=="function"?HNe:zNe)(e)):this.node().innerHTML}function UNe(){this.nextSibling&&this.parentNode.appendChild(this)}function VNe(){return this.each(UNe)}function qNe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function GNe(){return this.each(qNe)}function KNe(e){var t=typeof e=="function"?e:yz(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function YNe(){return null}function XNe(e,t){var n=typeof e=="function"?e:yz(e),r=t==null?YNe:typeof t=="function"?t:$5(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function JNe(){var e=this.parentNode;e&&e.removeChild(this)}function QNe(){return this.each(JNe)}function ZNe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eDe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tDe(e){return this.select(e?eDe:ZNe)}function nDe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rDe(e){return function(t){e.call(this,t,this.__data__)}}function iDe(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function sDe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function oDe(e,t,n){return function(){var r=this.__on,i,s=rDe(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function aDe(e,t,n){var r=iDe(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,u=o.length,h;l<u;++l)for(i=0,h=o[l];i<s;++i)if((a=r[i]).type===h.type&&a.name===h.name)return h.value}return}for(o=t?oDe:sDe,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function Rz(e,t,n){var r=Cz(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function lDe(e,t){return function(){return Rz(this,e,t)}}function cDe(e,t){return function(){return Rz(this,e,t.apply(this,arguments))}}function uDe(e,t){return this.each((typeof t=="function"?cDe:lDe)(e,t))}function*dDe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var Mz=[null];function Or(e,t){this._groups=e,this._parents=t}function Uf(){return new Or([[document.documentElement]],Mz)}function hDe(){return this}Or.prototype=Uf.prototype={constructor:Or,select:$6e,selectAll:H6e,selectChild:q6e,selectChildren:X6e,filter:J6e,data:rNe,enter:Q6e,exit:sNe,join:oNe,merge:aNe,selection:hDe,order:lNe,sort:cNe,call:dNe,nodes:hNe,node:fNe,size:pNe,empty:mNe,each:gNe,attr:SNe,style:TNe,property:jNe,classed:PNe,text:BNe,html:WNe,raise:VNe,lower:GNe,append:KNe,insert:XNe,remove:QNe,clone:tDe,datum:nDe,on:aDe,dispatch:uDe,[Symbol.iterator]:dDe};function nr(e){return typeof e=="string"?new Or([[document.querySelector(e)]],[document.documentElement]):new Or([[e]],Mz)}function fDe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function pi(e,t){if(e=fDe(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Bw={capture:!0,passive:!1};function Fw(e){e.preventDefault(),e.stopImmediatePropagation()}function pDe(e){var t=e.document.documentElement,n=nr(e).on("dragstart.drag",Fw,Bw);"onselectstart"in t?n.on("selectstart.drag",Fw,Bw):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function mDe(e,t){var n=e.document.documentElement,r=nr(e).on("dragstart.drag",null);t&&(r.on("click.drag",Fw,Bw),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Wc=0,Sd=0,sd=0,jz=1e3,mv,Cd,gv=0,qa=0,K1=0,Xh=typeof performance=="object"&&performance.now?performance:Date,Nz=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function F5(){return qa||(Nz(gDe),qa=Xh.now()+K1)}function gDe(){qa=0}function vv(){this._call=this._time=this._next=null}vv.prototype=Dz.prototype={constructor:vv,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?F5():+n)+(t==null?0:+t),!this._next&&Cd!==this&&(Cd?Cd._next=this:mv=this,Cd=this),this._call=e,this._time=n,zw()},stop:function(){this._call&&(this._call=null,this._time=1/0,zw())}};function Dz(e,t,n){var r=new vv;return r.restart(e,t,n),r}function vDe(){F5(),++Wc;for(var e=mv,t;e;)(t=qa-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Wc}function TM(){qa=(gv=Xh.now())+K1,Wc=Sd=0;try{vDe()}finally{Wc=0,yDe(),qa=0}}function xDe(){var e=Xh.now(),t=e-gv;t>jz&&(K1-=t,gv=e)}function yDe(){for(var e,t=mv,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:mv=n);Cd=e,zw(r)}function zw(e){if(!Wc){Sd&&(Sd=clearTimeout(Sd));var t=e-qa;t>24?(e<1/0&&(Sd=setTimeout(TM,e-Xh.now()-K1)),sd&&(sd=clearInterval(sd))):(sd||(gv=Xh.now(),sd=setInterval(xDe,jz)),Wc=1,Nz(TM))}}function AM(e,t,n){var r=new vv;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var bDe=I5("start","end","cancel","interrupt"),_De=[],Lz=0,RM=1,Hw=2,Am=3,MM=4,Ww=5,Rm=6;function Y1(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;wDe(e,n,{name:t,index:r,group:i,on:bDe,tween:_De,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Lz})}function z5(e,t){var n=Li(e,t);if(n.state>Lz)throw new Error("too late; already scheduled");return n}function cs(e,t){var n=Li(e,t);if(n.state>Am)throw new Error("too late; already running");return n}function Li(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function wDe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Dz(s,0,n.time);function s(u){n.state=RM,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var h,d,f,g;if(n.state!==RM)return l();for(h in r)if(g=r[h],g.name===n.name){if(g.state===Am)return AM(a);g.state===MM?(g.state=Rm,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[h]):+h<t&&(g.state=Rm,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[h])}if(AM(function(){n.state===Am&&(n.state=MM,n.timer.restart(o,n.delay,n.time),o(u))}),n.state=Hw,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Hw){for(n.state=Am,i=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(g=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function o(u){for(var h=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Ww,1),d=-1,f=i.length;++d<f;)i[d].call(e,h);n.state===Ww&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Rm,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Mm(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Hw&&r.state<Ww,r.state=Rm,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function SDe(e){return this.each(function(){Mm(this,e)})}function CDe(e,t){var n,r;return function(){var i=cs(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function kDe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=cs(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=o;break}l===u&&i.push(o)}s.tween=i}}function EDe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Li(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?CDe:kDe)(n,e,t))}function H5(e,t,n){var r=e._id;return e.each(function(){var i=cs(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Li(i,r).value[t]}}function Pz(e,t){var n;return(typeof t=="number"?vi:t instanceof Is?ev:(n=Is(t))?(t=n,ev):Yk)(e,t)}function TDe(e){return function(){this.removeAttribute(e)}}function ADe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function RDe(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function MDe(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function jDe(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function NDe(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function DDe(e,t){var n=G1(e),r=n==="transform"?xwe:Pz;return this.attrTween(e,typeof t=="function"?(n.local?NDe:jDe)(n,r,H5(this,"attr."+e,t)):t==null?(n.local?ADe:TDe)(n):(n.local?MDe:RDe)(n,r,t))}function LDe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function PDe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ODe(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&PDe(e,s)),n}return i._value=t,i}function IDe(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&LDe(e,s)),n}return i._value=t,i}function $De(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=G1(e);return this.tween(n,(r.local?ODe:IDe)(r,t))}function BDe(e,t){return function(){z5(this,e).delay=+t.apply(this,arguments)}}function FDe(e,t){return t=+t,function(){z5(this,e).delay=t}}function zDe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?BDe:FDe)(t,e)):Li(this.node(),t).delay}function HDe(e,t){return function(){cs(this,e).duration=+t.apply(this,arguments)}}function WDe(e,t){return t=+t,function(){cs(this,e).duration=t}}function UDe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?HDe:WDe)(t,e)):Li(this.node(),t).duration}function VDe(e,t){if(typeof t!="function")throw new Error;return function(){cs(this,e).ease=t}}function qDe(e){var t=this._id;return arguments.length?this.each(VDe(t,e)):Li(this.node(),t).ease}function GDe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;cs(this,e).ease=n}}function KDe(e){if(typeof e!="function")throw new Error;return this.each(GDe(this._id,e))}function YDe(e){typeof e!="function"&&(e=_z(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&o.push(l);return new Bs(r,this._parents,this._name,this._id)}function XDe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],u=n[o],h=l.length,d=a[o]=new Array(h),f,g=0;g<h;++g)(f=l[g]||u[g])&&(d[g]=f);for(;o<r;++o)a[o]=t[o];return new Bs(a,this._parents,this._name,this._id)}function JDe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function QDe(e,t,n){var r,i,s=JDe(t)?z5:cs;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function ZDe(e,t){var n=this._id;return arguments.length<2?Li(this.node(),n).on.on(e):this.each(QDe(n,e,t))}function eLe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function tLe(){return this.on("end.remove",eLe(this._id))}function nLe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$5(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,u=s[a]=new Array(l),h,d,f=0;f<l;++f)(h=o[f])&&(d=e.call(h,h.__data__,f,o))&&("__data__"in h&&(d.__data__=h.__data__),u[f]=d,Y1(u[f],t,n,f,u,Li(h,n)));return new Bs(s,this._parents,t,n)}function rLe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bz(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],u=l.length,h,d=0;d<u;++d)if(h=l[d]){for(var f=e.call(h,h.__data__,d,l),g,b=Li(h,n),x=0,v=f.length;x<v;++x)(g=f[x])&&Y1(g,t,n,x,f,b);s.push(f),a.push(h)}return new Bs(s,a,t,n)}var iLe=Uf.prototype.constructor;function sLe(){return new iLe(this._groups,this._parents)}function oLe(e,t){var n,r,i;return function(){var s=Hc(this,e),a=(this.style.removeProperty(e),Hc(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Oz(e){return function(){this.style.removeProperty(e)}}function aLe(e,t,n){var r,i=n+"",s;return function(){var a=Hc(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function lLe(e,t,n){var r,i,s;return function(){var a=Hc(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Hc(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function cLe(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=cs(this,e),u=l.on,h=l.value[s]==null?o||(o=Oz(t)):void 0;(u!==n||i!==h)&&(r=(n=u).copy()).on(a,i=h),l.on=r}}function uLe(e,t,n){var r=(e+="")=="transform"?vwe:Pz;return t==null?this.styleTween(e,oLe(e,r)).on("end.style."+e,Oz(e)):typeof t=="function"?this.styleTween(e,lLe(e,r,H5(this,"style."+e,t))).each(cLe(this._id,e)):this.styleTween(e,aLe(e,r,t),n).on("end.style."+e,null)}function dLe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function hLe(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&dLe(e,a,n)),r}return s._value=t,s}function fLe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,hLe(e,t,n??""))}function pLe(e){return function(){this.textContent=e}}function mLe(e){return function(){var t=e(this);this.textContent=t??""}}function gLe(e){return this.tween("text",typeof e=="function"?mLe(H5(this,"text",e)):pLe(e==null?"":e+""))}function vLe(e){return function(t){this.textContent=e.call(this,t)}}function xLe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&vLe(i)),t}return r._value=e,r}function yLe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,xLe(e))}function bLe(){for(var e=this._name,t=this._id,n=Iz(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,u=0;u<o;++u)if(l=a[u]){var h=Li(l,t);Y1(l,e,n,u,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Bs(r,this._parents,e,n)}function _Le(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var u=cs(this,r),h=u.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),u.on=t}),i===0&&s()})}var wLe=0;function Bs(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Iz(){return++wLe}var fs=Uf.prototype;Bs.prototype={constructor:Bs,select:nLe,selectAll:rLe,selectChild:fs.selectChild,selectChildren:fs.selectChildren,filter:YDe,merge:XDe,selection:sLe,transition:bLe,call:fs.call,nodes:fs.nodes,node:fs.node,size:fs.size,empty:fs.empty,each:fs.each,on:ZDe,attr:DDe,attrTween:$De,style:uLe,styleTween:fLe,text:gLe,textTween:yLe,remove:tLe,tween:EDe,delay:zDe,duration:UDe,ease:qDe,easeVarying:KDe,end:_Le,[Symbol.iterator]:fs[Symbol.iterator]};function SLe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var CLe={time:null,delay:0,duration:250,ease:SLe};function kLe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function ELe(e){var t,n;e instanceof Bs?(t=e._id,e=e._name):(t=Iz(),(n=CLe).time=F5(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,u=0;u<o;++u)(l=a[u])&&Y1(l,e,t,u,a,n||kLe(l,t));return new Bs(r,this._parents,e,t)}Uf.prototype.interrupt=SDe;Uf.prototype.transition=ELe;const qp=e=>()=>e;function TLe(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Es(e,t,n){this.k=e,this.x=t,this.y=n}Es.prototype={constructor:Es,scale:function(e){return e===1?this:new Es(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Es(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $z=new Es(1,0,0);Es.prototype;function Yy(e){e.stopImmediatePropagation()}function od(e){e.preventDefault(),e.stopImmediatePropagation()}function ALe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function RLe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function jM(){return this.__zoom||$z}function MLe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function jLe(){return navigator.maxTouchPoints||"ontouchstart"in this}function NLe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function DLe(){var e=ALe,t=RLe,n=NLe,r=MLe,i=jLe,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=wwe,u=I5("start","zoom","end"),h,d,f,g=500,b=150,x=0,v=10;function m(N){N.property("__zoom",jM).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",A).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(N,O,B,z){var P=N.selection?N.selection():N;P.property("__zoom",jM),N!==P?C(N,O,B,z):P.interrupt().each(function(){S(this,arguments).event(z).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},m.scaleBy=function(N,O,B,z){m.scaleTo(N,function(){var P=this.__zoom.k,j=typeof O=="function"?O.apply(this,arguments):O;return P*j},B,z)},m.scaleTo=function(N,O,B,z){m.transform(N,function(){var P=t.apply(this,arguments),j=this.__zoom,R=B==null?_(P):typeof B=="function"?B.apply(this,arguments):B,I=j.invert(R),H=typeof O=="function"?O.apply(this,arguments):O;return n(y(p(j,H),R,I),P,a)},B,z)},m.translateBy=function(N,O,B,z){m.transform(N,function(){return n(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof B=="function"?B.apply(this,arguments):B),t.apply(this,arguments),a)},null,z)},m.translateTo=function(N,O,B,z,P){m.transform(N,function(){var j=t.apply(this,arguments),R=this.__zoom,I=z==null?_(j):typeof z=="function"?z.apply(this,arguments):z;return n($z.translate(I[0],I[1]).scale(R.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof B=="function"?-B.apply(this,arguments):-B),j,a)},z,P)};function p(N,O){return O=Math.max(s[0],Math.min(s[1],O)),O===N.k?N:new Es(O,N.x,N.y)}function y(N,O,B){var z=O[0]-B[0]*N.k,P=O[1]-B[1]*N.k;return z===N.x&&P===N.y?N:new Es(N.k,z,P)}function _(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function C(N,O,B,z){N.on("start.zoom",function(){S(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(z).end()}).tween("zoom",function(){var P=this,j=arguments,R=S(P,j).event(z),I=t.apply(P,j),H=B==null?_(I):typeof B=="function"?B.apply(P,j):B,F=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),G=P.__zoom,Z=typeof O=="function"?O.apply(P,j):O,J=l(G.invert(H).concat(F/G.k),Z.invert(H).concat(F/Z.k));return function(W){if(W===1)W=Z;else{var $=J(W),V=F/$[2];W=new Es(V,H[0]-$[0]*V,H[1]-$[1]*V)}R.zoom(null,W)}})}function S(N,O,B){return!B&&N.__zooming||new E(N,O)}function E(N,O){this.that=N,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,O),this.taps=0}E.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,O){return this.mouse&&N!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var O=nr(this.that).datum();u.call(N,this.that,new TLe(N,{sourceEvent:this.sourceEvent,target:m,type:N,transform:this.that.__zoom,dispatch:u}),O)}};function k(N,...O){if(!e.apply(this,arguments))return;var B=S(this,O).event(N),z=this.__zoom,P=Math.max(s[0],Math.min(s[1],z.k*Math.pow(2,r.apply(this,arguments)))),j=pi(N);if(B.wheel)(B.mouse[0][0]!==j[0]||B.mouse[0][1]!==j[1])&&(B.mouse[1]=z.invert(B.mouse[0]=j)),clearTimeout(B.wheel);else{if(z.k===P)return;B.mouse=[j,z.invert(j)],Mm(this),B.start()}od(N),B.wheel=setTimeout(R,b),B.zoom("mouse",n(y(p(z,P),B.mouse[0],B.mouse[1]),B.extent,a));function R(){B.wheel=null,B.end()}}function T(N,...O){if(f||!e.apply(this,arguments))return;var B=N.currentTarget,z=S(this,O,!0).event(N),P=nr(N.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",F,!0),j=pi(N,B),R=N.clientX,I=N.clientY;pDe(N.view),Yy(N),z.mouse=[j,this.__zoom.invert(j)],Mm(this),z.start();function H(G){if(od(G),!z.moved){var Z=G.clientX-R,J=G.clientY-I;z.moved=Z*Z+J*J>x}z.event(G).zoom("mouse",n(y(z.that.__zoom,z.mouse[0]=pi(G,B),z.mouse[1]),z.extent,a))}function F(G){P.on("mousemove.zoom mouseup.zoom",null),mDe(G.view,z.moved),od(G),z.event(G).end()}}function A(N,...O){if(e.apply(this,arguments)){var B=this.__zoom,z=pi(N.changedTouches?N.changedTouches[0]:N,this),P=B.invert(z),j=B.k*(N.shiftKey?.5:2),R=n(y(p(B,j),z,P),t.apply(this,O),a);od(N),o>0?nr(this).transition().duration(o).call(C,R,z,N):nr(this).call(m.transform,R,z,N)}}function M(N,...O){if(e.apply(this,arguments)){var B=N.touches,z=B.length,P=S(this,O,N.changedTouches.length===z).event(N),j,R,I,H;for(Yy(N),R=0;R<z;++R)I=B[R],H=pi(I,this),H=[H,this.__zoom.invert(H),I.identifier],P.touch0?!P.touch1&&P.touch0[2]!==H[2]&&(P.touch1=H,P.taps=0):(P.touch0=H,j=!0,P.taps=1+!!h);h&&(h=clearTimeout(h)),j&&(P.taps<2&&(d=H[0],h=setTimeout(function(){h=null},g)),Mm(this),P.start())}}function D(N,...O){if(this.__zooming){var B=S(this,O).event(N),z=N.changedTouches,P=z.length,j,R,I,H;for(od(N),j=0;j<P;++j)R=z[j],I=pi(R,this),B.touch0&&B.touch0[2]===R.identifier?B.touch0[0]=I:B.touch1&&B.touch1[2]===R.identifier&&(B.touch1[0]=I);if(R=B.that.__zoom,B.touch1){var F=B.touch0[0],G=B.touch0[1],Z=B.touch1[0],J=B.touch1[1],W=(W=Z[0]-F[0])*W+(W=Z[1]-F[1])*W,$=($=J[0]-G[0])*$+($=J[1]-G[1])*$;R=p(R,Math.sqrt(W/$)),I=[(F[0]+Z[0])/2,(F[1]+Z[1])/2],H=[(G[0]+J[0])/2,(G[1]+J[1])/2]}else if(B.touch0)I=B.touch0[0],H=B.touch0[1];else return;B.zoom("touch",n(y(R,I,H),B.extent,a))}}function L(N,...O){if(this.__zooming){var B=S(this,O).event(N),z=N.changedTouches,P=z.length,j,R;for(Yy(N),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),j=0;j<P;++j)R=z[j],B.touch0&&B.touch0[2]===R.identifier?delete B.touch0:B.touch1&&B.touch1[2]===R.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(R=pi(R,this),Math.hypot(d[0]-R[0],d[1]-R[1])<v)){var I=nr(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return m.wheelDelta=function(N){return arguments.length?(r=typeof N=="function"?N:qp(+N),m):r},m.filter=function(N){return arguments.length?(e=typeof N=="function"?N:qp(!!N),m):e},m.touchable=function(N){return arguments.length?(i=typeof N=="function"?N:qp(!!N),m):i},m.extent=function(N){return arguments.length?(t=typeof N=="function"?N:qp([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),m):t},m.scaleExtent=function(N){return arguments.length?(s[0]=+N[0],s[1]=+N[1],m):[s[0],s[1]]},m.translateExtent=function(N){return arguments.length?(a[0][0]=+N[0][0],a[1][0]=+N[1][0],a[0][1]=+N[0][1],a[1][1]=+N[1][1],m):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},m.constrain=function(N){return arguments.length?(n=N,m):n},m.duration=function(N){return arguments.length?(o=+N,m):o},m.interpolate=function(N){return arguments.length?(l=N,m):l},m.on=function(){var N=u.on.apply(u,arguments);return N===u?m:N},m.clickDistance=function(N){return arguments.length?(x=(N=+N)*N,m):Math.sqrt(x)},m.tapDistance=function(N){return arguments.length?(v=+N,m):v},m}const LLe=(e,t)=>{let n;for(const r of e)if(r==="+Inf"){if(n!==void 0&&n<t)return;break}else typeof r!="string"&&r<=t&&(n=r);return typeof n=="number"?n:void 0},jm=e=>e==="+Inf"?"+Inf":typeof e=="string"?"???":e<0?"<0 ms":e===0?"0 ms":e<.001?"<1 ms":e>=.001&&e<1?`${(e*1e3).toFixed(0)} ms`:e<10?`${e.toFixed(2)} s`:e<100?`${e.toFixed(1)} s`:`${e.toFixed(0)} s`,Bz=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n-1]??0;if(typeof r!="number")throw new Error(`Invalid prev value: ${r}`);if(e.length>=2&&n===e.length-1){t.push(r*1.25);break}const i=e[n];if(typeof i!="number")throw new Error(`Invalid current value: ${i}`);t.push((r+i)/2)}return t},Fz=(e,t)=>{if(e.length!==t.length)throw new Error("Invalid bucket count");let n=0;const r=[];for(let i=0;i<t.length;i++){const a=(typeof e[i]=="number"?e[i]:0)*t[i];r.push(a),n+=a}return r.map(i=>i/n)},PLe=60*1e3,OLe=15*60*1e3,Nl=()=>({bootDuration:void 0,closeReason:void 0,log:[]}),ILe=(e,t)=>{var a,o;let n,r,i=[],s=Nl();for(const l of e){s===void 0&&(s=Nl());const u=(a=s==null?void 0:s.log)==null?void 0:a.length;if(l.type==="svBoot")u&&(i.push(s),s=Nl()),s.bootTime=new Date(l.ts),s.bootDuration=l.duration;else if(l.type==="svClose")u&&(s.closeTime=new Date(l.ts),s.closeReason=l.reason,i.push(s),s=Nl());else if(l.type==="data"){const h=l.ts-OLe,d=u?s.log.at(-1):void 0;let f=l.ts-PLe;if(d){const x=d.end.getTime();x>=h?f=x:(i.push(s),s=Nl())}else if(s.bootTime){const x=s.bootTime.getTime();x>=h?f=x:s=Nl()}const g=new Date(f),b=new Date(l.ts);n||(n=g),r=b,s.log.push({start:g,end:b,players:l.players,fxsMemory:l.fxsMemory,nodeMemory:l.nodeMemory,weightedPerf:t(l.perf)})}}return(o=s==null?void 0:s.log)!=null&&o.length&&i.push(s),i=i.filter(l=>l.log.length),n&&r&&i.length?{dataStart:n,dataEnd:r,lifespans:i}:void 0},$Le=(e,t,n)=>{const r=t*60*60*1e3,i=n-r;let s=0;const a=[];for(const o of e)if(!(!o.log.length||o.log.at(-1).end.getTime()<i))for(const u of o.log)a.push(u.players),!(u.end.getTime()<i)&&(u.start.getTime()<i?s+=u.end.getTime()-i:s+=u.end.getTime()-u.start.getTime());return{uptimePct:n?Math.min(100,s/r*100):void 0,medianPlayerCount:Uwe(a,.5)??0}};function BLe({delay:e,onDebouncedResize:t,children:n}){const r=w.useRef(null),i=w.useRef(null),s=w.useRef(null),a=w.useRef({width:0,height:0});e===void 0&&(e=250);const o=()=>{if(!r.current||!r.current.parentNode)return;const u={width:r.current.clientWidth,height:r.current.clientHeight};a.current=u,t(u),s.current.style.visibility="visible",i.current.style.visibility="hidden"},l=w.useCallback(hS(e,o,{atBegin:!1}),[r]);return w.useEffect(()=>{if(!r.current)return;const u=new ResizeObserver(()=>{const h=r.current.clientHeight,d=r.current.clientWidth;h===0||d===0||a.current.width===d&&a.current.height===h||(a.current.width===0||a.current.height===0?o():(l(),s.current.style.visibility="hidden",i.current.style.visibility="visible"))});return u.observe(r.current),o(),()=>u.disconnect()},[r]),c.jsxs("div",{ref:r,style:{height:"100%",width:"100%",position:"relative"},children:[c.jsx("div",{ref:i,className:"absolute inset-0 flex items-center justify-center",children:c.jsx(qt,{className:"animate-spin size-16 text-muted-foreground"})}),c.jsx("div",{className:"absolute inset-0",ref:s,children:n})]})}const Jh=w.memo(BLe),FLe={svMain:1e3/20/1e3,svNetwork:1e3/40/1e3,svSync:1e3/40/1e3},zLe=w.memo(({data:e,minTickIntervalMarker:t,width:n,height:r})=>{const i=cu(),s=a=>{var h;const o=((h=e.find((d,f)=>f===a.index-1))==null?void 0:h.bucket)??0,l=a.data.bucket,u=(a.value*100).toFixed()+"%";return c.jsxs("div",{className:"p-3 text-gray-900 bg-white rounded-md shadow-md",children:[c.jsxs("div",{children:["Tick duration: ",c.jsx("strong",{children:jm(o)})," ~ ",c.jsx("strong",{children:jm(l)})]}),c.jsxs("div",{children:["Time spent: ",c.jsxs("strong",{children:["~",u]})]}),c.jsxs("div",{children:["Tick count: ",a.data.count]})]})};return t=void 0,!n||!r?null:c.jsx(_6e,{height:r,width:n,data:e,theme:{tooltip:{wrapper:{zIndex:1e4}},text:{fontSize:"12px",fontWeight:600,fill:"inherit"},grid:{line:{strokeDasharray:"8 6",stroke:"#3F4146",strokeOpacity:i?1:.25,strokeWidth:1}}},indexBy:"bucket",margin:{top:0,right:25,bottom:40,left:60},layout:"horizontal",valueFormat:".1%",colors:{datum:"data.color"},colorBy:"indexValue",borderWidth:.5,borderColor:i?void 0:{from:"color",modifiers:[["darker",1]]},axisBottom:{format:".0%",legend:"percent of total time",legendPosition:"middle",legendOffset:32},axisLeft:{format:jm},enableGridX:!0,enableGridY:!1,labelSkipWidth:25,labelSkipHeight:12,labelTextColor:{from:"color",modifiers:[["darker",1.6]]},tooltip:s,markers:t?[{axis:"y",value:t,lineStyle:{stroke:"black",opacity:.5,strokeWidth:4,strokeDasharray:"6 2",strokeDashoffset:1},legend:"good",legendPosition:"bottom-right",legendOffsetX:10,legendOffsetY:12,legendOrientation:"horizontal",textStyle:{fontSize:"16px",opacity:.5}},{axis:"y",value:t,lineStyle:{stroke:"white",opacity:.55,strokeWidth:2,strokeDasharray:"4 4"},legend:"bad",legendPosition:"top-right",legendOffsetX:10,legendOffsetY:12,legendOrientation:"horizontal",textStyle:{fontSize:"16px",opacity:.5}}]:void 0})});function HLe(){const[e,t]=w.useState({width:0,height:0}),[n,r]=w.useState("svMain"),i=nt(Uv),s=nt(Vv),a=mS(),o=w.useMemo(()=>{if(!i||a().isExpired)return null;if(!i.perfBoundaries||!i.perfBucketCounts)return"incomplete";const d=s?s.threadName:n??"svMain",{perfBoundaries:f,perfBucketCounts:g}=i,b=FLe[d],x=LLe(f,b),v=f.findIndex(C=>C===x);let m;v?m=C=>{const S=v+1;return C<=v?VB(1.1-C/S):qB(.25+(C-S)/(f.length-S))}:m=C=>UB(1-(C+1)/f.length);const p=g[d];let y;if(s)y=s.snap.weightedPerf;else{const C=Bz(f);y=Fz(p,C)}const _=[];for(let C=0;C<f.length;C++)_.push({bucket:f[C],count:s?0:p[C],value:y[C],color:m(C+1)});return{threadName:d,data:_,minTickIntervalMarker:x,perfBoundaries:f}},[i,s,n]),l=w.useMemo(()=>{const d=a();if(!i||d.isExpired||!i.perfBoundaries||!i.perfBucketCounts)return null;if(s){const f=Rc(s.snap.end,"2-digit","2-digit"),g=Mc(s.snap.end,"short"),b=vh(s.snap.end)?f:`${f} - ${g}`;return c.jsxs(c.Fragment,{children:["(",c.jsx("span",{className:"text-xs text-warning-inline font-mono",children:b}),")"]})}else return d.isStale?"(minutes ago)":"(last minute)"},[i,s]);let u,h=null;return typeof o=="object"&&o!==null?(u=o.threadName,h=c.jsx(zLe,{...o,width:e.width,height:e.height})):typeof o=="string"?h=c.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:c.jsxs("p",{className:"max-w-80",children:["Data not yet available. ",c.jsx("br",{}),"The thread performance chart will appear soon after the server is online."]})}):h=c.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:c.jsx(qt,{className:"animate-spin size-16 text-muted-foreground"})}),c.jsxs("div",{className:"py-2 md:rounded-xl border bg-card shadow-sm flex flex-col col-span-3 fill-primary h-[20rem] max-h-[20rem]",children:[c.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[c.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:[u??n," performance ",l]}),c.jsxs("div",{className:"flex gap-4",children:[c.jsxs(gn,{defaultValue:n,onValueChange:r,disabled:!!s,children:[c.jsx(un,{className:Y("w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",!!s&&"hidden"),children:c.jsx(vn,{placeholder:"Filter by admin"})}),c.jsxs(dn,{className:"px-0",children:[c.jsx(ye,{value:"svMain",className:"cursor-pointer",children:"svMain"}),c.jsx(ye,{value:"svSync",className:"cursor-pointer",children:"svSync"}),c.jsx(ye,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),c.jsx("div",{className:"hidden xs:block",children:c.jsx(rX,{})})]})]}),c.jsx(Jh,{onDebouncedResize:t,children:h})]})}function Ot(){return Ot=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},Ot.apply(this,arguments)}var WLe={pointerEvents:"none"},ULe=function(e){var t=e.label,n=e.style,r=Gt();return c.jsx(Tt.g,{transform:n.transform,opacity:n.progress,style:WLe,children:c.jsx(Tt.text,{textAnchor:"middle",dominantBaseline:"central",style:Ot({},r.labels.text,{fill:n.textColor}),children:t})})},zz=function(e){var t=e%(2*Math.PI);return t<0&&(t+=2*Math.PI),t},VLe=function(e,t){return e.filter(function(n){return Math.abs(U1(n.arc.endAngle-n.arc.startAngle))>=t})},qLe={startAngle:{enter:function(e){return Ot({},e,{endAngle:e.startAngle})},update:function(e){return e},leave:function(e){return Ot({},e,{startAngle:e.endAngle})}},middleAngle:{enter:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return Ot({},e,{startAngle:t,endAngle:t})},update:function(e){return e},leave:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return Ot({},e,{startAngle:t,endAngle:t})}},endAngle:{enter:function(e){return Ot({},e,{startAngle:e.endAngle})},update:function(e){return e},leave:function(e){return Ot({},e,{endAngle:e.startAngle})}},innerRadius:{enter:function(e){return Ot({},e,{outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return Ot({},e,{innerRadius:e.outerRadius})}},centerRadius:{enter:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return Ot({},e,{innerRadius:t,outerRadius:t})},update:function(e){return e},leave:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return Ot({},e,{innerRadius:t,outerRadius:t})}},outerRadius:{enter:function(e){return Ot({},e,{innerRadius:e.outerRadius})},update:function(e){return e},leave:function(e){return Ot({},e,{outerRadius:e.innerRadius})}},pushIn:{enter:function(e){return Ot({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return Ot({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})}},pushOut:{enter:function(e){return Ot({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})},update:function(e){return e},leave:function(e){return Ot({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})}}},Hz=function(e,t){return w.useMemo(function(){var n=qLe[e];return{enter:function(r){return Ot({progress:0},n.enter(r.arc),t?t.enter(r):{})},update:function(r){return Ot({progress:1},n.update(r.arc),t?t.update(r):{})},leave:function(r){return Ot({progress:0},n.leave(r.arc),t?t.leave(r):{})}}},[e,t])},GLe=function(e,t){var n=D3e(e)-Math.PI/2,r=e.innerRadius+(e.outerRadius-e.innerRadius)*t;return Ta(n,r)},KLe=function(e){return function(t,n,r,i){return Ho([t,n,r,i],function(s,a,o,l){var u=GLe({startAngle:s,endAngle:a,innerRadius:o,outerRadius:l},e);return"translate("+u.x+","+u.y+")"})}},YLe=function(e,t,n,r){t===void 0&&(t=.5),n===void 0&&(n="innerRadius");var i=Cr(),s=i.animate,a=i.config,o=Hz(n,r);return{transition:al(e,{keys:function(l){return l.id},initial:o.update,from:o.enter,enter:o.update,update:o.update,leave:o.leave,config:a,immediate:!s}),interpolate:KLe(t)}},XLe=function(e){var t=e.center,n=e.data,r=e.transitionMode,i=e.label,s=e.radiusOffset,a=e.skipAngle,o=e.textColor,l=e.component,u=l===void 0?ULe:l,h=Aa(i),d=Gt(),f=zc(o,d),g=w.useMemo(function(){return n.filter(function(p){return Math.abs(U1(p.arc.endAngle-p.arc.startAngle))>=a})},[n,a]),b=YLe(g,s,r),x=b.transition,v=b.interpolate,m=u;return c.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:x(function(p,y){return w.createElement(m,{key:y.id,datum:y,label:h(y),style:Ot({},p,{transform:v(p.startAngle,p.endAngle,p.innerRadius,p.outerRadius),textColor:f(y)})})})})},JLe=function(e){var t=e.label,n=e.style,r=Gt();return c.jsxs(Tt.g,{opacity:n.opacity,children:[c.jsx(Tt.path,{fill:"none",stroke:n.linkColor,strokeWidth:n.thickness,d:n.path}),c.jsx(Tt.text,{transform:n.textPosition,textAnchor:n.textAnchor,dominantBaseline:"central",style:Ot({},r.labels.text,{fill:n.textColor}),children:t})]})},QLe=function(e){var t=zz(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2);return t<Math.PI/2||t>1.5*Math.PI?"start":"end"},Wz=function(e,t,n,r){var i,s,a=zz(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2),o=Ta(a,e.outerRadius+t),l=Ta(a,e.outerRadius+t+n);return a<Math.PI/2||a>1.5*Math.PI?(i="after",s={x:l.x+r,y:l.y}):(i="before",s={x:l.x-r,y:l.y}),{side:i,points:[o,l,s]}},ZLe=nF().x(function(e){return e.x}).y(function(e){return e.y}),e8e=function(e,t,n,r,i,s,a){return Ho([e,t,n,r,i,s,a],function(o,l,u,h,d,f,g){var b=Wz({startAngle:o,endAngle:l,innerRadius:u,outerRadius:h},d,f,g).points;return ZLe(b)})},t8e=function(e,t,n,r){return Ho([e,t,n,r],function(i,s,a,o){return QLe({startAngle:i,endAngle:s,innerRadius:a,outerRadius:o})})},n8e=function(e,t,n,r,i,s,a,o){return Ho([e,t,n,r,i,s,a,o],function(l,u,h,d,f,g,b,x){var v=Wz({startAngle:l,endAngle:u,innerRadius:h,outerRadius:d},f,g,b),m=v.points,p=v.side,y=m[2];return p==="before"?y.x-=x:y.x+=x,"translate("+y.x+","+y.y+")"})},r8e=function(e){var t=e.data,n=e.offset,r=n===void 0?0:n,i=e.diagonalLength,s=e.straightLength,a=e.skipAngle,o=a===void 0?0:a,l=e.textOffset,u=e.linkColor,h=e.textColor,d=Cr(),f=d.animate,g=d.config,b=Gt(),x=zc(u,b),v=zc(h,b),m=function(y,_){return w.useMemo(function(){return VLe(y,_)},[y,_])}(t,o),p=function(y){var _=y.offset,C=y.diagonalLength,S=y.straightLength,E=y.textOffset,k=y.getLinkColor,T=y.getTextColor;return w.useMemo(function(){return{enter:function(A){return{startAngle:A.arc.startAngle,endAngle:A.arc.endAngle,innerRadius:A.arc.innerRadius,outerRadius:A.arc.outerRadius,offset:_,diagonalLength:0,straightLength:0,textOffset:E,linkColor:k(A),textColor:T(A),opacity:0}},update:function(A){return{startAngle:A.arc.startAngle,endAngle:A.arc.endAngle,innerRadius:A.arc.innerRadius,outerRadius:A.arc.outerRadius,offset:_,diagonalLength:C,straightLength:S,textOffset:E,linkColor:k(A),textColor:T(A),opacity:1}},leave:function(A){return{startAngle:A.arc.startAngle,endAngle:A.arc.endAngle,innerRadius:A.arc.innerRadius,outerRadius:A.arc.outerRadius,offset:_,diagonalLength:0,straightLength:0,textOffset:E,linkColor:k(A),textColor:T(A),opacity:0}}}},[C,S,E,k,T,_])}({offset:r,diagonalLength:i,straightLength:s,textOffset:l,getLinkColor:x,getTextColor:v});return{transition:al(m,{keys:function(y){return y.id},initial:p.update,from:p.enter,enter:p.update,update:p.update,leave:p.leave,config:g,immediate:!f}),interpolateLink:e8e,interpolateTextAnchor:t8e,interpolateTextPosition:n8e}},i8e=function(e){var t=e.center,n=e.data,r=e.label,i=e.skipAngle,s=e.offset,a=e.diagonalLength,o=e.straightLength,l=e.strokeWidth,u=e.textOffset,h=e.textColor,d=e.linkColor,f=e.component,g=f===void 0?JLe:f,b=Aa(r),x=r8e({data:n,skipAngle:i,offset:s,diagonalLength:a,straightLength:o,textOffset:u,linkColor:d,textColor:h}),v=x.transition,m=x.interpolateLink,p=x.interpolateTextAnchor,y=x.interpolateTextPosition,_=g;return c.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:v(function(C,S){return w.createElement(_,{key:S.id,datum:S,label:b(S),style:Ot({},C,{thickness:l,path:m(C.startAngle,C.endAngle,C.innerRadius,C.outerRadius,C.offset,C.diagonalLength,C.straightLength),textAnchor:p(C.startAngle,C.endAngle,C.innerRadius,C.outerRadius),textPosition:y(C.startAngle,C.endAngle,C.innerRadius,C.outerRadius,C.offset,C.diagonalLength,C.straightLength,C.textOffset)})})})})},s8e=function(e){var t=e.datum,n=e.style,r=e.onClick,i=e.onMouseEnter,s=e.onMouseMove,a=e.onMouseLeave,o=w.useCallback(function(d){return r==null?void 0:r(t,d)},[r,t]),l=w.useCallback(function(d){return i==null?void 0:i(t,d)},[i,t]),u=w.useCallback(function(d){return s==null?void 0:s(t,d)},[s,t]),h=w.useCallback(function(d){return a==null?void 0:a(t,d)},[a,t]);return c.jsx(Tt.path,{d:n.path,opacity:n.opacity,fill:t.fill||n.color,stroke:n.borderColor,strokeWidth:n.borderWidth,onClick:r?o:void 0,onMouseEnter:i?l:void 0,onMouseMove:s?u:void 0,onMouseLeave:a?h:void 0})},o8e=function(e,t,n,r,i){return Ho([e,t,n,r],function(s,a,o,l){return i({startAngle:s,endAngle:a,innerRadius:Math.max(0,o),outerRadius:Math.max(0,l)})})},a8e=function(e,t,n){t===void 0&&(t="innerRadius");var r=Cr(),i=r.animate,s=r.config,a=Hz(t,n);return{transition:al(e,{keys:function(o){return o.id},initial:a.update,from:a.enter,enter:a.update,update:a.update,leave:a.leave,config:s,immediate:!i}),interpolate:o8e}},l8e=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,s=e.borderColor,a=e.onClick,o=e.onMouseEnter,l=e.onMouseMove,u=e.onMouseLeave,h=e.transitionMode,d=e.component,f=d===void 0?s8e:d,g=Gt(),b=zc(s,g),x=a8e(n,h,{enter:function(y){return{opacity:0,color:y.color,borderColor:b(y)}},update:function(y){return{opacity:1,color:y.color,borderColor:b(y)}},leave:function(y){return{opacity:0,color:y.color,borderColor:b(y)}}}),v=x.transition,m=x.interpolate,p=f;return c.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:v(function(y,_){return w.createElement(p,{key:_.id,datum:_,style:Ot({},y,{borderWidth:i,path:m(y.startAngle,y.endAngle,y.innerRadius,y.outerRadius,r)}),onClick:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u})})})},c8e=function(e,t,n,r,i,s){s===void 0&&(s=!0);var a=[],o=Ta(ei(r),n);a.push([o.x,o.y]);var l=Ta(ei(i),n);a.push([l.x,l.y]);for(var u=Math.round(Math.min(r,i));u<=Math.round(Math.max(r,i));u++)if(u%90==0){var h=Ta(ei(u),n);a.push([h.x,h.y])}a=a.map(function(v){var m=v[0],p=v[1];return[e+m,t+p]}),s&&a.push([e,t]);var d=a.map(function(v){return v[0]}),f=a.map(function(v){return v[1]}),g=Math.min.apply(Math,d),b=Math.max.apply(Math,d),x=Math.min.apply(Math,f);return{points:a,x:g,y:x,width:b-g,height:Math.max.apply(Math,f)-x}},u8e=function(e){var t=e===void 0?{}:e,n=t.cornerRadius,r=n===void 0?0:n,i=t.padAngle,s=i===void 0?0:i;return w.useMemo(function(){return mke().innerRadius(function(a){return a.innerRadius}).outerRadius(function(a){return a.outerRadius}).cornerRadius(r).padAngle(s)},[r,s])};function Ga(){return Ga=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},Ga.apply(this,arguments)}function Uz(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var NM,d8e=function(e){var t=e.width,n=e.height,r=e.legends,i=e.data,s=e.toggleSerie;return c.jsx(c.Fragment,{children:r.map(function(a,o){var l;return c.jsx(dz,Ga({},a,{containerWidth:t,containerHeight:n,data:(l=a.data)!=null?l:i,toggleSerie:a.toggleSerie?s:void 0}),o)})})},Ne={id:"id",value:"value",sortByValue:!1,innerRadius:0,padAngle:0,cornerRadius:0,layers:["arcs","arcLinkLabels","arcLabels","legends"],startAngle:0,endAngle:360,fit:!0,activeInnerRadiusOffset:0,activeOuterRadiusOffset:0,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableArcLabels:!0,arcLabel:"formattedValue",arcLabelsSkipAngle:0,arcLabelsRadiusOffset:.5,arcLabelsTextColor:{theme:"labels.text.fill"},enableArcLinkLabels:!0,arcLinkLabel:"id",arcLinkLabelsSkipAngle:0,arcLinkLabelsOffset:0,arcLinkLabelsDiagonalLength:16,arcLinkLabelsStraightLength:24,arcLinkLabelsThickness:1,arcLinkLabelsTextOffset:6,arcLinkLabelsTextColor:{theme:"labels.text.fill"},arcLinkLabelsColor:{theme:"axis.ticks.line.stroke"},colors:{scheme:"nivo"},defs:[],fill:[],isInteractive:!0,animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",tooltip:function(e){var t=e.datum;return c.jsx(g$,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})},legends:[],role:"img",pixelRatio:typeof window<"u"&&(NM=window.devicePixelRatio)!=null?NM:1},h8e=["points"],f8e=function(e){var t=e.data,n=e.id,r=n===void 0?Ne.id:n,i=e.value,s=i===void 0?Ne.value:i,a=e.valueFormat,o=e.colors,l=o===void 0?Ne.colors:o,u=Aa(r),h=Aa(s),d=H1(a),f=lz(l,"id");return w.useMemo(function(){return t.map(function(g){var b,x=u(g),v=h(g),m={id:x,label:(b=g.label)!=null?b:x,hidden:!1,value:v,formattedValue:d(v),data:g};return Ga({},m,{color:f(m)})})},[t,u,h,d,f])},p8e=function(e){var t=e.data,n=e.startAngle,r=e.endAngle,i=e.innerRadius,s=e.outerRadius,a=e.padAngle,o=e.sortByValue,l=e.activeId,u=e.activeInnerRadiusOffset,h=e.activeOuterRadiusOffset,d=e.hiddenIds,f=e.forwardLegendData,g=w.useMemo(function(){var m=bke().value(function(p){return p.value}).startAngle(ei(n)).endAngle(ei(r)).padAngle(ei(a));return o||m.sortValues(null),m},[n,r,a,o]),b=w.useMemo(function(){var m=t.filter(function(p){return!d.includes(p.id)});return{dataWithArc:g(m).map(function(p){var y=Math.abs(p.endAngle-p.startAngle);return Ga({},p.data,{arc:{index:p.index,startAngle:p.startAngle,endAngle:p.endAngle,innerRadius:l===p.data.id?i-u:i,outerRadius:l===p.data.id?s+h:s,thickness:s-i,padAngle:p.padAngle,angle:y,angleDeg:U1(y)}})}),legendData:t.map(function(p){return{id:p.id,label:p.label,color:p.color,hidden:d.includes(p.id),data:p}})}},[g,t,d,l,i,u,s,h]),x=b.legendData,v=w.useRef(f);return w.useEffect(function(){typeof v.current=="function"&&v.current(x)},[v,x]),b},m8e=function(e){var t=e.activeId,n=e.onActiveIdChange,r=e.defaultActiveId,i=t!==void 0,s=w.useState(i||r===void 0?null:r),a=s[0],o=s[1];return{activeId:i?t:a,setActiveId:w.useCallback(function(l){n&&n(l),i||o(l)},[i,n,o])}},g8e=function(e){var t=e.data,n=e.width,r=e.height,i=e.innerRadius,s=i===void 0?Ne.innerRadius:i,a=e.startAngle,o=a===void 0?Ne.startAngle:a,l=e.endAngle,u=l===void 0?Ne.endAngle:l,h=e.padAngle,d=h===void 0?Ne.padAngle:h,f=e.sortByValue,g=f===void 0?Ne.sortByValue:f,b=e.cornerRadius,x=b===void 0?Ne.cornerRadius:b,v=e.fit,m=v===void 0?Ne.fit:v,p=e.activeInnerRadiusOffset,y=p===void 0?Ne.activeInnerRadiusOffset:p,_=e.activeOuterRadiusOffset,C=_===void 0?Ne.activeOuterRadiusOffset:_,S=e.activeId,E=e.onActiveIdChange,k=e.defaultActiveId,T=e.forwardLegendData,A=m8e({activeId:S,onActiveIdChange:E,defaultActiveId:k}),M=A.activeId,D=A.setActiveId,L=w.useState([]),N=L[0],O=L[1],B=w.useMemo(function(){var j,R=Math.min(n,r)/2,I=R*Math.min(s,1),H=n/2,F=r/2;if(m){var G=c8e(H,F,R,o-90,u-90),Z=G.points,J=Uz(G,h8e),W=Math.min(n/J.width,r/J.height),$={width:J.width*W,height:J.height*W};$.x=(n-$.width)/2,$.y=(r-$.height)/2,H=(H-J.x)/J.width*J.width*W+$.x,F=(F-J.y)/J.height*J.height*W+$.y,j={box:J,ratio:W,points:Z},R*=W,I*=W}return{centerX:H,centerY:F,radius:R,innerRadius:I,debug:j}},[n,r,s,o,u,m]),z=p8e({data:t,startAngle:o,endAngle:u,innerRadius:B.innerRadius,outerRadius:B.radius,padAngle:d,sortByValue:g,activeId:M,activeInnerRadiusOffset:y,activeOuterRadiusOffset:C,hiddenIds:N,forwardLegendData:T}),P=w.useCallback(function(j){O(function(R){return R.indexOf(j)>-1?R.filter(function(I){return I!==j}):[].concat(R,[j])})},[]);return Ga({arcGenerator:u8e({cornerRadius:x,padAngle:ei(d)}),activeId:M,setActiveId:D,toggleSerie:P},z,B)},v8e=function(e){var t=e.dataWithArc,n=e.arcGenerator,r=e.centerX,i=e.centerY,s=e.radius,a=e.innerRadius;return w.useMemo(function(){return{dataWithArc:t,arcGenerator:n,centerX:r,centerY:i,radius:s,innerRadius:a}},[t,n,r,i,s,a])},x8e=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,s=e.borderColor,a=e.isInteractive,o=e.onClick,l=e.onMouseEnter,u=e.onMouseMove,h=e.onMouseLeave,d=e.setActiveId,f=e.tooltip,g=e.transitionMode,b=jk(),x=b.showTooltipFromEvent,v=b.hideTooltip,m=w.useMemo(function(){if(a)return function(C,S){o==null||o(C,S)}},[a,o]),p=w.useMemo(function(){if(a)return function(C,S){x(w.createElement(f,{datum:C}),S),d(C.id),l==null||l(C,S)}},[a,x,d,l,f]),y=w.useMemo(function(){if(a)return function(C,S){x(w.createElement(f,{datum:C}),S),u==null||u(C,S)}},[a,x,u,f]),_=w.useMemo(function(){if(a)return function(C,S){v(),d(null),h==null||h(C,S)}},[a,v,d,h]);return c.jsx(l8e,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:s,transitionMode:g,onClick:m,onMouseEnter:p,onMouseMove:y,onMouseLeave:_})},y8e=["isInteractive","animate","motionConfig","theme","renderWrapper"],b8e=function(e){var t=e.data,n=e.id,r=n===void 0?Ne.id:n,i=e.value,s=i===void 0?Ne.value:i,a=e.valueFormat,o=e.sortByValue,l=o===void 0?Ne.sortByValue:o,u=e.layers,h=u===void 0?Ne.layers:u,d=e.startAngle,f=d===void 0?Ne.startAngle:d,g=e.endAngle,b=g===void 0?Ne.endAngle:g,x=e.padAngle,v=x===void 0?Ne.padAngle:x,m=e.fit,p=m===void 0?Ne.fit:m,y=e.innerRadius,_=y===void 0?Ne.innerRadius:y,C=e.cornerRadius,S=C===void 0?Ne.cornerRadius:C,E=e.activeInnerRadiusOffset,k=E===void 0?Ne.activeInnerRadiusOffset:E,T=e.activeOuterRadiusOffset,A=T===void 0?Ne.activeOuterRadiusOffset:T,M=e.width,D=e.height,L=e.margin,N=e.colors,O=N===void 0?Ne.colors:N,B=e.borderWidth,z=B===void 0?Ne.borderWidth:B,P=e.borderColor,j=P===void 0?Ne.borderColor:P,R=e.enableArcLabels,I=R===void 0?Ne.enableArcLabels:R,H=e.arcLabel,F=H===void 0?Ne.arcLabel:H,G=e.arcLabelsSkipAngle,Z=G===void 0?Ne.arcLabelsSkipAngle:G,J=e.arcLabelsTextColor,W=J===void 0?Ne.arcLabelsTextColor:J,$=e.arcLabelsRadiusOffset,V=$===void 0?Ne.arcLabelsRadiusOffset:$,U=e.arcLabelsComponent,X=e.enableArcLinkLabels,q=X===void 0?Ne.enableArcLinkLabels:X,ne=e.arcLinkLabel,te=ne===void 0?Ne.arcLinkLabel:ne,le=e.arcLinkLabelsSkipAngle,xe=le===void 0?Ne.arcLinkLabelsSkipAngle:le,ie=e.arcLinkLabelsOffset,Te=ie===void 0?Ne.arcLinkLabelsOffset:ie,Ae=e.arcLinkLabelsDiagonalLength,be=Ae===void 0?Ne.arcLinkLabelsDiagonalLength:Ae,we=e.arcLinkLabelsStraightLength,_e=we===void 0?Ne.arcLinkLabelsStraightLength:we,de=e.arcLinkLabelsThickness,se=de===void 0?Ne.arcLinkLabelsThickness:de,me=e.arcLinkLabelsTextOffset,K=me===void 0?Ne.arcLinkLabelsTextOffset:me,Q=e.arcLinkLabelsTextColor,re=Q===void 0?Ne.arcLinkLabelsTextColor:Q,ce=e.arcLinkLabelsColor,ve=ce===void 0?Ne.arcLinkLabelsColor:ce,ge=e.arcLinkLabelComponent,pe=e.defs,Ue=pe===void 0?Ne.defs:pe,Fe=e.fill,He=Fe===void 0?Ne.fill:Fe,$e=e.isInteractive,dt=$e===void 0?Ne.isInteractive:$e,Ee=e.onClick,Me=e.onMouseEnter,Ie=e.onMouseMove,ht=e.onMouseLeave,Je=e.tooltip,at=Je===void 0?Ne.tooltip:Je,Ct=e.activeId,an=e.onActiveIdChange,Nt=e.defaultActiveId,$t=e.transitionMode,Bt=$t===void 0?Ne.transitionMode:$t,yn=e.legends,kt=yn===void 0?Ne.legends:yn,ln=e.forwardLegendData,Qe=e.role,Ke=Qe===void 0?Ne.role:Qe,Ve=R5(M,D,L),wt=Ve.outerWidth,nn=Ve.outerHeight,rn=Ve.margin,jn=Ve.innerWidth,yl=Ve.innerHeight,Pe=f8e({data:t,id:r,value:s,valueFormat:a,colors:O}),Oe=g8e({data:Pe,width:jn,height:yl,fit:p,innerRadius:_,startAngle:f,endAngle:b,padAngle:v,sortByValue:l,cornerRadius:S,activeInnerRadiusOffset:k,activeOuterRadiusOffset:A,activeId:Ct,onActiveIdChange:an,defaultActiveId:Nt,forwardLegendData:ln}),lt=Oe.dataWithArc,Dt=Oe.legendData,mt=Oe.arcGenerator,Jt=Oe.centerX,At=Oe.centerY,Qt=Oe.radius,na=Oe.innerRadius,bl=Oe.setActiveId,Jn=Oe.toggleSerie,Mu=zF(Ue,lt,He),ke={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};h.includes("arcs")&&(ke.arcs=c.jsx(x8e,{center:[Jt,At],data:lt,arcGenerator:mt,borderWidth:z,borderColor:j,isInteractive:dt,onClick:Ee,onMouseEnter:Me,onMouseMove:Ie,onMouseLeave:ht,setActiveId:bl,tooltip:at,transitionMode:Bt},"arcs")),q&&h.includes("arcLinkLabels")&&(ke.arcLinkLabels=c.jsx(i8e,{center:[Jt,At],data:lt,label:te,skipAngle:xe,offset:Te,diagonalLength:be,straightLength:_e,strokeWidth:se,textOffset:K,textColor:re,linkColor:ve,component:ge},"arcLinkLabels")),I&&h.includes("arcLabels")&&(ke.arcLabels=c.jsx(XLe,{center:[Jt,At],data:lt,label:F,radiusOffset:V,skipAngle:Z,textColor:W,transitionMode:Bt,component:U},"arcLabels")),kt.length>0&&h.includes("legends")&&(ke.legends=c.jsx(d8e,{width:jn,height:yl,data:Dt,legends:kt,toggleSerie:Jn},"legends"));var us=v8e({dataWithArc:lt,arcGenerator:mt,centerX:Jt,centerY:At,radius:Qt,innerRadius:na});return c.jsx(j5,{width:wt,height:nn,margin:rn,defs:Mu,role:Ke,children:h.map(function(Nn,ZW){return ke[Nn]!==void 0?ke[Nn]:typeof Nn=="function"?c.jsx(w.Fragment,{children:w.createElement(Nn,us)},ZW):null})})},_8e=function(e){var t=e.isInteractive,n=t===void 0?Ne.isInteractive:t,r=e.animate,i=r===void 0?Ne.animate:r,s=e.motionConfig,a=s===void 0?Ne.motionConfig:s,o=e.theme,l=e.renderWrapper,u=Uz(e,y8e);return c.jsx(W1,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:o,children:c.jsx(b8e,Ga({isInteractive:n},u))})};const w8e=1.4,Dl=e=>Is(e).darker(w8e).toString(),Gp="#A97CD2",wn={player:{label:"Player",description:"Player left by quitting the game, leaving the server or other normal means.",color:"#39E673",border:Dl("#39E673"),expected:!0},resource:{label:"Resource",description:"Player kicked out of the server by a resource.",color:"#406FE6",border:Dl("#406FE6"),expected:!0},timeout:{label:"Timeout",description:"Player connection timed out due to networking issues or client crash.",color:"#F0E38B",border:Dl("#F0E38B"),expected:!1},crash:{label:"Crash",description:"Player left due to a game crash, but was still able to inform the server the crash reason.",color:"#FF913F",border:Dl("#FF913F"),expected:!1},security:{label:"Security",description:"Player kicked out of the server due to suspect behavior such as sending too many commands or losing connection to the Cfx.re backend services.",color:"#FF3E26",border:Dl("#FF3E26"),expected:!1},unknown:{label:"Unknown",description:"Player left the server for an unknown reason.",color:"#F13BF7",border:Dl("#F13BF7"),expected:!1}},DM=Object.keys(wn).filter(e=>wn[e].expected),S8e=Object.keys(wn).filter(e=>!wn[e].expected),LM=({centerX:e,centerY:t,dataWithArc:n,innerRadius:r,active:i})=>{if(i)return c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:e,cy:t,r:r*.95,fill:i.color}),c.jsxs("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:[i.label,":"]}),c.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:Wn(i.data.count)})]});{const s=w.useMemo(()=>n.reduce((a,o)=>a+o.data.count,0),[n]);return c.jsxs(c.Fragment,{children:[c.jsx("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:"Total:"}),c.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:Wn(s)})]})}},C8e=w.memo(({data:e,activeId:t,setActiveId:n,width:r,height:i})=>{const s=cu(),[a,o]=w.useState(!1),l=w.useCallback(u=>{if(!t)return LM(u);const h=u.dataWithArc.find(d=>d.id===t);return LM({...u,active:h})},[t]);return!r||!i?null:c.jsx(_8e,{data:e,height:i,width:r,theme:{text:{fontSize:"13px",fontWeight:600}},activeId:t,onActiveIdChange:n,margin:{top:8,right:8,bottom:8,left:8},innerRadius:.6,padAngle:1.75,cornerRadius:4,activeOuterRadiusOffset:6,borderWidth:1,borderColor:s?void 0:{from:"data.border"},valueFormat:".1%",enableArcLinkLabels:!1,layers:["arcs","arcLabels","arcLinkLabels",l],arcLabelsSkipAngle:20,arcLabelsTextColor:{from:"color",modifiers:[["darker",2.5]]},onClick:(u,h)=>o(d=>!d),onMouseEnter:(u,h)=>o(!1),onMouseLeave:(u,h)=>{a&&n(u.id),h.preventDefault()},colors:{datum:"data.color"},tooltip:()=>null,sortByValue:!0})});function k8e(){const[e,t]=w.useState(null),[n,r]=w.useState({width:0,height:0}),i=nt(Wv),s=mS(),a=w.useMemo(()=>{if(!(i!=null&&i.summaryLast6h)||s().isExpired)return null;if(!i.summaryLast6h.length)return"not_enough_data";const h=i.summaryLast6h.reduce((d,f)=>d+f[1],0);return i.summaryLast6h.map(([d,f])=>{var g,b,x;return{id:d,label:((g=wn[d])==null?void 0:g.label)??d,count:f,value:f/h,color:((b=wn[d])==null?void 0:b.color)??Gp,border:((x=wn[d])==null?void 0:x.border)??Gp}})},[i==null?void 0:i.summaryLast6h]),o=w.useMemo(()=>!(i!=null&&i.summaryLast6h)||s().isExpired||!i.summaryLast6h.length?null:i.summaryLast6h.map(([h,d])=>{var f,g,b;return{id:h,label:((f=wn[h])==null?void 0:f.label)??h,color:((g=wn[h])==null?void 0:g.color)??Gp,border:((b=wn[h])==null?void 0:b.border)??Gp}}),[i==null?void 0:i.summaryLast6h]);let l=null;return typeof a=="object"&&a!==null?l=c.jsx(C8e,{data:a,activeId:e,setActiveId:t,width:n.width,height:n.height}):typeof a=="string"?l=c.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:c.jsx("p",{className:"max-w-80",children:"No players have disconnected from the server in the last 6 hours."})}):l=c.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:c.jsx(qt,{className:"animate-spin size-16 text-muted-foreground"})}),c.jsxs("div",{className:"col-span-3 sm:col-span-2 3xl:col-span-3 py-2 md:rounded-xl border bg-card shadow-sm flex flex-col min-w-64 h-[20rem] max-h-[20rem]",children:[c.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[c.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Player drop cause (last 6h)"}),c.jsx("div",{className:"hidden sm:block",children:c.jsx(dg,{})})]}),c.jsx(Jh,{onDebouncedResize:r,children:l}),o&&c.jsx("div",{className:"px-4 mx-auto flex flex-wrap justify-center gap-2",children:o.map(u=>c.jsxs("div",{"data-active":e===u.id,className:"flex items-center cursor-pointer hover:underline data-[active=true]:underline",onClick:()=>t(e===u.id?null:u.id),children:[c.jsx("div",{className:"size-4 mr-1 rounded-full border dark:border-0",style:{backgroundColor:u.color,borderColor:u.border}}),c.jsx("span",{className:"text-sm",children:u.label})]},u.id))})]})}const Kp=(e,t)=>`translate(${e}, ${t})`;function E8e({svgRef:e,canvasRef:t,setRenderError:n,size:{width:r,height:i},margins:s,isDarkMode:a,bucketLabels:o,dataStart:l,dataEnd:u,lifespans:h,cursorSetter:d}){nr(e).selectAll("*").remove();const f=nr(e);if(f.empty())throw new Error("SVG selection failed.");const g=nr(t);if(g.empty())throw new Error("Canvas selection failed.");if(!(t!=null&&t.getContext))throw new Error("Canvas not supported.");let b=!0;console.log("From:",l.toISOString()),console.log("To:",u.toISOString()),console.log("Window:",hf(u.getTime()-l.getTime())),console.log("Number of lifespans:",h.length);const x=i-s.top-s.bottom,v=r-s.left-s.right;f.append("clipPath").attr("id","fullPerfChartClipPath").append("rect").attr("x",0).attr("y",s.top).attr("width",v).attr("height",i);const m=f.append("g").attr("clip-path","url(#fullPerfChartClipPath)").attr("transform",Kp(s.left,0)),p=p5().domain([l,u]).range([0,v]),y=o1().domain(o).range([i-s.bottom,0]),_=PB(a?KB:GB).domain([0,1]),C=ao(h,se=>ao(se.log,me=>me.players)),S=ao(h,se=>ao(se.log,me=>me.fxsMemory)),E=ao(h,se=>ao(se.log,me=>me.nodeMemory)),k=Math.ceil((C+1)/5)*5,T=[i-s.bottom,s.top],A=bo([0,k],T);bo([0,S],T),bo([0,E],T);const M=bo([382,1350],[7,16]),D=vz(p).ticks(M(r)),L=f.append("g").attr("transform",Kp(s.left,i-s.bottom)).attr("class","time-axis").call(D),N=j6e(y);f.append("g").attr("class","buckets-axis").attr("transform",Kp(r-s.right+s.axis,s.top)).call(N);const O=k<=7?Jk(k+1):null,B=xz(A).tickFormat(se=>se.toString()).tickValues(O);f.append("g").attr("class","players-axis").attr("transform",Kp(s.left-s.axis,0)).call(B);let z=[];const P=o.map(se=>Math.floor(y(se))),j=Math.ceil(y.bandwidth()),R=Is(_(0)).darker(1.15).formatHsl(),I=()=>{const se=g.node();if(!se)return n("Canvas node not found.");const me=se.getContext("2d");if(!me)return n("Canvas 2d context not found.");b&&console.time("drawing canvas heatmap"),me.clearRect(0,0,v,x),me.fillStyle=a?"#281C2B":"#E4D4FA",me.fillRect(0,0,v,x),z=[];let K=0,Q=0;for(const re of h){const{bootTime:ce,closeTime:ve,log:ge}=re,pe=p(ce||ge[0].start),Ue=p(ve||ge.at(-1).end),Fe=Ue-pe;if(!(Ue<0||pe>v)&&!(Fe<5)){K++;for(const He of re.log){const $e=Math.floor(p(He.start)),Ee=Math.floor(p(He.end))-$e;if(Ee){z.push(He);for(let Me=0;Me<He.weightedPerf.length;Me++){const Ie=He.weightedPerf[Me];me.fillStyle=Ie>.001?_(Ie):R,me.fillRect($e,P[Me],Ee,j),Q++}}}}}b&&(console.log("Canvas heatmap finished drawing:",{lifespanCount:K,snapCount:z.length,rectCount:Q}),console.timeEnd("drawing canvas heatmap"))};I();const H=se=>{const me=se.bootTime?p(se.bootTime):p(se.log[0].start),K=se.closeTime?p(se.closeTime):p(se.log.at(-1).end),Q=K-me;return Q<5||K<0+s.left||me>v+s.left?[]:[{...se,lifespanStartX:me,lifespanEndX:K,lifespanWidth:Q}]},F=se=>{const me=nF(K=>p(K.end),K=>A(K.players));se.selectAll("path.players-line-bg").data(H).join("path").attr("class","players-line-bg").each((K,Q,re)=>{nr(re[Q]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","black").attr("stroke-width",6).attr("d",me(K.log))}),se.selectAll("path.players-line").data(H).join("path").attr("class","players-line").each((K,Q,re)=>{nr(re[Q]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","rgb(204, 203, 203)").attr("stroke-width",2).attr("d",me(K.log))})};m.selectAll("g.lifespan").data(h).join("g").attr("class","lifespan").call(F);const G=m.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3 3"),Z=m.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3 3"),J=m.append("circle").attr("class","cursorDot").attr("fill","red").attr("r",4),W=m.append("rect").attr("class","cursorTextBg").attr("fill","black").attr("rx",5).attr("ry",5).attr("stroke","rgba(216, 245, 19, 0.35)").attr("stroke-width",1),$=m.append("text").attr("class","cursorText font-mono").attr("fill","rgba(216, 245, 19)").attr("font-size",16),V=$.node(),U=()=>{G.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),J.attr("cx",-99).attr("cy",-99),Z.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),$.attr("x",-99).attr("y",-99),W.attr("x",-99).attr("y",-99),d(void 0)};U();const X=20*60*1e3,q=zf(se=>se.end).center,ne=se=>{if(!z.length)return;const me=p.invert(se),K=q(z,me);if(K===-1)return;const Q=z[K];if(Math.abs(Q.end.getTime()-me.getTime())<X)return{snapIndex:K,snapData:Q}};let te=null;const le=(se,me)=>{const K=ne(se);if(!K)return te=null,U();const{snapIndex:Q,snapData:re}=K;if(Q===te)return;te=Q,d(re);const ce={x:Math.round(p(re.end))+.5,y:Math.round(A(re.players))+.5,val:re.players};G.attr("x1",ce.x).attr("y1",0).attr("x2",ce.x).attr("y2",x),Z.attr("x1",0).attr("y1",ce.y).attr("x2",v).attr("y2",ce.y),J.attr("cx",ce.x).attr("cy",ce.y);const ve=ce.val.toString(),ge=ce.x<50,pe=ce.y<50;if($.text(ve).attr("x",ge?ce.x+20:ce.x-15).attr("y",pe?ce.y+15:ce.y-15).attr("text-anchor",ge?"start":"end").attr("dominant-baseline",pe?"hanging":"baseline"),!V)return;const Ue=V.getBBox(),Fe=6,He=2;W.attr("x",Math.round(Ue.x)-Fe-.5).attr("y",Math.round(Ue.y)-He-.5).attr("width",Math.round(Ue.width)+Fe*2).attr("height",Math.round(Ue.height)+He*2)};let xe=!1,ie;const Te=20;m.append("rect").attr("x",0).attr("y",0).attr("width",v).attr("height",x).attr("fill","transparent").on("mousemove",function(se){const[me,K]=pi(se);xe?(clearTimeout(ie),ie=setTimeout(()=>{le(me)},Te)):(xe=!0,le(me),setTimeout(()=>{xe=!1},Te))}),f.on("mouseleave",function(){setTimeout(()=>{U()},150)});let Ae=!1;const we=Un(20,({transform:se})=>{if(se.k===1&&se.x===0){if(!Ae)return;Ae=!1}else Ae=!0;p.range([parseFloat(se.applyX(0).toFixed(6)),parseFloat(se.applyX(v).toFixed(6))]),D.scale(se.rescaleX(p).range([0,v])),L.call(D),m.selectAll("g.lifespan").call(F),U(),I()},{noLeading:!1,noTrailing:!1}),_e=[[0,s.top],[v,i-s.top]],de=DLe().scaleExtent([1,12]).translateExtent(_e).extent(_e).on("zoom",we);f.call(de),b=!1}const T8e=w.memo(({threadName:e,apiData:t,apiDataAge:n,width:r,height:i,isDarkMode:s})=>{const a=rt(fS),o=w.useRef(null),l=w.useRef(null),[u,h]=w.useState(""),[d,f]=w.useState(0),g=NY(),b={top:8,right:50,bottom:30,left:40,axis:1},x=w.useMemo(()=>{if(!t)return null;const v=ILe(t.threadPerfLog,m=>{const p=Bz(t.boundaries);return Fz(m.buckets,p)});return v?{...v,bucketLabels:t.boundaries.map(jm),cursorSetter:m=>{if(!m)return g(void 0);g({threadName:e,snap:m})}}:null},[t,n,e,s,u]);return w.useEffect(()=>{if(!x)a(void 0);else{const v=$Le(x.lifespans,24,n);a(v)}},[x,n]),w.useEffect(()=>{if(!(!x||!o.current||!l.current||!r||!i)&&x.lifespans.length)try{console.groupCollapsed("Drawing full performance chart:"),console.time("drawFullPerfChart"),E8e({svgRef:o.current,canvasRef:l.current,setRenderError:h,size:{width:r,height:i},margins:b,isDarkMode:s,...x}),f(0),h(""),console.timeEnd("drawFullPerfChart")}catch(v){h(v.message??"Unknown error.")}finally{console.groupEnd()}},[x,r,i,o,l,u]),!r||!i?null:u?c.jsxs("div",{className:"absolute inset-0 p-4 flex flex-col gap-4 items-center justify-center text-center text-lg font-mono text-destructive-inline",children:["Render Error: ",u,c.jsx("br",{}),c.jsxs(Re,{size:"sm",variant:"outline",className:"text-primary",onClick:()=>{f(v=>v+1),h("")},children:["Retry",d?` (${d})`:""]})]}):c.jsxs(c.Fragment,{children:[c.jsx("svg",{ref:o,width:r,height:i,style:{zIndex:1,position:"absolute",top:"0px",left:"0px"}}),c.jsx("canvas",{ref:l,width:r-b.left-b.right,height:i-b.top-b.bottom,style:{zIndex:0,position:"absolute",top:`${b.top}px`,left:`${b.left}px`}})]})});function A8e({error:e}){const t={bad_request:"Chart data loading failed: bad request.",invalid_thread_name:"Chart data loading failed: invalid thread name.",data_unavailable:"Chart data loading failed: data not yet available.",not_enough_data:c.jsxs("p",{className:"text-center",children:[c.jsx("strong",{children:"There is not enough data to display the chart just yet."}),c.jsx("br",{}),c.jsx("span",{className:"text-base italic",children:"The chart requires at least 30 minutes of server runtime data to be available."})]})};return typeof e=="string"?c.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-2xl text-muted-foreground",children:t[e]??"Unknown BackendApiError"}):c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-2xl text-destructive-inline",children:["Error: ",e.message??"Unknown Error"]})}function R8e(){const[e,t]=w.useState({width:0,height:0}),[n,r]=w.useState("svMain"),[i,s]=w.useState(""),[a,o]=w.useState(0),l=cu(),u=bt({method:"GET",path:"/perfChartData/:thread/"}),h=nl(`/perfChartData/${n}`,async()=>{s("");const f=await u({pathParams:{thread:n}});if(!f)throw new Error("empty_response");return"fail_reason"in f?(s(f.fail_reason),null):(o(Date.now()),f)},{revalidateOnMount:!0,revalidateOnFocus:!1,refreshInterval:60*1e3});let d=null;return h.data?d=c.jsx(T8e,{threadName:n,apiData:h.data,apiDataAge:a,width:e.width,height:e.height,isDarkMode:l}):h.isLoading?d=c.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:c.jsx(qt,{className:"animate-spin size-16 text-muted-foreground"})}):(i||h.error)&&(d=c.jsx(A8e,{error:i||h.error})),c.jsxs("div",{className:"w-full h-[28rem] pt-2 md:rounded-xl border bg-card shadow-sm flex flex-col fill-primary",children:[c.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[c.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Server performance"}),c.jsxs("div",{className:"flex gap-4",children:[c.jsxs(gn,{defaultValue:n,onValueChange:r,children:[c.jsx(un,{className:"w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",children:c.jsx(vn,{placeholder:"Filter by admin"})}),c.jsxs(dn,{className:"px-0",children:[c.jsx(ye,{value:"svMain",className:"cursor-pointer",children:"svMain"}),c.jsx(ye,{value:"svSync",className:"cursor-pointer",children:"svSync"}),c.jsx(ye,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),c.jsx("div",{className:"hidden xs:block",children:c.jsx(iX,{})})]})]}),c.jsx(Jh,{onDebouncedResize:t,children:d})]})}const M8e=w.memo(({uptimePct:e,medianPlayerCount:t,fxsMemory:n,nodeMemory:r})=>{const i=e?e.toFixed(2)+"%":"--",s=t?Math.ceil(t):"--",a=n?n.toFixed(2)+"MB":"--";let o=null,l="--";if(r){const u=Math.ceil(r.used/r.limit*100);l=r.used.toFixed(2)+"MB ("+u+"%)",u>85?o="text-destructive":u>70&&(o="text-warning")}return c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-1 gap-4 h-full pb-2 text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center",children:[c.jsx(rL,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),c.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[c.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:i}),c.jsx("span",{className:"text-center sm:text-right text-sm",children:"Uptime 24h"})]})]}),c.jsxs("div",{className:"flex items-center",children:[c.jsx(rJ,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),c.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[c.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:s}),c.jsx("span",{className:"text-center sm:text-right text-sm",children:"Median Players 24h"})]})]}),c.jsxs("div",{className:"flex items-center",children:[c.jsx(r_,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),c.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[c.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:a}),c.jsx("span",{className:"text-center sm:text-right text-sm",children:"FXServer Memory"})]})]}),c.jsxs("div",{className:Y("flex items-center",o??"text-muted-foreground"),title:r?`${r.used.toFixed(2)}MB / ${r.limit}MB`:"",children:[c.jsx(r_,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),c.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[c.jsx("span",{className:Y("text-center sm:text-right text-xl",o??"text-primary"),children:l}),c.jsx("span",{className:"text-center sm:text-right text-sm",children:"Node.js Memory"})]})]})]})});function j8e(){const e=nt(fS),t=nt(Uv),n=nt(Vv),r=mS(),i=w.useMemo(()=>{const o=r();if(!t||o.isExpired)return null;if(n&&n.snap){const l=Rc(n.snap.end,"2-digit","2-digit"),u=Mc(n.snap.end,"short"),h=vh(n.snap.end)?l:`${l} - ${u}`;return{fxsMemory:n.snap.fxsMemory,nodeMemory:t.nodeMemory&&n.snap.nodeMemory?{used:n.snap.nodeMemory,limit:t.nodeMemory.limit}:null,titleTimeIndicator:c.jsxs(c.Fragment,{children:["(",c.jsx("span",{className:"text-xs text-warning-inline font-mono",children:h}),")"]})}}else return{fxsMemory:t.fxsMemory,nodeMemory:t.nodeMemory,titleTimeIndicator:o.isStale?"(minutes ago)":"(live)"}},[t,n]);let s=null,a=null;return i?(s=i.titleTimeIndicator,a=c.jsx(M8e,{fxsMemory:i.fxsMemory,medianPlayerCount:e==null?void 0:e.medianPlayerCount,uptimePct:e==null?void 0:e.uptimePct,nodeMemory:i.nodeMemory})):a=c.jsx("div",{className:"size-full flex flex-col items-center justify-center",children:c.jsx(qt,{className:"animate-spin size-16 text-muted-foreground"})}),c.jsxs("div",{className:"col-span-3 sm:col-span-1 3xl:col-span-2 min-w-52 py-2 px-4 flex flex-col md:rounded-xl border shadow-sm bg-card",children:[c.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[c.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:["Server stats ",s]}),c.jsx("div",{className:"hidden xs:block",children:c.jsx(kX,{})})]}),a]})}function Vz({children:e,className:t,...n}){return c.jsx("div",{className:Y("flex flex-col md:flex-row md:px-4 h-full",t),...n,children:e})}function qz({children:e,className:t,...n}){return c.jsx("div",{className:Y("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",t),...n,children:e})}function Gz({children:e,className:t,...n}){return c.jsx(ii,{className:Y("min-h-[16rem] w-full md:max-h-[50vh] px-2 md:px-4 max-md:pt-3",t),...n,children:e})}function Au({children:e,className:t,...n}){return c.jsx("div",{className:Y("px-1 pb-1",t),...n,children:e})}function Vf({children:e,className:t,...n}){return c.jsx("div",{className:Y("min-h-[16rem] p-2 md:p-4 flex items-center justify-center text-xl text-muted-foreground",t),...n,children:e})}function Ka({msg:e}){return c.jsxs("div",{className:"flex items-center gap-1 text-xl leading-relaxed text-muted-foreground",children:[c.jsx(qt,{className:"inline animate-spin h-5"})," ",e]})}function N8e(){const e=w.useRef(null),t=jY();return w.useEffect(()=>(e.current=iS(["dashboard"]),e.current.on("connect",()=>{console.log("Dashboard Socket.IO Connected.")}),e.current.on("disconnect",n=>{console.log("Dashboard Socket.IO Disonnected:",n)}),e.current.on("error",n=>{console.log("Dashboard Socket.IO",n)}),e.current.on("dashboard",function(n){t(n)}),()=>{var n,r;(n=e.current)==null||n.removeAllListeners(),(r=e.current)==null||r.disconnect()}),[]),c.jsxs("div",{className:"w-full min-w-96 flex flex-col gap-4",children:[c.jsxs("div",{className:"w-full grid grid-cols-3 3xl:grid-cols-8 gap-4",children:[c.jsx(k8e,{}),c.jsx(j8e,{}),c.jsx(HLe,{})]}),c.jsx(R8e,{})]})}function D8e(){const e=nt(dS),t=zs()[1];return e===As.Setup?(t("/server/setup"),null):e===As.Deployer?(t("/server/deployer"),null):e!==As.Ready?c.jsx("div",{className:"size-full",children:c.jsx(Vf,{children:c.jsx(Ka,{msg:`Unknown Config State: ${String(e)}`})})}):c.jsx(N8e,{})}function Jd({isError:e}){return e?c.jsxs("div",{className:"h-full min-h-28 flex flex-col items-center justify-center gap-2 text-destructive-inline",children:[c.jsx(JD,{className:"size-16 opacity-75"}),c.jsx("span",{children:"Error loading data."})]}):c.jsx("div",{className:"h-full min-h-28 flex items-center justify-center text-muted-foreground",children:c.jsx(qt,{className:"animate-spin size-16 opacity-75"})})}function qf({message:e}){return c.jsx("div",{className:"h-full min-h-28 px-4 py-6 flex items-center justify-center text-xl tracking-wider text-muted-foreground/75",children:e})}const PM=e=>{const t=e.indexOf("/");if(t===-1)return{name:e};const n=e.substring(t+1);return{name:e.substring(0,t),version:n||void 0}},L8e=(e,t)=>{const n=e.map(PM),r=t.map(PM),i=new Set(n.map(u=>u.name)),s=new Set(r.map(u=>u.name)),a=n.filter(u=>!s.has(u.name)).map(u=>u!=null&&u.version?`${u.name}/${u.version}`:u.name),o=r.filter(u=>!i.has(u.name)).map(u=>u!=null&&u.version?`${u.name}/${u.version}`:u.name),l=n.filter(u=>s.has(u.name)).map(u=>{const h=r.find(d=>d.name===u.name);return{resName:u.name,oldVer:u.version??"???",newVer:(h==null?void 0:h.version)??"???"}});return{removed:a,added:o,updated:l}},OM=e=>e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122,P8e=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;n>0&&(OM(t.charCodeAt(n))||!OM(t.charCodeAt(n-1)));)n--;return n<=1?!1:t.slice(0,n)},O8e=e=>e.map((t,n)=>{const r=n===0?!1:P8e(e[n-1],t);return{prefix:r,suffix:r?t.slice(r.length):t}}),I8e=(e,t,n)=>{if(e.length<=t)return{filteredIn:e,filteredOut:!1};const r=e.map(([o,l])=>l).sort((o,l)=>l-o)[t-1];let i=0,s=0;const a=[];for(let o=0;o<e.length;o++){const[l,u]=e[o];(n?u>=r:o<t)?a.push([l,u]):(i++,s+=u)}return{filteredIn:a,filteredOut:!!i&&{count:s,types:i}}};function $8e({datum:e,isLast:t,isOdd:n}){let r=null;return e.prefix?r=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-muted-foreground/50",children:e.prefix}),c.jsx("span",{children:e.suffix})]}):r=e.suffix,c.jsxs("tr",{className:Y("font-mono text-sm group",!t&&"border-b",n&&"bg-secondary/15","hover:bg-secondary/35"),children:[c.jsx("td",{className:"min-w-[4ch] px-2 py-1 border-r text-right",title:"Percent of all crashes",children:e.pctStr??"--"}),c.jsx("td",{className:"min-w-[4ch] px-2 py-1 border-r text-right",title:"Crash count",children:e.cntStr??"--"}),c.jsx("td",{className:"px-2 py-1 attempt-word-wrap line-clamp-4",children:r})]})}function B8e({crashTypes:e,crashesGroupReasons:t,crashesTargetLimit:n,setCrashesTargetLimit:r}){if(!e.length)return c.jsx(qf,{message:"No player crashes within this time window."});const i=w.useMemo(()=>{t?e.sort((d,f)=>d[0].localeCompare(f[0])):e.sort((d,f)=>f[1]-d[1]);const s=e.reduce((d,[,f])=>d+f,0),{filteredIn:a,filteredOut:o}=n?I8e(e,n,t):{filteredIn:e,filteredOut:!1},l=O8e(a.map(([d,f])=>d)),u=[];let h=0;for(let d=0;d<a.length;d++){const[f,g]=a[d];h+=g;const b=g/s;u.push({key:f,pctStr:Wn(b*100,1)+"%",cntStr:Wn(g),...l[d]})}return{display:u,displayPct:Wn(h/s*100,1)+"%",filteredOut:o&&{...o,countPct:Wn(o.count/s*100,1)+"%"}}},[e,t,n,r]);return c.jsxs("table",{className:"w-full px-4 pt-2",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b text-muted-foreground/75",children:[c.jsx("th",{className:"min-w-[4ch] px-2 py-1 border-r text-right",children:"%"}),c.jsx("th",{className:"min-w-[4ch] px-2 py-1 border-r text-right",children:"Count"}),c.jsx("th",{className:"px-2 py-1",children:"Crash Reason"})]})}),c.jsxs("tbody",{children:[i.display.map((s,a)=>c.jsx($8e,{datum:s,isOdd:a%2===0,isLast:!i.filteredOut&&a===i.display.length-1},s.key)),i.filteredOut?c.jsx("tr",{children:c.jsxs("td",{colSpan:3,className:Y("text-center px-4 py-2 text-muted-foreground",i.display.length%2===0&&"bg-secondary/15","hover:bg-secondary/35"),children:["Showing the top ",i.display.length," out of ",Wn(e.length)," reasons which account for ",i.displayPct," of all crashes. ",c.jsx("br",{}),"The remaining ",Wn(i.filteredOut.types)," reasons account for ",i.filteredOut.countPct," of all crashes. "," ",c.jsx("button",{className:"text-accent hover:underline",onClick:()=>r(0),children:"Show All!"})]})}):null]})]})}function W5({children:e}){return c.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-destructive-inline/60 dark:bg-destructive-inline/90",children:e})}function U5({children:e}){return c.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-success-inline/60 dark:bg-success-inline/90",children:e})}function F8e({children:e}){return c.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-warning/60 dark:bg-warning/90",children:e})}function z8e({change:e}){return c.jsxs(c.Fragment,{children:["Switched from ",c.jsx(W5,{children:e.oldVersion})," to ",c.jsx(U5,{children:e.newVersion})]})}function H8e({change:e}){return c.jsxs(c.Fragment,{children:["Switched from ",c.jsx(W5,{children:e.oldVersion})," to ",c.jsx(U5,{children:e.newVersion})]})}function W8e({change:e}){const t=w.useMemo(()=>L8e(e.resRemoved,e.resAdded),[e.resRemoved,e.resAdded]);let n=null;t.removed.length&&(n=c.jsxs("p",{children:["Removed: ",t.removed.map((s,a,o)=>c.jsxs(w.Fragment,{children:[c.jsx(W5,{children:s}),a<o.length-1?", ":"."]},s))]}));let r=null;t.added.length&&(r=c.jsxs("p",{children:["Added: ",t.added.map((s,a,o)=>c.jsxs(w.Fragment,{children:[c.jsx(U5,{children:s}),a<o.length-1?", ":"."]},s))]}));let i=null;return t.updated.length&&(i=c.jsxs("p",{children:["Updated: ",t.updated.map((s,a,o)=>c.jsxs(w.Fragment,{children:[c.jsxs(F8e,{children:[s.resName," ",s.oldVer," -> ",s.newVer]}),a<o.length-1?", ":"."]},a))]})),c.jsxs(c.Fragment,{children:[n,r,i]})}function U8e({changes:e}){const t={fxsChanged:"Changed FXServer version",gameChanged:"Changed game version",resourcesChanged:"Changed boot resources"},n=w.useMemo(()=>e.sort((r,i)=>i.ts-r.ts),[e]);return e.length?c.jsx("div",{className:"md:grid md:grid-cols-[auto_minmax(0,1fr)] gap-4 md:px-4 pt-2 ",children:n.map((r,i)=>c.jsxs(w.Fragment,{children:[c.jsx("div",{className:"hidden mx-auto md:flex items-center gap-4 divide-y",children:c.jsxs("div",{className:"flex flex-col items-center justify-center px-2 py-1 rounded-lg text-xs font-medium bg-muted",children:[c.jsx("span",{children:x8(r.ts,"medium")}),c.jsx("span",{children:Kie(r.ts)})]})}),c.jsxs("div",{className:Y("flex-1 col-span-2 md:col-span-1 px-2 md:px-0 py-2 md:py-0",i%2===0&&"bg-secondary/25 md:bg-transparent"),children:[c.jsxs("div",{className:"flex flex-wrap-reverse justify-between",children:[c.jsx("h3",{className:"flex-grow inline text-lg font-semibold",children:r.type in t?t[r.type]:r.type}),c.jsx("div",{className:"md:hidden mx-auto",children:c.jsx("span",{className:"border-muted-foreground border rounded px-2 py-0.5 font-normal text-xs text-muted-foreground",children:ws(r.ts,"medium","short")})})]}),c.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[r.type==="fxsChanged"&&c.jsx(z8e,{change:r}),r.type==="gameChanged"&&c.jsx(H8e,{change:r}),r.type==="resourcesChanged"&&c.jsx(W8e,{change:r})]})]})]},i))}):c.jsx(qf,{message:"No environmental changes within this time window."})}var[X1,QIe]=Cn("Tooltip",[au]),J1=au(),Kz="TooltipProvider",V8e=700,Uw="tooltip.open",[q8e,V5]=X1(Kz),Yz=e=>{const{__scopeTooltip:t,delayDuration:n=V8e,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,[a,o]=w.useState(!0),l=w.useRef(!1),u=w.useRef(0);return w.useEffect(()=>{const h=u.current;return()=>window.clearTimeout(h)},[]),c.jsx(q8e,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(u.current),o(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(h=>{l.current=h},[]),disableHoverableContent:i,children:s})};Yz.displayName=Kz;var Q1="Tooltip",[G8e,Z1]=X1(Q1),Xz=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=e,l=V5(Q1,e.__scopeTooltip),u=J1(t),[h,d]=w.useState(null),f=yr(),g=w.useRef(0),b=a??l.disableHoverableContent,x=o??l.delayDuration,v=w.useRef(!1),[m=!1,p]=Pr({prop:r,defaultProp:i,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(Uw))):l.onClose(),s==null||s(E)}}),y=w.useMemo(()=>m?v.current?"delayed-open":"instant-open":"closed",[m]),_=w.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,p(!0)},[p]),C=w.useCallback(()=>{window.clearTimeout(g.current),g.current=0,p(!1)},[p]),S=w.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,p(!0),g.current=0},x)},[x,p]);return w.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),c.jsx(CC,{...u,children:c.jsx(G8e,{scope:t,contentId:f,open:m,stateAttribute:y,trigger:h,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayed?S():_()},[l.isOpenDelayed,S,_]),onTriggerLeave:w.useCallback(()=>{b?C():(window.clearTimeout(g.current),g.current=0)},[C,b]),onOpen:_,onClose:C,disableHoverableContent:b,children:n})})};Xz.displayName=Q1;var Vw="TooltipTrigger",Jz=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Z1(Vw,n),s=V5(Vw,n),a=J1(n),o=w.useRef(null),l=Le(t,o,i.onTriggerChange),u=w.useRef(!1),h=w.useRef(!1),d=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),c.jsx(kC,{asChild:!0,...a,children:c.jsx(Ce.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:ae(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:ae(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:ae(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ae(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:ae(e.onBlur,i.onClose),onClick:ae(e.onClick,i.onClose)})})});Jz.displayName=Vw;var K8e="TooltipPortal",[ZIe,Y8e]=X1(K8e,{forceMount:void 0}),Uc="TooltipContent",Qz=w.forwardRef((e,t)=>{const n=Y8e(Uc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,a=Z1(Uc,e.__scopeTooltip);return c.jsx(on,{present:r||a.open,children:a.disableHoverableContent?c.jsx(Zz,{side:i,...s,ref:t}):c.jsx(X8e,{side:i,...s,ref:t})})}),X8e=w.forwardRef((e,t)=>{const n=Z1(Uc,e.__scopeTooltip),r=V5(Uc,e.__scopeTooltip),i=w.useRef(null),s=Le(t,i),[a,o]=w.useState(null),{trigger:l,onClose:u}=n,h=i.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{o(null),d(!1)},[d]),g=w.useCallback((b,x)=>{const v=b.currentTarget,m={x:b.clientX,y:b.clientY},p=ePe(m,v.getBoundingClientRect()),y=tPe(m,p),_=nPe(x.getBoundingClientRect()),C=iPe([...y,..._]);o(C),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(l&&h){const b=v=>g(v,h),x=v=>g(v,l);return l.addEventListener("pointerleave",b),h.addEventListener("pointerleave",x),()=>{l.removeEventListener("pointerleave",b),h.removeEventListener("pointerleave",x)}}},[l,h,g,f]),w.useEffect(()=>{if(a){const b=x=>{const v=x.target,m={x:x.clientX,y:x.clientY},p=(l==null?void 0:l.contains(v))||(h==null?void 0:h.contains(v)),y=!rPe(m,a);p?f():y&&(f(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,h,a,u,f]),c.jsx(Zz,{...e,ref:s})}),[J8e,Q8e]=X1(Q1,{isInside:!1}),Zz=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=e,l=Z1(Uc,n),u=J1(n),{onClose:h}=l;return w.useEffect(()=>(document.addEventListener(Uw,h),()=>document.removeEventListener(Uw,h)),[h]),w.useEffect(()=>{if(l.trigger){const d=f=>{const g=f.target;g!=null&&g.contains(l.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,h]),c.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:c.jsxs(EC,{"data-state":l.stateAttribute,...u,...o,ref:t,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(sS,{children:r}),c.jsx(J8e,{scope:n,isInside:!0,children:c.jsx(S7,{id:l.contentId,role:"tooltip",children:i||r})})]})})});Qz.displayName=Uc;var eH="TooltipArrow",Z8e=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=J1(n);return Q8e(eH,n).isInside?null:c.jsx(TC,{...i,...r,ref:t})});Z8e.displayName=eH;function ePe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function tPe(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 nPe(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 rPe(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const o=t[s].x,l=t[s].y,u=t[a].x,h=t[a].y;l>r!=h>r&&n<(u-o)*(r-l)/(h-l)+o&&(i=!i)}return i}function iPe(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),sPe(t)}function sPe(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 s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.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 s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.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)}var oPe=Yz,aPe=Xz,lPe=Jz,tH=Qz;const cPe=oPe,Xr=aPe,Jr=lPe,Mr=w.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(tH,{ref:r,sideOffset:t,className:Y("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}));Mr.displayName=tH.displayName;function uPe({dropTypes:e}){let{totalDrops:t,categories:n}=w.useMemo(()=>{let r=0;const i={};for(const[s,a]of e)r+=a,s in wn&&(i[s]={label:wn[s].label,tooltip:wn[s].description,color:wn[s].color,count:a});return{totalDrops:r,categories:Object.entries(i)}},[e]);return n.length?c.jsx("div",{className:"px-4 py-4 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:n.map(([r,i])=>c.jsxs(Xr,{children:[c.jsx(Jr,{asChild:!0,children:c.jsxs("div",{className:"px-4 flex flex-col gap-1 items-center justify-center",children:[c.jsx("span",{className:"text-xl tracking-wider border-b-2 font-semibold",style:{borderColor:i.color},children:i.label}),c.jsxs("span",{children:[Wn(i.count)," ",c.jsxs("small",{className:"opacity-75",children:["(",Wn(i.count/t*100,1),"%)"]})]})]})}),c.jsx(Mr,{className:"max-w-96 text-center",children:c.jsx("p",{children:i.tooltip})})]},r))}):c.jsx(qf,{message:"No player drops within this time window."})}function dPe({resKicks:e}){let{totalKicks:t,resources:n}=w.useMemo(()=>{let r=0;const i={};for(const[s,a]of e)r+=a,i[s]={label:s,count:a};return{totalKicks:r,resources:Object.entries(i)}},[e]);return n.length?c.jsx("div",{className:"px-4 py-4 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:n.map(([r,i])=>c.jsxs("div",{className:"px-4 flex flex-col gap-1 items-center justify-center",children:[c.jsx("span",{className:"text-lg tracking-wider border-b-2",children:i.label}),c.jsxs("span",{className:"text-sm",children:[Wn(i.count)," ",c.jsxs("small",{className:"opacity-75",children:["(",Wn(i.count/t*100,1),"%)"]})]})]},r))}):c.jsx(qf,{message:"No players kicked by resources within this time window."})}function hPe({isError:e}){return c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-center space-x-2 text-sm text-muted-foreground",children:c.jsx("span",{children:"Loading..."})}),c.jsxs("div",{className:"pb-2 md:rounded-xl border bg-cardx shadow-sm flex flex-col",children:[c.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b md:rounded-t-[inherit] bg-secondary/35",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("div",{className:"hidden xs:block",children:c.jsx(YD,{className:"size-4"})}),c.jsx("h2",{className:"font-mono text-sm",children:"Overview"})]})}),c.jsx("div",{className:"px-4 py-2 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:c.jsx(Jd,{isError:e})}),c.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("div",{className:"hidden xs:block",children:c.jsx(ZD,{className:"size-4"})}),c.jsx("h2",{className:"font-mono text-sm",children:"Environment Changes"})]})}),c.jsx("div",{className:"px-4 pt-2 pb-4",children:c.jsx(Jd,{isError:e})}),c.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("div",{className:"hidden xs:block",children:c.jsx(nL,{className:"size-4"})}),c.jsx("h2",{className:"font-mono text-sm",children:"Crash Reasons"})]})}),c.jsx("div",{className:"px-4 pt-2 pb-4 space-y-4",children:c.jsx(Jd,{isError:e})})]})]})}const fPe=function({windowStart:t,windowEnd:n,windowData:r,rangeSelected:i,displayLod:s}){const[a,o]=w.useState(50),[l,u]=w.useState(!1),h=new Date(t),d=new Date(n),f=!vh(h)||!vh(h),g=Rc(h,"2-digit","2-digit"),b=Mc(h,"short"),x=f?`${g} - ${b}`:g,v=Rc(d,"2-digit","2-digit"),m=Mc(d,"short"),p=f?`${v} - ${m}`:v;return c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:Y("text-center space-x-2 text-sm text-muted-foreground",i&&"font-semibold text-primary"),children:c.jsxs("span",{children:["Period from ",c.jsx(Be,{title:h.toISOString(),children:x})," to ",c.jsx(Be,{title:d.toISOString(),children:p}),"."]})}),c.jsxs("div",{className:"md:rounded-xl border shadow-sm flex flex-col",children:[c.jsxs("div",{className:"rounded-t-[inherit]",children:[c.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b rounded-t-[inherit] bg-secondary/35",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("div",{className:"hidden xs:block",children:c.jsx(YD,{className:"size-4"})}),c.jsx("h2",{className:"font-mono text-sm",children:"Period Overview"})]})}),c.jsx(uPe,{dropTypes:r.dropTypes})]}),c.jsxs("div",{className:"pb-4",children:[c.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("div",{className:"hidden xs:block",children:c.jsx(VD,{className:"size-4"})}),c.jsx("h2",{className:"font-mono text-sm",children:"Resource Kicks"})]})}),c.jsx(dPe,{resKicks:r.resKicks})]}),c.jsxs("div",{className:"pb-4",children:[c.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("div",{className:"hidden xs:block",children:c.jsx(ZD,{className:"size-4"})}),c.jsx("h2",{className:"font-mono text-sm",children:"Environment Changes"}),c.jsx(jce,{featName:"playerDropsEnvChangesReversed",durationDays:14,children:c.jsx("span",{className:"text-2xs text-warning-inline/80",children:"Note: This list now shows the most recent changes first."})})]})}),c.jsx(U8e,{changes:r.changes})]}),c.jsxs("div",{className:"",children:[c.jsxs("div",{className:"flex flex-row items-center justify-between flex-shrink px-1 sm:px-4 border-t border-b bg-secondary/35",children:[c.jsxs("div",{className:"flex items-center py-2 space-x-2",children:[c.jsx("div",{className:"hidden xs:block",children:c.jsx(nL,{className:"size-4"})}),c.jsx("h2",{className:"font-mono text-sm",children:"Crash Reasons"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(gn,{value:a.toString(),onValueChange:y=>o(parseInt(y)),children:[c.jsx(un,{className:"w-32 h-6 px-3 py-1 text-sm",children:c.jsx(vn,{placeholder:"Filter by admin"})}),c.jsxs(dn,{className:"px-0",children:[c.jsx(ye,{value:"50",className:"cursor-pointer",children:"Top ~50"}),c.jsx(ye,{value:"100",className:"cursor-pointer",children:"Top ~100"}),c.jsx(ye,{value:"0",className:"cursor-pointer",children:"Show All"})]})]}),c.jsxs(gn,{value:l.toString(),onValueChange:y=>u(y==="true"),children:[c.jsx(un,{className:"w-36 h-6 px-3 py-1 text-sm",children:c.jsx(vn,{placeholder:"Filter by admin"})}),c.jsxs(dn,{className:"px-0",children:[c.jsx(ye,{value:"false",className:"cursor-pointer",children:"Sort by Count"}),c.jsx(ye,{value:"true",className:"cursor-pointer",children:"Group Reasons"})]})]})]})]}),c.jsx(B8e,{crashTypes:r.crashTypes,crashesGroupReasons:l,crashesTargetLimit:a,setCrashesTargetLimit:o})]})]})]})},pPe=w.memo(fPe),Xy=(e,t)=>`translate(${e}, ${t})`;function mPe({legendRef:e,svgRef:t,canvasRef:n,setRenderError:r,size:{width:i,height:s},rangeSelected:a,rangeSetter:o,margins:l,isDarkMode:u,chartName:h,data:d}){var me;nr(t).selectAll("*").remove();const f=nr(t);if(f.empty())throw new Error("SVG selection failed.");const g=nr(n);if(g.empty())throw new Error("Canvas selection failed.");if(!(n!=null&&n.getContext))throw new Error("Canvas not supported.");let b=!0;console.log("From:",d.startDate.toISOString()),console.log("To:",d.endDate.toISOString()),console.log("Window:",hf(d.startDate.getTime()-d.endDate.getTime())),console.log("Number of intervals:",d.log.length);const x=s-l.top-l.bottom,v=i-l.left-l.right;console.log("Drawable area:",v,x);const m=f.append("g").attr("transform",Xy(l.left,l.top)).attr("class","interaction-chart").attr("data-selected","false"),p=(me=m.node())==null?void 0:me.dataset,y=p5([d.startDate,d.endDate],[0,v]),_=d.maxDrops<10?d.maxDrops+1:d.maxDrops,C=bo([0,_],[s-l.bottom,l.top]),S=bo([382,1350],[7,16]),E=vz(y).ticks(S(i));m.append("g").attr("transform",Xy(0,x)).attr("class","time-axis").call(E);const k=_<=7?Jk(_+1):null,T=xz(C).ticks(s>200?6:4).tickFormat(K=>Wn(K)).tickValues(k),A=f.append("g").attr("class","counts-axis").attr("transform",Xy(l.left-l.axis,0)).call(T),M=d.displayLod==="day"?24:1,D=new Date(d.startDate.getTime()+M*60*60*1e3),L=y(D)-y(d.startDate),N=Math.floor(L/2),O=d.displayLod==="day"?12:0,B=u?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.35)",z=u?"#00000035":"#00000007",P=u?"#FFFFFFE0":"#000000D0",j=K=>C(K)-l.top;(()=>{var ce,ve;const K=g.node();if(!K)return r("Canvas node not found.");const Q=K.getContext("2d");if(!Q)return r("Canvas 2d context not found.");if(!L)return r("Cannot render with zero interval width.");b&&console.time("drawing canvas timeline"),Q.clearRect(0,0,v,x),Q.fillStyle=z,Q.fillRect(0,0,v,x),Q.strokeStyle=B,Q.setLineDash([2,2]);try{const ge=A.selectAll("g.tick").nodes();for(const pe of ge){const Ue=pe==null?void 0:pe.getAttribute("transform");if(!Ue)continue;const Fe=Math.round(+Ue.split(",")[1].replace(")","")-l.top)+.5;Q.beginPath(),Q.moveTo(0,Fe),Q.lineTo(v,Fe),Q.stroke()}}catch(ge){console.error("Error drawing horizontal ticks:",ge)}Q.setLineDash([]);let re=0;Q.lineWidth=1;for(const ge of d.log){const pe=y(ge.startDate);if(pe<0||pe>v)continue;const Fe=Math.round(pe)-N+O,He=pe-Fe,$e=Math.round(L+He)+1-N-O;if($e<1)continue;re++;let dt=0,Ee=x+1;for(const[Me,Ie]of ge.drops){if(!Ie)continue;const ht=Ee-1,Je=j(dt+Ie)+1,at=ht-Je,Ct=Math.max(Math.floor(at),at>.8?1:0);dt+=Ie,!(Ct<1)&&(Ee=ht-Ct,Q.fillStyle=((ce=wn[Me])==null?void 0:ce.color)??"white",Q.fillRect(Fe,ht,$e,-Ct),Q.strokeStyle=((ve=wn[Me])==null?void 0:ve.border)??"black",Q.strokeRect(Fe+.5,ht+.5,$e-1,-Ct-1))}if(ge.changes){Q.fillStyle=P;const Me=Math.round(Fe-.5+$e/2)+.5,Ie=Ee-6,ht=3;Q.beginPath(),Q.moveTo(Me,Ie-ht),Q.lineTo(Me+ht,Ie),Q.lineTo(Me,Ie+ht),Q.lineTo(Me-ht,Ie),Q.closePath(),Q.fill()}}b&&(console.timeEnd("drawing canvas timeline"),console.log("Bars rendered:",re))})();let I=null,H;const F=`chartMask-${h}`,G=m.append("line").attr("stroke",u?"rgba(216, 245, 19, 0.75)":"rgba(62, 70, 5, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3,3"),Z=m.append("rect").attr("fill","transparent").attr("height",x).attr("opacity","0").attr("class","transition-opacity interaction-highlight"),W=m.append("defs").append("mask").attr("id",F),$=W.append("rect").attr("width",v).attr("height",x).attr("fill","white").attr("class","transition-opacity").attr("opacity","0"),V=W.append("rect").attr("height",x).attr("fill","black");m.append("rect").attr("width",v).attr("height",x).attr("fill",u?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0.35)").attr("mask",`url(#${F})`);const U=(K,Q)=>{const re=Math.floor(K),ce=Math.floor(Q),ve=Math.min(re,ce)+.5-N,ge=Math.abs(ce-re)+L+.5;return{start:ve,width:ge}},X=(K,Q)=>{if(typeof K!="number"||typeof Q!="number"||K<0&&Q<0||K>v&&Q>v){$.attr("opacity","0"),m.attr("data-selected","false");return}const{start:re,width:ce}=U(K,Q);V.attr("x",re).attr("width",ce),$.attr("opacity","1"),m.attr("data-selected","true")},q=K=>{if(!Array.isArray(K)||K.length!==2)return o(null);K[0].getTime()<=K[1].getTime()?o({startDate:new Date(K[0]),endDate:new Date(K[1])}):o({startDate:new Date(K[1]),endDate:new Date(K[0])})},ne=(K=!1)=>{I=null,K&&(X(),a&&q(null))},te=()=>{G.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),e.style.opacity="0",clearTimeout(H)};te(),a&&(console.log("Upsream range selected:",a.startDate.toISOString(),a.endDate.toISOString()),X(y(a.startDate),y(a.endDate)));const le=d.log.filter(K=>K.drops.length>0),xe=zf(K=>K.startDate).center,ie=K=>{const Q=y.invert(K),re=xe(le,Q);if(re===-1)return;const ce=le[re],ve=ce.startDate.getTime();return{datum:ce,datumStartTs:ve,datumStartX:y(ce.startDate),dataumIndex:re}};let Te=null;const Ae=K=>{var Ee;const Q=ie(K);if(!Q){Z.attr("opacity","0");return}const{datum:re,datumStartX:ce,dataumIndex:ve}=Q;if(ve===Te)return;if(Te=ve,I)return X(I.x,ce);if((p==null?void 0:p.selected)==="true")return;const ge=e.querySelectorAll("span[data-category]");for(const Me of ge){const Ie=Me.getAttribute("data-category");if(!Ie)continue;const ht=((Ee=re.drops.find(([Je])=>Je===Ie))==null?void 0:Ee[1])??0;Me.textContent=Wn(ht)}const pe=e.querySelector("div.change-flag");pe&&(re.changes?(pe.style.display="block",pe.textContent=re.changes>1?`${re.changes} CHANGES`:"1 CHANGE"):(pe.style.display="none",pe.textContent=""));let Ue=!1;e.style.opacity==="0"&&(e.style.transitionProperty="opacity",Ue=!0);const Fe=e.clientWidth,He=36;let $e=ce-Fe-He+l.left;$e<l.left&&($e=ce+He+l.left),e.style.left=`${$e}px`,e.style.opacity="1",Ue&&setTimeout(()=>{e.style.transitionProperty="all"},0);const dt=U(ce,ce);Z.attr("x",dt.start).attr("width",dt.width).attr("opacity","1")},be=K=>{const Q=ie(K);Q&&(m.attr("data-mousedown","true"),te(),I={x:Q.datumStartX,datum:Q.datum},X(Q.datumStartX))},we=K=>{if(m.attr("data-mousedown","false"),!I)return ne(!0);const Q=ie(K);if(!Q||a&&(p==null?void 0:p.selected)!=="true")return ne(!0);console.log("PlayerDrops range selected:",I.datum.startDate,Q.datum.startDate),clearTimeout(H),q([I.datum.startDate,Q.datum.startDate]),ne()},_e=()=>{m.attr("data-mousedown","false"),Z.attr("opacity","0"),setTimeout(()=>{ne(!!I),te()},150)};let de=!1;const se=75;m.on("mousemove",function(K){const[Q]=pi(K);de?(clearTimeout(H),H=setTimeout(()=>{Ae(Q)},se)):(de=!0,Ae(Q),setTimeout(()=>{de=!1},se))}).on("mousedown",function(K){if(K.button!==0)return;const[Q]=pi(K);be(Q)}).on("mouseup",function(K){if(K.button!==0)return;const[Q]=pi(K);we(Q)}),f.on("mouseleave",_e),b=!1}const gPe=w.memo(({categories:e})=>e.slice().reverse().map(n=>c.jsxs("div",{className:"flex items-center text-sm",children:[c.jsx("div",{className:"size-4 mr-1 rounded-full border dark:border-0",style:{backgroundColor:wn[n].color,borderColor:wn[n].border}}),c.jsxs("span",{className:"tracking-wider",children:[wn[n].label,":"]}),c.jsx("div",{className:"flex-grow text-right font-semibold min-w-[3ch] text-muted-foreground",children:c.jsx("span",{"data-category":n})})]},n)));function vPe({chartData:e,chartName:t,width:n,height:r,rangeSelected:i,rangeSetter:s}){const a=w.useRef(null),o=w.useRef(null),l=w.useRef(null),[u,h]=w.useState(""),[d,f]=w.useState(0),g=cu(),b={top:8,right:8,bottom:24,left:42,axis:1};return w.useEffect(()=>{if(!(!e||!l.current||!a.current||!o.current||!n||!r)&&e.log.length)try{console.groupCollapsed(`Drawing player ${t} drops:`),console.time(`drawDropsTimeline-${t}`),mPe({chartName:t,legendRef:l.current,svgRef:a.current,canvasRef:o.current,size:{width:n,height:r},rangeSelected:i,margins:b,isDarkMode:g,data:e,setRenderError:h,rangeSetter:s}),f(0),h(""),console.timeEnd(`drawDropsTimeline-${t}`)}catch(x){h(x.message??"Unknown error.")}finally{console.groupEnd()}},[e,t,n,r,i,s,g,l,a,o,u]),!n||!r?null:u?c.jsxs("div",{className:"absolute inset-0 p-4 flex flex-col gap-4 items-center justify-center text-center text-lg font-mono text-destructive-inline",children:["Render Error: ",u,c.jsx("br",{}),c.jsxs(Re,{size:"sm",variant:"outline",className:"text-primary",onClick:()=>{f(x=>x+1),h("")},children:["Retry",d?` (${d})`:""]})]}):e.maxDrops?c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:l,style:{zIndex:2,position:"absolute",top:"12px",opacity:0},className:"p-2 rounded-md border shadow-lg dark:bg-zinc-800/90 bg-zinc-200/90 pointer-events-none transition-all",children:[c.jsx(gPe,{categories:e.categoriesSorted}),c.jsx("div",{className:"change-flag w-full mt-1 bg-card/75 rounded-md border text-center text-xs tracking-wider"})]}),c.jsx("svg",{ref:a,width:n,height:r,style:{zIndex:1,position:"absolute",top:"0px",left:"0px"}}),c.jsx("canvas",{ref:o,width:n-b.left-b.right,height:r-b.top-b.bottom,style:{zIndex:0,position:"absolute",top:`${b.top}px`,left:`${b.left}px`}})]}):c.jsx(qf,{message:"No players disconnected from your server recently."})}const IM=w.memo(vPe),xPe=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t.toISOString()},yPe=(e,t,n)=>{const r=n.getTime(),i=e.findIndex(p=>new Date(p.hour).getTime()>=r),s=e.slice(i);if(s.length===0)return null;const a=Object.fromEntries(DM.map(p=>[p,0])),o=Object.fromEntries(S8e.map(p=>[p,0]));let l=s;if(t==="day"){l=[];let p,y;for(const _ of s){const C=new Date(_.hour).getDate(),S=xPe(_.hour);if(!y)p=C,y={hour:S,changes:0,dropTypes:[]};else if(C!==p){l.push(y),p=C,y={hour:S,changes:_.changes,dropTypes:structuredClone(_.dropTypes)};continue}y.changes+=_.changes;for(const[E,k]of _.dropTypes.slice()){const T=y.dropTypes.find(([A])=>A===E);T?T[1]+=k:y.dropTypes.push([E,k])}}y&&l.push(y)}let u=0,h=0;const d=[];for(const p of l){const y=[],_=[];let C=0,S=0;for(const[E,k]of p.dropTypes)DM.includes(E)?(C+=k,y.push([E,k]),a[E]+=k):(S+=k,_.push([E,k]),o[E]+=k);u=Math.max(u,C),h=Math.max(h,S),d.push({changes:p.changes,expectedDrops:y,unexpectedDrops:_})}const f=Object.entries(a).sort((p,y)=>y[1]-p[1]),g=Object.fromEntries(f.map(([p,y],_)=>[p,_])),b=Object.entries(o).sort((p,y)=>y[1]-p[1]),x=Object.fromEntries(b.map(([p,y],_)=>[p,_])),v=[],m=[];for(let p=0;p<l.length;p++){const y=l[p],_=d[p];if(!_)continue;const C=new Date(y.hour);v.push({startDate:C,changes:_.changes,drops:_.expectedDrops.sort(([S],[E])=>g[S]-g[E])}),m.push({startDate:C,changes:_.changes,drops:_.unexpectedDrops.sort(([S],[E])=>x[S]-x[E])})}return{expectedSeries:v,expectedSeriesMax:u,expectedCategoriesSorted:f.map(([p,y])=>p),unexpectedSeries:m,unexpectedSeriesMax:h,unexpectedCategoriesSorted:b.map(([p,y])=>p)}},bPe=w.memo(({isError:e,dataTs:t,summaryData:n,rangeSelected:r,rangeSetter:i,displayLod:s,setDisplayLod:a})=>{const[o,l]=w.useState({width:0,height:0}),[u,h]=w.useState({width:0,height:0}),d=w.useMemo(()=>{if(!n||!t)return;const f=new Date(t),g=new Date(t);s==="day"?(f.setHours(-324,0,0,0),g.setHours(12,0,0,0)):(f.setHours(f.getHours()-169,15,0,0),g.setMinutes(g.getMinutes()+30,0,0));const b=yPe(n,s,f);if(!b)return;const x={displayLod:s,startDate:f,endDate:g};return{expected:{...x,maxDrops:b.expectedSeriesMax,categoriesSorted:b.expectedCategoriesSorted,log:b.expectedSeries},unexpected:{...x,maxDrops:b.unexpectedSeriesMax,categoriesSorted:b.unexpectedCategoriesSorted,log:b.unexpectedSeries}}},[n,s]);return c.jsxs("div",{className:"md:rounded-xl border bg-card shadow-sm flex flex-col",children:[c.jsxs("div",{className:"flex flex-row items-center justify-between px-1 sm:px-4 border-b rounded-t-[inherit] bg-secondary/35",children:[c.jsxs("div",{className:"flex items-center py-2 space-x-2",children:[c.jsx("div",{className:"hidden xs:block",children:c.jsx(dg,{className:"size-4"})}),c.jsx("h2",{className:"font-mono text-sm",children:"Expected Player Drops"})]}),c.jsxs(gn,{defaultValue:s,onValueChange:a,children:[c.jsx(un,{className:"w-32 h-6 px-3 py-1 text-sm",children:c.jsx(vn,{placeholder:"Filter by admin"})}),c.jsxs(dn,{className:"px-0",children:[c.jsx(ye,{value:"day",className:"cursor-pointer",children:"Days"}),c.jsx(ye,{value:"hour",className:"cursor-pointer",children:"Hours"})]})]})]}),c.jsx("div",{className:"h-32 max-h-32",children:c.jsx(Jh,{onDebouncedResize:l,children:d?c.jsx(IM,{chartData:d.expected,chartName:"expected",width:o.width,height:o.height,rangeSelected:r,rangeSetter:i}):c.jsx(Jd,{isError:e})})}),c.jsx("div",{className:"flex flex-row items-center justify-between px-1 sm:px-4 border-t border-b bg-secondary/35",children:c.jsxs("div",{className:"flex items-center py-2 gap-2",children:[c.jsx("div",{className:"hidden xs:block",children:c.jsx(dg,{className:"size-4"})}),c.jsx("h2",{className:"font-mono text-sm",children:"Unexpected Player Drops"})]})}),c.jsx("div",{className:"h-52 max-h-52",children:c.jsx(Jh,{onDebouncedResize:h,children:d?c.jsx(IM,{chartData:d.unexpected,chartName:"unexpected",width:u.width,height:u.height,rangeSelected:r,rangeSetter:i}):c.jsx(Jd,{isError:e})})})]})}),_Pe=w.memo(bPe),wPe=(e,t)=>{if(!e){const i=t==="day"?14:7;return{queryKey:"detailedDaysAgo="+i,queryParams:{detailedDaysAgo:i}}}const n=new Date(e.endDate);t==="day"?n.setHours(23,59,59,999):n.setMinutes(59,59,999);const r=`${e.startDate.toISOString()},${n.toISOString()}`;return{queryKey:"detailedWindow="+r,queryParams:{detailedWindow:r}}};function SPe(){var u,h;const[e,t]=w.useState("hour"),[n,r]=w.useState(null),{queryKey:i,queryParams:s}=wPe(n,e),a=bt({method:"GET",path:"/playerDropsData"}),o=nl(`/playerDropsData?${i}`,async()=>{const d=await a({queryParams:s});if(!d)throw new Error("empty_response");if("fail_reason"in d)throw new Error(d.fail_reason);return d},{revalidateOnFocus:!1}),l=d=>{t(d),r(null)};return c.jsxs("div",{className:"w-full space-y-8",children:[c.jsx(_Pe,{isError:!!o.error,dataTs:(u=o.data)==null?void 0:u.ts,summaryData:(h=o.data)==null?void 0:h.summary,rangeSelected:n,rangeSetter:r,displayLod:e,setDisplayLod:l}),o.data&&!o.isValidating?c.jsx(pPe,{windowStart:o.data.detailed.windowStart,windowEnd:o.data.detailed.windowEnd,windowData:o.data.detailed.windowData,rangeSelected:n,displayLod:e}):c.jsx(hPe,{isError:!!o.error})]})}var q5="Tabs",[CPe,e9e]=Cn(q5,[uu]),nH=uu(),[kPe,G5]=CPe(q5),rH=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:l="automatic",...u}=e,h=Ja(o),[d,f]=Pr({prop:r,onChange:i,defaultProp:s});return c.jsx(kPe,{scope:n,baseId:yr(),value:d,onValueChange:f,orientation:a,dir:h,activationMode:l,children:c.jsx(Ce.div,{dir:h,"data-orientation":a,...u,ref:t})})});rH.displayName=q5;var iH="TabsList",sH=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,s=G5(iH,n),a=nH(n);return c.jsx(PC,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:c.jsx(Ce.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});sH.displayName=iH;var oH="TabsTrigger",aH=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=e,a=G5(oH,n),o=nH(n),l=uH(a.baseId,r),u=dH(a.baseId,r),h=r===a.value;return c.jsx(OC,{asChild:!0,...o,focusable:!i,active:h,children:c.jsx(Ce.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":u,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:t,onMouseDown:ae(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:ae(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:ae(e.onFocus,()=>{const d=a.activationMode!=="manual";!h&&!i&&d&&a.onValueChange(r)})})})});aH.displayName=oH;var lH="TabsContent",cH=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=e,o=G5(lH,n),l=uH(o.baseId,r),u=dH(o.baseId,r),h=r===o.value,d=w.useRef(h);return w.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),c.jsx(on,{present:i||h,children:({present:f})=>c.jsx(Ce.div,{"data-state":h?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&s})})});cH.displayName=lH;function uH(e,t){return`${e}-trigger-${t}`}function dH(e,t){return`${e}-content-${t}`}var EPe=rH,hH=sH,fH=aH,pH=cH;const mH=EPe,K5=w.forwardRef(({className:e,...t},n)=>c.jsx(hH,{ref:n,className:Y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));K5.displayName=hH.displayName;const xv=w.forwardRef(({className:e,...t},n)=>c.jsx(fH,{ref:n,className:Y("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}));xv.displayName=fH.displayName;const ex=w.forwardRef(({className:e,...t},n)=>c.jsx(pH,{ref:n,className:Y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ex.displayName=pH.displayName;const gH=Symbol("Settings:ResetConfig"),vt=(e,t,n=void 0)=>({scope:e,key:t,isAdvanced:n}),pl=(e,t)=>{const n=typeof t.configValue=="function"?t.configValue(e[t.configName]):t.configValue;return{...e,[t.configName]:n}},ml=e=>Object.fromEntries(Object.keys(e).map(t=>[t,void 0])),TPe=(e,t,n,r,i)=>{const s=()=>{var h,d,f,g;const o=(d=(h=r==null?void 0:r.storedConfigs)==null?void 0:h[n.scope])==null?void 0:d[n.key],l=(g=(f=r==null?void 0:r.defaultConfigs)==null?void 0:f[n.scope])==null?void 0:g[n.key];return{storedValue:o,defaultValue:l,initialValue:o??l}},a=s();return r&&i({configName:t,configValue:a.initialValue}),{scope:n.scope,key:n.key,isAdvanced:n.isAdvanced??!1,eid:`tab-${e}:config:${n.key}`,defaultValue:a.defaultValue,initialValue:a.initialValue,state:{set:o=>i({configName:t,configValue:o}),discard:()=>i({configName:t,configValue:s().initialValue}),default:()=>i({configName:t,configValue:s().defaultValue})},hasChanged:o=>r!==void 0&&!kg(o,s().initialValue)}},gl=(e,t,n,r)=>Object.fromEntries(Object.entries(t).map(([i,s])=>[i,TPe(e,i,s,n,r)])),vl=(e,t,n,r)=>{var o,l;const i={},s={};let a=!1;console.groupCollapsed("Settings Diffing:");for(const[u,h]of Object.entries(e)){if(h.isAdvanced&&!r)continue;let d=u in n?n[u]:t[u];d===void 0&&(d=gH),typeof d=="string"&&(d=d.trim()),i[o=h.scope]??(i[o]={}),i[h.scope][h.key]=d;const f=h.hasChanged(d);console.log(f,h.scope,h.key,{initial:h.initialValue,current:d}),f&&(a=!0,s[l=h.scope]??(s[l]={}),s[h.scope][h.key]=d)}return console.log("Final changedConfigs:",s),console.groupEnd(),{hasChanges:a,localConfigs:i,changedConfigs:s}};function APe({tab:e,pageCtx:t}){return"cards"in e?c.jsx("div",{id:`tab-${e.ctx.tabId}`,className:"space-y-4",children:e.cards.map(({ctx:n,Component:r})=>c.jsx(r,{pageCtx:t,cardCtx:n},n.cardId))}):c.jsx(e.Component,{pageCtx:t,cardCtx:e.ctx},e.ctx.tabId)}const RPe=si("peer",{variants:{variant:{default:"",checkedGreen:"data-[state=unchecked]:bg-input data-[state=checked]:bg-success",checkedYellow:"data-[state=unchecked]:bg-input data-[state=checked]:bg-warning",checkedRed:"data-[state=unchecked]:bg-input data-[state=checked]:bg-destructive",uncheckedGreen:"data-[state=unchecked]:bg-success data-[state=checked]:bg-input",uncheckedYellow:"data-[state=unchecked]:bg-warning data-[state=checked]:bg-input",uncheckedRed:"data-[state=unchecked]:bg-destructive data-[state=checked]:bg-input",redGreen:"data-[state=unchecked]:bg-destructive data-[state=checked]:bg-success",greenRed:"data-[state=unchecked]:bg-success data-[state=checked]:bg-destructive"}},defaultVariants:{variant:"default"}}),fr=w.forwardRef(({id:e,checkedLabel:t,uncheckedLabel:n,variant:r,className:i,...s},a)=>c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(jg,{id:e,className:Y(i,RPe({variant:r})),ref:a,...s}),c.jsx("div",{className:"text-sm font-medium leading-none tracking-wide text-muted-foreground select-none hidden peer-data-[state=checked]:inline",children:t}),c.jsx("div",{className:"text-sm font-medium leading-none tracking-wide text-muted-foreground select-none hidden peer-data-[state=unchecked]:inline",children:n})]}));fr.displayName="SwitchText";function MPe(){return c.jsx("span",{className:"tracking-widest text-2xs text-destructive-inline opacity-65 group-hover/cfgCardItem:opacity-100",children:"REQUIRED"})}function jPe(){return c.jsx("span",{className:"tracking-widest text-2xs text-info-inline opacity-0 group-hover/cfgCardItem:opacity-85 group-hover/cfgCardItem:dark:opacity-35",children:"OPTIONAL"})}function NPe(){return c.jsx("span",{className:"rounded-sm bg-accent text-accent-foreground text-2xs tracking-wider font-semibold leading-snug pb-0.5 px-0.5 w-fit mt-0.5",children:"NEW"})}function $M({visible:e,children:t,className:n}){return e?c.jsx("div",{className:Y("text-warning-inline opacity-45 group-hover/cfgCardItem:opacity-100",n),children:t}):null}function ct({children:e,className:t}){return c.jsx("div",{className:Y("text-sm text-muted-foreground",t),children:e})}function ft({label:e,htmlFor:t,required:n,showOptional:r,showNew:i,showIf:s,children:a}){return s!==void 0&&!s?null:c.jsxs("div",{className:"max-w-4xl space-y-2 sm:grid sm:grid-cols-8 sm:gap-4 sm:space-y-0 sm:items-start group/cfgCardItem",children:[c.jsx("div",{className:"sm:col-span-2",children:c.jsxs(Yt,{className:"flex flex-col text-sm font-medium leading-6",htmlFor:t,children:[e,i&&c.jsx(NPe,{}),n&&c.jsx(MPe,{}),r&&c.jsx(jPe,{})]})}),c.jsx("div",{className:"sm:col-span-6 space-y-2",children:a})]})}function Y5(){return c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"absolute inset-0 flex items-center",children:c.jsx("hr",{className:"w-full border-t"})}),c.jsx("div",{className:"relative flex justify-center tracking-wider text-xs",children:c.jsx("span",{className:"bg-background px-2 text-muted-foreground/75",children:"Advanced Options"})})]})}function vH({loading:e,error:t,message:n,className:r}){let i;if(e)i=c.jsxs(c.Fragment,{children:[c.jsx(qt,{className:"animate-spin size-20 opacity-75"}),typeof e=="string"&&c.jsx("span",{className:"max-w-4xl text-2xl tracking-wider text-muted-foreground/75",children:e})]});else if(t)i=c.jsxs(c.Fragment,{children:[c.jsx(JD,{className:"size-16 opacity-75 text-destructive-inline"}),c.jsx("span",{className:"max-w-4xl text-xl text-destructive-inline",children:t})]});else if(n)i=c.jsx("span",{className:"max-w-4xl text-2xl tracking-wider text-muted-foreground/75",children:n});else return null;return c.jsx("div",{className:Y("absolute inset-0 z-10 min-h-20 px-4 py-6 rounded-[inherit] dark:bg-black/25 backdrop-blur-sm flex flex-col items-center justify-center gap-2 text-center",r),children:i})}function xl({cardCtx:e,pageCtx:t,advancedVisible:n,advancedSetter:r,onClickSave:i,children:s}){var h;const[a]=pk(),o=((h=t.cardPendingSave)==null?void 0:h.cardId)===e.cardId,l=e.tabName==="Whitelist"?"Allowlist":e.tabName,u=e.cardName==="Whitelist"?"Allowlist":e.cardName;return c.jsx("div",{id:`tab-${e.cardId}`,"data-show-advanced":n,className:"group/card",children:c.jsxs(bs,{className:"xs:x bg-transparent max-xs:rounded-none max-xs:shadow-none",children:[c.jsxs("ol",{className:"bg-muted/50 border-b p-4 flex flex-wrap items-center gap-1 sm:gap-2.5 select-none text-sm text-muted-foreground tracking-wide",children:[e.tabName!==e.cardName?c.jsxs(c.Fragment,{children:[c.jsx("li",{children:e.tabName}),c.jsx(SS,{className:"size-3.5 mt-0.5 inline align-text-top opacity-75"}),c.jsxs("li",{children:[e.cardName," Settings"]})]}):c.jsxs("li",{children:[l," Settings"]}),o&&c.jsx("li",{className:"text-warning-inline italic tracking-wide",children:"(unsaved changes)"})]}),c.jsxs("div",{className:"relative rounded-b-[inherit]",children:[c.jsxs(yi,{className:"space-y-6 pt-6 bg-transparent overflow-x-clip",ref:a,children:[s,c.jsxs("div",{className:"flex flex-wrap-reverse justify-center xs:justify-start gap-2",children:[c.jsxs(Re,{size:"xs",disabled:!o||t.isReadOnly,onClick:i,children:["Save ",u," Settings",t.isSaving&&c.jsx(qt,{className:"h-3.5 mt-0.5 inline animate-spin"})]}),n!==void 0&&r?c.jsxs(Re,{size:"xs",variant:"muted",onClick:()=>r(!n),children:[n?"Discard":"Show"," Advanced",n?c.jsx(CS,{className:"size-4 ml-1.5"}):c.jsx(Za,{className:"size-4 ml-1.5"})]}):null]})]}),c.jsx(vH,{loading:t.isLoading,error:t.swrError})]})]})})}const BM={checkingEnabled:vt("banlist","enabled"),rejectionMessage:vt("banlist","rejectionMessage"),requiredHwids:vt("banlist","requiredHwidMatches",!0)};function DPe({cardCtx:e,pageCtx:t}){const[n,r]=w.useState(!1),[i,s]=w.useReducer(pl,null,()=>ml(BM)),a=w.useMemo(()=>gl(e.cardId,BM,t.apiData,s),[t.apiData,s]);w.useEffect(()=>{u()},[i]),w.useEffect(()=>{n||Object.values(a).forEach(d=>d.isAdvanced&&d.state.discard())},[n]);const o=w.useRef(null),l={toUi:d=>d?d.toString():void 0,toCfg:d=>d?parseInt(d):void 0},u=()=>{var g;const d={rejectionMessage:(g=o.current)==null?void 0:g.textArea.value},f=vl(a,i,d,n);return t.setCardPendingSave(f.hasChanges?e:null),f},h=()=>{var g;const{hasChanges:d,localConfigs:f}=u();if(d){if((g=f.banlist)!=null&&g.rejectionMessage&&f.banlist.rejectionMessage.length>512)return ze.error({title:"The Ban Rejection Message is too big.",md:!0,msg:"The message must be 512 characters or less."});t.saveChanges(e,f)}};return c.jsxs(xl,{cardCtx:e,pageCtx:t,onClickSave:h,advancedVisible:n,advancedSetter:r,children:[c.jsxs(ft,{label:"Ban Checking",children:[c.jsx(fr,{id:a.checkingEnabled.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",checked:i.checkingEnabled,onCheckedChange:a.checkingEnabled.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Enable checking for ban status on player join. ",c.jsx("br",{}),c.jsx("strong",{children:"Note:"})," txAdmin bans will not work if this option is disabled."]})]}),c.jsxs(ft,{label:"Ban Templates",children:[c.jsx(Ti,{asChild:!0,href:"/settings/ban-templates",children:c.jsxs(Re,{size:"sm",variant:"secondary",disabled:t.isReadOnly,children:[c.jsx(BX,{className:"size-4 mr-1.5 inline-block"})," Edit Ban Templates"]})}),c.jsx(ct,{children:"Configure ban reasons and durations that will appear as dropdown options when banning a player. This is useful for common reasons that happen frequently, like violation of your server rules."})]}),c.jsxs(ft,{label:"Ban Rejection Message",htmlFor:a.rejectionMessage.eid,showOptional:!0,children:[c.jsx(Rf,{id:a.rejectionMessage.eid,ref:o,placeholder:"You can join http://discord.gg/example to appeal this ban.",defaultValue:a.rejectionMessage.initialValue,onInput:u,autoComplete:"off",minHeight:60,maxHeight:180,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Optional message to display to a player on the rejection message that shows when they try to connect while being banned. ",c.jsx("br",{}),"If you have a ban appeal process, you can use this field to inform the players."]})]}),n&&c.jsx(Y5,{}),c.jsxs(ft,{label:"Required Ban HWID Matches",htmlFor:a.requiredHwids.eid,showIf:n,children:[c.jsxs(gn,{value:l.toUi(i.requiredHwids),onValueChange:d=>a.requiredHwids.state.set(l.toCfg(d)),disabled:t.isReadOnly,children:[c.jsx(un,{id:a.requiredHwids.eid,children:c.jsx(vn,{placeholder:"Select..."})}),c.jsxs(dn,{children:[c.jsx(ye,{value:"1",children:"1 - recommended"}),c.jsx(ye,{value:"2",children:"2 - lax"}),c.jsx(ye,{value:"3",children:"3 - very lax"}),c.jsx(ye,{value:"4",children:"4 - virtually disabled"}),c.jsx(ye,{value:"0",children:"Disable HWID Bans"})]})]}),c.jsxs(ct,{children:["This option configures how many HWID tokens must match between a player and an existing ban for the player join to be blocked, or can disable HWID Bans entirely. ",c.jsx("br",{}),"Since Hardware ID Tokens are not guaranteed to be unique, there is the possibility of tokens from two players matching without them being related to each other. ",c.jsx("br",{}),c.jsx("strong",{children:"Note:"})," Most players have 3 to 6 HWID tokens."]})]})]})}const FM=e=>{try{return JSON.stringify(JSON.parse(e),null,4)}catch{return e}},zM={botEnabled:vt("discordBot","enabled"),botToken:vt("discordBot","token"),discordGuild:vt("discordBot","guild"),warningsChannel:vt("discordBot","warningsChannel"),embedJson:vt("discordBot","embedJson"),embedConfigJson:vt("discordBot","embedConfigJson")};function LPe({cardCtx:e,pageCtx:t}){const[n,r]=w.useReducer(pl,null,()=>ml(zM)),i=w.useMemo(()=>gl(e.cardId,zM,t.apiData,r),[t.apiData,r]);w.useEffect(()=>{u()},[n]);const s=w.useRef(null),a=w.useRef(null),o=w.useRef(null),l=d=>{if(d===void 0)return;const f=d.trim();return f.length?f:null},u=()=>{var g,b,x;const d={botToken:l((g=s.current)==null?void 0:g.value),discordGuild:l((b=a.current)==null?void 0:b.value),warningsChannel:l((x=o.current)==null?void 0:x.value)},f=vl(i,n,d,!1);return t.setCardPendingSave(f.hasChanges?e:null),f},h=()=>{var g,b,x,v,m;const{hasChanges:d,localConfigs:f}=u();if(d){if((g=f.discordBot)!=null&&g.enabled){if(!((b=f.discordBot)!=null&&b.token))return ze.error("You must provide a Discord Bot Token to enable the bot.");if(!((x=f.discordBot)!=null&&x.guild))return ze.error("You must provide a Server ID to enable the bot.");if(!((v=f.discordBot)!=null&&v.embedJson)||!((m=f.discordBot)!=null&&m.embedConfigJson))return ze.error("You must provide both the Embed JSON and Config JSON to enable the bot.")}t.saveChanges(e,f)}};return c.jsxs(xl,{cardCtx:e,pageCtx:t,onClickSave:h,children:[c.jsxs(ft,{label:"Discord Bot",children:[c.jsx(fr,{id:i.botEnabled.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",variant:"checkedGreen",checked:n.botEnabled,onCheckedChange:i.botEnabled.state.set,disabled:t.isReadOnly}),c.jsx(ct,{children:"Enable Discord Integration."})]}),c.jsxs(ft,{label:"Token",htmlFor:i.botToken.eid,required:n.botEnabled,children:[c.jsx(yt,{id:i.botToken.eid,ref:s,defaultValue:i.botToken.initialValue,onInput:u,disabled:t.isReadOnly,placeholder:"xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxx",maxLength:96,autoComplete:"off",className:"blur-input",required:!0}),c.jsxs(ct,{children:["To get a token and the bot to join your server, follow these two guides: ",c.jsx("br",{}),c.jsx(pn,{href:"https://discordjs.guide/preparations/setting-up-a-bot-application.html",children:"Setting up a bot application"})," and ",c.jsx(pn,{href:"https://discordjs.guide/preparations/adding-your-bot-to-servers.html",children:"Adding your bot to servers"})," ",c.jsx("br",{}),c.jsx("strong",{children:"Note:"})," Do not reuse the same token for another bot. ",c.jsx("br",{}),c.jsx("strong",{children:"Note:"})," The bot requires the ",c.jsx("strong",{children:"Server Members"})," intent, which can be set at the ",c.jsx(pn,{href:"https://discord.com/developers/applications",children:"Discord Developer Portal"}),"."]})]}),c.jsxs(ft,{label:"Guild/Server ID",htmlFor:i.discordGuild.eid,required:n.botEnabled,children:[c.jsx(yt,{id:i.discordGuild.eid,ref:a,defaultValue:i.discordGuild.initialValue,onInput:u,disabled:t.isReadOnly,placeholder:"000000000000000000"}),c.jsxs(ct,{children:["The ID of the Discord Server (also known as Discord Guild). ",c.jsx("br",{}),"To get the Server ID, go to Discord's settings and ",c.jsx(pn,{href:"https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png",children:"enable developer mode"}),', then right-click on the guild icon select "Copy ID".']})]}),c.jsxs(ft,{label:"Warnings Channel ID",htmlFor:i.warningsChannel.eid,showOptional:!0,children:[c.jsx(yt,{id:i.warningsChannel.eid,ref:o,defaultValue:i.warningsChannel.initialValue,onInput:u,disabled:t.isReadOnly,placeholder:"000000000000000000"}),c.jsxs(ct,{children:["The ID of the channel to send Announcements (eg server restarts). ",c.jsx("br",{}),"You can leave it blank to disable this feature. ",c.jsx("br",{}),"To get the channel ID, go to Discord's settings and ",c.jsx(pn,{href:"https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png",children:"enable developer mode"}),', then right-click on the channel name and select "Copy ID".']})]}),c.jsxs(ft,{label:"Status Embed JSON",htmlFor:i.embedJson.eid,required:n.botEnabled,children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(Oc,{id:i.embedJson.eid,placeholder:"{}",value:FM(n.embedJson??""),onChange:d=>i.embedJson.state.set(d.target.value),autoComplete:"off",style:{minHeight:512},disabled:t.isReadOnly,spellCheck:!1}),c.jsxs("div",{className:"w-full flex flex-wrap justify-between gap-6",children:[c.jsxs(Re,{className:"grow",variant:"outline",onClick:()=>i.embedJson.state.discard(),disabled:t.isReadOnly,children:[c.jsx(Kn,{className:"mr-2 h-4 w-4"})," Discard Changes"]}),c.jsxs(Re,{className:"grow border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",variant:"outline",onClick:()=>i.embedJson.state.default(),disabled:t.isReadOnly,children:[c.jsx(i_,{className:"mr-2 h-4 w-4"})," Reset to Default"]})]})]}),c.jsxs(ct,{children:["The server status embed is customizable by editing the JSON above. ",c.jsx("br",{}),c.jsx("strong",{children:"Note:"})," Use the command ",c.jsx(Be,{children:"/status add"}),' on a channel that the bot has the "Send Message" permission to setup the embed.']})]}),c.jsxs(ft,{label:"Status Config JSON",htmlFor:i.embedConfigJson.eid,required:n.botEnabled,children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(Oc,{id:i.embedConfigJson.eid,placeholder:"{}",value:FM(n.embedConfigJson??""),onChange:d=>i.embedConfigJson.state.set(d.target.value),autoComplete:"off",style:{minHeight:512},disabled:t.isReadOnly,spellCheck:!1}),c.jsxs("div",{className:"w-full flex flex-wrap justify-between gap-6",children:[c.jsxs(Re,{className:"grow",variant:"outline",onClick:()=>i.embedConfigJson.state.discard(),disabled:t.isReadOnly,children:[c.jsx(Kn,{className:"mr-2 h-4 w-4"})," Discard Changes"]}),c.jsxs(Re,{className:"grow border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",variant:"outline",onClick:()=>i.embedConfigJson.state.default(),disabled:t.isReadOnly,children:[c.jsx(i_,{className:"mr-2 h-4 w-4"})," Reset to Default"]})]})]}),c.jsxs(ct,{children:["The server status embed is customizable by editing the JSON above. ",c.jsx("br",{}),c.jsx("strong",{children:"Note:"})," Use the command ",c.jsx(Be,{children:"/status add"}),' on a channel that the bot has the "Send Message" permission to setup the embed.']})]})]})}function PPe({value:e,label24h:t,label12h:n}){return c.jsx(ye,{value:e,className:"group/timeOption",children:c.jsxs("div",{className:"flex justify-around gap-2 items-center",children:[c.jsx("div",{className:"font-medium min-w-[2ch]",children:t}),c.jsx("div",{className:"text-muted-foreground group-focus/timeOption:text-primary-foreground group-focus/timeOption:dark:text-primary text-sm min-w-[5ch] text-right",children:n})]})})}function OPe({title:e,isOpen:t,onClose:n,onSubmit:r}){const[i,s]=w.useState("00"),[a,o]=w.useState("00"),l=`timeinput-${w.useId()}`,u=`timeinput-${w.useId()}`,h=()=>{r(`${i}:${a}`),s("00"),o("00"),n()},d=w.useMemo(()=>Array.from({length:24},(f,g)=>{const b=g.toString().padStart(2,"0"),x=g<12?"AM":"PM",v=g%12||12;return{value:b,label24h:b,label12h:`${v} ${x}`}}),[]);return c.jsx(ea,{open:t,onOpenChange:n,children:c.jsxs(Us,{className:"sm:max-w-sm",children:[c.jsx(Vs,{children:c.jsx(qs,{children:e})}),c.jsx("div",{className:"grid gap-4 py-4",children:c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"flex flex-col space-y-1.5",children:[c.jsx(Yt,{htmlFor:l,className:"text-sm font-medium",children:"Hour"}),c.jsxs(gn,{onValueChange:s,value:i,children:[c.jsx(un,{id:l,children:c.jsx(vn,{placeholder:"Select hour"})}),c.jsx(dn,{children:d.map(f=>c.jsx(PPe,{...f},f.value))})]})]}),c.jsxs("div",{className:"flex flex-col space-y-1.5",children:[c.jsx(Yt,{htmlFor:u,className:"text-sm font-medium",children:"Minute"}),c.jsxs(gn,{onValueChange:o,value:a,children:[c.jsx(un,{id:u,children:c.jsx(vn,{placeholder:"Select minute"})}),c.jsxs(dn,{onBlur:f=>f.preventDefault(),children:[c.jsx(ye,{value:"00",children:"00"}),c.jsx(ye,{value:"05",children:"05"}),c.jsx(ye,{value:"10",children:"10"}),c.jsx(ye,{value:"15",children:"15"}),c.jsx(ye,{value:"20",children:"20"}),c.jsx(ye,{value:"25",children:"25"}),c.jsx(ye,{value:"30",children:"30"}),c.jsx(ye,{value:"35",children:"35"}),c.jsx(ye,{value:"40",children:"40"}),c.jsx(ye,{value:"45",children:"45"}),c.jsx(ye,{value:"50",children:"50"}),c.jsx(ye,{value:"55",children:"55"})]})]})]})]})}),c.jsx(du,{children:c.jsx(Re,{onClick:h,children:"Add Time"})})]})})}function HM(e){return Array.from(new Set(e)).sort((n,r)=>{const[i,s]=n.split(":").map(Number),[a,o]=r.split(":").map(Number);return i-a||s-o})}function IPe({restartTimes:e,setRestartTimes:t,disabled:n}){const[r,i]=w.useState(!1),[s]=pk(),a=d=>{!e||n||t(f=>HM([...f??[],d]))},o=d=>{!e||n||t(f=>HM((f??[]).filter((g,b)=>b!==d)))},l=d=>{!e||n||t(d)},u=()=>{n||t([])},h=Y("text-muted-foreground",n&&"opacity-50 cursor-not-allowed");return c.jsxs("div",{className:"py-3 px-2 min-h-[4.5rem] flex items-center border rounded-lg",children:[c.jsxs("div",{className:Y("w-full flex items-center gap-2",n&&"cursor-not-allowed"),children:[c.jsxs("div",{className:"flex flex-wrap gap-2 grow",ref:s,children:[e&&e.length===0&&c.jsxs("div",{className:"text-sm text-muted-foreground",children:[c.jsxs("span",{children:["No schedule set. Click on the ",c.jsx("strong",{children:"+"})," button to add a time."]}),c.jsxs("p",{children:["Presets: ",c.jsxs("a",{onClick:()=>l(["00:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["1x",c.jsx("span",{className:h,children:"/day"})]}),", ",c.jsxs("a",{onClick:()=>l(["00:00","12:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["2x",c.jsx("span",{className:h,children:"/day"})]}),", ",c.jsxs("a",{onClick:()=>l(["00:00","08:00","16:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["3x",c.jsx("span",{className:h,children:"/day"})]}),", ",c.jsxs("a",{onClick:()=>l(["00:00","06:00","12:00","18:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["4x",c.jsx("span",{className:h,children:"/day"})]})]})]}),e&&e.map((d,f)=>c.jsxs("div",{className:"flex items-center space-x-1 bg-secondary text-secondary-foreground px-3 py-1 rounded-md select-none",children:[c.jsx("span",{className:"font-mono",children:d}),!n&&c.jsx("button",{onClick:()=>o(f),className:"ml-2 text-secondary-foreground/50 hover:text-destructive","aria-label":"Remove",disabled:n,children:c.jsx(Kn,{className:"size-4"})})]},d))]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Re,{onClick:()=>i(!0),variant:"secondary",size:"xs",className:"w-10 hover:bg-primary hover:text-primary-foreground","aria-label":"Add",disabled:n,children:c.jsx(TS,{className:"h-4"})}),c.jsx(Re,{onClick:()=>u(),variant:"muted",size:"xs",className:"w-10 hover:bg-destructive hover:text-destructive-foreground","aria-label":"Clear",disabled:n||!e||e.length===0,children:c.jsx(nJ,{className:"h-3.5"})})]})]}),c.jsx(OPe,{title:"Add Restart Time",isOpen:r,onClose:()=>i(!1),onSubmit:a})]})}const $Pe=e=>e?`${e.replace(/\/$/,"")}/CFXDefault`:window.txConsts.isWindows?"C:/Users/Admin/Desktop/CFXDefault":"/root/fivem/txData/CFXDefault";function BPe(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(window.txConsts.serverTimezone!==e)return c.jsxs(ct,{className:"text-destructive-inline",children:[c.jsx("strong",{children:"Warning:"})," Your server timezone is set to ",c.jsx(Be,{children:window.txConsts.serverTimezone}),", but your browser timezone is ",c.jsx(Be,{children:e}),". Make sure to configure the time according to the server timezone."]})}catch(e){console.error(e)}return null}const WM={dataPath:vt("server","dataPath"),restarterSchedule:vt("restarter","schedule"),quietMode:vt("server","quiet"),cfgPath:vt("server","cfgPath",!0),startupArgs:vt("server","startupArgs",!0),onesync:vt("server","onesync",!0),autoStart:vt("server","autoStart",!0),resourceTolerance:vt("restarter","resourceStartingTolerance",!0)};function FPe({cardCtx:e,pageCtx:t}){var k,T,A;const[n,r]=w.useState(!1),[i,s]=w.useState(!1),{hasPerm:a}=Xn(),o=zs()[1],l=Yv(),[u,h]=w.useReducer(pl,null,()=>ml(WM)),d=w.useMemo(()=>gl(e.cardId,WM,t.apiData,h),[t.apiData,h]);w.useEffect(()=>{y()},[u]),w.useEffect(()=>{n||Object.values(d).forEach(M=>M.isAdvanced&&M.state.discard())},[n]);const f=w.useRef(null),g=w.useRef(null),b=w.useRef(null),x=(k=t.apiData)==null?void 0:k.forceQuietMode,v={toUi:M=>M?M.toString():void 0,toCfg:M=>M?parseInt(M):void 0},m={toUi:M=>M?M.join(" "):"",toCfg:M=>M?M.trim().split(/\s+/):[]},p=M=>{if(M===void 0)return;const D=M.trim();return D.length?D:null},y=()=>{var O,B,z;let M;b.current&&(M=m.toCfg(b.current.value));let D;(O=f.current)!=null&&O.value&&(D=f.current.value.replace(/\\/g,"/").replace(/\/\/+/,"/"),D.endsWith("/")&&(D=D.slice(0,-1)));const L={dataPath:p((B=f.current)==null?void 0:B.value),cfgPath:(z=g.current)==null?void 0:z.value,startupArgs:M},N=vl(d,u,L,n);return t.setCardPendingSave(N.hasChanges?e:null),N},_=()=>{var L,N;const{hasChanges:M,localConfigs:D}=y();if(M){if(!((L=D.server)!=null&&L.dataPath))return ze.error({title:"The Server Data Folder is required.",md:!0,msg:'If you want to return to the Setup page, click on the "Reset" button instead.'});if(D.server.cfgPath!==void 0&&!D.server.cfgPath)return ze.error({title:"The CFG File Path is required.",md:!0,msg:"The value should probably be `server.cfg`."});if(Array.isArray((N=D.server)==null?void 0:N.startupArgs)&&D.server.startupArgs.some(O=>O.toLowerCase()==="onesync"))return ze.error({title:"You cannot set OneSync in Startup Arguments.",md:!0,msg:"Please use the selectbox below it."});t.saveChanges(e,D)}},C=w.useMemo(()=>{var M;return $Pe((M=t.apiData)==null?void 0:M.dataPath)},[t.apiData]),S=bt({method:"POST",path:"/settings/resetServerDataPath",throwGenericErrors:!0}),E=()=>{l({title:"Reset Server Data Path",message:c.jsxs(c.Fragment,{children:["Are you sure you want to reset the server data path? ",c.jsx("br",{}),c.jsx("br",{}),c.jsx("strong",{children:"This will not delete any resource files or database"}),", but just reset the txAdmin configuration, allowing you to go back to the Setup page. ",c.jsx("br",{}),"If you want, you can set the path back to the current value later. ",c.jsx("br",{}),c.jsx("br",{}),c.jsx("strong",{className:"text-warning-inline",children:"Warning:"})," take note of the current path before proceeding, so you can set it back later if you need to. Current path:",c.jsx(yt,{value:d.dataPath.initialValue,className:"mt-2",readOnly:!0})]}),onConfirm:()=>{s(!0),S({toastLoadingMessage:"Resetting server data path...",success:(M,D)=>{M.type==="success"&&o("/server/setup")},finally:()=>s(!1)})}})};return c.jsxs(xl,{cardCtx:e,pageCtx:t,onClickSave:_,advancedVisible:n,advancedSetter:r,children:[c.jsxs(ft,{label:"Server Data Folder",htmlFor:d.dataPath.eid,required:!0,children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx(yt,{id:d.dataPath.eid,ref:f,defaultValue:d.dataPath.initialValue,placeholder:C,onInput:y,disabled:t.isReadOnly,required:!0}),c.jsxs(Re,{className:"grow border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",variant:"outline",disabled:t.isReadOnly||!a("all_permissions")||i,onClick:E,children:[c.jsx(RS,{className:"mr-2 h-4 w-4"})," Reset"]})]}),c.jsxs(ct,{children:["The full path of the folder that ",c.jsx("strong",{children:"contains"})," the ",c.jsx(Be,{children:"resources"})," folder, usually it's the same place that contains your ",c.jsx(Be,{children:"server.cfg"}),". ",c.jsx("br",{}),"Resetting this value will allow you to go back to the Setup page, without deleting any files.",((T=t.apiData)==null?void 0:T.dataPath)&&((A=t.apiData)==null?void 0:A.hasCustomDataPath)&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),c.jsxs("span",{className:"text-warning-inline",children:[window.txConsts.hostConfigSource,": This path should start with ",c.jsx(Be,{children:t.apiData.dataPath})," ."]})]})]})]}),c.jsxs(ft,{label:"Restart Schedule",showOptional:!0,children:[c.jsx(IPe,{restartTimes:u.restarterSchedule,setRestartTimes:d.restarterSchedule.state.set,disabled:t.isReadOnly}),c.jsx(BPe,{}),c.jsxs(ct,{children:["At which times of day to restart the server. ",c.jsx("br",{}),c.jsx("strong",{children:"Note:"})," Make sure your schedule matches your server time and not your local time."]})]}),c.jsxs(ft,{label:"Quiet Mode",children:[c.jsx(fr,{id:d.quietMode.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",checked:x||u.quietMode,onCheckedChange:d.quietMode.state.set,disabled:t.isReadOnly||x}),c.jsxs(ct,{children:["Do not print FXServer's output to the terminal. ",c.jsx("br",{}),"You will still be able to use the Live Console.",x&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),c.jsxs("span",{className:"text-warning-inline",children:[window.txConsts.hostConfigSource,": This setting is locked and cannot be changed."]})]})]})]}),n&&c.jsx(Y5,{}),c.jsxs(ft,{label:"CFG File Path",htmlFor:d.cfgPath.eid,showIf:n,required:!0,children:[c.jsx(yt,{id:d.cfgPath.eid,ref:g,defaultValue:d.cfgPath.initialValue,placeholder:"server.cfg",onInput:y,disabled:t.isReadOnly,required:!0}),c.jsxs(ct,{children:["The path to your server config file, probably named ",c.jsx(Be,{children:"server.cfg"}),". ",c.jsx("br",{}),"This can either be absolute, or relative to the Server Data folder."]})]}),c.jsxs(ft,{label:"Startup Arguments",htmlFor:d.startupArgs.eid,showIf:n,children:[c.jsx(yt,{id:d.startupArgs.eid,ref:b,defaultValue:m.toUi(d.startupArgs.initialValue),placeholder:"--trace-warning",onInput:y,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Additional command-line arguments to pass to the FXServer instance such as NodeJS CLI flags. ",c.jsx("br",{}),c.jsx("strong",{children:"Warning:"})," You almost certainly should not use this option, commands and convars should be placed in your ",c.jsx(Be,{children:"server.cfg"})," instead."]})]}),c.jsxs(ft,{label:"OneSync",htmlFor:d.onesync.eid,showIf:n,children:[c.jsxs(gn,{value:u.onesync,onValueChange:d.onesync.state.set,disabled:t.isReadOnly,children:[c.jsx(un,{id:d.onesync.eid,children:c.jsx(vn,{placeholder:"Select OneSync option"})}),c.jsxs(dn,{children:[c.jsx(ye,{value:"on",children:"On (recommended)"}),c.jsx(ye,{value:"legacy",children:"Legacy"}),c.jsx(ye,{value:"off",children:"Off"})]})]}),c.jsxs(ct,{children:["Most servers should be using ",c.jsx("strong",{children:"OneSync On"}),". ",c.jsx("br",{}),"The other options are considered deprecated and should not be used unless you know what you're doing. For more information, please read the ",c.jsx(pn,{href:"https://docs.fivem.net/docs/scripting-reference/onesync/",children:"documentation"}),"."]})]}),c.jsxs(ft,{label:"Autostart",showIf:n,children:[c.jsx(fr,{id:d.autoStart.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",checked:u.autoStart,onCheckedChange:d.autoStart.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Start the server automatically after ",c.jsx("strong",{children:"txAdmin"})," starts."]})]}),c.jsxs(ft,{label:"Resource Starting Tolerance",htmlFor:d.resourceTolerance.eid,showIf:n,children:[c.jsxs(gn,{value:v.toUi(u.resourceTolerance),onValueChange:M=>d.resourceTolerance.state.set(v.toCfg(M)),disabled:t.isReadOnly,children:[c.jsx(un,{id:d.resourceTolerance.eid,children:c.jsx(vn,{placeholder:"Select..."})}),c.jsxs(dn,{children:[c.jsx(ye,{value:"90",children:"1.5 minutes (default)"}),c.jsx(ye,{value:"180",children:"3 minutes"}),c.jsx(ye,{value:"300",children:"5 minutes"}),c.jsx(ye,{value:"600",children:"10 minutes"})]})]}),c.jsxs(ct,{children:["At server boot, how much time to wait for any single resource to start before restarting the server. ",c.jsx("br",{}),c.jsx("strong",{children:"Note:"})," If you are getting ",c.jsx(Be,{children:"failed to start in time"})," errors, increase this value."]})]})]})}const UM={menuEnabled:vt("gameFeatures","menuEnabled"),alignRight:vt("gameFeatures","menuAlignRight"),pageKey:vt("gameFeatures","menuPageKey"),playerModePtfx:vt("gameFeatures","playerModePtfx")};function zPe({cardCtx:e,pageCtx:t}){const[n,r]=w.useState(!1),[i,s]=w.useReducer(pl,null,()=>ml(UM)),a=w.useMemo(()=>gl(e.cardId,UM,t.apiData,s),[t.apiData,s]);w.useEffect(()=>{o()},[i]),w.useEffect(()=>{n||Object.values(a).forEach(h=>h.isAdvanced&&h.state.discard())},[n]);const o=()=>{const d=vl(a,i,{},n);return t.setCardPendingSave(d.hasChanges?e:null),d},l=()=>{const{hasChanges:h,localConfigs:d}=o();h&&t.saveChanges(e,d)},u=h=>{h.metaKey||h.preventDefault(),["Escape","Backspace"].includes(h.code)?a.pageKey.state.set("Tab"):a.pageKey.state.set(h.code)};return c.jsxs(xl,{cardCtx:e,pageCtx:t,onClickSave:l,advancedVisible:n,advancedSetter:r,children:[c.jsxs(ft,{label:"Game Menu",children:[c.jsx(fr,{id:a.menuEnabled.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",variant:"checkedGreen",checked:i.menuEnabled,onCheckedChange:a.menuEnabled.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["When enabled, admins will be able to open the menu by typing ",c.jsx(Be,{children:"/tx"})," or using the keybind configured in the FiveM/RedM settings."]})]}),c.jsxs(ft,{label:"Align Menu Right",children:[c.jsx(fr,{id:a.alignRight.eid,checkedLabel:"Right aligned",uncheckedLabel:"Left aligned",checked:i.alignRight,onCheckedChange:a.alignRight.state.set,disabled:t.isReadOnly}),c.jsx(ct,{children:"Move menu to the right side of the screen."})]}),c.jsxs(ft,{label:"Menu Page Switch Key",htmlFor:a.pageKey.eid,required:!0,children:[c.jsx(yt,{id:a.pageKey.eid,value:i.pageKey,placeholder:"click here and use the key to change",onKeyDown:u,className:"font-mono",readOnly:!0,onInput:o,disabled:t.isReadOnly}),c.jsxs(ct,{children:["The key used to to switch tabs in the menu. ",c.jsx("br",{}),"Click above and press any key to change the configuration. ",c.jsx("br",{}),c.jsx("strong",{children:"Note:"})," The default is ",c.jsx(Be,{children:"Tab"}),", and you cannot use ",c.jsx(Be,{children:"Escape"})," or ",c.jsx(Be,{children:"Backspace"}),"."]})]}),n&&c.jsx(Y5,{}),c.jsxs(ft,{label:"Player Mode Change Effect",showIf:n,children:[c.jsx(fr,{id:a.playerModePtfx.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",variant:"checkedGreen",checked:i.playerModePtfx,onCheckedChange:a.playerModePtfx.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Play a particle effect and sound when an admin uses NoClip, God Mode, etc. ",c.jsx("br",{}),c.jsx("strong",{className:"text-warning-inline",children:"Warning:"})," This options help prevent admin abuse during PvP by making it visible/audible to all players that an admin is using a special mode. We recommend keeping it enabled."]})]})]})}const VM={hideAdminInPunishments:vt("gameFeatures","hideAdminInPunishments"),hideAdminInMessages:vt("gameFeatures","hideAdminInMessages"),hideDefaultAnnouncement:vt("gameFeatures","hideDefaultAnnouncement"),hideDefaultDirectMessage:vt("gameFeatures","hideDefaultDirectMessage"),hideDefaultWarning:vt("gameFeatures","hideDefaultWarning"),hideScheduledRestartWarnings:vt("gameFeatures","hideDefaultScheduledRestartWarning")};function HPe({cardCtx:e,pageCtx:t}){const[n,r]=w.useReducer(pl,null,()=>ml(VM)),i=w.useMemo(()=>gl(e.cardId,VM,t.apiData,r),[t.apiData,r]);w.useEffect(()=>{s()},[n]);const s=()=>{const l=vl(i,n,{},!1);return t.setCardPendingSave(l.hasChanges?e:null),l},a=()=>{const{hasChanges:o,localConfigs:l}=s();o&&t.saveChanges(e,l)};return c.jsxs(xl,{cardCtx:e,pageCtx:t,onClickSave:a,children:[c.jsxs(ft,{label:"Hide Admin Name In Punishments",children:[c.jsx(fr,{id:i.hideAdminInPunishments.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideAdminInPunishments,onCheckedChange:i.hideAdminInPunishments.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Never show to the players the admin name on ",c.jsx("strong",{children:"Bans"})," or ",c.jsx("strong",{children:"Warns"}),". ",c.jsx("br",{}),"This information will still be available in the history and logs."]})]}),c.jsxs(ft,{label:"Hide Admin Name In Messages",children:[c.jsx(fr,{id:i.hideAdminInMessages.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideAdminInMessages,onCheckedChange:i.hideAdminInMessages.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Do not show the admin name on ",c.jsx("strong",{children:"Announcements"})," or ",c.jsx("strong",{children:"DMs"}),". ",c.jsx("br",{}),"This information will still be available in the live console and logs."]})]}),c.jsxs(ft,{label:"Hide Announcement Notifications",children:[c.jsx(fr,{id:i.hideDefaultAnnouncement.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideDefaultAnnouncement,onCheckedChange:i.hideDefaultAnnouncement.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Suppresses the display of announcements, allowing you to implement your own announcement via the event ",c.jsx(Be,{children:"txAdmin:events:announcement"}),".  ",c.jsx(pn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsannouncement",children:"Documentation"})]})]}),c.jsxs(ft,{label:"Hide Direct Message Notification",children:[c.jsx(fr,{id:i.hideDefaultDirectMessage.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideDefaultDirectMessage,onCheckedChange:i.hideDefaultDirectMessage.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Suppresses the display of direct messages, allowing you to implement your own direct message notification via the event ",c.jsx(Be,{children:"txAdmin:events:playerDirectMessage"}),".  ",c.jsx(pn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsplayerdirectmessage",children:"Documentation"})]})]}),c.jsxs(ft,{label:"Hide Warning Notification",children:[c.jsx(fr,{id:i.hideDefaultWarning.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideDefaultWarning,onCheckedChange:i.hideDefaultWarning.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Suppresses the display of warnings, allowing you to implement your own warning via the event ",c.jsx(Be,{children:"txAdmin:events:playerWarned"}),".  ",c.jsx(pn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsplayerwarned",children:"Documentation"})]})]}),c.jsxs(ft,{label:"Hide Scheduled Restart Warnings",children:[c.jsx(fr,{id:i.hideScheduledRestartWarnings.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideScheduledRestartWarnings,onCheckedChange:i.hideScheduledRestartWarnings.state.set,disabled:t.isReadOnly}),c.jsxs(ct,{children:["Suppresses the display of scheduled restart warnings, allowing you to implement your own warning via the event ",c.jsx(Be,{children:"txAdmin:events:scheduledRestart"}),".  ",c.jsx(pn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsscheduledrestart",children:"Documentation"})]})]})]})}const WPe=()=>{const e=Array.isArray(window.txBrowserLocale)?window.txBrowserLocale[0]:window.txBrowserLocale;try{return new Intl.Locale(e).language}catch{}try{if(e.includes("-"))return e.split("-")[0]}catch{}},qM={serverName:vt("general","serverName"),language:vt("general","language")};function UPe({cardCtx:e,pageCtx:t}){const[n,r]=w.useReducer(pl,null,()=>ml(qM)),i=w.useMemo(()=>gl(e.cardId,qM,t.apiData,r),[t.apiData,r]);w.useEffect(()=>{a()},[n]);const s=w.useRef(null),a=()=>{var d;const u={serverName:(d=s.current)==null?void 0:d.value},h=vl(i,n,u,!1);return t.setCardPendingSave(h.hasChanges?e:null),h},o=()=>{var d,f,g;const{hasChanges:u,localConfigs:h}=a();if(u){if(!((d=h.general)!=null&&d.serverName))return ze.error("The Server Name is required.");if(((g=(f=h.general)==null?void 0:f.serverName)==null?void 0:g.length)>18)return ze.error("The Server Name is too big.");t.saveChanges(e,h)}},l=w.useMemo(()=>{var g,b;if(!((g=t.apiData)!=null&&g.locales))return null;const u=WPe();let h,d,f=[];for(const x of(b=t.apiData)==null?void 0:b.locales)x.code==="en"?h=x:x.code===u?d={code:x.code,label:`${x.label} (browser)`}:f.push(x);return[h,d,"sep1",...f,"sep2",{code:"custom",label:"Custom (txData/locale.json)"}].filter(Boolean)},[t.apiData]);return c.jsxs(xl,{cardCtx:e,pageCtx:t,onClickSave:o,children:[c.jsxs(ft,{label:"Server Name",htmlFor:i.serverName.eid,required:!0,children:[c.jsx(yt,{id:i.serverName.eid,ref:s,defaultValue:i.serverName.initialValue,placeholder:"Example RP",onInput:a,disabled:t.isReadOnly}),c.jsxs(ct,{children:["A ",c.jsx("strong",{children:"short"})," server name to be used in the txAdmin interface and Server/Discord messages. ",c.jsx("br",{}),"The name must be between 1 and 18 characters."]})]}),c.jsxs(ft,{label:"Language",htmlFor:i.language.eid,required:!0,children:[c.jsxs(gn,{value:n.language,onValueChange:i.language.state.set,disabled:t.isReadOnly,children:[c.jsx(un,{id:i.language.eid,children:c.jsx(vn,{placeholder:"Select..."})}),c.jsx(dn,{children:l==null?void 0:l.map(u=>typeof u=="object"?c.jsx(ye,{value:u.code,children:u.label},u.code):c.jsx(MC,{},u))})]}),c.jsxs(ct,{children:["The language to use on Chat/Discord messages. ",c.jsx("br",{}),"You can customize the phrases/words by using the ",c.jsx(Be,{children:"Custom"})," option. ",c.jsx("br",{}),"For more information, please read the ",c.jsx(pn,{href:"https://github.com/tabarra/txAdmin/blob/master/docs/translation.md",children:"documentation"}),"."]})]})]})}var X5="Radio",[VPe,xH]=Cn(X5),[qPe,GPe]=VPe(X5),yH=w.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:a,value:o="on",onCheck:l,form:u,...h}=e,[d,f]=w.useState(null),g=Le(t,v=>f(v)),b=w.useRef(!1),x=d?u||!!d.closest("form"):!0;return c.jsxs(qPe,{scope:n,checked:i,disabled:a,children:[c.jsx(Ce.button,{type:"button",role:"radio","aria-checked":i,"data-state":wH(i),"data-disabled":a?"":void 0,disabled:a,value:o,...h,ref:g,onClick:ae(e.onClick,v=>{i||l==null||l(),x&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),x&&c.jsx(KPe,{control:d,bubbles:!b.current,name:r,value:o,checked:i,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});yH.displayName=X5;var bH="RadioIndicator",_H=w.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,s=GPe(bH,n);return c.jsx(on,{present:r||s.checked,children:c.jsx(Ce.span,{"data-state":wH(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})})});_H.displayName=bH;var KPe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,s=w.useRef(null),a=bf(n),o=gf(t);return w.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),c.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...e.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function wH(e){return e?"checked":"unchecked"}var YPe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],J5="RadioGroup",[XPe,t9e]=Cn(J5,[uu,xH]),SH=uu(),CH=xH(),[JPe,QPe]=XPe(J5),kH=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:a=!1,disabled:o=!1,orientation:l,dir:u,loop:h=!0,onValueChange:d,...f}=e,g=SH(n),b=Ja(u),[x,v]=Pr({prop:s,defaultProp:i,onChange:d});return c.jsx(JPe,{scope:n,name:r,required:a,disabled:o,value:x,onValueChange:v,children:c.jsx(PC,{asChild:!0,...g,orientation:l,dir:b,loop:h,children:c.jsx(Ce.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":o?"":void 0,dir:b,...f,ref:t})})})});kH.displayName=J5;var EH="RadioGroupItem",TH=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,s=QPe(EH,n),a=s.disabled||r,o=SH(n),l=CH(n),u=w.useRef(null),h=Le(t,u),d=s.value===i.value,f=w.useRef(!1);return w.useEffect(()=>{const g=x=>{YPe.includes(x.key)&&(f.current=!0)},b=()=>f.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",b)}},[]),c.jsx(OC,{asChild:!0,...o,focusable:!a,active:d,children:c.jsx(yH,{disabled:a,required:s.required,checked:d,...l,...i,name:s.name,ref:h,onCheck:()=>s.onValueChange(i.value),onKeyDown:ae(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:ae(i.onFocus,()=>{var g;f.current&&((g=u.current)==null||g.click())})})})});TH.displayName=EH;var ZPe="RadioGroupIndicator",AH=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=CH(n);return c.jsx(_H,{...i,...r,ref:t})});AH.displayName=ZPe;var RH=kH,MH=TH,e7e=AH;const jH=w.forwardRef(({className:e,...t},n)=>c.jsx(RH,{className:Y("grid gap-2",e),...t,ref:n}));jH.displayName=RH.displayName;const NH=w.forwardRef(({className:e,...t},n)=>c.jsx(MH,{ref:n,className:Y("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:c.jsx(e7e,{className:"flex items-center justify-center",children:c.jsx(GD,{className:"h-2.5 w-2.5 fill-current text-current"})})}));NH.displayName=MH.displayName;function Ll(e){const t="radio"+w.useId(),n=!!e.disableReason;return c.jsx("div",{className:"group",children:c.jsxs(Yt,{htmlFor:t,className:Y("flex items-center gap-3 border rounded-lg p-3 cursor-pointer hover:bg-card data-[state=checked]:border-primary/50 data-[state=checked]:bg-muted select-none",n&&"cursor-not-allowed opacity-60 hover:bg-transparent"),"data-state":e.groupValue===e.value?"checked":"unchecked","aria-disabled":n,children:[c.jsx(NH,{value:e.value,id:t,disabled:n}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-bold",children:e.title}),e.newOptionBadgeFeatName&&c.jsx(mO,{featName:e.newOptionBadgeFeatName,className:"pb-1 pt-0.5",size:"md",durationDays:28})]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc}),e.disableReason&&c.jsx("p",{className:"text-sm text-warning-inline",children:e.disableReason})]})]})})}const GM={whitelistMode:vt("whitelist","mode"),rejectionMessage:vt("whitelist","rejectionMessage"),discordRoles:vt("whitelist","discordRoles")};function t7e({cardCtx:e,pageCtx:t}){var f,g;const[n,r]=w.useReducer(pl,null,()=>ml(GM)),i=w.useMemo(()=>gl(e.cardId,GM,t.apiData,r),[t.apiData,r]);w.useEffect(()=>{u()},[n]);const s=w.useRef(null),a=w.useRef(null),o={toUi:b=>b?b.join(", "):"",toCfg:b=>b?b.split(/[,;]\s*/).map(x=>x.trim()).filter(x=>x.length):[]},l=((g=(f=t.apiData)==null?void 0:f.storedConfigs.discordBot)==null?void 0:g.enabled)===!0,u=()=>{let b;a.current&&(b=o.toCfg(a.current.value));let x;s.current&&(x=s.current.textArea.value.trim());const m=vl(i,n,{rejectionMessage:x,discordRoles:b},!1);return t.setCardPendingSave(m.hasChanges?e:null),m},h=()=>{var m,p,y,_,C,S,E,k,T,A;const{hasChanges:b,localConfigs:x}=u();if(!b)return;if(((m=x.whitelist)==null?void 0:m.mode)!=="disabled"&&((p=x.whitelist)==null?void 0:p.mode)!=="adminOnly"&&!((y=x.whitelist)!=null&&y.rejectionMessage))return ze.error("Please fill in the Allowlist Instructions field to be able to enable this allowlist mode.");if((_=x.whitelist)!=null&&_.rejectionMessage&&x.whitelist.rejectionMessage.length>512)return ze.error({title:"The Allowlist Instructions is too big.",md:!0,msg:"The message must be 512 characters or less."});if(((C=x.whitelist)==null?void 0:C.mode)==="discordMember"||((S=x.whitelist)==null?void 0:S.mode)==="discordRoles"){if(!l)return ze.warning({title:"Discord Bot is required.",msg:"You need to enable the Discord Bot in the Discord tab to use Discord-based allowlist modes."});if(((E=x.whitelist)==null?void 0:E.mode)==="discordRoles"&&(!Array.isArray((k=x.whitelist)==null?void 0:k.discordRoles)||!((T=x.whitelist)!=null&&T.discordRoles.length)))return ze.warning({title:"Discord Roles are required.",msg:'You need to specify at least one Discord Role ID to use the "Discord Server Roles" allowlist mode.'})}if(Array.isArray((A=x.whitelist)==null?void 0:A.discordRoles)){const M=x.whitelist.discordRoles.filter(D=>!Tr.regexDiscordSnowflake.test(D)).map(D=>`- \`${D.slice(0,20)}\``);if(M.length)return ze.error({title:"Invalid Discord Role ID(s).",md:!0,msg:`The following Discord Role ID(s) are invalid: 
`+M.join(`
`)})}t.saveChanges(e,x)},d=n.whitelistMode!=="disabled"&&n.whitelistMode!=="adminOnly";return c.jsxs(xl,{cardCtx:e,pageCtx:t,onClickSave:h,children:[c.jsxs(ft,{label:"Allowlist Mode",children:[c.jsxs(jH,{value:n.whitelistMode,onValueChange:i.whitelistMode.state.set,disabled:t.isReadOnly,children:[c.jsx(Ll,{groupValue:n.whitelistMode,value:"disabled",title:"Disabled",desc:c.jsxs(c.Fragment,{children:["Select this option if your server is public and open for all players to join. When a player connects, txAdmin will only check if they are banned ",c.jsx("i",{children:"(if that is enabled)"})," and nothing else."]})}),c.jsx(Ll,{groupValue:n.whitelistMode,value:"adminOnly",title:"Admin-only (maintenance mode)",desc:c.jsxs(c.Fragment,{children:["Will only allow server join if the player's ",c.jsx(Be,{children:"fivem:"})," or ",c.jsx(Be,{children:"discord:"})," identifiers are attached to a txAdmin administrator. Also known as maintenance mode."]})}),c.jsx(Ll,{groupValue:n.whitelistMode,value:"discordMember",disableReason:l?null:"The Discord bot must be enabled in the Discord tab to use this option.",title:"Discord Server Member",desc:c.jsxs(c.Fragment,{children:["Checks if the player joining has a ",c.jsx(Be,{children:"discord:"})," identifier and is present in the Discord server configured in the Discord Tab."]})}),c.jsx(Ll,{groupValue:n.whitelistMode,value:"discordRoles",disableReason:l?null:"The Discord bot must be enabled in the Discord tab to use this option.",title:"Discord Server Roles",desc:c.jsxs(c.Fragment,{children:["Checks if the player joining has a ",c.jsx(Be,{children:"discord:"})," identifier and is present in the Discord server configured in the Discord Tab and has at least one of the roles specified below."]})}),c.jsx(Ll,{groupValue:n.whitelistMode,value:"approvedLicense",title:"Approved License",desc:c.jsxs(c.Fragment,{children:["The player ",c.jsx(Be,{children:"license:"})," identifier must be allowlisted by a txAdmin administrator. This can be done through the ",c.jsx(pn,{href:"/allowlist",children:"Allowlist page"}),", or the ",c.jsx(Be,{children:"/allowlist"})," Discord bot command."]})}),c.jsx(Ll,{groupValue:n.whitelistMode,value:"external",title:"External Allowlist Resource",newOptionBadgeFeatName:"settingsExternalWhitelist",desc:c.jsx(c.Fragment,{children:"Select this option if you are using an external allowlist system to manage which players can join the server."})})]}),c.jsxs(ct,{children:[c.jsx("strong",{children:"Note:"})," When enabled, the server list will show a lock icon next to the server name, and on the server page the players will be able to see the Allowlist Instructions."]})]}),c.jsxs(ft,{label:"Allowlist Instructions",htmlFor:i.rejectionMessage.eid,required:d,children:[c.jsx(Rf,{id:i.rejectionMessage.eid,ref:s,placeholder:"Please join http://discord.gg/example and request to be allowlisted.",defaultValue:i.rejectionMessage.initialValue,onInput:u,autoComplete:"off",minHeight:60,maxHeight:180,softMaxLength:512,disabled:t.isReadOnly||!d}),c.jsxs(ct,{children:["Explain here how players can apply to be allowlisted to join the server, including any requirements or steps they need to follow, like joining a Discord server or filling out an online form. ",c.jsx("br",{}),"This message will show on the in-game server page and will also be sent to the player when they try to connect while not being allowlisted.",c.jsx($M,{visible:!t.isReadOnly&&!d,children:"This field requires the Allowlist Mode to be enabled and not in Admin-only mode."})]})]}),c.jsxs(ft,{label:"Allowlisted Discord Roles",htmlFor:i.discordRoles.eid,required:n.whitelistMode==="discordRoles",children:[c.jsx(yt,{id:i.discordRoles.eid,ref:a,defaultValue:o.toUi(i.discordRoles.initialValue),placeholder:"000000000000000000, 000000000000000000",onInput:u,disabled:t.isReadOnly||n.whitelistMode!=="discordRoles"}),c.jsxs(ct,{children:["The ID of the Discord roles that are allowed to join the server. ",c.jsx("br",{}),"This field supports multiple roles, separated by comma.",c.jsx($M,{visible:!t.isReadOnly&&n.whitelistMode!=="discordRoles",children:'This field requires the Allowlist Mode to be set to "Discord Server Roles".'})]})]})]})}const n7e=[{name:"General",Component:UPe},{name:"FXServer",Component:FPe},{name:"Bans",Component:DPe},{name:"Whitelist",Component:t7e},{name:"Discord",Component:LPe},{name:"Game",cards:[{name:"Menu",Component:zPe},{name:"Notifications",Component:HPe}]}],KM=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"-"),Yp=n7e.map(e=>{const t={tabId:KM(e.name),tabName:e.name};return"cards"in e&&e.cards?{ctx:t,cards:e.cards.map(n=>({ctx:{...t,cardId:`${t.tabId}-${KM(n.name)}`,cardName:n.name,cardTitle:`${t.tabName} ${n.name}`},Component:n.Component}))}:{ctx:{...t,cardId:t.tabId,cardName:t.tabName,cardTitle:t.tabName},Component:e.Component}});function r7e(){var x;const[e,t]=w.useState(null),[n,r]=w.useState(!1),i=Yv(),{hasPerm:s}=Xn(),a=v=>{v==="whitelist"&&(v="allowlist"),ase(v)},[o,l]=w.useState(()=>{var p,y;const v=(p=window.location)==null?void 0:p.hash.slice(1),m=v==="allowlist"?"whitelist":v;return v==="whitelist"&&a("allowlist"),((y=Yp.find(_=>_.ctx.tabId===m))==null?void 0:y.ctx.tabId)??Yp[0].ctx.tabId}),u=bt({method:"GET",path:"/settings/configs",throwGenericErrors:!0}),h=bt({method:"POST",path:"/settings/configs/:card",throwGenericErrors:!0}),d=nl("/settings/configs",async()=>{const v=await u({});if(!v)throw new Error("No data returned");return v},{revalidateOnMount:!0,revalidateOnFocus:!1}),f=async(v,m)=>{if(n)return;const p=ze.loading(`Saving ${v.cardTitle} settings...`,{id:"settingsSave"});r(!0);try{if(!d.data)throw new Error("Cannot save changes without swr.data.");const y=[];for(const[C,S]of Object.entries(m))for(const[E,k]of Object.entries(S))k===gH&&y.push(`${C}.${E}`);const _=await h({pathParams:{card:v.cardId},data:{resetKeys:y,changes:m},timeout:v.cardId==="discord"?xh.REALLY_REALLY_LONG:xh.LONG,toastId:p});if(!_)throw new Error("empty_response");if(_.type==="error")return;if(!_.stored)throw new Error("no_stored_data");if(!_.changelog)throw new Error("no_changelog_data");d.mutate({...d.data,storedConfigs:_.stored,changelog:_.changelog},!1),t(null)}catch(y){ze.error({title:`Error saving ${v.cardTitle} settings:`,msg:y.message},{id:p})}finally{r(!1)}},g=v=>{t(null),l(v),a(v)},b=v=>{e&&v&&v!==(e==null?void 0:e.tabId)?i({title:"Discard Changes",actionLabel:"Discard",confirmBtnVariant:"destructive",message:c.jsxs(c.Fragment,{children:["You have unsaved changes in the ",c.jsx("strong",{children:e.cardTitle})," tab. ",c.jsx("br",{}),"Are you sure you want to discard them?"]}),onConfirm:()=>{g(v)}}):g(v)};return c.jsxs("div",{className:"w-full mb-10",children:[c.jsx(E9,{title:"Settings",icon:c.jsx(AS,{}),children:c.jsx(zpe,{changelogData:(x=d==null?void 0:d.data)==null?void 0:x.changelog})}),c.jsx("div",{className:"px-0 xs:px-3 md:px-0 flex flex-row gap-2 w-full",children:c.jsxs(mH,{value:o,onValueChange:b,className:"w-full",children:[c.jsx(K5,{className:"max-xs:sticky max-xs:top-navbarvh z-10 flex-wrap h-[unset] max-xs:w-full max-xs:rounded-none",children:Yp.map(v=>c.jsx(xv,{value:v.ctx.tabId,className:"hover:text-primary",children:v.ctx.tabName==="Whitelist"?"Allowlist":v.ctx.tabName},v.ctx.tabId))}),Yp.map(v=>c.jsx(ex,{value:v.ctx.tabId,className:"mt-6",children:c.jsx(APe,{tab:v,pageCtx:{apiData:d.data,isReadOnly:d.isLoading||n||!d.data||!s("settings.write"),isLoading:d.isLoading,isSaving:n,swrError:d.error?d.error.message:void 0,cardPendingSave:e,setCardPendingSave:t,saveChanges:f}})},v.ctx.tabId))]})})]})}function i7e({permission:e}){return c.jsxs(Xr,{children:[c.jsx(Jr,{className:"underline decoration-dotted cursor-help tracking-wider",children:"permission"}),c.jsx(Mr,{children:e})]})}function s7e({pageName:e,permission:t}){let n;return t==="master"?n=c.jsxs(c.Fragment,{children:["You need to be the Master account to view the ",c.jsx("strong",{className:"text-accent",children:e})," page."]}):n=c.jsxs(c.Fragment,{children:["You don't have the required ",c.jsx(i7e,{permission:t})," to view the ",c.jsx("strong",{className:"text-accent",children:e})," page. ",c.jsx("br",{}),"Please contact your server owner if you believe this is an error."]}),c.jsx("div",{className:"w-full px-4 pt-[7.5vh] flex items-start justify-center bg-background",children:c.jsxs("div",{className:"mx-auto max-w-xl text-center border border-destructive/50 rounded-lg p-6 bg-destructive-hint/15 space-y-4",children:[c.jsxs("h1",{className:"text-2xl font-bold tracking-tight text-destructive",children:[c.jsx(eL,{className:"size-6 mr-2 mt-0.5 inline align-text-top"}),"Access Denied"]}),c.jsx("p",{className:"mt-4 text-sm text-primary/90 tracking-wide",children:n}),c.jsx(Re,{variant:"outline",size:"sm",asChild:!0,children:c.jsx(Ti,{href:"/",children:"Return to Dashboard"})})]})})}function DH({process:e,level:t}){return c.jsxs("div",{className:Y(t>0?"ml-6 -mt-[1px] mb-0":"mb-2"),children:[c.jsx("div",{className:Y("border rounded-lg p-3 text-sm",t>0?"bg-muted":"bg-secondary/50"),children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"font-semibold text-foreground truncate",children:e.name}),c.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:["ID:",e.pid]})]}),c.jsxs("div",{className:"flex ml-4",children:[c.jsxs("div",{className:"flex flex-col gap-1 items-end pr-3",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(r_,{className:"w-4 h-4 text-muted-foreground"}),c.jsx("span",{className:"text-muted-foreground text-xs",children:"RAM:"})]}),c.jsxs("span",{className:"font-mono font-medium text-xs",children:[e.memory.toFixed(1)," MB"]})]}),c.jsx("div",{className:"w-px bg-border mx-3"}),c.jsxs("div",{className:"flex flex-col gap-1 items-end pl-3",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(gX,{className:"w-4 h-4 text-muted-foreground"}),c.jsx("span",{className:"text-muted-foreground text-xs",children:"CPU:"})]}),c.jsxs("span",{className:"font-mono font-medium text-xs",children:[e.cpu.toFixed(1),"%"]})]})]})]})}),e.children.length>0&&e.children.map(n=>c.jsx(DH,{process:n,level:t+1},n.pid))]})}function o7e({processes:e}){const t=w.useMemo(()=>{const n=new Map,r=[];return e.forEach(i=>{n.set(i.pid,{...i,children:[]})}),e.forEach(i=>{const s=n.get(i.pid),a=n.get(i.parent);a?a.children.push(s):r.push(s)}),r},[e]);return c.jsx("div",{children:t.map(n=>c.jsx(DH,{process:n,level:0},n.pid))})}function a7e({label:e,content:t,isLast:n,maxLabelLength:r}){const i=n?"└─":"├─";let s;typeof t=="object"&&t!==null?s=Object.entries(t).map(([o,l],u)=>c.jsxs("code",{className:"inline-block rounded-sm font-mono px-[0.25rem] border bg-secondary/35",children:[c.jsxs("span",{className:"text-muted-foreground",children:[o,":"]}),c.jsx("span",{className:"text-primary dark:text-warning-inline font-bold",children:l})]},o)):s=c.jsx("code",{className:"font-mono text-primary dark:text-warning-inline font-semibold dark:font-normal",children:typeof t=="number"?Wn(t):t});const a=r-e.length;return c.jsxs("div",{className:"attempt-word-wrap leading-none my-0",children:[c.jsxs("span",{className:"inline-block text-sm",style:{minWidth:`${a+2}ch`},children:[i,"─".repeat(a)]}),c.jsxs("span",{className:"inline-block text-sm mr-0.5",children:[e,":"]}),c.jsx("span",{className:"text-xs space-x-1",children:s})]})}function l7e({title:e,tree:t}){const n=Object.entries(t),r=Math.max(...n.map(([i])=>i.length));return c.jsxs("div",{className:"attempt-word-wrap",children:[c.jsxs("div",{className:"font-bold",children:[e,":"]}),c.jsx("div",{className:"flex flex-col font-mono text-muted-foreground",children:n.map(([i,s],a)=>c.jsx(a7e,{label:i,maxLabelLength:r,content:s,isLast:a===n.length-1},i))})]})}function YM({list:e}){const t=Object.entries(e),n=Math.max(...t.map(([r])=>r.length));return c.jsx("dl",{className:"attempt-word-wrap",children:c.jsx("dd",{className:"flex flex-col font-mono text-muted-foreground",children:t.map(([r,i],s)=>c.jsxs("div",{className:"text-sm",children:[c.jsxs("div",{className:"inline-block text-muted-foreground capitalize shrink-0",style:{minWidth:`${n+2}ch`},children:[r,":"]}),c.jsx("span",{className:"font-mono text-primary dark:text-warning-inline font-semibold dark:font-normal",children:i})]},r))})})}const c7e=()=>c.jsxs("div",{className:"space-y-4 text-sm",children:[c.jsxs("p",{className:"text-sm",children:["This ",c.jsx("u",{children:"optional"})," feature sends a diagnostics report to the Cfx.re team, and may be required to diagnose a wide range of server issues. After sending the data, you will receive a Report ID you can send in the support channels."]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-warning-inline",children:"Who can access the data?"}),c.jsx("p",{children:"The data will be available for up to 24 hours to the Cfx.re team."})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-warning-inline",children:"Which data will be sent?"}),c.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[c.jsx("li",{children:"All diagnostics page data"}),c.jsx("li",{children:"Recent txAdmin (system), live console and server log"}),c.jsx("li",{children:"Environment variables"}),c.jsx("li",{children:"Server performance (dashboard chart) data"}),c.jsx("li",{children:"Player database statistics"}),c.jsx("li",{children:"txAdmin settings (no bot token)"}),c.jsx("li",{children:"List of admins (no passwords/hashes)"}),c.jsx("li",{children:"List of files/folders in server data and monitor folders"}),c.jsx("li",{children:"Config files in server data folder"})]})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-warning-inline",children:"Sensitive Information Protection:"}),c.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Settings:"})," the Discord Bot Token will be removed"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Admin List:"})," the password hashes will not be sent"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Env Vars:"})," parameters with"," ",c.jsxs("span",{className:"text-xs space-x-1",children:[c.jsx(Be,{children:"key"}),",",c.jsx(Be,{children:"license"}),",",c.jsx(Be,{children:"pass"}),",",c.jsx(Be,{children:"private"}),",",c.jsx(Be,{children:"secret"}),",",c.jsx(Be,{children:"token"})]})," ","in their name will be masked"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"CFG Files:"})," known secret parameters will be masked (eg. license, mysql string, tebex secret, webhooks, etc.)"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Logs:"})," any identifiable IPv4 address in logs will be masked"]})]})]})]})]}),u7e=()=>c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(qt,{className:"h-8 w-8 animate-spin mb-4"}),c.jsx("p",{children:"Sending diagnostics data..."})]}),d7e=({reportId:e})=>c.jsxs("div",{className:"text-center",children:[c.jsxs("div",{className:"mb-4 flex flex-wrap gap-4 items-center justify-center text-2xl",children:[c.jsx("h3",{className:"font-semibold",children:"Report ID:"}),c.jsx("div",{className:"bg-muted p-2 rounded-lg",children:c.jsx("span",{className:"font-mono text-accent tracking-[0.35em] -mr-[0.35em] font-bold",children:e})})]}),c.jsxs("p",{className:"text-muted-foreground pt-2",children:["Please send this ID to the support team in ",c.jsx(pn,{href:"https://discord.gg/uAmsGa2",className:"font-semibold tracking-wide text-primary",children:"discord.gg/txAdmin"}),"."]})]}),h7e=({error:e})=>c.jsx("div",{className:"text-center",children:c.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 rounded-lg p-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-destructive mb-2",children:"Error"}),c.jsx("p",{className:"text-destructive",children:e})]})});function f7e({open:e,onOpenChange:t}){const[n,r]=w.useState(!1),[i,s]=w.useState(""),[a,o]=w.useState("");w.useEffect(()=>{e&&(r(!1),s(""),o(""))},[e]);const l=bt({method:"POST",path:"/diagnostics/sendReport"}),u=async()=>{r(!0),o(""),l({data:{bugfix:!0},timeout:xh.LONG,success:g=>{"reportId"in g?s(g.reportId):o(g.error)},error:g=>o(g),finally:()=>r(!1)})},h=!n&&!i&&!a,d=!n&&!!i,f=!n&&!!a;return c.jsx(ea,{open:e,onOpenChange:t,children:c.jsxs(Us,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[c.jsx(Vs,{children:c.jsx(qs,{children:"Send Diagnostics Data"})}),c.jsxs("div",{className:"py-4",children:[n&&c.jsx(u7e,{}),h&&c.jsx(c7e,{}),d&&c.jsx(d7e,{reportId:i}),f&&c.jsx(h7e,{error:a})]}),c.jsxs(du,{children:[c.jsx(Re,{variant:"outline",onClick:()=>t(!1),children:"Close"}),h&&c.jsx(Re,{onClick:u,children:"Agree & Send Data"})]})]})})}function p7e(){var i;const[e,t]=w.useState(!1),n=bt({method:"GET",path:"/diagnostics/getDiagnostics"}),r=nl("/diagnostics/getDiagnostics",async()=>{const s=await n({});if(!s)throw new Error("empty_response");if("error"in s)throw new Error(s.error);return s},{revalidateOnFocus:!1});return r.data?c.jsxs("div",{className:"w-full space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:[c.jsx("div",{className:"space-y-4",children:c.jsxs(bs,{children:[c.jsx(_s,{children:c.jsx(po,{children:"txAdmin Runtime"})}),c.jsx(yi,{className:"space-y-4",children:Object.entries(r.data.runtime).map(([s,a])=>c.jsx(l7e,{title:s,tree:a},s))})]})}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs(bs,{children:[c.jsx(_s,{children:c.jsx(po,{children:"Host"})}),c.jsx(yi,{className:"space-y-4",children:c.jsx(YM,{list:r.data.host})})]}),c.jsxs(bs,{children:[c.jsx(_s,{children:c.jsx(po,{children:"Server"})}),c.jsx(yi,{className:"space-y-4",children:c.jsx(YM,{list:r.data.server})})]}),c.jsxs(bs,{children:[c.jsx(_s,{children:c.jsx(po,{children:"Processes"})}),c.jsx(yi,{children:c.jsx(o7e,{processes:r.data.processes})})]}),c.jsxs("div",{className:"italic text-center text-sm text-muted-foreground",children:["Loaded in ",Wn(r.data.loadTime)," ms"]})]})]}),c.jsx(f7e,{open:e,onOpenChange:t})]}):c.jsx("div",{className:"w-full h-1/3 relative",children:c.jsx(vH,{error:(i=r.error)==null?void 0:i.message,loading:r.isValidating?"Loading...":!1,className:"bg-transparent dark:bg-transparent"})})}const m7e=si("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function g7e({className:e,variant:t,...n}){return c.jsx("div",{className:Y(m7e({variant:t}),e),...n})}const v7e=[{name:"verbose",desc:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",args:["true/false"]},{name:"set",desc:"Sets a txAdmin config value.",args:["scope.key","json-encoded value"]},{name:"printFullPlayerList",desc:"Print the entire player list json."},{name:"printFxResourcesBootLog",desc:"Print the latest server resource boot log."},{name:"printFxRunnerChildHistory",desc:"Print the history of all fxRunner child processes."},{name:"printLoggerErrors",desc:"Print the latest logger errors."},{name:"forceUpdateMutableConvars",desc:"Force update the server mutable txAdmin convars."},{name:"safelyRestartMonitorResource",desc:`Restarts the server's "monitor" resource in a safe way by restoring the luaComToken convar before ensuring it.`},{name:"forceReauthRecentPlayers",desc:"Forces the last N players that joined the server to reauth.",args:["number of players"]},{name:"printProcessEnv",desc:"Print the process environment variables."},{name:"printProcessMemoryUsage",desc:"Prints the process memory usage."},{name:"freezeProcess",desc:"Freezes the NodeJS runtime by N seconds",args:["number of seconds"]},{name:"saveHeapSnapshot",desc:"Saves a heap snapshot."},{name:"printPublicIp",desc:"Fetches the public IP of the server."},{name:"printClockInfo",desc:"Fetches the current clock info."}],x7e=si("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground text-black/75 dark:text-white/90",{variants:{variant:{default:"bg-background text-foreground",warning:"border-warning/50 bg-warning/10 text-warning-foreground [&>svg]:text-warning",info:"border-info/50 bg-info/10 text-info-foreground [&>svg]:text-info",success:"border-success/50 bg-success/10 text-success-foreground [&>svg]:text-success",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Q5=w.forwardRef(({className:e,variant:t,...n},r)=>c.jsx("div",{ref:r,role:"alert",className:Y(x7e({variant:t}),e),...n}));Q5.displayName="Alert";const Z5=w.forwardRef(({className:e,...t},n)=>c.jsx("h5",{ref:n,className:Y("mb-1 font-medium leading-none tracking-tight",e),...t}));Z5.displayName="AlertTitle";const eE=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Y("text-sm [&_p]:leading-relaxed",e),...t}));eE.displayName="AlertDescription";function y7e({onCommandClick:e}){const[t,n]=w.useState(!1),r=i=>{e(i),n(!1)};return c.jsxs(o7,{open:t,onOpenChange:n,children:[c.jsx(a7,{asChild:!0,children:c.jsx(Re,{variant:"outline",title:"Help",size:"icon",children:c.jsx(lX,{className:"w-5"})})}),c.jsxs(_C,{className:"w-[100vw] xs:w-[500px] p-0",align:"end",children:[c.jsxs("div",{className:"p-4 border-b",children:[c.jsx("h3",{className:"font-semibold",children:"Available Commands"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Click a command to autofill it"})]}),c.jsx(ii,{className:"h-[500px]",children:c.jsx("div",{className:"p-4 space-y-3",children:v7e.map(i=>{var s;return c.jsx("button",{className:"w-full text-left p-3 rounded-lg border bg-black/5 border-transparent hover:border-border transition-all",onClick:()=>r(i.name),children:c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("span",{className:"font-mono font-bold text-sm text-foreground",children:i.name}),(s=i.args)==null?void 0:s.map((a,o)=>c.jsx(g7e,{variant:"outline",className:"text-xs font-mono px-2 py-0.5 rounded-md font-light",children:a},o))]}),c.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:i.desc})]})},i.name)})})})]})]})}function b7e({output:e}){return c.jsx("div",{className:"pt-4",children:e?"error"in e?c.jsxs(Q5,{variant:"destructive",children:[c.jsx(kS,{className:"h-4 w-4"}),c.jsx(Z5,{children:"Error"}),c.jsx(eE,{children:e.error})]}):e.type==="md"?c.jsx("div",{className:"bg-muted/40 p-4 rounded-md",children:c.jsx(g_,{md:e.data,className:"max-w-none"})}):c.jsx("div",{className:"bg-muted/40 p-4 rounded-md",children:c.jsx(h8,{value:e.data})}):c.jsx("p",{className:"text-muted-foreground opacity-50",children:"No output yet. Run a command to see the the output here."})})}function _7e(){const e=w.useRef(null),[t,n]=w.useState(null),[r,i]=w.useState(!1),s=bt({method:"POST",path:"/advanced/run"});w.useEffect(()=>{if(!e.current)return;const u=ose("cmd");u&&(e.current.value=u,e.current.focus())},[e]);const a=async u=>{if(u.preventDefault(),r||!e.current)return;const h=e.current.value.trim();if(!h){e.current.focus();return}eC("cmd",h),i(!0),s({data:{cmd:h},finally:()=>{i(!1),setTimeout(()=>{var d;return(d=e.current)==null?void 0:d.focus()},50)},success:d=>n(d),error:d=>n({error:d})})},o=()=>{n(null)},l=()=>{var g;if(!t)return;const u="error"in t?t.error:t.data,h=((g=e.current)==null?void 0:g.value.trim())||"command",d="error"in t?"txt":t.type==="md"?"md":"json";DK(u,h,d)||ze.error("Failed to download file. Please try again.")};return c.jsxs("div",{className:"relative flex flex-col h-full w-full space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap-reverse gap-6",children:[c.jsxs(bs,{className:"w-full 2xl:flex-1 2xl:min-w-80",children:[c.jsx(_s,{children:c.jsxs(po,{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(mX,{className:"size-6 text-muted-foreground"}),"Advanced Commands"]}),c.jsx(y7e,{onCommandClick:u=>{e.current&&(e.current.value=u+" ",e.current.focus())}})]})}),c.jsx(yi,{children:c.jsxs("form",{onSubmit:a,className:"flex gap-2",children:[c.jsx(yt,{ref:e,className:"flex-1",disabled:r,placeholder:"Type a command or click the help button..."}),c.jsx(Re,{type:"submit",disabled:r,title:"Run command",size:"icon",children:r?c.jsx(qt,{className:"w-5 mt-0.5 mr-0.5 animate-spin"}):c.jsx(GX,{className:"w-5 mt-0.5 mr-0.5"})})]})})]}),c.jsxs(Q5,{variant:"default",className:"max-2xl:w-full mx-auto 2xl:w-auto 2xl:flex-shrink-0  2xl:max-w-sm relative bg-warning-hint border-warning dark:opacity-75",children:[c.jsx(kS,{className:"h-4 w-4"}),c.jsx(Z5,{children:"Caution"}),c.jsxs(eE,{children:["This page is meant to be used by advanced users only, and there is no documentation for it. ",c.jsx("strong",{children:"Use at your own risk."})]})]})]}),c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center justify-between pb-3 border-b",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(XX,{className:"size-6 text-muted-foreground"}),c.jsx("h2",{className:"text-lg font-semibold",children:"Output"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Re,{variant:"outline",size:"sm",onClick:o,disabled:!t,title:"Clear output",children:c.jsx(vX,{className:"w-5 mr-0.5"})}),c.jsx(Re,{variant:"outline",size:"sm",onClick:l,disabled:!t,title:"Save output",children:c.jsx(yX,{className:"w-4"})})]})]}),c.jsx(b7e,{output:t})]}),c.jsx("img",{className:Y("absolute bottom-0 right-0 size-64 opacity-35 pointer-events-none","border border-transparent",r&&"opacity-100 animate-bounce"),src:"img/txSnaily2anim_320.png",alt:"Not A Meme"})]})}const w7e=[{path:"/players",title:"Players",Page:c.jsx(Qde,{})},{path:"/history",title:"History",Page:c.jsx(che,{})},{path:"/insights/player-drops",title:"Player Drops",Page:c.jsx(SPe,{})},{path:"/allowlist",title:"Allowlist",Page:c.jsx(eo,{legacyUrl:"allowlist"})},{path:"/admins",title:"Admins",Page:c.jsx(eo,{legacyUrl:"adminManager"})},{path:"/settings",title:"Settings",permission:"settings.view",Page:c.jsx(r7e,{})},{path:"/system/master-actions",title:"Master Actions",Page:c.jsx(eo,{legacyUrl:"masterActions"})},{path:"/system/diagnostics",title:"Diagnostics",Page:c.jsx(p7e,{})},{path:"/system/console-log",title:"Console Log",permission:"txadmin.log.view",Page:c.jsx(QT,{pageName:"console"})},{path:"/system/action-log",title:"Action Log",permission:"txadmin.log.view",Page:c.jsx(QT,{pageName:"action"})},{path:"/",title:"Dashboard",Page:c.jsx(D8e,{})},{path:"/server/console",title:"Live Console",permission:"console.view",Page:c.jsx(rue,{})},{path:"/server/resources",title:"Resources",Page:c.jsx(eo,{legacyUrl:"resources"})},{path:"/server/server-log",title:"Server Log",permission:"server.log.view",Page:c.jsx(eo,{legacyUrl:"serverLog"})},{path:"/server/cfg-editor",title:"CFG Editor",permission:"server.cfg.editor",Page:c.jsx(eo,{legacyUrl:"cfgEditor"})},{path:"/server/setup",title:"Server Setup",permission:"master",Page:c.jsx(eo,{legacyUrl:"setup"})},{path:"/server/deployer",title:"Server Deployer",permission:"master",Page:c.jsx(eo,{legacyUrl:"deployer"})},{path:"/advanced",title:"Advanced",permission:"all_permissions",Page:c.jsx(_7e,{})},{path:"/settings/ban-templates",title:"Ban Templates",Page:c.jsx(Vpe,{})},{path:"/ban-identifiers",title:"Ban Identifiers",Page:c.jsx(Kpe,{})}];function S7e(e){const{hasPerm:t}=Xn();LD()(e.title);const r=e.permission&&!t(e.permission)?c.jsx(s7e,{pageName:e.title,permission:e.permission}):e.Page;return c.jsx(da,{path:e.path,children:r})}function C7e(){return c.jsxs(DN,{children:[w7e.map(e=>c.jsx(S7e,{...e},e.path)),!1,c.jsx(da,{component:Use})]})}function k7e(){const e=rt(ND),t=nt(jD);return c.jsx(bj,{FallbackComponent:hY,onError:()=>{console.log("Page ErrorBoundary caught an error"),e(!0)},onReset:()=>{console.log("Page ErrorBoundary reset"),X2("/"),e(!1)},children:c.jsx(C7e,{})},t)}var Ru="NavigationMenu",[tE,LH,E7e]=yf(Ru),[qw,T7e,A7e]=yf(Ru),[nE,n9e]=Cn(Ru,[E7e,A7e]),[R7e,li]=nE(Ru),[M7e,j7e]=nE(Ru),PH=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:s,delayDuration:a=200,skipDelayDuration:o=300,orientation:l="horizontal",dir:u,...h}=e,[d,f]=w.useState(null),g=Le(t,T=>f(T)),b=Ja(u),x=w.useRef(0),v=w.useRef(0),m=w.useRef(0),[p,y]=w.useState(!0),[_="",C]=Pr({prop:r,onChange:T=>{const A=T!=="",M=o>0;A?(window.clearTimeout(m.current),M&&y(!1)):(window.clearTimeout(m.current),m.current=window.setTimeout(()=>y(!0),o)),i==null||i(T)},defaultProp:s}),S=w.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>C(""),150)},[C]),E=w.useCallback(T=>{window.clearTimeout(v.current),C(T)},[C]),k=w.useCallback(T=>{_===T?window.clearTimeout(v.current):x.current=window.setTimeout(()=>{window.clearTimeout(v.current),C(T)},a)},[_,C,a]);return w.useEffect(()=>()=>{window.clearTimeout(x.current),window.clearTimeout(v.current),window.clearTimeout(m.current)},[]),c.jsx(IH,{scope:n,isRootMenu:!0,value:_,dir:b,orientation:l,rootNavigationMenu:d,onTriggerEnter:T=>{window.clearTimeout(x.current),p?k(T):E(T)},onTriggerLeave:()=>{window.clearTimeout(x.current),S()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:S,onItemSelect:T=>{C(A=>A===T?"":T)},onItemDismiss:()=>C(""),children:c.jsx(Ce.nav,{"aria-label":"Main","data-orientation":l,dir:b,...h,ref:g})})});PH.displayName=Ru;var OH="NavigationMenuSub",N7e=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",...o}=e,l=li(OH,n),[u="",h]=Pr({prop:r,onChange:i,defaultProp:s});return c.jsx(IH,{scope:n,isRootMenu:!1,value:u,dir:l.dir,orientation:a,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>h(d),onItemSelect:d=>h(d),onItemDismiss:()=>h(""),children:c.jsx(Ce.div,{"data-orientation":a,...o,ref:t})})});N7e.displayName=OH;var IH=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:s,children:a,value:o,onItemSelect:l,onItemDismiss:u,onTriggerEnter:h,onTriggerLeave:d,onContentEnter:f,onContentLeave:g}=e,[b,x]=w.useState(null),[v,m]=w.useState(new Map),[p,y]=w.useState(null);return c.jsx(R7e,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:bf(o),baseId:yr(),dir:i,orientation:s,viewport:b,onViewportChange:x,indicatorTrack:p,onIndicatorTrackChange:y,onTriggerEnter:xt(h),onTriggerLeave:xt(d),onContentEnter:xt(f),onContentLeave:xt(g),onItemSelect:xt(l),onItemDismiss:xt(u),onViewportContentChange:w.useCallback((_,C)=>{m(S=>(S.set(_,C),new Map(S)))},[]),onViewportContentRemove:w.useCallback(_=>{m(C=>C.has(_)?(C.delete(_),new Map(C)):C)},[]),children:c.jsx(tE.Provider,{scope:t,children:c.jsx(M7e,{scope:t,items:v,children:a})})})},$H="NavigationMenuList",BH=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=li($H,n),s=c.jsx(Ce.ul,{"data-orientation":i.orientation,...r,ref:t});return c.jsx(Ce.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:c.jsx(tE.Slot,{scope:n,children:i.isRootMenu?c.jsx(YH,{asChild:!0,children:s}):s})})});BH.displayName=$H;var FH="NavigationMenuItem",[D7e,zH]=nE(FH),HH=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,s=yr(),a=r||s||"LEGACY_REACT_AUTO_VALUE",o=w.useRef(null),l=w.useRef(null),u=w.useRef(null),h=w.useRef(()=>{}),d=w.useRef(!1),f=w.useCallback((b="start")=>{if(o.current){h.current();const x=Kw(o.current);x.length&&sE(b==="start"?x:x.reverse())}},[]),g=w.useCallback(()=>{if(o.current){const b=Kw(o.current);b.length&&(h.current=F7e(b))}},[]);return c.jsx(D7e,{scope:n,value:a,triggerRef:l,contentRef:o,focusProxyRef:u,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:g,onContentFocusOutside:g,children:c.jsx(Ce.li,{...i,ref:t})})});HH.displayName=FH;var Gw="NavigationMenuTrigger",WH=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,s=li(Gw,e.__scopeNavigationMenu),a=zH(Gw,e.__scopeNavigationMenu),o=w.useRef(null),l=Le(o,a.triggerRef,t),u=JH(s.baseId,a.value),h=QH(s.baseId,a.value),d=w.useRef(!1),f=w.useRef(!1),g=a.value===s.value;return c.jsxs(c.Fragment,{children:[c.jsx(tE.ItemSlot,{scope:n,value:a.value,children:c.jsx(XH,{asChild:!0,children:c.jsx(Ce.button,{id:u,disabled:r,"data-disabled":r?"":void 0,"data-state":oE(g),"aria-expanded":g,"aria-controls":h,...i,ref:l,onPointerEnter:ae(e.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:ae(e.onPointerMove,yv(()=>{r||f.current||a.wasEscapeCloseRef.current||d.current||(s.onTriggerEnter(a.value),d.current=!0)})),onPointerLeave:ae(e.onPointerLeave,yv(()=>{r||(s.onTriggerLeave(),d.current=!1)})),onClick:ae(e.onClick,()=>{s.onItemSelect(a.value),f.current=g}),onKeyDown:ae(e.onKeyDown,b=>{const v={horizontal:"ArrowDown",vertical:s.dir==="rtl"?"ArrowLeft":"ArrowRight"}[s.orientation];g&&b.key===v&&(a.onEntryKeyDown(),b.preventDefault())})})})}),g&&c.jsxs(c.Fragment,{children:[c.jsx(S7,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:b=>{const x=a.contentRef.current,v=b.relatedTarget,m=v===o.current,p=x==null?void 0:x.contains(v);(m||!p)&&a.onFocusProxyEnter(m?"start":"end")}}),s.viewport&&c.jsx("span",{"aria-owns":h})]})]})});WH.displayName=Gw;var L7e="NavigationMenuLink",XM="navigationMenu.linkSelect",UH=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...s}=e;return c.jsx(XH,{asChild:!0,children:c.jsx(Ce.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...s,ref:t,onClick:ae(e.onClick,a=>{const o=a.target,l=new CustomEvent(XM,{bubbles:!0,cancelable:!0});if(o.addEventListener(XM,u=>i==null?void 0:i(u),{once:!0}),og(o,l),!l.defaultPrevented&&!a.metaKey){const u=new CustomEvent(Nm,{bubbles:!0,cancelable:!0});og(o,u)}},{checkForDefaultPrevented:!1})})})});UH.displayName=L7e;var rE="NavigationMenuIndicator",VH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=li(rE,e.__scopeNavigationMenu),s=!!i.value;return i.indicatorTrack?G2.createPortal(c.jsx(on,{present:n||s,children:c.jsx(P7e,{...r,ref:t})}),i.indicatorTrack):null});VH.displayName=rE;var P7e=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=li(rE,n),s=LH(n),[a,o]=w.useState(null),[l,u]=w.useState(null),h=i.orientation==="horizontal",d=!!i.value;w.useEffect(()=>{var x;const b=(x=s().find(v=>v.value===i.value))==null?void 0:x.ref.current;b&&o(b)},[s,i.value]);const f=()=>{a&&u({size:h?a.offsetWidth:a.offsetHeight,offset:h?a.offsetLeft:a.offsetTop})};return Yw(a,f),Yw(i.indicatorTrack,f),l?c.jsx(Ce.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...h?{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}),Vc="NavigationMenuContent",qH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=li(Vc,e.__scopeNavigationMenu),s=zH(Vc,e.__scopeNavigationMenu),a=Le(s.contentRef,t),o=s.value===i.value,l={value:s.value,triggerRef:s.triggerRef,focusProxyRef:s.focusProxyRef,wasEscapeCloseRef:s.wasEscapeCloseRef,onContentFocusOutside:s.onContentFocusOutside,onRootContentClose:s.onRootContentClose,...r};return i.viewport?c.jsx(O7e,{forceMount:n,...l,ref:a}):c.jsx(on,{present:n||o,children:c.jsx(GH,{"data-state":oE(o),...l,ref:a,onPointerEnter:ae(e.onPointerEnter,i.onContentEnter),onPointerLeave:ae(e.onPointerLeave,yv(i.onContentLeave)),style:{pointerEvents:!o&&i.isRootMenu?"none":void 0,...l.style}})})});qH.displayName=Vc;var O7e=w.forwardRef((e,t)=>{const n=li(Vc,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return Xt(()=>{r(e.value,{ref:t,...e})},[e,t,r]),Xt(()=>()=>i(e.value),[e.value,i]),null}),Nm="navigationMenu.rootContentDismiss",GH=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:s,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:l,...u}=e,h=li(Vc,n),d=w.useRef(null),f=Le(d,t),g=JH(h.baseId,r),b=QH(h.baseId,r),x=LH(n),v=w.useRef(null),{onItemDismiss:m}=h;w.useEffect(()=>{const y=d.current;if(h.isRootMenu&&y){const _=()=>{var C;m(),o(),y.contains(document.activeElement)&&((C=i.current)==null||C.focus())};return y.addEventListener(Nm,_),()=>y.removeEventListener(Nm,_)}},[h.isRootMenu,e.value,i,m,o]);const p=w.useMemo(()=>{const _=x().map(A=>A.value);h.dir==="rtl"&&_.reverse();const C=_.indexOf(h.value),S=_.indexOf(h.previousValue),E=r===h.value,k=S===_.indexOf(r);if(!E&&!k)return v.current;const T=(()=>{if(C!==S){if(E&&S!==-1)return C>S?"from-end":"from-start";if(k&&C!==-1)return C>S?"to-start":"to-end"}return null})();return v.current=T,T},[h.previousValue,h.value,h.dir,x,r]);return c.jsx(YH,{asChild:!0,children:c.jsx(ou,{id:b,"aria-labelledby":g,"data-motion":p,"data-orientation":h.orientation,...u,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var _;const y=new Event(Nm,{bubbles:!0,cancelable:!0});(_=d.current)==null||_.dispatchEvent(y)},onFocusOutside:ae(e.onFocusOutside,y=>{var C;l();const _=y.target;(C=h.rootNavigationMenu)!=null&&C.contains(_)&&y.preventDefault()}),onPointerDownOutside:ae(e.onPointerDownOutside,y=>{var E;const _=y.target,C=x().some(k=>{var T;return(T=k.ref.current)==null?void 0:T.contains(_)}),S=h.isRootMenu&&((E=h.viewport)==null?void 0:E.contains(_));(C||S||!h.isRootMenu)&&y.preventDefault()}),onKeyDown:ae(e.onKeyDown,y=>{var S;const _=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!_){const E=Kw(y.currentTarget),k=document.activeElement,T=E.findIndex(D=>D===k),M=y.shiftKey?E.slice(0,T).reverse():E.slice(T+1,E.length);sE(M)?y.preventDefault():(S=s.current)==null||S.focus()}}),onEscapeKeyDown:ae(e.onEscapeKeyDown,y=>{a.current=!0})})})}),iE="NavigationMenuViewport",KH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=!!li(iE,e.__scopeNavigationMenu).value;return c.jsx(on,{present:n||s,children:c.jsx(I7e,{...r,ref:t})})});KH.displayName=iE;var I7e=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,s=li(iE,n),a=Le(t,s.onViewportChange),o=j7e(Vc,e.__scopeNavigationMenu),[l,u]=w.useState(null),[h,d]=w.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,g=l?(l==null?void 0:l.height)+"px":void 0,b=!!s.value,x=b?s.value:s.previousValue;return Yw(h,()=>{h&&u({width:h.offsetWidth,height:h.offsetHeight})}),c.jsx(Ce.div,{"data-state":oE(b),"data-orientation":s.orientation,...i,ref:a,style:{pointerEvents:!b&&s.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":g,...i.style},onPointerEnter:ae(e.onPointerEnter,s.onContentEnter),onPointerLeave:ae(e.onPointerLeave,yv(s.onContentLeave)),children:Array.from(o.items).map(([m,{ref:p,forceMount:y,..._}])=>{const C=x===m;return c.jsx(on,{present:y||C,children:c.jsx(GH,{..._,ref:Qc(p,S=>{C&&S&&d(S)})})},m)})})}),$7e="FocusGroup",YH=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=li($7e,n);return c.jsx(qw.Provider,{scope:n,children:c.jsx(qw.Slot,{scope:n,children:c.jsx(Ce.div,{dir:i.dir,...r,ref:t})})})}),JM=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],B7e="FocusGroupItem",XH=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=T7e(n),s=li(B7e,n);return c.jsx(qw.ItemSlot,{scope:n,children:c.jsx(Ce.button,{...r,ref:t,onKeyDown:ae(e.onKeyDown,a=>{if(["Home","End",...JM].includes(a.key)){let l=i().map(d=>d.ref.current);if([s.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),JM.includes(a.key)){const d=l.indexOf(a.currentTarget);l=l.slice(d+1)}setTimeout(()=>sE(l)),a.preventDefault()}})})})});function Kw(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 sE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function F7e(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 Yw(e,t){const n=xt(t);Xt(()=>{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 oE(e){return e?"open":"closed"}function JH(e,t){return`${e}-trigger-${t}`}function QH(e,t){return`${e}-content-${t}`}function yv(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ZH=PH,eW=BH,z7e=HH,tW=WH,H7e=UH,nW=VH,rW=qH,iW=KH;const Xw=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(ZH,{ref:r,className:Y("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,c.jsx(lW,{})]}));Xw.displayName=ZH.displayName;const Jw=w.forwardRef(({className:e,...t},n)=>c.jsx(eW,{ref:n,className:Y("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));Jw.displayName=eW.displayName;const sW=z7e,W7e=si("group inline-flex h-10 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors 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"),oW=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(tW,{ref:r,className:Y(W7e(),"group",e),...n,children:[t," ",c.jsx(Za,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));oW.displayName=tW.displayName;const aW=w.forwardRef(({className:e,...t},n)=>c.jsx(rW,{ref:n,className:Y("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}));aW.displayName=rW.displayName;const U7e=H7e,lW=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:Y("absolute left-0 top-full flex justify-center"),children:c.jsx(iW,{className:Y("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})}));lW.displayName=iW.displayName;const V7e=w.forwardRef(({className:e,...t},n)=>c.jsx(nW,{ref:n,className:Y("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:c.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));V7e.displayName=nW.displayName;function q7e(e,t){const n=nt(ND),r=of(),i=Jv(),s=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 c.jsx(Ti,{ref:t,href:e.href,onClick:s,className:e.className,children:e.children})}const aE=w.forwardRef(q7e);function zn({href:e,children:t,className:n,disabled:r}){const[i]=$v(e);return r?c.jsxs(Xr,{children:[c.jsx(Jr,{className:"cursor-help",children:c.jsx(Re,{variant:"ghost",className:"w-full justify-start py-1",disabled:!0,children:t})}),c.jsxs(Mr,{side:"right",className:"text-destructive-inline text-center",children:["You do not have permission ",c.jsx("br",{}),"to access this page."]})]}):c.jsx(aE,{href:e,isActive:i,className:Y(sf({variant:i?"secondary":"ghost"}),"w-full justify-start py-1",n),children:t})}function Qw({href:e,children:t,className:n}){const[r]=$v(e);return c.jsx(aE,{href:e,isActive:r,className:n,children:t})}const QM=si("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 kd(e){const[t]=$v(e.href);return c.jsx(U7e,{asChild:!0,active:t,children:e.disabled?c.jsxs(Xr,{children:[c.jsx(Jr,{className:"cursor-help",children:c.jsx("a",{className:Y(QM({variant:"default"}),"pointer-events-none opacity-50",e.className),children:e.children})}),c.jsxs(Mr,{side:"bottom",className:"text-destructive-inline text-center",children:["You do not have permission ",c.jsx("br",{}),"to access this page."]})]}):c.jsx(aE,{href:e.href,isActive:t,className:Y(QM({variant:t?"secondary":"default"}),e.className),children:e.children})})}function Pl(e){return c.jsx(sW,{children:c.jsx(kd,{href:e.href,disabled:e.disabled,className:e.className,children:e.children})})}function G7e(){const{hasPerm:e}=Xn();return c.jsxs("div",{className:"space-x-1 flex flex-row select-none",children:[c.jsx(Xw,{children:c.jsxs(Jw,{children:[c.jsx(Pl,{href:"/players",children:"Players"}),c.jsx(Pl,{href:"/history",children:"History"}),c.jsx(Pl,{href:"/insights/player-drops",children:"Player Drops"}),c.jsx(Pl,{href:"/allowlist",children:"Allowlist"}),c.jsx(Pl,{href:"/admins",disabled:!e("manage.admins"),children:"Admins"}),c.jsx(Pl,{href:"/settings",disabled:!e("settings.view"),children:"Settings"})]})}),c.jsx(Xw,{children:c.jsx(Jw,{className:"aaaaaaaaaaa",children:c.jsxs(sW,{children:[c.jsx(oW,{onClick:t=>{t.currentTarget.dataset.state==="open"&&t.preventDefault()},children:"System"}),c.jsxs(aW,{className:"flex flex-col gap-2 p-4 list-none",children:[c.jsx(kd,{className:"w-36 justify-start",href:"/system/master-actions",children:"Master Actions"}),c.jsx(kd,{className:"w-36 justify-start",href:"/system/diagnostics",children:"Diagnostics"}),c.jsx(kd,{className:"w-36 justify-start",href:"/system/console-log",disabled:!e("txadmin.log.view"),children:"Console Log"}),c.jsx(kd,{className:"w-36 justify-start",href:"/system/action-log",disabled:!e("txadmin.log.view"),children:"Action Log"})]})]})})})]})}const ZM=["#de87ff","#4ad63b","#8625c2","#81da23","#7135ce","#b1d408","#3953eb","#5ab000","#ad30ce","#01a91e","#e533cd","#00ad3f","#ff2ebe","#00d577","#d800ab","#71dd65","#5836c0","#97d947","#0044cd","#c3cf23","#6369ff","#c8c200","#015fe8","#fcbc01","#ba69ff","#afd440","#d669ff","#1c7a00","#ff5ee8","#5a9300","#a0009e","#70dc85","#f301a0","#00a75d","#f4006b","#69dba1","#b20084","#b8a900","#0178f1","#e4b100","#0266d2","#e49700","#0277d8","#f27b00","#0091e0","#dd2b00","#00d1db","#d80029","#50dbc0","#ff409c","#00702b","#ff8ff6","#386500","#bd88ff","#617700","#948eff","#db7d00","#3f49a4","#ff7c29","#24509c","#ffb14a","#6b3b9a","#e2c45f","#872b84","#019967","#ce0073","#007144","#ff76d0","#4d5e00","#82a3ff","#ff6434","#5aceff","#b93600","#81b5ff","#9c3700","#00a7b6","#ff4a61","#01a79e","#ff4b77","#007f6b","#b1003c","#b4d086","#92266c","#887b00","#d2b0ff","#ac6500","#005f9e","#ff794e","#007db0","#ff695a","#017574","#a6111d","#abc6ff","#975100","#b0bcff","#966800","#ffabed","#265e33","#ff77af","#375b3a","#a7004d","#cbc98f","#972063","#f7bb73","#005a83","#ff915a","#5f487e","#5e5800","#e1b9e9","#6b4e0b","#ff9cc5","#4a582a","#ff8792","#83986d","#873464","#d0b58b","#6f4274","#feb595","#893650","#dba98f","#952f28","#b093bc","#ff8d79","#a06a80","#7e432c","#e8b0cc","#9c6e57","#ff9fa8"],K7e=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()},Y7e=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 ZM[Math.abs(t)%ZM.length]};function cW({username:e,profilePicture:t,className:n}){return c.jsxs(XS,{className:Y("bg-zinc-200 dark:bg-zinc-800 transition-colors text-zinc-200",n),children:[t&&c.jsx(JS,{src:t,alt:e}),c.jsx(QS,{className:n,style:{backgroundColor:Y7e(e)},delayMs:t?1e3:void 0,children:K7e(e)})]})}function uW(e){return iD({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 lE({style:e,className:t}){const n=w.useId(),r=w.useId();return c.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1115 288",children:[c.jsxs("mask",{id:n,fill:"#fff",children:[c.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"}),c.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"}),c.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"}),c.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"}),c.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"}),c.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"})]}),c.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),c.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[c.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),c.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function X7e({style:e,className:t}){const n=w.useId(),r=w.useId();return c.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 288 288",children:[c.jsx("mask",{id:n,fill:"#fff",children:c.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"})}),c.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),c.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[c.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),c.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function J7e(){const e=nt(qv),t=nt(TD);return c.jsxs("div",{className:"flex justify-start",children:[c.jsx("h1",{className:"line-clamp-1 text-base break-all",children:t}),c.jsxs("span",{children:[": ",c.jsx("span",{className:"font-mono",title:"players connected",children:e})]})]})}const cE=`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 Q7e({className:e}){const{setIsSheetOpen:t}=zD();return c.jsxs("button",{className:Y(cE,e),title:"Server Menu",onClick:()=>t(!0),children:[c.jsx(PX,{className:"h-6 w-6 sm:h-5 sm:w-5"}),c.jsx("div",{className:"hidden sm:flex flex-row min-w-max align-middle",children:"Server"})]})}function Z7e({className:e}){const{setIsSheetOpen:t}=FD();return c.jsxs("button",{className:Y(cE,e),title:"Global Menu",onClick:()=>t(!0),children:[c.jsx(LX,{className:"h-6 w-6 sm:h-5 sm:w-5"}),c.jsx("div",{className:"hidden sm:flex flex-row min-w-max",children:"Menu"})]})}function eOe({className:e}){const{setIsSheetOpen:t}=HD(),n=nt(qv);return c.jsxs("button",{className:Y(cE,e),title:"Global Menu",onClick:()=>t(!0),children:[c.jsx(FX,{className:"h-6 w-6 sm:h-5 sm:w-5"}),c.jsxs("div",{className:"hidden sm:flex flex-row min-w-max",children:["Players",c.jsxs("span",{className:"hidden lg:inline-block font-mono",children:[": ",n]})]})]})}function tOe(){const{authData:e,logout:t}=rl(),{theme:n,setTheme:r}=EO(),{setAccountModalOpen:i}=xS();if(!e)return null;const s=()=>{r(n==="light"?"dark":"light")},a=()=>{i(!0)},o=()=>{nu("https://discord.gg/uAmsGa2")},l=()=>t();return c.jsxs(cc,{children:[c.jsxs(uc,{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:[c.jsx("span",{className:"hidden xl:block text-muted-foreground",children:e.name}),c.jsx(cW,{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})]}),c.jsxs(Ca,{children:[window.txConsts.isWebInterface&&c.jsxs(Vi,{className:"cursor-pointer",onClick:s,children:[n==="light"?c.jsx(eJ,{className:"mr-2 h-4 w-4"}):c.jsx(OX,{className:"mr-2 h-4 w-4"}),n==="light"?"Light Mode":"Dark Mode"]}),c.jsxs(Vi,{className:"cursor-pointer",onClick:a,children:[c.jsx(AX,{className:"mr-2 h-4 w-4"}),"Your Account"]}),c.jsxs(Vi,{className:"cursor-pointer",onClick:o,children:[c.jsx(uW,{size:"14",className:"mr-2"}),"Support"]}),window.txConsts.isWebInterface&&c.jsxs(c.Fragment,{children:[c.jsx(ga,{}),c.jsxs(Vi,{className:"cursor-pointer",onClick:l,children:[c.jsx(jX,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})]})}function nOe(){return c.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 shadow-lg md:shadow-sm`,children:c.jsxs("div",{className:"h-14 lg:px-3 px-2 w-full max-w-[1920px] flex flex-row justify-between transition-all",children:[c.jsxs("div",{className:"flex flex-row items-center flex-grow gap-5 mr-5",children:[c.jsx("div",{className:"w-sidebar hidden xl:flex justify-center",children:c.jsx(Qw,{href:"/",children:c.jsx(lE,{className:"h-9 hover:scale-105 hover:brightness-110"})})}),c.jsx(Qw,{href:"/",className:"hidden sm:max-xl:block",children:c.jsx(X7e,{className:"h-8 w-8 lg:h-10 lg:w-10 hover:scale-105 hover:brightness-110"})}),c.jsx("div",{className:"lg:hidden",children:c.jsx(J7e,{})}),c.jsx("nav",{className:"hidden lg:block flex-grow",children:c.jsx(G7e,{})})]}),c.jsxs("div",{className:"flex flex-row items-center gap-2 sm:gap-3",children:[c.jsx(Q7e,{className:"lg:hidden"}),c.jsx(Z7e,{className:"lg:hidden"}),c.jsx(eOe,{className:"xl:hidden"}),c.jsx(tOe,{})]})]})})}function rOe(){return nt(TD)}function iOe({txConfigState:e}){const[t]=zs(),[n,r]=w.useState(""),i=w.useRef("");return w.useEffect(()=>{let s="";if(e===As.Setup&&!t.startsWith("/server/setup")?(s="/server/setup",i.current="Go to the setup page!"):e===As.Deployer&&!t.startsWith("/server/deployer")?(s="/server/deployer",i.current="Go to the deployer page!"):s="",s){const a=setTimeout(()=>{r(s)},500);return()=>clearTimeout(a)}else{r("");return}},[t,e]),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[c.jsx(XD,{className:"h-12 w-12 opacity-75 animate-pulse"}),c.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 it."}),n?c.jsx(pn,{href:n,className:"animate-toastbar-enter",children:i.current}):c.jsx(pn,{href:"#",className:"animate-toastbar-leave pointer-events-none",children:i.current||c.jsx(c.Fragment,{children:" "})})]})}function sOe(){const e=nt(dS),{hasPerm:t}=Xn(),n=e!==As.Ready;return c.jsxs("div",{className:"relative",children:[n&&c.jsx(iOe,{txConfigState:e}),c.jsxs("div",{className:Y(n&&"opacity-0 pointer-events-none"),children:[c.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight line-clamp-1",children:c.jsx(rOe,{})}),c.jsxs("div",{className:"space-y-1 select-none",children:[c.jsxs(zn,{href:"/",children:[c.jsx(RX,{className:"mr-2 h-4 w-4"}),"Dashboard"]}),c.jsxs(zn,{href:"/server/console",disabled:!t("console.view"),children:[c.jsx(YX,{className:"mr-2 h-4 w-4"}),"Live Console"]}),c.jsxs(zn,{href:"/server/resources",children:[c.jsx(VD,{className:"mr-2 h-4 w-4"}),"Resources"]}),c.jsxs(zn,{href:"/server/server-log",disabled:!t("server.log.view"),children:[c.jsx(bX,{className:"mr-2 h-4 w-4"}),"Server Log"]}),c.jsxs(zn,{href:"/server/cfg-editor",disabled:!t("server.cfg.editor"),children:[c.jsx(wX,{className:"mr-2 h-4 w-4"}),"CFG Editor"]}),window.txConsts.showAdvanced&&c.jsxs(zn,{href:"/advanced",className:"text-accent",disabled:!t("all_permisisons"),children:[c.jsx(xX,{className:"mr-2 h-4 w-4"}),"Advanced"]}),!1]})]})]})}function oOe({style:e}){return c.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:c.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 aOe({style:e}){return c.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:c.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 ad=si(`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 lOe(){const e=nt(dS),t=nt(AD),n=Yv(),r=af(),i=Jv(),{hasPerm:s}=Xn(),a=bt({method:"POST",path:"/fxserver/controls"}),o=bt({method:"POST",path:"/fxserver/commands"}),l=x=>{const v={start:"Starting server",stop:"Stopping server",restart:"Restarting server"},m=`${v[x]}...`,p=()=>{i(),a({data:{action:x},toastLoadingMessage:m,timeout:xh.LONG})};x==="start"?p():n({title:v[x],message:`Are you sure you want to ${x} the server?`,onConfirm:p})},u=()=>{l(t.isIdle?"start":"stop")},h=()=>{t.isChildAlive&&l("restart")},d=()=>{t.isChildAlive&&r({title:"Send Announcement",message:"Type the message to be broadcasted to all players.",placeholder:"announcement message",submitLabel:"Send",required:!0,onSubmit:x=>{i(),o({data:{action:"admin_broadcast",parameter:x},toastLoadingMessage:"Sending announcement..."})}})},f=()=>{t.isChildAlive&&r({title:"Kick All Players",message:"Type the kick reason or leave it blank (press enter)",placeholder:"kick reason",submitLabel:"Send",onSubmit:x=>{i(),o({data:{action:"kick_all",parameter:x},toastLoadingMessage:"Kicking players..."})}})},g=s("control.server"),b=s("announcement");return e!==As.Ready?c.jsx("div",{className:"w-full h-8 text-center tracking-wider font-light opacity-75",children:"Server not configured."}):c.jsxs("div",{className:"flex flex-row justify-between gap-2",children:[c.jsxs(Xr,{children:[c.jsx(Jr,{asChild:!0,children:t.isIdle?c.jsxs("div",{className:"relative flex flex-grow inset-0",children:[c.jsx("div",{className:"absolute inset-0 bg-success animate-pulse rounded blur-sm"}),c.jsx("button",{onClick:u,className:Y(ad({type:"success"}),"relative"),disabled:!g,children:c.jsx(HX,{className:"h-5"})})]}):c.jsx("button",{onClick:u,className:ad({type:"destructive"}),disabled:!g,children:c.jsx(zX,{className:"h-5"})})}),c.jsx(Mr,{className:Y(!g&&"text-destructive-inline text-center"),children:g?c.jsx("p",{children:t.isIdle?"Start the server! 🚀":"Stop the server"}):c.jsxs("p",{children:["You do not have permission ",c.jsx("br",{}),"to control the server."]})})]}),c.jsxs(Xr,{children:[c.jsx(Jr,{asChild:!0,children:c.jsx("button",{onClick:h,className:Y(ad({type:"warning"})),disabled:!g||!t.isChildAlive,children:c.jsx(i_,{className:"h-5"})})}),c.jsx(Mr,{className:Y(!g&&"text-destructive-inline text-center"),children:g?c.jsx("p",{children:"Restart Server"}):c.jsxs("p",{children:["You do not have permission ",c.jsx("br",{}),"to control the server."]})})]}),c.jsxs(Xr,{children:[c.jsx(Jr,{asChild:!0,children:c.jsx("button",{onClick:f,className:ad(),disabled:!g||!t.isChildAlive,children:c.jsx(oOe,{style:{height:"1.25rem",width:"1.5rem",fill:"currentcolor"}})})}),c.jsx(Mr,{className:Y(!g&&"text-destructive-inline text-center"),children:g?c.jsx("p",{children:"Kick All Players"}):c.jsxs("p",{children:["You do not have permission ",c.jsx("br",{}),"to control the server."]})})]}),c.jsxs(Xr,{children:[c.jsx(Jr,{asChild:!0,children:c.jsx("button",{onClick:d,className:ad(),disabled:!b||!t.isChildAlive,children:c.jsx(DX,{className:"h-5"})})}),c.jsx(Mr,{className:Y(!b&&"text-destructive-inline text-center"),children:b?c.jsx("p",{children:"Send Announcement"}):c.jsxs("p",{children:["You do not have permission ",c.jsx("br",{}),"to send an Announcement."]})})]})]})}const ej=si("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 Xp({children:e,tooltip:t,type:n}){return t?c.jsxs(Xr,{children:[c.jsx(Jr,{asChild:!0,children:c.jsx("span",{className:ej({type:n}),children:e})}),c.jsx(Mr,{side:"right",children:typeof t=="string"?c.jsx("p",{children:t}):c.jsxs(c.Fragment,{children:[c.jsx("h3",{children:t.title}),c.jsx("p",{className:Y("text-xs tracking-wider text-muted-foreground whitespace-pre-wrap",n==="warning"&&"text-warning-inline"),children:t.description})]})})]}):c.jsx("span",{className:ej({type:n}),children:e})}const Jp={[md.Disabled]:{text:"DISABLED",color:"default",description:"Discord bot is disabled."},[md.Starting]:{text:"STARTING",color:"warning",description:"Discord bot is starting."},[md.Ready]:{text:"READY",color:"default",description:"Discord bot is ready."},[md.Error]:{text:"ERROR",color:"destructive",description:"Discord bot is in an error state."}};function cOe(){const e=RD();let t="--",n="--",r="--",i="default",s="--",a="--",o="--",l="--",u="default",h="--",d="--",f="default";return e&&(e.server.uptime>0&&(s=hf(e.server.uptime,{units:["d","h","m"],delimiter:" "}),a="Time since the server came online."),t=e.server.health,r=e.server.healthReason,e.server.health===sc.ONLINE?(i="success",n="Resources running, accepting connections."):e.server.health===sc.PARTIAL?(i="warning",n="Resources not running or not accepting connections."):e.server.health===sc.OFFLINE?(i="destructive",n="Server is offline."):(i="destructive",n="Unknown server status."),e.server.whitelist==="disabled"?(o="DISABLED",l="Anyone can join."):e.server.whitelist==="adminOnly"?(o="ADMIN",u="warning",l="Only admins can join."):e.server.whitelist==="discordMember"?(o="MEMBER",l="Only Discord server members can join."):e.server.whitelist==="discordRoles"?(o="ROLES",l="Only Discord server members with the specified roles can join."):e.server.whitelist==="approvedLicense"?(o="LICENSE",l="Only players with an approved license can join."):e.server.whitelist==="external"&&(o="EXTERNAL",l="Player joins are handled by an external resource."),e.discord in Jp?(h=Jp[e.discord].text,f=Jp[e.discord].color,d=Jp[e.discord].description):(h=`CODE-${e.discord}`,f="destructive",d="Unknown status code")),c.jsxs("div",{className:"flex flex-col gap-[0.375rem]",children:[c.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Server:",c.jsx(Xp,{tooltip:{title:n,description:r},type:i,children:t})]}),c.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Uptime:",c.jsx(Xp,{tooltip:a,children:s})]}),c.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Allowlist:",c.jsx(Xp,{tooltip:l,type:u,children:o})]}),c.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Discord Bot:",c.jsx(Xp,{tooltip:d,type:f,children:h})]})]})}const dW=Intl.DateTimeFormat().resolvedOptions().timeZone,uOe=c.jsxs("p",{className:"text-destructive",children:["Server's timezone: ",c.jsx("b",{children:window.txConsts.serverTimezone})," ",c.jsx("br",{}),"Your timezone: ",c.jsx("b",{children:dW})," ",c.jsx("br",{}),"Either use relative times, or make sure the scheduled is based on the server timezone."]}),tj={suggestions:["+5","+10","+15","+30"],title:"When should the server restart?",message:c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["Possible formats: ",c.jsx("br",{}),c.jsxs("ul",{className:"list-disc ml-4",children:[c.jsxs("li",{children:[c.jsx(Be,{children:"+MM"})," relative time in minutes (example: ",c.jsx(Be,{children:"+15"})," for 15 minutes from now.)"]}),c.jsxs("li",{children:[c.jsx(Be,{children:"HH:MM"})," absolute 24-hour time (example: ",c.jsx(Be,{children:"23:30"})," for 11:30 PM.)"]})]})]}),dW!==window.txConsts.serverTimezone&&uOe]}),placeholder:"+15",required:!0,isWide:!0},dOe=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 hOe(){const e=Jv(),t=af(),{hasPerm:n}=Xn(),r=bt({method:"POST",path:"/fxserver/schedule"}),i=RD();if(!i)return c.jsxs("div",{children:[c.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),c.jsx("span",{className:"font-light text-muted-foreground italic",children:"loading..."})]});const{scheduler:s}=i;let a="nothing scheduled",o="text-muted-foreground italic",l=!1,u=!1,h=!1;const d=typeof s.nextRelativeMs=="number";if(d){const p=s.nextIsTemp?"(temp)":"",y=Sg(s.nextRelativeMs,{units:["h","m"]}),_=s.nextRelativeMs<6e4;_?(l=!0,a=`right now ${p}`):a=`in ${y} ${p}`,s.nextSkip?(o="text-muted-foreground line-through",_||(h=!0)):(o="text-warning-inline",_||(u=!0))}const f=p=>{if(e(),p.includes(",")){ze.error({title:"Invalid scheduled restart time.",msg:`It looks like you are trying to schedule multiple restart times, which can only be done in the Settings page.
This input is for just the next (not persistent) restart.`},{duration:1e4});return}if(!dOe(p)){ze.error(`Invalid schedule time: ${p}`);return}r({data:{action:"setNextTempSchedule",parameter:p},toastLoadingMessage:"Scheduling server restart..."})},g=()=>{t({...tj,onSubmit:f,submitLabel:"Edit"})},b=()=>{t({...tj,onSubmit:f,submitLabel:"Schedule"})},x=()=>{e(),r({data:{action:"setNextSkip",parameter:!0},toastLoadingMessage:"Cancelling next server restart..."})},v=()=>{e(),r({data:{action:"setNextSkip",parameter:!1},toastLoadingMessage:"Enabling next server restart..."})},m=n("control.server");return c.jsxs("div",{children:[c.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),c.jsx("span",{className:Y("font-light",o),children:a}),c.jsxs("div",{className:"flex flex-row justify-between gap-2 mt-2 flex-wrap",children:[d?c.jsxs(Re,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!m||l,onClick:g,children:[c.jsx($X,{className:"h-4 w-4 mr-1"})," Edit"]}):c.jsxs(Re,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!m||l,onClick:b,children:[c.jsx(uX,{className:"h-4 w-4 mr-1"})," Schedule Restart"]}),u&&c.jsxs(Re,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",onClick:x,disabled:!m,children:[c.jsx(dX,{className:"h-4 w-4 mr-1"})," Cancel"]}),h&&c.jsxs(Re,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border",onClick:v,disabled:!m,children:[c.jsx(cX,{className:"h-4 w-4 mr-1"})," Enable"]})]})]})}const fOe=e=>{const t=[{name:"gportal",link:"https://www.g-portal.com/FiveM"},{name:"nitrado",link:"https://server.nitrado.net/offers/fivem"},{name:"nodecraft",link:"https://nodecraft.com/r/fivem"},{name:"shockbyte",link:"https://shockbyte.com/partner/FIVEM"},{name:"xrealm",link:"https://xrealm.com/en/gameserver/fivem-server-hosting"},{name:"zaphosting",link:"https://zap-hosting.com/fivem2"}];let n=t[Math.floor(Math.random()*t.length)],r=!1;if(window.txConsts.providerName){const s=window.txConsts.providerName.toLowerCase().replace(/[^a-z0-9]+/g,""),a=t.find(o=>o.name===s);a&&(n=a,r=!0)}const i=new URL(n.link);return i.searchParams.set("utm_source","txadmin"),i.searchParams.set("utm_medium",r?"customer":"advert"),i.searchParams.set("utm_content",e),{name:n.name,link:i.toString()}};function hW({placement:e}){const[t]=w.useState(()=>fOe(e)),n=e==="login",r=n?"192x64":"256x80",i=window.txConsts.isWebInterface?"":"nui://monitor/web/public/";return c.jsxs("a",{href:t.link,onClick:ZS,target:"_blank",className:Y("relative self-center group shadow-sm","brightness-125 opacity-80 hover:opacity-100","dark:brightness-100 dark:hover:brightness-125",n?"w-48 h-16":"w-sidebar h-[80px]"),children:[c.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]"}),c.jsx("img",{className:Y("rounded-lg hover:outline outline-2 m-auto hover:saturate-150",n?"max-w-48 max-h-16":"max-w-sidebar max-h-[80px]"),src:`${i}/img/advert-${t.name}-${r}.png`})]})}function fW({isSheet:e}){return c.jsxs("aside",{className:Y("flex flex-col gap-4 z-10",e?"px-4 py-6":"tx-sidebar hidden lg:flex"),children:[c.jsx("div",{className:Y(!e&&"rounded-xl border bg-card text-card-foreground shadow-sm p-4"),children:c.jsx(sOe,{})}),c.jsx("hr",{className:e?"block":"hidden"}),c.jsxs("div",{className:Y(!e&&"rounded-xl border bg-card text-card-foreground shadow-sm p-4","flex flex-col gap-4"),children:[c.jsx(lOe,{}),c.jsx(cOe,{}),c.jsx(hOe,{})]}),c.jsx("hr",{className:e?"block":"hidden"}),c.jsx(hW,{placement:"sidebar"}),window.txConsts.isWebInterface?c.jsx("div",{className:"flex flex-col items-center justify-center gap-1 text-sm font-light opacity-85 hover:opacity-100",children:c.jsxs("span",{className:Y("text-muted-foreground",window.txConsts.txaVersion.includes("-")&&"text-destructive-inline font-semibold"),children:["tx: ",c.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",c.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]})}):null]})}function pOe(){const t=nt(qv).toLocaleString("en-US");return c.jsxs("div",{className:"w-full flex justify-between items-center",children:[c.jsx("div",{className:"w-16 h-16 dark:bg-zinc-600/50 bg-zinc-300/75 rounded-full flex items-center justify-center",children:c.jsx(MS,{className:"w-10 h-10 dark:text-zinc-400 text-zinc-500 text-opacity-80 stroke-1"})}),c.jsxs("div",{className:"flex flex-col items-end",children:[c.jsx("div",{className:"text-4xl font-mono font-extralight",children:t}),c.jsx("div",{className:"opacity-80 text-lg font-light tracking-wider",children:"Players"})]})]})}const mOe=new Set([9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]),nj=(e,t=35)=>{const n=[...e].map(s=>(s.codePointAt(0)??0).toString(16)),r=[];let i=0;for(let s=0;s<n.length;s++)if(!r.includes(n[s])){if(i+n[s].length>t)break;r.push(n[s]),i+=n[s].length+1}return r},gOe=e=>{const t=e.codePointAt(0);return t>=127744&&t<=128511||t>=128512&&t<=128591||t>=128640&&t<=128767||t>=128768&&t<=128895||t>=128896&&t<=129023||t>=129024&&t<=129279||t>=129280&&t<=129535||t>=129536&&t<=129647||t>=129648&&t<=129791||t>=9728&&t<=9983||t>=9984&&t<=10175},vOe=(e,t=36)=>{let n="",r="",i=0,s="",a=0;const o=[...e];for(let l=0;l<o.length&&!(a>=t);l++){const u=o[l],h=u.codePointAt(0),d=mOe.has(h);if(!n.length&&d)continue;const f=u===r;if(f&&i>=(d?1:3))continue;let g=!1;if(d&&!((h===65038||h===65039)&&gOe(r))){s||(s=u,g=!0);continue}if(!g&&s){if(a>=t-1)break;n+=s,a++,s=""}r=u,i=f?i+1:1,n+=u,a++}return n},rj=String.fromCodePoint(8709,8203),xOe=e=>{if(!e)return{displayName:rj+"EMPTY NAME",displayNameEmpty:!0,pureName:"emptyname",pureNameEmpty:!0};const t=[o=>o.substring(0,128),o=>o.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,""),o=>o.replace(/\^\d/ig,""),o=>o.replace(/[\p{Control}\u200E\u2067]/ug,""),o=>o.replace(/[\uA980-\uA9DF\u239B-\u23AD\u534D\u5350\u1000-\u109F\u0B80-\u0BFF\uFDFD\u2E3B]/ug,""),o=>o.replace(/[\u{12000}-\u{123FF}\u{12400}-\u{1247F}\u{12480}-\u{1254F}\u{1D000}-\u{1D0FF}]/gu,""),o=>o.replace(new RegExp("(^\\p{Nonspacing_Mark}+)|(\\p{Nonspacing_Mark}{3,})","ug"),(l,u,h)=>{if(u)return"";if(h)return h.substring(0,2)}),vOe];let n=e;for(const o of t){const l=o(n);if(l.length)n=l;else{const u=nj(n);return{displayName:`${rj}${u.join(" ").toUpperCase()}`,displayNameEmpty:!0,pureName:u.join(""),pureNameEmpty:!0}}}const r=n,i=[o=>o.normalize("NFKC"),o=>o.replace(/[^\p{Letter}\p{Number}]/gu,""),o=>o.toLocaleLowerCase()];let s=n;for(const o of i){const l=o(s);if(l.length)s=l;else{const u=nj(s);return{displayName:r,displayNameEmpty:!1,pureName:u.join(""),pureNameEmpty:!0}}}return{displayName:r,displayNameEmpty:!1,pureName:s,pureNameEmpty:!1}};function yOe({filterString:e,setFilterString:t}){const n=w.useRef(null);return Ei("message",r=>{var i;r.data.type==="globalHotkey"&&r.data.action==="focusPlayerlistFilter"&&((i=n.current)==null||i.focus())}),c.jsx("div",{className:"pt-2 px-2 flex gap-2",children:c.jsxs("div",{className:"relative w-full",children:[c.jsx(yt,{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?c.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:c.jsx(Kn,{})}):c.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:c.jsx(Be,{className:"text-xs tracking-wide",children:"ctrl+k"})})]})})}const bOe=w.memo(yOe);function _Oe({virtualItem:e,player:t,modalOpener:n}){return c.jsxs("div",{className:"player",style:{height:`${e.size}px`,transform:`translateY(${e.start}px)`},onClick:()=>n(t.netid),children:[c.jsx("div",{className:"pid-block leading-[1.7]",children:c.jsx("span",{className:"pid-badge",children:t.netid})}),c.jsx("span",{className:"pname",children:t.displayName})]})}function wOe(){const e=nt(gS),t=nt(MD),n=l0(),r=w.useRef(null),[i,s]=w.useState(""),a=w.useMemo(()=>{const d=xOe(i).pureName;return d!=="emptyname"?e.filter(f=>f.pureName.includes(d)||f.netid.toString().includes(d)):e},[e,i]),o=w.useMemo(()=>{var g;const d=((g=e.at(-1))==null?void 0:g.netid)??0;return`.tx-playerlist .player .pid-block { min-width: ${Math.floor(Math.log10(d))+1+1}ch; }`},[e]),l=qC({isScrollingResetDelay:0,count:a.length,getScrollElement:()=>{var d;return(d=r.current)==null?void 0:d.getElementsByTagName("div")[0]},estimateSize:()=>30,overscan:15}),u=l.getVirtualItems(),h=d=>{t&&n({mutex:t,netid:d})};return c.jsxs(c.Fragment,{children:[c.jsx(bOe,{filterString:i,setFilterString:s}),c.jsxs("div",{className:Y("text-center m-1 text-warning-inline tracking-wider italic text-xs",a.length!==e.length&&u.length?"block":"hidden"),children:["Showing ",a.length," of ",e.length," players."]}),c.jsx("div",{className:Y("text-center m-6 text-muted-foreground tracking-wider italic",u.length?"hidden":"block"),children:e.length&&i?c.jsxs("p",{children:["No players to show.",c.jsx("span",{className:"text-xs block opacity-75",children:"Clear the filter to show all players."})]}):c.jsxs("p",{children:["No players online.",c.jsx("span",{className:"text-xs block opacity-75",children:"Invite some friends to join in!"})]})}),c.jsx("style",{children:o}),c.jsx(ii,{className:"h-full select-none",ref:r,children:c.jsx("div",{className:"tx-playerlist",style:{height:`${l.getTotalSize()}px`,width:"100%",position:"relative"},children:u.map(d=>c.jsx(_Oe,{virtualItem:d,player:a[d.index],modalOpener:h},d.key))})})]})}function pW({isSheet:e}){return c.jsxs("aside",{className:Y("flex flex-col z-10",e?"w-full h-screen":"tx-sidebar hidden xl:flex gap-4 h-contentvh"),children:[c.jsx("div",{className:Y("text-card-foreground shrink-0 p-4",e?"pr-12 border-b":"rounded-xl border bg-card"),children:c.jsx(pOe,{})}),c.jsx("div",{className:Y("flex flex-col gap-2 flex-grow overflow-hidden",!e&&"min-h-[480px] rounded-xl border bg-card text-card-foreground shadow-sm"),children:c.jsx(wOe,{})})]})}const uE=ZC,SOe=ek,mW=w.forwardRef(({className:e,...t},n)=>c.jsx(kf,{className:Y("fixed inset-0 z-50 bg-black/80  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}));mW.displayName=kf.displayName;const COe=si("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"}}),tx=w.forwardRef(({side:e="right",className:t,children:n,...r},i)=>c.jsxs(SOe,{children:[c.jsx(mW,{}),c.jsxs(Ef,{ref:i,className:Y(COe({side:e}),t),...r,children:[n,c.jsxs(R0,{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:[c.jsx(Kn,{className:"h-8 w-8 sm:h-6 sm:w-6 md:h-4 md:w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));tx.displayName=Ef.displayName;const gW=({className:e,...t})=>c.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});gW.displayName="SheetHeader";const vW=w.forwardRef(({className:e,...t},n)=>c.jsx(Tf,{ref:n,className:Y("text-lg font-semibold text-foreground",e),...t}));vW.displayName=Tf.displayName;const kOe=w.forwardRef(({className:e,...t},n)=>c.jsx(Af,{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));kOe.displayName=Af.displayName;function EOe(){const{isSheetOpen:e,setIsSheetOpen:t}=FD(),{hasPerm:n}=Xn();return c.jsx(uE,{open:e,onOpenChange:t,children:c.jsx(tx,{side:"left",className:"p-0 flex flex-col gap-0 w-full xs:w-3/4 select-none",onOpenAutoFocus:r=>r.preventDefault(),children:c.jsxs(ii,{className:"h-full px-6 [&_svg]:shrink-0",children:[c.jsx(gW,{children:c.jsx(vW,{className:"py-6",children:c.jsx(Qw,{href:"/",children:c.jsx(lE,{className:"h-9 hover:scale-105 hover:brightness-110"})})})}),c.jsxs("div",{className:"mb-4",children:[c.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"Global Menu"}),c.jsxs("div",{className:"flex flex-wrap flex-row xs:grid grid-cols-2 gap-4",children:[c.jsxs(zn,{href:"/players",children:[c.jsx(MS,{className:"mr-2 h-4 w-4"}),"Players"]}),c.jsxs(zn,{href:"/history",children:[c.jsx(VX,{className:"mr-2 h-4 w-4"}),"History"]}),c.jsxs(zn,{href:"/insights/player-drops",children:[c.jsx(dg,{className:"mr-2 h-4 w-4"}),"Player Drops"]}),c.jsxs(zn,{href:"/allowlist",children:[c.jsx(hX,{className:"mr-2 h-4 w-4"}),"Allowlist"]}),c.jsxs(zn,{href:"/admins",disabled:!n("manage.admins"),children:[c.jsx(JX,{className:"mr-2 h-4 w-4"}),"Admins"]}),c.jsxs(zn,{href:"/settings",disabled:!n("settings.view"),children:[c.jsx(QD,{className:"mr-2 h-4 w-4"}),"Settings"]})]})]}),c.jsxs("div",{className:"mb-4",children:[c.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"System Menu"}),c.jsxs("div",{className:"flex flex-wrap flex-row xs:grid grid-cols-2 gap-4",children:[c.jsxs(zn,{href:"/system/master-actions",children:[c.jsx(aJ,{className:"mr-2 h-4 w-4"}),"Master Actions"]}),c.jsxs(zn,{href:"/system/diagnostics",children:[c.jsx(sX,{className:"mr-2 h-4 w-4"}),"Diagnostics"]}),c.jsxs(zn,{href:"/system/console-log",disabled:!n("txadmin.log.view"),children:[c.jsx(fg,{className:"mr-2 h-4 w-4"}),"Console Log"]}),c.jsxs(zn,{href:"/system/action-log",disabled:!n("txadmin.log.view"),children:[c.jsx(fg,{className:"mr-2 h-4 w-4"}),"Action Log"]})]})]})]})})})}function TOe(){const{isSheetOpen:e,setIsSheetOpen:t}=zD();return c.jsx(uE,{open:e,onOpenChange:t,children:c.jsx(tx,{side:"left",className:"w-full xs:w-3/4 p-0",onOpenAutoFocus:n=>n.preventDefault(),children:c.jsx(ii,{className:"h-full",children:c.jsx(fW,{isSheet:!0})})})})}function AOe(){const{isSheetOpen:e,setIsSheetOpen:t}=HD();return c.jsx(uE,{open:e,onOpenChange:t,children:c.jsx(tx,{side:"right",className:"w-full xs:w-3/4 p-0",onOpenAutoFocus:n=>n.preventDefault(),children:c.jsx(ii,{className:"h-full",children:c.jsx(pW,{isSheet:!0})})})})}function ROe(){return c.jsxs(c.Fragment,{children:[c.jsx(EOe,{}),c.jsx(TOe,{}),c.jsx(AOe,{})]})}const xW=Ze(!1),yW=Ze(window.txConsts.fxsOutdated),bW=Ze(window.txConsts.txaOutdated);function MOe(){const[e,t]=sr(xW),[n,r]=sr(yW),[i,s]=sr(bW);return{offlineWarning:e,setOfflineWarning:t,fxUpdateData:n,setFxUpdateData:r,txUpdateData:i,setTxUpdateData:s}}const jOe=()=>rt(xW),NOe=()=>{const e=rt(yW),t=rt(bW);return n=>{e(n.fxserver),t(n.txadmin),window.txConsts.fxsOutdated=n.fxserver,window.txConsts.txaOutdated=n.txadmin}},DOe=12*60*60*1e3,LOe=48*60*60*1e3,POe=()=>{const e=localStorage.getItem(_r.UpdateWarningPostponedTs);if(!e)return!1;const t=parseInt(e);return isNaN(t)?!1:t},OOe=e=>{const t=POe(),n=Date.now();return!t||t+(e?DOe:LOe)<n};function Jy({titleIcon:e,title:t,description:n,isImportant:r,canPostpone:i}){const[s,a]=w.useState(0),o=()=>{a(Math.random())},l=()=>{localStorage.setItem(_r.UpdateWarningPostponedTs,Date.now().toString()),o()};return w.useEffect(()=>{const u=setInterval(()=>{o()},6e4);return()=>clearInterval(u)},[]),i&&!OOe(r)?null:c.jsx("div",{className:"fixed top-navbarvh w-full flex justify-center z-40",children:c.jsxs("div",{className:Y("w-full sm:w-[28rem] min-h-9 hover:min-h-32 overflow-hidden sm:rounded-b-md","flex flex-col justify-center items-center p-1","group cursor-default transition-[height] shadow-xl",r?"bg-destructive text-destructive-foreground":"bg-info text-info-foreground"),children:[c.jsxs("h2",{className:"text-md text-center group-hover:font-medium",children:[e,t]}),c.jsxs("span",{className:"hidden group-hover:block text-center text-sm",children:[n,c.jsxs("div",{className:"flex flex-row justify-center items-center mt-3 gap-4",children:[i&&c.jsxs(Re,{size:"xs",variant:"outline",onClick:()=>l(),className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:[c.jsx(QY,{className:"h-[0.9rem] mr-1"})," Postpone"]}),c.jsx(Re,{size:"xs",variant:"outline",asChild:!0,className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:c.jsxs("a",{href:"https://discord.gg/uAmsGa2",target:"_blank",children:[c.jsx(uW,{size:"14",className:"mr-1"})," Support"]})})]})]})]})})}function IOe(){const{offlineWarning:e,txUpdateData:t,fxUpdateData:n}=MOe();return e?c.jsx(Jy,{titleIcon:c.jsx(pX,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:"Socket connection lost.",description:c.jsxs(c.Fragment,{children:["The connection to the txAdmin server has been lost. ",c.jsx("br",{}),"If you closed FXServer, please restart it."]}),isImportant:!0,canPostpone:!1}):t?c.jsx(Jy,{titleIcon:c.jsx(G3,{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?c.jsx(Jy,{titleIcon:c.jsx(G3,{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}var _W="AlertDialog",[$Oe,r9e]=Cn(_W,[jI]),Ks=jI(),wW=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ks(t);return c.jsx(ZC,{...r,...n,modal:!0})};wW.displayName=_W;var BOe="AlertDialogTrigger",FOe=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ks(n);return c.jsx(yhe,{...i,...r,ref:t})});FOe.displayName=BOe;var zOe="AlertDialogPortal",SW=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ks(t);return c.jsx(ek,{...r,...n})};SW.displayName=zOe;var HOe="AlertDialogOverlay",CW=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ks(n);return c.jsx(kf,{...i,...r,ref:t})});CW.displayName=HOe;var vc="AlertDialogContent",[WOe,UOe]=$Oe(vc),kW=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,s=Ks(n),a=w.useRef(null),o=Le(t,a),l=w.useRef(null);return c.jsx(mhe,{contentName:vc,titleName:EW,docsSlug:"alert-dialog",children:c.jsx(WOe,{scope:n,cancelRef:l,children:c.jsxs(Ef,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:ae(i.onOpenAutoFocus,u=>{var h;u.preventDefault(),(h=l.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(sS,{children:r}),c.jsx(qOe,{contentRef:a})]})})})});kW.displayName=vc;var EW="AlertDialogTitle",TW=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ks(n);return c.jsx(Tf,{...i,...r,ref:t})});TW.displayName=EW;var AW="AlertDialogDescription",RW=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ks(n);return c.jsx(Af,{...i,...r,ref:t})});RW.displayName=AW;var VOe="AlertDialogAction",MW=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ks(n);return c.jsx(R0,{...i,...r,ref:t})});MW.displayName=VOe;var jW="AlertDialogCancel",NW=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=UOe(jW,n),s=Ks(n),a=Le(t,i);return c.jsx(R0,{...s,...r,ref:a})});NW.displayName=jW;var qOe=({contentRef:e})=>{const t=`\`${vc}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${vc}\` by passing a \`${AW}\` component as a child, which also benefits sighted users by adding visible context to the dialog.

Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${vc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.

For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},GOe=wW,KOe=SW,DW=CW,LW=kW,PW=MW,OW=NW,IW=TW,$W=RW;const YOe=GOe,XOe=KOe,BW=w.forwardRef(({className:e,...t},n)=>c.jsx(DW,{className:Y("fixed inset-0 z-50 bg-black/80  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}));BW.displayName=DW.displayName;const FW=w.forwardRef(({className:e,...t},n)=>c.jsxs(XOe,{children:[c.jsx(BW,{}),c.jsx(LW,{ref:n,className:Y("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})]}));FW.displayName=LW.displayName;const zW=({className:e,...t})=>c.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});zW.displayName="AlertDialogHeader";const HW=({className:e,...t})=>c.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});HW.displayName="AlertDialogFooter";const WW=w.forwardRef(({className:e,...t},n)=>c.jsx(IW,{ref:n,className:Y("text-lg font-semibold","attempt-word-wrap",e),...t}));WW.displayName=IW.displayName;const UW=w.forwardRef(({className:e,...t},n)=>c.jsx($W,{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));UW.displayName=$W.displayName;const VW=w.forwardRef(({className:e,...t},n)=>c.jsx(PW,{ref:n,className:Y(sf(),e),...t}));VW.displayName=PW.displayName;const qW=w.forwardRef(({className:e,...t},n)=>c.jsx(OW,{ref:n,className:Y(sf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));qW.displayName=OW.displayName;function JOe(){const e=w.useRef(null),t=zY(),n=FY(),r=()=>{t.isOpen&&(n(),t.onCancel&&t.onCancel())},i=()=>{t.isOpen&&(n(),t.onConfirm())},s=o=>{o.preventDefault(),o.key==="Enter"||o.key==="NumpadEnter"?i():(o.key==="Backspace"||o.key==="Escape")&&r()},a=o=>{o||r()};return Nq(e,r),c.jsx(YOe,{open:t.isOpen,onOpenChange:a,children:c.jsxs(FW,{ref:e,onOpenAutoFocus:o=>{var l;o.preventDefault(),o.target&&"querySelector"in o.target&&typeof o.target.querySelector=="function"&&((l=o.target.querySelector("[data-autofocus]"))==null||l.focus())},children:[c.jsxs(zW,{children:[c.jsx(WW,{children:t.title}),c.jsx(UW,{children:t.message})]}),c.jsxs(HW,{children:[c.jsx(qW,{children:t.cancelLabel??"Cancel"}),c.jsx(VW,{"data-autofocus":!0,onKeyDown:s,onClick:i,className:Y(sf({variant:t.confirmBtnVariant??"destructive"})),children:t.actionLabel??"Continue"})]})]})})}function QOe(){const e=w.useRef(null),t=WY(),n=HY(),r=()=>{var o,l;if(!t.isOpen)return;n();const a=((o=e.current)==null?void 0:o.value)??((l=e.current)==null?void 0:l.textArea.value)??"";t.onSubmit(a.trim())},i=a=>{a.preventDefault(),r()},s=a=>{t.isOpen&&(a||(n(),t.onCancel&&t.onCancel()))};return c.jsx(ea,{open:t.isOpen,onOpenChange:s,children:c.jsx(Us,{className:Y(t.isWide&&"md:max-w-2xl"),children:c.jsxs("form",{onSubmit:i,className:"grid gap-4",children:[c.jsxs(Vs,{children:[c.jsx(qs,{children:t.title}),c.jsx(KI,{children:t.message})]}),t.isMultiline?c.jsx(Rf,{autoFocus:!0,ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required,minHeight:100,maxHeight:240,onChange:a=>{a.target.value=a.target.value.replace(/\n\s*/g," ").trimStart()}}):c.jsx(yt,{autoFocus:!0,ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required}),c.jsxs(du,{className:"gap-2 flex-col",children:[c.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,o)=>c.jsxs(Re,{type:"button",onClick:()=>{e.current.value=a,r()},variant:"outline",children:[c.jsx("span",{className:"sm:hidden mr-auto text-muted-foreground",children:"Suggestion:"}),a]},o))}),c.jsx(Re,{type:"submit",variant:t.submitBtnVariant??"default",children:t.submitLabel??"Submit"})]})]})})})}function ZOe(){const{authData:e,setAuthData:t}=rl(),{setAccountModalTab:n}=xS(),r=ID(),i=bt({method:"POST",path:"/auth/changePassword"}),[s,a]=w.useState(""),[o,l]=w.useState(""),[u,h]=w.useState(""),[d,f]=w.useState(""),[g,b]=w.useState(!1),x=v=>{if(v==null||v.preventDefault(),!!e){if(f(""),o.length<Tr.adminPasswordMinLength||o.length>Tr.adminPasswordMaxLength){f(`The password must be between ${Tr.adminPasswordMinLength} and ${Tr.adminPasswordMaxLength} digits long.`);return}else if(o!==u){f("The passwords do not match.");return}b(!0),i({data:{newPassword:o,oldPassword:e.isTempPassword?void 0:s},error:m=>{b(!1),f(m)},success:m=>{b(!1),"success"in m?e.isTempPassword?(n("identifiers"),t({...e,isTempPassword:!1})):(ze.success("Password changed successfully!"),r()):f(m.error)}})}};if(e)return c.jsx(ex,{value:"password",tabIndex:void 0,children:c.jsxs("form",{onSubmit:x,children:[e.isTempPassword?c.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. ",c.jsx("br",{}),c.jsx("strong",{children:"Make sure to take note of your new password before saving."})]}):c.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."}),c.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[!e.isTempPassword&&c.jsxs("div",{className:"space-y-1",children:[c.jsx(Yt,{htmlFor:"current-password",children:"Current Password"}),c.jsx(yt,{id:"current-password",placeholder:"Enter current password",type:"password",value:s,autoFocus:!0,required:!0,onChange:v=>{a(v.target.value),f("")}})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx(Yt,{htmlFor:"new-password",children:"New Password"}),c.jsx(yt,{id:"new-password",autoComplete:"new-password",placeholder:"Enter new password",type:"password",value:o,autoFocus:e.isTempPassword,required:!0,onChange:v=>{l(v.target.value),f("")}})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx(Yt,{htmlFor:"confirm-password",children:"Confirm Password"}),c.jsx(yt,{id:"confirm-password",autoComplete:"new-password",placeholder:"Repeat new password",type:"password",required:!0,onChange:v=>{h(v.target.value),f("")}})]})]}),d&&c.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:d}),c.jsx(Re,{className:"w-full",type:"submit",disabled:g,children:g?"Saving...":e.isTempPassword?"Save & Next":"Change Password"})]})})}function eIe(){const e=b8(),[t,n]=w.useState(""),[r,i]=w.useState(""),[s,a]=w.useState(""),[o,l]=w.useState(!1),u=ID(),[h,d]=w.useState(!1),f=nl("/auth/getIdentifiers",()=>e("/auth/getIdentifiers"),{revalidateOnMount:!0,revalidateOnFocus:!1});w.useEffect(()=>{f.data&&(n(f.data.cfxreId),i(f.data.discordId))},[f.data]),w.useEffect(()=>{var m;a(((m=f.error)==null?void 0:m.message)??"")},[f.error]);const g=bt({method:"POST",path:"/auth/changeIdentifiers"}),b=m=>{m==null||m.preventDefault(),a(""),d(!0),g({data:{cfxreId:t,discordId:r},error:p=>{a(p)},success:p=>{d(!1),"success"in p?(ze.success("Identifiers changed successfully!"),u()):a(p.error)}})},x=async()=>{if(!t)return;const m=t.trim();if(/^\d+$/.test(m))n(`fivem:${m}`);else if(m.startsWith("fivem:"))t!==m&&n(m);else{try{l(!0);const p=await Oo(`https://forum.cfx.re/u/${m}.json`);p.user&&typeof p.user.id=="number"?n(`fivem:${p.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)}},v=()=>{if(!r)return;const m=r.trim();/^\d+$/.test(m)?i(`discord:${m}`):r!==m&&i(m)};return c.jsx(ex,{value:"identifiers",tabIndex:void 0,children:c.jsxs("form",{onSubmit:b,children:[c.jsxs("p",{className:"text-sm text-muted-foreground",children:["The identifiers are optional for accessing the ",c.jsx("strong",{children:"Web Panel"})," but required for you to be able to use the ",c.jsx("strong",{children:"In Game Menu"})," and the ",c.jsx("strong",{children:"Discord Bot"}),". ",c.jsx("br",{}),c.jsx("strong",{children:"It is recommended that you configure at least one."})]}),c.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsxs(Yt,{htmlFor:"cfxreId",children:["FiveM identifier ",c.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),c.jsx(yt,{id:"cfxreId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"fivem:000000",value:f.isLoading||o?"loading...":t,disabled:f.isLoading||o,autoFocus:!0,onBlur:x,onChange:m=>{n(m.target.value),a("")}}),c.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. ",c.jsx("br",{}),"You can also type in your ",c.jsx(pn,{href:"https://forum.cfx.re/",children:"forum.cfx.re"})," username and it will be converted automatically. ",c.jsx("br",{}),"This is required if you want to login using the Cfx.re button."]})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs(Yt,{htmlFor:"discordId",children:["Discord identifier ",c.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),c.jsx(yt,{id:"discordId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"discord:000000000000000000",value:f.isLoading?"loading...":r,disabled:f.isLoading,onBlur:v,onChange:m=>{i(m.target.value),a("")}}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can get your Discord User ID by following ",c.jsx(pn,{href:"https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID",children:"this guide"}),". ",c.jsx("br",{}),"This is required if you want to use the Discord Bot slash commands."]})]})]}),s&&c.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:s}),c.jsx(Re,{className:"w-full",type:"submit",disabled:!f||h,children:h?"Saving...":"Save Changes"})]})})}function tIe(){const{authData:e}=rl(),{isAccountModalOpen:t,setAccountModalOpen:n,accountModalTab:r,setAccountModalTab:i}=xS();w.useEffect(()=>{e&&e.isTempPassword&&(n(!0),i("password"))},[]);const s=a=>{!a&&e&&!e.isTempPassword&&(n(!1),setTimeout(()=>{i("password")},500))};if(e)return c.jsx(ea,{open:t,onOpenChange:s,children:c.jsxs(Us,{className:"sm:max-w-lg",tabIndex:void 0,children:[c.jsx(Vs,{children:c.jsx(qs,{className:"text-2xl font-bold",children:e.isTempPassword?"Welcome to txAdmin!":`Your Account - ${e.name}`})}),c.jsxs(mH,{defaultValue:"password",value:r,onValueChange:i,children:[c.jsxs(K5,{className:"grid w-full grid-cols-2 mb-4",children:[c.jsx(xv,{value:"password",children:"Password"}),c.jsx(xv,{value:"identifiers",disabled:e.isTempPassword,children:"Identifiers"})]}),c.jsx(ZOe,{}),c.jsx(eIe,{})]})]})})}const nIe=5*60;function xc({tsFetch:e,tsObject:t,serverTime:n,className:r,isDateOnly:i,dateStyle:s,timeStyle:a}){const o=n-e,l=n-t,u=e-l,h=()=>{ze.warning(`This means that the server clock is ${Math.abs(o)} seconds ${o>0?"ahead":"behind"} your computer time. Make sure both your computer and the server have their clocks synchronized.`)},d=i?x8(u,s??"medium"):ws(u,s??"medium",a??"short");return c.jsxs("span",{className:r,title:ws(u,"long","long"),children:[d,Math.abs(o)>nIe&&c.jsx("button",{className:"ml-1 text-warning-inline",onClick:h,children:"(clock drift)"})]})}function ij({type:e,count:t}){const n=t>1?`${e}s`:e;return t===0?c.jsxs("span",{className:Y("h-max 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"]}):c.jsxs("span",{className:Y("h-max 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 sj=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function rIe({playerRef:e,player:t,refreshModalData:n}){const r=w.useRef(null),[i,s]=w.useState(t.notesLog??""),[a,o]=w.useState(sj(t.notes)),l=bt({method:"POST",path:"/player/save_note"}),u=()=>{var d;s("Saving..."),l({queryParams:e,data:{note:(d=r.current)==null?void 0:d.value.trim()},success:f=>{"error"in f?s(f.error):n()}})},h=d=>{d.key==="Enter"&&!d.shiftKey&&!window.txIsMobile?(d.preventDefault(),u()):o(sj(d.currentTarget.value))};return c.jsxs(c.Fragment,{children:[c.jsxs(Yt,{htmlFor:"playerNotes",children:["Notes: ",c.jsx("span",{className:"text-muted-foreground",children:i})]}),c.jsx(Oc,{ref:r,id:"playerNotes",className:"w-full mt-1",disabled:!t.isRegistered,defaultValue:t.notes,onChange:()=>s("Press enter to save."),onKeyDown:h,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&&c.jsx("div",{className:"mt-2 w-full",children:c.jsx(Re,{variant:"outline",size:"xs",onClick:u,disabled:!t.isRegistered,className:"w-full",children:"Save Note"})})]})}function iIe({playerRef:e,player:t,serverTime:n,tsFetch:r,setSelectedTab:i,refreshModalData:s}){const{hasPerm:a}=Xn(),o=bt({method:"POST",path:"/player/whitelist"}),l=t.sessionTime?Sg(t.sessionTime*6e4,{units:["h","m"]}):"--",u=t.tsLastConnection?c.jsx(xc,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsLastConnection,tsFetch:r,isDateOnly:!0}):"--",h=t.playTime?Sg(t.playTime*6e4,{units:["d","h","m"]}):"--",d=t.tsJoined?c.jsx(xc,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsJoined,tsFetch:r,isDateOnly:!0}):"--",f=t.tsWhitelisted?c.jsx(xc,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsWhitelisted,tsFetch:r,isDateOnly:!0}):"not yet",g=t.actionHistory.filter(m=>m.type==="ban"&&!m.revokedAt).length,b=t.actionHistory.filter(m=>m.type==="warn"&&!m.revokedAt).length,x=()=>{o({queryParams:e,data:{status:!t.tsWhitelisted},toastLoadingMessage:"Updating whitelist...",genericHandler:{successMsg:"Whitelist changed."},success:(m,p)=>{"success"in m&&s()}})},v=w.useMemo(()=>{if(!t||!n)return;let m;for(const p of t.actionHistory)if(!(p.type!=="ban"||p.revokedAt))if(p.exp)p.exp>=n&&(m=Math.max(m??0,p.exp));else return"This player is permanently banned.";if(m!==void 0)return`This player is banned until ${ws(m,"short","short")}`},[t,n]);return c.jsxs(Au,{children:[v?c.jsxs("div",{className:"w-full p-2 pr-3 mb-1 flex items-center justify-between space-x-4 rounded-lg border shadow-lg transition-all text-black/75 dark:text-white/90 border-warning/70 bg-warning-hint",children:[c.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:c.jsx(eL,{className:"size-5 text-warning"})}),c.jsx("div",{className:"flex-grow text-sm font-medium",children:v})]}):null,c.jsxs("dl",{className:"pb-2",children:[t.isConnected&&c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Session Time"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:l})]}),c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Play Time"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:h})]}),c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Join Date"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:d})]}),!t.isConnected&&c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Last Connection"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:u})]}),c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"ID Whitelisted"}),c.jsx("dd",{className:"text-sm leading-6 mt-0",children:f}),c.jsx("dd",{className:"text-right",children:c.jsx(Re,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:x,disabled:!a("players.whitelist"),children:t.tsWhitelisted?"Remove":"Add WL"})})]}),c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Sanctions"}),c.jsxs("dd",{className:"text-sm leading-6 mt-0 flex flex-wrap gap-2",children:[c.jsx(ij,{type:"Ban",count:g}),c.jsx(ij,{type:"Warn",count:b})]}),c.jsx("dd",{className:"text-right",children:c.jsx(Re,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:()=>{i("History")},children:"View"})})]})]}),c.jsx(rIe,{player:t,playerRef:e,refreshModalData:s})]})}const sIe=(e,t=4)=>{if(typeof e!="string")throw new Error("id is not a string");if(typeof t!="number"||t<3)throw new Error("numChars must be a number >= 3");const[n,r]=e.split(":",2);if(!n||!r)return e;const i=t*2+2;if(r.length<=i)return e;const s=r.slice(0,t),a=r.slice(-t);return`${n}:${s}…${a}`},oIe=()=>c.jsx("span",{className:"opacity-0",children:`
`}),oj=(e,t)=>{const n=s=>s.startsWith("license:")?0:s.startsWith("license2:")?1:2,r=n(e),i=n(t);return r===i?e.localeCompare(t):r-i},aIe=["fivem:xxxxxxx","license:xxxxxxxxxxxxxx","discord:xxxxxxxxxxxxxxxxxx","etc..."].join(`
`),lIe=["2:xxxxxxxxxxxxxx...","4:xxxxxxxxxxxxxx...","5:xxxxxxxxxxxxxx...","etc..."].join(`
`);function cIe({id:e,displayShortenedId:t,onCopy:n,isOnline:r,highlightOnline:i,isComparing:s,isMatch:a,isRemoving:o,isMarkedForRemoval:l,toggleMarkRemoval:u,disableButtons:h}){const d=!e.startsWith("license:")&&!r,f=s&&a||!s&&!i||!s&&i&&r;return c.jsxs("div",{className:"relative flex justify-between items-center gap-2 group/line",children:[c.jsxs("span",{className:Y("block px-1",f?"font-semibold opacity-100":"opacity-50",s&&a&&"text-success-inline",l&&"line-through text-destructive-inline"),title:t?e:void 0,children:[t?sIe(e,20):e,c.jsx(oIe,{})]}),o?d&&c.jsx("button",{className:"absolute right-0 top-0 h-full flex items-center bg-background hover:bg-background group/removal",onClick:u,title:l?"Undo mark for deletion":"Mark for deletion",disabled:h,children:l?c.jsx(iJ,{className:"h-4 opacity-75 group-hover:opacity-100 group-hover/removal:text-warning"}):c.jsx(Kn,{className:"h-4 opacity-75 group-hover:opacity-100 group-hover/removal:text-destructive"})}):c.jsx("button",{className:"absolute right-0 top-0 h-full flex items-center opacity-0 group-hover/line:opacity-100 bg-background hover:bg-background group/copy transition-opacity",onClick:n,title:"Copy to clipboard",disabled:h,children:c.jsx(KD,{className:"h-4 opacity-75 group-hover/copy:opacity-100 group-hover/copy:text-primary"})})]})}function uIe({hasRemoveIds:e,canRemoveIds:t,handleStartMarkRemoval:n,handleCompareIds:r,handleCopyAllIds:i,typeStr:s}){return c.jsxs(c.Fragment,{children:[e&&c.jsxs(Xr,{children:[c.jsx(Jr,{asChild:!0,children:c.jsx("button",{onClick:n,disabled:!t,children:c.jsx(iL,{className:Y("h-5 opacity-50",t?"hover:opacity-100 hover:text-primary":"opacity-35")})})}),c.jsx(Mr,{className:Y(!t&&"text-destructive-inline text-center"),children:t?c.jsx("p",{children:`Mark ${s}s for deletion.`}):c.jsxs("p",{children:["You do not have the permission ",c.jsx("br",{}),"required to remove ",s,"s"]})})]}),c.jsxs(Xr,{children:[c.jsx(Jr,{asChild:!0,children:c.jsx("button",{onClick:r,children:c.jsx(MX,{className:"h-6 opacity-50 hover:opacity-100 hover:text-primary"})})}),c.jsxs(Mr,{children:["Compare ",s,"s"]})]}),c.jsxs(Xr,{children:[c.jsx(Jr,{asChild:!0,children:c.jsx("button",{onClick:i,children:c.jsx(KD,{className:"h-5 opacity-50 hover:opacity-100 hover:text-primary"})})}),c.jsxs(Mr,{children:["Copy all ",s,"s"]})]})]})}function bv({idsOnline:e,idsOffline:t,type:n,src:r,onRemoveIds:i,canRemoveIds:s}){const a=af(),o=w.useRef(null),l=w.useRef(null),[u,h]=w.useState(null),[d,f]=w.useState(null),[g,b]=w.useState(!1),[x,v]=w.useState(!1),m=()=>{h(null),f(null),b(!1),v(!1)},p=(e==null?void 0:e.length)||t.length,y=Array.isArray(e)&&!!e.length,_=w.useMemo(()=>{const R=[];return e==null||e.slice().sort(oj).forEach(I=>{R.includes(I)||R.push(I)}),t.slice().sort(oj).forEach(I=>{R.includes(I)||R.push(I)}),R},[e,t]),C=n==="hwid",S=C?"HWID":"ID",E=R=>R===1?S:`${S}s`,k=`This ${r} has no ${S}s.`,T=Array.isArray(u),A=R=>T&&u.includes(R),M=Array.isArray(d),D=R=>M&&d.includes(R);w.useEffect(()=>{var R,I;if((R=l.current)==null||R.classList.remove("animate-toastbar-leave"),(I=l.current)==null||I.classList.add("animate-toastbar-enter"),g){const H=setTimeout(()=>{var G,Z;(G=l.current)==null||G.classList.remove("animate-toastbar-enter"),(Z=l.current)==null||Z.classList.add("animate-toastbar-leave")},2500),F=setTimeout(()=>{b(!1)},2750);return()=>{clearTimeout(H),clearTimeout(F)}}},[g,T,M]);const L=()=>{if(!p){ze.warning(`There are no ${S}s to remove.`);return}if(!t.length){ze.warning(`You can only remove ${S}s not being used by this player right now, and all the ${S}s in the list are currently being used.`);return}f([])},N=R=>{console.log(`toggleMarkRemoval(${R})`,d),M&&f(I=>I?I.includes(R)?I.filter(H=>H!==R):[...I,R]:[R])},O=()=>{!i||!M||!(d!=null&&d.length)||(b({msg:"saving...",type:"yellow"}),v(!0),i(d,()=>{v(!1),b({msg:"Error:(",type:"red"})}))},B=()=>{a({title:`Compare ${S}s`,message:c.jsxs("p",{children:["Paste in a list of ",S,"s to compare with the current list. ",c.jsx("br",{}),"Separate each ",S," with a new line or comma."]}),placeholder:C?lIe:aIe,submitLabel:"Compare",required:!0,isMultiline:!0,isWide:!0,onSubmit:R=>{const I=R.split(/[\n\s,;]+/).map(H=>H.trim()).filter(H=>H.length&&_.includes(H));h(I)}})},z=R=>{if(!o.current)throw new Error("divRef.current undefined");eD(R,o.current).then(I=>{I!==!1?b({msg:"Copied!",type:"green"}):ze.error("Failed to copy to clipboard :(")}).catch(I=>{ze.error({title:"Failed to copy to clipboard:",msg:I.message}),b({msg:"Error :(",type:"red"})})},P=()=>{if(!o.current)throw new Error("divRef.current undefined");p&&z(_.join(`\r
`))},j=R=>{if(!o.current)throw new Error("divRef.current undefined");R&&z(R)};return c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between items-center pb-1",ref:o,children:[c.jsxs("h3",{className:"text-xl",children:[C?"Hardware IDs":"Player Identifiers",T&&u.length?c.jsxs("span",{className:"ml-2 text-sm font-normal italic text-success-inline",children:["(",u.length," matches found)"]}):null]}),c.jsx("div",{className:Y("w-24 min-h-6 flex justify-end gap-2.5",!p&&"hidden"),children:g?c.jsx("span",{ref:l,className:Y("w-full text-right text-sm select-none pointer-events-none",g.type==="green"&&"text-success-inline",g.type==="yellow"&&"text-warning-inline",g.type==="red"&&"text-destructive-inline"),children:g.msg}):T?c.jsxs("span",{ref:l,onClick:m,className:Y("w-full text-right text-sm select-none cursor-pointer"),children:["Clear",c.jsx(Kn,{className:"inline h-5"})]}):M?c.jsxs("span",{ref:l,onClick:m,className:Y("w-full text-right text-sm select-none cursor-pointer"),children:["Cancel",c.jsx(Kn,{className:"inline h-5"})]}):c.jsx(uIe,{hasRemoveIds:!!i,canRemoveIds:s,handleStartMarkRemoval:L,handleCompareIds:B,handleCopyAllIds:P,typeStr:S})})]}),c.jsxs("div",{className:"relative border rounded",children:[c.jsxs("p",{className:"font-mono break-all whitespace-pre-wrap rounded-[inherit] overflow-hidden divide-y divide-border/50 text-muted-foreground text-xs leading-6 tracking-wider",children:[!p&&c.jsx("span",{className:"block px-1 opacity-50 italic",children:k}),_.map(R=>c.jsx(cIe,{id:R,displayShortenedId:C,onCopy:()=>j(R),isOnline:(e==null?void 0:e.includes(R))??!1,highlightOnline:y,isComparing:T,isMatch:A(R),isRemoving:M,isMarkedForRemoval:D(R),toggleMarkRemoval:()=>N(R),disableButtons:x},R)),M&&c.jsxs("div",{className:"px-2 py-1 flex flex-wrap justify-center xs:justify-between items-center gap-2 bg-destructive text-destructive-foreground font-sans text-xs leading-6 tracking-wider select-none",children:[c.jsx("span",{className:Y("block font-semibold my-[1px]"),children:d.length?`Permanently delete ${d.length} ${E(d.length)}?`:"Click above to mark IDs for deletion."}),c.jsx("button",{className:Y("px-1 border border-transparent hover:bg-background hover:border-background rounded-lg",d.length?"block":"hidden",x&&"opacity-50 cursor-progress"),onClick:O,title:`Confirm removal of marked ${S}s.`,disabled:x,children:x?"saving...":"Confirm & Delete"})]})]}),T&&!u.length&&c.jsx(c.Fragment,{children:c.jsx("div",{className:"absolute inset-0 dark:bg-black/25 rounded-[inherit] backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("span",{className:"text-xl tracking-wider text-warning-inline",children:["No matching ",S," found."]})})})]})]})}function dIe({playerRef:e,player:t,refreshModalData:n}){const{hasPerm:r}=Xn(),i=w.useMemo(()=>r("players.remove_ids"),[r]),s=bt({method:"POST",path:"/player/removeIds"}),a=(o,l)=>{if(!o.length)throw new Error("No IDs selected to remove.");s({queryParams:e,data:{ids:o},toastLoadingMessage:"Deleting selected IDs/HWIDs...",genericHandler:{successMsg:"Player IDs/HWIDs deleted!"},error:(u,h)=>l(),success:(u,h)=>{"success"in u?n():l()}})};return c.jsxs(Au,{className:"flex flex-col gap-4",children:[c.jsx(bv,{type:"id",src:"player",idsOnline:t.idsOnline,idsOffline:t.idsOffline,onRemoveIds:a,canRemoveIds:i}),c.jsx(bv,{type:"hwid",src:"player",idsOnline:t.hwidsOnline,idsOffline:t.hwidsOffline,onRemoveIds:a,canRemoveIds:i})]})}function hIe({action:e,serverTime:t,modalOpener:n}){let r,i,s;if(e.type==="ban"?(i="border-destructive",s=`BANNED by ${e.author}`):e.type==="warn"&&(i="border-warning",s=`WARNED by ${e.author}`),e.revokedBy){i="";const a=ws(e.revokedAt??0,"medium","short");r=`Revoked by ${e.revokedBy} on ${a}.`}else if(typeof e.exp=="number"){const a=ws(e.exp,"medium","short");r=e.exp<t?`Expired on ${a}.`:`Expires in ${a}.`}return c.jsxs("div",{onClick:()=>{n(e.id)},className:Y("pl-2 border-l-4 hover:bg-muted rounded-r-sm bg-muted/30 cursor-pointer",i),children:[c.jsxs("div",{className:"flex w-full justify-between",children:[c.jsx("strong",{className:"text-sm text-muted-foreground",children:s}),c.jsxs("small",{className:"text-right text-2xs space-x-1",children:[c.jsx(Be,{className:"tracking-widest",children:e.id}),c.jsx("span",{className:"opacity-75 cursor-help",title:ws(e.ts,"long","long"),children:ws(e.ts,"medium","short")})]})]}),c.jsx("span",{className:"text-sm",children:e.reason}),r&&c.jsx("small",{className:"block text-xs opacity-75",children:r})]})}function fIe({actionHistory:e,serverTime:t,refreshModalData:n}){const r=rC();if(!e.length)return c.jsx(Vf,{children:"No bans/warns found."});const i=a=>{r(a)},s=[...e].reverse();return c.jsx(Au,{className:"flex flex-col gap-1",children:s.map(a=>c.jsx(hIe,{action:a,serverTime:t,modalOpener:i},a.id))})}function pIe({playerRef:e,banTemplates:t}){const n=w.useRef(null),[r,i]=w.useState(!1),{hasPerm:s}=Xn(),a=tC(),o=bt({method:"POST",path:"/player/ban",throwGenericErrors:!0});if(!s("players.ban"))return c.jsx(Vf,{children:"You don't have permission to ban players."});const l=()=>{if(!n.current)return;const{reason:u,duration:h}=n.current.getData();if(!u||u.length<3){ze.warning("The reason must be at least 3 characters long."),n.current.focusReason();return}i(!0),o({queryParams:e,data:{reason:u,duration:h},toastLoadingMessage:"Banning player...",genericHandler:{successMsg:"Player banned."},finally:()=>i(!1),success:()=>a()})};return c.jsxs(Au,{className:"grid gap-4",children:[c.jsx(j9,{ref:n,banTemplates:t,disabled:r,onNavigateAway:()=>{a()}}),c.jsx("div",{className:"flex place-content-end",children:c.jsx(Re,{size:"sm",variant:"destructive",disabled:r,onClick:l,children:r?c.jsxs("span",{className:"flex items-center leading-relaxed",children:[c.jsx(qt,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})})]})}function mIe({playerRef:e,player:t}){const{hasPerm:n}=Xn(),r=af(),i=tC(),s=zs()[1],[a]=$v("/admins"),o=of(),l=Jv(),u=bt({method:"POST",path:"/player/message"}),h=bt({method:"POST",path:"/player/kick"}),d=bt({method:"POST",path:"/player/warn"}),f=m=>{"success"in m&&(i(),l())},g=()=>{if(!t)return;const m=new URLSearchParams;m.set("autofill","true"),m.set("name",t.pureName);for(const p of t.idsOnline)p.startsWith("discord:")?m.set("discord",p):p.startsWith("fivem:")&&m.set("citizenfx",p);s(`/admins?${m.toString()}`),console.log("isAlreadyInAdminPage",a),a&&o(),i(),l()},b=()=>{t&&r({title:`Direct Message ${t.displayName}`,message:"Type direct message below",placeholder:"whatever you wanna say",submitLabel:"Send",required:!0,onSubmit:m=>{u({queryParams:e,data:{message:m},genericHandler:{successMsg:"Direct message sent."},toastLoadingMessage:"Sending direct message...",success:f})}})},x=()=>{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:m=>{h({queryParams:e,data:{reason:m},genericHandler:{successMsg:"Player kicked."},toastLoadingMessage:"Kicking player...",success:f})}})},v=()=>{t&&r({title:`Warn ${t.displayName}`,message:c.jsxs("p",{children:["Type below the warn reason. ",c.jsx("br",{}),"Offline players will receive  the warning when they come back online."]}),placeholder:"The reason for the warn, rule violated, etc.",submitLabel:"Send",required:!0,onSubmit:m=>{d({queryParams:e,data:{reason:m},genericHandler:{successMsg:"Warning sent."},toastLoadingMessage:"Sending warning...",success:f})}})};return c.jsxs(du,{className:"max-w-2xl gap-2 p-2 md:p-4 border-t grid grid-cols-2 sm:flex",children:[c.jsxs(Re,{variant:"outline",size:"sm",disabled:!n("manage.admins")||!t||!t.idsOnline.length,onClick:g,className:"pl-2 sm:mr-auto",children:[c.jsx(tL,{className:"h-5 mr-1"})," Give Admin"]}),c.jsxs(Re,{variant:"outline",size:"sm",disabled:!n("players.direct_message")||!t||!t.isConnected,onClick:b,className:"pl-2",children:[c.jsx(NX,{className:"h-5 mr-1"})," DM"]}),c.jsxs(Re,{variant:"outline",size:"sm",disabled:!n("players.kick")||!t||!t.isConnected,onClick:x,className:"pl-2",children:[c.jsx(aOe,{style:{height:"1.25rem",width:"1.75rem",marginRight:"0.25rem",fill:"currentcolor"}})," Kick"]}),c.jsxs(Re,{variant:"outline",size:"sm",disabled:!n("players.warn")||!t,onClick:v,className:"pl-2",children:[c.jsx(pg,{className:"h-5 mr-1"})," Warn"]})]})}const ld=[{title:"Info",icon:c.jsx(ES,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"History",icon:c.jsx(TX,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:c.jsx(fg,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Ban",icon:c.jsx(hg,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function gIe(){const{isModalOpen:e,closeModal:t,playerRef:n}=lse(),[r,i]=w.useState(ld[0].title),[s,a]=w.useState(0),[o,l]=w.useState(void 0),[u,h]=w.useState(""),[d,f]=w.useState(0),g=bt({method:"GET",path:"/player",abortOnUnmount:!0}),b=()=>{a(s+1)};w.useEffect(()=>{n&&(l(void 0),h(""),g({queryParams:n,success:p=>{"error"in p?h(p.error):(l(p),f(Math.round(Date.now()/1e3)),!("license"in n)&&p.player.license&&a0(p.player.license))},error:p=>{h(p)}}))},[n,s]),w.useEffect(()=>{e||setTimeout(()=>{i(ld[0].title)},200)},[e]);const x=p=>{e&&!p&&t()},v=p=>{if(p.key==="ArrowUp"||p.key==="ArrowDown"){p.preventDefault();const y=ld.findIndex(S=>S.title===r),_=p.key==="ArrowUp"?y-1:y+1,C=ld[_];if(C){i(C.title);const S=document.getElementById(`player-modal-tab-${C.title}`);S&&S.focus()}}};let m;return o?o.player.netid?m=c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-success-inline font-mono mr-2",children:["[",o.player.netid,"]"]}),o.player.displayName]}):m=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-destructive-inline font-mono mr-2",children:"[OFF]"}),o.player.displayName]}):u?m=c.jsx("span",{className:"text-destructive-inline",children:"Error!"}):m=c.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."}),c.jsx(ea,{open:e,onOpenChange:x,children:c.jsxs(Us,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[c.jsx(Vs,{className:"px-4 py-3 border-b",children:c.jsx(qs,{className:"tracking-wide line-clamp-1 leading-7 break-all mr-6",children:m})}),c.jsxs(Vz,{children:[c.jsx(qz,{children:ld.map(p=>c.jsxs(Re,{id:`player-modal-tab-${p.title}`,variant:r===p.title?"secondary":"ghost",className:Y("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",p.className),onClick:()=>i(p.title),onKeyDown:v,children:[p.icon," ",p.title]},p.title))}),c.jsx(Gz,{className:"max-h-[calc(100vh-3.125rem-4rem-5rem)]",children:o?c.jsxs(c.Fragment,{children:[r==="Info"&&c.jsx(iIe,{player:o.player,playerRef:n,serverTime:o.serverTime,tsFetch:d,setSelectedTab:i,refreshModalData:b}),r==="History"&&c.jsx(fIe,{actionHistory:o.player.actionHistory,serverTime:o.serverTime,refreshModalData:b}),r==="IDs"&&c.jsx(dIe,{player:o.player,playerRef:n,refreshModalData:b}),r==="Ban"&&c.jsx(pIe,{banTemplates:o.banTemplates,playerRef:n})]}):c.jsx(Vf,{children:u?c.jsxs("span",{className:"text-destructive-inline",children:["Error: ",u]}):c.jsx(Ka,{msg:"Loading..."})})})]}),c.jsx(mIe,{playerRef:n,player:o==null?void 0:o.player})]})})}function vIe(){const e=oC(),t=zse(),n=w.useRef(0),r=jOe(),i=RY(),s=LY(),a=NOe();return w.useEffect(()=>{const o=window.txConsts.isWebInterface?["status","playerlist"]:["status"],l=iS(o);return l.on("connect",()=>{console.log("Main Socket.IO Connected."),r(!1)}),l.on("disconnect",u=>{console.log("Main Socket.IO Disonnected:",u);const h=n.current+1;n.current=h,setTimeout(()=>{n.current===h&&r(!0)},500)}),l.on("error",u=>{console.log("Main Socket.IO",u)}),l.on("logout",function(u){e("main socketio",u)}),l.on("refreshToUpdate",function(){e("main socketio","got refreshToUpdate",Mo.UPDATED)}),l.on("txAdminShuttingDown",function(){e("main socketio","got txAdminShuttingDown",Mo.SHUTDOWN)}),l.on("status",function(u){i(u)}),l.on("playerlist",function(u){window.txConsts.isWebInterface&&s(u)}),l.on("updateAvailable",function(u){a(u)}),l.on("updateAuthData",function(u){console.warn("Got updateAuthData from websocket",u),t(u)}),()=>{l.removeAllListeners(),l.disconnect(),i(null)}},[]),null}function xIe({action:e}){return c.jsxs(Au,{className:"flex flex-col gap-4",children:[c.jsx(bv,{type:"id",src:"action",idsOffline:e.ids}),c.jsx(bv,{type:"hwid",src:"action",idsOffline:"hwids"in e&&e.hwids?e.hwids:[]})]})}const yIe=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function bIe({actionReason:e}){const t=w.useRef(null),[n,r]=w.useState(yIe(e));return c.jsxs(c.Fragment,{children:[c.jsx(Yt,{htmlFor:"actionReason",children:"Reason:"}),c.jsx(Oc,{ref:t,id:"actionReason",className:"w-full mt-1",readOnly:!0,value:e,style:{height:`${1+1.25*n}rem`}})]})}function _Ie({action:e,serverTime:t,tsFetch:n}){const r=l0();let i;if(e.type==="ban")if(e.expiration===!1)i=c.jsx("span",{className:"text-destructive-inline",children:"Never"});else if(e.expiration>t){const d=Sg((t-e.expiration)*1e3,{units:["mo","w","d","h","m"]});i=c.jsxs("span",{className:"text-warning-inline",children:["In ",d]})}else i=c.jsx(xc,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.expiration,tsFetch:n});let s;e.type==="warn"&&e.acked?s=c.jsx("span",{className:"opacity-75",children:"Yes"}):s=c.jsx("span",{className:"text-warning-inline",children:"Not yet"});let a;e.revocation.timestamp?a=c.jsxs("span",{className:"text-warning-inline",children:["By ",e.revocation.author," on ",c.jsx(xc,{isDateOnly:!0,className:"cursor-help",serverTime:t,tsObject:e.revocation.timestamp,tsFetch:n})]}):a=c.jsx("span",{className:"opacity-75",children:"No"});const o=e.playerName!==!1?c.jsx("span",{children:e.playerName}):c.jsx("span",{className:"italic opacity-75",children:"unknown player"}),l=e.ids.filter(d=>d.startsWith("license:")),u=l.length===1?l[0].split(":")[1]:!1,h=()=>{u&&r({license:u})};return c.jsxs(Au,{children:[c.jsxs("dl",{className:"pb-2",children:[c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Date/Time"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:c.jsx(xc,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.timestamp,tsFetch:n})})]}),e.type==="ban"&&c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Expiration"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:i})]}),e.type==="warn"&&c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player Accepted"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:s})]}),c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Revoked"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:a})]}),c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Admin"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:e.author})]}),c.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[c.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player"}),c.jsx("dd",{className:"text-sm leading-6 col-span-2x mt-0",children:o}),c.jsx("dd",{className:"text-right",children:c.jsx(Re,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:h,disabled:!u,children:"View"})})]})]}),c.jsx(bIe,{actionReason:e.reason})]})}function wIe({action:e,refreshModalData:t}){const[n,r]=w.useState(!1),{hasPerm:i}=Xn(),s=bt({method:"POST",path:"/history/revokeAction"}),a=e.type.charAt(0).toUpperCase()+e.type.slice(1),o=()=>{r(!0),s({data:{actionId:e.id},toastLoadingMessage:`Revoking ${e.type}...`,genericHandler:{successMsg:`${a} revoked.`},success:d=>{r(!1),"success"in d&&t()}})},l=!!e.revocation.timestamp,u=i(e.type==="warn"?"players.warn":"players.ban"),h=l?`${e.type} revoked`:u?`Revoke ${a}`:"Revoke (no permission)";return c.jsx("div",{className:"flex flex-col gap-4 px-1 mb-1 md:mb-4",children:c.jsxs("div",{className:"space-y-2",children:[c.jsxs("h3",{className:"text-xl",children:["Revoke ",a]}),c.jsxs("p",{className:"text-muted-foreground text-sm",children:["This is generally done when the player successfully appeals the ",e.type," or the admin regrets issuing it.",c.jsxs("ul",{className:"list-disc list-inside pt-1",children:[e.type==="ban"&&c.jsx("li",{children:"The player will be able to rejoin the server."}),c.jsx("li",{children:"The player will not be notified of the revocation."}),c.jsxs("li",{children:["This ",e.type," will not be removed from the player history."]}),c.jsx("li",{children:"The revocation cannot be undone!"})]})]}),c.jsx(Re,{variant:"destructive",size:"xs",className:"col-start-1 col-span-full xs:col-span-3 xs:col-start-2",type:"submit",disabled:l||!u||n,onClick:o,children:n?c.jsxs("span",{className:"flex items-center leading-relaxed",children:[c.jsx(qt,{className:"inline animate-spin h-4"})," Revoking..."]}):h})]})})}const cd=[{title:"Info",icon:c.jsx(ES,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:c.jsx(fg,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Revoke",icon:c.jsx(RS,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function SIe(){const{isModalOpen:e,closeModal:t,actionRef:n}=cse(),[r,i]=w.useState(cd[0].title),[s,a]=w.useState(0),[o,l]=w.useState(void 0),[u,h]=w.useState(""),[d,f]=w.useState(0),g=bt({method:"GET",path:"/history/action",abortOnUnmount:!0}),b=()=>{a(s+1)};w.useEffect(()=>{n&&(l(void 0),h(""),g({queryParams:{id:n},success:p=>{"error"in p?h(p.error):(l(p),f(Math.round(Date.now()/1e3)))},error:p=>{h(p)}}))},[n,s]),w.useEffect(()=>{e||setTimeout(()=>{i(cd[0].title)},200)},[e]);const x=p=>{e&&!p&&t()},v=p=>{if(p.key==="ArrowUp"||p.key==="ArrowDown"){p.preventDefault();const y=cd.findIndex(S=>S.title===r),_=p.key==="ArrowUp"?y-1:y+1,C=cd[_];if(C){i(C.title);const S=document.getElementById(`action-modal-tab-${C.title}`);S&&S.focus()}}};let m;if(o){const p=o.action.playerName!==!1?c.jsx("span",{children:o.action.playerName}):c.jsx("span",{className:"italic opacity-75",children:"unknown player"});if(o.action.type==="ban")m=c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-destructive-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Banned ",p]});else if(o.action.type==="warn")m=c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-warning-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Warned ",p]});else throw new Error(`Unknown action type: ${o.action.type}`)}else u?m=c.jsx("span",{className:"text-destructive-inline",children:"Error!"}):m=c.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."});return c.jsx(ea,{open:e,onOpenChange:x,children:c.jsxs(Us,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col pb-4",children:[c.jsx(Vs,{className:"px-4 py-3 border-b",children:c.jsx(qs,{className:"tracking-wide line-clamp-1 leading-7 break-all mr-6",children:m})}),c.jsxs(Vz,{children:[c.jsx(qz,{children:cd.map(p=>c.jsxs(Re,{id:`action-modal-tab-${p.title}`,variant:r===p.title?"secondary":"ghost",className:Y("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",p.className),onClick:()=>i(p.title),onKeyDown:v,children:[p.icon," ",p.title]},p.title))}),c.jsx(Gz,{className:"max-h-[calc(100vh-3.125rem-4rem)]",children:o?c.jsxs(c.Fragment,{children:[r==="Info"&&c.jsx(_Ie,{action:o.action,serverTime:o.serverTime,tsFetch:d}),r==="IDs"&&c.jsx(xIe,{action:o.action}),r==="Revoke"&&c.jsx(wIe,{action:o.action,refreshModalData:b})]}):c.jsx(Vf,{children:u?c.jsxs("span",{className:"text-destructive-inline",children:["Error: ",u]}):c.jsx(Ka,{msg:"Loading..."})})})]})]})})}function CIe(){const e=oC(),t=BY(),n=l0(),r=rC(),i=tue();return Ei("message",s=>{s.data.type==="logoutNotice"?e("child iframe","got logoutNotice"):s.data.type==="openAccountModal"?t():s.data.type==="openPlayerModal"?n(s.data.ref):s.data.type==="navigateToPage"?X2(s.data.href):s.data.type==="globalHotkey"&&s.data.action==="toggleLightMode"&&i()}),w.useEffect(()=>{const s=new URL(window.location.toString()),a=s.searchParams.get(__),o=s.searchParams.get(w_);if(!(!a&&!o)){if(a){if(a.includes("#")){const[l,u]=a.split("#"),h=parseInt(u);if(l.length&&u.length&&!isNaN(h))return n({mutex:l,netid:h})}else if(a.length)return n({license:a})}else if(o&&o.length)return r(o);s.searchParams.delete(__),s.searchParams.delete(w_),window.history.replaceState({},"",s)}},[]),Ei("keydown",W8),c.jsx(c.Fragment,{children:c.jsxs(cPe,{delayDuration:300,disableHoverableContent:!0,children:[c.jsx(nOe,{}),c.jsxs("div",{className:"md:px-3 min-h-full pt-[var(--page-pt)] pb-[var(--page-pb)] w-full max-w-[1920px] mx-auto flex flex-row gap-4",children:[c.jsx(fW,{}),c.jsx("main",{className:"flex flex-1 min-h-contentvh min-w-[360px]",children:c.jsx(k7e,{})}),window.txConsts.isWebInterface&&c.jsx(pW,{})]}),c.jsx(ROe,{}),c.jsx(IOe,{}),c.jsx(JOe,{}),c.jsx(QOe,{}),c.jsx(Hie,{}),c.jsx(tIe,{}),c.jsx(gIe,{}),c.jsx(SIe,{}),c.jsx(vIe,{})]})})}function kIe(){const e=w.useRef(!1),{authData:t,setAuthData:n}=rl(),[r,i]=w.useState(Cg),[s,a]=w.useState(!1),o=async()=>{try{a(!0);const l=await Oo("/auth/cfxre/callback",{method:"POST",body:{redirectUri:window.location.href}});"errorCode"in l||"errorTitle"in l?i(l):n(l)}catch(l){i(pf(l))}finally{a(!1)}};return w.useEffect(()=>{if(t||e.current)return;e.current=!0;const l=Cg();if(l){i(l);return}o()},[]),r?c.jsx(ff,{error:r}):s?c.jsx(Ka,{msg:"Logging in..."}):c.jsx(Ka,{})}function EIe(){const e=w.useRef(null),[t,n]=w.useState(!1),[r,i]=w.useState(),[s,a]=w.useState(!1),[o,l]=w.useState(!1),[u,h]=w.useState(),d=async()=>{var g;try{a(!1),i(void 0),l(!0);const b=await Oo("/auth/addMaster/pin",{method:"POST",body:{pin:((g=e.current)==null?void 0:g.value)||"0000",origin:window.location.origin}});"error"in b?b.error==="master_already_set"?(n(!0),h({errorCode:b.error})):(a(!0),i(b.error)):(n(!0),console.log("Redirecting to",b.authUrl),window.location.href=b.authUrl)}catch(b){a(!0);const{errorTitle:x,errorMessage:v}=pf(b);i(`${x}: ${v}`)}finally{l(!1)}};if(w.useEffect(()=>{/^#\d{4}$/.test(window.location.hash)&&(i("Auto-filled ✔"),e.current.value=window.location.hash.substring(1))},[]),u)return c.jsx(ff,{error:u});const f=o||t;return c.jsxs("form",{onSubmit:g=>{g==null||g.preventDefault(),d()},className:"w-full",children:[c.jsxs(_s,{className:"space-y-1",children:[c.jsx(po,{className:"text-3xl",children:"No Cfx.re account linked"}),c.jsx(tD,{className:"text-base text-muted-foreground",children:"Type in the PIN from the terminal."})]}),c.jsxs(yi,{className:"grid gap-2",children:[c.jsx("span",{className:Y("text-center",s?"text-destructive":"text-success"),children:r??c.jsx(c.Fragment,{children:" "})}),c.jsx(yt,{className:Y("text-2xl text-center font-mono tracking-[0.25em] p-2",r&&(s?"border-acctext-destructive text-destructive":"border-succtext-success text-success")),id:"frm-pin",type:"text",ref:e,minLength:4,maxLength:4,placeholder:"0000",autoComplete:"off",onFocus:g=>{var b;a(!1),i(void 0),(b=g.target)==null||b.select()},onChange:g=>{g.target.value.length===4&&d()},disabled:f,required:!0})]}),c.jsx(rf,{children:c.jsxs(Re,{className:"w-full",disabled:f,children:[f&&c.jsx(qt,{className:"mr-2 h-4 w-4 animate-spin"}),"Link Account"]})})]})}var dE="Checkbox",[TIe,i9e]=Cn(dE),[AIe,RIe]=TIe(dE),GW=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:u,form:h,...d}=e,[f,g]=w.useState(null),b=Le(t,_=>g(_)),x=w.useRef(!1),v=f?h||!!f.closest("form"):!0,[m=!1,p]=Pr({prop:i,defaultProp:s,onChange:u}),y=w.useRef(m);return w.useEffect(()=>{const _=f==null?void 0:f.form;if(_){const C=()=>p(y.current);return _.addEventListener("reset",C),()=>_.removeEventListener("reset",C)}},[f,p]),c.jsxs(AIe,{scope:n,state:m,disabled:o,children:[c.jsx(Ce.button,{type:"button",role:"checkbox","aria-checked":No(m)?"mixed":m,"aria-required":a,"data-state":XW(m),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:b,onKeyDown:ae(e.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:ae(e.onClick,_=>{p(C=>No(C)?!0:!C),v&&(x.current=_.isPropagationStopped(),x.current||_.stopPropagation())})}),v&&c.jsx(MIe,{control:f,bubbles:!x.current,name:r,value:l,checked:m,required:a,disabled:o,form:h,style:{transform:"translateX(-100%)"},defaultChecked:No(s)?!1:s})]})});GW.displayName=dE;var KW="CheckboxIndicator",YW=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=RIe(KW,n);return c.jsx(on,{present:r||No(s.state)||s.state===!0,children:c.jsx(Ce.span,{"data-state":XW(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});YW.displayName=KW;var MIe=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...s}=e,a=w.useRef(null),o=bf(n),l=gf(t);w.useEffect(()=>{const h=a.current,d=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&g){const b=new Event("click",{bubbles:r});h.indeterminate=No(n),g.call(h,No(n)?!1:n),h.dispatchEvent(b)}},[o,n,r]);const u=w.useRef(No(n)?!1:n);return c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??u.current,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function No(e){return e==="indeterminate"}function XW(e){return No(e)?"indeterminate":e?"checked":"unchecked"}var JW=GW,jIe=YW;const QW=w.forwardRef(({className:e,...t},n)=>c.jsx(JW,{ref:n,className:Y("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:c.jsx(jIe,{className:Y("flex items-center justify-center text-current"),children:c.jsx(wS,{className:"h-4 w-4"})})}));QW.displayName=JW.displayName;function NIe({fivemId:e,fivemName:t,profilePicture:n}){const{setAuthData:r}=rl(),i=w.useRef(null),s=w.useRef(null),a=w.useRef(null),o=w.useRef(null),[l,u]=w.useState(),[h,d]=w.useState(),[f,g]=w.useState(!1),b=async(v,m)=>{try{g(!0);const p=await Oo("/auth/addMaster/save",{method:"POST",body:{discordId:m,password:v}});"error"in p?p.error==="master_already_set"?d({errorCode:p.error}):p.error==="invalid_session"?d({errorCode:p.error,returnTo:"/addMaster/pin"}):u(p.error):(window.txConsts.hasMasterAccount=!0,r(p))}catch(p){const{errorTitle:y,errorMessage:_}=pf(p);u(`${y}: ${_}`)}finally{g(!1)}},x=v=>{var C,S,E,k,T;v==null||v.preventDefault(),u(void 0);let m,p=(S=(C=i.current)==null?void 0:C.value)==null?void 0:S.trim();if(typeof p=="string"&&p.length>0){if(p.startsWith("discord:")&&(p=p.substring(8),i.current.value=p),!Tr.validIdentifierParts.discord.test(p)){u(`The Discord ID needs to be the numeric "User ID" instead of the username.
 You can also leave it blank.`);return}m=p}if(((E=o.current)==null?void 0:E.value)!=="on"){u("You MUST agree to the terms.");return}const y=((k=s.current)==null?void 0:k.value)||"",_=((T=a.current)==null?void 0:T.value)||"";if(y.length<Tr.adminPasswordMinLength||y.length>Tr.adminPasswordMaxLength){u(`The password must be between ${Tr.adminPasswordMinLength} and ${Tr.adminPasswordMaxLength} characters long.`);return}else if(y!==_){u("The passwords do not match.");return}b(y,m)};return w.useEffect(()=>{try{const v=localStorage.getItem(_r.AuthCredsAutofill);if(v){const[m,p]=JSON.parse(v);s.current.value=p??"",a.current.value=p??""}}catch(v){console.error("Passwords autofill failed",v)}},[]),h?c.jsx(ff,{error:h}):c.jsxs("form",{onSubmit:x,className:"w-full text-left",children:[c.jsxs(yi,{className:"pt-6 flex flex-col gap-4",children:[c.jsxs("div",{children:["Cfx.re account",c.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:[c.jsx(cW,{className:"h-16 w-16 text-3xl",username:t,profilePicture:n}),c.jsxs("div",{className:"text-left ml-4 overflow-hidden text-ellipsis",children:[c.jsx("span",{className:"text-2xl",children:t})," ",c.jsx("br",{}),c.jsx("code",{className:"text-muted-foreground",children:e})]})]})]}),c.jsx("input",{type:"text",name:"frm-username",className:"hidden",value:t,readOnly:!0}),c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx(Id,{htmlFor:"frm-discord",children:"Discord ID"}),c.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),c.jsx(yt,{className:"dark:placeholder:text-zinc-800",id:"frm-discord",type:"text",ref:i,placeholder:"000000000000000000",disabled:f})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx(Id,{htmlFor:"frm-password",children:"Backup Password"}),c.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",Tr.adminPasswordMinLength,"~",Tr.adminPasswordMaxLength," digits)"]})]}),c.jsx(yt,{className:"dark:placeholder:text-zinc-800",id:"frm-password",type:"password",ref:s,placeholder:"password",disabled:f,required:!0})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(Id,{htmlFor:"frm-password2",children:"Confirm Password"}),c.jsx(yt,{className:"dark:placeholder:text-zinc-800",id:"frm-password2",type:"password",ref:a,placeholder:"password",disabled:f,required:!0})]}),c.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[c.jsx(QW,{id:"terms",ref:o,required:!0}),c.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 ",c.jsx("a",{href:"https://fivem.net/terms",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Creator PLA"}),"."]})]})]}),c.jsxs(rf,{className:"flex-col gap-2",children:[c.jsx("span",{className:"text-center text-destructive whitespace-pre-wrap",children:l}),c.jsxs(Re,{className:"w-full",disabled:f,children:[f&&c.jsx(qt,{className:"mr-2 h-4 w-4 animate-spin"}),"Register"]})]})]})}function DIe(){const e=w.useRef(!1),[t,n]=w.useState(),[r,i]=w.useState(Cg),[s,a]=w.useState(!1),o=async()=>{try{a(!0);const l=await Oo("/auth/addMaster/callback",{method:"POST",body:{redirectUri:window.location.href}});"errorCode"in l||"errorTitle"in l?i(l):n(l)}catch(l){i(pf(l))}finally{a(!1)}};return w.useEffect(()=>{if(t||e.current)return;e.current=!0;const l=Cg();if(l){i(l);return}o()},[]),t?c.jsx(NIe,{...t}):r?c.jsx(ff,{error:{...r,returnTo:"/addMaster/pin"}}):s?c.jsx(Ka,{msg:"Authenticating..."}):c.jsx(Ka,{})}function Qp({children:e}){return c.jsx("div",{className:"text-center",children:e})}function LIe(){const e=nue(window.txConsts.providerLogo);return c.jsx("div",{className:"min-h-screen flex items-center justify-center pattern-dots",children:c.jsxs("div",{className:"w-full min-w-[20rem] xs:max-w-[25rem] my-4 xs:mx-4",children:[e?c.jsx("img",{className:"max-w-36 xs:max-w-56 max-h-16 xs:max-h-24 m-auto",src:e,alt:window.txConsts.providerName}):c.jsx(lE,{className:"w-36 xs:w-52 mx-auto"}),c.jsx(bs,{className:"min-h-80 mt-4 xs:mt-8 mb-4 flex items-center justify-center bg-card/40 rounded-none xs:rounded-lg",children:c.jsxs(DN,{children:[c.jsx(da,{path:"/login",children:c.jsx(ise,{})}),c.jsx(da,{path:"/login/callback",children:c.jsx(Qp,{children:c.jsx(kIe,{})})}),c.jsx(da,{path:"/addMaster/pin",children:c.jsx(Qp,{children:c.jsx(EIe,{})})}),c.jsx(da,{path:"/addMaster/callback",children:c.jsx(Qp,{children:c.jsx(DIe,{})})}),c.jsx(da,{path:"/:fullPath*",children:c.jsx(Qp,{children:c.jsx(ff,{error:{errorTitle:"404 | Not Found",errorMessage:"Something went wrong."}})})})]})}),c.jsxs("div",{className:"mx-auto flex flex-wrap gap-4 justify-center mb-2",children:[c.jsx(hW,{placement:"login"}),c.jsxs("a",{href:"https://discord.gg/uAmsGa2",onClick:ZS,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:[c.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]`}),c.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:"img/discord.png"})]})]}),c.jsxs("div",{className:"text-center text-muted-foreground text-sm font-light",children:["tx: ",c.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",c.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]})]})})}function PIe({children:e}){const{theme:t,setTheme:n}=EO();return w.useEffect(()=>{const r=s=>{const a=s.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]),c.jsx(c.Fragment,{children:e})}var hE={exports:{}};hE.exports=fE;var OIe=hE.exports.isMobile=fE;hE.exports.default=fE;const IIe=/(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,$Ie=/CrOS/,BIe=/android|ipad|playbook|silk/i;function fE(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=IIe.test(t)&&!$Ie.test(t)||!!e.tablet&&BIe.test(t);return!n&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(n=!0),n}window.txConsts.isWebInterface||(console.log=()=>{},console.info=()=>{},console.warn=()=>{},console.error=()=>{},console.debug=()=>{},console.table=()=>{},console.group=()=>{},console.groupEnd=()=>{},console.groupCollapsed=()=>{},console.time=()=>{},console.timeEnd=()=>{},console.timeLog=()=>{});try{window.txIsMobile=OIe({tablet:!0})}catch{window.txIsMobile=!1}try{window.txBrowserLocale=(window==null?void 0:window.nuiSystemLanguages)??navigator.language??"en"}catch{window.txBrowserLocale="en"}try{const e=Intl.DateTimeFormat(window.txBrowserLocale,{hour:"numeric"}).resolvedOptions().hour12;window.txBrowserHour12=e??!0}catch{window.txBrowserHour12=!0}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)}window.location.pathname==="/whitelist"&&window.history.replaceState(null,"","/allowlist");const FIe=["/login","/addMaster"],aj=e=>FIe.some(t=>e.startsWith(t));function zIe(){nt(Hse),nt(PY);const e=Bse();return w.useEffect(()=>{if(e){const n=new URLSearchParams(window.location.search).get("r");n?sse(n)?window.history.replaceState(null,"",n):window.history.replaceState(null,"","/"):aj(window.location.pathname)&&window.history.replaceState(null,"","/")}else!window.txConsts.hasMasterAccount&&!window.location.pathname.startsWith("/addMaster")?(console.log("No master account detected. Redirecting to addMaster page."),window.history.replaceState(null,"","/addMaster/pin")):aj(window.location.pathname)||(console.log("User is not authenticated. Redirecting to login page."),zd())},[e]),e?c.jsx(CIe,{}):c.jsx(LIe,{})}Qy.createRoot(document.getElementById("root")).render(c.jsx(w.StrictMode,{children:c.jsx(bj,{FallbackComponent:dY,children:c.jsx(PIe,{children:c.jsx(zIe,{})})})}));
//# sourceMappingURL=index-owz9jxb6.v800.js.map
